public static Task <IReadOnlyList <IWebhook> > FetchWebhooksAsync(this IMessageChannel channel,
                                                                          IRestRequestOptions options = null, CancellationToken cancellationToken = default)
        {
            var client = channel.GetRestClient();

            return(client.FetchChannelWebhooksAsync(channel.Id, options, cancellationToken));
        }
        public static IDisposable BeginTyping(this IMessageChannel channel,
                                              IRestRequestOptions options = null, CancellationToken cancellationToken = default)
        {
            var client = channel.GetRestClient();

            return(client.BeginTyping(channel.Id, options, cancellationToken));
        }
        public static Task TriggerTypingAsync(this IMessageChannel channel,
                                              IRestRequestOptions options = null, CancellationToken cancellationToken = default)
        {
            var client = channel.GetRestClient();

            return(client.TriggerTypingAsync(channel.Id, options, cancellationToken));
        }
        public static Task <IReadOnlyList <IUser> > FetchReactionsAsync(this IMessageChannel channel,
                                                                        Snowflake messageId, LocalEmoji emoji, int limit = Discord.Limits.Rest.FetchReactionsPageSize, Snowflake?startFromId = null,
                                                                        IRestRequestOptions options = null, CancellationToken cancellationToken = default)
        {
            var client = channel.GetRestClient();

            return(client.FetchReactionsAsync(channel.Id, messageId, emoji, limit, startFromId, options, cancellationToken));
        }
        public static Task <IReadOnlyList <IMessage> > FetchMessagesAsync(this IMessageChannel channel,
                                                                          int limit = Discord.Limits.Rest.FetchMessagesPageSize, RetrievalDirection direction = RetrievalDirection.Before, Snowflake?startFromId = null,
                                                                          IRestRequestOptions options = null, CancellationToken cancellationToken             = default)
        {
            var client = channel.GetRestClient();

            return(client.FetchMessagesAsync(channel.Id, limit, direction, startFromId, options, cancellationToken));
        }
        public static IPagedEnumerable <IMessage> EnumerateMessages(this IMessageChannel channel,
                                                                    int limit, RetrievalDirection direction = RetrievalDirection.Before, Snowflake?startFromId = null,
                                                                    IRestRequestOptions options             = null)
        {
            var client = channel.GetRestClient();

            return(client.EnumerateMessages(channel.Id, limit, direction, startFromId, options));
        }
        /*
         * Webhooks
         */
        public static Task <IWebhook> CreateWebhookAsync(this IMessageChannel channel,
                                                         string name, Action <CreateWebhookActionProperties> action = null,
                                                         IRestRequestOptions options = null, CancellationToken cancellationToken = default)
        {
            var client = channel.GetRestClient();

            return(client.CreateWebhookAsync(channel.Id, name, action, options, cancellationToken));
        }
        public static Task <IUserMessage> ModifyMessageAsync(this IMessageChannel channel,
                                                             Snowflake messageId, Action <ModifyMessageActionProperties> action,
                                                             IRestRequestOptions options = null, CancellationToken cancellationToken = default)
        {
            var client = channel.GetRestClient();

            return(client.ModifyMessageAsync(channel.Id, messageId, action, options, cancellationToken));
        }
        public static Task ClearReactionsAsync(this IMessageChannel channel,
                                               Snowflake messageId, LocalEmoji emoji = null,
                                               IRestRequestOptions options           = null, CancellationToken cancellationToken = default)
        {
            var client = channel.GetRestClient();

            return(client.ClearReactionsAsync(channel.Id, messageId, emoji, options, cancellationToken));
        }
        public static Task <IUserMessage> SendMessageAsync(this IMessageChannel channel,
                                                           LocalMessage message,
                                                           IRestRequestOptions options = null, CancellationToken cancellationToken = default)
        {
            var client = channel.GetRestClient();

            return(client.SendMessageAsync(channel.Id, message, options, cancellationToken));
        }
        public static Task <IMessage> FetchMessageAsync(this IMessageChannel channel,
                                                        Snowflake messageId,
                                                        IRestRequestOptions options = null, CancellationToken cancellationToken = default)
        {
            var client = channel.GetRestClient();

            return(client.FetchMessageAsync(channel.Id, messageId, options, cancellationToken));
        }
        public static IPagedEnumerable <IUser> EnumerateReactions(this IMessageChannel channel,
                                                                  Snowflake messageId, LocalEmoji emoji, int limit, Snowflake?startFromId = null,
                                                                  IRestRequestOptions options = null)
        {
            var client = channel.GetRestClient();

            return(client.EnumerateReactions(channel.Id, messageId, emoji, limit, startFromId, options));
        }
예제 #13
0
        public static Task <IUserMessage> SendMessageAsync(this IMessageChannel channel, LocalMessage message, IRestRequestOptions options = null)
        {
            var client = channel.GetRestClient();

            return(client.SendMessageAsync(channel.Id, message, options));
        }
예제 #14
0
        public static Task RemoveReactionAsync(this IMessageChannel channel, Snowflake messageId, LocalEmoji emoji, Snowflake userId, IRestRequestOptions options = null)
        {
            var client = channel.GetRestClient();

            return(client.RemoveReactionAsync(channel.Id, messageId, emoji, userId, options));
        }
예제 #15
0
        public static Task <IReadOnlyList <IMessage> > FetchMessagesAsync(this IMessageChannel channel, int limit = 100, RetrievalDirection direction = RetrievalDirection.Before, Snowflake?startFromId = null, IRestRequestOptions options = null)
        {
            var client = channel.GetRestClient();

            return(client.FetchMessagesAsync(channel.Id, limit, direction, startFromId, options));
        }
예제 #16
0
        public static Task <IMessage> FetchMessageAsync(this IMessageChannel channel, Snowflake messageId, IRestRequestOptions options = null)
        {
            var client = channel.GetRestClient();

            return(client.FetchMessageAsync(channel.Id, messageId, options));
        }
예제 #17
0
        public static Task <IReadOnlyList <IUserMessage> > FetchPinnedMessagesAsync(this IMessageChannel channel, IRestRequestOptions options = null)
        {
            var client = channel.GetRestClient();

            return(client.FetchPinnedMessagesAsync(channel.Id, options));
        }
예제 #18
0
        public static IDisposable BeginTyping(this IMessageChannel channel, IRestRequestOptions options = null)
        {
            var client = channel.GetRestClient();

            return(client.BeginTyping(channel.Id, options));
        }
예제 #19
0
        public static Task TriggerTypingAsync(this IMessageChannel channel, IRestRequestOptions options = null)
        {
            var client = channel.GetRestClient();

            return(client.TriggerTypingAsync(channel.Id, options));
        }
예제 #20
0
        public static Task <IReadOnlyList <IUser> > FetchReactionsAsync(this IMessageChannel channel, Snowflake messageId, LocalEmoji emoji, int limit = 100, Snowflake?startFromId = null, IRestRequestOptions options = null)
        {
            var client = channel.GetRestClient();

            return(client.FetchReactionsAsync(channel.Id, messageId, emoji, limit, startFromId, options));
        }
        // TODO: crosspost message

        public static Task AddReactionAsync(this IMessageChannel channel, Snowflake messageId, IEmoji emoji, IRestRequestOptions options = null)
        {
            var client = channel.GetRestClient();

            return(client.AddReactionAsync(channel.Id, messageId, emoji, options));
        }