onJoin
Command executes when a user joins the guild.
Event: onJoin
Type: joinCommand
Prerequisites
Add the onJoin
Event:
bot.addEvent([
"onMessage",
"onInteraction",
"onJoin" //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 here
Enable Prilivaged "Members Intent" in the Discord Developer Portal:
Example
bot.commands.add({
type: "joinCommand",
code: `$channelSendMessage[773363417338609674;Welcome <@$authorID>!]`
})

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