A Discord bot that monitors channels for time mentions and replies with Discord-formatted timestamps. For lazy admins who can't be bothered to use @time
- 🔍 Smart Time Parsing: Detects times like "12 utc", "19:30 UTC", "at 20", "3pm utc"
- 🌍 UTC Assumption: All times are assumed to be UTC
- 🧠 Smart Date Inference: If a time has already passed today, assumes tomorrow
- 📝 Discord Timestamps: Replies with both full (
<t:unix:F>) and relative (<t:unix:R>) formats - 🚫 No Self-Replies: Bot ignores its own messages
git clone <repository-url>
cd timeLordBot
npm install- Go to Discord Developer Portal
- Create a new application
- Go to "Bot" section and create a bot
- Copy the bot token
- Enable "Message Content Intent" under Privileged Gateway Intents
cp .env.example .env
# Edit .env and add your DISCORD_TOKENOptional: Configure Channel Filtering
By default, the bot monitors ALL channels. To restrict it to specific channels:
-
Enable Developer Mode in Discord:
- User Settings → App Settings → Advanced → Enable Developer Mode
-
Get channel IDs:
- Right-click the channel → Copy Channel ID
-
Add to
.env:CHANNEL_IDS=123456789012345678,987654321098765432
If CHANNEL_IDS is empty or unset, the bot monitors all channels (backward compatible).
npm startFor development with auto-reload:
npm run devUser posts:
"Pass opens at 12 utc"
Bot replies:
🕐 Time(s) detected:
at 12 utc → <t:1234567890:F> | <t:1234567890:R>
12 utc- 12:00 UTC19:30 UTC- 19:30 UTCat 20- 20:00 UTC3pm utc- 15:00 UTC3:30pm- 15:30 UTCat 12:30- 12:30 UTC
# Install PM2 globally
npm install -g pm2
# Start the bot
pm2 start src/index.js --name timelordbot
# Set to start on system boot
pm2 startup
pm2 saveCreate a service file at /etc/systemd/system/timelordbot.service:
[Unit]
Description=TimeLord Discord Bot
After=network.target
[Service]
Type=simple
User=your-user
WorkingDirectory=/path/to/timeLordBot
ExecStart=/usr/bin/node src/index.js
Restart=always
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.targetThen:
sudo systemctl enable timelordbot
sudo systemctl start timelordbot
sudo systemctl status timelordbottimeLordBot/
├── src/
│ ├── index.js # Main bot entry point
│ └── timeParser.js # Time parsing logic
├── .env # Environment variables (not in git)
├── .env.example # Environment template
├── package.json # Node.js dependencies
└── README.md # This file
ISC