-
Notifications
You must be signed in to change notification settings - Fork 6k
Add webappbot example #3052
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
Add webappbot example #3052
Conversation
harshil21
left a comment
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.
nice! The website isn't exactly mobile friendly though, you have to pull up and make it 'expanded' to see the rest of the interface, which we could do without.
Good point. I could either reduce the padding around the color picker or have the app automatically expanded via Telegram.WebApp.expand(). Which do you prefer? |
|
@Bibo-Joshi Reducing padding would be nice, that does seem a bit too much too |
|
I tried around for quite a while to get the container to adjust to the screen size or at least just be smaller, but I failed :/ So I just made the webapp window expand … This can ofc always be fine tuned later on (or someone who is more fluent with CSS steps up) |
harshil21
left a comment
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.
Okay. will need backport to v13 after merge
|
Also works fine with the static file hosted at ptb.org/statis/webappbot. merging. |
|
Is this example working? I'm trying to run it but I recieve an error "AttributeError: type object 'ContextTypes' has no attribute 'DEFAULT_TYPE'". In fact, python does not recognize "from telegram import version_info" and I had to delete the check for version type. In any case, I have a doubt about that version. In the python file it says it needs "20, 0, 0, "alpha", 1". However, the last pre version avalaible in pip install is 20.0a0. The branch for webapi does not exist neither... |
|
If you dont delete the try except, it should/would have told you that the installed PTB version does in fact not correspond with the one you need to run the example. That one isn't released yet, so you can either install the latest "version" of this library from master or you take care of the errors (I think it is CallbackContext instead of ContextTypes). |
|
Ok, thank you. I changed to CallbackContext and removed the DEFAULT_TYPE. It's working. |
Static html page should ofc be included in the ptb homepage once this is merged.