0

I everyone, I am using telepot to send text and image on my telegram bot. Below an example of my code:

bot.sendPhoto('@XXXXXXXXXX', getImage(soup),
              caption = getTitle(soup) + getDealPrice(soup) , disable_notification=True)

getTitle(soup) and getDealPrice(soup) return a string.

How can I bold only getTitle(soup) ?

Thank you so much.

moskino11
  • 21
  • 3

2 Answers2

0

According to doc, use parse_mode.

bot.sendPhoto(
    '@XXXXXXXXXX', 
    getImage(soup),
    parse_mode='Markdown',
    caption = f'*{getTitle(soup)}{getDealPrice(soup)}*',
    disable_notification=True
)
mo1ein
  • 535
  • 4
  • 18
  • I wrote this code: ` bot.sendPhoto('@xxxx', getImage(soup), parse_mode='Markdown', caption = f'{getTitle(soup)}', disable_notification=True)` but the Title is not bold. – moskino11 Jul 18 '22 at 14:20
  • Bacause you didn't use `*`. This is correct ```f'*{getTitle(soup)}{getDealPrice(soup)}*'``` – mo1ein Jul 18 '22 at 16:25
  • In this mode I get an error. However I resolved it ;) – moskino11 Jul 19 '22 at 13:25
0

I resolved.

bot.sendPhoto(
'@XXXXXXXXXX', 
getImage(soup),
parse_mode='Markdown',
caption = '*' + getTitle(soup)+ '*' + '*' + getDealPrice(soup) + '*',
disable_notification=True

)

Thanks

mo1ein

moskino11
  • 21
  • 3