alexander-akhmetov / python-telegram

Python client for the Telegram's tdlib
MIT License
594 stars 121 forks source link

Telegram Namespace Conflict #207

Open minusmagis opened 2 years ago

minusmagis commented 2 years ago

Hi Alexander,

First of all I would like to thank you and contgratulate you for your work, it works wondefully.

However I have encountered a major issue when trying to use your library alongside the python-telegram-bot library, since you use the same namespace, i.e 'telegram'.

A workaround I have found is to simply change the namespace of your library to a diferent name (telegram_simple) to prevent such incompatibilities, and it seems to work (see my modified code here).

I basically cloned your repo and modified all the necessary imports and folders from telegram to telegram_simple and it seems to work nicely.

I leave you with the code so that, if you want, you make this change to improve compatibility, since I've seen some issues #195 #120 #110 which seem to have trouble with this rather broad 'telegram' name and maybe something a little bit more specific would cause less confusion.

Thanks again for the nice work

Best

minus

alexander-akhmetov commented 2 years ago

Thank you for the feedback! Yes, there were several issues with that. Choosing telegram probably wasn't the best decision. But changing the namespace might break some external code. I'll leave this issue open, we might need some transitioning period if/when this change is implemented.

Nikita2305 commented 1 year ago

Had some problems with modified code above, so created new version as a fork. Thank you for non-blocking feature. I've no idea why this is so dumb in current well-known libraries.

UPD: also I've implemented there method add_any_update_handler to handle any type of update.

selankon commented 7 months ago

Hey!

Same problem here, if the @Nikita2305 is working properly, why don't create a PR? I can help testing

On production systems will be better if we can install the updated package from pip :)

Thanks to both!