Beispiel #1
0
 /// <summary>
 ///     Gets the last N messages from this message channel.
 /// </summary>
 /// <remarks>
 ///     This method follows the same behavior as described in <see cref="IMessageChannel.GetMessagesAsync(int, CacheMode, RequestOptions)"/>.
 ///     Please visit its documentation for more details on this method.
 /// </remarks>
 /// <param name="limit">The numbers of message to be gotten from.</param>
 /// <param name="options">The options to be used when sending the request.</param>
 /// <returns>
 ///     Paged collection of messages.
 /// </returns>
 public IAsyncEnumerable <IReadOnlyCollection <IMessage> > GetMessagesAsync(int limit = DiscordConfig.MaxMessagesPerBatch, RequestOptions options = null)
 => SocketChannelHelper.GetMessagesAsync(this, Discord, new MessageCache(Discord), null, Direction.Before, limit, CacheMode.AllowDownload, options);
 /// <inheritdoc />
 IAsyncEnumerable <IReadOnlyCollection <IMessage> > IMessageChannel.GetMessagesAsync(IMessage fromMessage, Direction dir, int limit, CacheMode mode, RequestOptions options)
 => SocketChannelHelper.GetMessagesAsync(this, Discord, _messages, fromMessage.Id, dir, limit, mode, options);
 /// <inheritdoc />
 IAsyncEnumerable <IReadOnlyCollection <IMessage> > IMessageChannel.GetMessagesAsync(int limit, CacheMode mode, RequestOptions options)
 => SocketChannelHelper.GetMessagesAsync(this, Discord, _messages, null, Direction.Before, limit, mode, options);
 /// <inheritdoc />
 public IReadOnlyCollection <SocketMessage> GetCachedMessages(IMessage fromMessage, Direction dir, int limit = DiscordConfig.MaxMessagesPerBatch)
 => SocketChannelHelper.GetCachedMessages(this, Discord, _messages, fromMessage.Id, dir, limit);
 /// <inheritdoc />
 public IReadOnlyCollection <SocketMessage> GetCachedMessages(int limit = DiscordConfig.MaxMessagesPerBatch)
 => SocketChannelHelper.GetCachedMessages(this, Discord, _messages, null, Direction.Before, limit);
 /// <summary>
 ///     Gets a collection of messages in this channel.
 /// </summary>
 /// <remarks>
 ///     This method follows the same behavior as described in <see cref="IMessageChannel.GetMessagesAsync(IMessage, Direction, int, CacheMode, RequestOptions)"/>.
 ///     Please visit its documentation for more details on this method.
 /// </remarks>
 /// <param name="fromMessage">The starting message to get the messages from.</param>
 /// <param name="dir">The direction of the messages to be gotten from.</param>
 /// <param name="limit">The numbers of message to be gotten from.</param>
 /// <param name="options">The options to be used when sending the request.</param>
 /// <returns>
 ///     Paged collection of messages.
 /// </returns>
 public IAsyncEnumerable <IReadOnlyCollection <IMessage> > GetMessagesAsync(IMessage fromMessage, Direction dir, int limit = DiscordConfig.MaxMessagesPerBatch, RequestOptions options = null)
 => SocketChannelHelper.GetMessagesAsync(this, Discord, _messages, fromMessage.Id, dir, limit, CacheMode.AllowDownload, options);