https://github.com/steph-lion/discord-botstrap
This is a full Typescript template for creating a Discord bot. The codebase uses the common and best practices for linting, formatting and design patterns.
https://github.com/steph-lion/discord-botstrap
design-patterns discord discord-js docker eslint prettier template typescript
Last synced: about 1 year ago
JSON representation
This is a full Typescript template for creating a Discord bot. The codebase uses the common and best practices for linting, formatting and design patterns.
- Host: GitHub
- URL: https://github.com/steph-lion/discord-botstrap
- Owner: steph-lion
- License: mit
- Created: 2025-04-09T19:54:12.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-23T12:15:55.000Z (about 1 year ago)
- Last Synced: 2025-04-23T12:20:26.024Z (about 1 year ago)
- Topics: design-patterns, discord, discord-js, docker, eslint, prettier, template, typescript
- Language: TypeScript
- Homepage:
- Size: 867 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Discord Botstrap

   
**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](https://discord.js.org/) and uses TypeScript for type safety and better development experience. It also includes ESLint and Prettier for code quality and formatting.
## Key Features
- **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](https://jestjs.io/) for reliable code.
- **GitHub Actions**: Automated workflows for linting, testing, and building to ensure code quality and reliability for each PR and commit.
## Requirements
- Node.js >= 18
- pnpm (Package Manager)
- Docker (optional, for containerized execution)
## Installation
1. Clone the repository:
```bash
git clone https://github.com/steph-lion/discord-botstrap.git
cd discord-botstrap
```
2. Install dependencies:
```bash
pnpm install
```
3. Configure environment variables:
Create a `.env` file in the root of the project and add the following variables:
```env
DISCORD_TOKEN=
DISCORD_CLIENT_ID=
DISCORD_GUILD_ID=
```
## Running Locally
1. Build the project:
```bash
pnpm build
```
2. Start the bot:
```bash
pnpm start
```
3. For development, use the command:
```bash
pnpm dev
```
## Running with Docker
1. Build the Docker image:
```bash
docker-compose build
```
2. Start the container:
```bash
docker-compose up
```
3. To stop the container:
```bash
docker-compose down
```
## Linting and Formatting
This project uses **ESLint** and **Prettier** to maintain consistent code style:
- To lint the code with ESLint:
```bash
pnpm lint
```
- To format the code with Prettier:
```bash
pnpm format
```
## Contributing
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
1. Fork the repository.
2. Create a new branch for your feature or bug fix:
```bash
git checkout -b feature/your-feature-name
```
3. Make your changes and commit them:
```bash
git commit -m "Add your message here"
```
4. Push your branch:
```bash
git push origin feature/your-feature-name
```
5. Open a pull request and describe your changes.
## License
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more details.