async Client.leave_chat()

Leave a group chat or channel.

Usable by Users Bots
  • chat_id (int | str) – Unique identifier for the target chat or username of the target channel/supergroup (in the format @username).

  • delete (bool, optional) – Deletes the group chat dialog after leaving (for simple group chats, not supergroups). Defaults to False.


# Leave chat or channel
await app.leave_chat(chat_id)

# Leave basic chat and also delete the dialog
await app.leave_chat(chat_id, delete=True)