Skip to content

Add per-admin permanent non-anonymous mode with one-time per-thread reminder#12

Merged
r-hensley merged 9 commits into
masterfrom
copilot/add-admin-slash-command-enable-non-anonymous-mode
May 13, 2026
Merged

Add per-admin permanent non-anonymous mode with one-time per-thread reminder#12
r-hensley merged 9 commits into
masterfrom
copilot/add-admin-slash-command-enable-non-anonymous-mode

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

This adds a server-admin slash command to opt into permanent non-anonymous replies across all report threads. It also adds per-thread reminder tracking so opted-in admins are notified once (on first message in that thread) that their identity is always disclosed.

  • Command surface

    • Added /permanent_non_anonymous enabled:<bool> in cogs/admin.py.
    • Stores per-guild opted-in admin IDs in guilds[guild_id]["permanent_non_anonymous_mods"].
  • Report-thread state

    • Extended report session records with permanent_non_anonymous_notified_mods in cogs/utils/helper_functions.py.
    • Tracks which opted-in admins have already received the reminder in a given thread.
  • Message relay behavior

    • Updated moderator→user relay logic in cogs/modbot.py:
      • If moderator is permanently opted in, DM relay always uses identified mode ({mention}:) regardless of thread-local anonymous default.
      • Sends one reminder reply in-thread on that moderator’s first message per thread.
      • Uses thread_info["guild_id"] for guild config lookup to avoid thread object coupling.
  • Operator-facing instructions

    • Updated admin instructions text to include the new slash command.
# cogs/modbot.py (relay decision)
is_permanent = msg.author.id in guild_config.get("permanent_non_anonymous_mods", [])
if is_permanent and msg.author.id not in thread_info.setdefault("permanent_non_anonymous_notified_mods", []):
    thread_info["permanent_non_anonymous_notified_mods"].append(msg.author.id)
    await msg.reply("Reminder: ... your identity is shown in this and all other report threads.")

cont = f" {msg.author.mention}: " if (thread_info.get("not_anonymous") or is_permanent) \
       else f">>> **Moderator {thread_info['mods'].index(msg.author.id) + 1}**: "

Copilot AI and others added 8 commits May 13, 2026 21:06
Agent-Logs-Url: https://github.com/r-hensley/DMModbot/sessions/764cbf79-1761-4755-a35b-e634b8924129

Co-authored-by: r-hensley <30587035+r-hensley@users.noreply.github.com>
Agent-Logs-Url: https://github.com/r-hensley/DMModbot/sessions/764cbf79-1761-4755-a35b-e634b8924129

Co-authored-by: r-hensley <30587035+r-hensley@users.noreply.github.com>
Agent-Logs-Url: https://github.com/r-hensley/DMModbot/sessions/764cbf79-1761-4755-a35b-e634b8924129

Co-authored-by: r-hensley <30587035+r-hensley@users.noreply.github.com>
@r-hensley
Copy link
Copy Markdown
Owner

@copilot in a notification message for thread add a line below on a new line starting with "-#" reminding admins basically the name of the slash command

Like to toggle this setting, use ...

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 13, 2026

@copilot in a notification message for thread add a line below on a new line starting with "-#" reminding admins basically the name of the slash command

Like to toggle this setting, use ...

Implemented in 2eb54b4.

The reminder now includes a second line starting with -# that tells admins how to toggle it:
-# To toggle this setting, use /permanent_non_anonymous.

