【发布时间】:2021-03-27 15:42:03
【问题描述】:
@client.event
async def on_message(message):
if message.content.startswith('bot, '):
if message.content[5:].startswith(('clear')):
if message.author.guild_permissions.administrator:
amount=int(message.content[10:])
await message.channel.purge(limit=amount)
else:
await message.channel.send('not enough energy.')
除了管理员, 我想让某些角色执行命令。 我该怎么办?
角色名称 = 不是管理员 id = 825183755484266529
【问题讨论】:
-
你想做什么?请解释您的代码、您遇到的错误以及您想知道的内容。你也可以看看how to ask a good question
标签: python discord discord.py