Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
fix settings + readded settings views
Browse files Browse the repository at this point in the history
  • Loading branch information
Weever1337 committed Nov 23, 2023
1 parent 7ca17f2 commit 0239fc2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions src/cogs/SettingsCog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 0239fc2

Please sign in to comment.