diff --git a/cogs/connect.py b/cogs/connect.py index 2ce2578..ce2f30e 100644 --- a/cogs/connect.py +++ b/cogs/connect.py @@ -137,7 +137,7 @@ async def autocomplete_server(self, interaction: nextcord.Interaction, current: choices = [server for server in self.servers if current.lower() in server.lower()] await interaction.response.send_autocomplete(choices) - @nextcord.slash_command(name="eventlogs", description=t("ConnectCog", "eventlogs.description"), default_member_permissions=nextcord.Permissions(administrator=True)) + @nextcord.slash_command(name="eventlogs", description=t("ConnectCog", "eventlogs.description"), default_member_permissions=nextcord.Permissions(administrator=True), dm_permission=False) @restrict_command() async def eventlogs(self, interaction: nextcord.Interaction, channel: nextcord.TextChannel, server: str = nextcord.SlashOption(description=t("ConnectCog", "eventlogs.server_description"), autocomplete=True)): await interaction.response.defer(ephemeral=True) @@ -151,7 +151,7 @@ async def eventlogs(self, interaction: nextcord.Interaction, channel: nextcord.T async def on_autocomplete_rcon(self, interaction: nextcord.Interaction, current: str): await self.autocomplete_server(interaction, current) - @nextcord.slash_command(name="removelogs", description=t("ConnectCog", "removelogs.description"), default_member_permissions=nextcord.Permissions(administrator=True)) + @nextcord.slash_command(name="removelogs", description=t("ConnectCog", "removelogs.description"), default_member_permissions=nextcord.Permissions(administrator=True), dm_permission=False) @restrict_command() async def removeeventlogs(self, interaction: nextcord.Interaction, server: str = nextcord.SlashOption(description=t("ConnectCog", "removelogs.server_description"), autocomplete=True)): await interaction.response.defer(ephemeral=True) diff --git a/cogs/economy/core.py b/cogs/economy/core.py index f62c74d..301a059 100644 --- a/cogs/economy/core.py +++ b/cogs/economy/core.py @@ -188,7 +188,7 @@ async def economyhelp(self, interaction: nextcord.Interaction): except Exception as e: await interaction.response.send_message(f"Unexpected error: {e}") - @nextcord.slash_command(name="setsteam", description=t("EconomyCog", "setsteam.description")) + @nextcord.slash_command(name="setsteam", description=t("EconomyCog", "setsteam.description"), dm_permission=False) @restrict_command() async def set_steam(self, interaction: nextcord.Interaction, steam_id: str): try: diff --git a/cogs/economy/manage.py b/cogs/economy/manage.py index 65f8a5d..1804ddb 100644 --- a/cogs/economy/manage.py +++ b/cogs/economy/manage.py @@ -29,6 +29,7 @@ async def load_config(self): name="economyset", description=t("EconomyManageCog", "economyset.description"), default_member_permissions=nextcord.Permissions(administrator=True), + dm_permission=False ) async def economyset(self, _interaction: nextcord.Interaction): pass diff --git a/cogs/economy/shop.py b/cogs/economy/shop.py index 90ddb3f..2c82023 100644 --- a/cogs/economy/shop.py +++ b/cogs/economy/shop.py @@ -127,7 +127,7 @@ async def get_server_info(self, server_name: str): } return None - @nextcord.slash_command(description=t("ShopCog", "shop.description")) + @nextcord.slash_command(description=t("ShopCog", "shop.description"), dm_permission=False) async def shop(self, _interaction: nextcord.Interaction): pass diff --git a/cogs/kits.py b/cogs/kits.py index 921d1ab..3407006 100644 --- a/cogs/kits.py +++ b/cogs/kits.py @@ -43,7 +43,12 @@ async def get_server_info(self, server_name: str): } return None - @nextcord.slash_command(name="kit", description=t("KitsCog", "givekit.description"), default_member_permissions=nextcord.Permissions(administrator=True)) + @nextcord.slash_command( + name="kit", + description=t("KitsCog", "givekit.description"), + default_member_permissions=nextcord.Permissions(administrator=True), + dm_permission=False + ) @restrict_command() async def givekit(self, interaction: nextcord.Interaction, steamid: str, kit_name: str, server: str): await interaction.response.defer(ephemeral=True) @@ -91,7 +96,12 @@ async def on_autocomplete_kits(self, interaction: nextcord.Interaction, current: choices = await autocomplete_kits(current) await interaction.response.send_autocomplete(choices[:10]) - @nextcord.slash_command(name="managekits", description=t("KitsCog", "manage_kits.description"), default_member_permissions=nextcord.Permissions(administrator=True)) + @nextcord.slash_command( + name="managekits", + description=t("KitsCog", "manage_kits.description"), + default_member_permissions=nextcord.Permissions(administrator=True), + dm_permission=False + ) @restrict_command() async def manage_kits(self, interaction: nextcord.Interaction, kit_name: str = ""): try: @@ -114,7 +124,12 @@ async def on_autocomplete_kits(self, interaction: nextcord.Interaction, current: choices = await autocomplete_kits(current) await interaction.response.send_autocomplete(choices[:10]) - @nextcord.slash_command(name="deletekit", description=t("KitsCog", "delete_kit.description"), default_member_permissions=nextcord.Permissions(administrator=True)) + @nextcord.slash_command( + name="deletekit", + description=t("KitsCog", "delete_kit.description"), + default_member_permissions=nextcord.Permissions(administrator=True), + dm_permission=False + ) @restrict_command() async def delete_kit(self, interaction: nextcord.Interaction, kit_name: str): await interaction.response.defer(ephemeral=True) @@ -130,7 +145,12 @@ async def on_autocomplete_kits(self, interaction: nextcord.Interaction, current: choices = await autocomplete_kits(current) await interaction.response.send_autocomplete(choices[:10]) - @nextcord.slash_command(name="uploadkits", description=t("KitsCog", "uploadkits.description"), default_member_permissions=nextcord.Permissions(administrator=True)) + @nextcord.slash_command( + name="uploadkits", + description=t("KitsCog", "uploadkits.description"), + default_member_permissions=nextcord.Permissions(administrator=True), + dm_permission=False + ) @restrict_command() async def uploadkits(self, interaction: nextcord.Interaction, json_file: nextcord.Attachment): await interaction.response.defer(ephemeral=True) @@ -154,7 +174,12 @@ async def uploadkits(self, interaction: nextcord.Interaction, json_file: nextcor except Exception as e: await interaction.followup.send(t("KitsCog", "uploadkits.error").format(error=e), ephemeral=True) - @nextcord.slash_command(name="exportkits", description="Export all kits as a JSON file.", default_member_permissions=nextcord.Permissions(administrator=True)) + @nextcord.slash_command( + name="exportkits", + description="Export all kits as a JSON file.", + default_member_permissions=nextcord.Permissions(administrator=True), + dm_permission=False + ) @restrict_command() async def exportkits(self, interaction: nextcord.Interaction): await interaction.response.defer(ephemeral=True) diff --git a/cogs/palcon.py b/cogs/palcon.py index d9e48ec..0b722a5 100644 --- a/cogs/palcon.py +++ b/cogs/palcon.py @@ -36,7 +36,8 @@ async def get_server_info(self, server_name: str): return None @nextcord.slash_command( - default_member_permissions=nextcord.Permissions(administrator=True) + default_member_permissions=nextcord.Permissions(administrator=True), + dm_permission=False ) async def palcon(self, interaction: nextcord.Interaction): await self.load_servers() diff --git a/cogs/palguard.py b/cogs/palguard.py index 40003c7..3a02200 100644 --- a/cogs/palguard.py +++ b/cogs/palguard.py @@ -81,7 +81,8 @@ async def get_server_info(self, server_name: str): return None @nextcord.slash_command( - default_member_permissions=nextcord.Permissions(administrator=True) + default_member_permissions=nextcord.Permissions(administrator=True), + dm_permission=False ) async def palguard(self, _interaction: nextcord.Interaction): await self.load_servers() @@ -399,7 +400,8 @@ async def on_autocomplete_rcon( @nextcord.slash_command( name="whitelist", description=t("PalguardCog", "whitelist.description"), - default_member_permissions=nextcord.Permissions(administrator=True) + default_member_permissions=nextcord.Permissions(administrator=True), + dm_permission=False ) async def whitelist(self, interaction: nextcord.Interaction): pass diff --git a/cogs/playerlist.py b/cogs/playerlist.py index 5c44be0..ec33c4c 100644 --- a/cogs/playerlist.py +++ b/cogs/playerlist.py @@ -90,7 +90,12 @@ async def get_server_info(self, server_name: str): } return None - @nextcord.slash_command(name="players", description=t("PlayerListCog", "playerslist.command_description"), default_member_permissions=nextcord.Permissions(administrator=True)) + @nextcord.slash_command( + name="players", + description=t("PlayerListCog", "playerslist.command_description"), + default_member_permissions=nextcord.Permissions(administrator=True), + dm_permission=False + ) @restrict_command() async def playerslist( self, diff --git a/cogs/playerlog.py b/cogs/playerlog.py index d9479fb..706e555 100644 --- a/cogs/playerlog.py +++ b/cogs/playerlog.py @@ -72,6 +72,7 @@ def is_valid_steamid(self, steamid): @nextcord.slash_command( description=t("PlayerInfoCog", "userdb.description"), default_member_permissions=nextcord.Permissions(administrator=True), + dm_permission=False ) async def userdb(self, interaction: nextcord.Interaction): pass diff --git a/cogs/query.py b/cogs/query.py index eb4096c..a8920ee 100644 --- a/cogs/query.py +++ b/cogs/query.py @@ -187,7 +187,7 @@ async def autocomplete_server(self, interaction: nextcord.Interaction, current: choices = [server for server in self.servers if current.lower() in server.lower()] await interaction.response.send_autocomplete(choices) - @nextcord.slash_command(description=t("QueryCog", "query.description"), default_member_permissions=nextcord.Permissions(administrator=True)) + @nextcord.slash_command(description=t("QueryCog", "query.description"), default_member_permissions=nextcord.Permissions(administrator=True), dm_permission=False) async def query(self, interaction: nextcord.Interaction): pass diff --git a/cogs/servers.py b/cogs/servers.py index 987cd6d..aaced5c 100644 --- a/cogs/servers.py +++ b/cogs/servers.py @@ -9,13 +9,13 @@ class ServerConfigCog(commands.Cog): def __init__(self, bot): self.bot = bot - @nextcord.slash_command(name="addserver", description=t("ServerConfig", "addserver.description"), default_member_permissions=nextcord.Permissions(administrator=True)) + @nextcord.slash_command(name="addserver", description=t("ServerConfig", "addserver.description"), default_member_permissions=nextcord.Permissions(administrator=True), dm_permission=False) @restrict_command() async def addserver(self, interaction: nextcord.Interaction): modal = AddServerModal() await interaction.response.send_modal(modal) - @nextcord.slash_command(name="removeserver", description=t("ServerConfig", "removeserver.description"), default_member_permissions=nextcord.Permissions(administrator=True)) + @nextcord.slash_command(name="removeserver", description=t("ServerConfig", "removeserver.description"), default_member_permissions=nextcord.Permissions(administrator=True), dm_permission=False) @restrict_command() async def removeserver(self, interaction: nextcord.Interaction, server_name: str): result = await remove_server(server_name)