HKUDS/nanobot · error · ValueError

Slack channel ' ' was not found. Use a joined channel name…

Error message

Slack channel '{name}' was not found. Use a joined channel name like '#general' or a concrete channel ID.

What it means

Lookup failure in _resolve_channel_name: pagination over conversations.list exhausted without finding a channel whose name matches the target. Either the channel doesn't exist, the bot isn't a member, or the token lacks visibility. The message guides the user toward a joined channel name or a concrete ID.

Solutions

  1. Invite the bot to the channel (/invite @bot) so it becomes visible in conversations.list
  2. Use the concrete channel ID (starts with 'C') instead of the name
  3. Check for typos and ensure the Slack token has the conversations:read scope
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at nanobot/channels/slack/runtime.py:335 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/nanobot@42f37dc4c0 (2026-08-26). Data as JSON: /api/errors/429b2c8519a8fddd. Report an issue: GitHub.

Appendix: source

Thrown at nanobot/channels/slack/runtime.py:335

                limit=200,
                cursor=cursor,
            ))
            for channel_value in cast(list[object], response.get("channels", [])):
                channel = cast(dict[str, Any], channel_value)
                if self._normalize_target_name(str(channel.get("name") or "")) == normalized:
                    channel_id = str(channel.get("id") or "")
                    if channel_id:
                        self._target_cache[cache_key] = channel_id
                        return channel_id
            response_metadata = cast(
                dict[str, Any],
                response.get("response_metadata") or {},
            )
            cursor = str(response_metadata.get("next_cursor") or "").strip()
            if not cursor:
                break

        raise ValueError(
            f"Slack channel '{name}' was not found. Use a joined channel name like "
            f"'#general' or a concrete channel ID."
        )

    async def _resolve_user_handle(self, handle: str) -> str:
        normalized = self._normalize_target_name(handle)
        if not normalized:
            raise ValueError("Slack target user handle is empty")

        cache_key = f"user:{normalized}"
        if cache_key in self._target_cache:
            return self._target_cache[cache_key]

        cursor: str | None = None
        web_api = self._require_web_api()
        while True:
            response = cast(
                dict[str, Any],

View on GitHub (pinned to 42f37dc4c0)