bot = commands.Bot(command_prefix=prefix, self_bot=True)
@commands.check(self_check)
@bot.command(pass_context=True)
async def mall(ctx, *, message):
await ctx.message.delete()
for user in ctx.guild.members:
try:
await user.send(message)
print(f"{user.name} has recieved the message.")
except:
print(f"{user.name} has NOT recieved the message.")
print("Action Completed: mall")
bot.run(token, bot=False)
我遇到了这样的问题:invalid syntax (<unknown>, line 45)
为什么"机器人"语法无效。我不明白
你需要实际做一个前缀...prefix='Enter prefix here'
还需要bot.run(token, bot=False)
bot.run('Enter token here')
- 我们不知道什么是"45行">
- 您没有定义"令牌"和"前缀">
- 从未见过像
self_bot=True
或bot=False
这样的参数