为什么"机器人"无效。在我的 discord.py 代码中


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')

  1. 我们不知道什么是"45行">
  2. 您没有定义"令牌"和"前缀">
  3. 从未见过像self_bot=Truebot=False这样的参数

最新更新