0
我正在使用此代码将一些用户添加到超级组,但它不起作用
是否有问题?
如何使用电报bot api(PHP)将用户推广到超级组?
function makereq($method,$datas=[])
{
$url = "https://api.telegram.org/bot".API_KEY."/".$method;
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,http_build_query($datas));
$res = curl_exec($ch);
if(curl_error($ch)){
var_dump(curl_error($ch));
}else{
return json_decode($res);
}
}
makereq('promoteChatMember',[
'chat_id'=>$chat_id,
'user_id'=>$user_id
]);