Package Exports
- discord-bot-nestjs-cli
- discord-bot-nestjs-cli/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (discord-bot-nestjs-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Discord Bot With NestJS CLI
Overview
The Discord Bot With NestJS CLI is a command-line tool designed to simplify the process of creating Discord bots using the NestJS framework. With a user-friendly interface and minimal configuration, this CLI streamlines the setup of a robust and scalable bot project.
Features
- Automated project setup using NestJS CLI.
- Custom module and service for Discord.js integration.
- Supports popular package managers: npm, yarn, and pnpm.
- Includes environment variable setup for secure bot token management.
- Keeps terminal output clean and focused with spinner feedback.
Prerequisites
Before using this CLI, ensure the following:
- Node.js installed (version 16+ recommended).
- A valid Discord bot token. Learn how to create a bot.
Installation
First, install the CLI globally using npm:
npm install -g discord-bot-nestjs-cli
Usage
Commands
init
: Create a new Discord bot project.version
: Display the CLI version.help
: Show available commands and their usage.
Initialize a Project
Run the following command to create a new project:
discord-bot-nestjs-cli init
The CLI will prompt you for:
- Project Name: Name of the folder where the project will be created.
- Package Manager: Choose between npm, yarn, or pnpm.
Example Workflow
Run the
init
command:discord-bot-nestjs-cli init
Follow the prompts to configure the project.
Navigate to the project folder:
cd <project-name>
Start the development server:
npm run start:dev
or
yarn start:dev
Project Structure
The CLI sets up a project with the following structure:
<project-name>/
├── src/
│ ├── discord/
│ │ ├── discord.module.ts
│ │ ├── discord.service.ts
├── package.json
├── .env
src/discord
: Contains the module and service for Discord bot functionality..env
: Holds theDISCORD_ENV
variable for your bot token.
Environment Variables
The .env
file includes:
DISCORD_ENV=your_discord_bot_token_here
Replace your_discord_bot_token_here
with your actual Discord bot token.
Contribution
Contributions are welcome! Feel free to fork the repository, make improvements, and submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Created by Mquiuqui to simplify Discord bot development with NestJS.