Features
- Embed welcome — Send a rich embed with a customizable title, description, image, and thumbnail when a member joins.
- Image welcome card — Generate a canvas-based welcome image with the member’s avatar, username, join rank, and account creation date.
- Template tags — Use
?user, ?tag, ?mention, ?server, and ?rank in your descriptions for dynamic content.
- Per-server configuration — All settings are stored per guild using a persistent SQLite database.
- Admin-only setup — Configuration commands require the
Administrator permission.
- Command cooldown — Built-in 10-second cooldown per user to prevent spam.
Tech Stack
Screenshots
Embed Welcome

Image Welcome Card

Installation
Prerequisites
Steps
# 1. Clone the repository
git clone https://github.com/diwasatreya/Welcome-Bot.git
cd Welcome-Bot
# 2. Install dependencies
npm install
# 3. Configure environment variables
cp .env.example .env
# Edit .env and add your bot token
# 4. Start the bot
npm start
Environment Variables
| Variable |
Description |
Required |
TOKEN |
Your Discord bot token |
✅ Yes |
Create a .env file in the root directory (copy from .env.example):
TOKEN=your_bot_token_here
Important: Never commit your .env file. It is already listed in .gitignore.
Configuration
Edit config.json to set your bot’s command prefix and your Discord user ID:
{
"prefix": "!",
"developerID": "your_discord_user_id"
}
Running Locally
npm start
For development with auto-restart on file changes (Node.js ≥ 18):
npm run dev
The bot also starts an HTTP keep-alive server on port 3000, which is useful when hosting on platforms like Replit.
Bot Setup (Discord)
When inviting the bot to your server, ensure it has these permissions:
- Read Messages / View Channels
- Send Messages
- Embed Links
- Attach Files
- Manage Messages (for auto-deleting help messages)
Enable these Privileged Gateway Intents in the Developer Portal:
- ✅ Server Members Intent — required for
guildMemberAdd events
- ✅ Message Content Intent — required for reading command messages
Commands
All commands require the Administrator permission unless noted.
| Command |
Alias |
Description |
Required |
setwelcomechannel <#channel> |
sw |
Set the embed welcome channel |
✅ |
setdescription <text> |
sd |
Set the welcome embed description |
✅ |
setthumbnail <url|tag> |
st |
Set the welcome thumbnail |
✅ |
setimage <url> |
si |
Set the welcome embed image |
Optional |
setimagewelcome <#channel> |
siw |
Set the image-card welcome channel |
Optional |
test |
— |
Preview the embed welcome |
— |
testimage |
ti |
Preview the image welcome card |
— |
reset |
— |
Clear all welcome settings |
— |
help [command] |
— |
Show help for all or one command |
— |
Use these placeholders in your setdescription text:
| Tag |
Output |
?user |
Member’s username |
?tag |
Member’s username#discriminator |
?mention |
@mention |
?server |
Server name |
?rank |
Member’s join position (e.g. 42nd) |
Use these with setthumbnail:
| Tag |
Output |
?useravatar |
New member’s avatar URL |
?serveravatar |
Server icon URL |
Project Structure
Welcome-Bot/
├── commands/
│ └── welcome/ # All command modules
│ ├── help.js
│ ├── imagetest.js
│ ├── reset.js
│ ├── setdesc.js
│ ├── setimg.js
│ ├── setimgwel.js
│ ├── setnail.js
│ ├── setwelchn.js
│ └── test.js
├── fonts/ # TrueType fonts for canvas rendering
├── handlers/
│ └── command.js # Auto-loads all commands on startup
├── JSON/
│ └── link.json # Background image URLs for welcome cards
├── .env.example # Environment variable template
├── .gitignore
├── config.json # Prefix and developer ID
├── index.js # Bot entry point
├── LICENSE
├── package.json
└── README.md
Scripts
| Script |
Description |
npm start |
Start the bot |
npm run dev |
Start with Node.js --watch (auto-restart on change) |
Deployment
Replit
- Fork this repo and open it in Replit.
- Add your
TOKEN in Secrets (not in .env).
- Click Run.
The built-in HTTP server on port 3000 keeps the bot alive with an uptime monitor (e.g. UptimeRobot).
VPS / Server
# Install pm2 for process management
npm install -g pm2
pm2 start index.js --name welcome-bot
pm2 save
pm2 startup
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b fix/your-fix
- Commit your changes:
git commit -m "fix: describe the fix"
- Push and open a Pull Request
Please keep changes minimal and focused. This is a small, intentionally simple bot.
License
Distributed under the Apache License 2.0.
Credits
评论