Esempio n. 1
0
            public async sealed override Task ActionOff(ActionData action, SocketReaction reaction)
            {
                var tally = (await action.GetTallyData(reaction.UserId)).Select(x => GetEmote(x)).ToArray();

                if (tally.Length == 0)
                {
                    Console.WriteLine("What th e f uck"); // Pretty sure this is also invalid
                    return;
                }
                if (tally.Contains(reaction.Emote))
                {
                    await Task.WhenAll(
                        ToggleOff(tally, reaction.Channel, reaction.Message.IsSpecified ? reaction.Message.Value : (IUserMessage)(await reaction.Channel.GetMessageAsync(reaction.MessageId)), reaction.UserId, reaction.Emote),
                        action.RemoveTally(reaction.UserId, reaction.Emote.ToString() ?? throw new ArgumentNullException("Reaction emote has null name and it hurts the soul."))
                        );
                } // Seraphina removed the reaction otherwise so it's all good?
            }