diff --git a/core.py b/core.py index d9b67c1..e335bf7 100644 --- a/core.py +++ b/core.py @@ -48,11 +48,12 @@ async def on_message(message, edited=False): try: if (cooldowns := command_cooldowns.get(message.author.id)) and not edited: - cur_time = time.time() - if (end_time := cooldowns.get(matched)) and round(end_time - cur_time) > 0: + if (end_time := cooldowns.get(matched)) and ( + remaining_time := round(end_time - time.time()) > 0 + ): await utils.reply( message, - f"please wait **{utils.format_duration(round(end_time - cur_time), natural=True)}** before using this command again!", + f"please wait **{utils.format_duration(remaining_time, natural=True)}** before using this command again!", ) return diff --git a/utils/discord.py b/utils/discord.py index 6913743..ad26fca 100644 --- a/utils/discord.py +++ b/utils/discord.py @@ -90,8 +90,7 @@ class ChannelResponseWrapper: self.sent_message = None async def send_message(self, **kwargs): - if "ephemeral" in kwargs: - del kwargs["ephemeral"] + kwargs.pop("ephemeral", None) self.sent_message = await reply(self.message, **kwargs) async def edit_message(self, content=None, embed=None, view=None):