diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketDMChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketDMChannel.cs
index c6edbcbb7..01b5a8d09 100644
--- a/src/Discord.Net.WebSocket/Entities/Channels/SocketDMChannel.cs
+++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketDMChannel.cs
@@ -18,6 +18,9 @@ namespace Discord.WebSocket
{
private readonly MessageCache _messages;
+ ///
+ /// Gets the recipient of the channel.
+ ///
public SocketUser Recipient { get; }
///
@@ -51,6 +54,14 @@ namespace Discord.WebSocket
///
public SocketMessage GetCachedMessage(ulong id)
=> _messages?.Get(id);
+ ///
+ /// Gets the message associated with the passed .
+ ///
+ /// The id of the message you want to retrieve
+ /// The options to be used when sending the request.
+ ///
+ /// An awaitable .
+ ///
public async Task GetMessageAsync(ulong id, RequestOptions options = null)
{
IMessage msg = _messages?.Get(id);
@@ -58,6 +69,15 @@ namespace Discord.WebSocket
msg = await ChannelHelper.GetMessageAsync(this, Discord, id, options).ConfigureAwait(false);
return msg;
}
+
+ ///
+ /// Gets a nested collection of messages.
+ ///
+ /// The number of messages you want to get.
+ /// The options to be used when sending the request.
+ ///
+ /// An awaitable .
+ ///
public IAsyncEnumerable> GetMessagesAsync(int limit = DiscordConfig.MaxMessagesPerBatch, RequestOptions options = null)
=> SocketChannelHelper.GetMessagesAsync(this, Discord, _messages, null, Direction.Before, limit, CacheMode.AllowDownload, options);
public IAsyncEnumerable> GetMessagesAsync(ulong fromMessageId, Direction dir, int limit = DiscordConfig.MaxMessagesPerBatch, RequestOptions options = null)
@@ -89,9 +109,10 @@ namespace Discord.WebSocket
/// Message content is too long, length must be less or equal to .
public Task SendFileAsync(Stream stream, string filename, string text, bool isTTS = false, Embed embed = null, RequestOptions options = null)
=> ChannelHelper.SendFileAsync(this, Discord, stream, filename, text, isTTS, embed, options);
-
+ ///
public Task DeleteMessageAsync(ulong messageId, RequestOptions options = null)
=> ChannelHelper.DeleteMessageAsync(this, messageId, Discord, options);
+ ///
public Task DeleteMessageAsync(IMessage message, RequestOptions options = null)
=> ChannelHelper.DeleteMessageAsync(this, message.Id, Discord, options);
@@ -108,6 +129,13 @@ namespace Discord.WebSocket
=> _messages?.Remove(id);
//Users
+ ///
+ /// Gets a user in this channel from the passed .
+ ///
+ /// The id of the user you want to get.
+ ///
+ /// The recipient, or the CurrentUSer otherwise; null
+ ///
public new SocketUser GetUser(ulong id)
{
if (id == Recipient.Id)
@@ -164,8 +192,10 @@ namespace Discord.WebSocket
///
async Task> IMessageChannel.GetPinnedMessagesAsync(RequestOptions options)
=> await GetPinnedMessagesAsync(options).ConfigureAwait(false);
+ ///
async Task IMessageChannel.SendFileAsync(string filePath, string text, bool isTTS, Embed embed, RequestOptions options)
=> await SendFileAsync(filePath, text, isTTS, embed, options).ConfigureAwait(false);
+ ///
async Task IMessageChannel.SendFileAsync(Stream stream, string filename, string text, bool isTTS, Embed embed, RequestOptions options)
=> await SendFileAsync(stream, filename, text, isTTS, embed, options).ConfigureAwait(false);
///
diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs
index 43cc26f6d..6a8372404 100644
--- a/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs
+++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs
@@ -141,6 +141,14 @@ namespace Discord.WebSocket
await ChannelHelper.AddPermissionOverwriteAsync(this, Discord, role, perms, options).ConfigureAwait(false);
_overwrites = _overwrites.Add(new Overwrite(role.Id, PermissionTarget.Role, new OverwritePermissions(perms.AllowValue, perms.DenyValue)));
}
+ ///
+ /// Removes an overwrite permission for the specified .
+ ///
+ /// The user you want to remove the overwrite permission from.
+ /// The options to be used when sending the request.
+ ///
+ /// An awaitable .
+ ///
public async Task RemovePermissionOverwriteAsync(IUser user, RequestOptions options = null)
{
await ChannelHelper.RemovePermissionOverwriteAsync(this, Discord, user, options).ConfigureAwait(false);
@@ -154,6 +162,14 @@ namespace Discord.WebSocket
}
}
}
+ ///
+ /// Removes an overwrite permission for the specified .
+ ///
+ /// The role you want the overwrite permissions to be removed from.
+ /// The options to be used when sending the request.
+ ///
+ /// An awaitable .
+ ///
public async Task RemovePermissionOverwriteAsync(IRole role, RequestOptions options = null)
{
await ChannelHelper.RemovePermissionOverwriteAsync(this, Discord, role, options).ConfigureAwait(false);
@@ -168,8 +184,26 @@ namespace Discord.WebSocket
}
}
+ ///
+ /// Gets the invites for this channel.
+ ///
+ /// The options to be used when sending the request.
+ ///
+ /// An awaitable .
+ ///
public async Task> GetInvitesAsync(RequestOptions options = null)
=> await ChannelHelper.GetInvitesAsync(this, Discord, options).ConfigureAwait(false);
+ ///
+ /// Creates an invite for this channel.
+ ///
+ /// The number of seconds that you want the invite to be valid for.
+ /// The number of times this invite can be used before it expires.
+ /// Whether or not the invite grants temporary membership.
+ /// Whether to try reuse a similar invite or not.
+ /// The options to be used when sending the request.
+ ///
+ /// An awaitable .
+ ///
public async Task CreateInviteAsync(int? maxAge = 86400, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null)
=> await ChannelHelper.CreateInviteAsync(this, Discord, maxAge, maxUses, isTemporary, isUnique, options).ConfigureAwait(false);
diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketTextChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketTextChannel.cs
index 5909421d5..9c5d15fc0 100644
--- a/src/Discord.Net.WebSocket/Entities/Channels/SocketTextChannel.cs
+++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketTextChannel.cs
@@ -20,7 +20,14 @@ namespace Discord.WebSocket
///
public string Topic { get; private set; }
+ ///
public ulong? CategoryId { get; private set; }
+ ///
+ /// Gets the Category this channel belongs to.
+ ///
+ ///
+ /// An that this channel belongs to otherwise; null.
+ ///
public ICategoryChannel Category
=> CategoryId.HasValue ? Guild.GetChannel(CategoryId.Value) as ICategoryChannel : null;
@@ -66,6 +73,15 @@ namespace Discord.WebSocket
///
public SocketMessage GetCachedMessage(ulong id)
=> _messages?.Get(id);
+
+ ///
+ /// Gets the message associated with the passed .
+ ///
+ /// The id of the message you want to retrieve
+ /// The options to be used when sending the request.
+ ///
+ /// An awaitable .
+ ///
public async Task GetMessageAsync(ulong id, RequestOptions options = null)
{
IMessage msg = _messages?.Get(id);
@@ -73,6 +89,15 @@ namespace Discord.WebSocket
msg = await ChannelHelper.GetMessageAsync(this, Discord, id, options).ConfigureAwait(false);
return msg;
}
+
+ ///
+ /// Gets a nested collection of messages.
+ ///
+ /// The number of messages you want to get.
+ /// The options to be used when sending the request.
+ ///
+ /// An awaitable .
+ ///
public IAsyncEnumerable> GetMessagesAsync(int limit = DiscordConfig.MaxMessagesPerBatch, RequestOptions options = null)
=> SocketChannelHelper.GetMessagesAsync(this, Discord, _messages, null, Direction.Before, limit, CacheMode.AllowDownload, options);
public IAsyncEnumerable> GetMessagesAsync(ulong fromMessageId, Direction dir, int limit = DiscordConfig.MaxMessagesPerBatch, RequestOptions options = null)
@@ -109,9 +134,10 @@ namespace Discord.WebSocket
///
public Task DeleteMessagesAsync(IEnumerable messageIds, RequestOptions options = null)
=> ChannelHelper.DeleteMessagesAsync(this, Discord, messageIds, options);
-
+ ///
public Task DeleteMessageAsync(ulong messageId, RequestOptions options = null)
=> ChannelHelper.DeleteMessageAsync(this, messageId, Discord, options);
+ ///
public Task DeleteMessageAsync(IMessage message, RequestOptions options = null)
=> ChannelHelper.DeleteMessageAsync(this, message.Id, Discord, options);