This document provides an overview of a simple Discord bot written in TypeScript using the Discord.js library. The bot listens for messages in Discord servers and responds to specific commands.
- TypeScript
- Discord.js
- Moderation
- MongoDB
- Event listeners
To run the bot locally, follow these steps:
-
Clone the repository:
git clone <repository-url>
-
Navigate to the project directory:
cd discord-bot -
Install dependencies:
npm install
-
Compile TypeScript code:
npm run compile
-
Set up your Discord bot in the Discord Developer Portal and obtain a bot token.
-
Create a
.envfile in the project root directory and add your bot token:token=your-bot-token-here client_id=your-client-id guild_id=your-guild-id
-
Start the bot:
npm run dev
Once the bot is running and added to your Discord server, you can interact with it using the following command:
!hello: Responds with "Hello, world!".