-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Telegram Namespace Conflict #207
Comments
Thank you for the feedback! Yes, there were several issues with that. Choosing |
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. |
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! |
Another approach to avoid namespace conflicts between Install the library in a local directory pip3 install python-telegram -t lib Modify your code to include the local directory in the Python path: import os
import sys
# Add the local 'lib' directory to the Python path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "lib"))
# Now you can import from the local 'telegram' library
from telegram.client import Telegram |
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
The text was updated successfully, but these errors were encountered: