I am writing a bot telegram in C #, using the Telegram.Bot library. When there is a lot of text on the Callback button, it does not fit on it and the telegrams automatically appends "...".

Is there a way to resize a button so that all the text fits on it or to make the text automatically scroll over the button?

if(ev.CallbackQuery.Data == "callback1") { var keyboard = new Telegram.Bot.Types.ReplyMarkups.InlineKeyboardMarkup( new Telegram.Bot.Types.InlineKeyboardButton[][] { new [] { // First column new Telegram.Bot.Types.InlineKeyboardButton("Button text","callback2"), }, new [] { new Telegram.Bot.Types.InlineKeyboardButton( "Thi is exampl. example example example.A lot of text that does not fit on the button","callback3"), }, } ); await Bot.SendTextMessageAsync(message.Chat.Id, "Message text", false, false, 0, keyboard, Telegram.Bot.Types.Enums.ParseMode.Default); } 

Here's what it looks like:

Here's what it looks like.

    1 answer 1

    No, in the current version of bot api, line wrapping and etc. are not implemented. Yes, it is logical from the point of view of UX / UI - what will the different-sized buttons look like or what will the user try to scroll through the text in the button on a 4 inch screen? Just flour for the esthete and perfectionist. Bot api cannot serve as an absolute replacement for mobile applications for obvious reasons - the possibilities are not those.


    There is a way out, more precisely - there are even two of them:

    1. Use concise labels, test on different devices.
    What is not suitable for 5 inches is great for the desktop and vice versa

    2. If the inscription is impossible to fit into the required size - use explanatory messages.
    You can precede the message with an explanatory message, with the same inline button, which, in turn, due to the fact that the explanation was already there, the inscription can be displayed in a simplified way. For example - an explanatory message - Предлагаем Вам выбрать грибы. К съедобным грибам относятся .... К несъедобным относятся ... Предлагаем Вам выбрать грибы. К съедобным грибам относятся .... К несъедобным относятся ... Next message with inline buttons - Ознакомьтесь с нашим ассортиментом Select edible Select inedible