A Discord bot that tracks and announces member birthdays automatically!
- Runs daily at the configured hour in the configured timezone (defaults to 10:00 AM Eastern Time)
- Automatically handles Daylight Saving Time transitions
- Pings
@everyonein the configured channel - Shows age if birth year was provided during setup
- (Optional) Assign members a special role on their birthday that gets automatically removed the next day
- Beautiful embed messages with emojis
-
/setbirthday <day> <month> [year]- Set your birthdayday: Day of the month (1-31) - Requiredmonth: Month (1-12) - Requiredyear: Birth year (optional, for age calculation)
-
/mybirthday- View your current birthday setting -
/listbirthdays- List all server birthdays (Admin only)
- Go to the Discord Developer Portal
- Click "New Application" and give it a name
- Go to the "Bot" section and click "Add Bot"
- Copy the bot token (you'll need this later)
- Under "Privileged Gateway Intents", enable:
- Server Members Intent (if you want to fetch member info)
- Go to "OAuth2" β "URL Generator"
- Select "bot" and "applications.commands" scopes
- Select "Send Messages", "Use Slash Commands", and "Mention Everyone" permissions
- Copy the generated URL to invite the bot to your server
You'll need these values from the Discord Developer Portal:
DISCORD_TOKEN- Your bot tokenDISCORD_CLIENT_ID- Your application client IDBIRTHDAY_CHANNEL_ID- The channel ID where announcements will be sentTZ- Timezone for birthday notifications (optional, defaults to America/New_York)BIRTHDAY_NOTIFICATION_HOUR- Hour for notifications in 24-hour format (optional, defaults to 10)
# Deploy commands to Discord (one-time setup)
docker run --rm \
-e DISCORD_TOKEN="your_bot_token" \
-e DISCORD_CLIENT_ID="your_client_id" \
ghcr.io/slamanna212/discordbirthdaybot:latest \
node scripts/deploy-commands.js docker run -d \
--name birthday_bot \
--restart unless-stopped \
-e TZ=America/New_York \
-e BIRTHDAY_NOTIFICATION_HOUR=10 \
-e NODE_ENV=production \
-e DISCORD_TOKEN="your_bot_token" \
-e DISCORD_CLIENT_ID="your_client_id" \
-e BIRTHDAY_CHANNEL_ID="your_channel_id" \
-e BIRTHDAY_ROLE_ID="your_birthday_role_id" \
-v ./data:/app/data \
ghcr.io/slamanna212/discord-birthday-bot:latest
The bot uses several environment variables for configuration. Here's a complete reference:
| Variable | Description | Example | Notes |
|---|---|---|---|
DISCORD_TOKEN |
Your bot's token from Discord Developer Portal | MTEx... |
Required - Keep this secret! |
DISCORD_CLIENT_ID |
Your application's client ID | 123456789012345678 |
Required - Found in Discord Developer Portal |
BIRTHDAY_CHANNEL_ID |
Channel ID where birthday announcements are sent | 123456789012345678 |
Required - Right-click channel β Copy ID |
NODE_ENV |
Node.js environment | development |
development, production |
| Variable | Description | Default | Valid Values | Example |
|---|---|---|---|---|
TZ |
Timezone for birthday notifications | America/New_York |
Any valid IANA timezone | America/Los_Angeles, UTC, Europe/London |
BIRTHDAY_NOTIFICATION_HOUR |
Hour to send birthday notifications (24-hour format) | 10 |
0-23 |
6 (6:00 AM), 18 (6:00 PM) |
BIRTHDAY_ROLE_ID |
Role ID to assign to users on their birthday | None |
Discord Role ID | 123456789012345678 |
- Go to Discord Developer Portal
- Select your application
- Bot Token: Go to "Bot" section β Copy token
- Client ID: Go to "General Information" β Copy Application ID
- Enable Developer Mode in Discord (User Settings β Advanced β Developer Mode)
- Right-click the channel where you want birthday announcements
- Select "Copy ID"
- Enable Developer Mode in Discord (User Settings β Advanced β Developer Mode)
- Go to Server Settings β Roles
- Right-click the role you want to use for birthdays
- Select "Copy ID"
- Note: The bot needs "Manage Roles" permission and the birthday role must be below the bot's highest role in the hierarchy
Use standard IANA timezone names:
- US Timezones:
America/New_York,America/Chicago,America/Denver,America/Los_Angeles - Other Common:
UTC,Europe/London,Asia/Tokyo,Australia/Sydney - Full List: Wikipedia IANA Timezone List
The bot uses SQLite to store birthday data in a file called birthdays.db. This file will be created automatically when you first run the bot.
CREATE TABLE birthdays (
userId TEXT PRIMARY KEY,
username TEXT NOT NULL,
day INTEGER NOT NULL,
month INTEGER NOT NULL,
year INTEGER,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);This project includes automated GitHub Actions workflows:
- Triggers: Push to main/master, Pull Requests
- Purpose: Validates project structure and tests Docker build
- Jobs:
- Tests Docker image build
- Validates file structure
- Checks package.json dependencies
- Verifies environment example file
- Triggers: Push to main/master, Pull Requests, Releases
- Purpose: Builds and pushes Docker images to GitHub Container Registry
- Features:
- Multi-platform builds (AMD64, ARM64)
- Automated tagging (latest, version tags)
- Docker layer caching for faster builds
- Only pushes on main branch (not PRs)
- Triggers: Manual workflow dispatch
- Purpose: Deploy the bot to production/staging environments
- Features:
- Manual trigger with environment selection
- Deploys slash commands automatically
- Pulls latest image from registry
- Environment-specific container naming
- Deployment verification
- Automatic Testing: Push code or create PR - tests run automatically
- Automatic Building: Push to main branch - Docker image builds and pushes to GHCR
- Manual Deployment: Go to Actions tab β Deploy β Fill in credentials β Run
MIT License - Feel free to modify and distribute!