A rebranded Discord bot that sends a stylish embedded welcome message via DMs when someone joins your server. It also tracks who invited who using invite codes and stores the data locally in json files.
greeting-bot/
├── commands/ # Bot commands like /invite and /stats
├── database/
│ └── invites.json # Local database for invite tracking
│ └── members.json # Local database for member tracking
├── events/
│ ├── guildMemberAdd.js # Handles new member joins (sends DM, tracks invite)
│ ├── guildMemberRemove.js # Handles member leaves
│ └── ready.js # Logs bot startup
├── utils/
│ └── memberDatabase.js # DB logic between
├── .env # Bot token
├── .gitignore # Ignores .env and node_modules
├── config.json # Bot settings
├── index.js # Bot entry point
├── package.json # Project metadata
├── package-lock.json # Exact dependency versions
└── README.md # You're reading this
- Sends a personalized DM welcome to new users
- Tracks who invited the new member (with invite code detection)
/invite
and/stats
slash commands- Lightweight and modular structure
- Uses
.env
andconfig.json
for easy configuration
git clone https://github.com/007codename/greeting-bot.git
cd greeting-bot
npm install
Rename the .env.example
file to .env
and add your bot token & id:
BOT_TOKEN=your_bot_token_here
CLIENT_ID=your_client_id_here
.gitignore
.
Rename the config.json.example
file to config.json
and add the requested info to fit your server:
{
"guildId": "your_guild_id",
"joinLeaveChannelId": "your_join_leave_channel_id"
}
node index.js
- Make sure "Server Members Intent" is enabled in the Discord Developer Portal.
- This bot currently stores data locally in json files. For multi-server or persistent tracking, connect to a real database.
MIT License. Fork it. Remix it. Break it.
Discord: @007codename