fix: power, get, and config command groups are disabled in dms

This commit is contained in:
Seaswimmer 2023-07-16 15:00:07 -04:00
parent 40858dc7d4
commit cb42243a65
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -125,7 +125,7 @@ class Pterodactyl(commands.Cog):
power = app_commands.Group(name='power', description="Controls the server's power state.")
@power.command(name='start', description="Starts the server.")
@app_commands.guild_only()
@power.guild_only()
async def start(self, interaction: discord.Interaction):
"""Starts the server."""
await interaction.response.defer(ephemeral=True, thinking=True)
@ -150,7 +150,7 @@ class Pterodactyl(commands.Cog):
await message.delete(delay=3)
@power.command(name='restart', description="Restarts the server.")
@app_commands.guild_only()
@power.guild_only()
async def restart(self, interaction: discord.Interaction):
"""Restarts the server."""
await interaction.response.defer(ephemeral=True, thinking=True)
@ -178,7 +178,7 @@ class Pterodactyl(commands.Cog):
await message.delete(delay=3)
@power.command(name='stop', description="Stops the server.")
@app_commands.guild_only()
@power.guild_only()
async def stop(self, interaction: discord.Interaction):
"""Stops the server."""
await interaction.response.defer(ephemeral=True, thinking=True)
@ -290,7 +290,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()
@get_group.guild_only()
async def retrieve_url(self, interaction: discord.Interaction, endpoint: str = None):
"""Retrieves the URL for the specified endpoint."""
try:
@ -306,13 +306,13 @@ class Pterodactyl(commands.Cog):
configure = app_commands.Group(name="config", description="Configures the Pterodactyl cog.")
@configure.command(name="api", description="Sets the information used to access the Pterodactyl API.")
@app_commands.guild_only()
@configure.guild_only()
async def configure_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(name="update", description="Sets the startup arguments for the update command.")
@app_commands.guild_only()
@configure.guild_only()
async def configure_update(self, interaction: discord.Interaction):
"""Sets the startup arguments for the update command."""
await interaction.response.send_modal(self.StartupConfigModal(self.config))