Skip to content

Conversation

@Bibo-Joshi
Copy link
Member

Static html page should ofc be included in the ptb homepage once this is merged.

@Bibo-Joshi Bibo-Joshi added the ⚙️ examples affected functionality: examples label May 19, 2022
Copy link
Member

@harshil21 harshil21 left a 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.

@Bibo-Joshi
Copy link
Member Author

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?

Copy link
Member

@Bibo-Joshi Reducing padding would be nice, that does seem a bit too much too

@Bibo-Joshi
Copy link
Member Author

Bibo-Joshi commented May 19, 2022

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)

Copy link
Member

@harshil21 harshil21 left a 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

@Bibo-Joshi
Copy link
Member Author

Also works fine with the static file hosted at ptb.org/statis/webappbot. merging.

@Bibo-Joshi Bibo-Joshi merged commit e10d933 into master May 19, 2022
@Bibo-Joshi Bibo-Joshi deleted the webappbot branch May 19, 2022 20:14
@Bibo-Joshi Bibo-Joshi mentioned this pull request May 19, 2022
@Scolymus
Copy link

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...

@Poolitzer
Copy link
Member

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).

@Scolymus
Copy link

Ok, thank you. I changed to CallbackContext and removed the DEFAULT_TYPE. It's working.

@github-actions github-actions bot locked and limited conversation to collaborators May 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

⚙️ examples affected functionality: examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants