Browse Source

feature: Global interaction post execution event. (#2213)

* Init

* Variable set to event

* Put internal above private

* Revert "Put internal above private"

This reverts commit 77784f001f.

* Revert "Variable set to event"

This reverts commit 2b0cb81d76.

* Revert "Init"

This reverts commit 9892ce7b51.

* Potentially improved approach
tags/3.5.0
Armano den Boef GitHub 3 years ago
parent
commit
a744948477
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 0 deletions
  1. +23
    -0
      src/Discord.Net.Interactions/InteractionService.cs

+ 23
- 0
src/Discord.Net.Interactions/InteractionService.cs View File

@@ -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>


Loading…
Cancel
Save