Skip to content

Moderation: no repeat bans from stale buttons, bio in the AI check, report cap of 3 - #25

Merged
scarletkc merged 3 commits into
mainfrom
feat/moderation-ban-once-bio-report-cap
Nov 10, 2026
Merged

scarletkc merged 3 commits into
mainfrom
feat/moderation-ban-once-bio-report-cap

Conversation

@scarletkc

Copy link
Copy Markdown
Member

Three moderation changes, one commit each.

Ban buttons on someone already banned

One person can have several ban buttons: every admin's report notice, the first-report and outcome notices to the same admin, and each warning in the group. Pressing a second one banned again, and from a report notice it also posted another removal notice in the group.

The button now reads the member's status before acting:

  • Report notice (「删除并永久封禁」): if they are already banned, only the reported message is deleted. No second ban, no group notice; the notice is edited to say so and the button goes away.
  • Warning or verification message (「封禁」): a popup says they are already banned and only that button is removed.
  • Two presses at once (a double tap, or two admins): handled once; the other gets "正在处理,请稍候".
  • Basic groups have no ban list, so someone who is no longer in the group counts as handled. Before, this posted a failed-removal notice in the group.

The report flow gets the same check. When members report another message from someone an admin has already banned and the AI confirms it, the message is deleted without a second notice. Before, this also replaced the permanent ban with a 24-hour one.

Bio in the AI check

Ad accounts put the pitch in their profile bio and post a harmless line such as 看我简介. /spam ai and /report now pass the sender's bio to Jev as sender.bio, read with one get_chat per judged message. A bio that is empty, hidden, or cannot be read leaves the check as it was.

The question counts a bio as spam only when it is a sales pitch (gambling, adult, 福利, easy-money work, investment returns, gray-market services). A bio that introduces the sender or links to their own channel, blog, or contact does not count.

Report cap

MAX_VOTES drops from 5 to 3. It is still one vote per 100 members, so groups with more than 200 members need 3 reports.

For the reviewer

  • Not checked against the real Jev API. The new bio criteria are only covered by request-shape tests. Worth watching for false positives on ordinary bios after deploy.
  • A 24-hour auto-ban is not upgraded by a stale button. Pressing an old 「删除并永久封禁」 on someone the bot already banned for 24 hours now only reports that they are banned. An admin who wants a permanent ban has to do it in the group.
  • The already-banned check costs one get_chat_member per ban press and per AI-confirmed report.

Testing

uv run pytest -q --ignore=tests/integration: 1280 passed, 68 skipped. ruff check src tests passes. The MySQL integration suite was not run; none of it touches these paths.

The vote cap drops from 5 to 3: still one vote per 100 members, so groups
with more than 200 members now need 3 reports instead of up to 5.
Ad accounts put the pitch in their profile bio and post a harmless line
such as 看我简介. Both /spam ai and /report now read the bio with one
get_chat per judged message and pass it to Jev as sender.bio; a bio that is
empty, hidden, or cannot be read leaves the check as it was.

The question counts a bio as spam only when it is a sales pitch, not when
it introduces the sender or links to their own channel or site.
…s or announces again

One person can have several ban buttons: every admin's report notice, the
first-report and outcome notices, and each warning in the group. Pressing a
second one banned again, and from a report notice also posted another
removal notice in the group.

The button now checks the member's status first. If they are already banned
it only drops the button; a report notice still deletes the reported
message. Two presses arriving together are handled once. Basic groups have
no ban list, so someone who is no longer in the group counts as handled
instead of producing a failed-removal notice.

The report flow gets the same check: a message from someone an admin has
already banned is deleted without a second notice and without replacing a
permanent ban with a 24-hour one.
@scarletkc

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 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-10T08:47:15.361966Z 87395f1 Manual request
ℹ️ 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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 87395f1e35

ℹ️ 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".

@scarletkc
scarletkc added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 0824d70 Nov 10, 2026
5 checks passed
@scarletkc
scarletkc deleted the feat/moderation-ban-once-bio-report-cap branch November 10, 2026 08:50
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