error out if an invalid colour is given
This commit is contained in:
parent
c4d0a3b2a9
commit
7ee3725c7e
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue