这是我的 afk 命令:
@client.event
async def on_message(message):
if message.mentions
results = collection.find({"member": message.author.id})
for result in results:
collection.delete_one(result)
if message.content == result:
await message.channel.send(f"This person is currently AFK. \nFor: {reason}")
await client.process_commands(message)
错误:
File "main.py", line 124
if message.mentions
^
SyntaxError: invalid syntax
我有点困惑为什么。有什么想法吗?
答案 0 :(得分:0)
添加条件冒号 :
,
@client.event
async def on_message(message):
if message.mentions:
results = collection.find({"member": message.author.id})
for result in results:
collection.delete_one(result)
if message.content == result:
await message.channel.send(f"This person is currently AFK. \nFor: {reason}")
await client.process_commands(message)