Open QQ-War opened 2 years ago
Thank you for the suggestion. Automatically creating a Telegram group while trying to link a slave chat is definitely a great feature to have. However, Telegram does not allow a bot to create groups, no matter if it is using the HTTP interface (via python-telegram-bot
) or using MTProto (via Pyrogram, Telethon, etc.). Group creation is only possible for normal users that registered with a phone number.
The only way to incorporate such feature, without any privacy concern, would be to ask the user to setup a “user bot” using their own phone number. Including such feature into ETM would require:
Thread
s. Including an MTProto library – either Telethon or Pyrogram – would need the bot to be running in Python’s native async.If you feel this is doable, feel free to send in your PRs. I’m glad to answer any question you might have in mind.
Thanks very much . One friend already prepared one version of code, and test running well , except there are 2 issues, we are not very clear how to solve. the address is: https://github.com/QQ-War/efb-telegram-master?organization=QQ-War&organization=QQ-War
issue 1: (solved)
after automatic new created one telegram group, the first message send to this slave group, still will be send by the wechat bot, not inside that group, it is very strange. the code position is below:
https://github.com/QQ-War/efb-telegram-master/blob/21cc99146fa07ae3c1f808268e762c11edcb522c/efb_telegram_master/slave_message.py#L247
issue 2: to update the group name and group image, better to use update_group_info in ChatBindingManager class, but we are not quite clear how to pass the parameters update and context. so we use the pyrogram itself and create some method. it is not graceful and not very efficient, since sometimes it fails. the code position is below, if possible, better change this function to the same position of issue 1. https://github.com/QQ-War/efb-telegram-master/blob/21cc99146fa07ae3c1f808268e762c11edcb522c/efb_telegram_master/auto_tg_manager.py#L90
could you help to check? Thanks.
@QQ-War Thank you for your development. I want to feed back two bugs
For issue 2, if you already have a user bot, it might be easier to just issue an /update_info
command to EFB through the user. Alternatively, you can consider constructing an Update
object mimicking an /update_info
message sent to the bot. It is technically possible since these objects are constructed from plain JSON objects, but it might require more effort than simply sending a message.
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:
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?