Events

CDHandler makes events much easier!

Examples

JavaScript
TypeScript
CoffeeScript
JavaScript
// file name = guildMemberRemove.js
module.exports = (client, member) => {
// member is the guildMemberRemove parameter
console.log(member.user.tag);
};
TypeScript
import { Client } from "discord.js";
export default (client: Client, member: any) => {
// member is the guildMemberRemove parameter
console.log(member.user!.tag);
};
CoffeeScript
# file name = guildMemberRemove.coffee
module.exports = (client, member) ->
# member is the guildMemberRemove parameter
console.log(member.user.tag);

Make sure to name your files after the event name, ex: guildMemberAdd.js would be the guildMemberAdd event, this is case sensitive, and should be exactly the way it's spelled.