<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tal</title>
    <description>The latest articles on DEV Community by Tal (@talzanar).</description>
    <link>https://dev.to/talzanar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4262324%2F9aa1cef1-7545-4212-90fd-d642cc2ba511.png</url>
      <title>DEV Community: Tal</title>
      <link>https://dev.to/talzanar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/talzanar"/>
    <language>en</language>
    <item>
      <title>Your mod log records what happened. It should record why.</title>
      <dc:creator>Tal</dc:creator>
      <pubDate>Tue, 24 Nov 2026 10:19:51 +0000</pubDate>
      <link>https://dev.to/sigh-club/your-mod-log-records-what-happened-it-should-record-why-1n71</link>
      <guid>https://dev.to/sigh-club/your-mod-log-records-what-happened-it-should-record-why-1n71</guid>
      <description>&lt;p&gt;Most moderation systems store the same five columns: guild, user, moderator, action, reason. That looks like a record until someone appeals, at which point it turns out to be a note to self.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;reason&lt;/code&gt; column is the problem. In practice it holds "spam", "rule 4", or "being annoying". A fortnight later, a member asks why they were muted and the honest answer is that the moderator who did it can't remember either. So the argument becomes about memory, and the member usually wins, because they were there.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a decision actually needs to answer
&lt;/h2&gt;

&lt;p&gt;Four questions, and a free-text field answers none of them reliably:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What happened, specifically?&lt;/li&gt;
&lt;li&gt;Which rule was breached?&lt;/li&gt;
&lt;li&gt;What evidence was considered?&lt;/li&gt;
&lt;li&gt;What can the member do about it?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If your schema can't answer those from the record alone, it isn't really a log. It's a rumour with a timestamp attached.&lt;/p&gt;

&lt;h2&gt;
  
  
  The shape we landed on
&lt;/h2&gt;

&lt;p&gt;Every action is a case with a stable id, the target, the moderator, an action type from a fixed enum, a reason, and whether it is still active:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;infractionSchema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;mongoose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Schema&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;guildId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;required&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;required&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;moderatorId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;required&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;enum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'warning'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'mute'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'kick'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'ban'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'timeout'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'softban'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'unban'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'unmute'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;required&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;required&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;active&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;reason&lt;/code&gt; stays required, and the bot refuses to write an empty one. That single constraint removes most of the "why was I banned" threads, because the answer is already written down at the moment somebody cared enough to write it.&lt;/p&gt;

&lt;p&gt;The second piece is a generator that turns a decision into a readable statement. It's a pure function, deterministic, and there's no LLM anywhere near it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;buildStatementOfReasons&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;caseId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;guildName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;targetUser&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;actionType&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;severity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;automated&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;evidenceCount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;decisionDate&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;ACTION_LABELS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;actionType&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="s1"&gt;'A moderation action was applied'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;points&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="sb"&gt;`Affected user: ${targetUser || 'the account concerned'}.`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sb"&gt;`What happened: ${action} against ${targetUser} (case ${caseId}) on ${new Date(date).toUTCString()}.`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sb"&gt;`Why: the action was taken for a ${sev}infringement of our Acceptable Use Policy. Specific reason recorded: "${reason}".`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;evidenceRef&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;basis&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// ... plus an appeal paragraph and the statutory basis&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output is five lines a human can read, and the same structured fields get snapshotted onto the appeal record.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that is easy to get wrong: automated decisions
&lt;/h2&gt;

&lt;p&gt;If an action came from automod or image screening, the statement has to say so, and the appeal has to reach a human. That isn't a formality. It's the difference between "the bot muted you" and "the bot muted you, and here's who looks at it":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;AUTOMATED_BASIS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
  &lt;span class="s1"&gt;'This decision was made by automated tools (including AI media moderation) '&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
  &lt;span class="s1"&gt;'and has been recorded so a human can review it on request.'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the appeal record carries an &lt;code&gt;automatedDecision&lt;/code&gt; flag, and the review path forces a human decision when it is set. The status lifecycle is deliberately narrow: &lt;code&gt;pending&lt;/code&gt;, then &lt;code&gt;upheld&lt;/code&gt;, &lt;code&gt;overturned&lt;/code&gt; or &lt;code&gt;dismissed&lt;/code&gt;. No "in review" state that quietly lives forever.&lt;/p&gt;

&lt;h2&gt;
  
  
  Snapshot, don't join
&lt;/h2&gt;

&lt;p&gt;The appeal stores a copy of the statement as it was at the time of the decision. Joining back to the live infraction looks tidier and is worse: the reason gets edited, the moderator leaves, a retention job deletes the case, and now the appeal is arguing about a record that doesn't exist any more. Snapshot the statement, keep the case id for reference, and treat the snapshot as immutable.&lt;/p&gt;

&lt;p&gt;Retention is the other half. We purge general records at six months and keep claim-related ones for six years. Pick your numbers before you need them, because "we deleted it" is a hopeless answer to an appeal.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you're not building this
&lt;/h2&gt;

&lt;p&gt;Three changes get you most of the way in an afternoon:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make the reason structured: a rule code plus the message id, not a sentence.&lt;/li&gt;
&lt;li&gt;Never delete a case. Mark it inactive.&lt;/li&gt;
&lt;li&gt;Write the appeal instructions into the record at creation, not into a help page nobody reads.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The legal framing is useful here. The EU Digital Services Act Article 17 requires a clear, specific statement of reasons for certain moderation decisions, and the UK Online Safety Act has an equivalent appeal framing. Most Discord servers aren't platforms in the statutory sense, and this isn't legal advice. But it's a good specification for a database schema, and the shape it forces is the shape that settles the argument.&lt;/p&gt;

