/// <summary> /// Gets a collection of users that are interested in this event. /// </summary> /// <param name="limit">The amount of users to fetch.</param> /// <param name="options">The options to be used when sending the request.</param> /// <returns> /// A read-only collection of users. /// </returns> public Task <IReadOnlyCollection <RestUser> > GetUsersAsync(int limit = 100, RequestOptions options = null) => GuildHelper.GetEventUsersAsync(Discord, this, limit, options);
public Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null) => GuildHelper.DeleteEmoteAsync(this, Discord, emote.Id, options);
public Task <RestGuildIntegration> CreateIntegrationAsync(ulong id, string type, RequestOptions options = null) => GuildHelper.CreateIntegrationAsync(this, Discord, id, type, options);
public Task <RestRole> CreateRoleAsync(string name, GuildPermissions?permissions = default(GuildPermissions?), Color?color = default(Color?), bool isHoisted = false, RequestOptions options = null) => GuildHelper.CreateRoleAsync(this, Discord, name, permissions, color, isHoisted, options);
public Task AddBanAsync(ulong userId, int pruneDays = 0, RequestOptions options = null) => GuildHelper.AddBanAsync(this, Discord, userId, pruneDays, options);
public Task <RestVoiceChannel> CreateVoiceChannelAsync(string name, RequestOptions options = null) => GuildHelper.CreateVoiceChannelAsync(this, Discord, name, options);
//Audit logs public IAsyncEnumerable <IReadOnlyCollection <RestAuditLogEntry> > GetAuditLogsAsync(int limit, RequestOptions options = null) => GuildHelper.GetAuditLogsAsync(this, Discord, null, limit, options);
public Task ReorderRolesAsync(IEnumerable <ReorderRoleProperties> args, RequestOptions options = null) => GuildHelper.ReorderRolesAsync(this, Discord, args, options);
public Task <RestBan> GetBanAsync(ulong userId, RequestOptions options = null) => GuildHelper.GetBanAsync(this, Discord, userId, options);
public Task <RestVoiceChannel> CreateVoiceChannelAsync(string name, Action <VoiceChannelProperties> func = null, RequestOptions options = null) => GuildHelper.CreateVoiceChannelAsync(this, Discord, name, options, func);
public Task ModifyRolesAsync(IEnumerable <BulkRoleProperties> args, RequestOptions options = null) => GuildHelper.ModifyRolesAsync(this, Discord, args, options);
/// <summary> /// Gets a collection of N users interested in the event. /// </summary> /// <remarks> /// <note type="important"> /// The returned collection is an asynchronous enumerable object; one must call /// <see cref="AsyncEnumerableExtensions.FlattenAsync{T}"/> to access the individual users as a /// collection. /// </note> /// <note type="warning"> /// Do not fetch too many users at once! This may cause unwanted preemptive rate limit or even actual /// rate limit, causing your bot to freeze! /// </note> /// This method will attempt to fetch the number of users specified under <paramref name="limit"/> around /// the user <paramref name="fromUserId"/> depending on the <paramref name="dir"/>. The library will /// attempt to split up the requests according to your <paramref name="limit"/> and /// <see cref="DiscordConfig.MaxGuildEventUsersPerBatch"/>. In other words, should the user request 500 users, /// and the <see cref="Discord.DiscordConfig.MaxGuildEventUsersPerBatch"/> constant is <c>100</c>, the request will /// be split into 5 individual requests; thus returning 5 individual asynchronous responses, hence the need /// of flattening. /// </remarks> /// <param name="fromUserId">The ID of the starting user to get the users from.</param> /// <param name="dir">The direction of the users to be gotten from.</param> /// <param name="limit">The numbers of users to be gotten from.</param> /// <param name="options">The options to be used when sending the request.</param> /// <returns> /// Paged collection of users. /// </returns> public IAsyncEnumerable <IReadOnlyCollection <RestUser> > GetUsersAsync(ulong fromUserId, Direction dir, int limit = DiscordConfig.MaxGuildEventUsersPerBatch, RequestOptions options = null) => GuildHelper.GetEventUsersAsync(Discord, this, fromUserId, dir, limit, options);
/// <summary> /// Gets a collection of N users interested in the event. /// </summary> /// <remarks> /// <note type="important"> /// The returned collection is an asynchronous enumerable object; one must call /// <see cref="AsyncEnumerableExtensions.FlattenAsync{T}"/> to access the individual messages as a /// collection. /// </note> /// This method will attempt to fetch all users that are interested in the event. /// The library will attempt to split up the requests according to and <see cref="DiscordConfig.MaxGuildEventUsersPerBatch"/>. /// In other words, if there are 300 users, and the <see cref="Discord.DiscordConfig.MaxGuildEventUsersPerBatch"/> constant /// is <c>100</c>, the request will be split into 3 individual requests; thus returning 3 individual asynchronous /// responses, hence the need of flattening. /// </remarks> /// <param name="options">The options to be used when sending the request.</param> /// <returns> /// Paged collection of users. /// </returns> public IAsyncEnumerable <IReadOnlyCollection <RestUser> > GetUsersAsync(RequestOptions options = null) => GuildHelper.GetEventUsersAsync(Discord, this, null, null, options);
//General public Task DeleteAsync(RequestOptions options = null) => GuildHelper.DeleteAsync(this, Discord, options);
public Task AddBanAsync(IUser user, int pruneDays = 0, string reason = null, RequestOptions options = null) => GuildHelper.AddBanAsync(this, Discord, user.Id, pruneDays, reason, options);
public Task ModifyEmbedAsync(Action <GuildEmbedProperties> func, RequestOptions options = null) => GuildHelper.ModifyEmbedAsync(this, Discord, func, options);
//Webhooks public Task <RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null) => GuildHelper.GetWebhookAsync(this, Discord, id, options);
public Task LeaveAsync(RequestOptions options = null) => GuildHelper.LeaveAsync(this, Discord, options);
public Task <IReadOnlyCollection <RestWebhook> > GetWebhooksAsync(RequestOptions options = null) => GuildHelper.GetWebhooksAsync(this, Discord, options);
public Task RemoveBanAsync(ulong userId, RequestOptions options = null) => GuildHelper.RemoveBanAsync(this, Discord, userId, options);
//Emotes public Task <GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null) => GuildHelper.GetEmoteAsync(this, Discord, id, options);
//Integrations public Task <IReadOnlyCollection <RestGuildIntegration> > GetIntegrationsAsync(RequestOptions options = null) => GuildHelper.GetIntegrationsAsync(this, Discord, options);
public Task <GuildEmote> CreateEmoteAsync(string name, Image image, Optional <IEnumerable <IRole> > roles = default(Optional <IEnumerable <IRole> >), RequestOptions options = null) => GuildHelper.CreateEmoteAsync(this, Discord, name, image, roles, options);
//Invites public Task <IReadOnlyCollection <RestInviteMetadata> > GetInvitesAsync(RequestOptions options = null) => GuildHelper.GetInvitesAsync(this, Discord, options);
public Task <GuildEmote> ModifyEmoteAsync(GuildEmote emote, Action <EmoteProperties> func, RequestOptions options = null) => GuildHelper.ModifyEmoteAsync(this, Discord, emote.Id, func, options);
public Task <int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null) => GuildHelper.PruneUsersAsync(this, Discord, days, simulate, options);
/// <inheritdoc/> public async Task ModifyAsync(Action <GuildScheduledEventsProperties> func, RequestOptions options = null) { var model = await GuildHelper.ModifyGuildEventAsync(Discord, func, this, options).ConfigureAwait(false); Update(model); }