Prerequisites
Before you begin, ensure you have the following installed:
- Node.js v18.x or higher
- MongoDB Database (local or Atlas)
- Redis Server (required for rate-limiting)
- Git
Step-by-Step Instructions
-
Register a Discord Application
Go to the Discord Developer Portal, create a new application, and navigate to the "Bot" section. Reset the token and save it securely.
Required Privileged Intents: Ensure Message Content Intent, Server Members Intent, and Presence Intent are all enabled.
-
Clone the Repository
Download the source code to your machine or server:
git clone https://github.com/Sejed-TRABELSSI/digital-akhi-bot.git
cd digital-akhi-bot
-
Environment Configuration
Create a .env file in the root directory and fill in your credentials:
DISCORD_TOKEN=your_bot_token
MONGODB_URI=your_mongodb_connection_string
REDIS_URL=your_redis_url
ENCRYPTION_KEY=32_char_random_string
SUPPORT_SERVER_ID=your_guild_id
-
Install & Build
Install dependencies and compile the TypeScript source:
npm install
npm run build
-
Deploy & Start
Deploy the slash commands to Discord and start the bot:
npm run deploy
npm start
Required Permissions
When inviting your bot, it needs the following permissions to function correctly:
- View Channels
- Send Messages
- Embed Links
- Attach Files
- Use Slash Commands
- Manage Messages (for AutoMod & sticky messages)
- Manage Channels (for lock/unlock & join-to-create)
- Move Members (for join-to-create)
- Moderate Members (for timeouts)
- View Audit Log (for enriched logging)