def em(self, ctx, *desc):
"""Make an embedded message
Usage: em <body>
Restricted command
"""
author = ctx.message.author
if author.permissions_in(ctx.message.channel).manage_channels or author.server_permissions.manage_channels:
try:
color = author.colour
except Exception:
color = discord.Colour(r.randrange(0xffffff))
string = ""
for w in desc:
string += w + " "
string = string.strip()
embed = discord.Embed(description = string, color = color)
#embed.set_thumbnail(url=author.avatar_url)
embed.set_author(name=author.display_name, icon_url = author.avatar_url)
await self.bot.say(embed = embed)
try:
await self.bot.delete_message(ctx.message)
except Exception:
#thats ok
print("Not allowed to delete message")
#@commands.command(pass_context = True)
#async def allowedEmbed(self, ctx):
# #echoes permissions
# await self.bot.say(ctx.message.author.permissions_in(ctx.message.channel).manage_channels)
评论列表
文章目录