@went.tf/discord-bot-framework 2.9.1 → 2.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/build/.tsbuildinfo +1 -1
- package/build/interactions/dispatch.d.ts +6 -0
- package/build/interactions/dispatch.d.ts.map +1 -1
- package/build/interactions/dispatch.js +23 -10
- package/build/interactions/dispatch.js.map +1 -1
- package/build/logger/discord-webhook-batcher.d.ts.map +1 -1
- package/build/logger/discord-webhook-batcher.js +16 -2
- package/build/logger/discord-webhook-batcher.js.map +1 -1
- package/build/webhook/handle-webhook-interaction-request.d.ts +16 -0
- package/build/webhook/handle-webhook-interaction-request.d.ts.map +1 -1
- package/build/webhook/handle-webhook-interaction-request.js +7 -3
- package/build/webhook/handle-webhook-interaction-request.js.map +1 -1
- package/build/webhook/index.d.ts +1 -0
- package/build/webhook/index.d.ts.map +1 -1
- package/build/webhook/index.js +1 -0
- package/build/webhook/index.js.map +1 -1
- package/build/webhook/is-discord-signature-conformance-check.d.ts +21 -0
- package/build/webhook/is-discord-signature-conformance-check.d.ts.map +1 -0
- package/build/webhook/is-discord-signature-conformance-check.js +43 -0
- package/build/webhook/is-discord-signature-conformance-check.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -563,6 +563,24 @@ Off by default, and deliberately stops at those fields - it never logs the
|
|
|
563
563
|
parsed interaction body itself (command names, option values, user data), so
|
|
564
564
|
it's safe to leave on for an investigation without a separate opt-out plan.
|
|
565
565
|
|
|
566
|
+
One recurring rejection is expected and muted automatically: Discord itself
|
|
567
|
+
periodically sends a `Ping` deliberately signed with an invalid signature
|
|
568
|
+
(seemingly to verify endpoints actually reject bad signatures, rather than
|
|
569
|
+
trusting anything that looks like a Discord request) -
|
|
570
|
+
`isDiscordSignatureConformanceCheck` recognizes it by shape (its `type` and
|
|
571
|
+
Discord's own official system user, not a fixed size) and
|
|
572
|
+
`handleWebhookInteractionRequest` mutes just its `warn`/`debug` logs for that
|
|
573
|
+
one request; the rejection itself is unchanged either way. On by default -
|
|
574
|
+
pass `muteKnownConformanceCheckLogs: false` to always log every rejection, or
|
|
575
|
+
`applicationId: env.DISCORD_CLIENT_ID` to narrow the match further:
|
|
576
|
+
|
|
577
|
+
```ts
|
|
578
|
+
await handleWebhookInteractionRequest(
|
|
579
|
+
{ signature, timestamp, rawBody, headers },
|
|
580
|
+
{ publicKey: env.DISCORD_PUBLIC_KEY, logger, onInteraction, applicationId: env.DISCORD_CLIENT_ID },
|
|
581
|
+
);
|
|
582
|
+
```
|
|
583
|
+
|
|
566
584
|
`createWebhookInteractionResponder` gives you the REST calls needed *after*
|
|
567
585
|
that initial response — editing a deferred reply, sending a follow-up, or
|
|
568
586
|
deleting the reply — built on `@discordjs/rest` (already a peer dependency):
|