diff --git a/LaDOSE.Src/LaDOSE.DiscordBot/Command/Hokuto.cs b/LaDOSE.Src/LaDOSE.DiscordBot/Command/Hokuto.cs new file mode 100644 index 0000000..c3ae104 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DiscordBot/Command/Hokuto.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using DSharpPlus.CommandsNext; +using DSharpPlus.CommandsNext.Attributes; +using DSharpPlus.Entities; + +namespace LaDOSE.DiscordBot.Command +{ + + public class Hokuto + { + private readonly Dependencies dep; + private static List Games = new List { "2X", "3.3", "Karnov" }; + private static Random r = new Random(); + public Hokuto(Dependencies d) + { + dep = d; + } + + + //[Command("hokuto")] + //public async Task HokutoAsync(CommandContext ctx) + //{ + + // var i = r.Next(0, 3); + // await ctx.RespondAsync(ctx.User?.Mention + " : " + Games[i].ToString()); + //} + + [Command("hokuto")] + public async Task HokutoUserAsync(CommandContext ctx, params DiscordMember[] user) + { + + + var i = r.Next(0, 3); + if (user!=null && user.Length>0) + { + await ctx.RespondAsync(ctx.User?.Mention + " vs " + user[0].Mention + " : " + Games[i].ToString()); + } + else + { + await ctx.RespondAsync(ctx.User?.Mention + " : " + Games[i].ToString()); + } + + } + } +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DiscordBot/Program.cs b/LaDOSE.Src/LaDOSE.DiscordBot/Program.cs index 032293e..74c73e1 100644 --- a/LaDOSE.Src/LaDOSE.DiscordBot/Program.cs +++ b/LaDOSE.Src/LaDOSE.DiscordBot/Program.cs @@ -87,6 +87,7 @@ namespace LaDOSE.DiscordBot _cnext.RegisterCommands(); _cnext.RegisterCommands(); _cnext.RegisterCommands(); + _cnext.RegisterCommands(); //discord.MessageCreated += async e => diff --git a/LaDOSE.Src/LaDOSE.DiscordBot/Service/WebService.cs b/LaDOSE.Src/LaDOSE.DiscordBot/Service/WebService.cs index bb087c8..6826817 100644 --- a/LaDOSE.Src/LaDOSE.DiscordBot/Service/WebService.cs +++ b/LaDOSE.Src/LaDOSE.DiscordBot/Service/WebService.cs @@ -48,7 +48,7 @@ namespace LaDOSE.DiscordBot.Service var wpBookingDtos = wpEventDto.WpBookings; List player= new List(); wpBookingDtos.OrderBy(e=>e.WpUser.Name).ToList().ForEach(e=> player.Add(e.WpUser.Name)); - return $"Les Joueurs inscrits pour {wpEventDto.Name} {string.Join(", ", player)}"; + return $"Les Joueurs inscrits pour {wpEventDto.Name} {string.Join(", ", player)} + ({player?.Count})"; } public bool RefreshDb() {