Fix the bots

This commit is contained in:
2022-09-14 23:29:22 +02:00
parent 8fd6c532c5
commit 3d4ff74d71
8 changed files with 172 additions and 158 deletions

View File

@@ -1,45 +1,45 @@
using System.Threading.Tasks;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
//using System.Threading.Tasks;
//using DSharpPlus.CommandsNext;
//using DSharpPlus.CommandsNext.Attributes;
namespace LaDOSE.DiscordBot.Command
{
internal class Result
{
Dependencies dep;
//namespace LaDOSE.DiscordBot.Command
//{
// internal class Result : BaseCommandModule
// {
// Dependencies dep;
public Result(Dependencies d)
{
this.dep = d;
}
// public Result(Dependencies d)
// {
// this.dep = d;
// }
//[Command("last")]
//public async Task LastAsync(CommandContext ctx)
//{
// var lastTournamentMessage = dep.WebService.GetLastChallonge();
// await ctx.RespondAsync(lastTournamentMessage);
//}
// //[Command("last")]
// //public async Task LastAsync(CommandContext ctx)
// //{
// // var lastTournamentMessage = dep.WebService.GetLastChallonge();
// // await ctx.RespondAsync(lastTournamentMessage);
// //}
//[RequireRolesAttribute("Staff")]
//[Command("inscriptions")]
//public async Task InscriptionsAsync(CommandContext ctx)
//{
// await ctx.TriggerTypingAsync();
// var inscrits = dep.WebService.GetInscrits();
// await ctx.RespondAsync(inscrits);
//}
// //[RequireRolesAttribute("Staff")]
// //[Command("inscriptions")]
// //public async Task InscriptionsAsync(CommandContext ctx)
// //{
// // await ctx.TriggerTypingAsync();
// // var inscrits = dep.WebService.GetInscrits();
// // await ctx.RespondAsync(inscrits);
// //}
[RequireRolesAttribute("Staff")]
[Command("UpdateDb")]
public async Task UpdateDbAsync(CommandContext ctx)
{
await ctx.RespondAsync("Mise à jour des inscriptions en cours...");
await ctx.TriggerTypingAsync();
// [RequireRolesAttribute(RoleCheckMode.Any,"Staff")]
// [Command("UpdateDb")]
// public async Task UpdateDbAsync(CommandContext ctx)
// {
// await ctx.RespondAsync("Mise à jour des inscriptions en cours...");
// await ctx.TriggerTypingAsync();
var status = dep.WebService.RefreshDb() ? "Ok" : "erreur";
// var status = dep.WebService.RefreshDb() ? "Ok" : "erreur";
await ctx.RespondAsync($"Status: {status}");
}
}
}
// await ctx.RespondAsync($"Status: {status}");
// }
// }
//}