50 lines
1.9 KiB
PHP
50 lines
1.9 KiB
PHP
<?php
|
|
class Xone extends MY_Controller
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
//-315860436
|
|
//
|
|
public function sasone() {
|
|
$prm = $this->sys_input;
|
|
$text = $prm["text"];
|
|
$url = "https://api.telegram.org/bot858743704:AAGplPB1cwWmzAu37VMwiTFifWFCsJKIH10/sendMessage";
|
|
$data = array (
|
|
"chat_id" => "-315860436" ,
|
|
"text" => $text,
|
|
"parse_mode" => "MarkdownV2"
|
|
);
|
|
$j_data = json_encode($data);
|
|
$this->post($url,$j_data);
|
|
}
|
|
public function send() {
|
|
$prm = $this->sys_input;
|
|
$id = $prm["id"];
|
|
$text = $prm["text"];
|
|
$url = "https://api.telegram.org/bot858743704:AAGplPB1cwWmzAu37VMwiTFifWFCsJKIH10/sendMessage";
|
|
$data = array (
|
|
"chat_id" => $id ,
|
|
"parse_mode" => "MarkdownV2",
|
|
"text" => $text
|
|
);
|
|
$j_data = json_encode($data);
|
|
$this->post($url,$j_data);
|
|
}
|
|
function post($url,$data) {
|
|
$ch = curl_init($url);
|
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
|
'Content-Type: application/json',
|
|
'Content-Length: ' . strlen($data))
|
|
);
|
|
$result = curl_exec($ch);
|
|
echo $result;
|
|
return $result;
|
|
}
|
|
}
|
|
?>
|