airflow.providers.telegram.operators.telegram

Operator for Telegram.

Module Contents

Classes

TelegramOperator

This operator allows you to post messages to Telegram using Telegram Bot API.

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.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.

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: Sequence[str] = ('text', 'chat_id')[source]
ui_color = '#FFBA40'[source]
execute(context)[source]

Call the TelegramHook to post the provided Telegram message.

Was this entry helpful?