+ Starting from this commit, all return types for tasks will use style similar to most documentations featured on docs.microsoft.com References: https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.dbcontext.-ctor?view=efcore-2.1 https://docs.microsoft.com/en-us/dotnet/api/system.io.filestream.readasync?view=netcore-2.1 https://docs.microsoft.com/en-us/dotnet/api/system.io.textwriter.writelineasync?view=netcore-2.1#System_IO_TextWriter_WriteLineAsync_System_Char___ And many more other asynchronous method documentations featured in the latest BCL.pull/1161/head
| @@ -10,8 +10,11 @@ namespace Discord | |||||
| /// Gets or sets the channel to this name. | /// Gets or sets the channel to this name. | ||||
| /// </summary> | /// </summary> | ||||
| /// <remarks> | /// <remarks> | ||||
| /// When modifying an <see cref="ITextChannel" />, the <see cref="Name" /> | |||||
| /// MUST be alphanumeric with dashes. It must match the following RegEx: [a-z0-9-_]{2,100} | |||||
| /// This property defines the new name for this channel. | |||||
| /// <note type="warning"> | |||||
| /// When modifying an <see cref="ITextChannel"/>, the <see cref="Name"/> must be alphanumeric with | |||||
| /// dashes. It must match the RegEx <c>[a-z0-9-_]{2,100}</c>. | |||||
| /// </note> | |||||
| /// </remarks> | /// </remarks> | ||||
| public Optional<string> Name { get; set; } | public Optional<string> Name { get; set; } | ||||
| /// <summary> | /// <summary> | ||||
| @@ -12,9 +12,21 @@ namespace Discord | |||||
| /// <summary> | /// <summary> | ||||
| /// Connects to this audio channel. | /// Connects to this audio channel. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="selfDeaf">Determines whether the client should deaf itself upon connection.</param> | |||||
| /// <param name="selfMute">Determines whether the client should mute itself upon connection.</param> | |||||
| /// <param name="external">Determines whether the audio client is an external one or not.</param> | |||||
| /// <returns> | |||||
| /// A task representing the asynchronous connection operation. The task result contains the | |||||
| /// <see cref="IAudioClient"/> responsible for the connection. | |||||
| /// </returns> | |||||
| Task<IAudioClient> ConnectAsync(bool selfDeaf = false, bool selfMute = false, bool external = false); | Task<IAudioClient> ConnectAsync(bool selfDeaf = false, bool selfMute = false, bool external = false); | ||||
| /// <summary> Disconnects from this audio channel. </summary> | |||||
| /// <summary> | |||||
| /// Disconnects from this audio channel. | |||||
| /// </summary> | |||||
| /// <returns> | |||||
| /// A task representing the asynchronous disconnection operation. | |||||
| /// </returns> | |||||
| Task DisconnectAsync(); | Task DisconnectAsync(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -31,11 +31,12 @@ namespace Discord | |||||
| /// <summary> | /// <summary> | ||||
| /// Gets a user in this channel. | /// Gets a user in this channel. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="id">The snowflake identifier of the user (e.g. 168693960628371456).</param> | |||||
| /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="id">The snowflake identifier of the user (e.g. <c>168693960628371456</c>).</param> | |||||
| /// <param name="mode">The <see cref="CacheMode" /> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a user object that represents the user. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a user object that | |||||
| /// represents the found user; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<IUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| } | } | ||||
| @@ -10,12 +10,18 @@ namespace Discord | |||||
| /// <summary> | /// <summary> | ||||
| /// Gets the recipient of all messages in this channel. | /// Gets the recipient of all messages in this channel. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A user object that represents the other user in this channel. | |||||
| /// </returns> | |||||
| IUser Recipient { get; } | IUser Recipient { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Closes this private channel, removing it from your channel list. | /// Closes this private channel, removing it from your channel list. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | |||||
| /// A task that represents the asynchronous close operation. | |||||
| /// </returns> | |||||
| Task CloseAsync(RequestOptions options = null); | Task CloseAsync(RequestOptions options = null); | ||||
| } | } | ||||
| } | } | ||||
| @@ -11,6 +11,9 @@ namespace Discord | |||||
| /// Leaves this group. | /// Leaves this group. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | |||||
| /// A task that represents the asynchronous leave operation. | |||||
| /// </returns> | |||||
| Task LeaveAsync(RequestOptions options = null); | Task LeaveAsync(RequestOptions options = null); | ||||
| } | } | ||||
| } | } | ||||
| @@ -16,7 +16,8 @@ namespace Discord | |||||
| /// Gets the position of this channel. | /// Gets the position of this channel. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// The position of this channel in the guild's channel list, relative to others of the same type. | |||||
| /// An <see cref="int"/> representing the position of this channel in the guild's channel list relative to | |||||
| /// others of the same type. | |||||
| /// </returns> | /// </returns> | ||||
| int Position { get; } | int Position { get; } | ||||
| @@ -24,14 +25,15 @@ namespace Discord | |||||
| /// Gets the guild associated with this channel. | /// Gets the guild associated with this channel. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// A guild that this channel belongs to. | |||||
| /// A guild object that this channel belongs to. | |||||
| /// </returns> | /// </returns> | ||||
| IGuild Guild { get; } | IGuild Guild { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the guild ID associated with this channel. | /// Gets the guild ID associated with this channel. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// A guild snowflake identifier for the guild that this channel belongs to. | |||||
| /// An <see cref="ulong"/> representing the guild snowflake identifier for the guild that this channel | |||||
| /// belongs to. | |||||
| /// </returns> | /// </returns> | ||||
| ulong GuildId { get; } | ulong GuildId { get; } | ||||
| /// <summary> | /// <summary> | ||||
| @@ -45,25 +47,14 @@ namespace Discord | |||||
| /// <summary> | /// <summary> | ||||
| /// Creates a new invite to this channel. | /// Creates a new invite to this channel. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="maxAge"> | |||||
| /// The time (in seconds) until the invite expires. Set to <c>null</c> to never expire. | |||||
| /// </param> | |||||
| /// <param name="maxUses"> | |||||
| /// The max amount of times this invite may be used. Set to <c>null</c> to have unlimited uses. | |||||
| /// </param> | |||||
| /// <param name="isTemporary"> | |||||
| /// If <c>true</c>, a user accepting this invite will be kicked from the guild after closing their client. | |||||
| /// </param> | |||||
| /// <param name="isUnique"> | |||||
| /// If <c>true</c>, don't try to reuse a similar invite (useful for creating many unique one time use | |||||
| /// invites). | |||||
| /// </param> | |||||
| /// <param name="options"> | |||||
| /// The options to be used when sending the request. | |||||
| /// </param> | |||||
| /// <param name="maxAge">The time (in seconds) until the invite expires. Set to <c>null</c> to never expire.</param> | |||||
| /// <param name="maxUses">The max amount of times this invite may be used. Set to <c>null</c> to have unlimited uses.</param> | |||||
| /// <param name="isTemporary">If <c>true</c>, the user accepting this invite will be kicked from the guild after closing their client.</param> | |||||
| /// <param name="isUnique">If <c>true</c>, don't try to reuse a similar invite (useful for creating many unique one time use invites).</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | |||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing an invite metadata object containing information for the | |||||
| /// created invite. | |||||
| /// A task that represents the asynchronous invite creation operation. The task result contains an invite | |||||
| /// metadata object containing information for the created invite. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IInviteMetadata> CreateInviteAsync(int? maxAge = 86400, int? maxUses = default(int?), bool isTemporary = false, bool isUnique = false, RequestOptions options = null); | Task<IInviteMetadata> CreateInviteAsync(int? maxAge = 86400, int? maxUses = default(int?), bool isTemporary = false, bool isUnique = false, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -71,18 +62,18 @@ namespace Discord | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a read-only collection of invite metadata that are created | |||||
| /// for this channel. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a read-only collection | |||||
| /// of invite metadata that are created for this channel. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IReadOnlyCollection<IInviteMetadata>> GetInvitesAsync(RequestOptions options = null); | Task<IReadOnlyCollection<IInviteMetadata>> GetInvitesAsync(RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Modifies this guild channel. | /// Modifies this guild channel. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="func">The properties to modify the channel with.</param> | |||||
| /// <param name="func">The delegate containing the properties to modify the channel with.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/>. | |||||
| /// A task that represents the asynchronous modification operation. | |||||
| /// </returns> | /// </returns> | ||||
| Task ModifyAsync(Action<GuildChannelProperties> func, RequestOptions options = null); | Task ModifyAsync(Action<GuildChannelProperties> func, RequestOptions options = null); | ||||
| @@ -108,7 +99,7 @@ namespace Discord | |||||
| /// <param name="role">The role to remove the overwrite from.</param> | /// <param name="role">The role to remove the overwrite from.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/>. | |||||
| /// A task representing the asynchronous removal operation. | |||||
| /// </returns> | /// </returns> | ||||
| Task RemovePermissionOverwriteAsync(IRole role, RequestOptions options = null); | Task RemovePermissionOverwriteAsync(IRole role, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -117,7 +108,7 @@ namespace Discord | |||||
| /// <param name="user">The user to remove the overwrite from.</param> | /// <param name="user">The user to remove the overwrite from.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/>. | |||||
| /// A task representing the asynchronous removal operation. | |||||
| /// </returns> | /// </returns> | ||||
| Task RemovePermissionOverwriteAsync(IUser user, RequestOptions options = null); | Task RemovePermissionOverwriteAsync(IUser user, RequestOptions options = null); | ||||
| @@ -128,7 +119,7 @@ namespace Discord | |||||
| /// <param name="permissions">The overwrite to add to the role.</param> | /// <param name="permissions">The overwrite to add to the role.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/>. | |||||
| /// A task representing the asynchronous permission addition operation. | |||||
| /// </returns> | /// </returns> | ||||
| Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null); | Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -138,7 +129,7 @@ namespace Discord | |||||
| /// <param name="permissions">The overwrite to add to the user.</param> | /// <param name="permissions">The overwrite to add to the user.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/>. | |||||
| /// A task representing the asynchronous permission addition operation. | |||||
| /// </returns> | /// </returns> | ||||
| Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options = null); | Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options = null); | ||||
| @@ -159,12 +150,11 @@ namespace Discord | |||||
| /// Gets a user in this channel with the provided ID. | /// Gets a user in this channel with the provided ID. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="id">The ID of the user.</param> | /// <param name="id">The ID of the user.</param> | ||||
| /// <param name="mode"> | |||||
| /// The <see cref="CacheMode" /> that determines whether the object should be fetched from cache. | |||||
| /// </param> | |||||
| /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a guild user object that represents the user. | |||||
| /// A task representing the asynchrnous get operation. The task result contains a guild user object that | |||||
| /// represents the user; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| new Task<IGuildUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | new Task<IGuildUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| } | } | ||||
| @@ -14,59 +14,67 @@ namespace Discord | |||||
| /// Sends a message to this message channel. | /// Sends a message to this message channel. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="text">The message to be sent.</param> | /// <param name="text">The message to be sent.</param> | ||||
| /// <param name="isTTS">Whether the message should be read aloud by Discord or not.</param> | |||||
| /// <param name="embed">The <see cref="EmbedType.Rich"/> <see cref="Embed"/> to be sent.</param> | |||||
| /// <param name="isTTS">Determines whether the message should be read aloud by Discord or not.</param> | |||||
| /// <param name="embed">The <see cref="Discord.EmbedType.Rich"/> <see cref="Embed"/> to be sent.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable Task containing the message sent to the channel. | |||||
| /// A task that represents an asynchrnous send operation for delievering the message. The task result | |||||
| /// contains the sent message. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IUserMessage> SendMessageAsync(string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null); | Task<IUserMessage> SendMessageAsync(string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Sends a file to this message channel with an optional caption. | /// Sends a file to this message channel with an optional caption. | ||||
| /// </summary> | /// </summary> | ||||
| /// <remarks> | |||||
| /// This method sends a file as if you are uploading an attachment directly from your Discord client. | |||||
| /// <note> | |||||
| /// If you wish to upload an image and have it embedded in a <see cref="Discord.EmbedType.Rich"/>embed, | |||||
| /// you may upload the file and refer to the file with "attachment://filename.ext" in the | |||||
| /// <see cref="Discord.EmbedBuilder.ImageUrl"/>. | |||||
| /// </note> | |||||
| /// </remarks> | |||||
| /// <param name="filePath">The file path of the file.</param> | /// <param name="filePath">The file path of the file.</param> | ||||
| /// <param name="text">The message to be sent.</param> | /// <param name="text">The message to be sent.</param> | ||||
| /// <param name="isTTS">Whether the message should be read aloud by Discord or not.</param> | /// <param name="isTTS">Whether the message should be read aloud by Discord or not.</param> | ||||
| /// <param name="embed">The <see cref="EmbedType.Rich"/> <see cref="Embed"/> to be sent.</param> | |||||
| /// <param name="embed">The <see cref="Discord.EmbedType.Rich" /> <see cref="Embed" /> to be sent.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <remarks> | |||||
| /// If you wish to upload an image and have it embedded in a <see cref="EmbedType.Rich"/> embed, you may | |||||
| /// upload the file and refer to the file with "attachment://filename.ext" in the | |||||
| /// <see cref="Discord.EmbedBuilder.ImageUrl"/>. | |||||
| /// </remarks> | |||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable Task containing the message sent to the channel. | |||||
| /// A task that represents an asynchrnous send operation for delievering the message. The task result | |||||
| /// contains the sent message. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IUserMessage> SendFileAsync(string filePath, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null); | Task<IUserMessage> SendFileAsync(string filePath, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Sends a file to this message channel with an optional caption. | /// Sends a file to this message channel with an optional caption. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="stream">The <see cref="Stream"/> of the file to be sent.</param> | |||||
| /// <remarks> | |||||
| /// This method sends a file as if you are uploading an attachment directly from your Discord client. | |||||
| /// <note> | |||||
| /// If you wish to upload an image and have it embedded in a <see cref="Discord.EmbedType.Rich"/>embed, | |||||
| /// you may upload the file and refer to the file with "attachment://filename.ext" in the | |||||
| /// <see cref="Discord.EmbedBuilder.ImageUrl"/>. | |||||
| /// </note> | |||||
| /// </remarks> | |||||
| /// <param name="stream">The <see cref="Stream" /> of the file to be sent.</param> | |||||
| /// <param name="filename">The name of the attachment.</param> | /// <param name="filename">The name of the attachment.</param> | ||||
| /// <param name="text">The message to be sent.</param> | /// <param name="text">The message to be sent.</param> | ||||
| /// <param name="isTTS">Whether the message should be read aloud by Discord or not.</param> | /// <param name="isTTS">Whether the message should be read aloud by Discord or not.</param> | ||||
| /// <param name="embed">The <see cref="EmbedType.Rich"/> <see cref="Embed"/> to be sent.</param> | |||||
| /// <param name="embed">The <see cref="Discord.EmbedType.Rich"/> <see cref="Embed"/> to be sent.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <remarks> | |||||
| /// If you wish to upload an image and have it embedded in a <see cref="EmbedType.Rich"/> embed, you may | |||||
| /// upload the file and refer to the file with "attachment://filename.ext" in the | |||||
| /// <see cref="Discord.EmbedBuilder.ImageUrl"/>. | |||||
| /// </remarks> | |||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the message sent to the channel. | |||||
| /// A task that represents an asynchrnous send operation for delievering the message. The task result | |||||
| /// contains the sent message. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IUserMessage> SendFileAsync(Stream stream, string filename, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null); | Task<IUserMessage> SendFileAsync(Stream stream, string filename, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a message from this message channel. | /// Gets a message from this message channel. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="id">The ID of the message.</param> | |||||
| /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from | |||||
| /// cache.</param> | |||||
| /// <param name="id">The snowflake identifier of the message.</param> | |||||
| /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the message gotten from either the cache or the download; | |||||
| /// <c>null</c> if none is found or if the message fails to be retrieved. | |||||
| /// A task that represents an asynchrnous get operation for retrieving the message. The task result contains | |||||
| /// the retrieved message; <c>null</c> if no message is found with the specified identifier. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IMessage> GetMessageAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<IMessage> GetMessageAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| @@ -116,25 +124,45 @@ namespace Discord | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable Task containing a collection of messages. | |||||
| /// A task that represents the asynchronous get operation for retrieving pinned messages in this channel. | |||||
| /// The task result contains a collection of messages found in the pinned messages. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IReadOnlyCollection<IMessage>> GetPinnedMessagesAsync(RequestOptions options = null); | Task<IReadOnlyCollection<IMessage>> GetPinnedMessagesAsync(RequestOptions options = null); | ||||
| /// <summary> Deletes a message based on the message ID in this channel. </summary> | |||||
| /// <summary> | |||||
| /// Deletes a message. | |||||
| /// </summary> | |||||
| /// <param name="messageId">The snowflake identifier of the message that would be removed.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | |||||
| /// <returns> | |||||
| /// A task that represents the asynchronous removal operation. | |||||
| /// </returns> | |||||
| Task DeleteMessageAsync(ulong messageId, RequestOptions options = null); | Task DeleteMessageAsync(ulong messageId, RequestOptions options = null); | ||||
| /// <summary> Deletes a message based on the provided message in this channel. </summary> | /// <summary> Deletes a message based on the provided message in this channel. </summary> | ||||
| /// <param name="message">The message that would be removed.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | |||||
| /// <returns> | |||||
| /// A task that represents the asynchronous removal operation. | |||||
| /// </returns> | |||||
| Task DeleteMessageAsync(IMessage message, RequestOptions options = null); | Task DeleteMessageAsync(IMessage message, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Broadcasts the "user is typing" message to all users in this channel, lasting 10 seconds. | /// Broadcasts the "user is typing" message to all users in this channel, lasting 10 seconds. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | |||||
| /// A task that represents the asynchronous operation that triggers the broadcast. | |||||
| /// </returns> | |||||
| Task TriggerTypingAsync(RequestOptions options = null); | Task TriggerTypingAsync(RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Continuously broadcasts the "user is typing" message to all users in this channel until the returned | /// Continuously broadcasts the "user is typing" message to all users in this channel until the returned | ||||
| /// object is disposed. | /// object is disposed. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | |||||
| /// A disposable object that, upon its disposal, will stop the client from broadcasting its typing state in | |||||
| /// this channel. | |||||
| /// </returns> | |||||
| IDisposable EnterTypingState(RequestOptions options = null); | IDisposable EnterTypingState(RequestOptions options = null); | ||||
| } | } | ||||
| } | } | ||||
| @@ -11,7 +11,7 @@ namespace Discord | |||||
| /// Gets the parent (category) ID of this channel in the guild's channel list. | /// Gets the parent (category) ID of this channel in the guild's channel list. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// An <see cref="System.UInt64"/> representing the snowflake identifier of the parent of this channel; | |||||
| /// A <see cref="ulong"/> representing the snowflake identifier of the parent of this channel; | |||||
| /// <c>null</c> if none is set. | /// <c>null</c> if none is set. | ||||
| /// </returns> | /// </returns> | ||||
| ulong? CategoryId { get; } | ulong? CategoryId { get; } | ||||
| @@ -21,7 +21,8 @@ namespace Discord | |||||
| /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// A category channel representing the parent of this channel; <c>null</c> if none is set. | |||||
| /// A task that represents the asynchrnous get operation. The task result contains the category channel | |||||
| /// representing the parent of this channel; <c>null</c> if none is set. | |||||
| /// </returns> | /// </returns> | ||||
| Task<ICategoryChannel> GetCategoryAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<ICategoryChannel> GetCategoryAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| } | } | ||||
| @@ -11,7 +11,7 @@ namespace Discord | |||||
| /// Gets the users that can access this channel. | /// Gets the users that can access this channel. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// A collection of users that can access this channel. | |||||
| /// A read-only collection of users that can access this channel. | |||||
| /// </returns> | /// </returns> | ||||
| IReadOnlyCollection<IUser> Recipients { get; } | IReadOnlyCollection<IUser> Recipients { get; } | ||||
| } | } | ||||
| @@ -14,7 +14,7 @@ namespace Discord | |||||
| /// Determines whether the channel is NSFW. | /// Determines whether the channel is NSFW. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// <c>true</c> if the channel has the NSFW flag enabled; otherwise, <c>false</c>. | |||||
| /// <c>true</c> if the channel has the NSFW flag enabled; otherwise <c>false</c>. | |||||
| /// </returns> | /// </returns> | ||||
| bool IsNsfw { get; } | bool IsNsfw { get; } | ||||
| @@ -22,7 +22,7 @@ namespace Discord | |||||
| /// Gets the current topic for this text channel. | /// Gets the current topic for this text channel. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// The topic set in the channel, or <c>null</c> if none is set. | |||||
| /// A string representing the topic set in the channel; <c>null</c> if none is set. | |||||
| /// </returns> | /// </returns> | ||||
| string Topic { get; } | string Topic { get; } | ||||
| @@ -30,30 +30,42 @@ namespace Discord | |||||
| /// Bulk-deletes multiple messages. | /// Bulk-deletes multiple messages. | ||||
| /// </summary> | /// </summary> | ||||
| /// <remarks> | /// <remarks> | ||||
| /// This method attempts to remove the messages specified in bulk. | |||||
| /// <note type="important"> | /// <note type="important"> | ||||
| /// This method can only remove messages that are posted within 14 days! | |||||
| /// Due to the limitation set by Discord, this method can only remove messages that are posted within 14 days! | |||||
| /// </note> | /// </note> | ||||
| /// </remarks> | /// </remarks> | ||||
| /// <param name="messages">The messages to be bulk-deleted.</param> | /// <param name="messages">The messages to be bulk-deleted.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | |||||
| /// A task that represents the asynchronous bulk-removal operation. | |||||
| /// </returns> | |||||
| Task DeleteMessagesAsync(IEnumerable<IMessage> messages, RequestOptions options = null); | Task DeleteMessagesAsync(IEnumerable<IMessage> messages, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Bulk-deletes multiple messages. | /// Bulk-deletes multiple messages. | ||||
| /// </summary> | /// </summary> | ||||
| /// <remarks> | /// <remarks> | ||||
| /// This method attempts to remove the messages specified in bulk. | |||||
| /// <note type="important"> | /// <note type="important"> | ||||
| /// This method can only remove messages that are posted within 14 days! | |||||
| /// Due to the limitation set by Discord, this method can only remove messages that are posted within 14 days! | |||||
| /// </note> | /// </note> | ||||
| /// </remarks> | /// </remarks> | ||||
| /// <param name="messageIds">The IDs of the messages to be bulk-deleted.</param> | |||||
| /// <param name="messageIds">The snowflake identifier of the messages to be bulk-deleted.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | |||||
| /// A task that represents the asynchronous bulk-removal operation. | |||||
| /// </returns> | |||||
| Task DeleteMessagesAsync(IEnumerable<ulong> messageIds, RequestOptions options = null); | Task DeleteMessagesAsync(IEnumerable<ulong> messageIds, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Modifies this text channel. | /// Modifies this text channel. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="func">The properties to modify the channel with.</param> | |||||
| /// <param name="func">The delegate containing the properties to modify the channel with.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | |||||
| /// A task that represents the asynchronous modification operation. | |||||
| /// </returns> | |||||
| /// <seealso cref="TextChannelProperties"/> | |||||
| Task ModifyAsync(Action<TextChannelProperties> func, RequestOptions options = null); | Task ModifyAsync(Action<TextChannelProperties> func, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -63,7 +75,8 @@ namespace Discord | |||||
| /// <param name="avatar">The avatar of the webhook.</param> | /// <param name="avatar">The avatar of the webhook.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the created webhook. | |||||
| /// A task that represents the asynchronous creation operation. The task result contains the newly created | |||||
| /// webhook. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IWebhook> CreateWebhookAsync(string name, Stream avatar = null, RequestOptions options = null); | Task<IWebhook> CreateWebhookAsync(string name, Stream avatar = null, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -72,8 +85,8 @@ namespace Discord | |||||
| /// <param name="id">The identifier of the webhook.</param> | /// <param name="id">The identifier of the webhook.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a webhook associated with the identifier; <c>null</c> if not | |||||
| /// found. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a webhook associated | |||||
| /// with the identifier; <c>null</c> if the webhook is not found. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IWebhook> GetWebhookAsync(ulong id, RequestOptions options = null); | Task<IWebhook> GetWebhookAsync(ulong id, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -81,7 +94,8 @@ namespace Discord | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a collection of found webhooks. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a read-only collection | |||||
| /// of webhooks that is available in this channel. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IReadOnlyCollection<IWebhook>> GetWebhooksAsync(RequestOptions options = null); | Task<IReadOnlyCollection<IWebhook>> GetWebhooksAsync(RequestOptions options = null); | ||||
| } | } | ||||
| @@ -9,13 +9,20 @@ namespace Discord | |||||
| public interface IVoiceChannel : INestedChannel, IAudioChannel | public interface IVoiceChannel : INestedChannel, IAudioChannel | ||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the bitrate, in bits per second, clients in this voice channel are requested to use. | |||||
| /// Gets the bitrate that the clients in this voice channel are requested to use. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// An <see cref="int"/> representing the bitrate (bps) that this voice channel defines and requests the | |||||
| /// client(s) to use. | |||||
| /// </returns> | |||||
| int Bitrate { get; } | int Bitrate { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the max amount of users allowed to be connected to this channel at one time, or | |||||
| /// <c>null</c> if none is set. | |||||
| /// Gets the max number of users allowed to be connected to this channel at once. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// An <see cref="int"/> representing the maxmimum number of users that are allowed to be connected to this | |||||
| /// channel at once; <c>null</c> if a limit is not set. | |||||
| /// </returns> | |||||
| int? UserLimit { get; } | int? UserLimit { get; } | ||||
| /// <summary> | /// <summary> | ||||
| @@ -23,6 +30,10 @@ namespace Discord | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="func">The properties to modify the channel with.</param> | /// <param name="func">The properties to modify the channel with.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | |||||
| /// A task that represents the asynchronous modification operation. | |||||
| /// </returns> | |||||
| /// <seealso cref="VoiceChannelProperties"/> | |||||
| Task ModifyAsync(Action<VoiceChannelProperties> func, RequestOptions options = null); | Task ModifyAsync(Action<VoiceChannelProperties> func, RequestOptions options = null); | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,7 +1,7 @@ | |||||
| namespace Discord | namespace Discord | ||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Properties that are used to reorder an <see cref="IGuildChannel"/>. | |||||
| /// Provides properties that are used to reorder an <see cref="IGuildChannel"/>. | |||||
| /// </summary> | /// </summary> | ||||
| public class ReorderChannelProperties | public class ReorderChannelProperties | ||||
| { | { | ||||
| @@ -20,7 +20,7 @@ namespace Discord | |||||
| /// </returns> | /// </returns> | ||||
| public int Position { get; } | public int Position { get; } | ||||
| /// <summary> Creates a <see cref="ReorderChannelProperties"/> used to reorder a channel. </summary> | |||||
| /// <summary> Initializes a new instance of the <see cref="ReorderChannelProperties"/> class used to reorder a channel. </summary> | |||||
| /// <param name="id"> Sets the ID of the channel to apply this position to. </param> | /// <param name="id"> Sets the ID of the channel to apply this position to. </param> | ||||
| /// <param name="position"> Sets the new zero-based position of this channel. </param> | /// <param name="position"> Sets the new zero-based position of this channel. </param> | ||||
| public ReorderChannelProperties(ulong id, int position) | public ReorderChannelProperties(ulong id, int position) | ||||
| @@ -1,11 +1,9 @@ | |||||
| using System; | |||||
| namespace Discord | namespace Discord | ||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Properties that are used to modify an <see cref="ITextChannel"/> with the specified changes. | |||||
| /// Provides properties that are used to modify an <see cref="ITextChannel"/> with the specified changes. | |||||
| /// </summary> | /// </summary> | ||||
| /// <seealso cref="ITextChannel.ModifyAsync(Action{TextChannelProperties}, RequestOptions)"/> | |||||
| /// <seealso cref="ITextChannel.ModifyAsync(System.Action{TextChannelProperties}, RequestOptions)"/> | |||||
| public class TextChannelProperties : GuildChannelProperties | public class TextChannelProperties : GuildChannelProperties | ||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| @@ -1,7 +1,7 @@ | |||||
| namespace Discord | namespace Discord | ||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Properties that are used to modify an <see cref="IVoiceChannel" /> with the specified changes. | |||||
| /// Provides properties that are used to modify an <see cref="IVoiceChannel" /> with the specified changes. | |||||
| /// </summary> | /// </summary> | ||||
| public class VoiceChannelProperties : GuildChannelProperties | public class VoiceChannelProperties : GuildChannelProperties | ||||
| { | { | ||||
| @@ -12,10 +12,13 @@ namespace Discord | |||||
| /// <summary> | /// <summary> | ||||
| /// Gets the Unicode representation of this emote. | /// Gets the Unicode representation of this emote. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A string that resolves to <see cref="Emoji.Name"/>. | |||||
| /// </returns> | |||||
| public override string ToString() => Name; | public override string ToString() => Name; | ||||
| /// <summary> | /// <summary> | ||||
| /// Creates a Unicode emoji. | |||||
| /// Initializes a new <see cref="Emoji"/> class with the provided Unicode. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="unicode">The pure UTF-8 encoding of an emoji.</param> | /// <param name="unicode">The pure UTF-8 encoding of an emoji.</param> | ||||
| public Emoji(string unicode) | public Emoji(string unicode) | ||||
| @@ -17,14 +17,18 @@ namespace Discord | |||||
| /// <summary> | /// <summary> | ||||
| /// Gets whether this emote is animated. | /// Gets whether this emote is animated. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A boolean that determines whether or not this emote is an animated one. | |||||
| /// </returns> | |||||
| public bool Animated { get; } | public bool Animated { get; } | ||||
| /// <summary> | |||||
| /// Gets the date when this emote is created. | |||||
| /// </summary> | |||||
| /// <inheritdoc /> | |||||
| public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id); | public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the image URL of this emote. | /// Gets the image URL of this emote. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A string that points to the URL of this emote. | |||||
| /// </returns> | |||||
| public string Url => CDN.GetEmojiUrl(Id, Animated); | public string Url => CDN.GetEmojiUrl(Id, Animated); | ||||
| internal Emote(ulong id, string name, bool animated) | internal Emote(ulong id, string name, bool animated) | ||||
| @@ -59,7 +63,7 @@ namespace Discord | |||||
| } | } | ||||
| /// <summary> Parses an <see cref="Emote"/> from its raw format. </summary> | /// <summary> Parses an <see cref="Emote"/> from its raw format. </summary> | ||||
| /// <param name="text">The raw encoding of an emote; for example, <:dab:277855270321782784>.</param> | |||||
| /// <param name="text">The raw encoding of an emote (e.g. <c><:dab:277855270321782784></c>).</param> | |||||
| /// <returns>An emote.</returns> | /// <returns>An emote.</returns> | ||||
| /// <exception cref="ArgumentException">Invalid emote format.</exception> | /// <exception cref="ArgumentException">Invalid emote format.</exception> | ||||
| public static Emote Parse(string text) | public static Emote Parse(string text) | ||||
| @@ -99,6 +103,9 @@ namespace Discord | |||||
| /// <summary> | /// <summary> | ||||
| /// Returns the raw representation of the emote. | /// Returns the raw representation of the emote. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A string representing the raw presentation of the emote (e.g. <c><:thonkang:282745590985523200></c>). | |||||
| /// </returns> | |||||
| public override string ToString() => $"<{(Animated ? "a" : "")}:{Name}:{Id}>"; | public override string ToString() => $"<{(Animated ? "a" : "")}:{Name}:{Id}>"; | ||||
| } | } | ||||
| } | } | ||||
| @@ -3,7 +3,7 @@ using System.Collections.Generic; | |||||
| namespace Discord | namespace Discord | ||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Properties that are used to modify an <see cref="Emote" /> with the specified changes. | |||||
| /// Provides properties that are used to modify an <see cref="Emote" /> with the specified changes. | |||||
| /// </summary> | /// </summary> | ||||
| /// <seealso cref="IGuild.ModifyEmoteAsync"/> | /// <seealso cref="IGuild.ModifyEmoteAsync"/> | ||||
| public class EmoteProperties | public class EmoteProperties | ||||
| @@ -10,16 +10,25 @@ namespace Discord | |||||
| public class GuildEmote : Emote | public class GuildEmote : Emote | ||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets whether this emoji is managed. | |||||
| /// Gets whether this emoji is managed by an integration. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A boolean that determines whether or not this emote is managed by a Twitch integration. | |||||
| /// </returns> | |||||
| public bool IsManaged { get; } | public bool IsManaged { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets whether this emoji must be wrapped in colons. | /// Gets whether this emoji must be wrapped in colons. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A boolean that determines whether or not this emote requires the use of colons in chat to be used. | |||||
| /// </returns> | |||||
| public bool RequireColons { get; } | public bool RequireColons { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the roles this emoji is whitelisted to. | |||||
| /// Gets the roles that are allowed to use this emoji. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A read-only list containing snowflake identifiers for roles that are allowed to use this emoji. | |||||
| /// </returns> | |||||
| public IReadOnlyList<ulong> RoleIds { get; } | public IReadOnlyList<ulong> RoleIds { get; } | ||||
| internal GuildEmote(ulong id, string name, bool animated, bool isManaged, bool requireColons, IReadOnlyList<ulong> roleIds) : base(id, name, animated) | internal GuildEmote(ulong id, string name, bool animated, bool isManaged, bool requireColons, IReadOnlyList<ulong> roleIds) : base(id, name, animated) | ||||
| @@ -8,6 +8,9 @@ namespace Discord | |||||
| /// <summary> | /// <summary> | ||||
| /// Gets the display name or Unicode representation of this emote. | /// Gets the display name or Unicode representation of this emote. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A string representing the display name or the Unicode representation (e.g. <c>🤔</c>) of this emote. | |||||
| /// </returns> | |||||
| string Name { get; } | string Name { get; } | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,7 +1,7 @@ | |||||
| namespace Discord | namespace Discord | ||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Properties that are used to modify the widget of an <see cref="IGuild" /> with the specified changes. | |||||
| /// Provides properties that are used to modify the widget of an <see cref="IGuild" /> with the specified changes. | |||||
| /// </summary> | /// </summary> | ||||
| public class GuildEmbedProperties | public class GuildEmbedProperties | ||||
| { | { | ||||
| @@ -1,7 +1,7 @@ | |||||
| namespace Discord | namespace Discord | ||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Properties used to modify an <see cref="IGuildIntegration" /> with the specified changes. | |||||
| /// Provides properties used to modify an <see cref="IGuildIntegration" /> with the specified changes. | |||||
| /// </summary> | /// </summary> | ||||
| public class GuildIntegrationProperties | public class GuildIntegrationProperties | ||||
| { | { | ||||
| @@ -1,7 +1,7 @@ | |||||
| namespace Discord | namespace Discord | ||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Properties that are used to modify an <see cref="IGuild" /> with the specified changes. | |||||
| /// Provides properties that are used to modify an <see cref="IGuild" /> with the specified changes. | |||||
| /// </summary> | /// </summary> | ||||
| /// <see cref="IGuild.ModifyAsync"/> | /// <see cref="IGuild.ModifyAsync"/> | ||||
| public class GuildProperties | public class GuildProperties | ||||
| @@ -22,7 +22,7 @@ namespace Discord | |||||
| /// automatically moved to the AFK voice channel. | /// automatically moved to the AFK voice channel. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// An <see cref="Int32"/> representing the amount of time in seconds for a user to be marked as inactive | |||||
| /// An <see cref="int"/> representing the amount of time in seconds for a user to be marked as inactive | |||||
| /// and moved into the AFK voice channel. | /// and moved into the AFK voice channel. | ||||
| /// </returns> | /// </returns> | ||||
| int AFKTimeout { get; } | int AFKTimeout { get; } | ||||
| @@ -98,63 +98,88 @@ namespace Discord | |||||
| /// Gets the ID of the AFK voice channel for this guild. | /// Gets the ID of the AFK voice channel for this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// An <see cref="UInt64" /> representing the snowflake identifier of the AFK voice channel; <c>null</c> if | |||||
| /// A <see cref="ulong"/> representing the snowflake identifier of the AFK voice channel; <c>null</c> if | |||||
| /// none is set. | /// none is set. | ||||
| /// </returns> | /// </returns> | ||||
| ulong? AFKChannelId { get; } | ulong? AFKChannelId { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the ID of the the default channel for this guild. | |||||
| /// Gets the ID of the default channel for this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <remarks> | |||||
| /// This property retrieves the snowflake identifier of the first viewable text channel for this guild. | |||||
| /// <note type="warning"> | |||||
| /// This channel does not guarantee the user can send message to it, as it only looks for the first viewable | |||||
| /// text channel. | |||||
| /// </note> | |||||
| /// </remarks> | |||||
| /// <returns> | |||||
| /// A <see cref="ulong"/> representing the snowflake identifier of the default text channel; <c>0</c> if | |||||
| /// none can be found. | |||||
| /// </returns> | |||||
| ulong DefaultChannelId { get; } | ulong DefaultChannelId { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the ID of the embed channel set in the widget settings of this guild, or <c>null</c> if none is set. | |||||
| /// Gets the ID of the widget embed channel of this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A <see cref="ulong"/> representing the snowflake identifier of the embedded channel found within the | |||||
| /// widget settings of this guild; <c>null</c> if none is set. | |||||
| /// </returns> | |||||
| ulong? EmbedChannelId { get; } | ulong? EmbedChannelId { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the ID of the channel where randomized welcome messages are sent, or <c>null</c> if none is set. | |||||
| /// Gets the ID of the channel where randomized welcome messages are sent. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A <see cref="ulong"/> representing the snowflake identifier of the system channel where randomized | |||||
| /// welcome messages are sent; <c>null</c> if none is set. | |||||
| /// </returns> | |||||
| ulong? SystemChannelId { get; } | ulong? SystemChannelId { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the ID of the user that created this guild. | |||||
| /// Gets the ID of the user that owns this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A <see cref="ulong"/> representing the snowflake identifier of the user that owns this guild. | |||||
| /// </returns> | |||||
| ulong OwnerId { get; } | ulong OwnerId { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the ID of the region hosting this guild's voice channels. | /// Gets the ID of the region hosting this guild's voice channels. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A string containing the identifier for the voice region that this guild uses (e.g. <c>eu-central</c>). | |||||
| /// </returns> | |||||
| string VoiceRegionId { get; } | string VoiceRegionId { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the <see cref="IAudioClient" /> currently associated with this guild. | |||||
| /// Gets the <see cref="IAudioClient"/> currently associated with this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// <see cref="IAudioClient" /> currently associated with this guild. | |||||
| /// An <see cref="IAudioClient"/> currently associated with this guild. | |||||
| /// </returns> | /// </returns> | ||||
| IAudioClient AudioClient { get; } | IAudioClient AudioClient { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the built-in role containing all users in this guild. | /// Gets the built-in role containing all users in this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// Built-in role that represents an @everyone role in this guild. | |||||
| /// A role object that represents an <c>@everyone</c> role in this guild. | |||||
| /// </returns> | /// </returns> | ||||
| IRole EveryoneRole { get; } | IRole EveryoneRole { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a collection of all custom emotes for this guild. | /// Gets a collection of all custom emotes for this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// A collection of all custom emotes for this guild. | |||||
| /// A read-only collection of all custom emotes for this guild. | |||||
| /// </returns> | /// </returns> | ||||
| IReadOnlyCollection<GuildEmote> Emotes { get; } | IReadOnlyCollection<GuildEmote> Emotes { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a collection of all extra features added to this guild. | /// Gets a collection of all extra features added to this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// A collection of enabled features in this guild. | |||||
| /// A read-only collection of enabled features in this guild. | |||||
| /// </returns> | /// </returns> | ||||
| IReadOnlyCollection<string> Features { get; } | IReadOnlyCollection<string> Features { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a collection of all roles in this guild. | /// Gets a collection of all roles in this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// A collection of roles found within this guild. | |||||
| /// A read-only collection of roles found within this guild. | |||||
| /// </returns> | /// </returns> | ||||
| IReadOnlyCollection<IRole> Roles { get; } | IReadOnlyCollection<IRole> Roles { get; } | ||||
| @@ -164,7 +189,7 @@ namespace Discord | |||||
| /// <param name="func">The delegate containing the properties to modify the guild with.</param> | /// <param name="func">The delegate containing the properties to modify the guild with.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/>. | |||||
| /// A task that represents the asynchronous modification operation. | |||||
| /// </returns> | /// </returns> | ||||
| Task ModifyAsync(Action<GuildProperties> func, RequestOptions options = null); | Task ModifyAsync(Action<GuildProperties> func, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -173,7 +198,7 @@ namespace Discord | |||||
| /// <param name="func">The delegate containing the properties to modify the guild widget with.</param> | /// <param name="func">The delegate containing the properties to modify the guild widget with.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/>. | |||||
| /// A task that represents the asynchronous modification operation. | |||||
| /// </returns> | /// </returns> | ||||
| Task ModifyEmbedAsync(Action<GuildEmbedProperties> func, RequestOptions options = null); | Task ModifyEmbedAsync(Action<GuildEmbedProperties> func, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -182,7 +207,7 @@ namespace Discord | |||||
| /// <param name="args">The properties used to modify the channel positions with.</param> | /// <param name="args">The properties used to modify the channel positions with.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/>. | |||||
| /// A task that represents the asynchronous reorder operation. | |||||
| /// </returns> | /// </returns> | ||||
| Task ReorderChannelsAsync(IEnumerable<ReorderChannelProperties> args, RequestOptions options = null); | Task ReorderChannelsAsync(IEnumerable<ReorderChannelProperties> args, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -191,28 +216,32 @@ namespace Discord | |||||
| /// <param name="args">The properties used to modify the role positions with.</param> | /// <param name="args">The properties used to modify the role positions with.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/>. | |||||
| /// A task that represents the asynchronous reorder operation. | |||||
| /// </returns> | /// </returns> | ||||
| Task ReorderRolesAsync(IEnumerable<ReorderRoleProperties> args, RequestOptions options = null); | Task ReorderRolesAsync(IEnumerable<ReorderRoleProperties> args, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Leaves this guild. | /// Leaves this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <remarks> | /// <remarks> | ||||
| /// This method will make the currently logged-in user leave the guild. If the user is the owner, use | |||||
| /// <see cref="IDeletable.DeleteAsync" /> instead. | |||||
| /// This method will make the currently logged-in user leave the guild. | |||||
| /// <note> | |||||
| /// If the user is the owner of this guild, use <see cref="IDeletable.DeleteAsync"/> instead. | |||||
| /// </note> | |||||
| /// </remarks> | /// </remarks> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/>. | |||||
| /// A task that represents the asynchronous leave operation. | |||||
| /// </returns> | /// </returns> | ||||
| Task LeaveAsync(RequestOptions options = null); | Task LeaveAsync(RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a collection of all users banned on this guild. | |||||
| /// Gets a collection of all users banned in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a collection of banned users with reasons. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a read-only collection of | |||||
| /// ban objects that this guild currently possesses, with each object containing the user banned and reason | |||||
| /// behind the ban. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IReadOnlyCollection<IBan>> GetBansAsync(RequestOptions options = null); | Task<IReadOnlyCollection<IBan>> GetBansAsync(RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -221,8 +250,8 @@ namespace Discord | |||||
| /// <param name="user">The banned user.</param> | /// <param name="user">The banned user.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the ban object, which contains the user information and the | |||||
| /// reason for the ban; <c>null</c> if the ban entry cannot be found. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a ban object, which | |||||
| /// contains the user information and the reason for the ban; <c>null</c> if the ban entry cannot be found. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IBan> GetBanAsync(IUser user, RequestOptions options = null); | Task<IBan> GetBanAsync(IUser user, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -231,216 +260,197 @@ namespace Discord | |||||
| /// <param name="userId">The snowflake identifier for the banned user.</param> | /// <param name="userId">The snowflake identifier for the banned user.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the ban object, which contains the user information and the | |||||
| /// reason for the ban; <c>null</c> if the ban entry cannot be found. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a ban object, which | |||||
| /// contains the user information and the reason for the ban; <c>null</c> if the ban entry cannot be found. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IBan> GetBanAsync(ulong userId, RequestOptions options = null); | Task<IBan> GetBanAsync(ulong userId, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Bans the user from this guild and optionally prunes their recent messages. | /// Bans the user from this guild and optionally prunes their recent messages. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="user">The user to ban.</param> | /// <param name="user">The user to ban.</param> | ||||
| /// <param name="pruneDays"> | |||||
| /// The number of days to remove messages from this <paramref name="user" /> for - must be between [0, 7]. | |||||
| /// </param> | |||||
| /// <param name="pruneDays">The number of days to remove messages from this user for, and this number must be between [0, 7].</param> | |||||
| /// <param name="reason">The reason of the ban to be written in the audit log.</param> | /// <param name="reason">The reason of the ban to be written in the audit log.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <exception cref="ArgumentException"><paramref name="pruneDays" /> is not between 0 to 7.</exception> | |||||
| /// <exception cref="ArgumentException"><paramref name="pruneDays"/> is not between 0 to 7.</exception> | |||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/>. | |||||
| /// A task that represents the asynchronous add operation for the ban. | |||||
| /// </returns> | /// </returns> | ||||
| Task AddBanAsync(IUser user, int pruneDays = 0, string reason = null, RequestOptions options = null); | Task AddBanAsync(IUser user, int pruneDays = 0, string reason = null, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Bans the user from this guild and optionally prunes their recent messages. | /// Bans the user from this guild and optionally prunes their recent messages. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="userId">The snowflake ID of the user to ban.</param> | /// <param name="userId">The snowflake ID of the user to ban.</param> | ||||
| /// <param name="pruneDays"> | |||||
| /// The number of days to remove messages from this user for - must be between [0, 7]. | |||||
| /// </param> | |||||
| /// <param name="pruneDays">The number of days to remove messages from this user for, and this number must be between [0, 7].</param> | |||||
| /// <param name="reason">The reason of the ban to be written in the audit log.</param> | /// <param name="reason">The reason of the ban to be written in the audit log.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <exception cref="ArgumentException"><paramref name="pruneDays" /> is not between 0 to 7.</exception> | |||||
| /// <exception cref="ArgumentException"><paramref name="pruneDays"/> is not between 0 to 7.</exception> | |||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/>. | |||||
| /// A task that represents the asynchronous add operation for the ban. | |||||
| /// </returns> | /// </returns> | ||||
| Task AddBanAsync(ulong userId, int pruneDays = 0, string reason = null, RequestOptions options = null); | Task AddBanAsync(ulong userId, int pruneDays = 0, string reason = null, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Unbans the provided user if they are currently banned. | |||||
| /// Unbans the user if they are currently banned. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="user">The user to be unbanned.</param> | /// <param name="user">The user to be unbanned.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/>. | |||||
| /// A task that represents the asynchronous removal operation for the ban. | |||||
| /// </returns> | /// </returns> | ||||
| Task RemoveBanAsync(IUser user, RequestOptions options = null); | Task RemoveBanAsync(IUser user, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Unbans the provided user ID if it is currently banned. | |||||
| /// Unbans the user if they are currently banned. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="userId">The snowflake ID of the user to be unbanned.</param> | |||||
| /// <param name="userId">The snowflake identifier of the user to be unbanned.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/>. | |||||
| /// A task that represents the asynchronous removal operation for the ban. | |||||
| /// </returns> | /// </returns> | ||||
| Task RemoveBanAsync(ulong userId, RequestOptions options = null); | Task RemoveBanAsync(ulong userId, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a collection of all channels in this guild. | /// Gets a collection of all channels in this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="mode"> | |||||
| /// The <see cref="CacheMode" /> that determines whether the object should be fetched from cache. | |||||
| /// </param> | |||||
| /// <param name="mode">The <see cref="CacheMode" /> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a collection of generic channels found within this guild. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a read-only collection of | |||||
| /// generic channels found within this guild. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IReadOnlyCollection<IGuildChannel>> GetChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<IReadOnlyCollection<IGuildChannel>> GetChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the channel in this guild with the provided ID. | |||||
| /// Gets a channel in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="id">The channel ID.</param> | |||||
| /// <param name="mode"> | |||||
| /// The <see cref="CacheMode" /> that determines whether the object should be fetched from cache. | |||||
| /// </param> | |||||
| /// <param name="id">The snowflake identifier for the channel.</param> | |||||
| /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the generic channel with the specified ID, or | |||||
| /// <c>null</c> if none is found. | |||||
| /// A task that represents the asynchronous get operation. The task result contains the generic channel | |||||
| /// associated with the specified <paramref name="id"/>; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IGuildChannel> GetChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<IGuildChannel> GetChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a collection of all text channels in this guild. | /// Gets a collection of all text channels in this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="mode"> | |||||
| /// The <see cref="CacheMode" /> that determines whether the object should be fetched from cache. | |||||
| /// </param> | |||||
| /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a collection of text channels found within this guild. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a read-only collection of | |||||
| /// message channels found within this guild. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IReadOnlyCollection<ITextChannel>> GetTextChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<IReadOnlyCollection<ITextChannel>> GetTextChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a text channel in this guild with the provided ID, or <c>null</c> if not found. | |||||
| /// Gets a text channel in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="id">The text channel ID.</param> | |||||
| /// <param name="mode"> | |||||
| /// The <see cref="CacheMode" /> that determines whether the object should be fetched from cache. | |||||
| /// </param> | |||||
| /// <param name="id">The snowflake identifier for the text channel.</param> | |||||
| /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the text channel with the specified ID, or | |||||
| /// <c>null</c> if none is found. | |||||
| /// A task that represents the asynchronous get operation. The task result contains the text channel | |||||
| /// associated with the specified <paramref name="id"/>; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| Task<ITextChannel> GetTextChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<ITextChannel> GetTextChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a collection of all voice channels in this guild. | /// Gets a collection of all voice channels in this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="mode"> | |||||
| /// The <see cref="CacheMode" /> that determines whether the object should be fetched from cache. | |||||
| /// </param> | |||||
| /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a collection of voice channels found within this guild. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a read-only collection of | |||||
| /// voice channels found within this guild. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IReadOnlyCollection<IVoiceChannel>> GetVoiceChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<IReadOnlyCollection<IVoiceChannel>> GetVoiceChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a collection of all category channels in this guild. | /// Gets a collection of all category channels in this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="mode"> | |||||
| /// The <see cref="CacheMode" /> that determines whether the object should be fetched from cache. | |||||
| /// </param> | |||||
| /// <param name="mode">The <see cref="CacheMode" /> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a collection of category channels found within this guild. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a read-only collection of | |||||
| /// category channels found within this guild. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IReadOnlyCollection<ICategoryChannel>> GetCategoriesAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<IReadOnlyCollection<ICategoryChannel>> GetCategoriesAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the voice channel in this guild with the provided ID. | |||||
| /// Gets a voice channel in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="id">The text channel ID.</param> | |||||
| /// <param name="mode"> | |||||
| /// The <see cref="CacheMode" /> that determines whether the object should be fetched from cache. | |||||
| /// </param> | |||||
| /// <param name="id">The snowflake identifier for the voice channel.</param> | |||||
| /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the voice channel with the specified ID, or | |||||
| /// <c>null</c> if none is found. | |||||
| /// A task that represents the asynchronous get operation. The task result contains the voice channel associated | |||||
| /// with the specified <paramref name="id"/>; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IVoiceChannel> GetVoiceChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<IVoiceChannel> GetVoiceChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the AFK voice channel in this guild. | /// Gets the AFK voice channel in this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="mode"> | |||||
| /// The <see cref="CacheMode" /> that determines whether the object should be fetched from cache. | |||||
| /// </param> | |||||
| /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the AFK voice channel set within this guild, or | |||||
| /// <c>null</c> if none is set. | |||||
| /// A task that represents the asynchronous get operation. The task result contains the voice channel that the | |||||
| /// AFK users will be moved to after they have idled for too long; <c>null</c> if none is set. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IVoiceChannel> GetAFKChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<IVoiceChannel> GetAFKChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the default system text channel in this guild with the provided ID. | |||||
| /// Gets the system channel where randomized welcome messages are sent in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="mode"> | |||||
| /// The <see cref="CacheMode" /> that determines whether the object should be fetched from cache. | |||||
| /// </param> | |||||
| /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the system channel within this guild, or | |||||
| /// <c>null</c> if none is set. | |||||
| /// A task that represents the asynchronous get operation. The task result contains the text channel where | |||||
| /// randomized welcome messages will be sent to; <c>null</c> if none is set. | |||||
| /// </returns> | /// </returns> | ||||
| Task<ITextChannel> GetSystemChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<ITextChannel> GetSystemChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the top viewable text channel in this guild with the provided ID. | |||||
| /// Gets the first viewable text channel in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="mode"> | |||||
| /// The <see cref="CacheMode" /> that determines whether the object should be fetched from cache. | |||||
| /// </param> | |||||
| /// <param name="mode">The <see cref="CacheMode" /> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the first viewable text channel in this guild, or | |||||
| /// <c>null</c> if none is found. | |||||
| /// A task that represents the asynchronous get operation. The task result contains the first viewable text | |||||
| /// channel in this guild; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| Task<ITextChannel> GetDefaultChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<ITextChannel> GetDefaultChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the embed channel (i.e. the channel set in the guild's widget settings) in this guild. | /// Gets the embed channel (i.e. the channel set in the guild's widget settings) in this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="mode"> | |||||
| /// The <see cref="CacheMode" /> that determines whether the object should be fetched from cache. | |||||
| /// </param> | |||||
| /// <param name="mode">The <see cref="CacheMode" /> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the embed channel set within the server's widget settings, or | |||||
| /// <c>null</c> if none is set. | |||||
| /// A task that represents the asynchronous get operation. The task result contains the embed channel set | |||||
| /// within the server's widget settings; <c>null</c> if none is set. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IGuildChannel> GetEmbedChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<IGuildChannel> GetEmbedChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Creates a new text channel. | |||||
| /// Creates a new text channel in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="name">The new name for the text channel.</param> | /// <param name="name">The new name for the text channel.</param> | ||||
| /// <param name="func">The delegate containing the properties to be applied to the channel upon its creation.</param> | /// <param name="func">The delegate containing the properties to be applied to the channel upon its creation.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the newly created text channel. | |||||
| /// A task that represents the asynchronous creation operation. The task result contains the newly created | |||||
| /// text channel. | |||||
| /// </returns> | /// </returns> | ||||
| Task<ITextChannel> CreateTextChannelAsync(string name, Action<TextChannelProperties> func = null, RequestOptions options = null); | Task<ITextChannel> CreateTextChannelAsync(string name, Action<TextChannelProperties> func = null, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Creates a new voice channel. | |||||
| /// Creates a new voice channel in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="name">The new name for the voice channel.</param> | /// <param name="name">The new name for the voice channel.</param> | ||||
| /// <param name="func">The delegate containing the properties to be applied to the channel upon its creation.</param> | /// <param name="func">The delegate containing the properties to be applied to the channel upon its creation.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the newly created voice channel. | |||||
| /// A task that represents the asynchronous creation operation. The task result contains the newly created | |||||
| /// voice channel. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IVoiceChannel> CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null); | Task<IVoiceChannel> CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Creates a new channel category. | |||||
| /// Creates a new channel category in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="name">The new name for the category.</param> | /// <param name="name">The new name for the category.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the newly created category channel. | |||||
| /// A task that represents the asynchronous creation operation. The task result contains the newly created | |||||
| /// category channel. | |||||
| /// </returns> | /// </returns> | ||||
| Task<ICategoryChannel> CreateCategoryAsync(string name, RequestOptions options = null); | Task<ICategoryChannel> CreateCategoryAsync(string name, RequestOptions options = null); | ||||
| @@ -448,11 +458,12 @@ namespace Discord | |||||
| Task<IGuildIntegration> CreateIntegrationAsync(ulong id, string type, RequestOptions options = null); | Task<IGuildIntegration> CreateIntegrationAsync(ulong id, string type, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a collection of all invites to this guild. | |||||
| /// Gets a collection of all invites in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a collection of invites found within this guild. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a read-only collection of | |||||
| /// invite metadata, each representing information for an invite found within this guild. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IReadOnlyCollection<IInviteMetadata>> GetInvitesAsync(RequestOptions options = null); | Task<IReadOnlyCollection<IInviteMetadata>> GetInvitesAsync(RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -460,17 +471,17 @@ namespace Discord | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the partial metadata of the vanity invite found within | |||||
| /// this guild. | |||||
| /// A task that represents the asynchronous get operation. The task result contains the partial metadata of | |||||
| /// the vanity invite found within this guild; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IInviteMetadata> GetVanityInviteAsync(RequestOptions options = null); | Task<IInviteMetadata> GetVanityInviteAsync(RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a role in this guild. | /// Gets a role in this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="id">The role ID.</param> | |||||
| /// <param name="id">The snowflake identifier for the role.</param> | |||||
| /// <returns> | /// <returns> | ||||
| /// A role that matches the provided snowflake identifier; <c>null</c> if none is found. | |||||
| /// A role that is associated with the specified <paramref name="id"/>; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| IRole GetRole(ulong id); | IRole GetRole(ulong id); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -482,7 +493,8 @@ namespace Discord | |||||
| /// <param name="isHoisted">Whether the role is separated from others on the sidebar.</param> | /// <param name="isHoisted">Whether the role is separated from others on the sidebar.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the newly crated role. | |||||
| /// A task that represents the asynchronous creation operation. The task result contains the newly created | |||||
| /// role. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IRole> CreateRoleAsync(string name, GuildPermissions? permissions = null, Color? color = null, bool isHoisted = false, RequestOptions options = null); | Task<IRole> CreateRoleAsync(string name, GuildPermissions? permissions = null, Color? color = null, bool isHoisted = false, RequestOptions options = null); | ||||
| @@ -492,27 +504,33 @@ namespace Discord | |||||
| /// <remarks> | /// <remarks> | ||||
| /// This method retrieves all users found within this guild. | /// This method retrieves all users found within this guild. | ||||
| /// <note> | /// <note> | ||||
| /// This may return an incomplete list on the WebSocket implementation. | |||||
| /// This may return an incomplete collection in the WebSocket implementation due to how Discord does not | |||||
| /// send a complete user list for large guilds. | |||||
| /// </note> | /// </note> | ||||
| /// </remarks> | /// </remarks> | ||||
| /// <param name="mode"> | |||||
| /// The <see cref="CacheMode" /> that determines whether the object should be fetched from cache. | |||||
| /// </param> | |||||
| /// <param name="mode">The <see cref="CacheMode" /> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a collection of users found within this guild. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a collection of guild | |||||
| /// users found within this guild. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IReadOnlyCollection<IGuildUser>> GetUsersAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<IReadOnlyCollection<IGuildUser>> GetUsersAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a user found in this guild. | |||||
| /// Gets a user from this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="id">The user ID to search for.</param> | |||||
| /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from | |||||
| /// cache.</param> | |||||
| /// <remarks> | |||||
| /// This method retrieves a user found within this guild. | |||||
| /// <note> | |||||
| /// This may return <c>null</c> in the WebSocket implementation due to incomplete user collection in | |||||
| /// large guilds. | |||||
| /// </note> | |||||
| /// </remarks> | |||||
| /// <param name="id">The snowflake identifier of the user.</param> | |||||
| /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the guild user with the specified ID; <c>null</c> if none is | |||||
| /// found. | |||||
| /// A task that represents the asynchronous get operation. The task result contains the guild user | |||||
| /// associated with the specified <paramref name="id"/>; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IGuildUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<IGuildUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -521,7 +539,8 @@ namespace Discord | |||||
| /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the currently logged-in user within this guild. | |||||
| /// A task that represents the asynchronous get operation. The task result contains the currently logged-in | |||||
| /// user within this guild. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IGuildUser> GetCurrentUserAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<IGuildUser> GetCurrentUserAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -530,29 +549,34 @@ namespace Discord | |||||
| /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | /// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the owner of this guild. | |||||
| /// A task that represents the asynchronous get operation. The task result contains the owner of this guild. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IGuildUser> GetOwnerAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<IGuildUser> GetOwnerAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Downloads all users for this guild if the current list is incomplete. | /// Downloads all users for this guild if the current list is incomplete. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/>. | |||||
| /// A task that represents the asynchronous download operation. | |||||
| /// </returns> | /// </returns> | ||||
| Task DownloadUsersAsync(); | Task DownloadUsersAsync(); | ||||
| /// <summary> | /// <summary> | ||||
| /// Prunes inactive users. | /// Prunes inactive users. | ||||
| /// </summary> | /// </summary> | ||||
| /// <remarks> | /// <remarks> | ||||
| /// This method removes all users that have not logged on in the provided number of days or, if | |||||
| /// <paramref name="simulate"/> is <c>true</c>, returns the number of users that would be removed. | |||||
| /// <para> | |||||
| /// This method removes all users that have not logged on in the provided number of <paramref name="days"/>. | |||||
| /// </para> | |||||
| /// <para> | |||||
| /// If <paramref name="simulate" /> is <c>true</c>, this method will only return the number of users that | |||||
| /// would be removed without kicking the users. | |||||
| /// </para> | |||||
| /// </remarks> | /// </remarks> | ||||
| /// <param name="days">The number of days required for the users to be kicked.</param> | /// <param name="days">The number of days required for the users to be kicked.</param> | ||||
| /// <param name="simulate">Whether this prune action is a simulation.</param> | /// <param name="simulate">Whether this prune action is a simulation.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task" /> containing the number of users to be or has been removed from this | |||||
| /// guild. | |||||
| /// A task that represents the asynchronous prune operation. The task result contains the number of users to | |||||
| /// be or has been removed from this guild. | |||||
| /// </returns> | /// </returns> | ||||
| Task<int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null); | Task<int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null); | ||||
| @@ -560,12 +584,11 @@ namespace Discord | |||||
| /// Gets the specified number of audit log entries for this guild. | /// Gets the specified number of audit log entries for this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="limit">The number of audit log entries to fetch.</param> | /// <param name="limit">The number of audit log entries to fetch.</param> | ||||
| /// <param name="mode"> | |||||
| /// The <see cref="CacheMode" /> that determines whether the object should be fetched from cache. | |||||
| /// </param> | |||||
| /// <param name="mode">The <see cref="CacheMode" /> that determines whether the object should be fetched from cache.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a collection of requested audit log entries. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a read-only collection | |||||
| /// of the requested audit log entries. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IReadOnlyCollection<IAuditLogEntry>> GetAuditLogAsync(int limit = DiscordConfig.MaxAuditLogEntriesPerBatch, | Task<IReadOnlyCollection<IAuditLogEntry>> GetAuditLogAsync(int limit = DiscordConfig.MaxAuditLogEntriesPerBatch, | ||||
| CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
| @@ -573,11 +596,11 @@ namespace Discord | |||||
| /// <summary> | /// <summary> | ||||
| /// Gets a webhook found within this guild. | /// Gets a webhook found within this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="id">The webhook ID.</param> | |||||
| /// <param name="id">The identifier for the webhook.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the webhook with the specified ID; <c>null</c> if none is | |||||
| /// found. | |||||
| /// A task that represents the asynchronous get operation. The task result contains the webhook with the | |||||
| /// specified <paramref name="id"/>; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IWebhook> GetWebhookAsync(ulong id, RequestOptions options = null); | Task<IWebhook> GetWebhookAsync(ulong id, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -585,18 +608,19 @@ namespace Discord | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a collection of webhooks found within the guild. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a read-only collection | |||||
| /// of webhooks found within the guild. | |||||
| /// </returns> | /// </returns> | ||||
| Task<IReadOnlyCollection<IWebhook>> GetWebhooksAsync(RequestOptions options = null); | Task<IReadOnlyCollection<IWebhook>> GetWebhooksAsync(RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a specific emote from this guild. | /// Gets a specific emote from this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="id">The guild emote ID.</param> | |||||
| /// <param name="id">The snowflake identifier for the guild emote.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the emote found with the specified ID; <c>null</c> if none is | |||||
| /// found. | |||||
| /// A task that represents the asynchronous get operation. The task result contains the emote found with the | |||||
| /// specified <paramref name="id"/>; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null); | Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -607,7 +631,7 @@ namespace Discord | |||||
| /// <param name="roles">The roles to limit the emote usage to.</param> | /// <param name="roles">The roles to limit the emote usage to.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the created emote. | |||||
| /// A task that represents the asynchronous creation operation. The task result contains the created emote. | |||||
| /// </returns> | /// </returns> | ||||
| Task<GuildEmote> CreateEmoteAsync(string name, Image image, Optional<IEnumerable<IRole>> roles = default(Optional<IEnumerable<IRole>>), RequestOptions options = null); | Task<GuildEmote> CreateEmoteAsync(string name, Image image, Optional<IEnumerable<IRole>> roles = default(Optional<IEnumerable<IRole>>), RequestOptions options = null); | ||||
| @@ -618,7 +642,8 @@ namespace Discord | |||||
| /// <param name="func">The delegate containing the properties to modify the emote with.</param> | /// <param name="func">The delegate containing the properties to modify the emote with.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing the newly modified emote. | |||||
| /// A task that represents the asynchronous modification operation. The task result contains the modified | |||||
| /// emote. | |||||
| /// </returns> | /// </returns> | ||||
| Task<GuildEmote> ModifyEmoteAsync(GuildEmote emote, Action<EmoteProperties> func, RequestOptions options = null); | Task<GuildEmote> ModifyEmoteAsync(GuildEmote emote, Action<EmoteProperties> func, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -627,7 +652,7 @@ namespace Discord | |||||
| /// <param name="emote">The emote to delete.</param> | /// <param name="emote">The emote to delete.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/>. | |||||
| /// A task that represents the asynchronous removal operation. | |||||
| /// </returns> | /// </returns> | ||||
| Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null); | Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null); | ||||
| } | } | ||||
| @@ -148,7 +148,7 @@ namespace Discord | |||||
| RawValue = value; | RawValue = value; | ||||
| } | } | ||||
| /// <summary> Creates a new <see cref="GuildPermissions"/> with the provided permissions. </summary> | |||||
| /// <summary> Creates a new <see cref="GuildPermissions"/> structure with the provided permissions. </summary> | |||||
| public GuildPermissions( | public GuildPermissions( | ||||
| bool createInstantInvite = false, | bool createInstantInvite = false, | ||||
| bool kickMembers = false, | bool kickMembers = false, | ||||
| @@ -18,61 +18,60 @@ namespace Discord | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/1ABC9C">1ABC9C</see>.</returns> | /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/1ABC9C">1ABC9C</see>.</returns> | ||||
| public static readonly Color Teal = new Color(0x1ABC9C); | public static readonly Color Teal = new Color(0x1ABC9C); | ||||
| /// <summary> Gets the dark teal color value. </summary> | /// <summary> Gets the dark teal color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/11806A">11806A</see>.</returns> | |||||
| public static readonly Color DarkTeal = new Color(0x11806A); | public static readonly Color DarkTeal = new Color(0x11806A); | ||||
| /// <summary> Gets the green color value. </summary> | /// <summary> Gets the green color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/2ECC71">2ECC71</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/11806A">11806A</see>.</returns> | |||||
| public static readonly Color Green = new Color(0x2ECC71); | public static readonly Color Green = new Color(0x2ECC71); | ||||
| /// <summary> Gets the dark green color value. </summary> | /// <summary> Gets the dark green color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/1F8B4C">1F8B4C</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/2ECC71">2ECC71</see>.</returns> | |||||
| public static readonly Color DarkGreen = new Color(0x1F8B4C); | public static readonly Color DarkGreen = new Color(0x1F8B4C); | ||||
| /// <summary> Gets the blue color value. </summary> | /// <summary> Gets the blue color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/3498DB">3498DB</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/1F8B4C">1F8B4C</see>.</returns> | |||||
| public static readonly Color Blue = new Color(0x3498DB); | public static readonly Color Blue = new Color(0x3498DB); | ||||
| /// <summary> Gets the dark blue color value. </summary> | /// <summary> Gets the dark blue color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/206694">206694</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/3498DB">3498DB</see>.</returns> | |||||
| public static readonly Color DarkBlue = new Color(0x206694); | public static readonly Color DarkBlue = new Color(0x206694); | ||||
| /// <summary> Gets the purple color value. </summary> | /// <summary> Gets the purple color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/9B59B6">9B59B6</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/206694">206694</see>.</returns> | |||||
| public static readonly Color Purple = new Color(0x9B59B6); | public static readonly Color Purple = new Color(0x9B59B6); | ||||
| /// <summary> Gets the dark purple color value. </summary> | /// <summary> Gets the dark purple color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/71368A">71368A</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/9B59B6">9B59B6</see>.</returns> | |||||
| public static readonly Color DarkPurple = new Color(0x71368A); | public static readonly Color DarkPurple = new Color(0x71368A); | ||||
| /// <summary> Gets the magenta color value. </summary> | /// <summary> Gets the magenta color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/E91E63">E91E63</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/71368A">71368A</see>.</returns> | |||||
| public static readonly Color Magenta = new Color(0xE91E63); | public static readonly Color Magenta = new Color(0xE91E63); | ||||
| /// <summary> Gets the dark magenta color value. </summary> | /// <summary> Gets the dark magenta color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/AD1457">AD1457</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/E91E63">E91E63</see>.</returns> | |||||
| public static readonly Color DarkMagenta = new Color(0xAD1457); | public static readonly Color DarkMagenta = new Color(0xAD1457); | ||||
| /// <summary> Gets the gold color value. </summary> | /// <summary> Gets the gold color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/F1C40F">F1C40F</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/AD1457">AD1457</see>.</returns> | |||||
| public static readonly Color Gold = new Color(0xF1C40F); | public static readonly Color Gold = new Color(0xF1C40F); | ||||
| /// <summary> Gets the light orange color value. </summary> | /// <summary> Gets the light orange color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/C27C0E">C27C0E</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/F1C40F">F1C40F</see>.</returns> | |||||
| public static readonly Color LightOrange = new Color(0xC27C0E); | public static readonly Color LightOrange = new Color(0xC27C0E); | ||||
| /// <summary> Gets the orange color value. </summary> | /// <summary> Gets the orange color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/E67E22">E67E22</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/C27C0E">C27C0E</see>.</returns> | |||||
| public static readonly Color Orange = new Color(0xE67E22); | public static readonly Color Orange = new Color(0xE67E22); | ||||
| /// <summary> Gets the dark orange color value. </summary> | /// <summary> Gets the dark orange color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/A84300">A84300</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/E67E22">E67E22</see>.</returns> | |||||
| public static readonly Color DarkOrange = new Color(0xA84300); | public static readonly Color DarkOrange = new Color(0xA84300); | ||||
| /// <summary> Gets the red color value. </summary> | /// <summary> Gets the red color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/E74C3C">E74C3C</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/A84300">A84300</see>.</returns> | |||||
| public static readonly Color Red = new Color(0xE74C3C); | public static readonly Color Red = new Color(0xE74C3C); | ||||
| /// <summary> Gets the dark red color value. </summary> | /// <summary> Gets the dark red color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/992D22">992D22</see>.</returns> | |||||
| public static readonly Color DarkRed = new Color(0x992D22); | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/E74C3C">E74C3C</see>.</returns> | |||||
| public static readonly Color DarkRed = new Color(0x992D22); | |||||
| /// <summary> Gets the light grey color value. </summary> | /// <summary> Gets the light grey color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/979C9F">979C9F</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/992D22">992D22</see>.</returns> | |||||
| public static readonly Color LightGrey = new Color(0x979C9F); | public static readonly Color LightGrey = new Color(0x979C9F); | ||||
| /// <summary> Gets the lighter grey color value. </summary> | /// <summary> Gets the lighter grey color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/95A5A6">95A5A6</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/979C9F">979C9F</see>.</returns> | |||||
| public static readonly Color LighterGrey = new Color(0x95A5A6); | public static readonly Color LighterGrey = new Color(0x95A5A6); | ||||
| /// <summary> Gets the dark grey color value. </summary> | /// <summary> Gets the dark grey color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/607D8B">607D8B</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/95A5A6">95A5A6</see>.</returns> | |||||
| public static readonly Color DarkGrey = new Color(0x607D8B); | public static readonly Color DarkGrey = new Color(0x607D8B); | ||||
| /// <summary> Gets the darker grey color value. </summary> | /// <summary> Gets the darker grey color value. </summary> | ||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/546E7A">546E7A</see>.</returns> | |||||
| /// <returns> A color class with the hex value of <see href="http://www.color-hex.com/color/607D8B">607D8B</see>.</returns> | |||||
| public static readonly Color DarkerGrey = new Color(0x546E7A); | public static readonly Color DarkerGrey = new Color(0x546E7A); | ||||
| /// <summary> Gets the encoded value for this color. </summary> | /// <summary> Gets the encoded value for this color. </summary> | ||||
| @@ -16,7 +16,7 @@ namespace Discord | |||||
| /// Gets the new zero-based position of the role. | /// Gets the new zero-based position of the role. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// A <see cref="int"/> representing the new zero-based position of the role. | |||||
| /// An <see cref="int"/> representing the new zero-based position of the role. | |||||
| /// </returns> | /// </returns> | ||||
| public int Position { get; } | public int Position { get; } | ||||
| @@ -10,36 +10,60 @@ namespace Discord | |||||
| public interface IGuildUser : IUser, IVoiceState | public interface IGuildUser : IUser, IVoiceState | ||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets when this user joined this guild. | |||||
| /// Gets when this user joined the guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A <see cref="DateTimeOffset"/> representing the time of which the user has joined the guild; | |||||
| /// <c>null</c> when it cannot be obtained. | |||||
| /// </returns> | |||||
| DateTimeOffset? JoinedAt { get; } | DateTimeOffset? JoinedAt { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the nickname for this user. | /// Gets the nickname for this user. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A string representing the nickname of the user; <c>null</c> if none is set. | |||||
| /// </returns> | |||||
| string Nickname { get; } | string Nickname { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the guild-level permissions for this user. | /// Gets the guild-level permissions for this user. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A <see cref="Discord.GuildPermissions"/> structure for this user, representing what | |||||
| /// permissions this user has in the guild. | |||||
| /// </returns> | |||||
| GuildPermissions GuildPermissions { get; } | GuildPermissions GuildPermissions { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the guild for this user. | /// Gets the guild for this user. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A guild object that this user belongs to. | |||||
| /// </returns> | |||||
| IGuild Guild { get; } | IGuild Guild { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the ID of the guild for this user. | /// Gets the ID of the guild for this user. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// An <see cref="ulong"/> representing the snowflake identifier of the guild that this user belongs to. | |||||
| /// </returns> | |||||
| ulong GuildId { get; } | ulong GuildId { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Returns a collection of the ids of the roles this user is a member of in this guild, including the | |||||
| /// guild's @everyone role. | |||||
| /// Gets a collection of IDs for the roles that this user currently possesses in the guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A read-only collection of <see cref="ulong"/>, each representing a snowflake identifier for a role that | |||||
| /// this user posesses. | |||||
| /// </returns> | |||||
| IReadOnlyCollection<ulong> RoleIds { get; } | IReadOnlyCollection<ulong> RoleIds { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the level permissions granted to this user to a given channel. | /// Gets the level permissions granted to this user to a given channel. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="channel">The channel to get the permission from.</param> | /// <param name="channel">The channel to get the permission from.</param> | ||||
| /// <returns> | |||||
| /// A <see cref="Discord.ChannelPermissions"/> structure representing the permissions that a user has in the | |||||
| /// specified channel. | |||||
| /// </returns> | |||||
| ChannelPermissions GetPermissions(IGuildChannel channel); | ChannelPermissions GetPermissions(IGuildChannel channel); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -47,37 +71,56 @@ namespace Discord | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="reason">The reason for the kick which will be recorded in the audit log.</param> | /// <param name="reason">The reason for the kick which will be recorded in the audit log.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | |||||
| /// A task that represents the asynchronous kick operation. | |||||
| /// </returns> | |||||
| Task KickAsync(string reason = null, RequestOptions options = null); | Task KickAsync(string reason = null, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Modifies this user's properties in this guild. | /// Modifies this user's properties in this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="func">The properties to modify the user with.</param> | |||||
| /// <param name="func">The delegate containing the properties to modify the user with.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | |||||
| /// A task that represents the asynchronous modification operation. | |||||
| /// </returns> | |||||
| /// <seealso cref="Discord.GuildUserProperties"/> | |||||
| Task ModifyAsync(Action<GuildUserProperties> func, RequestOptions options = null); | Task ModifyAsync(Action<GuildUserProperties> func, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Adds a <paramref name="role"/> to this user in this guild. | |||||
| /// Adds the specified <paramref name="role"/> to this user in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="role">The role to be added to the user.</param> | /// <param name="role">The role to be added to the user.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | |||||
| /// A task that represents the asynchronous role addition operation. | |||||
| /// </returns> | |||||
| Task AddRoleAsync(IRole role, RequestOptions options = null); | Task AddRoleAsync(IRole role, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Adds <paramref name="roles"/> to this user in this guild. | |||||
| /// Adds the specified <paramref name="roles"/> to this user in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="roles">The roles to be added to the user.</param> | /// <param name="roles">The roles to be added to the user.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | |||||
| /// A task that represents the asynchronous role addition operation. | |||||
| /// </returns> | |||||
| Task AddRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null); | Task AddRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Removes a <paramref name="role"/> from this user in this guild. | |||||
| /// Removes the specified <paramref name="role"/> from this user in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="role">The role to be removed from the user.</param> | /// <param name="role">The role to be removed from the user.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | |||||
| /// A task that represents the asynchronous role removal operation. | |||||
| /// </returns> | |||||
| Task RemoveRoleAsync(IRole role, RequestOptions options = null); | Task RemoveRoleAsync(IRole role, RequestOptions options = null); | ||||
| /// <summary> | /// <summary> | ||||
| /// Removes <paramref name="roles"/> from this user in this guild. | |||||
| /// Removes the specified <paramref name="roles"/> from this user in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="roles">The roles to be removed from the user.</param> | /// <param name="roles">The roles to be removed from the user.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | |||||
| /// A task that represents the asynchronous role removal operation. | |||||
| /// </returns> | |||||
| Task RemoveRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null); | Task RemoveRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null); | ||||
| } | } | ||||
| } | } | ||||
| @@ -13,12 +13,18 @@ namespace Discord | |||||
| /// </summary> | /// </summary> | ||||
| string Email { get; } | string Email { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Returns <c>true</c> if this user's email has been verified. | |||||
| /// Indicates whether or not this user has their email verified. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// <c>true</c> if this user's email has been verified; <c>false</c> if not. | |||||
| /// </returns> | |||||
| bool IsVerified { get; } | bool IsVerified { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Returns <c>true</c> if this user has enabled MFA on their account. | |||||
| /// Indicates whether or not this user has MFA enabled on their account. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// <c>true</c> if this user has enabled multi-factor authentication on their account; <c>false</c> if not. | |||||
| /// </returns> | |||||
| bool IsMfaEnabled { get; } | bool IsMfaEnabled { get; } | ||||
| /// <summary> | /// <summary> | ||||
| @@ -3,7 +3,7 @@ using System; | |||||
| namespace Discord.Net | namespace Discord.Net | ||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Describes an exception that indicates the user is being rate limited by Discord. | |||||
| /// The exception that is thrown when the user is being rate limited by Discord. | |||||
| /// </summary> | /// </summary> | ||||
| public class RateLimitedException : TimeoutException | public class RateLimitedException : TimeoutException | ||||
| { | { | ||||
| @@ -16,14 +16,13 @@ namespace Discord.Rest | |||||
| { | { | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public string Topic { get; private set; } | public string Topic { get; private set; } | ||||
| /// <inheritdoc /> | |||||
| public ulong? CategoryId { get; private set; } | public ulong? CategoryId { get; private set; } | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public string Mention => MentionUtils.MentionChannel(Id); | public string Mention => MentionUtils.MentionChannel(Id); | ||||
| private bool _nsfw; | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public bool IsNsfw => _nsfw; | |||||
| public bool IsNsfw { get; private set; } | |||||
| internal RestTextChannel(BaseDiscordClient discord, IGuild guild, ulong id) | internal RestTextChannel(BaseDiscordClient discord, IGuild guild, ulong id) | ||||
| : base(discord, guild, id) | : base(discord, guild, id) | ||||
| @@ -40,7 +39,7 @@ namespace Discord.Rest | |||||
| base.Update(model); | base.Update(model); | ||||
| CategoryId = model.CategoryId; | CategoryId = model.CategoryId; | ||||
| Topic = model.Topic.Value; | Topic = model.Topic.Value; | ||||
| _nsfw = model.Nsfw.GetValueOrDefault(); | |||||
| IsNsfw = model.Nsfw.GetValueOrDefault(); | |||||
| } | } | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| @@ -239,6 +238,7 @@ namespace Discord.Rest | |||||
| } | } | ||||
| // INestedChannel | // INestedChannel | ||||
| /// <inheritdoc /> | |||||
| async Task<ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options) | async Task<ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options) | ||||
| { | { | ||||
| if (CategoryId.HasValue && mode == CacheMode.AllowDownload) | if (CategoryId.HasValue && mode == CacheMode.AllowDownload) | ||||
| @@ -18,6 +18,7 @@ namespace Discord.Rest | |||||
| public int Bitrate { get; private set; } | public int Bitrate { get; private set; } | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public int? UserLimit { get; private set; } | public int? UserLimit { get; private set; } | ||||
| /// <inheritdoc /> | |||||
| public ulong? CategoryId { get; private set; } | public ulong? CategoryId { get; private set; } | ||||
| internal RestVoiceChannel(BaseDiscordClient discord, IGuild guild, ulong id) | internal RestVoiceChannel(BaseDiscordClient discord, IGuild guild, ulong id) | ||||
| @@ -1,4 +1,4 @@ | |||||
| using System.Diagnostics; | |||||
| using System.Diagnostics; | |||||
| using Model = Discord.API.Message; | using Model = Discord.API.Message; | ||||
| namespace Discord.Rest | namespace Discord.Rest | ||||
| @@ -6,6 +6,7 @@ namespace Discord.Rest | |||||
| [DebuggerDisplay(@"{DebuggerDisplay,nq}")] | [DebuggerDisplay(@"{DebuggerDisplay,nq}")] | ||||
| public class RestSystemMessage : RestMessage, ISystemMessage | public class RestSystemMessage : RestMessage, ISystemMessage | ||||
| { | { | ||||
| /// <inheritdoc /> | |||||
| public MessageType Type { get; private set; } | public MessageType Type { get; private set; } | ||||
| internal RestSystemMessage(BaseDiscordClient discord, ulong id, IMessageChannel channel, IUser author) | internal RestSystemMessage(BaseDiscordClient discord, ulong id, IMessageChannel channel, IUser author) | ||||
| @@ -54,8 +54,14 @@ namespace Discord.WebSocket | |||||
| /// Gets the number of members. | /// Gets the number of members. | ||||
| /// </summary> | /// </summary> | ||||
| /// <remarks> | /// <remarks> | ||||
| /// This property retrieves the number of members returned by Discord and is the most accurate. You may see | |||||
| /// discrepancy between the <see cref="Users"/> collection and this property. | |||||
| /// This property retrieves the number of members returned by Discord. | |||||
| /// <note type="tip"> | |||||
| /// Due to how this property is returned by Discord instead of relying on the WebSocket cache, the | |||||
| /// number here is the most accurate in terms of counting the number of users within this guild. Use | |||||
| /// this instead of enumerating the count of the <see cref="Discord.WebSocket.SocketGuild.Users" /> | |||||
| /// collection, as you may see discrepancy between the count of | |||||
| /// <see cref="Discord.WebSocket.SocketGuild.Users" />collection and this property. | |||||
| /// </note> | |||||
| /// </remarks> | /// </remarks> | ||||
| public int MemberCount { get; internal set; } | public int MemberCount { get; internal set; } | ||||
| /// <summary> Gets the number of members downloaded to the local guild cache. </summary> | /// <summary> Gets the number of members downloaded to the local guild cache. </summary> | ||||
| @@ -95,12 +101,18 @@ namespace Discord.WebSocket | |||||
| /// </summary> | /// </summary> | ||||
| public IAudioClient AudioClient => _audioClient; | public IAudioClient AudioClient => _audioClient; | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the first viewable text channel. | |||||
| /// Gets the default channel in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <remarks> | /// <remarks> | ||||
| /// This method gets the first viewable text channel for the logged-in user. This property does not | |||||
| /// guarantee the user can send message to it. | |||||
| /// This property retrieves the first viewable text channel for this guild. | |||||
| /// <note type="warning"> | |||||
| /// This channel does not guarantee the user can send message to it, as it only looks for the first viewable | |||||
| /// text channel. | |||||
| /// </note> | |||||
| /// </remarks> | /// </remarks> | ||||
| /// <returns> | |||||
| /// A <see cref="SocketTextChannel"/> representing the first viewable channel that the user has access to. | |||||
| /// </returns> | |||||
| public SocketTextChannel DefaultChannel => TextChannels | public SocketTextChannel DefaultChannel => TextChannels | ||||
| .Where(c => CurrentUser.GetPermissions(c).ViewChannel) | .Where(c => CurrentUser.GetPermissions(c).ViewChannel) | ||||
| .OrderBy(c => c.Position) | .OrderBy(c => c.Position) | ||||
| @@ -109,7 +121,8 @@ namespace Discord.WebSocket | |||||
| /// Gets the AFK voice channel in this guild. | /// Gets the AFK voice channel in this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// A voice channel set within this guild that AFK users get moved to; otherwise <c>null</c> if none is set. | |||||
| /// A <see cref="SocketVoiceChannel" /> that the AFK users will be moved to after they have idled for too | |||||
| /// long; <c>null</c> if none is set. | |||||
| /// </returns> | /// </returns> | ||||
| public SocketVoiceChannel AFKChannel | public SocketVoiceChannel AFKChannel | ||||
| { | { | ||||
| @@ -120,10 +133,10 @@ namespace Discord.WebSocket | |||||
| } | } | ||||
| } | } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the embed channel set in the widget settings of this guild. | |||||
| /// Gets the embed channel (i.e. the channel set in the guild's widget settings) in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// A channel set in the widget settings of this guild; otherwise <c>null</c> if none is set. | |||||
| /// A channel set within the server's widget settings; <c>null</c> if none is set. | |||||
| /// </returns> | /// </returns> | ||||
| public SocketGuildChannel EmbedChannel | public SocketGuildChannel EmbedChannel | ||||
| { | { | ||||
| @@ -134,11 +147,10 @@ namespace Discord.WebSocket | |||||
| } | } | ||||
| } | } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the channel where randomized welcome messages are sent. | |||||
| /// Gets the system channel where randomized welcome messages are sent in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// A channel where randomized welcome messages are sent in this guild; otherwise <c>null</c> if none is | |||||
| /// set. | |||||
| /// A text channel where randomized welcome messages will be sent to; <c>null</c> if none is set. | |||||
| /// </returns> | /// </returns> | ||||
| public SocketTextChannel SystemChannel | public SocketTextChannel SystemChannel | ||||
| { | { | ||||
| @@ -149,21 +161,27 @@ namespace Discord.WebSocket | |||||
| } | } | ||||
| } | } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a collection of text channels present in this guild. | |||||
| /// Gets a collection of all text channels in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// A collection of text channels in this guild. | |||||
| /// A read-only collection of message channels found within this guild. | |||||
| /// </returns> | /// </returns> | ||||
| public IReadOnlyCollection<SocketTextChannel> TextChannels | public IReadOnlyCollection<SocketTextChannel> TextChannels | ||||
| => Channels.Select(x => x as SocketTextChannel).Where(x => x != null).ToImmutableArray(); | => Channels.Select(x => x as SocketTextChannel).Where(x => x != null).ToImmutableArray(); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a collection of voice channels present in this guild. | |||||
| /// Gets a collection of all voice channels in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A read-only collection of voice channels found within this guild. | |||||
| /// </returns> | |||||
| public IReadOnlyCollection<SocketVoiceChannel> VoiceChannels | public IReadOnlyCollection<SocketVoiceChannel> VoiceChannels | ||||
| => Channels.Select(x => x as SocketVoiceChannel).Where(x => x != null).ToImmutableArray(); | => Channels.Select(x => x as SocketVoiceChannel).Where(x => x != null).ToImmutableArray(); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a collection of category channels present in this guild. | |||||
| /// Gets a collection of all category channels in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A read-only collection of category channels found within this guild. | |||||
| /// </returns> | |||||
| public IReadOnlyCollection<SocketCategoryChannel> CategoryChannels | public IReadOnlyCollection<SocketCategoryChannel> CategoryChannels | ||||
| => Channels.Select(x => x as SocketCategoryChannel).Where(x => x != null).ToImmutableArray(); | => Channels.Select(x => x as SocketCategoryChannel).Where(x => x != null).ToImmutableArray(); | ||||
| /// <summary> | /// <summary> | ||||
| @@ -171,14 +189,17 @@ namespace Discord.WebSocket | |||||
| /// </summary> | /// </summary> | ||||
| public SocketGuildUser CurrentUser => _members.TryGetValue(Discord.CurrentUser.Id, out SocketGuildUser member) ? member : null; | public SocketGuildUser CurrentUser => _members.TryGetValue(Discord.CurrentUser.Id, out SocketGuildUser member) ? member : null; | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the @everyone role in this guild. | |||||
| /// Gets the built-in role containing all users in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A role object that represents an <c>@everyone</c> role in this guild. | |||||
| /// </returns> | |||||
| public SocketRole EveryoneRole => GetRole(Id); | public SocketRole EveryoneRole => GetRole(Id); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a collection of channels present in this guild. | |||||
| /// Gets a collection of all channels in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// Collection of channels. | |||||
| /// A read-only collection of generic channels found within this guild. | |||||
| /// </returns> | /// </returns> | ||||
| public IReadOnlyCollection<SocketGuildChannel> Channels | public IReadOnlyCollection<SocketGuildChannel> Channels | ||||
| { | { | ||||
| @@ -189,37 +210,31 @@ namespace Discord.WebSocket | |||||
| return channels.Select(x => state.GetChannel(x) as SocketGuildChannel).Where(x => x != null).ToReadOnlyCollection(channels); | return channels.Select(x => state.GetChannel(x) as SocketGuildChannel).Where(x => x != null).ToReadOnlyCollection(channels); | ||||
| } | } | ||||
| } | } | ||||
| /// <summary> | |||||
| /// Gets a collection of emotes created in this guild. | |||||
| /// </summary> | |||||
| /// <returns> | |||||
| /// Collection of emotes. | |||||
| /// </returns> | |||||
| /// <inheritdoc /> | |||||
| public IReadOnlyCollection<GuildEmote> Emotes => _emotes; | public IReadOnlyCollection<GuildEmote> Emotes => _emotes; | ||||
| /// <summary> | |||||
| /// Gets a collection of features enabled in this guild. | |||||
| /// </summary> | |||||
| /// <returns> | |||||
| /// Collection of features in string. | |||||
| /// </returns> | |||||
| /// <inheritdoc /> | |||||
| public IReadOnlyCollection<string> Features => _features; | public IReadOnlyCollection<string> Features => _features; | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a collection of users in this guild. | /// Gets a collection of users in this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <remarks> | /// <remarks> | ||||
| /// This property may not always return all the members for large guilds (i.e. guilds containing 100+ users). | |||||
| /// You may need to enable <see cref="DiscordSocketConfig.AlwaysDownloadUsers"/> to fetch the full user list | |||||
| /// upon startup, or use <see cref="DownloadUsersAsync"/> to manually download the users. | |||||
| /// This property retrieves all users found within this guild. | |||||
| /// <note type="warning"> | |||||
| /// This property may not always return all the members for large guilds (i.e. guilds containing 100+ users). | |||||
| /// If you are simply looking to get the number of users present in this guild, consider <see cref="MemberCount"/> instead. | |||||
| /// Otherwise, you may need to enable <see cref="DiscordSocketConfig.AlwaysDownloadUsers"/> to fetch the full user list | |||||
| /// upon startup, or use <see cref="DownloadUsersAsync"/> to manually download the users. | |||||
| /// </note> | |||||
| /// </remarks> | /// </remarks> | ||||
| /// <returns> | /// <returns> | ||||
| /// Collection of users. | |||||
| /// A collection of guild users found within this guild. | |||||
| /// </returns> | /// </returns> | ||||
| public IReadOnlyCollection<SocketGuildUser> Users => _members.ToReadOnlyCollection(); | public IReadOnlyCollection<SocketGuildUser> Users => _members.ToReadOnlyCollection(); | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a collection of roles in this guild. | |||||
| /// Gets a collection of all roles in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// Collection of roles. | |||||
| /// A read-only collection of roles found within this guild. | |||||
| /// </returns> | /// </returns> | ||||
| public IReadOnlyCollection<SocketRole> Roles => _roles.ToReadOnlyCollection(); | public IReadOnlyCollection<SocketRole> Roles => _roles.ToReadOnlyCollection(); | ||||
| @@ -407,11 +422,13 @@ namespace Discord.WebSocket | |||||
| //Bans | //Bans | ||||
| /// <summary> | /// <summary> | ||||
| /// Returns a collection of the banned users in this guild. | |||||
| /// Gets a collection of all users banned in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// A collection of bans. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a read-only collection of | |||||
| /// ban objects that this guild currently possesses, with each object containing the user banned and reason | |||||
| /// behind the ban. | |||||
| /// </returns> | /// </returns> | ||||
| public Task<IReadOnlyCollection<RestBan>> GetBansAsync(RequestOptions options = null) | public Task<IReadOnlyCollection<RestBan>> GetBansAsync(RequestOptions options = null) | ||||
| => GuildHelper.GetBansAsync(this, Discord, options); | => GuildHelper.GetBansAsync(this, Discord, options); | ||||
| @@ -421,8 +438,8 @@ namespace Discord.WebSocket | |||||
| /// <param name="user">The banned user.</param> | /// <param name="user">The banned user.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a REST-based ban object, which contains the user information | |||||
| /// and the reason for the ban; <c>null</c> if the ban entry cannot be found. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a ban object, which | |||||
| /// contains the user information and the reason for the ban; <c>null</c> if the ban entry cannot be found. | |||||
| /// </returns> | /// </returns> | ||||
| public Task<RestBan> GetBanAsync(IUser user, RequestOptions options = null) | public Task<RestBan> GetBanAsync(IUser user, RequestOptions options = null) | ||||
| => GuildHelper.GetBanAsync(this, Discord, user.Id, options); | => GuildHelper.GetBanAsync(this, Discord, user.Id, options); | ||||
| @@ -432,8 +449,8 @@ namespace Discord.WebSocket | |||||
| /// <param name="userId">The snowflake identifier for the banned user.</param> | /// <param name="userId">The snowflake identifier for the banned user.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a REST-based ban object, which contains the user information | |||||
| /// and the reason for the ban; <c>null</c> if the ban entry cannot be found. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a ban object, which | |||||
| /// contains the user information and the reason for the ban; <c>null</c> if the ban entry cannot be found. | |||||
| /// </returns> | /// </returns> | ||||
| public Task<RestBan> GetBanAsync(ulong userId, RequestOptions options = null) | public Task<RestBan> GetBanAsync(ulong userId, RequestOptions options = null) | ||||
| => GuildHelper.GetBanAsync(this, Discord, userId, options); | => GuildHelper.GetBanAsync(this, Discord, userId, options); | ||||
| @@ -454,11 +471,11 @@ namespace Discord.WebSocket | |||||
| //Channels | //Channels | ||||
| /// <summary> | /// <summary> | ||||
| /// Returns a guild channel with the provided ID. | |||||
| /// Gets a channel in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="id">The channel ID.</param> | |||||
| /// <param name="id">The snowflake identifier for the channel.</param> | |||||
| /// <returns> | /// <returns> | ||||
| /// The guild channel associated with the ID. | |||||
| /// A generic channel associated with the specified <paramref name="id" />; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| public SocketGuildChannel GetChannel(ulong id) | public SocketGuildChannel GetChannel(ulong id) | ||||
| { | { | ||||
| @@ -468,56 +485,59 @@ namespace Discord.WebSocket | |||||
| return null; | return null; | ||||
| } | } | ||||
| /// <summary> | /// <summary> | ||||
| /// Returns a text channel with the provided ID. | |||||
| /// Gets a text channel in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="id">The channel ID.</param> | |||||
| /// <param name="id">The snowflake identifier for the text channel.</param> | |||||
| /// <returns> | /// <returns> | ||||
| /// The text channel associated with the ID. | |||||
| /// A text channel associated with the specified <paramref name="id" />; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| public SocketTextChannel GetTextChannel(ulong id) | public SocketTextChannel GetTextChannel(ulong id) | ||||
| => GetChannel(id) as SocketTextChannel; | => GetChannel(id) as SocketTextChannel; | ||||
| /// <summary> | /// <summary> | ||||
| /// Returns a voice channel with the provided ID. | |||||
| /// Gets a voice channel in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="id">The channel ID.</param> | |||||
| /// <param name="id">The snowflake identifier for the voice channel.</param> | |||||
| /// <returns> | /// <returns> | ||||
| /// The voice channel associated with the ID. | |||||
| /// A voice channel associated with the specified <paramref name="id" />; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| public SocketVoiceChannel GetVoiceChannel(ulong id) | public SocketVoiceChannel GetVoiceChannel(ulong id) | ||||
| => GetChannel(id) as SocketVoiceChannel; | => GetChannel(id) as SocketVoiceChannel; | ||||
| /// <summary> | /// <summary> | ||||
| /// Creates a text channel with the provided name. | |||||
| /// Creates a new text channel in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="name">The name of the new channel.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | |||||
| /// <param name="name">The new name for the text channel.</param> | |||||
| /// <param name="func">The delegate containing the properties to be applied to the channel upon its creation.</param> | /// <param name="func">The delegate containing the properties to be applied to the channel upon its creation.</param> | ||||
| /// <exception cref="ArgumentNullException"><paramref name="name" /> is <c>null</c>.</exception> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | |||||
| /// <exception cref="ArgumentNullException"><paramref name="name"/> is <c>null</c>.</exception> | |||||
| /// <returns> | /// <returns> | ||||
| /// The created text channel. | |||||
| /// A task that represents the asynchronous creation operation. The task result contains the newly created | |||||
| /// text channel. | |||||
| /// </returns> | /// </returns> | ||||
| public Task<RestTextChannel> CreateTextChannelAsync(string name, Action<TextChannelProperties> func = null, RequestOptions options = null) | public Task<RestTextChannel> CreateTextChannelAsync(string name, Action<TextChannelProperties> func = null, RequestOptions options = null) | ||||
| => GuildHelper.CreateTextChannelAsync(this, Discord, name, options, func); | => GuildHelper.CreateTextChannelAsync(this, Discord, name, options, func); | ||||
| /// <summary> | /// <summary> | ||||
| /// Creates a voice channel with the provided name. | |||||
| /// Creates a new voice channel in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="name">The name of the new channel.</param> | |||||
| /// <param name="name">The new name for the voice channel.</param> | |||||
| /// <param name="func">The delegate containing the properties to be applied to the channel upon its creation.</param> | /// <param name="func">The delegate containing the properties to be applied to the channel upon its creation.</param> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <exception cref="ArgumentNullException"><paramref name="name" /> is <c>null</c>.</exception> | |||||
| /// <exception cref="ArgumentNullException"><paramref name="name"/> is <c>null</c>.</exception> | |||||
| /// <returns> | /// <returns> | ||||
| /// The created voice channel. | |||||
| /// A task that represents the asynchronous creation operation. The task result contains the newly created | |||||
| /// voice channel. | |||||
| /// </returns> | /// </returns> | ||||
| public Task<RestVoiceChannel> CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null) | public Task<RestVoiceChannel> CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null) | ||||
| => GuildHelper.CreateVoiceChannelAsync(this, Discord, name, options, func); | => GuildHelper.CreateVoiceChannelAsync(this, Discord, name, options, func); | ||||
| /// <summary> | /// <summary> | ||||
| /// Creates a category channel with the provided name. | |||||
| /// Creates a new channel category in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="name">The name of the new channel.</param> | |||||
| /// <param name="name">The new name for the category.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <exception cref="ArgumentNullException"><paramref name="name" /> is <c>null</c>.</exception> | |||||
| /// <exception cref="ArgumentNullException"><paramref name="name"/> is <c>null</c>.</exception> | |||||
| /// <returns> | /// <returns> | ||||
| /// The created category channel. | |||||
| /// A task that represents the asynchronous creation operation. The task result contains the newly created | |||||
| /// category channel. | |||||
| /// </returns> | /// </returns> | ||||
| public Task<RestCategoryChannel> CreateCategoryChannelAsync(string name, RequestOptions options = null) | public Task<RestCategoryChannel> CreateCategoryChannelAsync(string name, RequestOptions options = null) | ||||
| => GuildHelper.CreateCategoryChannelAsync(this, Discord, name, options); | => GuildHelper.CreateCategoryChannelAsync(this, Discord, name, options); | ||||
| @@ -544,11 +564,12 @@ namespace Discord.WebSocket | |||||
| //Invites | //Invites | ||||
| /// <summary> | /// <summary> | ||||
| /// Returns a collection of invites associated with this channel. | |||||
| /// Gets a collection of all invites in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// An awaitable <see cref="Task"/> containing a collection of invites. | |||||
| /// A task that represents the asynchronous get operation. The task result contains a read-only collection of | |||||
| /// invite metadata, each representing information for an invite found within this guild. | |||||
| /// </returns> | /// </returns> | ||||
| public Task<IReadOnlyCollection<RestInviteMetadata>> GetInvitesAsync(RequestOptions options = null) | public Task<IReadOnlyCollection<RestInviteMetadata>> GetInvitesAsync(RequestOptions options = null) | ||||
| => GuildHelper.GetInvitesAsync(this, Discord, options); | => GuildHelper.GetInvitesAsync(this, Discord, options); | ||||
| @@ -557,18 +578,19 @@ namespace Discord.WebSocket | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <returns> | /// <returns> | ||||
| /// A partial metadata of the vanity invite found within this guild. | |||||
| /// A task that represents the asynchronous get operation. The task result contains the partial metadata of | |||||
| /// the vanity invite found within this guild; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| public Task<RestInviteMetadata> GetVanityInviteAsync(RequestOptions options = null) | public Task<RestInviteMetadata> GetVanityInviteAsync(RequestOptions options = null) | ||||
| => GuildHelper.GetVanityInviteAsync(this, Discord, options); | => GuildHelper.GetVanityInviteAsync(this, Discord, options); | ||||
| //Roles | //Roles | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a role. | |||||
| /// Gets a role in this guild. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="id">The snowflake identifier of the role.</param> | |||||
| /// <param name="id">The snowflake identifier for the role.</param> | |||||
| /// <returns> | /// <returns> | ||||
| /// The role associated with the snowflake identifier. | |||||
| /// A role that is associated with the specified <paramref name="id"/>; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| public SocketRole GetRole(ulong id) | public SocketRole GetRole(ulong id) | ||||
| { | { | ||||
| @@ -578,18 +600,17 @@ namespace Discord.WebSocket | |||||
| } | } | ||||
| /// <summary> | /// <summary> | ||||
| /// Creates a role. | |||||
| /// Creates a new role with the provided name. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="name">The name of the new role.</param> | |||||
| /// <param name="permissions"> | |||||
| /// The permissions that the new role possesses. Set to <c>null</c> to use the default permissions. | |||||
| /// </param> | |||||
| /// <param name="color">The color of the role. Set to <c>null</c> to use the default color.</param> | |||||
| /// <param name="isHoisted">Used to determine if users of this role are separated in the user list.</param> | |||||
| /// <param name="name">The new name for the role.</param> | |||||
| /// <param name="permissions">The guild permission that the role should possess.</param> | |||||
| /// <param name="color">The color of the role.</param> | |||||
| /// <param name="isHoisted">Whether the role is separated from others on the sidebar.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
| /// <exception cref="ArgumentNullException"><paramref name="name" /> is <c>null</c>.</exception> | |||||
| /// <exception cref="ArgumentNullException"><paramref name="name"/> is <c>null</c>.</exception> | |||||
| /// <returns> | /// <returns> | ||||
| /// The created role. | |||||
| /// A task that represents the asynchronous creation operation. The task result contains the newly created | |||||
| /// role. | |||||
| /// </returns> | /// </returns> | ||||
| public Task<RestRole> CreateRoleAsync(string name, GuildPermissions? permissions = default(GuildPermissions?), Color? color = default(Color?), | public Task<RestRole> CreateRoleAsync(string name, GuildPermissions? permissions = default(GuildPermissions?), Color? color = default(Color?), | ||||
| bool isHoisted = false, RequestOptions options = null) | bool isHoisted = false, RequestOptions options = null) | ||||
| @@ -611,9 +632,16 @@ namespace Discord.WebSocket | |||||
| /// <summary> | /// <summary> | ||||
| /// Gets a user from this guild. | /// Gets a user from this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <param name="id">The snowflake identifier of the user (e.g. `168693960628371456`).</param> | |||||
| /// <remarks> | |||||
| /// This method retrieves a user found within this guild. | |||||
| /// <note> | |||||
| /// This may return <c>null</c> in the WebSocket implementation due to incomplete user collection in | |||||
| /// large guilds. | |||||
| /// </note> | |||||
| /// </remarks> | |||||
| /// <param name="id">The snowflake identifier of the user.</param> | |||||
| /// <returns> | /// <returns> | ||||
| /// A WebSocket-based guild user associated with the snowflake identifier. | |||||
| /// A guild user associated with the specified <paramref name="id"/>; <c>null</c> if none is found. | |||||
| /// </returns> | /// </returns> | ||||
| public SocketGuildUser GetUser(ulong id) | public SocketGuildUser GetUser(ulong id) | ||||
| { | { | ||||
| @@ -675,9 +703,7 @@ namespace Discord.WebSocket | |||||
| return null; | return null; | ||||
| } | } | ||||
| /// <summary> | |||||
| /// Downloads the users of this guild to the WebSocket cache. | |||||
| /// </summary> | |||||
| /// <inheritdoc /> | |||||
| public async Task DownloadUsersAsync() | public async Task DownloadUsersAsync() | ||||
| { | { | ||||
| await Discord.DownloadUsersAsync(new[] { this }).ConfigureAwait(false); | await Discord.DownloadUsersAsync(new[] { this }).ConfigureAwait(false); | ||||
| @@ -688,6 +714,15 @@ namespace Discord.WebSocket | |||||
| } | } | ||||
| //Audit logs | //Audit logs | ||||
| /// <summary> | |||||
| /// Gets the specified number of audit log entries for this guild. | |||||
| /// </summary> | |||||
| /// <param name="limit">The number of audit log entries to fetch.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | |||||
| /// <returns> | |||||
| /// A task that represents the asynchronous get operation. The task result contains a read-only collection | |||||
| /// of the requested audit log entries. | |||||
| /// </returns> | |||||
| public IAsyncEnumerable<IReadOnlyCollection<RestAuditLogEntry>> GetAuditLogsAsync(int limit, RequestOptions options = null) | public IAsyncEnumerable<IReadOnlyCollection<RestAuditLogEntry>> GetAuditLogsAsync(int limit, RequestOptions options = null) | ||||
| => GuildHelper.GetAuditLogsAsync(this, Discord, null, limit, options); | => GuildHelper.GetAuditLogsAsync(this, Discord, null, limit, options); | ||||
| @@ -914,7 +949,7 @@ namespace Discord.WebSocket | |||||
| /// Gets the name of the guild. | /// Gets the name of the guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| /// A string that resolves to the <see cref="Discord.WebSocket.SocketGuild.Name" /> of this guild. | |||||
| /// A string that resolves to <see cref="Discord.WebSocket.SocketGuild.Name"/>. | |||||
| /// </returns> | /// </returns> | ||||
| public override string ToString() => Name; | public override string ToString() => Name; | ||||
| private string DebuggerDisplay => $"{Name} ({Id})"; | private string DebuggerDisplay => $"{Name} ({Id})"; | ||||
| @@ -1025,6 +1060,7 @@ namespace Discord.WebSocket | |||||
| Task<IGuildUser> IGuild.GetOwnerAsync(CacheMode mode, RequestOptions options) | Task<IGuildUser> IGuild.GetOwnerAsync(CacheMode mode, RequestOptions options) | ||||
| => Task.FromResult<IGuildUser>(Owner); | => Task.FromResult<IGuildUser>(Owner); | ||||
| /// <inheritdoc /> | |||||
| async Task<IReadOnlyCollection<IAuditLogEntry>> IGuild.GetAuditLogAsync(int limit, CacheMode cacheMode, RequestOptions options) | async Task<IReadOnlyCollection<IAuditLogEntry>> IGuild.GetAuditLogAsync(int limit, CacheMode cacheMode, RequestOptions options) | ||||
| { | { | ||||
| if (cacheMode == CacheMode.AllowDownload) | if (cacheMode == CacheMode.AllowDownload) | ||||