Alchemy.Webhook.send
You're seeing just the function
send
, go back to Alchemy.Webhook module for more information.
Link to this function
send(webhook, arg, options \\ [])
Specs
send(t(), {:embed, Alchemy.Embed.t()} | {:content, String.t()}, avatar_url: String.t(), username: String.t(), tts: Boolean ) :: {:ok, nil} | {:error, term()}
Sends a message to a webhook.
type
must be one of :embed, :content
; :embed
requiring an Embed.t
struct, and :content
requiring a string.
Options
avatar_url
A link to an image to replace the one the hook has, for this message.username
The username to override to hook's, for this message.tts
When set to true, will make the message TTSExamples
For a more elaborate example:{:ok, hook} = Webhook.create("66", "Captain Hook") Webhook.send(hook, {content: "ARRRRRGH!"})
user = Cache.user() embed = %Embed{} |> description("I'm commandeering this vessel!!!") |> color(0x3a83b8) Webhook.send(hook, {:embed, embed}, avatar_url: User.avatar_url(user), username: user.username)