From 68daf90938d6d3c54fe0d54a1c873e99bca9fcd4 Mon Sep 17 00:00:00 2001 From: Romain J Date: Sun, 15 Sep 2019 02:31:31 +0200 Subject: [PATCH] update(command|info): add things to command --- bot.py | 2 +- cogs/basics.py | 34 ++++++++++++++++++++++++++++++- locales/en/LC_MESSAGES/basics.po | 9 ++++++++ locales/fr/LC_MESSAGES/base.mo | Bin 1335 -> 1337 bytes locales/fr/LC_MESSAGES/basics.mo | Bin 717 -> 830 bytes locales/fr/LC_MESSAGES/basics.po | 11 +++++++++- 6 files changed, 53 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index adc6fdc..f2cfb2c 100755 --- a/bot.py +++ b/bot.py @@ -43,7 +43,7 @@ class TuxBot(commands.AutoShardedBot): super().__init__(command_prefix=_prefix_callable, pm_help=None, help_command=None, description=description, help_attrs=dict(hidden=True), - activity=discord.Game(name=Texts().get('Stating...'))) + activity=discord.Game(name=Texts().get('Starting...'))) self.uptime: datetime = datetime.datetime.utcnow() self.config = config diff --git a/cogs/basics.py b/cogs/basics.py index 2d56eea..ba8ce30 100644 --- a/cogs/basics.py +++ b/cogs/basics.py @@ -1,3 +1,4 @@ +import os import platform import time @@ -15,6 +16,12 @@ class Basics(commands.Cog): def __init__(self, bot: TuxBot): self.bot = bot + @staticmethod + def _latest_commits(): + cmd = 'git log -n 3 -s --format="[\`%h\`](https://git.gnous.eu/gnouseu/tuxbot-bot/commits/%H) %s (%cr)"' + + return os.popen(cmd).read().strip() + """---------------------------------------------------------------------""" @commands.command(name='ping') @@ -33,7 +40,7 @@ class Basics(commands.Cog): """---------------------------------------------------------------------""" - @commands.command(name='info') + @commands.command(name='info', aliases=['about']) async def _info(self, ctx: commands.Context): proc = psutil.Process() with proc.oneshot(): @@ -41,6 +48,12 @@ class Basics(commands.Cog): e = discord.Embed( title=f"{Texts('basics').get('Information about TuxBot')}", color=0x89C4F9) + + e.add_field( + name=f"__{Texts('basics').get('Latest changes')}__", + value=self._latest_commits(), + inline=False) + e.add_field( name=f"__:busts_in_silhouette: " f"{Texts('basics').get('Development')}__", @@ -79,10 +92,29 @@ class Basics(commands.Cog): inline=True ) + e.add_field( + name=f"__{Texts('basics').get('Links')}__", + value="[tuxbot.gnous.eu](https://tuxbot.gnous.eu/) " + "| [gnous.eu](https://gnous.eu/) " + f"| [{Texts('basics').get('Invite')}](https://discordapp.com/oauth2/authorize?client_id=301062143942590465&scope=bot&permissions=268749888)", + inline=False + ) + e.set_footer(text=f'version: {self.bot.version}') await ctx.send(embed=e) + """---------------------------------------------------------------------""" + + @commands.command(name='credits') + async def _credits(self, ctx: commands.Context): + e = discord.Embed( + title=Texts('basics').get('Contributors'), + description=f"- **Romain#5117** https://git.gnous.eu/Romain\n" + f"- **Outout#4039** https://git.gnous.eu/mael", + color=0x89C4F9 + ) + def setup(bot: TuxBot): bot.add_cog(Basics(bot)) diff --git a/locales/en/LC_MESSAGES/basics.po b/locales/en/LC_MESSAGES/basics.po index ebf8a66..7aaceda 100644 --- a/locales/en/LC_MESSAGES/basics.po +++ b/locales/en/LC_MESSAGES/basics.po @@ -18,6 +18,9 @@ msgstr "" msgid "Information about TuxBot" msgstr "" +msgid "Latest changes" +msgstr "" + msgid "Development" msgstr "" @@ -34,4 +37,10 @@ msgid "Channels count" msgstr "" msgid "Members count" +msgstr "" + +msgid "Links" +msgstr "" + +msgid "Invite" msgstr "" \ No newline at end of file diff --git a/locales/fr/LC_MESSAGES/base.mo b/locales/fr/LC_MESSAGES/base.mo index eb70dc4735fbb26e44540961a6d86a1ab0db3eac..d01053d4529ca168c7e4a99655d7bd7e6c5d59e5 100644 GIT binary patch delta 143 zcmdnawUcW?i7qz-0|P4)1A_sO76j5FK-vjN^8@K{AZ^RYz>p54Re}7a6BinrvI80U zEDQ`XK)M`A>jCL0K$;gw9|qF4K>8w(76Q`ztPBidKw4=sC*yy{qRkvkyBQ}RVcx)~ XFu8<9mFe)x$+KBh7*i+jXQ==Ho%{)qwmZ6BinrvH=jLS?K$;gw9|Y32K>9q876Q_|tPBidKw4okC*%LkoJ_kJCm&|sIJuNX Ql_|Ao@*EbG$p={~0B6q?F#rGn diff --git a/locales/fr/LC_MESSAGES/basics.mo b/locales/fr/LC_MESSAGES/basics.mo index 8a09184b02ff9d836974f908c96d8803c723c2d3..f5581a0c89ba9c749b1177678e7238d1b4111e59 100644 GIT binary patch delta 296 zcmX@hx{s~?o)F7a1|Z-DVi_PV0dbJP86cYvh|dBsNX;D}mH^@xK+FcjjEoR@4j|16 z~-s9+nA<^s~^fV2pZ zz6qp32EPN+fNX|&iOHVCk z@X5@}F5Y;dg^{f|F(*H-cyct8hALQTVo7Fx9)nA2QC?i+_