blob: aeb193d0c04bab532de15ec1593ae6a8651124b5 [file] [log] [blame]
:py:mod:`airflow.providers.discord.hooks.discord_webhook`
=========================================================
.. py:module:: airflow.providers.discord.hooks.discord_webhook
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.discord.hooks.discord_webhook.DiscordWebhookHook
.. py:class:: DiscordWebhookHook(http_conn_id = None, webhook_endpoint = None, message = '', username = None, avatar_url = None, tts = False, proxy = None, *args, **kwargs)
Bases: :py:obj:`airflow.providers.http.hooks.http.HttpHook`
This hook allows you to post messages to Discord using incoming webhooks.
Takes a Discord connection ID with a default relative webhook endpoint. The
default endpoint can be overridden using the webhook_endpoint parameter
(https://discordapp.com/developers/docs/resources/webhook).
Each Discord webhook can be pre-configured to use a specific username and
avatar_url. You can override these defaults in this hook.
:param http_conn_id: Http connection ID with host as "https://discord.com/api/" and
default webhook endpoint in the extra field in the form of
{"webhook_endpoint": "webhooks/{webhook.id}/{webhook.token}"}
:param webhook_endpoint: Discord webhook endpoint in the form of
"webhooks/{webhook.id}/{webhook.token}"
:param message: The message you want to send to your Discord channel
(max 2000 characters)
:param username: Override the default username of the webhook
:param avatar_url: Override the default avatar of the webhook
:param tts: Is a text-to-speech message
:param proxy: Proxy to use to make the Discord webhook call
.. py:attribute:: conn_name_attr
:annotation: = http_conn_id
.. py:attribute:: default_conn_name
:annotation: = discord_default
.. py:attribute:: conn_type
:annotation: = discord
.. py:attribute:: hook_name
:annotation: = Discord
.. py:method:: execute()
Execute the Discord webhook call