Skip to content

Discord chat: "Report to moderators" on any message in the server - #446

Closed
TripleU613 wants to merge 3 commits into
mainfrom
discord-chat/report-to-moderators
Closed

TripleU613 wants to merge 3 commits into
mainfrom
discord-chat/report-to-moderators

Conversation

@TripleU613

Copy link
Copy Markdown
Owner

Message command (right-click → Apps → Report to moderators). Ephemeral "Sent" reply; a job posts to #mod-log and messages the forum moderators group with the text in a plain code block (no mentions, fences defused). Configured guild only, 5/hour/member, works with slash commands off. Default off (discord_chat_reports_enabled). Specs for the reply, guild check, off switch, the forum message (no mention notifications) and the log line.

Stacked on discord-chat/mod-log-timeouts; retargets to main once that merges.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BUGDaR7qv2d8CuVp7UGSTs

TripleU613 and others added 3 commits November 25, 2026 13:37
…ictions

discord_chat_mod_log_channel_id posts what the forum does in the server to
a moderators-only channel: who got in (with their forum username), who lost
access, and timeouts set and lifted. Lines never ping anyone, and a line
that fails to post is dropped rather than stopping the sync.

discord_chat_sync_timeouts times a linked member out while they're
suspended or silenced on the forum, capped at Discord's 28 days and renewed
as it runs down. A timeout already within a day of the right end is left
alone, so long suspensions aren't rewritten every minute. The forum records
the timeouts it set and lifts only those; a moderator's own timeout in the
server is never cleared. The server owner is skipped. Both settings default
off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUGDaR7qv2d8CuVp7UGSTs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUGDaR7qv2d8CuVp7UGSTs
discord_chat_reports_enabled registers a message command, so right-clicking
or long-pressing a message → Apps → "Report to moderators" sends it to the
moderators. The reporter gets a private "Sent" reply at once; a job posts the
report to the moderators' log channel and messages the forum's moderators
group with the reporter and author (and their forum accounts when linked),
a link to the message and its text.

The reported text is untrusted: on the forum it goes in a plain code block
with its own fences defused, accounts are shown as profile links rather
than @mentions, and the log line pings nobody. Only reports from the
configured server are taken, 5 per member per hour. It works whether or not
the slash commands are on; the registered list now comes from
Commands.definitions. Off by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUGDaR7qv2d8CuVp7UGSTs
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T18:50:23.283017Z 58293fe PR opened
🔒 Security Review ✅ Completed 2026-11-25T18:51:23.001319Z 58293fe PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 58293fe057

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +28 to +30
raw: forum_body(args, link, content),
archetype: Archetype.private_message,
target_group_names: [moderators.name],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep restricted-channel content inside its audience

When a report originates in a Discord channel that some forum moderators cannot view, such as an admin-only or private project channel, this unconditionally copies the raw message into a PM for the entire forum moderators group. The only authorization check is the guild ID; neither the interaction handler nor this job restricts source channels or recipients, so reporting widens access to restricted Discord content. Avoid copying the content unless every recipient is authorized for that channel, or constrain reports to an explicit safe channel set.

AGENTS.md reference: AGENTS.md:L9-L9

Useful? React with 👍 / 👎.

Base automatically changed from discord-chat/mod-log-timeouts to main November 25, 2026 18:57
@TripleU613
TripleU613 deleted the branch discord-chat/mod-log-timeouts November 25, 2026 18:57
@TripleU613 TripleU613 closed this Nov 25, 2026
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.

1 participant