当我以/addchannel@username向我的bot发送消息时,它不会返回任何错误,但通道订户计数没有插入到我的数据库中
$ex = explode("/addchannel", $text);
$im = implode("", $ex);
$content=file_get_contents("https://api.telegram.org/botxxxxx:yyyyyyyyyyy/getChatMembersCount?chat_id=".$im);
$obj = json_decode($content, TRUE);
$im = $obj['result'];
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>$im
]);
if($text != in_array($text, $ex)){
if($im > 1000){
mysqli_query($db,"INSERT INTO channel(c_id,phone) VALUES('$im','0')");
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>'CHANNEL ADDED SUCCESFULLY'
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>'INVALID FORMAT'
]);
}
}
暂无答案!
目前还没有任何答案,快来回答吧!