mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-03-23 03:14:22 +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
|
||||
)
|
||||
|
||||
entity = await self.get_input_entity(entity) if entity else None
|
||||
if helpers._entity_type(entity) == helpers._EntityType.CHANNEL:
|
||||
if entity:
|
||||
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(
|
||||
entity, list(c)) for c in utils.chunks(message_ids)])
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user