Skip to content

Commit ac26782

Browse files
committed
Not strictly API-related, but finally add run instructions to the readme
1 parent 03fbbf4 commit ac26782

1 file changed

Lines changed: 38 additions & 4 deletions

File tree

README.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,46 @@ roles, since the bot needs to make several requests to make them work. The bot
134134
is registering the actions. Give it a few seconds to catch up.
135135

136136
## Hosting your own instance
137-
This bot is built on [discord.js](https://discord.js.org/#/), so you'll need
138-
Node.js installed. Discord.js says it requires Node.js version 12.0.0 or higher,
139-
but I've been testing with version 10.19.0 with no issues.
137+
This bot is built on [discord.js](https://discord.js.org/#/) v12, so you'll need
138+
Node.js 12.0.0 (or newer) installed. You will also need your own Discord bot
139+
account.
140140

141141
The `resources` directory has a service file that can be used with Linux distros
142142
with systemd. If you're installing this on some other operating system, you're
143143
on your own.
144144

145-
_I will add more detailed setup instructions later._
145+
### Running as a service
146+
The provided service file expects to find the bot code at
147+
`/srv/discord/ReactionRoleBot/`, and will want to create the sqlite database at
148+
`/srv/discord/rolebot.sqlite`. The easiest way to do this is to create a
149+
`/srv/discord` directory, and `chown` it so it belongs to the user running the
150+
bot.
151+
152+
The following will prepare the bot to run. Run this from `/srv/discord`:
153+
```
154+
git clone https://github.com/Mimickal/ReactionRoleBot.git
155+
cd ReactionRoleBot
156+
npm install
157+
NODE_ENV=prod npm run knex migrate:latest
158+
```
159+
160+
Create a file `/etc/discord/ReactionRoleBot/token` and paste your bot token in,
161+
in plain text.
162+
163+
Install `reactionrolebot.service` into `/etc/systemd/system/`.
164+
165+
Now you should be able to run `systemctl restart reactionrolebot.service` to
166+
start your bot.
167+
168+
### Running locally (in dev-mode)
169+
Run this wherever you want:
170+
```
171+
git clone https://github.com/Mimickal/ReactionRoleBot.git
172+
cd ReactionRoleBot
173+
npm install
174+
npm run knex migrate:latest
175+
```
176+
177+
Create a file containing your bot token in plain text.
178+
179+
Run this to start the bot: `node main.js path/to/your/token`

0 commit comments

Comments
 (0)