Exemplo n.º 1
0
 private async Task GuildHandler_ReactionAdded(Cacheable <IUserMessage, ulong> arg1, Discord.WebSocket.ISocketMessageChannel arg2, Discord.WebSocket.SocketReaction arg3)
 {
     if (arg1.Id == _book.Message.Id)
     {
         if (arg3.Emote.Name == Book.LeftArrow)
         {
             await _book.Flip(-1);
         }
         if (arg3.Emote.Name == Book.RightArrow)
         {
             await _book.Flip(1);
         }
     }
 }
Exemplo n.º 2
0
        private async Task GuildHandler_ReactionAdded(Cacheable <IUserMessage, ulong> arg1, Discord.WebSocket.ISocketMessageChannel arg2, Discord.WebSocket.SocketReaction arg3)
        {
            var message = await arg1.GetOrDownloadAsync();

            if (arg1.Id == Result.Id && message.Author.Id != arg3.UserId)
            {
                if (!_recipient.HasValue || _recipient.Value == arg3.UserId)
                {
                    QuestionOption option = _options.First(x => x.Emoji == arg3.Emote.Name);
                    if (option != null)
                    {
                        await option.OnOption();

                        Detach(_handler);
                    }
                }
            }
        }
Exemplo n.º 3
0
        private async Task GuildHandler_ReactionAdded(Cacheable <IUserMessage, ulong> arg1, Discord.WebSocket.ISocketMessageChannel arg2, Discord.WebSocket.SocketReaction arg3)
        {
            if (EnableHyperlinkReactions)
            {
                NestedDefinitionButton button = _nestedButtons.FirstOrDefault(x => x.MessageId == arg1.Id);
                if (button != null && !arg3.User.GetValueOrDefault().IsBot)
                {
                    int emoji = ReactionEmojis.ToList().IndexOf(arg3.Emote.Name);
                    if (button.Contains(emoji))
                    {
                        string word = button.Consume(emoji);
                        var    def  = await UrbanDefinition.Get(word, EnableHyperlinkReactions);

                        var msg = await arg2.SendMessageAsync(null, false, def.ToEmbed());
                        await AddNestedDefReactions(def, msg);
                    }
                }
            }
        }
 private async Task OnReactionAdded(Cacheable <IUserMessage, ulong> arg1, Discord.WebSocket.ISocketMessageChannel arg2, Discord.WebSocket.SocketReaction arg3)
 {
     if (arg1.Id == Message.Id && arg3.UserId != Tsukihi.Client.CurrentUser.Id && Emotes.ContainsValue(arg3.Emote))
     {
         await OnReactionChanged(arg3.Emote, Action.Added);
     }
 }