Skip to main content

Discord Webhook Helpers

discord_send(webhook_url, content, username, avatar_url) → (success, error)

Send a message to Discord and wait for confirmation (5s timeout).

  • webhook_url (string) - Must start with https://discord.com/api/webhooks/ or https://discordapp.com/api/webhooks/
  • content (string) - Message text (max 2000 characters, cannot be empty)
  • username (string, optional) - Override webhook username (max 80 chars, nil for default)
  • avatar_url (string, optional) - Override webhook avatar (nil for default)

Returns: success (boolean), error (string|nil).

discord_send_async(webhook_url, content, username, avatar_url) → boolean

Fire-and-forget variant. Returns true if queued, false if validation failed.