From 29094c5d0fbd21508dfe9b87aa57c27ef8c8b0e4 Mon Sep 17 00:00:00 2001 From: Ziad Arafat Date: Mon, 11 Aug 2025 06:15:37 -0600 Subject: [PATCH] Fixed test command to work with slash commands --- doge_alignment/doge_alignment.py | 6 +++--- pyproject.toml | 1 + uv.lock | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/doge_alignment/doge_alignment.py b/doge_alignment/doge_alignment.py index e676177..6f4337a 100644 --- a/doge_alignment/doge_alignment.py +++ b/doge_alignment/doge_alignment.py @@ -1,4 +1,5 @@ from redbot.core import app_commands, commands +import discord class AlignmentCog(commands.Cog): @@ -8,7 +9,6 @@ class AlignmentCog(commands.Cog): self.bot = bot @app_commands.command() - async def alignment(self, ctx): + async def alignment(self, interaction: discord.Interaction): """This does stuff!""" - # Your code will go here - await ctx.send("I can do stuff!") + await interaction.response.send_message("Hello World!", ephemeral=True) diff --git a/pyproject.toml b/pyproject.toml index 1387803..542ae2c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,7 @@ authors = [ ] requires-python = ">=3.11" dependencies = [ + "discord>=2.3.2", "pyyaml>=6.0.2", "red-discordbot>=3.5.20", ] diff --git a/uv.lock b/uv.lock index e399944..d88b619 100644 --- a/uv.lock +++ b/uv.lock @@ -316,6 +316,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, ] +[[package]] +name = "discord" +version = "2.3.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "discord-py" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7e/9f/0763429949416aeff9c6f33051270831b72e5582273acd28053b9b949462/discord-2.3.2.tar.gz", hash = "sha256:cc1ee2dbe6df218ca51519af355b97e87309f8230f58c7f34885feb8e8a76145", size = 1137, upload-time = "2023-08-10T21:45:07.93Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2d/38/d91ac49e8169b6c0f724f7aad26704eec07c4ecf31e067ca3d46a87e33d6/discord-2.3.2-py3-none-any.whl", hash = "sha256:d7959418799dd3b1e896685812d880169c193468b061b3431fa2a4664febd3da", size = 1132, upload-time = "2023-08-10T21:45:06.334Z" }, +] + [[package]] name = "discord-py" version = "2.5.2" @@ -343,12 +355,14 @@ name = "doge-cogs" version = "0.1.0" source = { editable = "." } dependencies = [ + { name = "discord" }, { name = "pyyaml" }, { name = "red-discordbot" }, ] [package.metadata] requires-dist = [ + { name = "discord", specifier = ">=2.3.2" }, { name = "pyyaml", specifier = ">=6.0.2" }, { name = "red-discordbot", specifier = ">=3.5.20" }, ]