Add before and after execute async (#1998)

This commit is contained in:
Quin Lynch
2021-12-24 10:37:36 -04:00
committed by GitHub
parent 5446bfe343
commit 9f124b25ab
3 changed files with 23 additions and 1 deletions

View File

@@ -311,6 +311,7 @@ namespace Discord.Interactions.Builders
try
{
await instance.BeforeExecuteAsync(commandInfo).ConfigureAwait(false);
instance.BeforeExecute(commandInfo);
var task = commandInvoker(instance, args) ?? Task.Delay(0);
@@ -332,6 +333,7 @@ namespace Discord.Interactions.Builders
}
finally
{
await instance.AfterExecuteAsync(commandInfo).ConfigureAwait(false);
instance.AfterExecute(commandInfo);
( instance as IDisposable )?.Dispose();
}