api.transferChatOwnership()
Changes the owner of a chat. The current user must be a current owner of the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats
Parameters
TransferChatOwnershipParams
:chevron_leftchevron_right
Parameters
Interface
Name | Type | Description |
---|---|---|
chatId | number | Chat identifier |
userId | number | Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user |
password | string | The password of the current user |
Returns
ApiResponse
interface:interface ApiResponse {
_: 'transferChatOwnership' | 'error'
airgram: Airgram
request: {
method: 'transferChatOwnership'
params: TransferChatOwnershipParams
}
response: |
setState: (nextState: Record<string, unknown>) => void
getState: () => Record<string, unknown>
}