airflow.providers.telegram.operators.telegram¶
Operator for Telegram.
Classes¶
This operator allows you to post messages to Telegram using Telegram Bot API. |
|
This operator allows you to send file to Telegram using Telegram Bot API. |
Module Contents¶
- class airflow.providers.telegram.operators.telegram.TelegramOperator(*, telegram_conn_id='telegram_default', token=None, chat_id=None, text='No message has been set.', telegram_kwargs=None, **kwargs)[source]¶
Bases:
airflow.providers.common.compat.sdk.BaseOperatorThis 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.
See also
For more information on how to use this operator, take a look at the guide: TelegramOperator
- Parameters:
telegram_conn_id (str) – Telegram connection ID which its password is Telegram API token
token (str | None) – Telegram API Token
chat_id (str | None) – Telegram chat ID for a chat/channel/group
text (str) – Message to be sent on telegram
telegram_kwargs (dict | None) – Extra args to be passed to telegram client
- template_fields: collections.abc.Sequence[str] = ('text', 'chat_id')[source]¶
- class airflow.providers.telegram.operators.telegram.TelegramFileOperator(*, telegram_conn_id='telegram_default', token=None, chat_id=None, file, telegram_kwargs=None, **kwargs)[source]¶
Bases:
airflow.providers.common.compat.sdk.BaseOperatorThis operator allows you to send file 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.
See also
For more information on how to use this operator, take a look at the guide: TelegramOperator
- Parameters:
telegram_conn_id (str) – Telegram connection ID which its password is Telegram API token
token (str | None) – Telegram API Token
chat_id (str | None) – Telegram chat ID for a chat/channel/group
file (str) – The path of the file or media to be sent via Telegram
telegram_kwargs (dict | None) – Extra args to be passed to telegram client
- template_fields: collections.abc.Sequence[str] = 'chat_id'[source]¶