discord_set_member_role
Add or remove a Discord server role from a member by user ID and role ID, optionally recording a reason in the audit log.
Instructions
Give a role to a member, or take it away.
Needs Manage Roles, and the bot's own top role must sit above the role being assigned.
Returns: Confirmation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | add | |
| reason | No | Reason recorded in the server's audit log. | |
| role_id | Yes | Role to add or remove (find with discord_list_roles). | |
| user_id | Yes | ||
| guild_id | No | Server (guild) ID. Omit to use DISCORD_GUILD_ID from .env. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |