我想列出静音成员的列表,并删除他们写的每条消息,但是我做错了,因为该命令对所有成员均有效:
Muted_members = ["muted member id"]
@bot.event
async def on_message(message):
for message.author in Muted_members:
...
答案 0 :(得分:0)
您应该更换
for message.author in Muted_members:
与
if message.author in Muted_members:
检查作者是否在列表中,然后执行删除操作,而不像现在一样对所有静音成员执行一次删除代码。