how to promote users to supergroup using telegram bot api(PHP)?

一笑奈何 提交于 2019-12-25 00:37:58

问题



I'm using this code to add some of my users to a supergroup but it doesn't work
is there something wrong with it?

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
  ]);

回答1:


Bots can't add user to group/channel, promoteChatMember is used to make existing members have admin permission.

You can only send invite link of group, and they need to join themselves. :(



来源:https://stackoverflow.com/questions/46041889/how-to-promote-users-to-supergroup-using-telegram-bot-apiphp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!