- Setup a local MySQL database using our table creation syntax
- Create a Discord bot via Discord's Developer Portal
- Navigate into the repository on your local disc and run
npm i - 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
- Create a file in the
commandsdirectory called<your_command>.js - Copy this template into your file
- Customise the properties to meet your liking:
commandis the command people will run e.g.?profile(don't include the prefix)descriptionis the command's description, this is displayed in?commandsprefixis a boolean which states whether or not the command requires a prefix to be ranargumentsis an array of arguments, this is used to:- decide how the command should be ran
- display the correct usage in
?commands
visibleis a boolean which states whether or not the command appears in?commandsbotchatis a boolean which states whether or not the command can only be executed in the bot chat
- 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.