Custom Events
If you'd like to create your own events, you have two options:
Extend Kord's
Event
type. This is provided as an option mostly so that you can integrate other Kord-based libraries with Kord Extensions.Extend the
KordExEvent
type, which itself extends Kord'sEvent
type. This also extends theKordExKoinComponent
type, providing Koin ⏳ access.
The KordExEvent
type has an identical API to the Kord Event
type.
Once you've constructed an event object, you can fire it using the send
function that's part of the ExtensibleBot
type. If you need to get a reference to this, you can do so via Koin ⏳.
Rich Base Types
When an event deals with specific entity types, it's important that it implements the relevant rich base types.
Name | Parent Types | Description |
---|---|---|
| Base type for events that contain guild information. This must be provided in the form of a | |
|
| Base type for events that contain guild member information. This must be provided in the form of a |
| Base type for events that contain message information. This must be provided in the form of a | |
| Base type for events that contain role information. This must be provided in the form of a | |
| Base type for events that contain user information. This must be provided in the form of a |