fix(twitch): Fix broken imports

This commit is contained in:
2026-05-31 06:42:18 +10:00
parent d1368af74b
commit 1c1c109860
2 changed files with 9 additions and 5 deletions
+7 -3
View File
@@ -5,14 +5,15 @@ from twitchio import PartialUser
from twitchio.ext import commands as cmds
from meta import Bot
from twitch.client import TwitchCmdClient
from utils.lib import utc_now
from . import logger
from ..customcmd.data import CustomCmd, CustomCmdData
from ..customcmd.client import ExecClient
from ..customcmd.parser import ExecContext
from . import logger
from .client import TwitchCmdClient
# TODO: Make an alphacroc or croccyalpha client for testing
# TODO: Fix the tracker not actually guarding the commands properly
@@ -58,13 +59,16 @@ class CustomCmdComponent(cmds.Component):
# Make sure the command parses (can't guarantee it runs, but at least it can parse)
try:
await self.cmdclient.run_command(ExecContext(args=[], content=""), response)
await self.cmdclient.run_command(
ExecContext(args=[], content=""), response, dryrun=True
)
except Exception:
# TODO: Nicer errors for pinpointing problem
await ctx.reply(f"Sorry, could not parse your command!")
logger.info(
f"Failed to parse attempted customcmd '{response}'", exc_info=True
)
return
# If everything is good, add it to the table
# TODO: Again, permission resolution