tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

chatMemberStatusAdministrator not work #2904

Closed Big-js-demon closed 5 months ago

Big-js-demon commented 5 months ago

Hi.If create supergroup and add admin method chatMemberStatusAdministrator ,bot or user added as normal user and not have admin privegies,but work other methods chatMemberStatusCreator,chatMemberStatusMember ,etc.

const right={ 
_: 'chatMemberStatusAdministrator',
can_manage_chat:true,
custom_title:'administrator',
can_delete_messages:true,
can_invite_users:true,
can_restrict_members:true,
can_pin_messages:true,
can_manage_video_chats:true,
is_anonymous:true
};

await client.invoke({
_: 'setChatMemberStatus',
member_id:{_:'messageSenderUser',user_id:bot_id},
chat_id:super_group_id,
status:right
})
.then((e)=>{console.log(e);}).catch((e)=>{console.log(e);}) 

how add user as admin to the supergroup with tdlib?

levlam commented 5 months ago

You create chatMemberStatusAdministrator object incorrectly. See documentation for the class in the latest TDLib version: https://github.com/tdlib/td/blob/fd3154b28727df9e66423d64168fab1202d8c849/td/generate/scheme/td_api.tl#L997

Big-js-demon commented 5 months ago

You create chatMemberStatusAdministrator object incorrectly. See documentation for the class in the latest TDLib version:

https://github.com/tdlib/td/blob/fd3154b28727df9e66423d64168fab1202d8c849/td/generate/scheme/td_api.tl#L997

hello.it`s fine? right={ _: 'chatMemberStatusAdministrator', custom_title: 'Robot', can_beedited:true, rights:{:'chatPermissions',can_manage_chat:true,can_delete_messages:true,can_invite_users:true,can_restrict_members:true,can_pin_messages:true,can_manage_video_chats:true,is_anonymous:true} };