Browse Source

Merge branch 'release/3.x' of https://github.com/Discord-Net-Labs/Discord.Net-Labs into release/3.x

pull/1966/head
quin lynch 3 years ago
parent
commit
a65affc4b6
3 changed files with 3 additions and 13 deletions
  1. +2
    -0
      src/Discord.Net.Core/DiscordErrorCode.cs
  2. +1
    -8
      src/Discord.Net.Interactions/InteractionService.cs
  3. +0
    -5
      src/Discord.Net.Interactions/InteractionServiceConfig.cs

+ 2
- 0
src/Discord.Net.Core/DiscordErrorCode.cs View File

@@ -65,6 +65,7 @@ namespace Discord
OnlyOwnerAction = 20018,
AnnouncementEditRatelimit = 20022,
ChannelWriteRatelimit = 20028,
WriteRatelimitReached = 20029,
WordsNotAllowed = 20031,
GuildPremiumTooLow = 20035,
#endregion
@@ -139,6 +140,7 @@ namespace Discord
FileUploadTooBig = 50045,
InvalidFileUpload = 50046,
CannotSelfRedeemGift = 50054,
InvalidGuild = 50055,
PaymentSourceRequiredForGift = 50070,
CannotDeleteRequiredCommunityChannel = 50074,
InvalidSticker = 50081,


+ 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