feature: Global interaction post execution event. (#2213)
* Init * Variable set to event * Put internal above private * Revert "Put internal above private" This reverts commit 77784f001faa58a90edf34edc195d6942ba9b451. * Revert "Variable set to event" This reverts commit 2b0cb81d76e2150a8d692028486aa1d402efe8a3. * Revert "Init" This reverts commit 9892ce7b51d8cf2952d4ae5b67f4a2e4c7917ae2. * Potentially improved approach
This commit is contained in:
@@ -24,6 +24,29 @@ namespace Discord.Interactions
|
||||
public event Func<LogMessage, Task> Log { add { _logEvent.Add(value); } remove { _logEvent.Remove(value); } }
|
||||
internal readonly AsyncEvent<Func<LogMessage, Task>> _logEvent = new ();
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when any type of interaction is executed.
|
||||
/// </summary>
|
||||
public event Func<ICommandInfo, IInteractionContext, IResult, Task> InteractionExecuted
|
||||
{
|
||||
add
|
||||
{
|
||||
SlashCommandExecuted += value;
|
||||
ContextCommandExecuted += value;
|
||||
ComponentCommandExecuted += value;
|
||||
AutocompleteCommandExecuted += value;
|
||||
ModalCommandExecuted += value;
|
||||
}
|
||||
remove
|
||||
{
|
||||
SlashCommandExecuted -= value;
|
||||
ContextCommandExecuted -= value;
|
||||
ComponentCommandExecuted -= value;
|
||||
AutocompleteCommandExecuted -= value;
|
||||
ModalCommandExecuted -= value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when a Slash Command is executed.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user