Skip to content

Commit 1c30d64

Browse files
authored
Merge pull request #70 from Mimickal/ts-port
2 parents 129fdc4 + 5af279a commit 1c30d64

23 files changed

Lines changed: 2179 additions & 4574 deletions

.replit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
language = "nodejs"
2-
run = "node ."
2+
run = "npm run start"

Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
worker: node .
1+
worker: npm run start

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ src="https://www.gnu.org/graphics/agplv3-155x51.png">
77
A Discord bot that can assign roles based on message reactions.<br/>
88
[You can invite my live instance of the bot to your server with this link](
99
https://discord.com/oauth2/authorize?client_id=692585944934514738&scope=applications.commands%20bot&permissions=335881280
10-
).
10+
).<br/>
11+
[Join the support server here](https://discord.gg/7UBT8SK).
1112

1213
# Why this bot?
1314
Several other popular role-react bots exist, but many of them have some annoying
@@ -41,7 +42,7 @@ the channel with your role-react post, and have have following permissions:
4142
* **Manage roles** - To assign roles to users
4243
* **Read Message History** - To see posts in the channel before it joined
4344
* **Use External Emojis** - To use your custom emojis in role reacts
44-
* **Read Text Channels & See Voice Channels** - To see the role-react post
45+
* **View Channels** - To see the role-react post
4546

4647
**Note:** These permissions may be inherited from your `@everyone` settings.
4748

@@ -134,9 +135,12 @@ won't do anything, but you *could* do it...
134135
## Hosting your own instance
135136
[See the guide here](docs/hosting.md).
136137

137-
If you are upgrading from version 1.x, [see the migration guide](
138+
If you are upgrading from version 1.x to 2.x, [follow this migration guide](
138139
docs/migrate.md).
139140

141+
If you are upgrading from version 2.x to 3.x, [follow this migration guide](
142+
docs/migrate3.md).
143+
140144
## License
141145
Copyright 2020 [Mimickal](https://github.com/Mimickal)
142146

docs/hosting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ bot's database. Run this from `/srv/discord`:
6767
git clone https://github.com/Mimickal/ReactionRoleBot.git
6868
cd ReactionRoleBot
6969
npm ci
70-
npm run register /etc/discord/ReactionRoleBot/config.json
70+
npm run register -- --config /etc/discord/ReactionRoleBot/config.json src/commands.ts
7171
NODE_ENV=prod npm run knex migrate:latest
7272
```
7373

@@ -86,7 +86,7 @@ start your bot.
8686

8787
- **database_file** - Use a different SQLite3 database file. This defaults to `/srv/discord/rolebot.sqlite3`. Users on non-Linux systems will probably want to change this.
8888
- **enable_precache** - Makes the bot pre-cache all messages with reaction roles on startup. This can help the bot be more consistent when it first starts, but will cause larger bots to be rate limited. Use with caution!
89-
- **guild_id** - Limits slash command registration to this Guild. This is useful for bot development.
89+
- **guild** - Limits slash command registration to this Guild. This is useful for bot development.
9090
- **log_file** - Use a different log file. This defaults to `output.log` in the project root.
9191

9292
You can also run the bot with a config file other than `config.json`, but you must provide an absolute file path!

docs/migrate3.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Migrating your instance to 3.x
2+
3+
This guide is for people who were running their own 2.x instance of the bot.
4+
5+
This bot now runs Discord.js v14, which requires Node.js 16.11.0 or later.
6+
Something like [`nvm`](https://github.com/nvm-sh/nvm) can make the transition
7+
easier.
8+
9+
This bot is also now written in TypeScript and runs natively using `ts-node`.
10+
We do not transpile down to JavaScript! For hosting the bot, the only thing this
11+
should affect is the install size (2.0 was ~64 MB, 3.0 is ~114 MB).
12+
13+
1. Get the updated bot code. Either:
14+
- `git pull origin master` if you cloned with git (which you should).
15+
- Download the `master` branch from GitHub as a zip file, and extract it.
16+
1. In your `config.json`:
17+
- Rename `app_id` to `app`.
18+
- Rename `guild_id` to `guild` (if you have it).
19+
1. Install updated dependencies: `npm ci`.
20+
1. You may need / want to update your `reactionrolebot.service` definition.
21+
- Added instructions on how to run as a user service.
22+
- Changed `WantedBy` to be `default.target` instead of `multi-user.target`.
23+
- Removed `User` field in favor of running as a user service.
24+
1. Restart the bot.
25+
- **Running as a service**: `systemctl restart reactionrolebot.service`
26+
- **Running in dev-mode**: `npm start path/to/your/config.json`

0 commit comments

Comments
 (0)