|
1 | 1 | # **vue-land-bot**
|
2 | 2 |
|
3 |
| -**UPDATE 02/09/2019:** Aimed to be rewritten using [Commando.js](https://discord.js.org/#/docs/commando/master/general/welcome) for easiness of maintainability. |
| 3 | +This is the official bot for the Vue Land Discord server. |
4 | 4 |
|
5 |
| -API Doc: https://discord.js.org |
| 5 | +It's written in JS and built on [Discord.js](https://github.com/discordjs/discord.js/) and [Commando](https://github.com/discordjs/Commando). |
6 | 6 |
|
7 |
| -Based on guide: https://discordjs.guide/ |
| 7 | +## Table of Contents |
8 | 8 |
|
9 |
| -Not implemented: |
10 |
| - |
11 |
| -- [Setting a command as guild-only](https://discordjs.guide/commando/guild-only.html#setting-a-command-as-guild-only) |
12 |
| -- [Cooldowns](https://discordjs.guide/command-handling/adding-features.html#cooldowns) |
13 |
| -- [Command aliases](https://discordjs.guide/command-handling/adding-features.html#command-aliases) |
| 9 | +- [Set up the bot](#setup) |
| 10 | + - [Necessary steps](#necessary-steps) |
| 11 | + - [Install dependencies](#install-dependencies) |
| 12 | + - [Create Discord app and bot](#create-discord-application-and-bot-user) |
| 13 | + - [Create the `.env` file](#create-the-.env-file) |
| 14 | + - [Add Discord token to `.env` file](#add-discord-token-to-.env-file) |
| 15 | + - [Optional steps](#optional-steps) |
| 16 | + - [Configure role and user IDs](#configure-role-and-user-ids) |
| 17 | +- [Run the bot](#running) |
| 18 | +- [FAQ](#faq) |
| 19 | +- [Contributors](#contributors) |
14 | 20 |
|
15 | 21 | # Setup
|
16 | 22 |
|
17 |
| -To make this code work, you'll need to setup your own bot with its own token. |
18 |
| -To do so, follow [this steps](https://discordjs.guide/preparations/setting-up-a-bot-application.html). |
| 23 | +## Necessary steps |
| 24 | + |
| 25 | +### Install dependencies |
19 | 26 |
|
20 |
| -# How to run? |
| 27 | +As always: |
21 | 28 |
|
22 |
| -```sh |
23 |
| -# Install dependencies |
| 29 | +```bash |
24 | 30 | npm install
|
| 31 | +``` |
| 32 | + |
| 33 | +### Create Discord application and bot user |
| 34 | + |
| 35 | +Before you can run vue-land-bot, you'll need to setup a Discord Application and attach a bot user to it. |
| 36 | + |
| 37 | +Once you're done, copy the bot token to your clipboard. |
| 38 | + |
| 39 | +If you're not sure what to do you can [follow this guide](https://discordjs.guide/preparations/setting-up-a-bot-application.html). |
| 40 | + |
| 41 | +### Create the `.env` file |
| 42 | + |
| 43 | +You'll need to copy `.env.example` to `.env`. |
| 44 | + |
| 45 | +On \*nix/bsd you can run this command: |
| 46 | + |
| 47 | +```bash |
| 48 | +cp .env.example .env |
| 49 | +``` |
| 50 | + |
| 51 | +### Add Discord token to `.env` file |
| 52 | + |
| 53 | +Next you need to add the bot token to the `.env` file (as `DISCORD_TOKEN`). |
| 54 | + |
| 55 | +> **IMPORTANT:** You should treate the Discord bot token like a password - keep it safe! Especially if you plan on giving it permissions like `ADMINISTRATOR`! |
| 56 | +
|
| 57 | +[Back to top](#vue-land-bot) |
| 58 | + |
| 59 | +## Optional steps |
25 | 60 |
|
26 |
| -# Start bot |
| 61 | +<!-- |
| 62 | +### Create Github personal access token |
| 63 | +
|
| 64 | +If you want the RFCs command group to work then you'll need to create a [Github personal access token](https://github.com/settings/tokens) and add it to the `.env` file (as `GITHUB_TOKEN`). |
| 65 | +
|
| 66 | +You don't _need_ to give it any scopes. |
| 67 | +
|
| 68 | +> **IMPORTANT:** You should treate the Github personal access token like a password - keep it safe! Especially if you add any scopes! |
| 69 | +--> |
| 70 | + |
| 71 | +### Configure role and user IDs |
| 72 | + |
| 73 | +While not necessary per se, it's recommended to check out `src/constants/development.js` and `src/constants/production.js`. |
| 74 | + |
| 75 | +The relevant file is included based on the `NODE_ENV` environmental variable. |
| 76 | + |
| 77 | +These files contain various [Snowflakes](https://discordapp.com/developers/docs/reference#snowflakes) (basically IDs) for users and roles. |
| 78 | + |
| 79 | +[Back to top](#vue-land-bot) |
| 80 | + |
| 81 | +# Running |
| 82 | + |
| 83 | +To run the bot simply run: |
| 84 | + |
| 85 | +```bash |
27 | 86 | npm run serve
|
28 | 87 | ```
|
29 | 88 |
|
| 89 | +[Back to top](#vue-land-bot) |
| 90 | + |
30 | 91 | # FAQ
|
31 | 92 |
|
32 |
| -### When I run `npm run serve`, I get: `UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided` |
| 93 | +## When I run `npm run serve` I get an error |
| 94 | + |
| 95 | +### "The environmental variable BOT_TOKEN is required but was not present!" |
| 96 | + |
| 97 | +Please read the [necessary steps](#necessary-steps) section of the README. |
| 98 | + |
| 99 | +### Error: Incorrect login details were provided. |
| 100 | + |
| 101 | +Ensure you copy-pasted the token correctly. Perhaps you accidentally added a space, for instance? |
| 102 | + |
| 103 | +[Back to top](#vue-land-bot) |
33 | 104 |
|
34 |
| -Make sure you have a `./src/config.json` file with your token properly filled. |
| 105 | +# Contributors |
35 | 106 |
|
36 |
| -To get a default `config.json`, run `npm run init`. |
| 107 | +- Lead Developer / Maintainer |
| 108 | + - [Elfayer](https://github.com/elfayer/), Hong Kong |
| 109 | +- Contributors |
| 110 | + - [sustained](https://github.com/sustained/), United Kingdom |
| 111 | +- Ideas, Feedback & Testing |
| 112 | + - [gusto](https://github.com/gustojs/), Poland |
| 113 | + - [laquasicinque](https://github.com/laquasicinque) United Kingdom |
37 | 114 |
|
38 |
| -To setup your token, see the [Setup](#Setup) section. |
| 115 | +[Back to top](#vue-land-bot) |
0 commit comments