From ae2d565004b7f32314f1af605be77ebd0300d1d1 Mon Sep 17 00:00:00 2001 From: WhatDidYouExpect <89535984+WhatDidYouExpect@users.noreply.github.com> Date: Fri, 18 Jul 2025 01:29:31 +0200 Subject: [PATCH] dynamic git URL --- bot.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 6833874..9315b3a 100644 --- a/bot.py +++ b/bot.py @@ -459,6 +459,17 @@ async def ping(ctx: commands.Context) -> None: await ctx.send(embed=LOLembed) +def get_git_remote_url(): + try: + url = subprocess.check_output( + ["git", "config", "--get", "remote.origin.url"], + text=True, + stderr=subprocess.DEVNULL, + ).strip() + return url + except subprocess.CalledProcessError: + return "Unknown" + # Command: Show about information @bot.hybrid_command(description=f"{(_('command_about_desc'))}") async def about(ctx: commands.Context) -> None: @@ -468,7 +479,7 @@ async def about(ctx: commands.Context) -> None: embed: discord.Embed = discord.Embed(title=f"{(_('command_about_embed_title'))}", description="", color=Colour(0x000000)) embed.add_field(name=f"{(_('command_about_embed_field1'))}", value=f"{NAME}", inline=False) embed.add_field(name=f"{(_('command_about_embed_field2name'))}", value=f"{(_('command_about_embed_field2value')).format(local_version=local_version, latest_version=latest_version)}", inline=False) - embed.add_field(name=f"Github", value=f"https://github.com/gooberinc/goober") + embed.add_field(name=f"Github", value=get_git_remote_url()) await send_message(ctx, embed=embed)