Permission Toggles
Change channel permissions for chosen roles or members on a schedule, such as opening a lounge channel every weekday morning.
Why Use This Feature?
- Opens and closes channels at set times, so nobody has to change permissions by hand every day.
- Sets the full permission state each time, so a channel always ends up exactly as the rule describes.
- Skips holidays with a list of dates, so the schedule doesn't open a channel on a day off.
How It Works
- When it runs — At every time the rule's calendar selectorThe calendar fields that say when a schedule runs matches, the workerBackground service that runs schedules and deliveries queues one durable jobQueued task kept in the database until it's done for the rule.
- What it changes — The job sets each listed permission overwriteA channel's allow or deny rule for one role or member, with
trueallowing a permission andfalsedenying it. - No merging — Each overwrite replaces the target's whole overwrite in that channel, so permissions you don't list become neutral.
- Audit log — Changes carry the reason "Stonker scheduled permission set:" followed by the rule's name.
- Retries — A failed change is tried again 30 seconds later, up to
JOB_ATTEMPT_LIMITtries, 5 by default, and the last failure can send a Job gave up notification. - Downtime — After the workerBackground service that runs schedules and deliveries has been down, it catches up on missed times from the last 24 hours, so a change can apply late.
A rule sets one state and never reverts it, so opening and closing a channel takes two rules. There is no slash commandA /command members type in Discord's message box for this feature, so changes happen only on the schedule.
Requirements
- No extra intent — The workerBackground service that runs schedules and deliveries changes permissions through Discord's REST API, so this feature adds no Gateway intentA kind of Discord event the bot asks to hear about.
- Channel permissions — The bot needs View Channel and Manage Permissions in each channel, through Manage Roles or a channel overwrite.
- The bot's own permissions — The bot can allow or deny only permissions it holds itself.
- Running bot — Nothing is queued while the bot is stopped, as described in Bot Lifecycle.
Settings
| Field | Description |
|---|---|
Name (name) | The rule's name, used in the audit-log reason, up to 100 characters. |
Schedule (toggle-on) | The calendar selectorThe calendar fields that say when a schedule runs that decides when the rule runs, required. |
Dates to skip (skip-dates) | Optional skip datesDates a schedule sits out in the rule's time zoneThe zone a schedule's times are read in; UTC by default. |
Channel changes (toggles) | 1 to 25 channels, each with a Channel and its Permission overrides. |
Applies to (toggles[].permissions[].target-type) | Member (member) or Role (role). |
Member or role ID (toggles[].permissions[].user-or-role-id) | The Discord IDThe long number Discord gives every user, channel, and role of the member or role. |
Discord permissions (toggles[].permissions[].user-or-role-perms) | 1 to 50 permissions, each picked from Add a permission… and set to Allow or Deny, stored as true or false. |
Permission names are Discord's flag names as discord.js spells them, such as ViewChannel and SendMessages, and they are case-sensitive. Scheduled Posts explains the calendar selectorThe calendar fields that say when a schedule runs fields.
Example
[
{
"name": "Open the weekday lounge",
"toggle-on": { "days-of-week": [1, 2, 3, 4, 5], "hours": [9], "minutes": [0], "time-zone": "America/New_York" },
"skip-dates": ["2026-11-26", "2026-12-25"],
"toggles": [
{
"channel": { "channel-id": "123456789012345678" },
"permissions": [
{
"target-type": "role",
"user-or-role-id": "223456789012345678",
"user-or-role-perms": { "ViewChannel": true, "SendMessages": true }
}
]
}
]
}
]
Limits
- Rules — Up to 100, each with up to 25 channels and 25 targets per channel.
- Permissions — Up to 50 names per target.
Troubleshooting
- Other permissions reset — Each run replaces the whole overwrite, so list every permission you want to keep for that target.
- "Every permission name must be supported by the current Discord API." — Check the spelling and capitalization of each permission name.
- Nothing changed at the scheduled time — The bot was stopped, so that time was skipped, or every try failed. The workerBackground service that runs schedules and deliveries log then shows
job_failedwith the reason, such as "Discord permission changes are paused while the bot is stopped." or "Missing Permissions".
Changes from the legacy bot
The legacy botThe old v3.4.3 bot that ran from a config.json file merged changes into the existing overwrite, accepted null to make a permission neutral, worked out whether an ID was a role or a member, and could also run from a chat command. The rewrite replaces the whole overwrite, needs target-type and toggle-on in every rule, and runs only on its schedule.