From 172b66a776def2eb4807c32c672eac6112e42f00 Mon Sep 17 00:00:00 2001 From: pancakes-proxy Date: Thu, 22 May 2025 07:46:27 +0900 Subject: [PATCH 1/5] feat: Refactor download commands to use a command group for better organization --- cogs/files.py | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/cogs/files.py b/cogs/files.py index 012d0e2..9bcc5d6 100644 --- a/cogs/files.py +++ b/cogs/files.py @@ -6,7 +6,9 @@ class Download(commands.Cog): def __init__(self, bot): self.bot = bot - @app_commands.command(name="open_otp", description="Get the OpenOTP installer link") + download = app_commands.Group(name="download", description="Download useful files") + + @download.command(name="open_otp", description="Get the OpenOTP installer link") async def open_otp(self, interaction: discord.Interaction): embed = discord.Embed( title="Download OpenOTP Installer", @@ -15,7 +17,7 @@ class Download(commands.Cog): ) await interaction.response.send_message(embed=embed) - @app_commands.command(name="archlinux", description="Get the Arch Linux ISO link") + @download.command(name="archlinux", description="Get the Arch Linux ISO link") async def archlinux(self, interaction: discord.Interaction): embed = discord.Embed( title="Download Arch Linux ISO", @@ -24,7 +26,7 @@ class Download(commands.Cog): ) await interaction.response.send_message(embed=embed) - @app_commands.command(name="ubuntu", description="Get the Ubuntu mirror link") + @download.command(name="ubuntu", description="Get the Ubuntu mirror link") async def ubuntu(self, interaction: discord.Interaction): embed = discord.Embed( title="Download Ubuntu (Mirror)", @@ -33,7 +35,7 @@ class Download(commands.Cog): ) await interaction.response.send_message(embed=embed) - @app_commands.command(name="vscode_windows", description="Get the Visual Studio Code installer for Windows (ARM64)") + @download.command(name="vscode_windows", description="Get the Visual Studio Code installer for Windows (ARM64)") async def vscode_windows(self, interaction: discord.Interaction): embed = discord.Embed( title="Download Visual Studio Code for Windows (ARM64)", @@ -42,7 +44,7 @@ class Download(commands.Cog): ) await interaction.response.send_message(embed=embed) - @app_commands.command(name="vscode_mac", description="Get the Visual Studio Code installer for Mac (Universal)") + @download.command(name="vscode_mac", description="Get the Visual Studio Code installer for Mac (Universal)") async def vscode_mac(self, interaction: discord.Interaction): embed = discord.Embed( title="Download Visual Studio Code for Mac (Universal)", @@ -51,17 +53,8 @@ class Download(commands.Cog): ) await interaction.response.send_message(embed=embed) - @app_commands.guild_only() - @app_commands.group(name="download", description="Download useful files") - async def download(self, interaction: discord.Interaction): - # This is just the group command, not directly callable - pass - - download.add_command(open_otp) - download.add_command(archlinux) - download.add_command(ubuntu) - download.add_command(vscode_windows) - download.add_command(vscode_mac) + async def cog_load(self): + self.bot.tree.add_command(self.download) async def setup(bot): await bot.add_cog(Download(bot)) From 2474f22f76b15d17e60f1e30f803aa9bac5addf0 Mon Sep 17 00:00:00 2001 From: pancakes-proxy Date: Thu, 22 May 2025 07:47:41 +0900 Subject: [PATCH 2/5] feat: Update download commands to use app_commands for improved organization --- cogs/files.py | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/cogs/files.py b/cogs/files.py index 9bcc5d6..8111455 100644 --- a/cogs/files.py +++ b/cogs/files.py @@ -6,10 +6,8 @@ class Download(commands.Cog): def __init__(self, bot): self.bot = bot - download = app_commands.Group(name="download", description="Download useful files") - - @download.command(name="open_otp", description="Get the OpenOTP installer link") - async def open_otp(self, interaction: discord.Interaction): + @app_commands.command(name="download_open_otp", description="Get the OpenOTP installer link") + async def download_open_otp(self, interaction: discord.Interaction): embed = discord.Embed( title="Download OpenOTP Installer", description="[Click here to download OpenOTPInstaller.exe](https://filehost.internettools.org/OpenOTPInstaller.exe)", @@ -17,8 +15,8 @@ class Download(commands.Cog): ) await interaction.response.send_message(embed=embed) - @download.command(name="archlinux", description="Get the Arch Linux ISO link") - async def archlinux(self, interaction: discord.Interaction): + @app_commands.command(name="download_archlinux", description="Get the Arch Linux ISO link") + async def download_archlinux(self, interaction: discord.Interaction): embed = discord.Embed( title="Download Arch Linux ISO", description="[Click here to download Arch Linux 2025.05.01 ISO](https://ftpmirror.infania.net/mirror/archlinux/iso/2025.05.01/)", @@ -26,8 +24,8 @@ class Download(commands.Cog): ) await interaction.response.send_message(embed=embed) - @download.command(name="ubuntu", description="Get the Ubuntu mirror link") - async def ubuntu(self, interaction: discord.Interaction): + @app_commands.command(name="download_ubuntu", description="Get the Ubuntu mirror link") + async def download_ubuntu(self, interaction: discord.Interaction): embed = discord.Embed( title="Download Ubuntu (Mirror)", description="[Click here for the Ubuntu mirror](https://launchpad.net/ubuntu/+mirror/ftp.yz.yamagata-u.ac.jp-release)", @@ -35,8 +33,8 @@ class Download(commands.Cog): ) await interaction.response.send_message(embed=embed) - @download.command(name="vscode_windows", description="Get the Visual Studio Code installer for Windows (ARM64)") - async def vscode_windows(self, interaction: discord.Interaction): + @app_commands.command(name="download_vscode_windows", description="Get the Visual Studio Code installer for Windows (ARM64)") + async def download_vscode_windows(self, interaction: discord.Interaction): embed = discord.Embed( title="Download Visual Studio Code for Windows (ARM64)", description="[Click here to download VS Code for Windows (ARM64)](https://code.visualstudio.com/sha/download?build=stable&os=win32-arm64-user)", @@ -44,8 +42,8 @@ class Download(commands.Cog): ) await interaction.response.send_message(embed=embed) - @download.command(name="vscode_mac", description="Get the Visual Studio Code installer for Mac (Universal)") - async def vscode_mac(self, interaction: discord.Interaction): + @app_commands.command(name="download_vscode_mac", description="Get the Visual Studio Code installer for Mac (Universal)") + async def download_vscode_mac(self, interaction: discord.Interaction): embed = discord.Embed( title="Download Visual Studio Code for Mac (Universal)", description="[Click here to download VS Code for Mac (Universal)](https://code.visualstudio.com/sha/download?build=stable&os=darwin-universal)", @@ -53,8 +51,5 @@ class Download(commands.Cog): ) await interaction.response.send_message(embed=embed) - async def cog_load(self): - self.bot.tree.add_command(self.download) - async def setup(bot): await bot.add_cog(Download(bot)) From 57f73332b518612a783e62a4a974a5f5ef41104c Mon Sep 17 00:00:00 2001 From: pancakes-proxy Date: Thu, 22 May 2025 07:51:52 +0900 Subject: [PATCH 3/5] feat: Update Visual Studio Code download command for Windows to reflect accurate architecture --- cogs/files.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cogs/files.py b/cogs/files.py index 8111455..d836659 100644 --- a/cogs/files.py +++ b/cogs/files.py @@ -33,11 +33,11 @@ class Download(commands.Cog): ) await interaction.response.send_message(embed=embed) - @app_commands.command(name="download_vscode_windows", description="Get the Visual Studio Code installer for Windows (ARM64)") + @app_commands.command(name="download_vscode_windows", description="Get the Visual Studio Code installer for Windows.") async def download_vscode_windows(self, interaction: discord.Interaction): embed = discord.Embed( - title="Download Visual Studio Code for Windows (ARM64)", - description="[Click here to download VS Code for Windows (ARM64)](https://code.visualstudio.com/sha/download?build=stable&os=win32-arm64-user)", + title="Download Visual Studio Code for Windows.", + description="[Click here to download VS Code for Windows.](https://code.visualstudio.com/sha/download?build=stable&os=win32-x64-user)", color=discord.Color.purple() ) await interaction.response.send_message(embed=embed) From 6828feafac102d63fa430c9baba8f5bd2ef7cf8b Mon Sep 17 00:00:00 2001 From: pancakes-proxy Date: Thu, 22 May 2025 07:53:13 +0900 Subject: [PATCH 4/5] fix: Update Arch Linux download link to point to the correct ISO file --- cogs/files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/files.py b/cogs/files.py index d836659..1e26bcb 100644 --- a/cogs/files.py +++ b/cogs/files.py @@ -19,7 +19,7 @@ class Download(commands.Cog): async def download_archlinux(self, interaction: discord.Interaction): embed = discord.Embed( title="Download Arch Linux ISO", - description="[Click here to download Arch Linux 2025.05.01 ISO](https://ftpmirror.infania.net/mirror/archlinux/iso/2025.05.01/)", + description="[Click here to download Arch Linux 2025.05.01 ISO](https://ftpmirror.infania.net/mirror/archlinux/iso/2025.05.01/archlinux-2025.05.01-x86_64.iso)", color=discord.Color.green() ) await interaction.response.send_message(embed=embed) From 83a26509195b710bd1b78b52f84246caab5c22ea Mon Sep 17 00:00:00 2001 From: pancakes-proxy Date: Thu, 22 May 2025 19:16:35 +0900 Subject: [PATCH 5/5] feat: Add command to download Windows Redist All-in-One package --- cogs/files.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cogs/files.py b/cogs/files.py index 1e26bcb..81e1789 100644 --- a/cogs/files.py +++ b/cogs/files.py @@ -51,5 +51,14 @@ class Download(commands.Cog): ) await interaction.response.send_message(embed=embed) + @app_commands.command(name="download_windows_redist", description="Get the Windows Redist All-in-One package") + async def download_windows_redist(self, interaction: discord.Interaction): + embed = discord.Embed( + title="Download Windows Redist All-in-One", + description="[Click here to download windows_redist_allinone.zip](https://filehost.internettools.org/windows_redist_allinone.zip)", + color=discord.Color.teal() + ) + await interaction.response.send_message(embed=embed) + async def setup(bot): await bot.add_cog(Download(bot))