def qembed(self, ctx, text, color=None):
"""Used to make a quick embed
{server} is ctx.message.server
{author} is ctx.message.author
{channel} is ctx.message.channel
{message} is ctx.message
{ctx} is ctx
"""
if color is None:
embed_color = self.colours[self.data["default_colour"]]()
elif color.lower() not in self.colours:
if color.startswith('#'):
color = color[1:]
try:
if validhex(int(color, 16)):
embed_color = discord.Color(int(color, 16))
except ValueError:
await send_cmd_help(ctx)
return
if not validhex(int(color, 16)):
await send_cmd_help(ctx)
return
else:
embed_color = self.colours[color]()
embed = discord.Embed(description=text.format(server=ctx.message.server, author=ctx.message.author, channel=ctx.message.channel, message=ctx.message, ctx=ctx), color=embed_color)
await self.bot.say(embed=embed)
评论列表
文章目录