telegramphp-telegram-bot

Escaping underline in telegram api when parse_mode = Markdown


How can I send this text correctly:

$parameters['text'] = 'you must see [example](example.com) or contact with @exmaple_com';

if I don't use "Markdown", telegram don't show the above link if I use "Markdown", telegram can't handle underline.


Solution

  • you should use backslash scapes to do so:

    $parameters['text'] = 'you must see [example](example.com) or contact with @exmaple\\_com';