Screenshot: /tmp/permanent-non-anon-reminder.png

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=6113 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.TG3rcv --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,2231159370276082313,11049609085022729297,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,6535208403247609441,6500486231364916274,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium chromium --headless --disable-gpu --no-sandbox --window-size=1200,420 --screenshot=/tmp/permanent-non-anon-reminder.png data:text/html,&lt;html&gt;&lt;body style=&#39;font-family:sans-serif;padding:24px;&#39;&gt;&lt;div style=&#39;max-width:760px;border:1px solid #ccc;border-radius:8px;padding:16px;&#39;&gt;&lt;p&gt;Reminder: you have permanent non-anonymous mode enabled in this server, so your identity is shown (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=6212 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.uyqyV4 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,16733232158874739470,17605037226746529139,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,4192209654449853047,14213850103242308933,4 --trace-process-track-uuid=3190708989122997041 (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=6113 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.TG3rcv --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,2231159370276082313,11049609085022729297,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,6535208403247609441,6500486231364916274,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium chromium --headless --disable-gpu --no-sandbox --window-size=1200,420 --screenshot=/tmp/permanent-non-anon-reminder.png data:text/html,&lt;html&gt;&lt;body style=&#39;font-family:sans-serif;padding:24px;&#39;&gt;&lt;div style=&#39;max-width:760px;border:1px solid #ccc;border-radius:8px;padding:16px;&#39;&gt;&lt;p&gt;Reminder: you have permanent non-anonymous mode enabled in this server, so your identity is shown (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=6212 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.uyqyV4 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,16733232158874739470,17605037226746529139,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,4192209654449853047,14213850103242308933,4 --trace-process-track-uuid=3190708989122997041 (dns block)
  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=6113 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.TG3rcv --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,2231159370276082313,11049609085022729297,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,6535208403247609441,6500486231364916274,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium chromium --headless --disable-gpu --no-sandbox --window-size=1200,420 --screenshot=/tmp/permanent-non-anon-reminder.png data:text/html,&lt;html&gt;&lt;body style=&#39;font-family:sans-serif;padding:24px;&#39;&gt;&lt;div style=&#39;max-width:760px;border:1px solid #ccc;border-radius:8px;padding:16px;&#39;&gt;&lt;p&gt;Reminder: you have permanent non-anonymous mode enabled in this server, so your identity is shown (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=6212 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.uyqyV4 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,16733232158874739470,17605037226746529139,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,4192209654449853047,14213850103242308933,4 --trace-process-track-uuid=3190708989122997041 (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=6113 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.TG3rcv --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,2231159370276082313,11049609085022729297,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,6535208403247609441,6500486231364916274,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium chromium --headless --disable-gpu --no-sandbox --window-size=1200,420 --screenshot=/tmp/permanent-non-anon-reminder.png data:text/html,&lt;html&gt;&lt;body style=&#39;font-family:sans-serif;padding:24px;&#39;&gt;&lt;div style=&#39;max-width:760px;border:1px solid #ccc;border-radius:8px;padding:16px;&#39;&gt;&lt;p&gt;Reminder: you have permanent non-anonymous mode enabled in this server, so your identity is shown (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=6212 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.uyqyV4 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,16733232158874739470,17605037226746529139,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,4192209654449853047,14213850103242308933,4 --trace-process-track-uuid=3190708989122997041 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from r-hensley May 13, 2026 21:28
@r-hensley r-hensley marked this pull request as ready for review May 13, 2026 21:34
@r-hensley r-hensley requested a review from Copilot May 13, 2026 21:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a per-admin opt-in toggle for permanently non-anonymous moderator replies in report threads, with a one-time in-thread reminder the first time an opted-in admin posts in a given thread.

Changes:

  • New /permanent_non_anonymous slash command in cogs/admin.py storing opted-in admin IDs under guilds[guild_id]["permanent_non_anonymous_mods"], plus instructions update.
  • cogs/modbot.py DM relay now treats opted-in mods as non-anonymous and sends a one-time reminder per thread, tracked via permanent_non_anonymous_notified_mods on thread_info.
  • cogs/utils/helper_functions.py initializes permanent_non_anonymous_notified_mods on new report records.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
cogs/admin.py Adds the new admin slash command and updates the instructions text.
cogs/modbot.py Applies permanent non-anonymous behavior and per-thread reminder during moderator→user relay.
cogs/utils/helper_functions.py Adds permanent_non_anonymous_notified_mods to new report sessions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@r-hensley r-hensley merged commit 3750406 into master May 13, 2026
1 check passed
@r-hensley r-hensley deleted the copilot/add-admin-slash-command-enable-non-anonymous-mode branch May 13, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants