/// <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);