&lt;p&gt;If you want to see it in the app, the bot is at &lt;a href="https://sighnet.org" rel="noopener noreferrer"&gt;sighnet.org&lt;/a&gt;. The moderation dashboard is on the free tier.&lt;/p&gt;

</description>
      <category>discord</category>
      <category>node</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Discord rate limits forced us to pre-create voice channels. The permission bug came free.</title>
      <dc:creator>Tal</dc:creator>
      <pubDate>Tue, 24 Nov 2026 10:03:32 +0000</pubDate>
      <link>https://dev.to/sigh-club/discord-rate-limits-forced-us-to-pre-create-voice-channels-the-permission-bug-came-free-51el</link>
      <guid>https://dev.to/sigh-club/discord-rate-limits-forced-us-to-pre-create-voice-channels-the-permission-bug-came-free-51el</guid>
      <description>&lt;p&gt;Every "join to create a voice channel" bot has the same bug hiding in it, and it isn't the join part.&lt;/p&gt;

&lt;p&gt;The join part is easy. A voice state update arrives, you create a channel, you move the member in. What's hard is that you are doing a gateway write in the middle of a user's click. Discord's channel-create limit is per guild, and a busy evening of people hopping in and out will find it. When it does, the member sits in the anchor channel for three seconds wondering if the bot is broken.&lt;/p&gt;

&lt;p&gt;So we stopped creating channels on demand. We pre-create them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pool
&lt;/h2&gt;

&lt;p&gt;Two idle slots per anchor, held in memory, keyed by guild and category:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;POOL_TARGET_SIZE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;refillChannelPool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;guildId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;categoryId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;guildConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;guildConfigCache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guildId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;guildConfig&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;guildConfig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;enablePooling&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;poolKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sb"&gt;`${guildId}:${categoryId}`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;pool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;channelPools&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;poolKey&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="no"&gt;POOL_TARGET_SIZE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// ...create one slot, push it&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A claim shifts a slot off the pool and renames it in place, then refills in the background. The user gets a channel in one edit instead of one create, which is the difference between "instant" and "is it broken".&lt;/p&gt;

&lt;p&gt;Idle slots are called &lt;code&gt;🕒 Preparing...&lt;/code&gt;, and &lt;code&gt;@everyone&lt;/code&gt; is denied View and Connect, so nobody wanders into one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The permission trap
&lt;/h2&gt;

&lt;p&gt;This is the part worth writing down, because it cost us a weekend.&lt;/p&gt;

&lt;p&gt;Our first pool slots were created inside the category and inherited its permission overwrites. That seems right: the room should look like the category. What actually happened is that every idle slot became visible to the whole server.&lt;/p&gt;

&lt;p&gt;The reason is Discord's permission precedence. Channel-level overwrites beat role-level ones, but a &lt;em&gt;role&lt;/em&gt; allow still beats an &lt;em&gt;&lt;a class="mentioned-user" href="https://dev.to/everyone"&gt;@everyone&lt;/a&gt;&lt;/em&gt; deny. If the category grants View to, say, a "Member" role, and your slot denies View to &lt;code&gt;@everyone&lt;/code&gt;, the Member role wins for every member. Your &lt;code&gt;@everyone&lt;/code&gt; deny did nothing for the people who matter.&lt;/p&gt;

&lt;p&gt;So pool slots are created with &lt;strong&gt;no category inheritance at all&lt;/strong&gt;, and two explicit overwrites:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;permissionOverwrites&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;guild&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;deny&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;ViewChannel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Connect&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;allow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;ViewChannel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Connect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;ManageChannels&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;MoveMembers&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At claim time the overwrites are replaced wholesale with a layered set: category rules, then the anchor channel's rules, then the owner's explicit allow. Layering in that order matters, because the anchor is the thing the admin configured last and it has to win over the category for the same role id. And a deny always beats an allow at the same level, so you cannot "allow" your way past a role deny. You have to remove the deny.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cleanup, and the bug that taught us to key by owner
&lt;/h2&gt;

&lt;p&gt;Rooms have to die. Empty rooms, rooms whose owner left the server, rooms whose owner moved to another room, and the leftovers from a bot restart. We sweep for all four, plus a global pass on boot.&lt;/p&gt;

&lt;p&gt;The interesting bug: our lock button read the &lt;em&gt;clicker's&lt;/em&gt; temp-room record, not the room's. A moderator locking someone else's room would toggle their own flag and the room's stored state would stay wrong. Everything is keyed by the room owner now, resolved from the channel, because the person clicking and the person who owns the room are frequently not the same person.&lt;/p&gt;

&lt;p&gt;The other one: a rename can take longer than the three seconds Discord gives an interaction to respond. Any control that renames or rewrites overwrites defers first, then acts. That's not defensive coding, it's the only way the button ever works.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do differently
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Treat channel creation as a queue, not a promise. A create that fails should retry, not surface to the user.&lt;/li&gt;
&lt;li&gt;Cap the pool hard and back off the refill when you're being rate limited, otherwise the refill is what hammers the limit.&lt;/li&gt;
&lt;li&gt;Assume every voice state event can arrive twice, out of order, or not at all. The member who leaves during creation is the normal case, not the edge case.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The whole system is about 1,300 lines, most of it cleanup. The pool is maybe forty of them.&lt;/p&gt;

&lt;p&gt;If you want to see it running, the bot is at &lt;a href="https://sighnet.org" rel="noopener noreferrer"&gt;sighnet.org&lt;/a&gt;. Free tier, and temp voice is in it.&lt;/p&gt;

</description>
      <category>discord</category>
      <category>node</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
