From e0beb010ba5747eeaaaf08b6e2fe5c0dcbb4b4f0 Mon Sep 17 00:00:00 2001 From: Cenngo Date: Fri, 6 Jan 2023 18:20:31 +0300 Subject: [PATCH] fix oopsie --- .../ApplicationCommandPermissionTarget.cs | 6 +- .../ApplicationCommandPermissions.cs | 56 ------------------- .../Commands/ComponentInteractionAttribute.cs | 3 + .../Commands/ModalInteractionAttribute.cs | 3 + 4 files changed, 7 insertions(+), 61 deletions(-) diff --git a/src/Discord.Net.Core/Entities/Permissions/ApplicationCommandPermissionTarget.cs b/src/Discord.Net.Core/Entities/Permissions/ApplicationCommandPermissionTarget.cs index aa81ac6fc..9a99b34f1 100644 --- a/src/Discord.Net.Core/Entities/Permissions/ApplicationCommandPermissionTarget.cs +++ b/src/Discord.Net.Core/Entities/Permissions/ApplicationCommandPermissionTarget.cs @@ -12,10 +12,6 @@ namespace Discord /// /// The target of the permission is a user. /// - User = 2, - /// - /// The target of the permission is a channel. - /// - Channel = 3 + User = 2 } } diff --git a/src/Discord.Net.Core/Entities/Permissions/ApplicationCommandPermissions.cs b/src/Discord.Net.Core/Entities/Permissions/ApplicationCommandPermissions.cs index aa1580c8a..28a6455e2 100644 --- a/src/Discord.Net.Core/Entities/Permissions/ApplicationCommandPermissions.cs +++ b/src/Discord.Net.Core/Entities/Permissions/ApplicationCommandPermissions.cs @@ -58,61 +58,5 @@ namespace Discord Permission = allow; TargetType = ApplicationCommandPermissionTarget.Role; } - - /// - /// Creates a new targeting . - /// - /// The channel you want to target this permission value for. - /// The value of this permission. - public ApplicationCommandPermission(IChannel channel, bool allow) - { - TargetId = channel.Id; - Permission = allow; - TargetType = ApplicationCommandPermissionTarget.Channel; - } - - /// - /// Creates a new targeting @everyone in a guild. - /// - /// Id of the target guild. - /// The value of this permission. - /// - /// Instance of targeting @everyone in a guild. - /// - public static ApplicationCommandPermission ForEveryone(ulong guildId, bool allow) => - new (guildId, ApplicationCommandPermissionTarget.User, allow); - - /// - /// Creates a new targeting @everyone in a guild. - /// - /// Target guild. - /// The value of this permission. - /// - /// Instance of targeting @everyone in a guild. - /// - public static ApplicationCommandPermission ForEveryone(IGuild guild, bool allow) => - ForEveryone(guild.Id, allow); - - /// - /// Creates a new targeting every channel in a guild. - /// - /// Id of the target guild. - /// The value of this permission. - /// - /// Instance of targeting everychannel in a guild. - /// - public static ApplicationCommandPermission ForAllChannels(ulong guildId, bool allow) => - new (guildId - 1, ApplicationCommandPermissionTarget.Channel, allow); - - /// - /// Creates a new targeting every channel in a guild. - /// - /// Target guild. - /// The value of this permission. - /// - /// Instance of targeting everychannel in a guild. - /// - public static ApplicationCommandPermission ForAllChannels(IGuild guild, bool allow) => - ForAllChannels(guild.Id, allow); } } diff --git a/src/Discord.Net.Interactions/Attributes/Commands/ComponentInteractionAttribute.cs b/src/Discord.Net.Interactions/Attributes/Commands/ComponentInteractionAttribute.cs index 823410cdf..a6b8d2c2b 100644 --- a/src/Discord.Net.Interactions/Attributes/Commands/ComponentInteractionAttribute.cs +++ b/src/Discord.Net.Interactions/Attributes/Commands/ComponentInteractionAttribute.cs @@ -32,6 +32,9 @@ namespace Discord.Interactions /// /// Gets or sets whether the should be treated as a raw Regex pattern. /// + /// + /// defaults to the pattern used before 3.9.0. + /// public bool TreatAsRegex { get; set; } = false; /// diff --git a/src/Discord.Net.Interactions/Attributes/Commands/ModalInteractionAttribute.cs b/src/Discord.Net.Interactions/Attributes/Commands/ModalInteractionAttribute.cs index f5df950bd..0e79952f3 100644 --- a/src/Discord.Net.Interactions/Attributes/Commands/ModalInteractionAttribute.cs +++ b/src/Discord.Net.Interactions/Attributes/Commands/ModalInteractionAttribute.cs @@ -31,6 +31,9 @@ namespace Discord.Interactions /// /// Gets or sets whether the should be treated as a raw Regex pattern. /// + /// + /// defaults to the pattern used before 3.9.0. + /// public bool TreatAsRegex { get; set; } = false; ///