- 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
commands
directory called<your_command>.js
- Copy this template into your file
- 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 ranarguments
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
- 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.