Discord bot created to serve the KnightHacks discord. Feel free to join us Here!
- Clone this repository on your environment.
- Install the latest nodejs and npm:
- https://nodejs.org/en/
- Instructions for Mac: https://treehouse.github.io/installation-guides/mac/node-mac.html
- Instructions for Windows: https://www.guru99.com/download-install-node-js.html
- Instructions for Linux: https://blog.teamtreehouse.com/install-node-js-npm-linux
- Visit the project's main directory and run
npm install
- Create a
constants/token.json
file and format and insert your discord bot token properly. (Refer to token.json section) - Run
npm start
to start the discord bot.
The proper formatting for the token.json
file is this:
{
"token": "INSERT-TOKEN-HERE"
}
Place the token.json in the constants/
directory.
- Run your code through ESLint first. (Refer to ESLint section)
- Read over your comments and variable names and check for speelign erorrs.
- Check for compilation errors.
- Make sure your code is consistent with the rest of the project and with other commands (i.e. diceRoll.js, not diceroll.js).
What is ESLint?
ESLint is a way to create a uniform code base throughout the project. It is beneficial because it allows multiple people to create and work on the project and stick to one coding style.
- Click on
File
>Preferences
>Extensions
and installESLint
by Dirk Baeumer. - Once you restart VSCode, and go back to the project, it will highlight if there is inconsistent coding style.
- To test, you can copy paste this code. If it highlights red, then it is working.
console.log ( "hi" )
-
Go to the project's home directory, and run
node_modules/.bin/eslint <file>
. -
This will guide you to fixing your mistakes.
-
If you are having trouble decoding your coding inconsistency check out:
Please check at
.eslintrc.js
for more rules that are not standardized by the standards above.
- If the bot is not starting, try deleting your node_modules folder and your package-lock.json file (both located in the project's main directory), and running npm install again.
- Feel free to reach out to Lancelot devs on Discord for questions and troubleshooting.
- Let us know if there's anything that needs to be added to this section!