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 Func<DiscordRestClient> _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;
}


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

@@ -33,11 +33,6 @@ namespace Discord.Interactions
/// </summary>
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>
/// 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>


Loading…
Cancel
Save