Files
Reactor/README.md
2026-03-29 04:34:40 +01:00

102 lines
2.8 KiB
Markdown

# Reactor
Reactor is a Valour.gg bot that enables server administrators to create reaction role messages. Users can react to a message with an emoji to automatically be assigned or removed from a role.
---
## Features
- Create reaction role messages in any planet channel
- Map emojis to roles — reacting adds the role, removing the reaction removes it
- Automatic cleanup of deleted reaction messages from the database
- Persistent storage via SQLite — survives bot restarts
- Permission-based command access (Manage Roles or Full Control required)
- Built with .NET and the Valour SDK
- Open-source under AGPL-3.0
---
## How It Works
Reactor connects to the Valour.gg API and listens for reactions on configured messages.
- Reaction role messages and their emoji-to-role mappings are stored in a local SQLite database
- When a user reacts to a tracked message, Reactor assigns the mapped role
- When a user removes their reaction, Reactor removes the mapped role
- Stale messages (deleted from Valour) are automatically pruned from the database on startup
---
## Requirements
- .NET 10+
- Valid Valour bot token
---
## Installation
```bash
git clone https://git.skyjoshua.xyz/SkyJoshua/Reactor.git
cd Reactor
dotnet restore
```
All required NuGet packages are installed automatically via the `.csproj` file.
---
## Configuration
Create a `.env` file in the root directory:
```
TOKEN=your-valour-bot-token
```
Do not commit this file to version control.
---
## Running the Bot
```bash
dotnet run
```
---
## Commands
All commands require **Manage Roles** or **Full Control** permissions, except `r.help` and `r.source`.
| Command | Description |
|---|---|
| `r.help` | Shows the list of available commands |
| `r.source` | Shows the source code of the bot |
| `r.create <message text>` | Creates a new reaction role message in the current channel |
| `r.add <messageId> <emoji> <roleId>` | Maps an emoji to a role on a reaction message |
| `r.remove <messageId> <emoji>` | Removes an emoji-to-role mapping from a reaction message |
| `r.delete <messageId>` | Deletes a reaction message and all its role mappings |
---
## Data Storage
Reactor stores the following data in a local SQLite database (`reactor.db`):
- Reaction message IDs, channel IDs, and planet IDs
- Emoji-to-role mappings per reaction message
- Configurable delete delay for confirmation messages (default: 5 seconds)
Full privacy policy:
https://git.skyjoshua.xyz/SkyJoshua/Reactor/blob/main/PRIVACY.md
---
## License
This project is licensed under the **GNU Affero General Public License v3.0 (AGPL-3.0)**.
See the LICENSE file for details:
https://git.skyjoshua.xyz/SkyJoshua/Reactor/blob/main/LICENSE
If you modify and deploy this project publicly (including as a hosted service), you must make your source code available under the same AGPL-3.0 license.