refactor: minor cleanups
This commit is contained in:
parent
c73260badb
commit
5610fc7acd
7
core.py
7
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
|
||||
|
||||
|
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user