From f39556afa07ec4e68e1d9b5e061736297bb5605c Mon Sep 17 00:00:00 2001 From: MuXinCG <202322130196@mail.sdu.edu.cn> Date: Mon, 16 Feb 2026 19:54:39 +0800 Subject: [PATCH] pass pytest --- EvoScientist/channels/slack/channel.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/EvoScientist/channels/slack/channel.py b/EvoScientist/channels/slack/channel.py index 21237f7..d5ad772 100644 --- a/EvoScientist/channels/slack/channel.py +++ b/EvoScientist/channels/slack/channel.py @@ -35,6 +35,14 @@ class SlackChannel(Channel): self._typing_message_ts: dict[str, str] = {} async def start(self) -> None: + if not self.config.bot_token: + raise ChannelError("Slack bot token is required") + if not self.config.app_token: + raise ChannelError( + "Slack app token is required for Socket Mode " + "(starts with xapp-)" + ) + try: from slack_sdk.web.async_client import AsyncWebClient from slack_sdk.socket_mode.aiohttp import SocketModeClient @@ -46,14 +54,6 @@ class SlackChannel(Channel): "Install with: pip install evoscientist[slack]" ) - if not self.config.bot_token: - raise ChannelError("Slack bot token is required") - if not self.config.app_token: - raise ChannelError( - "Slack app token is required for Socket Mode " - "(starts with xapp-)" - ) - self._web_client = AsyncWebClient( token=self.config.bot_token, proxy=self._get_proxy(),