Search code examples
pythonpython-telegram-bot

I need example on how to mention using PTB


I need further elaboration on this thread How can I mention Telegram users without a username?

Can someone give me an example of how to use the markdown style? I am also using PTB library

The code I want modified

context.bot.send_message(chat_id=-1111111111, text="hi")

Solution

  • Alright, so I finally found the answer. The example below should work.

    context.bot.send_message(chat_id=update.effective_chat.id, 
                             parse_mode = ParseMode.MARKDOWN_V2, 
                             text = "[inline mention of a user](tg://user?id=123456789)")