I have been trying to create a kick command with discord.py and I get the error of a invalid syntax.
Here what I got
@client.event
async def on_command_error(ctx, error):
@client.event
async def on_command_error(ctx, error):
if isinstance(error, MissingPermissions):
await ctx.channel.send("You cant't do that that")
@client.command()
@commands.has_permissions(kick_memebers=True)
async def kick(ctx, user: discord.Member, *, reason=None)
await user.kick(reason=reason)
await ctx.send(f"{user} has been kicked")
and when I run it, I get this error
File "main.py", line 55
async def kick(ctx, user: discord.Member, *, reason=None)
^
SyntaxError: invalid syntax
I have been trying to create a kick command with discord.py and I get the error of a invalid syntax.
Here what I got
@client.event
async def on_command_error(ctx, error):
@client.event
async def on_command_error(ctx, error):
if isinstance(error, MissingPermissions):
await ctx.channel.send("You cant't do that that")
@client.command()
@commands.has_permissions(kick_memebers=True)
async def kick(ctx, user: discord.Member, *, reason=None)
await user.kick(reason=reason)
await ctx.send(f"{user} has been kicked")
and when I run it, I get this error
File "main.py", line 55
async def kick(ctx, user: discord.Member, *, reason=None)
^
SyntaxError: invalid syntax
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.