/// <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);
예제 #2
0
 public Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null)
 => GuildHelper.DeleteEmoteAsync(this, Discord, emote.Id, options);
예제 #3
0
 public Task <RestGuildIntegration> CreateIntegrationAsync(ulong id, string type, RequestOptions options = null)
 => GuildHelper.CreateIntegrationAsync(this, Discord, id, type, options);
예제 #4
0
 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);
예제 #5
0
 public Task AddBanAsync(ulong userId, int pruneDays = 0, RequestOptions options = null)
 => GuildHelper.AddBanAsync(this, Discord, userId, pruneDays, options);
예제 #6
0
 public Task <RestVoiceChannel> CreateVoiceChannelAsync(string name, RequestOptions options = null)
 => GuildHelper.CreateVoiceChannelAsync(this, Discord, name, options);
예제 #7
0
 //Audit logs
 public IAsyncEnumerable <IReadOnlyCollection <RestAuditLogEntry> > GetAuditLogsAsync(int limit, RequestOptions options = null)
 => GuildHelper.GetAuditLogsAsync(this, Discord, null, limit, options);
예제 #8
0
 public Task ReorderRolesAsync(IEnumerable <ReorderRoleProperties> args, RequestOptions options = null)
 => GuildHelper.ReorderRolesAsync(this, Discord, args, options);
예제 #9
0
 public Task <RestBan> GetBanAsync(ulong userId, RequestOptions options = null)
 => GuildHelper.GetBanAsync(this, Discord, userId, options);
예제 #10
0
 public Task <RestVoiceChannel> CreateVoiceChannelAsync(string name, Action <VoiceChannelProperties> func = null, RequestOptions options = null)
 => GuildHelper.CreateVoiceChannelAsync(this, Discord, name, options, func);
예제 #11
0
 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);
예제 #14
0
 //General
 public Task DeleteAsync(RequestOptions options = null)
 => GuildHelper.DeleteAsync(this, Discord, options);
예제 #15
0
 public Task AddBanAsync(IUser user, int pruneDays = 0, string reason = null, RequestOptions options = null)
 => GuildHelper.AddBanAsync(this, Discord, user.Id, pruneDays, reason, options);
예제 #16
0
 public Task ModifyEmbedAsync(Action <GuildEmbedProperties> func, RequestOptions options = null)
 => GuildHelper.ModifyEmbedAsync(this, Discord, func, options);
예제 #17
0
 //Webhooks
 public Task <RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
 => GuildHelper.GetWebhookAsync(this, Discord, id, options);
예제 #18
0
 public Task LeaveAsync(RequestOptions options = null)
 => GuildHelper.LeaveAsync(this, Discord, options);
예제 #19
0
 public Task <IReadOnlyCollection <RestWebhook> > GetWebhooksAsync(RequestOptions options = null)
 => GuildHelper.GetWebhooksAsync(this, Discord, options);
예제 #20
0
 public Task RemoveBanAsync(ulong userId, RequestOptions options = null)
 => GuildHelper.RemoveBanAsync(this, Discord, userId, options);
예제 #21
0
 //Emotes
 public Task <GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null)
 => GuildHelper.GetEmoteAsync(this, Discord, id, options);
예제 #22
0
 //Integrations
 public Task <IReadOnlyCollection <RestGuildIntegration> > GetIntegrationsAsync(RequestOptions options = null)
 => GuildHelper.GetIntegrationsAsync(this, Discord, options);
예제 #23
0
 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);
예제 #24
0
 //Invites
 public Task <IReadOnlyCollection <RestInviteMetadata> > GetInvitesAsync(RequestOptions options = null)
 => GuildHelper.GetInvitesAsync(this, Discord, options);
예제 #25
0
 public Task <GuildEmote> ModifyEmoteAsync(GuildEmote emote, Action <EmoteProperties> func, RequestOptions options = null)
 => GuildHelper.ModifyEmoteAsync(this, Discord, emote.Id, func, options);
예제 #26
0
 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);
        }