@@ -134,12 +134,46 @@ roles, since the bot needs to make several requests to make them work. The bot
134134is 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
141141The ` resources ` directory has a service file that can be used with Linux distros
142142with systemd. If you're installing this on some other operating system, you're
143143on 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