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))