Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

codesupport/old-discord-bot

Repository files navigation

CodeSupport Discord Bot

Dependancies

Production

Development

Setup

  1. Setup a local MySQL database using our table creation syntax
  2. Create a Discord bot via Discord's Developer Portal
  3. Navigate into the repository on your local disc and run npm i
  4. To start the bot type DISCORD_TOKEN=<YOUR_DISCORD_TOKEN> MYSQL_HOST=<YOUR_MYSQL_HOST> MYSQL_USER=<YOUR_MYSQL_USERNAME> MYSQL_PASSWORD=<YOUR_MYSQL_PASSWORD> MYSQL_DATABASE=<YOUR_MYSQL_DATABASE> npm start

Adding Commands

  1. Create a file in the commands directory called <your_command>.js
  2. Copy this template into your file
  3. Customise the properties to meet your liking:
    • command is the command people will run e.g. ?profile (don't include the prefix)
    • description is the command's description, this is displayed in ?commands
    • prefix is a boolean which states whether or not the command requires a prefix to be ran
    • arguments is an array of arguments, this is used to:
      • decide how the command should be ran
      • display the correct usage in ?commands
    • visible is a boolean which states whether or not the command appears in ?commands
    • botchat is a boolean which states whether or not the command can only be executed in the bot chat
  4. Add all your logic into the run() function.

Notes:

  • If your command accepts arguments you will want to use this template instead
  • Use <argument> for required arguments and [argument] for optional arguments

Any Questions? Feel free to mention @LamboCreeper#6510 in the CodeSupport Discord.