mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2026-06-06 21:52:59 -04:00
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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user