LuisMayo / ace-attorney-telegram-bot

Telegram bot that turns comment chains into ace attorney scenes. Inspired by and using https://github.com/micah5/ace-attorney-reddit-bot
MIT License
70 stars 9 forks source link

Rewrite the bot in telethon? #10

Closed cofob closed 3 years ago

cofob commented 3 years ago

This will speed up the bot, besides, the library is asynchronous. I can do this

LuisMayo commented 3 years ago

Hi! Thanks for the issue

I think the current implementation is currently multithreaded too? Like in it processes several videos at the same time? I'm not really sure.

Could you give me more info in what improvements could telethon provide?

Thanks!

cofob commented 3 years ago

This is an asynchronous library for Telegram, which implements MTProto (Own Telegram Protocol), which is faster and safer than HTTPs (which is used in python-telegram-bot).

LuisMayo commented 3 years ago

Hi! I've read a bit and it certainly connects by MTProto instead of using the HTTP Bot API.

However:

  1. The current implementation is already async in nature due to how the code works. You can try it yourself, start rendering a video and then issue an /about command. You can see that it doesn't get blocked while waiting for the video and it instead answers right away. If this isn't what you meant by "async" please try to explain it one more time
  2. While it is certain that text-based protocols (like HTTP Rest bot API) carry more overheard than other kind of protocols (like MTProto), I think the cost is negligible in this case. This is a bot that literally renders and sends video files, the text-based part of the conversation may not be the one that's consuming the more time.

I don't have any special interest on using either python-telegram-bot nor telethon. I am however, struggling to understand what benefits would the switch make for such a big re-work.

Thanks again for your issue!