1
0
Fork 0
mirror of synced 2024-05-05 05:02:30 +12:00

error out if an invalid colour is given

This commit is contained in:
phxntxm 2018-01-01 22:59:19 -06:00
parent c4d0a3b2a9
commit 7ee3725c7e

View file

@ -50,8 +50,11 @@ class Roles:
"name": name,
"colour": role_colour
}
role = await ctx.guild.create_role(**opts)
try:
role = await ctx.guild.create_role(**opts)
except discord.HTTPException:
await ctx.send("{} is not a valid colour".format(role_colour))
return
# Now add the role
await ctx.author.add_roles(role)