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(),