不和python踢和ban命令



在Discord.py中,我们创建了一个命令来驱逐用户。但是,结果输出为Nameerror:未定义名称"app"。这是我的密码。

你对@app.command有什么问题吗?

我使用客户端运行而不是应用程序运行。

@app.command(name="<<kick", pass_context= True)
@commands.has_permissions(administrator=True)
async def _kick(ctx, *, username: discord.Member, reason=None):
await user_name.kick(reason=reason)
await ctx.send(str(user_name) + 'n```User was kick!```')```

如果使用client.run,则还必须使用@client.command(...)

根据您的评论判断,您使用的是不和。客户端而不是命令。Bot.如果你想使用命令模块,你需要使用命令。取而代之的是Bot。

最新更新