Skip to content

JAZSI/Discord-v14-template

Repository files navigation

Discord Bot Template

Prerequisites

Before you can run this bot, you will need the following:

  • A Discord account and server: If you don't already have a Discord account, you can create one for free at https://discord.com. To use the bot on your server, you will need to have owner or admin permissions.

  • Node.js and npm: Node.js is a JavaScript runtime that allows you to run JavaScript on your computer. npm (short for Node Package Manager) is a tool that comes with Node.js and allows you to install and manage packages (libraries and tools) that you can use in your projects. You can download and install Node.js and npm from https://nodejs.org/.

  • Git: Git is a version control system that allows you to track changes to your code and collaborate with others. You can download and install Git from https://git-scm.com/.

  • A text editor: A text editor is a program that allows you to write and edit code. Some popular text editors include Visual Studio Code , Sublime Text, and Atom. You can choose any text editor that you prefer.

  • A Discord bot token: A bot token is a unique code that identifies your bot and allows it to connect to the Discord API. You can get a bot token by creating a new bot at https://discord.com/developers/applications. Click on the "New Application" button and follow the prompts to create a new bot. Once you have created the bot, click on the "Copy" button next to the "Token" field to copy the token to your clipboard. Keep this token safe and do not share it with anyone.

Installing

To install the dependencies for this project, navigate to the project directory in your terminal and run the following command:

npm install

This will install all the necessary dependencies for the project.

Running the Bot

To run the bot, you'll need to provide your Discord bot token as environment variables. You can do this by creating a file named .env in the project directory and adding the following line:

DISCORD_TOKEN="YOUR_DISCORD_BOT_TOKEN"

Replace YOUR_DISCORD_BOT_TOKEN with the actual bot token that you copied from the Discord developer portal

Once you've set the environment variables, you can start the bot by running the following command in the terminal:

node index.js

This will start the bot and make it available to use in your Discord server.

Optional Configuration

The config.json file contains several options that can be customized to suit your needs. The following is a description of each option and its purpose:

  • prefix: The prefix that will be used to trigger the bot's prefix commands. This can be changed to any string value you prefer.
  • ownerID: The Discord user ID of the bot owner.
  • color: The color code (in hexadecimal format) that will be used for embeds generated by the bot.
  • inviteURL: The URL for the Discord bot's invite link.
  • sourceURL: The URL to the source code repository for the bot.
  • supportURL: The URL to the support server for the bot.
  • websiteURL: The URL to the website for the bot.
  • debug: A boolean value that determines whether debug mode is enabled.
  • shard: A boolean value that determines whether sharding is enabled.
  • category: An object that defines the categories used for organizing the bot's commands.
  • ignoredCategories: An array of categories that should be ignored when showing the help command. Note: You may edit these fields in the config.json file as needed before starting the bot.

Credits

This project was created by Jaszi.

License

This project is licensed under the MIT License.