Reputation: 11
In Discord.py, we have created a command to banish a user. However, the result is output as Nameerror: name'app' is not definded. This is my code.
Do you have any problems with @app.command?
I use client run instead of app run.
@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!```')```
Upvotes: 0
Views: 83
Reputation: 429
Judging from your comments, you're using a discord.Client instead of a commands.Bot. If you want to use the commands module, you need to use commands.Bot instead.
Upvotes: 1