Registering the event
This page shows how to call the command handler to make commands actually work

We want to do other things in the Message event

1
// `client` is our Discord.js Client
2
// `commands` is our djs-commands-control Commands object
3
4
client.on("message", (message) => {
5
// Do some stuff
6
7
// Call the command handler
8
commands.messageEvent(message);
9
10
// Do some more other stuff
11
});
12
Copied!

We only want to call the command handler

1
// `client` is our Discord.js Client
2
// `commands` is our djs-commands-control Commands object
3
4
client.on("message", commands.messageEvent);
5
Copied!
Last modified 4mo ago