//public async Task CheckReaction(SocketCommandContext context) //{ // context.Client.ReactionAdded += Client_ReactionAdded; //} //private void Client_ReactionAdded(Cacheable<IUserMessage, ulong> message, ISocketMessageChannel channel, SocketReaction reaction) //{ //// var AllReactions = message.Value.Reactions.ToList(); //// if(reaction.Emote.Name = "🛡" || AllReactions.Contains("❗") || AllReactions.Contains("💎") ) //// { //// } //} public async Task ChoosePassage(SocketCommandContext context, int id, Map m, AudioModule audio) { int time = 20000; await context.Channel.SendMessageAsync(":timer: Fermeture de la salle dans " + time / 1000 + "s"); var msg = await(m.allStructures[id] as Room).ShowIllustrationPassage(context); Console.WriteLine("Choix du passage"); if (msg != null) { JDR.passageMsgsID.Add(msg.Id); //var msg = await p.StartQCM(passageQCM.name); await msg.AddReactionAsync(new Emoji("🛡")); await msg.AddReactionAsync(new Emoji("❗")); await msg.AddReactionAsync(new Emoji("💎")); //await CheckReaction(context); await Task.Delay(time - 4000); // id + 1 car on regarde les passages à venir SelectPassageWithVotes(id + 1); var pass = (m.allStructures[id + 1] as Passages); foreach (var passage in pass.passages) { if (passage.isSelected) { if (passage.isSelectedRandomly) { await context.Channel.SendMessageAsync("Comme les aventuriers n'ont pas pu se départager, un des passages est choisi aléatoirement"); } await context.Channel.SendMessageAsync("Passage sélectionné ! : " + passage.GetName()); if (passage.GetName() == "passage Talisman") { if (JDR.map.allStructures[id + 2] != null) { (JDR.map.allStructures[id + 2] as Room).illustration.Title = ":gem: Salle au Talisman"; } } if (JDR.map.allStructures[id + 1] != null) { JDR.map.allStructures[id + 1] = passage; } } } try { audio = new AudioModule((AudioService)Program._services.GetService(typeof(AudioService)), context);; await audio.DoorCloseSFX(); } catch (Exception ex) { Console.WriteLine(ex); } await context.Channel.SendMessageAsync("En route vers le passage !"); } else { Console.WriteLine("Message nul"); } }