refactor: minor cleanups

This commit is contained in:
Ryan 2025-02-13 16:29:08 -05:00
parent c73260badb
commit 5610fc7acd
Signed by: ErrorNoInternet
GPG Key ID: 2486BFB7B1E6A4A3
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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):