A simple and powerful Discord bot that tracks user activity through !checkin
and !checkout
commands. The bot logs the time users spend in sessions and provides activity summaries. Built with Node.js and SQLite, it’s lightweight and easy to deploy.
- Check-In and Check-Out: Tracks the time users spend in sessions.
- Activity Summary: Displays total session time for users over the past 7 days (or a custom period).
- Docker Support: Easily deploy the bot using Docker for a reliable and isolated environment.
- Lightweight Database: Uses SQLite for local data storage, ensuring simplicity and performance.
Command | Description |
---|---|
!checkin |
Starts tracking a user's session. |
!checkout |
Ends the session and logs the duration. |
!summary [days] |
Displays the total time spent by users in the past [days] (default: 7). |
-
Clone the Repository
git clone https://github.com/your-username/discord-checkin-bot.git cd discord-checkin-bot
-
Install Dependencies
npm install
-
Set Up Environment Variables Create a
.env
file to store your Discord bot token:touch .env
Add the following line to
.env
:DISCORD_BOT_TOKEN=your_bot_token
-
Run the Bot Start the bot locally:
node bot.js
docker build -t discord-checkin-bot .
docker run -d \
--name discord-checkin-bot \
-e DISCORD_BOT_TOKEN=your_bot_token \
discord-checkin-bot
- Check logs:
docker logs discord-checkin-bot
- Restart the container:
docker restart discord-checkin-bot
-
Invite the bot to your server:
- Go to the Discord Developer Portal.
- Copy the OAuth2 URL and invite the bot to your server with the necessary permissions.
-
Interact with the bot using the commands:
!checkin
to start tracking time.!checkout
to end your session.!summary
to view a summary of user activity.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add a new feature"
- Push to your fork:
git push origin feature-name
- Create a pull request on the main repository.
This project is licensed under the MIT License. See the LICENSE file for details.
If you encounter any issues or have feature requests, please open an issue.
- Discord.js for the powerful Discord API library.
- SQLite for the lightweight database.