diff --git a/src/Discord.Net.Core/Entities/Guilds/IGuildIntegration.cs b/src/Discord.Net.Core/Entities/Guilds/IGuildIntegration.cs index 225ce05d6..4ca57a55f 100644 --- a/src/Discord.Net.Core/Entities/Guilds/IGuildIntegration.cs +++ b/src/Discord.Net.Core/Entities/Guilds/IGuildIntegration.cs @@ -1,17 +1,40 @@ -using System; +using System; namespace Discord { public interface IGuildIntegration { + /// Gets the integration ID. + /// An representing the unique identifier value of this integration. ulong Id { get; } + /// Gets the integration name. + /// A string containing the name of this integration. string Name { get; } + /// Gets the integration type (twitch, youtube, etc). + /// A string containing the name of the type of integration. string Type { get; } + /// Gets if this integration is enabled or not. + /// A value indicating if this integration is enabled. bool IsEnabled { get; } + /// Gets if this integration is syncing or not. + /// A value indicating if this integration is syncing. + /// + /// An integration with syncing enabled will update its "subscribers" on + /// an interval, while one with syncing disabled will not. + /// A user must manually choose when sync the integration + /// if syncing is disabled. + /// bool IsSyncing { get; } + /// Gets the ID that this integration uses for "subscribers". ulong ExpireBehavior { get; } + /// Gets the grace period before expiring "subscribers". ulong ExpireGracePeriod { get; } + /// Gets when this integration was last synced. + /// A containing a date and time of day when the integration was last synced. DateTimeOffset SyncedAt { get; } + /// + /// Gets integration account information. + /// IntegrationAccount Account { get; } IGuild Guild { get; } diff --git a/src/Discord.Net.Core/Entities/Guilds/IntegrationAccount.cs b/src/Discord.Net.Core/Entities/Guilds/IntegrationAccount.cs index 71bcf10ed..637bf969b 100644 --- a/src/Discord.Net.Core/Entities/Guilds/IntegrationAccount.cs +++ b/src/Discord.Net.Core/Entities/Guilds/IntegrationAccount.cs @@ -1,11 +1,15 @@ -using System.Diagnostics; +using System.Diagnostics; namespace Discord { [DebuggerDisplay("{DebuggerDisplay,nq}")] public struct IntegrationAccount { + /// Gets the ID of the account. + /// A unique identifier of this integration account. public string Id { get; } + /// Gets the name of the account. + /// A string containing the name of this integration account. public string Name { get; private set; } public override string ToString() => Name; diff --git a/src/Discord.Net.Core/Entities/Permissions/ChannelPermission.cs b/src/Discord.Net.Core/Entities/Permissions/ChannelPermission.cs index ef531967a..e3cfc0e19 100644 --- a/src/Discord.Net.Core/Entities/Permissions/ChannelPermission.cs +++ b/src/Discord.Net.Core/Entities/Permissions/ChannelPermission.cs @@ -22,7 +22,7 @@ namespace Discord /// AddReactions = 0x00_00_00_40, /// - /// Allows for reading of message. + /// Allows for reading of messages. This flag is obsolete, use instead. /// [Obsolete("Use ViewChannel instead.")] ReadMessages = ViewChannel, diff --git a/src/Discord.Net.Core/Entities/Permissions/GuildPermission.cs b/src/Discord.Net.Core/Entities/Permissions/GuildPermission.cs index 1297f283b..c010d90b1 100644 --- a/src/Discord.Net.Core/Entities/Permissions/GuildPermission.cs +++ b/src/Discord.Net.Core/Entities/Permissions/GuildPermission.cs @@ -14,23 +14,43 @@ namespace Discord /// /// Allows kicking members. /// + /// + /// This permission requires the owner account to use two-factor + /// authentication when used on a guild that has server-wide 2FA enabled. + /// KickMembers = 0x00_00_00_02, /// /// Allows banning members. /// + /// + /// This permission requires the owner account to use two-factor + /// authentication when used on a guild that has server-wide 2FA enabled. + /// BanMembers = 0x00_00_00_04, /// /// Allows all permissions and bypasses channel permission overwrites. /// - Administrator = 0x00_00_00_08, + /// + /// This permission requires the owner account to use two-factor + /// authentication when used on a guild that has server-wide 2FA enabled. + /// + Administrator = 0x00_00_00_08, /// /// Allows management and editing of channels. /// - ManageChannels = 0x00_00_00_10, + /// + /// This permission requires the owner account to use two-factor + /// authentication when used on a guild that has server-wide 2FA enabled. + /// + ManageChannels = 0x00_00_00_10, /// /// Allows management and editing of the guild. /// - ManageGuild = 0x00_00_00_20, + /// + /// This permission requires the owner account to use two-factor + /// authentication when used on a guild that has server-wide 2FA enabled. + /// + ManageGuild = 0x00_00_00_20, // Text /// @@ -52,7 +72,11 @@ namespace Discord /// /// Allows for deletion of other users messages. /// - ManageMessages = 0x00_00_20_00, + /// + /// This permission requires the owner account to use two-factor + /// authentication when used on a guild that has server-wide 2FA enabled. + /// + ManageMessages = 0x00_00_20_00, /// /// Allows links sent by users with this permission will be auto-embedded. /// @@ -115,14 +139,26 @@ namespace Discord /// /// Allows management and editing of roles. /// + /// + /// This permission requires the owner account to use two-factor + /// authentication when used on a guild that has server-wide 2FA enabled. + /// ManageRoles = 0x10_00_00_00, /// /// Allows management and editing of webhooks. /// + /// + /// This permission requires the owner account to use two-factor + /// authentication when used on a guild that has server-wide 2FA enabled. + /// ManageWebhooks = 0x20_00_00_00, /// /// Allows management and editing of emojis. /// + /// + /// This permission requires the owner account to use two-factor + /// authentication when used on a guild that has server-wide 2FA enabled. + /// ManageEmojis = 0x40_00_00_00 } } diff --git a/src/Discord.Net.Core/Entities/Permissions/GuildPermissions.cs b/src/Discord.Net.Core/Entities/Permissions/GuildPermissions.cs index 0d6719b01..2d2a9e56a 100644 --- a/src/Discord.Net.Core/Entities/Permissions/GuildPermissions.cs +++ b/src/Discord.Net.Core/Entities/Permissions/GuildPermissions.cs @@ -251,8 +251,19 @@ namespace Discord readMessageHistory, mentionEveryone, useExternalEmojis, connect, speak, muteMembers, deafenMembers, moveMembers, useVoiceActivation, prioritySpeaker, changeNickname, manageNicknames, manageRoles, manageWebhooks, manageEmojis); + /// + /// Returns a value that indicates if a specific is enabled + /// in these permissions. + /// + /// The permission value to check for. + /// true if the permission is enabled, false otherwise. public bool Has(GuildPermission permission) => Permissions.GetValue(RawValue, permission); + /// + /// Returns a containing all of the + /// flags that are enabled. + /// + /// A containing flags. Empty if none are enabled. public List ToList() { var perms = new List(); diff --git a/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs b/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs index 0af2fba9a..04bb2f668 100644 --- a/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs +++ b/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs @@ -193,6 +193,10 @@ namespace Discord embedLinks, attachFiles, readMessageHistory, mentionEveryone, useExternalEmojis, connect, speak, muteMembers, deafenMembers, moveMembers, useVoiceActivation, manageRoles, manageWebhooks); + /// + /// Creates a of all the values that are allowed. + /// + /// A of all allowed flags. If none, the list will be empty. public List ToAllowList() { var perms = new List(); @@ -205,6 +209,11 @@ namespace Discord } return perms; } + + /// + /// Creates a of all the values that are denied. + /// + /// A of all denied flags. If none, the list will be empty. public List ToDenyList() { var perms = new List(); diff --git a/src/Discord.Net.Core/Entities/Roles/Color.cs b/src/Discord.Net.Core/Entities/Roles/Color.cs index c663d5b25..f78eca01c 100644 --- a/src/Discord.Net.Core/Entities/Roles/Color.cs +++ b/src/Discord.Net.Core/Entities/Roles/Color.cs @@ -75,6 +75,10 @@ namespace Discord public static readonly Color DarkerGrey = new Color(0x546E7A); /// Gets the encoded value for this color. + /// + /// This value is encoded as an unsigned integer value. The most-significant 8 bits contain the red value, + /// the middle 8 bits contain the green value, and the least-significant 8 bits contain the blue value. + /// public uint RawValue { get; } /// Gets the red component for this color. diff --git a/src/Discord.Net.Core/Entities/Users/IConnection.cs b/src/Discord.Net.Core/Entities/Users/IConnection.cs index cc981ccf0..1e65d971f 100644 --- a/src/Discord.Net.Core/Entities/Users/IConnection.cs +++ b/src/Discord.Net.Core/Entities/Users/IConnection.cs @@ -1,14 +1,27 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Discord { public interface IConnection { + /// Gets the ID of the connection account. + /// A representing the unique identifier value of this connection. string Id { get; } + /// Gets the service of the connection (twitch, youtube). + /// A string containing the name of this type of connection. string Type { get; } + /// Gets the username of the connection account. + /// A string containing the name of this connection. string Name { get; } + /// Gets whether the connection is revoked. + /// A value which if true indicates that this connection has been revoked, otherwise false. bool IsRevoked { get; } + /// Gets a of integration IDs. + /// + /// An containing + /// representations of unique identifier values of integrations. + /// IReadOnlyCollection IntegrationIds { get; } } }