Class EventController
Inherited Members
Namespace: Discord.Controller
Assembly: Discord.dll
Syntax
public static class EventController
Methods
ExecuteController<T>(string[], string, object)
Method To be placed in a separate Class that will be passed into the InvokeEventControllerClass<CLASS, ENUM>(string, object) For the EventControllerAttribute you have to pass the enum type e.g. of all categories and pass the enum value for a specific category. Finally you have to execute the controller and use the category's enum for the generic.
Declaration
public static void ExecuteController<T>(string[] ids, string nspace, object e)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | ids | The given Ids without category enum. |
| string | nspace | The namespace with all the required events. E.g. Project_Sipster.DiscordBarista.Function.Partnership.Events |
| object | e | The passed event from the InvokeEventControllerClass<CLASS, ENUM>(string, object) - just needs to be put it as a param and passed over to the controller. |
Type Parameters
| Name | Description |
|---|---|
| T | The enum of the category |
InvokeEventControllerClass<CLASS, ENUM>(string, object)
To be executed by the Discord Events that use Ids.
Declaration
public static void InvokeEventControllerClass<CLASS, ENUM>(string ids, object e) where ENUM : class
Parameters
| Type | Name | Description |
|---|---|---|
| string | ids | Passed Ids by the event e.g e.Interaction.Data.CustomId |
| object | e | The passed Event args |
Type Parameters
| Name | Description |
|---|---|
| CLASS | The class that should be looked in by the controller, defined by using ExecuteController<T>(string[], string, object) |
| ENUM | The base enum that will get separated and passed to the actual controller |