onLeave
Command executes when a user leaves the guild.
Event: onLeave
Type: leaveCommand
Prerequisites
Add the onLeave Event:
bot.addEvent([
"onMessage",
"onInteraction",
"onLeave" //This is what you need to add
])Add the GUILD_MEMBERS Intent:
const dbd = require("dbd.ts")
const bot = new dbd.Bot({
intents: ["GUILDS", "GUILD_MESSAGES", "GUILD_MEMBERS"],
prefix: "PREFIX"
})
//The rest of your index.js file hereEnable Prilivaged "Members Intent" in the Discord Developer Portal:

Example

You should use server variables in $channelSendMessage[] (if your bot is in more than 1 server).
Last updated
Was this helpful?