Files
LaDOSE/LaDOSE.Src/LaDOSE.DiscordBot/Command/Result.cs

45 lines
1.2 KiB
C#
Raw Normal View History

2018-10-04 00:29:25 +02:00
using System.Threading.Tasks;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
namespace LaDOSE.DiscordBot.Command
{
internal class Result
{
Dependencies dep;
2019-02-20 21:54:21 +01:00
public Result(Dependencies d)
2018-10-04 00:29:25 +02:00
{
this.dep = d;
}
2022-07-30 18:22:49 +02:00
//[Command("last")]
//public async Task LastAsync(CommandContext ctx)
//{
2022-07-30 18:22:49 +02:00
// var lastTournamentMessage = dep.WebService.GetLastChallonge();
// await ctx.RespondAsync(lastTournamentMessage);
//}
2018-10-04 00:29:25 +02:00
2022-07-30 18:22:49 +02:00
//[RequireRolesAttribute("Staff")]
//[Command("inscriptions")]
//public async Task InscriptionsAsync(CommandContext ctx)
//{
// await ctx.TriggerTypingAsync();
// var inscrits = dep.WebService.GetInscrits();
// await ctx.RespondAsync(inscrits);
//}
2018-10-04 20:53:36 +02:00
[RequireRolesAttribute("Staff")]
[Command("UpdateDb")]
public async Task UpdateDbAsync(CommandContext ctx)
{
await ctx.RespondAsync("Mise à jour des inscriptions en cours...");
await ctx.TriggerTypingAsync();
2018-10-04 01:32:33 +02:00
var status = dep.WebService.RefreshDb() ? "Ok" : "erreur";
2018-10-04 01:32:33 +02:00
await ctx.RespondAsync($"Status: {status}");
2018-10-04 00:29:25 +02:00
}
}
2018-10-04 00:29:25 +02:00
}