![]() ![]() For forwarded messages, sender of the original message forward_from_chat ¶Ĭhat – Optional. Int – Date the message was sent in Unix time chat ¶Ĭhat – Conversation the message belongs to forward_from ¶ Sender, can be empty for messages sent to channels date ¶ ![]() _get_chat_id ( chat_id, telegram_conn_id ) self. ![]() ![]() _get_token ( token, telegram_conn_id ) self. code-block:: python # Create hook telegram_hook = TelegramHook(telegram_conn_id='telegram_default') # or telegram_hook = TelegramHook(telegram_conn_id='telegram_default', chat_id='-1xxx') # or telegram_hook = TelegramHook(token='xxx:xxx', chat_id='-1xxx') # Call method from telegram bot client telegram_nd_message(None', ) :param telegram_conn_id: connection that optionally has Telegram API token in the password field :type telegram_conn_id: str :param token: optional telegram API token :type token: str :param chat_id: optional chat_id of the telegram chat/channel/group :type chat_id: str """ def _init_ ( self, telegram_conn_id : Optional = None, token : Optional = None, chat_id : Optional = None, ) -> None : super (). Following is the details of a telegram_connection: name: 'telegram-connection-name' conn_type: 'http' password: 'TELEGRAM_TOKEN' host: 'chat_id' (optional) Examples. chat_id can also be provided in the connection using 'host' field in connection. If both supplied, token parameter will be given precedence, otherwise 'password' field in the connection from telegram_conn_id will be used. The library can be found here: It accepts both telegram bot API token directly or connection that has telegram bot API token. Class TelegramHook ( BaseHook ): """ This hook allows you to post messages to Telegram using the telegram python-telegram-bot library. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |