Webhooks and the messages they send.
Every function returns {:ok, result}, :ok when Discord sends no body, or
{:error, %Lingo.Error{}}. Calls go to the current bot (see Lingo.with_bot/2).
Summary
Functions
Creates a webhook in a channel.
Deletes a webhook.
Deletes a message a webhook sent.
Deletes a webhook using its token.
Sends a message through a webhook. Pass wait: true to get the message back.
Sends a GitHub event through a webhook. Options: :thread_id and :wait.
Sends a Slack-formatted message through a webhook. Options: :thread_id
and :wait.
Fetches a webhook.
Fetches a message a webhook sent.
Fetches a webhook using its token instead of the bot's.
Lists a channel's webhooks.
Lists a guild's webhooks.
Edits a webhook.
Edits a message a webhook sent.
Edits a webhook using its token.
Functions
@spec create(Lingo.Api.id(), Lingo.Api.params(), keyword()) :: Lingo.Api.result(Lingo.Type.Webhook.t())
Creates a webhook in a channel.
@spec delete( Lingo.Api.id(), keyword() ) :: Lingo.Api.result()
Deletes a webhook.
@spec delete_message(Lingo.Api.id(), String.t(), Lingo.Api.id(), keyword()) :: Lingo.Api.result()
Deletes a message a webhook sent.
@spec delete_with_token(Lingo.Api.id(), String.t()) :: Lingo.Api.result()
Deletes a webhook using its token.
@spec execute(Lingo.Api.id(), String.t(), Lingo.Api.content(), keyword()) :: Lingo.Api.result() | {:ok, Lingo.Type.Message.t()}
Sends a message through a webhook. Pass wait: true to get the message back.
@spec execute_github(Lingo.Api.id(), String.t(), Lingo.Api.params(), keyword()) :: Lingo.Api.result()
Sends a GitHub event through a webhook. Options: :thread_id and :wait.
@spec execute_slack(Lingo.Api.id(), String.t(), Lingo.Api.params(), keyword()) :: Lingo.Api.result()
Sends a Slack-formatted message through a webhook. Options: :thread_id
and :wait.
@spec get(Lingo.Api.id()) :: Lingo.Api.result(Lingo.Type.Webhook.t())
Fetches a webhook.
@spec get_message(Lingo.Api.id(), String.t(), Lingo.Api.id(), keyword()) :: Lingo.Api.result(Lingo.Type.Message.t())
Fetches a message a webhook sent.
@spec get_with_token(Lingo.Api.id(), String.t()) :: Lingo.Api.result(Lingo.Type.Webhook.t())
Fetches a webhook using its token instead of the bot's.
@spec list_channel(Lingo.Api.id()) :: Lingo.Api.result([Lingo.Type.Webhook.t()])
Lists a channel's webhooks.
@spec list_guild(Lingo.Api.id()) :: Lingo.Api.result([Lingo.Type.Webhook.t()])
Lists a guild's webhooks.
@spec update(Lingo.Api.id(), Lingo.Api.params(), keyword()) :: Lingo.Api.result(Lingo.Type.Webhook.t())
Edits a webhook.
@spec update_message( Lingo.Api.id(), String.t(), Lingo.Api.id(), Lingo.Api.content(), keyword() ) :: Lingo.Api.result(Lingo.Type.Message.t())
Edits a message a webhook sent.
@spec update_with_token(Lingo.Api.id(), String.t(), Lingo.Api.params()) :: Lingo.Api.result(Lingo.Type.Webhook.t())
Edits a webhook using its token.