From dbd16175a6747dba01cc28ac64cf499424ae316b Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Sun, 16 Jul 2023 13:19:39 -0400 Subject: [PATCH] fix: made all commands only work in guilds --- pterodactyl/ptero.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pterodactyl/ptero.py b/pterodactyl/ptero.py index 43aaa62..ba7834e 100644 --- a/pterodactyl/ptero.py +++ b/pterodactyl/ptero.py @@ -51,6 +51,7 @@ class Pterodactyl(commands.Cog): return response @app_commands.command(description="Updates the server.") + @app_commands.guild_only() async def update(self, interaction: discord.Interaction): """Updates the server using the arguments provided in the server's configuration.""" await interaction.response.defer(ephemeral=True, thinking=True) @@ -182,6 +183,7 @@ class Pterodactyl(commands.Cog): get_group = app_commands.Group(name='get', description="Retrieves information from the Pterodactyl API.") @get_group.command(name='url', description="Retrieves the URL for the specified endpoint.") + @app_commands.guild_only() async def retrieve_url(self, interaction: discord.Interaction, endpoint: str = None): """Retrieves the URL for the specified endpoint.""" try: @@ -197,11 +199,13 @@ class Pterodactyl(commands.Cog): configure = app_commands.Group(name="config", description="Configures the Pterodactyl cog.") @configure.command() + @app_commands.guild_only() async def api(self, interaction: discord.Interaction): """Sets the information used to access the Pterdoactyl API.""" await interaction.response.send_modal(self.APIConfigModal(self.config)) @configure.command() + @app_commands.guild_only() async def update(self, interaction: discord.Interaction): """Sets the startup arguments for the update command.""" await interaction.response.send_modal(self.StartupConfigModal(self.config))