def about(self, ctx):
"""Shows information about the bot."""
git_revision = (await shell('git rev-parse --short HEAD')).strip()
if self.maker is None:
self.maker = discord.utils.get(self.bot.get_all_members(), id=ctx.bot.cfg["bot"]["owner_id"])
birthday = self.bot.user.created_at.strftime(await ctx._('cmd.about.birthday'))
github = ctx.bot.cfg["bot"]["github"]
embed = discord.Embed(
title=await ctx._('cmd.about.title'),
description=await ctx._('cmd.about.description', maker=self.maker)
)
rev_link = f'[{git_revision}](https://github.com/{github}/commit/{git_revision})'
# git revision
embed.add_field(name=await ctx._('cmd.about.fields.git_rev'), value=rev_link)
# github repo link
embed.add_field(
name=await ctx._('cmd.about.fields.github_repo'),
value='[{0}](https://www.github.com/{0})'.format(github)
)
# birthday
embed.add_field(name=await ctx._('cmd.about.fields.birthday'), value=birthday)
# who made me?
embed.set_author(name=f'{self.maker.name}#{self.maker.discriminator}', icon_url=self.maker.avatar_url)
# information about python and discord.py
pyversion = platform.python_version()
version = discord.__version__
embed.set_footer(
text='Python {} \N{EM DASH} Discord.py {}'.format(pyversion, version),
icon_url='http://i.imgur.com/v1dAbXi.png'
)
await ctx.send(embed=embed)
评论列表
文章目录