From b3637bd1c470497aedc3fd504841c82d905d6228 Mon Sep 17 00:00:00 2001 From: xnomas Date: Tue, 4 Jan 2022 20:54:04 +0100 Subject: [PATCH] Simple source command Fixes fumenoid/JHDBot#52 --- JHDBot/cogs/general.py | 14 ++++++++++++++ JHDBot/cogs/strings.py | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/JHDBot/cogs/general.py b/JHDBot/cogs/general.py index 0ee0a2e..6d70576 100644 --- a/JHDBot/cogs/general.py +++ b/JHDBot/cogs/general.py @@ -199,6 +199,20 @@ async def attach_embed_info(self, ctx=None, embed=None): embed.set_footer(text="by: JHD Moderation team ") return embed + # Send github link + @commands.command( + name="source", help="JHDBot github link." + ) + async def source(self, ctx): + if await self.pre_invoke(ctx): + if ( + str(ctx.message.channel) == "bot-commands" + ): + emb = discord.Embed(description=strings.url, colour=0xFF002A) + await self.attach_embed_info(ctx, emb) + await ctx.send(embed=emb) + else: + await ctx.send("Please use this command in `#bot-commands`") def setup(bot): bot.add_cog(GeneralCog(bot)) diff --git a/JHDBot/cogs/strings.py b/JHDBot/cogs/strings.py index 7bf3b80..d045972 100644 --- a/JHDBot/cogs/strings.py +++ b/JHDBot/cogs/strings.py @@ -119,3 +119,7 @@ `#katana` Discuss and coordinate work on Katana Modules here. """ + +url = """ +**https://github.com/Fumenoid/JHDBot** +"""