Skip to content

ReactionRole

Domekologe edited this page Jun 30, 2026 · 1 revision

ReactionRole

🌐 English · Deutsch

ReactionRole is a simple, ID-based reaction-role system. You bind an emoji on an existing message to a role; when a member adds that reaction they get the role, and removing it takes the role away. Every binding gets a short generated ID so you can list and remove them precisely, a manual sync command back-fills roles for people who already reacted, and the PDC Web Dashboard adds a full panel-based editor that can post and manage multi-mapping reaction panels for you. Author: pd-codes · version 1.0.0 · requires Red 3.5.0+.

Screenshot: a reaction-role message in Discord

Installation

[p]repo add PDC_Redbot_Cogs https://github.com/pd-codes/PDC_Redbot_Cogs
[p]cog install PDC_Redbot_Cogs ReactionRole
[p]load ReactionRole
[p]slash sync

[p] is your bot's prefix. The commands are hybrid commands (work as both prefix and slash), so run [p]slash sync once after loading to register the slash variants. See Installation for the full Downloader walkthrough.

Commands

All commands are guild-only. The set/remove/sync commands require the Manage Roles permission.

Command Parameters What it does
reactionrole-set message_id emoji role Adds the emoji reaction to the message in the current channel and binds it to the role. Replies with the new binding ID.
reactionrole-remove rr_id Removes the binding with the given ID from the config.
reactionrole-get Lists every binding: ID, emoji, role and message ID.
reactionrole-sync Re-scans every bound message and grants the role to everyone who already reacted but is missing it. Reports how many roles were added.

Note on the command group: the cog defines flat hybrid commands (reactionrole-set, reactionrole-remove, reactionrole-get, reactionrole-sync). There is no RR command group in the current source, so [p]help RR will not resolve — use [p]help ReactionRole to list the cog's commands instead.

How IDs are generated

Each binding gets an 8-character ID — the first 8 characters of a random uuid4() (e.g. a1b2c3d4). IDs are generated for chat-created bindings, dashboard-created bindings and each emoji→role mapping within a dashboard panel. Use the ID with reactionrole-remove or in the dashboard list to manage a specific binding.

Configuration

ReactionRole stores everything per guild (Red Config, identifier 983472983472):

Key Contents
language Per-guild language of this module (de-DE or en-US).
reactionroles Map of rr_id → {message_id, channel_id, emoji, role_id, panel_id?} — one entry per emoji→role binding.
panels Map of panel_id → {channel_id, message_id, content} — dashboard-posted reaction panels.
templates The success messages, with two keys: set_success and remove_success.

Message templates

The reply text for create/remove is customizable. Available variables:

Variable Meaning Used in
{id} The binding ID both
{emoji} The emoji set_success
{role} The role mention set_success
{message_id} The message ID set_success
{channel} The channel mention set_success

Defaults: set_success✅ ReactionRole erstellt | ID: \{id}` | Emoji: {emoji} | Rolle: {role}, remove_success🗑️ ReactionRole `{id}` entfernt.`

Dashboard integration

ReactionRole registers with the PDC Web Dashboard on load and re-attaches if the dashboard cog appears later. It exposes a widget, two panels, a managed list and a standalone page:

Surface Mount Permission Purpose
Widget "ReactionRoles" Dashboard home (KPI, small) guild_member Counts the configured bindings.
Panel "ReactionRole-Nachrichten" guild_settings guild_admin Module language + the two success-message templates.
Panel "ReactionRole anlegen" guild_settings guild_admin Create a binding directly: channel, message ID, emoji, role — saving adds the reaction and stores the binding.
List "Bestehende ReactionRoles" guild_settings guild_admin Table of all bindings (channel, message ID, emoji, role) with edit (change role) and delete (also clears the reaction).
Standalone page reactionrole own page (GET/POST) manage_roles / manage_guild / bot owner Full panel editor: write a Markdown message, add multiple emoji→role mappings, and create / update / delete a posted reaction panel.

Screenshot: ReactionRole dashboard panel editor

The standalone page is the most powerful surface: it posts the panel message itself, adds every reaction, and tracks the whole panel under a single panel_id so it can be edited or removed as a unit. Legacy single bindings are folded into pseudo-panels so they remain visible there.

Permissions & notes

The bot needs Manage Roles (and its role must sit above the roles it assigns), plus Add Reactions and Read Message History to attach and sync reactions — exactly the permissions declared in info.json. Chat commands require the invoking user to have Manage Roles; dashboard surfaces require guild_admin (the standalone page also accepts manage_roles / manage_guild / bot owner). Only guild settings are stored — bindings, panels, templates and the language flag — no personal data.

See also: Installation · Dashboard Integration · Home

Clone this wiki locally