示例#1
0
 public Task <IReadOnlyList <RestMessage> > GetMessagesAsync(int limit = 100, RetrievalDirection direction = RetrievalDirection.Before, Snowflake?startFromId = null, RestRequestOptions options = null)
 => Client.GetMessagesAsync(Id, limit, direction, startFromId, options);
示例#2
0
 public Task <RestMessage> GetMessageAsync(Snowflake messageId, RestRequestOptions options = null)
 => Client.GetMessageAsync(Id, messageId, options);
示例#3
0
 public Task <RestUserMessage> SendMessageAsync(IEnumerable <LocalAttachment> attachments, string content = null, bool isTTS = false, LocalEmbed embed = null, LocalMentions mentions = null, RestRequestOptions options = null)
 => Client.SendMessageAsync(Id, attachments, content, isTTS, embed, mentions, options);
示例#4
0
 public RestRequestEnumerable <RestMessage> GetMessagesEnumerable(int limit, RetrievalDirection direction = RetrievalDirection.Before, Snowflake?startFromId = null, RestRequestOptions options = null)
 => Client.GetMessagesEnumerable(Id, limit, direction, startFromId, options);
示例#5
0
 public Task DeleteMessageAsync(Snowflake messageId, RestRequestOptions options = null)
 => Client.DeleteMessageAsync(Id, messageId, options);
示例#6
0
 Task IDeletable.DeleteAsync(RestRequestOptions options)
 => RevokeAsync(options);
示例#7
0
        public static Task RemoveReactionAsync(IMessage message, Snowflake memberId, IEmoji emoji, RestRequestOptions options)
        {
            if (emoji == null)
            {
                throw new ArgumentNullException(nameof(emoji));
            }

            return(message.Client.RemoveMemberReactionAsync(message.ChannelId, message.Id, memberId, emoji, options));
        }
示例#8
0
 public Task <IReadOnlyList <RestUser> > GetReactionsAsync(Snowflake messageId, IEmoji emoji, int limit = 100, Snowflake?startFromId = null, RestRequestOptions options = null)
 => Client.GetReactionsAsync(Id, messageId, emoji, limit, startFromId, options);
示例#9
0
 public Task DeleteAsync(RestRequestOptions options = null)
 => Client.DeleteRoleAsync(GuildId, Id, options);
示例#10
0
        public async Task ModifyAsync(Action <ModifyRoleProperties> action, RestRequestOptions options = null)
        {
            var model = await Client.InternalModifyRoleAsync(GuildId, Id, action, options).ConfigureAwait(false);

            Update(model);
        }
示例#11
0
 public Task UnpinAsync(RestRequestOptions options = null)
 => Client.UnpinMessageAsync(ChannelId, Id, options);
示例#12
0
        public async Task <IReadOnlyList <RestVoiceRegion> > GetVoiceRegionsAsync(RestRequestOptions options = null)
        {
            var models = await ApiClient.ListVoiceRegionsAsync(options).ConfigureAwait(false);

            return(models.ToReadOnlyList(this, (x, @this) => new RestVoiceRegion(@this, x)));
        }
示例#13
0
        public async Task <string> GetGatewayUrlAsync(RestRequestOptions options = null)
        {
            var model = await ApiClient.GetGatewayAsync(options).ConfigureAwait(false);

            return(model.Url);
        }
示例#14
0
 public Task RemoveOwnReactionAsync(Snowflake messageId, IEmoji emoji, RestRequestOptions options = null)
 => Client.RemoveOwnReactionAsync(Id, messageId, emoji, options);
示例#15
0
 public Task DeleteOverwriteAsync(Snowflake targetId, RestRequestOptions options = null)
 => Client.DeleteOverwriteAsync(Id, targetId, options);
示例#16
0
 public RestRequestEnumerable <RestUser> GetReactionsEnumerable(Snowflake messageId, IEmoji emoji, int limit, Snowflake?startFromId = null, RestRequestOptions options = null)
 => Client.GetReactionsEnumerable(Id, messageId, emoji, limit, startFromId, options);
示例#17
0
 public Task DeleteAsync(RestRequestOptions options = null)
 => Client.DeleteOrCloseChannelAsync(Id);
示例#18
0
 public Task <RestUserMessage> ModifyMessageAsync(Snowflake messageId, Action <ModifyMessageProperties> action, RestRequestOptions options = null)
 => Client.ModifyMessageAsync(Id, messageId, action, options);
示例#19
0
 public Task AddOrModifyOverwriteAsync(LocalOverwrite overwrite, RestRequestOptions options = null)
 => Client.AddOrModifyOverwriteAsync(Id, overwrite, options);
示例#20
0
 public Task <IReadOnlyList <RestUserMessage> > GetPinnedMessagesAsync(RestRequestOptions options = null)
 => Client.GetPinnedMessagesAsync(Id, options);
示例#21
0
 /// <summary>
 ///     Revokes this <see cref="RestBan"/>, unbanning the <see cref="User"/>.
 /// </summary>
 /// <param name="options"></param>
 public Task RevokeAsync(RestRequestOptions options = null)
 => Client.UnbanMemberAsync(GuildId, User.Id, options);