Skip to main content
Version: 2.3

Events

Base events

You can use this decorator to declare methods that will be executed whenever a Discord event is triggered.

Our methods must be decorated with the @On(event: string) or @Once(event: string) decorator.

It's that simple, when the event is triggered, the method is called:

import { Discord, On, Once } from 'discordx'

@Discord()
class Example {

@On('messageCreate')
private onMessage() {
// ...
}

@Once('ready')
private onReady() {
// ...
}
}
important

For more information, head over to the discordx documentation.

Added events

TSCord make the use of discord-logs to add furthermore events to the client!

You can find the complete list of added events here

Custom Events

You can also set your own custom events.

Head over this part of the documentation to know more 😉