S
S
sasha3212021-12-20 00:55:15
Bots
sasha321, 2021-12-20 00:55:15

How to make a text transfer in a bot?

How to wrap text? Here is what I tried

if call.data == "1":
        bot.send_message(call.message.chat.id, "<b>Foursquare</b></n>Тут зібрані всі, навіть найновіші або менш популярні місця будь-якого міста. Найрізноманітніші точки: від вокзалів до хостелів, від набережних до університетів та шкіл, від парків до пралень, пляжі, острови, нічні клуби та інше.")
    elif call.data == "2":
        bot.send_message(call.message.chat.id,"Monefy")
        bot.send_message(call.message.chat.id,"Одна з найкращих програм для ведення домашньої бухгалтерії. Є можливість вести єдиний бюджет кількома користувачами, мультивалютність, систему обліку виплат за кредитами, смарт-бюджет для економії.")

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kreeplambor, 2021-12-20
@kreeplambor

I wrote \n instead of / n (without triangle brackets). Works for me. The main thing is to write parse_mode='html'

S
shurshur, 2021-12-20
@shurshur

Specify \n or even \n\n (two breaks - so that there is an empty line between paragraphs).
To use html, you must pass the parse_mode='html' parameter. There are limitations - not all tags are supported. See https://core.telegram.org/bots/api#html-style
Also has parse_mode='MarkdownV2' and parse_mode='Markdown, more info https://core.telegram.org/bots/api#formatting-options

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question