G
Size: a a a
G
G
<?php
class TelegramBot{
protected $token;
public function __construct($token){
$this->token = $token;
}
public function getApiUrl(){
return "https://api.telegram.org/bot{$this->token}/";
}
protected function buildParams($params){
$s = [];
foreach($params as $k=>$v){
array_push($s,"{$k}=>{urlencode($v)}");
}
return implode($s,"&");
}
public function buildUrl($method,$params){
return $this->getApiUrl().$method."?".$this->buildParams($params);
}
public function query($method,$params){
return json_decode(file_get_contents($this->buildUrl($method,$params)),true);
}
}
?>
LX
G
LX
G
G
LX
LX
VM
<?php
class TelegramBot{
protected $token;
public function __construct($token){
$this->token = $token;
}
public function getApiUrl(){
return "https://api.telegram.org/bot{$this->token}/";
}
protected function buildParams($params){
$s = [];
foreach($params as $k=>$v){
array_push($s,"{$k}=>{urlencode($v)}");
}
return implode($s,"&");
}
public function buildUrl($method,$params){
return $this->getApiUrl().$method."?".$this->buildParams($params);
}
public function query($method,$params){
return json_decode(file_get_contents($this->buildUrl($method,$params)),true);
}
}
?>
VM
VM
VM
VM
VM
AB
LX
LX
AB