A community bot built on top of Discord.js.
How To Use • Credits • Style Guide • License
To clone and run this application, you'll need Git and Node.js (which comes with npm) installed on your computer. From your command line:
# Clone this repository
$ git clone https://github.com/hgvmp/discord-bot
# Go into the repository
$ cd discord-bot
# Install dependencies
$ npm install
# Run the app
$ npm start
Note: If you're using Linux Bash for Windows, see this guide or use node
from the command prompt.
This software uses code from several open source packages.
- Node.js
- Discord.js
- cleverbot-node
- bugsnag
- dateformat
- dotenv
- moment
- request
- superagent
- time-ago
- ffmpeg-binaries
- node-opus
- opusscript
- profanities
The HGVMP developers follow the AirBnB style guide for every project they create, including the Discord bot. Style guides provide three benefits that make development more efficient:
- Code that's easier to read
- Clear guidelines when writing code
- Predictable file and variable names
Consistent style choices greatly benefit readability. For example, they mean that indentation reliably communicates the structure of your code.
Variable naming conventions allow you to immediately see that LoginDialog
is a class, loginDialog
is a class instance and LOGIN_DIALOG
is a constant.
Credits to codereadability and their amazing read on why style guides are handy.
# Install ESLint
$ npm install eslint --save-dev
# Install AirBnB
$ npm install eslint-config-airbnb --save-dev
# Install a peerdeps
$ npm install -g install-peerdeps
# Install peer dependencies
$ install-peerdeps eslint-config-airbnb --dev
{
"extends": [
"airbnb"
],
"rules": {
"linebreak-style": "off"
}
}
{
"editor.tabSize": 2,
"editor.detectIndentation": true,
"[javascript]": {
"editor.tabSize": 2
},
"[json]": {
"editor.tabSize": 2
},
"[php]": {
"editor.tabSize": 4
},
"emmet.triggerExpansionOnTab": true,
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 100,
"editor.rulers": [
100
],
"eslint.enable": true,
"eslint.autoFixOnSave": true
}
MIT