fix: made all commands only work in guilds
This commit is contained in:
parent
b81615e6b6
commit
dbd16175a6
1 changed files with 4 additions and 0 deletions
|
@ -51,6 +51,7 @@ class Pterodactyl(commands.Cog):
|
||||||
return response
|
return response
|
||||||
|
|
||||||
@app_commands.command(description="Updates the server.")
|
@app_commands.command(description="Updates the server.")
|
||||||
|
@app_commands.guild_only()
|
||||||
async def update(self, interaction: discord.Interaction):
|
async def update(self, interaction: discord.Interaction):
|
||||||
"""Updates the server using the arguments provided in the server's configuration."""
|
"""Updates the server using the arguments provided in the server's configuration."""
|
||||||
await interaction.response.defer(ephemeral=True, thinking=True)
|
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 = 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.")
|
@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):
|
async def retrieve_url(self, interaction: discord.Interaction, endpoint: str = None):
|
||||||
"""Retrieves the URL for the specified endpoint."""
|
"""Retrieves the URL for the specified endpoint."""
|
||||||
try:
|
try:
|
||||||
|
@ -197,11 +199,13 @@ class Pterodactyl(commands.Cog):
|
||||||
configure = app_commands.Group(name="config", description="Configures the Pterodactyl cog.")
|
configure = app_commands.Group(name="config", description="Configures the Pterodactyl cog.")
|
||||||
|
|
||||||
@configure.command()
|
@configure.command()
|
||||||
|
@app_commands.guild_only()
|
||||||
async def api(self, interaction: discord.Interaction):
|
async def api(self, interaction: discord.Interaction):
|
||||||
"""Sets the information used to access the Pterdoactyl API."""
|
"""Sets the information used to access the Pterdoactyl API."""
|
||||||
await interaction.response.send_modal(self.APIConfigModal(self.config))
|
await interaction.response.send_modal(self.APIConfigModal(self.config))
|
||||||
|
|
||||||
@configure.command()
|
@configure.command()
|
||||||
|
@app_commands.guild_only()
|
||||||
async def update(self, interaction: discord.Interaction):
|
async def update(self, interaction: discord.Interaction):
|
||||||
"""Sets the startup arguments for the update command."""
|
"""Sets the startup arguments for the update command."""
|
||||||
await interaction.response.send_modal(self.StartupConfigModal(self.config))
|
await interaction.response.send_modal(self.StartupConfigModal(self.config))
|
||||||
|
|
Reference in a new issue