# Event Abstract
Abstract base class for all Chariot.js events. Every event created must extend this class, otherwise Chariot.js won't register the event upon initialization. This class should never be instantiated as-is without being extended!
A more detailed event template along with explanations and event examples can be found here.
# Constructor
Instantiation: In event subclass via super(eventName);
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
eventName | String | N/A | A valid Eris client event name. Reference |
# Properties
# Methods
# execute(...eventArgs)
The main event executor running upon being triggered by its event. The event arguments passed to this method are always relative to the event it is processing. For instance the
ready
event has no args, whereas themessageUpdate
event gets passedmessage, oldMessage
. Click here for a full event method argument reference.
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
...eventArgs | Any? | N/A | The event arguments passed to this method relative to its event. |
Promise<void>
This method resolves with an empty Promise upon successful completion.
/* Given the event handler has been initialized with "messageReactionAdd" */
async execute(message, emoji, userID) {
console.log(`${message.author.username} added a reaction with the ID ${emoji.id}!`);
}