mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-03-25 20:34:16 +03:00
Fix delete_messages(None, ...) not working
This commit is contained in:
parent
67a9718f9e
commit
0c8a90f2a3
|
@ -1118,8 +1118,14 @@ class MessageMethods:
|
||||||
else int(m) for m in message_ids
|
else int(m) for m in message_ids
|
||||||
)
|
)
|
||||||
|
|
||||||
entity = await self.get_input_entity(entity) if entity else None
|
if entity:
|
||||||
if helpers._entity_type(entity) == helpers._EntityType.CHANNEL:
|
entity = await self.get_input_entity(entity)
|
||||||
|
ty = helpers._entity_type(entity)
|
||||||
|
else:
|
||||||
|
# no entity (None), set a value that's not a channel for private delete
|
||||||
|
ty = helpers._EntityType.USER
|
||||||
|
|
||||||
|
if ty == helpers._EntityType.CHANNEL:
|
||||||
return await self([functions.channels.DeleteMessagesRequest(
|
return await self([functions.channels.DeleteMessagesRequest(
|
||||||
entity, list(c)) for c in utils.chunks(message_ids)])
|
entity, list(c)) for c in utils.chunks(message_ids)])
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user