Open iyamk opened 10 months ago
Hello
You can set the parse_mode when sending a message
A function to set the parse_mode bot wide hasn't been implemented yet
@iyamk The parse mode is only hardcoded for system commands, which shouldn't interfere.
You could write yourself a little helper class that does any parse_mode setting for you.
Feel free to suggest a way to do this, then you can create a PR for it :blush:
@iyamk The parse mode is only hardcoded for system commands, which shouldn't interfere.
You could write yourself a little helper class that does any parse_mode setting for you.
Feel free to suggest a way to do this, then you can create a PR for it blush
There are two options: $this->replyToChat and Request::sendMessage It's not clear how to extend the class and replace replyToChat, I didn't even find replyToChat in the source code I decided to install everywhere manually
Hi @iyamk, I wasn't sure how to handle parse_mode either, so I decided to take a look at all the classes. It would look something like this:
TelegramBotRequest::sendToActiveChats( 'sendMessage', // Callback function to execute (see Request.php methods) ['text' => $messageToSend, "parse_mode" => "HTML"], [ 'groups' => false, 'supergroups' => false, 'channels' => false, 'users' => true, ] );
Hopefully it will help you.
I don't see a setting for parse_mode, I need to switch to html. But it seems that the code is hardcoded in all files is markdown