transfer_chat_ownership()¶
- async Client.transfer_chat_ownership()¶
Transfer the ownership of a supergroup or a channel to another user.
Requires owner privileges and two-step verification enabled on your account.
Usable by Users Bots- Parameters:
chat_id (
int|str) – Unique identifier (int) or username (str) of the target chat.user_id (
int|str) – Unique identifier (int) or username (str) of the new owner.password (
str) – The two-step verification password of the current user.
- Returns:
bool– On success, True is returned.- Raises:
ValueError – In case the chat is not a supergroup or a channel, or the new owner is not a user.
Example
await app.transfer_chat_ownership(chat_id, user_id, "password")