From ed09a1377efb42aaf2ce7f4459711d5b9029a204 Mon Sep 17 00:00:00 2001 From: nailer Date: Fri, 28 Sep 2018 13:50:44 +0300 Subject: [PATCH] fix minigroup leaving --- telethon/tl/custom/dialog.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/telethon/tl/custom/dialog.py b/telethon/tl/custom/dialog.py index 39e01668..2297da97 100644 --- a/telethon/tl/custom/dialog.py +++ b/telethon/tl/custom/dialog.py @@ -99,6 +99,10 @@ class Dialog: async def delete(self): if self.is_channel: await self._client(functions.channels.LeaveChannelRequest(self.input_entity)) + elif self.is_group: + await self._client(functions.messages.DeleteChatUserRequest(self.entity.id, + types.InputPeerSelf())) + await self._client(functions.messages.DeleteHistoryRequest(self.input_entity, 0, just_clear=False)) else: await self._client(functions.messages.DeleteHistoryRequest(self.input_entity, 0))