meta.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:Harmonbot 作者: Harmon758 项目源码 文件源码
def about(self, ctx):
        '''About me'''
        from clients import application_info
        changes = os.popen(r'git show -s HEAD~3..HEAD --format="[`%h`](https://github.com/Harmon758/Harmonbot/commit/%H) %s (%cr)"').read().strip()
        embed = discord.Embed(title = "About Me", color = clients.bot_color)
        embed.description = "[Changelog (Harmonbot Server)]({})\n[Invite Link]({})".format(clients.changelog, discord.utils.oauth_url(application_info.id))
        # avatar = ctx.message.author.avatar_url or ctx.message.author.default_avatar_url
        # embed.set_author(name = ctx.message.author.display_name, icon_url = avatar)
        avatar = self.bot.user.avatar_url or self.bot.user.default_avatar_url
        # embed.set_thumbnail(url = avatar)
        embed.set_author(name = "Harmonbot (Discord ID: {})".format(self.bot.user.id), icon_url = avatar)
        if changes: embed.add_field(name = "Latest Changes:", value = changes, inline = False)
        embed.add_field(name = "Created on:", value = "February 10th, 2016")
        embed.add_field(name = "Version", value = clients.version)
        embed.add_field(name = "Library", value = "[discord.py](https://github.com/Rapptz/discord.py) v{0}\n([Python](https://www.python.org/) v{1.major}.{1.minor}.{1.micro})".format(discord.__version__, sys.version_info))
        me = discord.utils.get(self.bot.get_all_members(), id = clients.owner_id)
        avatar = me.default_avatar_url if not me.avatar else me.avatar_url
        embed.set_footer(text = "Developer/Owner: {0} (Discord ID: {0.id})".format(me), icon_url = avatar)
        await self.bot.reply("", embed = embed)
        await self.bot.say("Changelog (Harmonbot Server): {}".format(clients.changelog))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号