【发布时间】:2021-07-16 00:46:07
【问题描述】:
我想制作带角色的ban bot
但它引发了错误
这是我的代码:
@client.command()
async def roleban(ctx, role:discord.Role):
for user in ctx.guild.members:
if role in user:
try:
await user.ban()
except:
pass
else:
pass
和错误:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: argument of type 'Member' is not iterable
【问题讨论】:
-
使用
if role in user.rolesdiscordpy.readthedocs.io/en/stable/…
标签: python-3.x discord.py