Show / Hide Table of Contents

Class EventController

Inheritance
object
EventController
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Discord.Controller
Assembly: Discord.dll
Syntax
public static class EventController

Methods

ExecuteController<T>(string[], string, object, Assembly)

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, Assembly execAssembly)
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.

Assembly execAssembly

The executing assembly. Get it via GetExecutingAssembly()

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

ENUM

The base enum that will get separated and passed to the actual controller

In This Article
Back to top Generated by DocFX