Telegram [parse_mode] and <a> tag question #1402
-
In the first case ($message variable), we get the message without a link, but in the second case (Google), we have the link. Why?
|
Beta Was this translation helpful? Give feedback.
Answered by
filippotoso
Apr 16, 2024
Replies: 2 comments 2 replies
-
Please try this: $url = 'https://www.google.com';
$clientName = 'Google link';
$message = sprintf('<a href="%s">%s</a>', $url, $clientName);
$this->bot->reply($message, ['parse_mode' => 'HTML']); |
Beta Was this translation helpful? Give feedback.
2 replies
-
Just tested and it works correctly: class TelegramController extends Controller
{
public function index(Request $request)
{
DriverManager::loadDriver(TelegramDriver::class);
DriverManager::loadDriver(TelegramPhotoDriver::class);
DriverManager::loadDriver(TelegramLocationDriver::class);
DriverManager::loadDriver(TelegramContactDriver::class);
$config = array_merge([
'config' => config('botman.config')
], [
'telegram' => config('botman.telegram', [])
]);
$botman = BotManFactory::create($config, new LaravelCache);
$botman->hears('Hi', function (BotMan $bot) {
$url = 'https://www.google.com';
$clientName = 'Google link';
$message = sprintf('<a href="%s">%s</a>', $url, $clientName);
$bot->reply($message, ['parse_mode' => 'HTML']);
});
$botman->listen();
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kirchevsky
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just tested and it works correctly: