Skip to content

Commit 7f15cda

Browse files
eslachancegitbook-bot
authored andcommitted
GitBook: [master] 2 pages modified
1 parent 072b70a commit 7f15cda

File tree

2 files changed

+49
-41
lines changed

2 files changed

+49
-41
lines changed

other-guides/heroku.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ In your package.json, add the following section \(changing node to the right ver
3232

3333
```javascript
3434
"engines": {
35-
"node": "8.x",
35+
"node": "10.x",
3636
"npm": "*"
3737
},
3838
```
@@ -52,10 +52,11 @@ Save the file, you're done with it for the moment.
5252
5353
Next, you need a thing called a `Procfile`. This tells Heroku exactly how to run your project, specifically it says that it should _not_ expect an HTTP server to be started. If this isn't done, Heroku will stop your project after a couple minutes because it failed to bind an http server to the appropriate port.
5454

55-
Create a new file called `Procfile` in your project \(no extension, with the uppercase P\), and add in the following contents:
55+
Create a new file called `Procfile` in your project \(no extension, with the uppercase P\), and add in the following contents, which disables the need for a web server and lets your bot run:
5656

5757
```text
58-
worker: npm start
58+
web: echo "I don't want a web process"
59+
service: npm start
5960
```
6061

6162
## Creating the main bot file
@@ -114,35 +115,39 @@ To install the CLI just go right ahead and run `npm i -g heroku`. It'll take a f
114115

115116
Next, you need to login. From your prompt, go ahead and run `heroku login`. This will ask you to enter your email, and password, for Heroku.
116117

117-
Then finally, you need to create an _application_ on Heroku, if you haven't already done that on the website. So in my case, I just went `heroku create eviebot` and that took care of that! Oh make sure you run this _in your project folder_.
118+
Then finally, you need to create an _application_ on Heroku. Go to your Dashboard, into [Create New App](https://dashboard.heroku.com/new-app). Enter a unique app name, like `my-super-original-bot` \(hereafter referred as <appname>\), in your closest region.
118119

119-
Woop woop! Almost there! One last thing before put in the last puzzle pieces, which is to configure the same Environment Variables that we have in our `.env` file. Go right ahead and visit your dashboard, which would be the following URL: `https://dashboard.heroku.com/apps/<appname>/settings` \(replace `<appname>` with the one you just created, of course\). It should look like this:
120+
One last thing before put in the last puzzle pieces, which is to configure the same Environment Variables that we have in our `.env` file. In the app's dashboard, go to the Settings tab, then click Reveal Config Vars. Add the 2 configuration variables. It should look like this:
120121

121122
![Heroku Config Vars](https://img.evie.codes/QNSpgc4)
122123

124+
Let's pre-emptively open up the logs so we can see what's going on on the server:
125+
126+
In your app's dashboard, click the "More" button at the top-right:
127+
128+
![Heroku Logs](https://img.evie.codes/hosTRYK)
129+
130+
It'll be empty for now, don't worry, let's keep going!
131+
123132
## Pushing the app
124133

125134
So we're on the last mile now! Everything you've done until now has prepared us for this moment.
126135

127136
* `git init` make our project git-enabled.
128-
* `heroku create <appname>` generated a link to your heroku project.
129137
* `npm init -y` and the package.json file modifications prepared our project for the Heroku universe.
130138

131139
So let's finalize everything by saving our changes to `git` and pushing them to Heroku:
132140

133141
* Add all the files to git with `git add .` \(don't forget the dot!\)
134142
* Prepare for pushing using commit: `git commit -m "Initial bot commit for Heroku"`
135143
* Push the entire thing to Heroku: `git push heroku master`
144+
* You'll see quite a lot of output logs which should end with something like "Verifying deploy... done."
136145

137146
OMG. That's... it. can you believe it? Your bot's now on Heroku and should really be running already!
138147

139-
To verify, look at the logs, from the top-right "More" button:
140-
141-
![Heroku Logs](https://img.evie.codes/hosTRYK)
142-
143-
It should look like this:
148+
Take a look at the logs on the dashboard, It should look like this \(Note: You'll have a few lines about processes crashing with Error Code 0, those are normal\):
144149

145150
![Heroku Success!](https://img.evie.codes/1Y6bJxZ)
146151

147-
So... here's to hoping for the best!
152+
And we're done! This should be enough to get you going, remember Heroku can't do a whole lot of processing, and you can't save files \(no file database, edited json, etc\).
148153

understanding/roles.md

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -125,32 +125,35 @@ Now get to coding!
125125

126126
This is the list of internal permission names, used for `.has(name)` in the above examples:
127127

128-
* `ADMINISTRATOR` (implicitly has *all* permissions, and bypasses all channel overwrites)
129-
* `CREATE_INSTANT_INVITE` (create invites for the guild)
130-
* `KICK_MEMBERS`
131-
* `BAN_MEMBERS`
132-
* `MANAGE_CHANNELS` (edit and reorder channels)
133-
* `MANAGE_GUILD` (edit the guild information, region, etc.)
134-
* `ADD_REACTIONS` (add new reactions to messages)
135-
* `VIEW_AUDIT_LOG`
136-
* `PRIORITY_SPEAKER`
137-
* `VIEW_CHANNEL`
138-
* `SEND_MESSAGES`
139-
* `SEND_TTS_MESSAGES`
140-
* `MANAGE_MESSAGES` (delete messages and reactions)
141-
* `EMBED_LINKS` (links posted will have a preview embedded)
142-
* `ATTACH_FILES`
143-
* `READ_MESSAGE_HISTORY` (view messages that were posted prior to oping Discord)
144-
* `MENTION_EVERYONE`
145-
* `USE_EXTERNAL_EMOJIS` (use emojis from different guilds)
146-
* `CONNECT` (connect to a voice channel)
147-
* `SPEAK` (speak in a voice channel)
148-
* `MUTE_MEMBERS` (mute members across all voice channels)
149-
* `DEAFEN_MEMBERS` (deafen members across all voice channels)
150-
* `MOVE_MEMBERS` (move members between voice channels)
151-
* `USE_VAD` (use voice activity detection)
152-
* `CHANGE_NICKNAME`
153-
* `MANAGE_NICKNAMES` (change other members' nicknames)
154-
* `MANAGE_ROLES`
155-
* `MANAGE_WEBHOOKS`
156-
* `MANAGE_EMOJIS`
128+
```javascript
129+
{
130+
CREATE_INSTANT_INVITE: true,
131+
KICK_MEMBERS: true,
132+
BAN_MEMBERS: true,
133+
ADMINISTRATOR: true,
134+
MANAGE_CHANNELS: true,
135+
MANAGE_GUILD: true,
136+
ADD_REACTIONS: true,
137+
READ_MESSAGES: true,
138+
SEND_MESSAGES: true,
139+
SEND_TTS_MESSAGES: true,
140+
MANAGE_MESSAGES: true,
141+
EMBED_LINKS: true,
142+
ATTACH_FILES: true,
143+
READ_MESSAGE_HISTORY: true,
144+
MENTION_EVERYONE: true,
145+
EXTERNAL_EMOJIS: true,
146+
CONNECT: true,
147+
SPEAK: true,
148+
MUTE_MEMBERS: true,
149+
DEAFEN_MEMBERS: true,
150+
MOVE_MEMBERS: true,
151+
USE_VAD: true,
152+
CHANGE_NICKNAME: true,
153+
MANAGE_NICKNAMES: true,
154+
MANAGE_ROLES_OR_PERMISSIONS: true,
155+
MANAGE_WEBHOOKS: true,
156+
MANAGE_EMOJIS: true
157+
}
158+
```
159+

0 commit comments

Comments
 (0)