Answer the question
In order to leave comments, you need to log in
How to make a line break in the message that the bot sends?
Everywhere they say that /n /r/n helps, but I don’t have an underscore instead of them with single quotes.
With double
Send code:
public function sendMessage($api, $chat_id, $message) {
file_get_contents($api . '/sendMessage?chat_id=' . $chat_id . '&text=' . $message);
}
Answer the question
In order to leave comments, you need to log in
Answer found, I stupidly removed urlencode() when sending a message
public function sendMessage($api, $chat_id, $message) {
file_get_contents($api . '/sendMessage?chat_id=' . $chat_id . '&text=' . urlencode ($message));
}
Should be like this
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question