A
A
Alex Meyer2017-09-21 10:58:57
Bots
Alex Meyer, 2017-09-21 10:58:57

Incorrect display of the ReplyKeyboardMarkup string. How to change line height and make text wrap automatically?

Good day to all.
I am writing a telegram bot using the telegrambotapi library.
When prompted by an ambiguous user, a keyboard should appear (as a list) with all possible options. Everything works, but there is a catch: this is a reduction in text.
Custom keyboard abbreviation on Android devices is abbreviated by adding an ellipsis to the end of the line, this is quite tolerable, but on iOS devices the ellipsis is placed in the center of the sentence, which makes the line less informative.
90431310259a465eab85272079035ca2.jpg
How can I manually change the height of each button in the keyboard, and how can I automatically wrap the text in this keyboard cell?

markup = types.ReplyKeyboardMarkup(one_time_keyboard=True)
            for line in result[0]:
                markup.row(f'{line}')
            bot.send_message(message.chat.id, "Варианты:", reply_markup=markup, disable_notification=True)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nllm, 2017-09-21
@iriddy

Don't change at all. Don't do transfers. There is no such possibility.
Do it differently. For example, display options in text with numbers, and display option numbers on buttons. The most versatile and visual way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question