Fix check_100_plus return value and missing i18n in cleanup cog (#6782)

Co-authored-by: Jakub Kuczys <me@jacken.men>
This commit is contained in:
Evanroby
2026-05-28 18:09:17 +02:00
committed by GitHub
parent 60199c8231
commit 28ff1f6d03
+6 -5
View File
@@ -51,12 +51,13 @@ class Cleanup(commands.Cog):
Tries its best to cleanup after itself if the response is positive. Tries its best to cleanup after itself if the response is positive.
""" """
if number > 2**63 - 1:
await ctx.send(_("Try a smaller number instead."))
return False
if ctx.assume_yes: if ctx.assume_yes:
return True return True
if number > 2**63 - 1:
return await ctx.send(_("Try a smaller number instead."))
prompt = await ctx.send( prompt = await ctx.send(
_("Are you sure you want to delete {number} messages?").format( _("Are you sure you want to delete {number} messages?").format(
number=humanize_number(number) number=humanize_number(number)
@@ -453,13 +454,13 @@ class Cleanup(commands.Cog):
mone = await channel.fetch_message(one) mone = await channel.fetch_message(one)
except discord.errors.NotFound: except discord.errors.NotFound:
return await ctx.send( return await ctx.send(
_("Could not find a message with the ID of {id}.".format(id=one)) _("Could not find a message with the ID of {id}.").format(id=one)
) )
try: try:
mtwo = await channel.fetch_message(two) mtwo = await channel.fetch_message(two)
except discord.errors.NotFound: except discord.errors.NotFound:
return await ctx.send( return await ctx.send(
_("Could not find a message with the ID of {id}.".format(id=two)) _("Could not find a message with the ID of {id}.").format(id=two)
) )
to_delete = await self.get_messages_for_deletion( to_delete = await self.get_messages_for_deletion(
channel=channel, before=mtwo, after=mone, delete_pinned=delete_pinned channel=channel, before=mtwo, after=mone, delete_pinned=delete_pinned