Harass nonmembers - #177
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new handler has avoidable performance/operational issues (verification check ordering, silent channel lookup failures, goroutine capture/memory pressure) and documentation claims that currently overstate behavior guarantees.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a new MessageCreate handler to automatically prompt unverified Discord users to run /member, with per-user exponential backoff and temporary timeouts to prevent repeated posting until verification.
Changes:
- Introduces
MemberNudgehandler with role-based + data-layer verification checks, exponential backoff, Discord timeouts, and delayed message cleanup. - Registers the new handler in the command handler registry.
File summaries
| File | Description |
|---|---|
| commands/handlers/memberNudge.go | Adds the nudge/backoff/timeout logic for unverified users posting outside bot-help. |
| commands/enabled.go | Registers the memberNudge handler so it is attached to the bot session. |
Review details
Suppressed comments (1)
commands/handlers/memberNudge.go:142
- The doc comment says posting in bot-help “clears any active timeout”, but nudgeClear only clears timeouts when a nudge state (and its guild ID) is present. Either broaden the behavior or adjust the docs to match the actual best-effort semantics.
// minute after each nudge, both the bot's reply and the triggering user
// message are deleted. Nagging stops once the user is verified or posts in
// bot-help, which also clears any active timeout. Applying the timeout
// requires MODERATE_MEMBERS permission; when it fails, the in-memory backoff
// gate continues to throttle re-nudges as a fallback.
- Files reviewed: 2/2 changed files
- Comments generated: 5
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by @leahkvares