Welcomer
The Welcomer module sends a message to a channel of your choice whenever a new member joins your server. You can customise the message with placeholders and optionally show which member invited the new person.
Requirements
Your bot needs the MANAGE_GUILD permission to fetch invite data. Without it, invite tracking will not work and the inviter will show as unknown. Enable Developer Mode in Discord to copy channel IDs.
Settings
Open settings/settings.js and set the channel where welcome messages will be posted,
along with the default message text.
let welcomeChannelId = 'YOUR_CHANNEL_ID';
let welcomeMessage = 'Welcome to {server}, {user}!';
Placeholders
Use these inside your welcome message to insert live values.
| Placeholder | What it outputs |
|---|---|
{user} | Mentions the new member e.g. @Steve |
{username} | Plain username with no mention e.g. Steve |
{server} | The name of your server pulled live from Discord |
Basic Usage
Import the module and call it once in your main bot file. The message argument is optional and falls back to whatever you set in settings.js.
const { DiscordWelcomer } = require('./node_modules/bb-dbotbits/discordWelcomer.js');
DiscordWelcomer('Welcome to {server}, {user}!');
Invite Tracking
Pass showInvitee: true as a second argument to automatically detect and display who invited the new member.
When enabled, a second line is appended to the welcome message showing the inviter as a mention.
The invite data is also saved to inviteData.json in your bot folder for future reference.
DiscordWelcomer('Welcome to {server}, {user}!', { showInvitee: true });
DiscordWelcomer('Welcome to {server}, {user}!', { showInvitee: false });
Example Output
With invite tracking on, the bot will post something like this in your welcome channel:
Welcome to My Server, @Steve! Invited by @John
If the inviter cannot be determined, for example the member joined via a vanity URL, the second line is silently skipped.
inviteData.json
When invite tracking is on, a file called inviteData.json is created automatically in your bot root folder.
It stores a record for every member who joins, including who invited them and when they joined.
This file is created for you if it does not already exist.
{
"123456789012345678": {
"username": "Steve",
"joinedAt": "2026-06-04T12:00:00.000Z",
"invitedBy": {
"userId": "987654321098765432",
"username": "John",
"inviteCode": "abc123"
}
}
}
Continue to Goodbyes to set up a message when members leave.