Search code examples
pythontelegrampyrogram

How to make invisible telegram python mention


I need to make sure that the mention of users is not visible, it seems like this is done somehow through links, but I don't know (


Solution

  • You can use the internal tg:// protocol to mention users by their ID: tg://user?id=123456789

    These mentions only work when they are an inline URL by using Markdown or HTML formatting for links: [text](url) or <a href="url">text</a>, respectively.

    The trick for an invisible mention is to use a character that isn't visible, for example a zero-width whitespace: [​](tg://user?id=123456). Keep in mind that Telegram strips leading and trailing whitespace, so if you have other text in your message, make sure to have the invisible mention somewhere that isn't the very beginning or end of that message.