discord-botstrap is a TypeScript template project designed to serve as a launchpad for a customizable and scalable bot. It removes all scaffolding concerns and implements best coding practices. It contains a modular structure for commands and events, making it easy to add new features and maintain the codebase. This template is built on top of discord.js and uses TypeScript for type safety and better development experience. It also includes ESLint and Prettier for code quality and formatting.
- TypeScript: Advanced typing for more robust code.
- ESLint and Prettier: Ensures consistent and high-quality code style.
- Docker Support: Easy and portable execution via Docker containers.
- Testing: Includes unit tests with Jest for reliable code.
- GitHub Actions: Automated workflows for linting, testing, and building to ensure code quality and reliability for each PR and commit.
- Node.js >= 18
- pnpm (Package Manager)
- Docker (optional, for containerized execution)
-
Clone the repository:
git clone https://github.com/steph-lion/discord-botstrap.git cd discord-botstrap
-
Install dependencies:
pnpm install
-
Configure environment variables: Create a
.env
file in the root of the project and add the following variables:DISCORD_TOKEN=<your_discord_token> DISCORD_CLIENT_ID=<your_client_id> DISCORD_GUILD_ID=<your_guild_id>
-
Build the project:
pnpm build
-
Start the bot:
pnpm start
-
For development, use the command:
pnpm dev
-
Build the Docker image:
docker-compose build
-
Start the container:
docker-compose up
-
To stop the container:
docker-compose down
This project uses ESLint and Prettier to maintain consistent code style:
-
To lint the code with ESLint:
pnpm lint
-
To format the code with Prettier:
pnpm format
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix:
git checkout -b feature/your-feature-name
- Make your changes and commit them:
git commit -m "Add your message here"
- Push your branch:
git push origin feature/your-feature-name
- Open a pull request and describe your changes.
This project is licensed under the MIT License. See the LICENSE file for more details.