From 8bfabf8d44b15f406a22ffe5c3ab63f4f6dfb2e5 Mon Sep 17 00:00:00 2001 From: Cenk Ergen <57065323+Cenngo@users.noreply.github.com> Date: Sat, 27 Nov 2021 16:33:31 +0300 Subject: [PATCH] Invoke SlashCommandExecuted event on failed type conversion (#314) * added interaction specific interfaces * fix build error * implement change requests * add autocomplete respond method to IAutocompleteInteraction * fix sharded client current user * fix generic typeconverter picking priority * Revert "fix sharded client current user" This reverts commit a9c15ffd6ab02651e83e72c275889502b60cfddc. * Revert "add autocomplete respond method to IAutocompleteInteraction" This reverts commit f2fc50f1f19a0b41144b6dc93080d2f3a01282fc. * fix command parsing for names with spaces * add SlashCommandExecuted event invoke to failed type conversion * update interactions sample app * Revert "update interactions sample app" This reverts commit 6ac8cd0da60b440874cf29abc7202cdc49fd0538. --- src/Discord.Net.Interactions/Info/Commands/SlashCommandInfo.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Discord.Net.Interactions/Info/Commands/SlashCommandInfo.cs b/src/Discord.Net.Interactions/Info/Commands/SlashCommandInfo.cs index fad015550..116a07ab4 100644 --- a/src/Discord.Net.Interactions/Info/Commands/SlashCommandInfo.cs +++ b/src/Discord.Net.Interactions/Info/Commands/SlashCommandInfo.cs @@ -81,7 +81,10 @@ namespace Discord.Interactions var readResult = await typeConverter.ReadAsync(context, arg, services).ConfigureAwait(false); if (!readResult.IsSuccess) + { + await InvokeModuleEvent(context, readResult).ConfigureAwait(false); return readResult; + } args[i] = readResult.Value; }