Skip to content

diorwave/discord-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✅ Discord Check-in Notification Bot

A simple Discord bot that monitors an announcement channel, automatically adds a ✅ reaction to new posts, and reminds users via DM every 2 hours if they haven’t reacted yet.

Built with TypeScript, Discord.js v14, and nodemon for hot reloading.


🚀 Features

  • Automatically reacts to new messages in your announcement channel.
  • Tracks which users have reacted with ✅.
  • Sends DM reminders every 2 hours to those who haven’t reacted.
  • Updates the bot’s avatar on startup.
  • No database required — runs entirely in memory.

📂 Project Structure


discord-checkin-bot/
├─ bot/
│  └─ index.ts           # main bot logic
├─ .env                  # environment variables
├─ package.json          # project dependencies and scripts
├─ tsconfig.json         # TypeScript config
├─ nodemon.json          # nodemon config (optional)
└─ README.md


⚙️ Installation

  1. Clone this repository

    git clone https://github.com/ledgerwave/discord-bot.git
    cd discord-bot
  2. Install dependencies

    npm install
  3. Create a .env file

    DISCORD_TOKEN=your_discord_bot_token_here
    ANNOUNCEMENT_CHANNEL_ID=your_announcement_channel_id
    GENERAL_CHANNEL_ID=your_general_channel_id
    MODERATOR_ID=your_moderator_user_id
    CHECKMARK=✅
    REMINDER_INTERVAL=5000
    MAX_MISSED_CHECKINS=5
    BOT_ICON_PATH=./assets/icon.png
    • DISCORD_TOKEN → Your Discord bot token (from the Discord Developer Portal)
    • ANNOUNCEMENT_CHANNEL_ID → Channel where announcements are posted
    • GENERAL_CHANNEL_ID → Channel where moderator notifications are sent (e.g., general channel)
    • MODERATOR_ID → User ID of the moderator to notify
    • CHECKMARK → Emoji used for check-ins (default: ✅)
    • REMINDER_INTERVAL → Interval between reminders in milliseconds (default: 5000ms = 5 seconds)
    • MAX_MISSED_CHECKINS → Number of missed check-ins before notifying moderator (default: 5)
    • BOT_ICON_PATH → Optional path to your bot's avatar image
  4. Enable Intents in Developer Portal

    • Go to Bot → Privileged Gateway Intents

    • Enable:

      • ✅ Server Members Intent
      • ✅ Message Content Intent

▶️ Running the Bot

Development mode (auto-reload)

npm run start

Or directly with ts-node

npx ts-node index.ts

The bot will:

  • Log in to Discord
  • Set its avatar (optional)
  • React ✅ to new announcement messages
  • DM users who haven’t reacted every 2 hours

🛠️ Scripts

Command Description
npm run start Start the bot with nodemon (auto-reload)
npx ts-node index.ts Run once using ts-node
npm run build (Optional) Compile to JavaScript if you add a build script

🧠 Notes

  • If users have DMs disabled for server members, they will not receive reminders.

  • All data (reactions, users) is stored in memory — restarting the bot resets the data.

  • You can change the reminder interval inside index.ts:

    const REMINDER_INTERVAL = 2 * 60 * 60 * 1000; // 2 hours

🪪 License

MIT License © 2025 Your Name


❤️ Contributing

Pull requests and improvements are welcome! Feel free to fork and modify this bot for your own server.

About

A versatile Discord bot built for community servers: supports slash commands, event handling, moderation tools, and extensible modules, ready for customization and integration into your Discord ecosystem.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors