Skip to content

fix(bot): stop taking every message for the one of a webhook - #357

Merged
RedStar071 merged 1 commit into
V7from
fix/webhook-id-undefined
Nov 2, 2026
Merged

RedStar071 merged 1 commit into
V7from
fix/webhook-id-undefined

Conversation

@RedStar071

@RedStar071 RedStar071 commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

❓ Type of change

  • 🐞 Bug fix

📚 Description

I wrote in the honeypot channel of the staging server with an alt and nothing happened: the message stayed, no case, no log. The dispatch had reached the bot (the message was in the Redis cache), the settings pointed at the right channel and the alt had no moderator role.

The listeners skip webhooks with message.webhookId !== null, but a Message of plugin-gateway inherits that getter from @discordjs/structures, which leaves it undefined when there is no webhook (discord.js gives null). So every message read as a webhook's, since the port to the gateway on 5 October: messageCreate never emitted UserMessage (the whole message auto-moderation), the honeypot caught nobody, edited messages were never logged and auto-delete took every author for a bot. The four checks now go through isWebhookMessage.

The mocks of the listener tests had webhookId: null, which is why nothing failed. The plugin should return null like discord.js does; that is wolfstar-project/plugins#276, and this guard stays correct either way.

🤖 AI disclosure: Wolfstar Agent Kit modified this description. My AI open-source policy.


Play the walkthrough    Follow each request

RetriggerView in GreptileConfidence Score: 5/5

The reviewed changes are safe to merge; no blocking issues were found.

Reviews (1) · Last reviewed commit: "fix(bot): stop taking every message for ..." · Reviewed by Greptile

@coldtea-pr-lens

coldtea-pr-lens Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Architecture

Architecture diagram for wolfstar-project/wolfstar at 8991412

Play the walkthrough


Data flow

Data flow diagram for wolfstar-project/wolfstar at 8991412

Follow each request


Tip

Set github.draw: on-demand in .github/pr-lens.yml and PR Lens stops drawing pull requests on its own. Comment @pr-lens draw on a pull request when you want that one drawn

🪧 More tips
  • Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through
  • The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture… row. Drawing still runs as before
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works
  • After a push, tick Redraw to draw the latest commit
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion
  • Set github.description: false in .github/pr-lens.yml to stop PR Lens adding buttons to your PR descriptions

Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it.  Star PR Lens on GitHub

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes — the full single-commit diff of this PR.

  • isWebhookMessage guard — new helper in guards.ts using typeof message.webhookId === 'string', which treats both undefined and null as "not a webhook".
  • Listener call sites — messageCreate, messageCreateAutoDelete, messageCreateHoneypot and rawMessageUpdateNotify replace webhookId !== null with the helper. A grep of projects/ finds no remaining webhookId !== null checks.
  • Tests — guards.test.ts builds a real gateway Message for the member and webhook cases. The webhookId: null lines are removed from the autoDelete and honeypot mocks, so those tests now exercise the undefined case that hid this bug.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@github-project-automation github-project-automation Bot moved this from Todo to Review Approved in Wolfstar Nov 2, 2026
@RedStar071
RedStar071 merged commit 2e77286 into V7 Nov 2, 2026
9 checks passed
@RedStar071
RedStar071 deleted the fix/webhook-id-undefined branch November 2, 2026 13:25
@github-project-automation github-project-automation Bot moved this from Review Approved to Done in Wolfstar Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant