diff --git a/readthedocs/misc/v2-migration-guide.rst b/readthedocs/misc/v2-migration-guide.rst index 5e9d6a5d..e1621fb4 100644 --- a/readthedocs/misc/v2-migration-guide.rst +++ b/readthedocs/misc/v2-migration-guide.rst @@ -13,7 +13,7 @@ good chance you were not relying on this to begin with". **Please read this document in full before upgrading your code to Telethon 2.0.** -Pyhton 3.5 is no longer supported +Python 3.5 is no longer supported --------------------------------- The library will no longer attempt to support Python 3.5. The minimum version is now Python 3.6. @@ -218,6 +218,14 @@ your handlers much more easily. // TODO provide standalone alternative for this? +Deleting messages now returns a more useful value +------------------------------------------------- + +It used to return a list of :tl:`messages.affectedMessages` which I expect very little people were +actually using. Now it returns an ``int`` value indicating the number of messages that did exist +and were deleted. + + The aggressive parameter hack has been removed ---------------------------------------------- diff --git a/telethon/_client/messages.py b/telethon/_client/messages.py index c29610e4..5c073e60 100644 --- a/telethon/_client/messages.py +++ b/telethon/_client/messages.py @@ -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',