public Task <SocketMessage> NextMessageAsync(SocketCommandContext context, bool fromSourceUser = true, bool inSourceChannel = true, TimeSpan?timeout = null)
        {
            var criterion = new Criteria <SocketMessage>();

            if (fromSourceUser)
            {
                criterion.AddCriterion(new EnsureSourceUserCriterion());
            }
            if (inSourceChannel)
            {
                criterion.AddCriterion(new EnsureSourceChannelCriterion());
            }
            return(NextMessageAsync(context, criterion, timeout));
        }
Exemplo n.º 2
0
        public Task <CachedUserMessage> NextMessageAsync(MummyContext context,
                                                         bool fromSourceUser     = true,
                                                         bool inSourceChannel    = true,
                                                         TimeSpan?timeout        = null,
                                                         CancellationToken token = default)
        {
            var criterion = new Criteria <CachedUserMessage>();

            if (fromSourceUser)
            {
                criterion.AddCriterion(new EnsureSourceUserCriterion());
            }
            if (inSourceChannel)
            {
                criterion.AddCriterion(new EnsureSourceChannelCriterion());
            }
            return(NextMessageAsync(context, criterion, timeout, token));
        }
Exemplo n.º 3
0
        public Task <IUserMessage> PagedReplyAsync(PaginatedMessage pager, bool fromSourceUser = true)
        {
            Criteria <SocketReaction> criterion = new Criteria <SocketReaction>();

            if (fromSourceUser)
            {
                criterion.AddCriterion(new EnsureReactionFromSourceUserCriterion());
            }
            return(PagedReplyAsync(pager, criterion));
        }
        public Task <SocketMessage> NextMessageAsync(SocketCommandContext context,
                                                     bool fromSourceUser     = true,
                                                     bool inSourceChannel    = true,
                                                     TimeSpan?timeout        = null,
                                                     CancellationToken token = default(CancellationToken))
        {
            Criteria <SocketMessage> criterion = new Criteria <SocketMessage>();

            if (fromSourceUser)
            {
                criterion.AddCriterion(new EnsureSourceUserCriterion());
            }

            if (inSourceChannel)
            {
                criterion.AddCriterion(new EnsureSourceChannelCriterion());
            }

            return(NextMessageAsync(context, criterion, timeout, token));
        }
        public async Task <IUserMessage> SendMessageWithReactionCallbacksAsync(SocketCommandContext context, ReactionCallbackData callbacks, bool fromSourceUser = true)
        {
            var criterion = new Criteria <SocketReaction>();

            if (fromSourceUser)
            {
                criterion.AddCriterion(new EnsureReactionFromSourceUserCriterion());
            }
            var callback = new InlineReactionCallback(this, context, callbacks, criterion);
            await callback.DisplayAsync().ConfigureAwait(false);

            return(callback.Message);
        }