Airgram

Guides
/
/
Methods

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:

NameTypeDescription
chatIdnumber Chat identifier
userIdnumber Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user
passwordstring 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>
}