PingPong.Service.Discord (PingPong v0.1.0)

Copy Markdown View Source

Discord webhook notification service.

This service posts a JSON payload directly to a Discord webhook URL. Discord returns HTTP 204 for successful webhook delivery, which is treated as {:ok, response}.

Summary

Types

Discord delivery options.

Discord webhook payload.

Functions

Sends a Discord message through a webhook.

Types

options()

@type options() :: %{webhook: binary()}

Discord delivery options.

payload()

@type payload() :: %{content: binary()}

Discord webhook payload.

Functions

call(payload, options)

@spec call(payload(), options()) :: PingPong.result()

Sends a Discord message through a webhook.

Required payload:

%{content: "Message text"}

Required options:

%{webhook: "https://discord.com/api/webhooks/..."}

Missing required values return {:error, {:missing_required_params}, nil}.