def _colour(self, ctx, role: str, colour: str):
"""Set the Color of a Role."""
role = getRole(ctx, role)
colour = getColor(colour)
if not role:
return await edit(ctx, content="\N{HEAVY EXCLAMATION MARK SYMBOL} Role not found", ttl=5)
elif not colour:
return await edit(ctx, content="\N{HEAVY EXCLAMATION MARK SYMBOL} Colour not found", ttl=5)
else:
value = discord.Colour(int((colour.hex_l.strip('#')), 16))
try:
await role.edit(colour=value)
except discord.HTTPException:
await edit(ctx, content="\N{HEAVY EXCLAMATION MARK SYMBOL} Missing permissions to edit this role", ttl=5)
else:
e = discord.Embed(color=value)
e.set_author(name="Changed Role Color of: " + str(role))
await edit(ctx, embed=e)
评论列表
文章目录