jimchen5209 / pill_posting

GNU Affero General Public License v3.0
6 stars 3 forks source link

Consider migrating to MTProto based bot library in 2.1? #3

Open blueset opened 4 years ago

blueset commented 4 years ago

It seems like the library used in the current 2.0 branch is telepot, which is not maintained for over 2 about 2 years. As it seems like you are switching to another library in 2.1, I would like to suggest you to switch to a MTProto based library for @Pill_Postring. (Yes, you can use MTProto based libraries on bots too.)

The 2 main reasons I’d like to suggest this is:

  1. MTProto can maintain a relatively more stable connection, and introduce less overhead.
  2. MTProto supports forwarding album messages which could be a big plus.

There are currently 2 major libraries for this purpose that is under well maintenance: Pyrogram and Telethon. There isn’t much of a different upon my initial inspection. Depending on your plan, Pyrogram is by default synchronous with an asynchronous variant available, while Telethon is completely based on asyncio. I am currently using Telethon on my Telegram bot integration test suite, and it works pretty well so far.

Hope this helps.

jimchen5209 commented 4 years ago

🤔Good idea I'll put it into my consideration

jimchen5209 commented 4 years ago

BTW is there any risks for using this kind of API for bot? I've tried telethon with its example and it has a really fast response, so I'm kind of afraid.

blueset commented 4 years ago

I’d rather say that is safe to use. Running bots on MTProto has been done since years ago when that option has been discovered from the badly documented (or rather almost no document at all) MTProto schema.

With the amount of documentations from Telegram themselves, I cannot quote from an official source that it is absolutely safe to do that, but seeing that various popular MTProto libraries (Pyrogram, Telethon, MadelineProto, etc.) are promoting that they can be used on bots, and the fact that I have seen no cases where a bot is banned by doing so, I would say that it is safe to use MTProto on bots.