EFB Telegram Master Channel, a channel for EH Forwarder Bot.

ehForwarderBot, updated 🕥 2023-01-02 14:01:35

EFB Telegram Master Channel (ETM)

.. image:: https://img.shields.io/pypi/v/efb-telegram-master.svg :alt: PyPI release :target: https://pypi.org/project/efb-telegram-master/ .. image:: https://github.com/ehForwarderBot/efb-telegram-master/workflows/Tests/badge.svg :alt: Tests status :target: https://github.com/ehForwarderBot/efb-telegram-master/actions .. image:: https://pepy.tech/badge/efb-telegram-master/month :alt: Downloads per month :target: https://pepy.tech/project/efb-telegram-master .. image:: https://d322cqt584bo4o.cloudfront.net/ehforwarderbot/localized.svg :alt: Translate this project :target: https://crowdin.com/project/ehforwarderbot/

.. image:: https://github.com/ehForwarderBot/efb-telegram-master/raw/master/banner.png :alt: Banner

README in other languages_.

.. TRANSLATORS: change the URL on previous line as "." (without quotations). .. _README in other languages: ./readme_translations

Channel ID: blueset.telegram

ETM is a Telegram Master Channel for EH Forwarder Bot, based on Telegram Bot API, python-telegram-bot.

Requirements

  • Python >= 3.6
  • EH Forwarder Bot >= 2.0.0
  • ffmpeg
  • libmagic
  • libwebp

Getting Started

  1. Install all required binary dependencies
  2. Install ETM

.. code:: shell

   pip3 install efb-telegram-master
  1. Enable and configure ETM using the EFB configuration wizard, or enable it manually in the profile’s config.yaml.

The path of your profile storage directory depends on your configuration.

(As of EFB 2, default profile storage directory is located at ~/.ehforwarderbot/profiles/default )

  1. Configure the channel (manual configure instructions as follows)

Alternative installation methods ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ETM also has other alternative installation methods contributed by the community, including:

  • AUR package maintained by KeLiu (python-efb-telegram-master-git)
  • Other installation scripts and containers (e.g. Docker)_

.. _KeLiu: https://github.com/specter119 .. _AUR package: https://aur.archlinux.org/packages/python-efb-telegram-master-git .. _installation scripts and containers (e.g. Docker): https://efb-modules.1a23.studio#scripts-and-containers-eg-docker

Manual Configuration

Set up a bot ~~~~~~~~~~~~

Create a bot with @BotFather_, give it a name and a username. Then you’ll get a token, which will be used later. Keep this token secure, as it gives who owns it the full access to the bot.

.. [email protected]: https://t.me/botfather

Use /setjoingroups to allow your bot to join groups. Use /setprivacy to disable the privacy restriction of the bot, so that it can receive all messages in the group.

Complete configuration file ~~~~~~~~~~~~~~~~~~~~~~~~~~~

Configuration file is stored at <profile directory>/blueset.telegram/config.yaml.

A sample config file can be as follows:

.. code:: yaml

##################
# Required items #
##################

# [Bot Token]
# This is the token you obtained from @BotFather
token: "012345678:1Aa2Bb3Vc4Dd5Ee6Gg7Hh8Ii9Jj0Kk1Ll2M"

# [List of Admin User IDs]
# ETM will only process messages and commands from users
# listed below. This ID can be obtained from various ways 
# on Telegram.
admins:
- 102938475
- 91827364

##################
# Optional items #
##################
# [Experimental Flags]
# This section can be used to toggle experimental functionality.
# These features may be changed or removed at any time.
# Options in this section is explained afterward.
flags:
    option_one: 10
    option_two: false
    option_three: "foobar"

# [Network Configurations]
# [RPC Interface]
# Refer to relevant sections afterwards for details.

Usage

At the beginning, messages from all senders will be sent to the user directly, that means every message will be mixed in the same conversation. By linking a chat, you can redirect messages from a specific sender to an empty group for a more organized conversation.

In a nutshell, ETM offers the following commands, you can also send it to BotFather for a command list::

help - Show commands list.
link - Link a remote chat to a group.
unlink_all - Unlink all remote chats from a group.
info - Display information of the current Telegram chat.
chat - Generate a chat head.
extra - Access additional features from Slave Channels.
update_info - Update info of linked Telegram group.
react - Send a reaction to a message, or show a list of reactors.
rm - Remove a message from its remote chat.

