From 91ad2018efbd6a892d9d5a436836758f8ee28e80 Mon Sep 17 00:00:00 2001 From: Discord-NET-Robot <95661365+Discord-NET-Robot@users.noreply.github.com> Date: Tue, 7 Dec 2021 03:05:17 -0400 Subject: [PATCH 1/3] Add 50055 Error code (#352) Co-authored-by: quin lynch --- src/Discord.Net.Core/DiscordErrorCode.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Discord.Net.Core/DiscordErrorCode.cs b/src/Discord.Net.Core/DiscordErrorCode.cs index 5a5223b93..3662624be 100644 --- a/src/Discord.Net.Core/DiscordErrorCode.cs +++ b/src/Discord.Net.Core/DiscordErrorCode.cs @@ -139,6 +139,7 @@ namespace Discord FileUploadTooBig = 50045, InvalidFileUpload = 50046, CannotSelfRedeemGift = 50054, + InvalidGuild = 50055, PaymentSourceRequiredForGift = 50070, CannotDeleteRequiredCommunityChannel = 50074, InvalidSticker = 50081, From 26c3da77b6ab57df5a8f013c70801b67a599209e Mon Sep 17 00:00:00 2001 From: Cenk Ergen <57065323+Cenngo@users.noreply.github.com> Date: Wed, 8 Dec 2021 03:52:33 +0300 Subject: [PATCH 2/3] remove DeleteUnknownSlashCommandAck (#353) --- src/Discord.Net.Interactions/InteractionService.cs | 9 +-------- src/Discord.Net.Interactions/InteractionServiceConfig.cs | 5 ----- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Discord.Net.Interactions/InteractionService.cs b/src/Discord.Net.Interactions/InteractionService.cs index 6c2a70f16..d7192129d 100644 --- a/src/Discord.Net.Interactions/InteractionService.cs +++ b/src/Discord.Net.Interactions/InteractionService.cs @@ -67,7 +67,7 @@ namespace Discord.Interactions internal readonly LogManager _logManager; internal readonly Func _getRestClient; - internal readonly bool _throwOnError, _deleteUnkownSlashCommandAck, _useCompiledLambda, _enableAutocompleteHandlers; + internal readonly bool _throwOnError, _useCompiledLambda, _enableAutocompleteHandlers; internal readonly string _wildCardExp; internal readonly RunMode _runMode; internal readonly RestResponseCallback _restResponseCallback; @@ -153,7 +153,6 @@ namespace Discord.Interactions throw new InvalidOperationException($"RunMode cannot be set to {RunMode.Default}"); _throwOnError = config.ThrowOnError; - _deleteUnkownSlashCommandAck = config.DeleteUnknownSlashCommandAck; _wildCardExp = config.WildCardExpression; _useCompiledLambda = config.UseCompiledLambda; _enableAutocompleteHandlers = config.EnableAutocompleteHandlers; @@ -620,12 +619,6 @@ namespace Discord.Interactions { await _cmdLogger.DebugAsync($"Unknown slash command, skipping execution ({string.Join(" ", keywords).ToUpper()})"); - if (_deleteUnkownSlashCommandAck) - { - var response = await context.Interaction.GetOriginalResponseAsync().ConfigureAwait(false); - await response.DeleteAsync().ConfigureAwait(false); - } - await _slashCommandExecutedEvent.InvokeAsync(null, context, result).ConfigureAwait(false); return result; } diff --git a/src/Discord.Net.Interactions/InteractionServiceConfig.cs b/src/Discord.Net.Interactions/InteractionServiceConfig.cs index 8e495a5ca..e5ca5b9ec 100644 --- a/src/Discord.Net.Interactions/InteractionServiceConfig.cs +++ b/src/Discord.Net.Interactions/InteractionServiceConfig.cs @@ -33,11 +33,6 @@ namespace Discord.Interactions /// public string WildCardExpression { get; set; } - /// - /// Gets or sets the option to delete Slash Command acknowledgements if no Slash Command handler is found in the . - /// - public bool DeleteUnknownSlashCommandAck { get; set; } = true; - /// /// Gets or sets the option to use compiled lambda expressions to create module instances and execute commands. This method improves performance at the cost of memory. /// From 648baf3c0f38f271408ee07e359db146964dd354 Mon Sep 17 00:00:00 2001 From: Discord-NET-Robot <95661365+Discord-NET-Robot@users.noreply.github.com> Date: Tue, 7 Dec 2021 20:52:54 -0400 Subject: [PATCH 3/3] [Robot] Add missing json error (#354) * Add 20029 Error code * Update DiscordErrorCode.cs Co-authored-by: Robot Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com> --- src/Discord.Net.Core/DiscordErrorCode.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Discord.Net.Core/DiscordErrorCode.cs b/src/Discord.Net.Core/DiscordErrorCode.cs index 3662624be..61516a0ff 100644 --- a/src/Discord.Net.Core/DiscordErrorCode.cs +++ b/src/Discord.Net.Core/DiscordErrorCode.cs @@ -65,6 +65,7 @@ namespace Discord OnlyOwnerAction = 20018, AnnouncementEditRatelimit = 20022, ChannelWriteRatelimit = 20028, + WriteRatelimitReached = 20029, WordsNotAllowed = 20031, GuildPremiumTooLow = 20035, #endregion