Skip to content
/ discord-botstrap Public template

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.

License

Notifications You must be signed in to change notification settings

steph-lion/discord-botstrap

Repository files navigation

Discord Botstrap

Botstrap Logo

Build Status Test Coverage Discord.js Version Node.js Version

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.

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 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:

    git clone https://github.com/steph-lion/discord-botstrap.git
    cd discord-botstrap
  2. Install dependencies:

    pnpm install
  3. 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>

Running Locally

  1. Build the project:

    pnpm build
  2. Start the bot:

    pnpm start
  3. For development, use the command:

    pnpm dev

Running with Docker

  1. Build the Docker image:

    docker-compose build
  2. Start the container:

    docker-compose up
  3. To stop the container:

    docker-compose down

Linting and Formatting

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

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:
    git checkout -b feature/your-feature-name
  3. Make your changes and commit them:
    git commit -m "Add your message here"
  4. Push your branch:
    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 file for more details.

About

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.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •