Skip to content

Commit 565b269

Browse files
authored
Merge pull request #8 from sustained/commando-rewrite
Commando rewrite
2 parents 797a2d7 + 9a40e74 commit 565b269

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2228
-759
lines changed

.env.example

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
BOT_TOKEN=
2+
CLIENT_ID=
3+
OWNERS_IDS=
4+
COMMAND_PREFIX=!

.eslintrc.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true,
5+
es6: true,
6+
},
7+
extends: ['prettier', 'plugin:vue/essential', '@vue/prettier'],
8+
rules: {
9+
'prettier/prettier': 'error',
10+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
11+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
12+
'func-call-spacing': 'error',
13+
'curly': 'error'
14+
},
15+
parserOptions: {
16+
parser: 'babel-eslint',
17+
},
18+
}

.prettierrc.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
semi: false,
3+
tabs: false,
4+
tabWidth: 2,
5+
singleQuote: true,
6+
trailingComma: 'es5',
7+
bracketSpacing: true,
8+
}

README.md

+95-18
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,115 @@
11
# **vue-land-bot**
22

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.
44

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).
66

7-
Based on guide: https://discordjs.guide/
7+
## Table of Contents
88

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)
1420

1521
# Setup
1622

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
1926

20-
# How to run?
27+
As always:
2128

22-
```sh
23-
# Install dependencies
29+
```bash
2430
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
2560

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
2786
npm run serve
2887
```
2988

89+
[Back to top](#vue-land-bot)
90+
3091
# FAQ
3192

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)
33104

34-
Make sure you have a `./src/config.json` file with your token properly filled.
105+
# Contributors
35106

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
37114

38-
To setup your token, see the [Setup](#Setup) section.
115+
[Back to top](#vue-land-bot)
File renamed without changes.

data/documentation.js

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
export default [
2+
{
3+
name: 'vue',
4+
aliases: ['home', 'vuejs'],
5+
value: 'https://vuejs.org/',
6+
},
7+
{
8+
name: 'get-started',
9+
aliases: ['start', 'intro', 'introduction'],
10+
value: 'https://vuejs.org/v2/guide/',
11+
},
12+
{
13+
name: 'installation',
14+
value: 'https://vuejs.org/v2/guide/installation.html',
15+
},
16+
{
17+
name: 'class',
18+
aliases: ['classes'],
19+
value:
20+
'https://vuejs.org/v2/guide/class-and-style.html#Binding-HTML-Classes',
21+
},
22+
{
23+
name: 'style',
24+
aliases: ['styles'],
25+
value:
26+
'https://vuejs.org/v2/guide/class-and-style.html#Binding-Inline-Styles',
27+
},
28+
{
29+
name: 'component',
30+
aliases: ['components'],
31+
value: 'https://vuejs.org/v2/guide/components.html',
32+
},
33+
{
34+
name: 'slot',
35+
aliases: ['slots'],
36+
value: 'https://vuejs.org/v2/guide/components-slots.html',
37+
},
38+
{
39+
name: 'prop',
40+
aliases: ['props'],
41+
value: 'https://vuejs.org/v2/guide/components-props.html',
42+
},
43+
{
44+
name: 'event',
45+
aliases: ['events'],
46+
value: 'https://vuejs.org/v2/guide/components-custom-events.html',
47+
},
48+
{
49+
name: 'registration',
50+
value: 'https://vuejs.org/v2/guide/components-registration.html',
51+
},
52+
{
53+
name: 'transition',
54+
aliases: ['transitions'],
55+
value: 'https://vuejs.org/v2/guide/transitions.html',
56+
},
57+
{
58+
name: 'mixin',
59+
aliases: ['mixins'],
60+
value: 'https://vuejs.org/v2/guide/mixins.html',
61+
},
62+
{
63+
name: 'directive',
64+
aliases: ['directives', 'custom-directive', 'custom-directives'],
65+
value: 'https://vuejs.org/v2/guide/custom-directive.html',
66+
},
67+
{
68+
name: 'render',
69+
aliases: ['render-function', 'render-functions'],
70+
value: 'https://vuejs.org/v2/guide/render-function.html',
71+
},
72+
{
73+
name: 'lifecycle',
74+
aliases: ['cycle', 'lifecycles', 'lifecycle-hooks'],
75+
value: 'https://vuejs.org/v2/api/#Options-Lifecycle-Hooks',
76+
},
77+
{
78+
name: 'lifecycle-diagram',
79+
aliases: ['cycle-diag', 'cycle-diagram', 'life-cycle-diagram'],
80+
value: 'https://vuejs.org/v2/guide/instance.html#Lifecycle-Diagram',
81+
},
82+
{
83+
name: 'cookbook',
84+
aliases: ['cook'],
85+
value: 'https://vuejs.org/v2/cookbook/',
86+
},
87+
{
88+
name: 'style-guide',
89+
aliases: ['guide'],
90+
value: 'https://vuejs.org/v2/style-guide/',
91+
},
92+
{
93+
name: 'example',
94+
aliases: ['examples'],
95+
value: 'https://vuejs.org/v2/examples/',
96+
},
97+
{
98+
name: 'prop-event',
99+
aliases: ['props-events'],
100+
value: 'https://vuejs.org/images/props-events.png',
101+
},
102+
]

0 commit comments

Comments
 (0)