HTTP interactions (slash commands, components) — signature verification and callback responses. REST-only: interactions arrive at your HTTP endpoint, not via the gateway.
Discord signs each request with Ed25519 over timestamp <> raw_body, sending
X-Signature-Ed25519 (hex) and X-Signature-Timestamp. Verify against the
raw request body before decoding JSON, and answer PING (type 1) with
respond(id, token, :pong) — or directly in the HTTP response body
(%{type: 1}).
Summary
Functions
Builds the callback JSON body for respond/4.
POST /interactions/{interaction.id}/{interaction.token}/callback — respond to an interaction (no bot token needed).
Verifies an interaction request signature. Returns true only for a valid
Ed25519 signature; malformed hex or keys return false (never raise).
Types
Functions
Builds the callback JSON body for respond/4.
@spec respond(String.t(), String.t(), response(), keyword()) :: Noizu.Discord.Request.result()
POST /interactions/{interaction.id}/{interaction.token}/callback — respond to an interaction (no bot token needed).
response is one of:
:pong— type 1 (PONG).{:message, data}— type 4 (CHANNEL_MESSAGE_WITH_SOURCE);data= message params.{:deferred, data}— type 5 (DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE);datamay be%{}or%{flags: 64}for ephemeral.- a raw map
%{type: t, data: d}for any other callback type.
Opts: :client (base_url/req_options/retry source, token unused), or :base_url /
:req_options / :retry; :with_response (query flag); :meta.
Verifies an interaction request signature. Returns true only for a valid
Ed25519 signature; malformed hex or keys return false (never raise).