I am trying to implement a check for bot having manage_nicknames permission and if it doesn't have it it should spit out a embed
@commands.command(pass_context=True ,description='Set a nickname for a person', aliases=['name', 'set_name', 'prozvische'])
async def setname(self, ctx: SlashContext, member: discord.Member, *, nickname=None):
try:
'''
Change user's nickname
'''
await member.edit(nick=nickname)
await ctx.message.delete()
if ctx.message.guild.me.permissions_in(ctx.message.channel).manage_nicknames is False:
embed=discord.Embed(title=" Error", description="I need the ``Manage Nicknames`` permission to do this.", color=0xdd2e44,)
await ctx.send(embed=embed)
here is the code piece for the command and it spits out this error ExtensionFailed: Extension 'listener.konsolemod.fun' raised an error: SyntaxError: invalid syntax (fun.py, line 27)