Browse Source

remove DeleteUnknownSlashCommandAck (#353)

pull/1966/head
Cenk Ergen GitHub 3 years ago
parent
commit
26c3da77b6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 13 deletions
  1. +1
    -8
      src/Discord.Net.Interactions/InteractionService.cs
  2. +0
    -5
      src/Discord.Net.Interactions/InteractionServiceConfig.cs

+ 1
- 8
src/Discord.Net.Interactions/InteractionService.cs View File

@@ -67,7 +67,7 @@ namespace Discord.Interactions
internal readonly LogManager _logManager; internal readonly LogManager _logManager;
internal readonly Func<DiscordRestClient> _getRestClient; internal readonly Func<DiscordRestClient> _getRestClient;


internal readonly bool _throwOnError, _deleteUnkownSlashCommandAck, _useCompiledLambda, _enableAutocompleteHandlers;
internal readonly bool _throwOnError, _useCompiledLambda, _enableAutocompleteHandlers;
internal readonly string _wildCardExp; internal readonly string _wildCardExp;
internal readonly RunMode _runMode; internal readonly RunMode _runMode;
internal readonly RestResponseCallback _restResponseCallback; internal readonly RestResponseCallback _restResponseCallback;
@@ -153,7 +153,6 @@ namespace Discord.Interactions
throw new InvalidOperationException($"RunMode cannot be set to {RunMode.Default}"); throw new InvalidOperationException($"RunMode cannot be set to {RunMode.Default}");


_throwOnError = config.ThrowOnError; _throwOnError = config.ThrowOnError;
_deleteUnkownSlashCommandAck = config.DeleteUnknownSlashCommandAck;
_wildCardExp = config.WildCardExpression; _wildCardExp = config.WildCardExpression;
_useCompiledLambda = config.UseCompiledLambda; _useCompiledLambda = config.UseCompiledLambda;
_enableAutocompleteHandlers = config.EnableAutocompleteHandlers; _enableAutocompleteHandlers = config.EnableAutocompleteHandlers;
@@ -620,12 +619,6 @@ namespace Discord.Interactions
{ {
await _cmdLogger.DebugAsync($"Unknown slash command, skipping execution ({string.Join(" ", keywords).ToUpper()})"); 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); await _slashCommandExecutedEvent.InvokeAsync(null, context, result).ConfigureAwait(false);
return result; return result;
} }


+ 0
- 5
src/Discord.Net.Interactions/InteractionServiceConfig.cs View File

@@ -33,11 +33,6 @@ namespace Discord.Interactions
/// </summary> /// </summary>
public string WildCardExpression { get; set; } public string WildCardExpression { get; set; }


/// <summary>
/// Gets or sets the option to delete Slash Command acknowledgements if no Slash Command handler is found in the <see cref="InteractionService"/>.
/// </summary>
public bool DeleteUnknownSlashCommandAck { get; set; } = true;

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


Loading…
Cancel
Save