Overview
Add Discord bot integration for notifications and slash commands.
Interaction Webhooks ✅
Discord uses HTTP interactions (not WebSocket required):
Interaction Types
1 - PING (verification)
2 - APPLICATION_COMMAND (slash commands)
3 - MESSAGE_COMPONENT (buttons, selects)
4 - APPLICATION_COMMAND_AUTOCOMPLETE
5 - MODAL_SUBMIT
Identification
- Header:
X-Signature-Ed25519 (Ed25519 signature)
- Header:
X-Signature-Timestamp
- Payload: Contains
type, application_id, guild_id
Signature Verification (Ed25519)
from nacl.signing import VerifyKey
verify_key = VerifyKey(bytes.fromhex(public_key))
message = timestamp.encode() + body
verify_key.verify(message, bytes.fromhex(signature))
Interaction Payload
{
"type": 2,
"id": "interaction_id",
"application_id": "app_id",
"guild_id": "server_id",
"channel_id": "channel_id",
"member": {
"user": { "id": "user_id", "username": "user" }
},
"data": {
"name": "review",
"options": [{ "name": "url", "value": "https://..." }]
}
}
Tasks
Use Cases
- Notifications: Alert channel when PR opens/updates
- Commands:
/review <pr_url> from Discord
- Rich Embeds: Formatted PR summaries with status
- Buttons: Approve/request changes via buttons
Overview
Add Discord bot integration for notifications and slash commands.
Interaction Webhooks ✅
Discord uses HTTP interactions (not WebSocket required):
Interaction Types
1- PING (verification)2- APPLICATION_COMMAND (slash commands)3- MESSAGE_COMPONENT (buttons, selects)4- APPLICATION_COMMAND_AUTOCOMPLETE5- MODAL_SUBMITIdentification
X-Signature-Ed25519(Ed25519 signature)X-Signature-Timestamptype,application_id,guild_idSignature Verification (Ed25519)
Interaction Payload
{ "type": 2, "id": "interaction_id", "application_id": "app_id", "guild_id": "server_id", "channel_id": "channel_id", "member": { "user": { "id": "user_id", "username": "user" } }, "data": { "name": "review", "options": [{ "name": "url", "value": "https://..." }] } }Tasks
/review,/describe,/ask)Use Cases
/review <pr_url>from Discord