This guide explains how to set up the Discord bot locally on your machine.
Before starting, ensure you have the following installed:
- Node.js (LTS version recommended)
- Git (for cloning the repository)
- SQLite (for the database, installed automatically by Prisma)
- Clone the Repository
git clone <repository-url> cd <repository-folder>
- Install Dependencies Use npm to install all required dependencies:
npm install
- Set Up the Database Initialize the database using Prisma:
npx prisma migrate dev --name init
- Create a .env File Add a .env file in the root directory with the following content:
DISCORD_BOT_TOKEN=your-bot-token-here
Replace your-bot-token-here with your actual Discord bot token from the Discord Developer Portal.
- Compile the TypeScript Code Convert the TypeScript source files into JavaScript:
npx tsc node dist/index.js