diff --git a/classes/manager.php b/classes/manager.php index 3ae9426..dd19e3e 100644 --- a/classes/manager.php +++ b/classes/manager.php @@ -67,7 +67,13 @@ public function send_message($message, $userid) { return true; } - $response = $this->send_api_command('sendMessage', ['chat_id' => $chatid, 'text' => $message]); + /** + * remove

...

, ...,
+ */ + $msg = preg_replace('/

((.|\n)*)<\/p>/', '${1}', $message); + $msg = preg_replace('/]*>(.*)<\/a>/','${1}',$msg); + $msg = str_replace('
', '', $msg); + $response = $this->send_api_command('sendMessage', ['chat_id' => $chatid, 'text' => $msg]); return (!empty($response) && isset($response->ok) && ($response->ok == true)); } @@ -304,6 +310,6 @@ private function send_api_command($command, $params = null) { $this->curl = new \curl(); } - return json_decode($this->curl->get('https://api.telegram.org/bot'.$this->config('sitebottoken').'/'.$command, $params)); + return json_decode($this->curl->get('https://api.telegram.org/bot'.$this->config('sitebottoken').'/'.$command, $params, ["CURLOPT_RETURNTRANSFER" => true])); } -} \ No newline at end of file +}