blob: a05d3e0e71fbf0b6cd274489689f10b0ac50c13f [file] [log] [blame]
:py:mod:`airflow.providers.telegram.operators.telegram`
=======================================================
.. py:module:: airflow.providers.telegram.operators.telegram
.. autoapi-nested-parse::
Operator for Telegram
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.telegram.operators.telegram.TelegramOperator
.. py:class:: TelegramOperator(*, telegram_conn_id = 'telegram_default', token = None, chat_id = None, text = 'No message has been set.', telegram_kwargs = None, **kwargs)
Bases: :py:obj:`airflow.models.BaseOperator`
This operator allows you to post messages to Telegram using Telegram Bot API.
Takes both Telegram Bot API token directly or connection that has Telegram token in password field.
If both supplied, token parameter will be given precedence.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:TelegramOperator`
:param telegram_conn_id: Telegram connection ID which its password is Telegram API token
:param token: Telegram API Token
:param chat_id: Telegram chat ID for a chat/channel/group
:param text: Message to be sent on telegram
:param telegram_kwargs: Extra args to be passed to telegram client
.. py:attribute:: template_fields
:annotation: :Sequence[str] = ['text', 'chat_id']
.. py:attribute:: ui_color
:annotation: = #FFBA40
.. py:method:: execute(self, context)
Calls the TelegramHook to post the provided Telegram message