diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketDMChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketDMChannel.cs index ee33b3b93..4d84dce25 100644 --- a/src/Discord.Net.WebSocket/Entities/Channels/SocketDMChannel.cs +++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketDMChannel.cs @@ -26,6 +26,10 @@ namespace Discord.WebSocket /// public IReadOnlyCollection CachedMessages => _messages?.Messages ?? ImmutableArray.Create(); + + /// + /// Gets a collection that is the current logged-in user and the recipient. + /// public new IReadOnlyCollection Users => ImmutableArray.Create(Discord.CurrentUser, Recipient); internal SocketDMChannel(DiscordSocketClient discord, ulong id, SocketGlobalUser recipient) @@ -82,8 +86,32 @@ namespace Discord.WebSocket /// public IAsyncEnumerable> GetMessagesAsync(int limit = DiscordConfig.MaxMessagesPerBatch, RequestOptions options = null) => SocketChannelHelper.GetMessagesAsync(this, Discord, _messages, null, Direction.Before, limit, CacheMode.AllowDownload, options); + + /// + /// Gets the last N messages from this channel based on the passed id and the direction to get the messages. + /// + /// The id of the starting message. + /// The direction that you want the messages to be retrieved from. + /// The number of messages you want to retrieve. + /// The options to be used when sending the request. + /// + /// Paged collection of messages. Flattening the paginated response into a collection of messages with + /// is required if you wish to access the messages. + /// public IAsyncEnumerable> GetMessagesAsync(ulong fromMessageId, Direction dir, int limit = DiscordConfig.MaxMessagesPerBatch, RequestOptions options = null) => SocketChannelHelper.GetMessagesAsync(this, Discord, _messages, fromMessageId, dir, limit, CacheMode.AllowDownload, options); + + /// + /// Gets the last N messages from this channel based on the passed message and the direction to get the messages. + /// + /// The message you want to start from. + /// The direction that you want the messages to be retrieved from. + /// The number of messages you want to retrieve. + /// The options to be used when sending the request. + /// + /// Paged collection of messages. Flattening the paginated response into a collection of messages with + /// is required if you wish to access the messages. + /// public IAsyncEnumerable> GetMessagesAsync(IMessage fromMessage, Direction dir, int limit = DiscordConfig.MaxMessagesPerBatch, RequestOptions options = null) => SocketChannelHelper.GetMessagesAsync(this, Discord, _messages, fromMessage.Id, dir, limit, CacheMode.AllowDownload, options); ///