skip to Main Content

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.

2

Answers


  1. Chosen as BEST ANSWER

    I resolved.

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

    )

    Thanks

    mo1ein


  2. According to doc, use parse_mode.

    bot.sendPhoto(
        '@XXXXXXXXXX', 
        getImage(soup),
        parse_mode='Markdown',
        caption = f'*{getTitle(soup)}{getDealPrice(soup)}*',
        disable_notification=True
    )
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search