A Discord bot made for a friend that automatically manages 'Active' and 'Inactive' roles based on user message activity.
- Assigns 'Active' role to users who have sent a message in the last 7 days.
- Assigns 'Inactive' role to users who have not sent a message in over 7 days.
- Automatically switches roles when users become active/inactive.
- Uses SQLite for persistent tracking of user activity.
- Create 'Active' and 'Inactive' roles in your Discord server.
- Invite the bot with permissions to manage roles and read messages.
- Copy your bot token from the Discord Developer Portal.
- Replace
YOUR_BOT_TOKEN_HEREinindex.jswith your actual bot token. - Run the bot:
npm init -y npm install discord.js sqlite3 node index.js
- Node.js
- discord.js
- sqlite3
- The bot must have permission to manage roles and read messages in your server.
- The check for inactive users runs every 12 hours by default.