Elevate Bot is a specialized Discord bot designed to create a focused, accountable, and productive community environment. It combines strict gated access control with a robust task management system. By requiring users to actively log in to participate and tracking their daily tasks, streaks, and scores, the bot gamifies productivity and ensures accountability.
- Password Authentication: Users must sign in via a secure modal or password command to gain access to the server.
- Session Management: Automatic logout after 15 minutes of inactivity to ensure active participation.
- Security logging: All login/logout events are logged to a dedicated admin channel.
- Daily Goals: Users commit tasks for the day and mark them as complete as they progress.
- Stash Functionality: Unfinished tasks can be "stashed" to automatically reappear in the next day's list.
- Accountability Checks: Pulling a user's task list (
!pull @user) triggers a DM alert if the user is currently offline/logged out.
Encourage consistency with a built-in scoring engine:
- +20 Points: Completing a fresh task committed today.
- +10 Points: Completing a task carried over from the stash.
- -5 Points: Penalty for any task left incomplete at the end of the day.
- Daily Streaks: Only increment if at least one task is completed for the day.
- 7:00 AM Daily Reset: A cron job automatically processes daily stats, updates streaks, moves stashed tasks, and clears the slate for the new day.
This project is built using modern JavaScript and cloud-native technologies:
- Node.js: Runtime environment for the bot logic.
- Discord.js: Powerful library for interacting with the Discord API.
- Rest Redis (Upstash): Serverless Redis database for fast, persistent storage of tasks, scores, and sessions.
- Node-Cron: Task scheduler for handling the 7:00 AM daily reset.
All commands are prefixed with !.
| Command | Usage | Description |
|---|---|---|
| Commit | !commit <task> |
Add a new task to your daily list. Example: !commit Finish React component |
| Push | !push <number> |
Mark a task as complete. Example: !push 1 (Completes task #1) |
| Pull | !pull [user] |
View your tasks, score, and streak. Mention a user to see theirs. Example: !pull or !pull @Alice |
| Stash | !stash <number> |
Move a task to the Stash. It will reappear automatically tomorrow. Example: !stash 2 |
| Remove | !rm <number> |
Delete a task entirely from your list. Example: !rm 3 |
| Checkout | !checkout |
End your day. Calculates final score, updates streak, and posts a summary report. Note: You cannot add new tasks after checking out. |
| Logout | !logout |
Manually sign out of the session immediately. |
| Command | Usage | Description |
|---|---|---|
| Reset | !reset --soft @user |
Clears a user's tasks and checkout status for today only. |
| Full Wipe | !reset --hard @user |
Irreversible. Wipes all data (Score, Streak, Stash, Tasks) for a user. |
elevate-bot/
├── 📂 handlers/ # core event logic
│ ├── activityManager.js # inactivity timeout
│ ├── interactionHandler.js # buttons & modals
│ ├── mentionNotifier.js # DM alerts
│ └── messageHandler.js # command routing
├── 📂 tasks/ # scheduled & command logic
│ ├── dailyReset.js # 7 AM cron job
│ └── tasksCommands.js # !commit, !push, etc.
├── 📂 utils/ # helper modules
│ ├── scoreStorage.js # Redis score logic
│ ├── statsProcessor.js # Daily summaries
│ ├── taskStorage.js # Task CRUD
│ ├── dateHelper.js # IST time handling
│ └── panel.js # Login UI generation
├── config.js # configuration constants
├── index.js # entry point
└── package.json # dependencies-
Clone the repository
git clone https://github.com/yourusername/elevate-bot.git cd elevate-bot -
Install Dependencies
npm install
-
Configure Environment Create a
.envfile in the root directory:TOKEN=your_discord_bot_token PASSWORD=your_server_password UPSTASH_REDIS_REST_URL=your_redis_url UPSTASH_REDIS_REST_TOKEN=your_redis_token
-
Bot Setup Ensure your Discord server has the following channels (names configurable in
config.js):🔐-access(Login panel)🤖-bot-commands(Task commands)✅-session-progress(Daily reports)🚨-grilling-area
-
Run the Bot
npm start
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Built with ❤️ for productivity enthusiasts.
