Skip to content

Commit 6cfe3a0

Browse files
committed
refactor(config.py): replace custom checks with built-in has_permissions check for better compatibility
chore(config.py): add TODO comments for future improvements and features style(config.py): change 'category' to 'setting' in app_commands.describe for better clarity
1 parent c800bc7 commit 6cfe3a0

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

tux/cogs/guild/config.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,24 @@
44
from discord import app_commands
55
from discord.ext import commands
66

7-
import tux.utils.checks as checks
87
from tux.database.controllers import DatabaseController
98
from tux.ui.views.config import ConfigSetChannels, ConfigSetPrivateLogs, ConfigSetPublicLogs
109

10+
# TODO: Add onboarding setup to ensure all required channels, logs, and roles are set up
11+
# TODO: Figure out how to handle using our custom checks because the current checks would result in a lock out
12+
# TODO: Add a command to reset the guild config to default values
13+
1114

1215
class Config(commands.Cog):
1316
def __init__(self, bot: commands.Bot) -> None:
1417
self.bot = bot
1518
self.db = DatabaseController().guild_config
1619

1720
@app_commands.command(name="config_set_logs")
18-
@app_commands.describe(category="Which category of logs to configure")
21+
@app_commands.describe(setting="Which category of logs to configure")
1922
@app_commands.guild_only()
20-
@checks.ac_has_pl(7)
23+
# @checks.ac_has_pl(7)
24+
@app_commands.checks.has_permissions(administrator=True)
2125
async def config_set_logs(
2226
self,
2327
interaction: discord.Interaction,
@@ -44,7 +48,8 @@ async def config_set_logs(
4448

4549
@app_commands.command(name="config_set_channels")
4650
@app_commands.guild_only()
47-
@checks.ac_has_pl(7)
51+
# @checks.ac_has_pl(7)
52+
@app_commands.checks.has_permissions(administrator=True)
4853
async def config_set_channels(
4954
self,
5055
interaction: discord.Interaction,
@@ -76,7 +81,8 @@ async def config_set_channels(
7681
],
7782
)
7883
@app_commands.guild_only()
79-
@checks.ac_has_pl(7)
84+
# @checks.ac_has_pl(7)
85+
@app_commands.checks.has_permissions(administrator=True)
8086
async def config_set_roles(
8187
self,
8288
interaction: discord.Interaction,
@@ -112,7 +118,8 @@ async def config_set_roles(
112118

113119
@app_commands.command(name="config_get_roles")
114120
@app_commands.guild_only()
115-
@checks.ac_has_pl(7)
121+
# @checks.ac_has_pl(7)
122+
@app_commands.checks.has_permissions(administrator=True)
116123
async def config_get_roles(
117124
self,
118125
interaction: discord.Interaction,

0 commit comments

Comments
 (0)