A polished, well-structured Discord bot that welcomes new members with DMs, tracks invites, logs joins/leaves, and generates personalized welcome cards.
| Feature | What you get |
|---|---|
| 💌 Welcome DMs | Stylish embedded messages for every new member. |
| 🧭 Invite Tracking | See who invited who via invite code analytics. |
| 🧾 Join/Leave Logs | Moderation-friendly logs with rich embeds. |
| 🖼️ Welcome Cards | Personalized images generated with canvacord. |
| ⚡ Slash Commands | /invites and /stats toolset for admins. |
| 🗂️ Local JSON Storage | Lightweight files auto-created at runtime. |
.
├── src/ # Source code
│ ├── commands/ # Slash commands
│ │ ├── invite.js # /invites management
│ │ └── stats.js # /stats analytics
│ ├── events/ # Discord event handlers
│ │ ├── guildMemberAdd.js # Welcome DM + invite tracking + welcome card
│ │ ├── guildMemberRemove.js# Leave log + invite lookup
│ │ ├── inviteCreate.js # Auto-track new invites
│ │ ├── inviteDelete.js # Clean up deleted invites
│ │ └── ready.js # Startup sync + invite validation schedule
│ ├── models/
│ │ └── WelcomeCard.js # Welcome card renderer
│ ├── utils/
│ │ ├── inviteValidator.js # Invite sync + validation helpers
│ │ └── memberDatabase.js # Member tracking storage
│ ├── config/
│ │ ├── config.json # Bot configuration
│ │ └── config.json.example # Bot configuration template
│ └── index.js # Bot entry point
├── data/ # Auto-created JSON storage (members/invites)
├── .env.example # Environment variable template
├── package.json # Dependencies & metadata
├── LICENSE # MIT License
└── README.md
Estimated setup time: 5–10 minutes
npm installCopy .env.example to .env and fill in:
BOT_TOKEN=your_bot_token_here
CLIENT_ID=your_client_id_hereRename src/config/config.json.example to src/config/config.json and set the channel IDs used by the bot:
{
"joinLeaveChannelId": "your_join_leave_channel_id",
"welcomeCardChannelId": "your_welcome_card_channel_id",
"welcomeCardBackground": "https://your-image-url.com/background.png"
}node src/index.jsRequires Manage Server permissions.
| Command | Subcommand | Purpose |
|---|---|---|
/invites |
add |
Assign a custom name to an invite. |
/invites |
remove |
Remove a custom invite name. |
/invites |
list |
List active + archived invites. |
/invites |
validate |
Archive deleted/expired invites. |
/stats |
invites |
Invite performance & usage. |
/stats |
members |
Member join sources. |
Enable these in the Discord Developer Portal:
- Server Members Intent
- Guild Invites Intent
- Direct Messages Intent
- View Channels
- Send Messages
- Embed Links
- Read Message History
The bot stores lightweight JSON files at runtime in the data/ folder (outside src/). Directories are created automatically:
data/members.json— member → invite trackingdata/invites.json— invite metadata
If you want multi-server persistence or analytics at scale, swap these files for a real database.
| Area | Details |
|---|---|
| Slash Commands | Registered globally on startup. |
| Invite Validation | Runs every 6 hours to archive expired invites. |
| Welcome Cards | Supports a custom background image via config.json. |
- Add a database adapter (MongoDB/Postgres).
- Per-guild configuration UI or
/setupwizard. - Customizable welcome DM templates.
MIT
Discord: @007codename