Skip to content
This repository has been archived by the owner on Jul 31, 2018. It is now read-only.

Commit

Permalink
Added more info to the info command
Browse files Browse the repository at this point in the history
  • Loading branch information
kyb3r committed Oct 13, 2017
1 parent 2fe9e4c commit a7d993f
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions cogs/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,9 @@ async def userinfo(self, ctx, *, member : discord.Member=None):
@commands.command(aliases=['bot', 'info'])
async def about(self, ctx):
'''See information about the selfbot and latest changes.'''
cmd = r'git show -s HEAD~3..HEAD --format="[{}](https://github.com/verixx/selfbot/commit/%H) %s (%cr)"'
if os.name == 'posix':
cmd = cmd.format(r'\`%h\`')
else:
cmd = cmd.format(r'`%h`')

revision = '\n'.join(os.popen(cmd).read().strip() .splitlines()[:3])
embed = discord.Embed()
embed.url = 'https://discord.gg/pmQSbAd'
embed.url = 'https://selfbot-py.tk'
embed.colour = await ctx.get_dominant_color(ctx.author.avatar_url)

embed.set_author(name='selfbot.py', icon_url=ctx.author.avatar_url)
Expand Down Expand Up @@ -230,8 +224,12 @@ async def about(self, ctx):
if days:
fmt = '{d}d ' + fmt
uptime = fmt.format(d=days, h=hours, m=minutes, s=seconds)
if revision:
embed.add_field(name='Latest Changes', value=revision)

github = '[Click Here](https://github.com/verixx/selfbot.py/)'
server = '[Click Here](https://discord.gg/pmQSbAd)'
website = '[selfbot-py.tk](http://selfbot-py.tk/)'


embed.add_field(name='Author', value='verixx#7220')
embed.add_field(name='Uptime', value=uptime)
embed.add_field(name='Guilds', value=len(self.bot.guilds))
Expand All @@ -240,6 +238,9 @@ async def about(self, ctx):
memory_usage = self.bot.process.memory_full_info().uss / 1024**2
cpu_usage = self.bot.process.cpu_percent() / psutil.cpu_count()
embed.add_field(name='Process', value=f'{memory_usage:.2f} MiB\n{cpu_usage:.2f}% CPU')
embed.add_field(name='Github', value=github)
embed.add_field(name='Discord', value=server)
embed.add_field(name='Website', value=website)
embed.set_footer(text=f'Powered by discord.py {discord.__version__}')
await ctx.send(embed=embed)

Expand Down

0 comments on commit a7d993f

Please sign in to comment.