def embedsay(self, ctx, *, text: str):
"""Says Something as the bot in a embed"""
colour = ''.join([choice('0123456789ABCDEF') for x in range(6)])
colour = int(colour, 16)
randnum = randint(1, 10)
empty = u"\u2063"
emptyrand = empty * randnum
data = discord.Embed(description=str(
text), colour=discord.Colour(value=colour))
if ctx.message.author.avatar_url:
data.set_author(name=ctx.message.author.name,
url=ctx.message.author.avatar_url, icon_url=ctx.message.author.avatar_url)
else:
data.set_author(name=ctx.message.author.name)
try:
await self.bot.say(emptyrand, embed=data)
except:
await self.bot.say("I need the `Embed links` permission to send this")
评论列表
文章目录