1
0
Fork 0
mirror of synced 2024-05-20 20:42:27 +12:00

Catch an invalid nickname being passed

This commit is contained in:
Phxntxm 2017-03-24 15:37:03 -05:00
parent 4a7eaaf4da
commit a5d8e849aa

View file

@ -23,8 +23,12 @@ class Mod:
EXAMPLE: !nick Music Bot
RESULT: My nickname is now Music Bot"""
await ctx.message.guild.me.edit(nick=name)
await ctx.send("\N{OK HAND SIGN}")
try:
await ctx.message.guild.me.edit(nick=name)
except discord.HTTPException:
await ctx.send("Sorry but I can't change my nickname to {}".format(name))
else:
await ctx.send("\N{OK HAND SIGN}")
@commands.command(no_pm=True)
@utils.custom_perms(kick_members=True)