不和谐命令冷却时间忽略特定服务器中的某些角色



我想知道是否可以为某个服务器上的角色禁用命令冷却时间,因此在 Server1 中具有常规角色的用户将不会收到冷却时间,但普通用户(@everyone角色(将收到冷却时间,但如果用户在 Server2 中具有常规角色,他们将收到冷却时间。

你可以简单地使用 if 语句。我对重写语法不是很熟悉 discord.py 所以这里有一些伪代码:

@client.event
async def on_message(message):
role = discord.utils.get(...)
if message.content.startswith(...) and (message.author.hasRole(role) or not countdownIsActive):
...

最新更新