From 0239fc238ef92c601efda7fdb06bbb6f9f8956ef Mon Sep 17 00:00:00 2001 From: weever Date: Thu, 23 Nov 2023 19:05:13 +0200 Subject: [PATCH] fix settings + readded settings views --- src/cogs/SettingsCog.py | 22 +++++++++---------- .../SettingsView.py} | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) rename src/utils/{settingsviews.py => views/SettingsView.py} (98%) diff --git a/src/cogs/SettingsCog.py b/src/cogs/SettingsCog.py index 5b1ed87..5bab4ac 100644 --- a/src/cogs/SettingsCog.py +++ b/src/cogs/SettingsCog.py @@ -4,7 +4,7 @@ from typing import Dict, List, Optional from src.utils import main_db, commands_db -from src.utils.settingsviews import ( +from src.utils.views.SettingsView import ( CommandsContextCommands, CommandsSlashCommands, CommandsSlashSettings, @@ -150,16 +150,16 @@ async def test(self, ctx: commands.Context): # "status": "OK", # } - @commands.command() - async def set_prefix(self, ctx: commands.Context, prefix: str) -> disnake.Message: - """Set the current prefix to another one""" - if prefix is None or prefix == "": - return await ctx.reply("Please enter a prefix!") - elif len(prefix) >= 5: - return await ctx.reply("Your prefix is too long!") - else: - await self.settings_db.set_prefix(ctx.guild.id, prefix) - return await ctx.reply(f"Successfully set prefix to {prefix}") + # @commands.command() + # async def set_prefix(self, ctx: commands.Context, prefix: str) -> disnake.Message: + # """Set the current prefix to another one""" + # if prefix is None or prefix == "": + # return await ctx.reply("Please enter a prefix!") + # elif len(prefix) >= 5: + # return await ctx.reply("Your prefix is too long!") + # else: + # await self.settings_db.set_prefix(ctx.guild.id, prefix) + # return await ctx.reply(f"Successfully set prefix to {prefix}") @commands.command() async def command_disable( diff --git a/src/utils/settingsviews.py b/src/utils/views/SettingsView.py similarity index 98% rename from src/utils/settingsviews.py rename to src/utils/views/SettingsView.py index 71adc94..de6bd39 100644 --- a/src/utils/settingsviews.py +++ b/src/utils/views/SettingsView.py @@ -258,7 +258,7 @@ async def select_callback( slash_settings = CommandsContextSettings(bot=self.bot) for name, cog in self.bot.cogs.items(): - if not name.startswith("Event") and not name.startswith("Settings"): + if not name.startswith("Event"): slash_settings.add_option( label=name, description=cog.description, @@ -274,7 +274,7 @@ async def select_callback( slash_settings = CommandsSlashSettings(bot=self.bot) for name, cog in self.bot.cogs.items(): - if not name.startswith("Event") and not name.startswith("Settings"): + if not name.startswith("Event"): slash_settings.add_option( label=name, description=cog.description,