.. note::

In case of multiple admins are assigned, they may all send message on
your behalf, but only the 0th admin can receive direct message from
the bot.

/link: Link a chat ~~~~~~~~~~~~~~~~~~~~~~

  1. Create a new group, invite your bot to the group
  2. Send /link directly to the bot, then select your preferred slave chat.
  3. Tap “Link” and select your new group. You can also choose to unlink or relink a linked chat from this menu.
  4. Tap “Start” at the bottom of your screen, and you should see a success message: “Chat linked.”

.. note::

You may introduce non-ETM admin users to the group, however, they:

-  Can read all messages send from the related remote chat;
-  May NOT send message on your behalf.

If the “Link” button doesn’t work for you, you may try the “Manual Link/Relink” button. To manually link a remote chat:

  1. Add the bot to the group you want to link to
  2. Copy the code provided by the bot, and send it to the group.
  3. If the group is linked successfully, you would receive a confirmation from the bot.

Also, you can send /unlink_all to a group to unlink all remote chats from it.

Also, if you want to link a chat which you just used, you can simply reply /link quoting a previous message from that chat without choosing from the long chat list.

Advanced feature: Filtering ^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you have just too many chats, and being too tired for keep tapping Next >, or maybe you just want to find a way to filter out what you’re looking for, now ETM has equipped /chat and /list with filtering feature. Attach your keyword behind, and you can get a filtered result.

E.g.: /chat Eana will give you all chats has the word “Eana”.

.. admonition:: Technical Details

The filter query is in fact a regular expression matching. We used
Python’s ``re.search`` with flags ``re.DOTALL | re.IGNORECASE`` in
this case, i.e.: ``.`` matches everything including line breaks, and
the query is NOT case-sensitive. Each comparison is done against a
specially crafted string which allows you to filter multiple criteria.

::

Channel: <Channel name>
Channel ID: <Channel ID>
Name: <Chat name>
Alias: (<Chat Alias>|None)
ID: <Chat Unique ID>
Type: (Private|Group|System)
Mode: [Linked]
Description: <Description>
Notification: (ALL|MENTION|NONE)
Other: <Python Dictionary String>

.. note::

Type can be either “User” or “Group”

Other is the vendor specific information provided by slave channels.
Format of such information is specified in their documentations
respectively.

Examples:

  • Look for all WeChat groups: Channel: WeChat.*Type: Group
  • Look for everyone who has no alias (and those with an alias called “None”): Alias: None
  • Look for all entries contain “John” and “Johnny” in any order: (?=.*John)(?=.*Johnny)

Send a message ~~~~~~~~~~~~~~

Send to a linked chat ^^^^^^^^^^^^^^^^^^^^^

You can send message as you do in a normal Telegram chat.

What is supported:

  • Send/forward message in all supported types
  • Quote-reply to a message
  • Send message with inline bot in supported types

What is NOT supported:

  • @ reference
  • Markdown/HTML formatting
  • Inline buttons
  • Messages with unsupported types.

.. note::

This only applies to Telegram groups that are linked to a single remote
chat, groups that are linked with multiple remote chats shall work in the
same way as non-linked chats.

Send to a non-linked chat ^^^^^^^^^^^^^^^^^^^^^^^^^

To send a message to a non-linked chat, you should “quote-reply” to a message or a “chat head” that is sent from your recipient. Those messages should appear only in the bot conversation.

In a non-linked chat, quote-reply will not be passed on to the remote channel, everything else is supported as it does in a linked chat.

Quick reply in non-linked chats ''''''''''''''''''''''''''''''' ETM provides a mechanism that allow you to keep sending messages to the same recipient without quoting every single time. ETM will store the remote chat you sent a message to in every Telegram chat (i.e. a Telegram group or the bot), which is known as the “last known recipient” of the Telegram chat.

In case where recipient is not indicated for a message, ETM will try to deliver it to the “last known recipient” in the Telegram chat only if:

  1. your last message with the “last known recipient” is with in an hour, and
  2. the last message in this Telegram chat is from the “last known recipient”.

Edit and delete message ^^^^^^^^^^^^^^^^^^^^^^^

