0


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
  ]);
HamidR
  • 55
  • 1
  • 9

1 Answers1

0

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. :(

Sean Wei
  • 7,433
  • 1
  • 19
  • 39