grammyjs / grammY

The Telegram Bot Framework.
https://grammy.dev
MIT License
2.04k stars 106 forks source link

Bot not full width on mobile #593

Closed jrmcdona closed 2 weeks ago

jrmcdona commented 1 month ago

The bot I ceated looks good on desktop but on mobile it only taking half the screen on my iPhone and the sentences are wrapping. What am I missing to make full width mobile?

I have a photo, HTML text and 6 buttons.

KnorpelSenf commented 1 month ago

There's no way to affect how different clients perform their layouting. Either change the structure of your message, which will change the layout on all clients including desktop, or accept that iOS doesn't layout it the way you want.

jrmcdona commented 1 month ago

Any suggestion on changing the message structure?

I have HTML parse mode. I am not word wrapping in VS Code. The bot is wrapping the text on it's own. I don't think you can set any no wrap or width command.

KnorpelSenf commented 1 month ago

A bot is not a website. Messages are not HTML—they are simple strings. Clients render them however they like, you cannot affect this beyond making parts of the string bold, italics, and so on.

If you want to add more newlines, put \n in your text.

You can also rearrange the buttons. For example, you can put them all in one column or use three columns.

KnorpelSenf commented 2 weeks ago

Closing due to inactivity.