Return deleted count from delete_messages

This commit is contained in:
Lonami Exo
2021-09-17 20:36:40 +02:00
parent d81ebe92f7
commit b3c23e343a
2 changed files with 15 additions and 5 deletions

View File

@@ -644,11 +644,13 @@ async def delete_messages(
ty = helpers._EntityType.USER
if ty == helpers._EntityType.CHANNEL:
return await self([_tl.fn.channels.DeleteMessages(
entity, list(c)) for c in utils.chunks(message_ids)])
res = await self([_tl.fn.channels.DeleteMessages(
entity, list(c)) for c in utils.chunks(message_ids)])
else:
return await self([_tl.fn.messages.DeleteMessages(
list(c), revoke) for c in utils.chunks(message_ids)])
res = await self([_tl.fn.messages.DeleteMessages(
list(c), revoke) for c in utils.chunks(message_ids)])
return sum(r.pts_count for r in res)
async def send_read_acknowledge(
self: 'TelegramClient',