Skip to content

Send to plugin and giving roles ​

Two powers that act on one thing a person chose: a message a member sends you, and a role an admin let you give. Both need manifest version 2.

Send to plugin ​

json
{ "manifest_version": 2, "message_actions": [{ "name": "Translate", "description": "Into English" }] }

Every message on a server with your plugin gets Send to plugin → <your plugin> · Translate on its menu — right-click on a computer, long-press on a phone. When a member picks it, Dissent shows them the message and asks; only when they press Send does your plugin get that one message:

json
{
  "action": "Translate",
  "message": {
    "id": "…", "channel_id": "…", "content": "bonjour", "created_at": "2026-11-11T08:00:00Z",
    "author": { "id": "…", "name": "alice" }, "attachments": [{ "name": "menu.pdf" }], "encrypted": false
  },
  "channel_id": "…",
  "user": { "id": "…", "name": "bob" },
  "viewer": false
}
  • content comes from the node, as the message is stored — the app can't change it.
  • In an encrypted channel the node can't read the message. The member's app unlocks it and Dissent warns them first: "This message is encrypted. Sending it lets <your plugin> — and its maker's server — read it." Then encrypted is true and the text is what their app unlocked.
  • Only attachment names, never links to the files.
  • user is the member who sent it to you (null if they chose "View without joining").
  • It counts against the same per-member limit as commands (10 a minute by default).

Up to 5 actions, names up to 32 characters. A plugin can never read a channel — this, commands, buttons and events are the only ways a message reaches it.

With a server half ​

js
import { messageAction, output } from "./server-sdk.js";

const m = messageAction();          // null when this run is something else
if (m) output(`“${m.message.content}” → ${translate(m.message.content)}`); // only they see it
// or output({ content, visibility: "public" }) to post as your plugin (needs bot:post)

Without one ​

Dissent opens your panel and hands it the message:

js
Dissent.onMessageAction('Translate', (m) => translate(m.message.content));
// '*' receives every action. Return text (private) or { content, visibility: 'public' }.

Giving roles ​

json
{ "manifest_version": 2, "permissions": ["roles:assign"] }

Your server half can give and take roles — only the ones a server admin ticks for your plugin (plugin page → Permissions → Roles it may give and take). Dissent refuses:

  • any role that carries a power — a permission of its own, or a channel override that lets it do more than see, read, talk, attach and join voice (checked when ticked and on every change: if an admin later adds a power to a ticked role, your changes to it stop);
  • a role at or above the highest role of the admin who ticked it;
  • someone who isn't a member of the server;
  • more than 100 changes a day per install (the node or server admin may set a lower limit);
  • changes from a timer run — only a run a member, an event or a webhook started may change roles.
js
import { roles, interaction, caller, output } from "./server-sdk.js";

const verified = roles.list().find((r) => r.name === "Verified"); // [{ id, name, color }]
const ix = interaction();
if (ix?.component_id === "verify" && verified) {
  roles.give(caller().user_id, verified.id, "pressed Verify"); // throws with the reason if refused
  output("You're verified ✓");
}

give / take queue the change; the node checks it again and applies it right after your run. Each change is in the server's audit log as your plugin (with the admin who ticked the roles) and on the plugin's Permissions tab, where an admin can Undo any of them.

roles:assign is server half only — it can't be optional, and nothing in your panel can call it. An update that adds it waits for the admin, like any new permission.