-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Extend Customization Support for Bot.base_(file_)url
#4632
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
Conversation
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Hi @Bibo-Joshi Im not sure how I should use it. I see that the latest merge is Verified and pass so It should work.
But Im obtaining the error InvalidToken rejected by server (I double checked the token with botfather) Thanks for your work EDIT: I found Bot and tried in this way:
But didn't work, get the same error. I also tried installing the test-env branch: |
Hi.
That only means that the changes work in the proposed branch. It does not mean that it works on PTB versions that you can install from pypi. Since the PR is not yet merged, the changes are not yet in the master branch and especially not in any release available on pypi.
This is what you have to do if you want to use the changes from this PR, correct.
The exact token must not be a part of the base url. You should pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks pretty good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @Bibo-Joshi, I did update the code using:
But im getting this error:
What can I do? |
Please show the full traceback |
2025-01-23 17:37:39,494 - httpx - INFO - HTTP Request: POST https://api.telegram.org/bot%7Btoken%7D/test2200136402:AAEiAa2zcJD5S4-dwTcZZP9-l1zWBy1GY3w/getMe "HTTP/1.1 404 Not Found" The above exception was the direct cause of the following exception: Traceback (most recent call last): |
It looks like you've installed PTB from the Python package index (pipy.org). This PR is not contained in any release yet that's available there. This PR has been merged into the master branch which means that it will be part of the next release. |
Oh ok, so I’m gonna install it from the main branch then. |
no, we don't give ETAS. |
Closes #3355
Given the spiked request for #3355 (see the graphic that I attached yesterday), I decided to go ahead and PR for this.
I decided agains the
test_env
flag and for customizingbase_(file_)url
because I think this will be easier to maintain.For this, I implemented support for the following options:
PS: I confirmed that the file url is
https://api.telegram.org/file/bot<token>/test/…
though with this approach PTB doesn't hard-code that.