blob: 8244d7a7abaf60a4ea4285cafe3d6a89edebff3c [file] [log] [blame]
:mod:`airflow.providers.telegram.operators.telegram`
====================================================
.. py:module:: airflow.providers.telegram.operators.telegram
.. autoapi-nested-parse::
Operator for Telegram
Module Contents
---------------
.. py:class:: TelegramOperator(*, telegram_conn_id: str = 'telegram_default', token: Optional[str] = None, chat_id: Optional[str] = None, text: str = 'No message has been set.', telegram_kwargs: Optional[dict] = None, **kwargs)
Bases: :class:`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
:type telegram_conn_id: str
:param token: Telegram API Token
:type token: str
:param chat_id: Telegram chat ID for a chat/channel/group
:type chat_id: str
:param text: Message to be sent on telegram
:type text: str
:param telegram_kwargs: Extra args to be passed to telegram client
:type telegram_kwargs: dict
.. attribute:: template_fields
:annotation: = ['text', 'chat_id']
.. attribute:: ui_color
:annotation: = #FFBA40
.. method:: execute(self, **kwargs)
Calls the TelegramHook to post the provided Telegram message