【发布时间】:2020-10-28 18:28:28
【问题描述】:
冷却使机器人在有冷却时间时以秒为单位显示冷却计时器。我想做到这一点,以便机器人在分钟:秒内显示它。不知道怎么做。
此代码的冷却时间为 5 分钟
@rob.error
async def rob_error(self, ctx, error):
if isinstance(error, commands.BadArgument):
await ctx.send("Member doesnt exist")
if isinstance(error, commands.CommandOnCooldown):
embed = discord.Embed(
title="Your on a cooldown!", color=discord.Color.blue())
embed.add_field(
name="\u200b",
value=
f"Slow down will ya?\n Wait for {round(error.retry_after)} seconds"
)
await ctx.send(embed=embed)
【问题讨论】:
标签: discord.py