diff options
| author | 2018-02-07 12:27:41 +0000 | |
|---|---|---|
| committer | 2018-02-07 12:27:41 +0000 | |
| commit | edab0c3e7a432add22d19977ee7f4f24cdaebec7 (patch) | |
| tree | d3bf85a4ffeaa2d778550c42631648d8e0675167 | |
| parent | Add "Now playing" status (#1) (diff) | |
Fix up bot info command formatting and add git sha
| -rw-r--r-- | bot/cogs/bot.py | 35 | ||||
| -rw-r--r-- | requirements.txt | 3 |
2 files changed, 15 insertions, 23 deletions
diff --git a/bot/cogs/bot.py b/bot/cogs/bot.py index 96dc8d795..e7c304ccd 100644 --- a/bot/cogs/bot.py +++ b/bot/cogs/bot.py @@ -1,4 +1,5 @@ # coding=utf-8 +from dulwich.repo import Repo from discord import Embed from discord.ext.commands import AutoShardedBot, Context, group @@ -16,7 +17,7 @@ class Bot: @group(invoke_without_command=True, name="bot") async def bot_group(self, ctx: Context): """ - Bot information commands + Bot informational commands """ await ctx.invoke(self.bot.get_command("help"), "bot") @@ -27,31 +28,21 @@ class Bot: Get information about the current bot """ - if not hasattr(self.bot, "shard_id") or self.bot.shard_id is None: - embed = Embed( - description="A utility bot designed just for the Python server!. Try `>>> help` for more info.\n\n" - "**Currently __not sharded__.**", - url="https://github.com/discord-python/bot" - ) - else: - embed = Embed( - description="A utility bot designed just for the Python server! Try `>>> help` for more info.", - url="https://github.com/discord-python/bot" - ) - embed.add_field( - name="Total Shards", value=self.bot.shard_count - ) - embed.add_field( - name="Current Shard", value=self.bot.shard_id - ) - - embed.add_field(name="Visible Guilds", value=str(len(self.bot.guilds))) - embed.add_field(name="Visible Users", value=str(len(self.bot.users))) + embed = Embed( + description="A utility bot designed just for the Python server! Try `>>> help` for more info.", + url="https://github.com/discord-python/bot" + ) + + repo = Repo(".") + sha = repo[repo.head()].sha().hexdigest() + + embed.add_field(name="Total Users", value=str(len(self.bot.users))) + embed.add_field(name="Git SHA", value=str(sha)[:7]) embed.set_author( name="Python Bot", url="https://github.com/discord-python/bot", - icon_url="https://avatars3.githubusercontent.com/u/36101493?s=200&v=4" + icon_url="https://raw.githubusercontent.com/discord-python/branding/master/logos/logo_circle.png" ) await ctx.send(embed=embed) diff --git a/requirements.txt b/requirements.txt index 07e0675ab..b1cabf9b0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -https://github.com/Rapptz/discord.py/archive/rewrite.zip
\ No newline at end of file +https://github.com/Rapptz/discord.py/archive/rewrite.zip +dulwich
\ No newline at end of file |