In EFB v2, the framework added support to message editing and removal, and so does ETM. However, due to the limitation of Telegram Bot API, although you may have selected “Delete for the bot”, or “Delete for everyone” while deleting messages, the bot would not know anything about it. Therefore, if you want your message to be removed from a remote chat, edit your message and prepend it with rm``` (it’sR,M, and~```, not single quote), so that the bot knows that you want to delete the message.

Alternatively, you can also reply /rm to a message to remove it from its remote chat. This can be useful when you cannot edit the message directly (sticker, location, etc.), or when the message is not sent via ETM.

Please also notice that some slave channels may not support editing and/or deleting messages depends on their implementations.

/chat: Chat head ^^^^^^^^^^^^^^^^^^^^

If you want to send a message to a non-linked chat which has not yet sent you a message, you can ask ETM to generate a “chat head”. Chat head works similarly to an incoming message, you can reply to it to send messages to your recipient.

Send /chat to the bot, and choose a chat from the list. When you see “Reply to this message to chat with ...”, it’s ready to go.

Advanced feature: Filtering '''''''''''''''''''''''''''

Filter is also available in /chat command. Please refer to the same chapter above, under /link for details.

/extra: External commands from slave channels (“additional features”) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Some slave channels may provide commands that allows you to remotely control those accounts, and achieve extra functionality, those commands are called “additional features”. To view the list of available extra functions, send /extra to the bot, you will receive a list of commands available.

Those commands are named like “\ /<number>_<command_name>\ ”, and can be called like an CLI utility. (of course, advanced features like piping etc would not be supported)

/update_info: Update details of linked Telegram group ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ETM can help you to update the name and profile picture of a group to match with appearance in the remote chat. This will also add a list of current members to the Telegram group description if the remote chat is a group.

This functionality is available when:

  • This command is sent to a group
  • The bot is an admin of the group
  • The group is linked to exactly one remote chat
  • The remote chat is accessible

Profile picture will not be set if it’s not available from the slave channel.

/react: Send reactions to a message or show a list of reactors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply /react to a message to show a list of chat members who have reacted to the message and what their reactions are.

Reply /react followed by an emoji to react to this message, e.g. /react 👍. Send /react - to remove your reaction.

Note that some slave channels may not accept message reactions, and some channels have a limited reactions you can send with. Usually when you send an unaccepted reaction, slave channels can provide a list of suggested reactions you may want to try instead.

/rm: Delete a message from its remote chat ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can reply /rm to a message to remove it from its remote chat. Comparing to prepending ``rm``` to a message, you can use this command even when you cannot edit the message directly (sticker, location, etc.), or when the message is not sent via ETM. It can also allow you to remove messages sent by others if provided by the slave channel.

Please notice that some slave channels may not support removing messages depends on their implementations.

Telegram Channel support ~~~~~~~~~~~~~~~~~~~~~~~~

ETM supports linking remote chats to Telegram Channels with partial support.

The bot can:

  • Link one or more remote chats to a Telegram Channel
  • Check and manage link status of the channel
  • Update channel title and profile pictures accordingly

It cannot:

  • Process messages sent by you or others to the channel
  • Accept commands in the channel

Currently the following commands are supported in channels:

  • /start for manual chat linking
  • /link to manage chats linked to the channel
  • /info to show information of the channel
  • /update_info to update the channel title and picture

How to use:

  1. Add the bot as an administrator of the channel
  2. Send commands to the channel
  3. Forward the command message to the bot privately

.. admonition:: Technical Details

Telegram Bot API prevents bot from knowing who actually sent a message
in a channel (not including signatures as that doesn't reflect the numeric
ID of the sender). In fact, that is the same for normal users in a channel
too, even admins.

If messages from channels are to be processed unconditionally, not only
that other admins in existing channels can add malicious admins to it,
anyone on Telegram, once knows your bot username, can add it to a channel
and use the bot on your behalf. Thus, we think that it is not safe to
process messages directly from a channel.

Limitations

Due to the technical constraints of both Telegram Bot API and EH Forwarder Bot framework, ETM has the following limitations:

  • Some Telegram message types are not supported:
    • Game messages
    • Invoice messages
    • Payment messages
    • Passport messages
    • Vote messages
  • ETM cannot process any message from another Telegram bot.
  • Some components in Telegram messages are dropped:
    • Original author and signature of forwarded messages
    • Formats, links and link previews
    • Buttons attached to messages
    • Details about inline bot used on messages
  • Some components in messages from slave channels are dropped:
    • @ references not referring to you.
  • The Telegram bot can only
    • send you any file up to 50 MB,
    • receive file from you up to 20 MB.

Experimental flags

The following flags are experimental features, may change, break, or disappear at any time. Use at your own risk.

Flags can be enabled in the flags key of the configuration file, e.g.:

.. code:: yaml

flags:
    flag_name: flag_value
  • chats_per_page (int) [Default: 10]

Number of chats shown in when choosing for /chat and /link command. An overly large value may lead to malfunction of such commands.

  • network_error_prompt_interval (int) [Default: 100]

Notify the user about network error every n errors received. Set to 0 to disable it.

  • multiple_slave_chats (bool) [Default: true]

Link more than one remote chat to one Telegram group. Send and reply as you do with an unlinked chat. Disable to link remote chats and Telegram group one-to-one.

  • prevent_message_removal (bool) [Default: true]

When a slave channel requires to remove a message, EFB will ignore the request if this value is true.

  • auto_locale (str) [Default: true]

Detect the locale from admins’ messages automatically. Locale defined in environment variables will be used otherwise.

  • retry_on_error (bool) [Default: false]

    Retry infinitely when an error occurred while sending request to Telegram Bot API. Note that this may lead to repetitive message delivery, as the respond of Telegram Bot API is not reliable, and may not reflect the actual result.

  • send_image_as_file (bool) [Default: false]

    Send all image messages as files, in order to prevent Telegram’s image compression in an aggressive way.

  • message_muted_on_slave (str) [Default: normal]

    Behavior when a message received is muted on slave channel platform.

    • normal: send to Telegram as normal message
    • silent: send to Telegram as normal message, but without notification sound
    • mute: do not send to Telegram
  • your_message_on_slave (str) [Default: silent]

    Behavior when a message received is from you on slave channel platform. This overrides settings from message_muted_on_slave.

    • normal: send to Telegram as normal message
    • silent: send to Telegram as normal message, but without notification sound
    • mute: do not send to Telegram
  • animated_stickers (bool) [Default: false]

    Enable experimental support to animated stickers. Note: you need to install binary dependency libcairo on your own, and additional Python dependencies via pip3 install "efb-telegram-master[tgs]" to enable this feature.

  • send_to_last_chat (str) [Default: warn]

    Enable quick reply in non-linked chats.

    • enabled: Enable this feature without warning.
    • warn: Enable this feature and issue warnings every time when you switch a recipient with quick reply.
    • disabled: Disable this feature.
  • default_media_prompt (str) [Default: emoji]

    Placeholder text when the a picture/video/file message has no caption.

    • emoji: Use emoji like 🖼️, 🎥, and 📄.
    • text: Use text like “Sent a picture/video/file”.
    • disabled: Use empty placeholders.
  • api_base_url (str) [Default: null]

    Base URL of the Telegram Bot API. Defaulted to https://api.telegram.org/bot.

  • api_base_file_url (str) [Default: null]

    Base file URL of the Telegram Bot API. Defaulted to https://api.telegram.org/file/bot.

  • local_tdlib_api (bool) [Default: false]

    Enable this option if the bot API is running in --local mode and is using the same file system with ETM.

Network configuration: timeout tweaks

This chapter is adapted from Python Telegram Bot wiki__, licensed under CC-BY 3.0.

__ https://github.com/python-telegram-bot/python-telegram-bot/wiki/Handling-network-errors#tweaking-ptb

python-telegram-bot performs HTTPS requests using urllib3. urllib3 provides control over connect_timeout & read_timeout. urllib3 does not separate between what would be considered read & write timeout, so read_timeout serves for both. The defaults chosen for each of these parameters is 5 seconds.

The connect_timeout value controls the timeout for establishing a connection to the Telegram server(s).

Changing the defaults of read_timeout & connect_timeout can be done by adjusting values request_kwargs section in ETM’s config.yaml.

.. code:: yaml

# ... request_kwargs: read_timeout: 6 connect_timeout: 7

Run ETM behind a proxy

This chapter is adapted from Python Telegram Bot wiki__, licensed under CC-BY 3.0.

__ https://github.com/python-telegram-bot/python-telegram-bot/wiki/Working-Behind-a-Proxy

You can appoint proxy specifically for ETM without affecting other channels running in together in the same EFB instance. This can also be done by adjusting values request_kwargs section in ETM’s config.yaml.

HTTP proxy server ~~~~~~~~~~~~~~~~~

.. code:: yaml

request_kwargs: # ... proxy_url: http://PROXY_HOST:PROXY_PORT/ # Optional, if you need authentication: username: PROXY_USER password: PROXY_PASS

SOCKS5 proxy server ~~~~~~~~~~~~~~~~~~~

This is configuration is supported, but requires an optional/extra python package. To install:

.. code:: shell

pip install python-telegram-bot[socks]

.. code:: yaml

request_kwargs: # ... proxy_url: socks5://URL_OF_THE_PROXY_SERVER:PROXY_PORT # Optional, if you need authentication: urllib3_proxy_kwargs: username: PROXY_USER password: PROXY_PASS

RPC interface

A standard Python XML RPC server__ is implemented in ETM 2. It can be enabled by adding a rpc section in ETM’s config.yml file.

__ https://docs.python.org/3/library/xmlrpc.html

.. code:: yaml

rpc: server: 127.0.0.1 port: 8000

..

.. warning:: The xmlrpc module is not secure against maliciously constructed data. Do not expose the interface to untrusted parties or the public internet, and turn off after use.

Exposed functions ~~~~~~~~~~~~~~~~~

Functions in the db (database manager) class and the RPCUtilities class are exposed. Refer to the source code for their documentations.

How to use ~~~~~~~~~~

Set up a SimpleXMLRPCClient in any Python script and call any of the exposed functions directly. For details, please consult Python documentation on xmlrpc__.

__ https://docs.python.org/3/library/xmlrpc.html

.. _the db (database manager) class: https://etm.1a23.studio/blob/master/efb_telegram_master/db.py .. _the RPCUtilities class: https://etm.1a23.studio/blob/master/efb_telegram_master/rpc_utilities.py

Setup Webhook

For details on how to setup a webhook, please visit this wiki article_.

.. _wiki article: https://github.com/ehForwarderBot/efb-telegram-master/wiki/Setup-Webhook

License

ETM is licensed under GNU Affero General Public License 3.0_ or later versions::

EFB Telegram Master Channel: A master channel for EH Forwarder Bot.
Copyright (C) 2016 - 2020 Eana Hufwe, and the EFB Telegram Master Channel contributors
All rights reserved.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

.. _GNU Affero General Public License 3.0: https://www.gnu.org/licenses/agpl-3.0.txt

Translation support

ETM supports translated user interface with the help of community. The bot detects languages of Telegram Client of the admins from their messages, and automatically matches with a supported language on the go. Otherwise, you can set your language by turning off the auto_locale feature, and then setting the locale environmental variable (LANGUAGE, LC_ALL, LC_MESSAGES or LANG) to one of our supported languages. Meanwhile, you can help to translate this project into your languages on our Crowdin page_.

.. _our Crowdin page: https://crowdin.com/project/ehforwarderbot/

.. note::

If your are installing from source code, you will not get translations
of the user interface without manual compile of message catalogs (``.mo``)
prior to installation.

Issues

[BUG] Using telegram bot local server can't send / receive Files

opened on 2023-03-03 07:33:37 by kettly1260

Describe the bug
Using telegram bot local server can't send / receive Files

To Reproduce
Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error

Expected behavior
When I change the telegram api to the local server,the bot can received the text,but when I sent the pictures or any files, the bot prompts that
"Unknown error has occurred while trying to process this message. See log for details.

InvalidToken() " 。

When I received files, nothing prompted and couldn't receive them

Screenshots
If applicable, add screenshots to help explain your problem.

Version information (please complete the following information):
- OS: [e.g. iOS] - Detailed Python, EFB and module versions: (you can obtain this by running ehforwarderbot --version)

``` EH Forwarder Bot Version: 2.1.1 Python version: 3.8

Master channel: EFB Telegram Master Channel 2.3.1

Slave channel: WeChat Slave (blueset.wechat, 2.0.6.dev10)

Middleware: - MP InstantView Middleware (catbaron.mp_instantview, 0.3.1) - Search Message Middleware (catbaron.search_msg, 0.1.0) ```

Additional context
elete_chat_photo': False, 'channel_chat_created': False, 'caption_entities': [], 'from': {'id': xxxxx, 'is_bot': False, 'first_name': 'xxxx', 'language_code': 'zh-hans'}}, 'update_id': xxxxx}. Traceback (most recent call last): File "/home/ubuntu/.local/lib/python3.8/site-packages/efb_telegram_master/master_message.py", line 103, in message_worker self.msg(update, context) File "/home/ubuntu/.local/lib/python3.8/site-packages/efb_telegram_master/master_message.py", line 207, in msg return self.process_telegram_message(update, context, destination, quote=quote, edited=edited) File "/home/ubuntu/.local/lib/python3.8/site-packages/efb_telegram_master/master_message.py", line 426, in process_telegram_message if m.file: File "/home/ubuntu/.local/lib/python3.8/site-packages/efb_telegram_master/message.py", line 130, in get_file self._load_file() File "/home/ubuntu/.local/lib/python3.8/site-packages/efb_telegram_master/message.py", line 77, in _load_file file_meta.download(out=file) File "/home/ubuntu/.local/lib/python3.8/site-packages/telegram/files/file.py", line 148, in download buf = self.bot.request.retrieve(url) File "/home/ubuntu/.local/lib/python3.8/site-packages/telegram/utils/request.py", line 385, in retrieve return self._request_wrapper('GET', url, **urlopen_kwargs) File "/home/ubuntu/.local/lib/python3.8/site-packages/telegram/utils/request.py", line 281, in _request_wrapper raise InvalidToken() telegram.error.InvalidToken: Invalid token

[FR] Resent the incoming photo as a file

opened on 2023-02-11 19:16:52 by QieSen

When the flag send_image_as_file is false, users reply to an incoming photo message with /resent command, ETM will reply to the selected message (Easy to trace back), then resent that photo as a file to the session. Or return an error if the message id got invalid due to EWS session refresh.

When the flag is true, ETM should ignore the /resent command, or return a error.

当ETM属性 send_image_as_file 为false时响应 /resent 指令,用户发送指令回复一条bot转发的图片消息,ETM会引用该消息(方便回溯定位)并将该图片以文件形式重新发到会话中。若EWS会话刷新导致该消息id失效则返回报错。 若上述ETM属性为true则不响应 /resent 命令或返回错误。

build(deps): update python-telegram-bot requirement from ~=13.11 to >=13.11,<21.0

opened on 2023-01-02 14:01:35 by dependabot[bot]

Updates the requirements on python-telegram-bot to permit the latest version.

Release notes

Sourced from python-telegram-bot's releases.

v20.0

Version 20.0

Released 2023-01-01

This is the technical changelog for version 20.0. More elaborate release notes can be found in the news channel @​pythontelegrambotchannel.

Major Changes

  • Full Support For Bot API 6.4 (#3449)

Minor Changes, Documentation Improvements and CI

  • Documentation Improvements (#3428, #3423, #3429, #3441, #3404, #3443)
  • Allow Sequence Input for Bot Methods (#3412)
  • Update Link-Check CI and Replace a Dead Link (#3456)
  • Freeze Classes Without Arguments (#3453)
  • Add New Constants (#3444)
  • Override Bot.__deepcopy__ to Raise TypeError (#3446)
  • Add Log Decorator to Bot.get_webhook_info (#3442)
  • Add Documentation On Verifying Releases (#3436)
  • Drop Undocumented Job.__lt__ (#3432)

Dependencies

  • Downgrade sphinx to 5.3.0 to Fix Search (#3457)
  • Bump sphinx from 5.3.0 to 6.0.0 (#3450)
Changelog

Sourced from python-telegram-bot's changelog.

Version 20.0

Released 2023-01-01

This is the technical changelog for version 20.0. More elaborate release notes can be found in the news channel @pythontelegrambotchannel <https://t.me/pythontelegrambotchannel>_.

Major Changes

  • Full Support For Bot API 6.4 ([#3449](https://github.com/python-telegram-bot/python-telegram-bot/issues/3449)_)

Minor Changes, Documentation Improvements and CI

  • Documentation Improvements ([#3428](https://github.com/python-telegram-bot/python-telegram-bot/issues/3428), [#3423](https://github.com/python-telegram-bot/python-telegram-bot/issues/3423), [#3429](https://github.com/python-telegram-bot/python-telegram-bot/issues/3429), [#3441](https://github.com/python-telegram-bot/python-telegram-bot/issues/3441), [#3404](https://github.com/python-telegram-bot/python-telegram-bot/issues/3404), [#3443](https://github.com/python-telegram-bot/python-telegram-bot/issues/3443))
  • Allow Sequence Input for Bot Methods ([#3412](https://github.com/python-telegram-bot/python-telegram-bot/issues/3412)_)
  • Update Link-Check CI and Replace a Dead Link ([#3456](https://github.com/python-telegram-bot/python-telegram-bot/issues/3456)_)
  • Freeze Classes Without Arguments ([#3453](https://github.com/python-telegram-bot/python-telegram-bot/issues/3453)_)
  • Add New Constants ([#3444](https://github.com/python-telegram-bot/python-telegram-bot/issues/3444)_)
  • Override Bot.__deepcopy__ to Raise TypeError ([#3446](https://github.com/python-telegram-bot/python-telegram-bot/issues/3446)_)
  • Add Log Decorator to Bot.get_webhook_info ([#3442](https://github.com/python-telegram-bot/python-telegram-bot/issues/3442)_)
  • Add Documentation On Verifying Releases ([#3436](https://github.com/python-telegram-bot/python-telegram-bot/issues/3436)_)
  • Drop Undocumented Job.__lt__ ([#3432](https://github.com/python-telegram-bot/python-telegram-bot/issues/3432)_)

Dependencies

  • Downgrade sphinx to 5.3.0 to Fix Search ([#3457](https://github.com/python-telegram-bot/python-telegram-bot/issues/3457)_)
  • Bump sphinx from 5.3.0 to 6.0.0 ([#3450](https://github.com/python-telegram-bot/python-telegram-bot/issues/3450)_)

.. _[#3449](https://github.com/python-telegram-bot/python-telegram-bot/issues/3449): python-telegram-bot/python-telegram-bot#3449 .. _[#3428](https://github.com/python-telegram-bot/python-telegram-bot/issues/3428): python-telegram-bot/python-telegram-bot#3428 .. _[#3423](https://github.com/python-telegram-bot/python-telegram-bot/issues/3423): python-telegram-bot/python-telegram-bot#3423 .. _[#3429](https://github.com/python-telegram-bot/python-telegram-bot/issues/3429): python-telegram-bot/python-telegram-bot#3429 .. _[#3441](https://github.com/python-telegram-bot/python-telegram-bot/issues/3441): python-telegram-bot/python-telegram-bot#3441 .. _[#3404](https://github.com/python-telegram-bot/python-telegram-bot/issues/3404): python-telegram-bot/python-telegram-bot#3404 .. _[#3443](https://github.com/python-telegram-bot/python-telegram-bot/issues/3443): python-telegram-bot/python-telegram-bot#3443 .. _[#3412](https://github.com/python-telegram-bot/python-telegram-bot/issues/3412): python-telegram-bot/python-telegram-bot#3412 .. _[#3456](https://github.com/python-telegram-bot/python-telegram-bot/issues/3456): python-telegram-bot/python-telegram-bot#3456 .. _[#3453](https://github.com/python-telegram-bot/python-telegram-bot/issues/3453): python-telegram-bot/python-telegram-bot#3453 .. _[#3444](https://github.com/python-telegram-bot/python-telegram-bot/issues/3444): python-telegram-bot/python-telegram-bot#3444 .. _[#3446](https://github.com/python-telegram-bot/python-telegram-bot/issues/3446): python-telegram-bot/python-telegram-bot#3446 .. _[#3442](https://github.com/python-telegram-bot/python-telegram-bot/issues/3442): python-telegram-bot/python-telegram-bot#3442 .. _[#3436](https://github.com/python-telegram-bot/python-telegram-bot/issues/3436): python-telegram-bot/python-telegram-bot#3436 .. _[#3432](https://github.com/python-telegram-bot/python-telegram-bot/issues/3432): python-telegram-bot/python-telegram-bot#3432 .. _[#3457](https://github.com/python-telegram-bot/python-telegram-bot/issues/3457): python-telegram-bot/python-telegram-bot#3457 .. _[#3450](https://github.com/python-telegram-bot/python-telegram-bot/issues/3450): python-telegram-bot/python-telegram-bot#3450

Version 20.0b0

... (truncated)

Commits


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

2 bugs

opened on 2022-12-05 04:37:49 by YouXam

fix bug: extra command attributes

Extra command did not have name and desc attributes.

image

fix bug: video cannot be received

We don't seem to need either file or path to exist at the same time. In fact, some slaves have only one attribute, file.

[FR] automatic group creating feature

opened on 2022-08-26 23:48:45 by QQ-War

Currently, for each contact or group in slave channel, we need to create new group and use /link command to link out. I am thinking of some ways to make it automaticly. I find Pyrogram has this kind of interface and we can make use of it. The idea is like to at least to change 3 parts in the code:

  1. configuration part and class init, need to use a parameter to enable this feature or not. if enable, need to provide api id and api hash, then initiate the client.
  2. message send out part, need to add some mechanism to check if this chat has already link to a group, othewise will use the interface provided by pyrogram to create one and make the link, then update_info of that group.
  3. database part, currently allow 1 group to link more than 1 slave group. maybe need to change 1 to 1. otherwise, I have not think of an idea how to do it.

There are some other issues may need to consider, but to realize it will make life happy. I am trying to read the code of this project, and maybe I will offer some help to submit on PR later. but what will others think of it?

Wipe description on Telegram when a linked chat does not have a description/member list

opened on 2022-06-09 03:07:16 by MatrixLau

Env

``` 您正在使用 EFB Telegram 主端 2.3.1,运行于默认配置档案与实例、EFB 版本 2.1.1。 已激活 1 个从端: - 💬 WeChat Slave (blueset.wechat, 2.0.7)

已启用 7 个中间件: - Filter Middleware (filter.FilterMiddleware, 1.1.1) - Search Message Middleware (catbaron.search_msg, 0.1.0) - Patch Middleware (patch.PatchMiddleware, 2.0.19) - KeywordMention Middleware (keywordmention.MatrixLauMiddlware, 2.1.0) - Solitaire Middleware (solitaire.MatrixLauMiddleware, 1.3.0) - MP InstantView Middleware (catbaron.mp_instantview, 0.3.2) - Voice Recognition Middleware (catbaron.voice_recog, 1.0.3) ```

Problem

Only chat related to a group that /update_info will update the info of chat in Telegram

If so when I related a private to a chat that once related to a group, the chat info in Telegram will be STILL the member list of the group

Solution/Thoughts

Maybe if related to a private will erase the info of the chat in Telegram or set the info into the details of this private?

Sent from PPHub

Releases

2.3.0 2022-05-24 19:38:30

2.3.0 - 2022-05-24

Added

  • Support for custom Telegram API endpoints and local Tglib Bot API client mode. (#116)
  • Add support to video stickers. (#120)

Fixed

  • Attempt to fix “Database is Locked” issue. (#110 by @whtsky)
  • Telegram GIF image processing may trigger an early download.
  • Preserve filenames from Telegram for music files. (#117)
  • Redundant error message when trying to send unsupported media.
  • Remove bot.set_webhook calls. (#113 by @JamzumSum)

2.2.4 2021-05-22 23:15:25

2.2.4 - 2021-05-22

Changed

  • Updated to follow python-telegram-bot 13.4 API changes

Fixed

  • Fix issue where edited messages in non-singly-linked channels are mistakenly attached with quoted messages.
  • Allow cases when flags in config file is set to null
  • Incomplete chat link migration upon conversion to supergroup

2.2.3 2021-02-12 19:02:26

2.2.3 - 2021-02-12

Changed

  • Updated type hints to follow new python-telegram-bot (PTB) changes.
  • Locked PTB version to 13.x for their upcoming migration to async.

Fixed

  • Update message and caption format serialization from markdown to markdown_v2.
  • Fixed yet another typo causing wizard to crash

2.2.2 2020-12-04 14:50:27

2.2.2 - 2020-12-04

Fixed

  • Following the latest Bullet API change which caused setup wizard to crash

2.2.1 2020-11-22 16:48:00

2.2.1 - 2020-11-23

Fixed

  • Delivery failure when captions of messages from slave channel are too long
  • Exception thrown when executing a command in a command message

2.2.0 2020-08-25 08:16:43

Added

  • Experimental flag default_media_prompt to modify placeholder text of media messages with no caption. (#104)

Changed

  • Moved lottie and cairosvg to optional dependencies to avoid unnecessary hurdle on new installations.
EH Forwarder Bot

An extensible message tunneling chat bot framework.

GitHub Repository

eh-forwarder-bot efb-master-channel telegram telegram-bot