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] 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. ///