HKUDS/nanobot · error · ValueError

Slack user '{handle}' was not found. Use '@name' or a concre

Error message

Slack user '{handle}' was not found. Use '@name' or a concrete DM/channel ID.

What it means

Error "Slack user '{handle}' was not found. Use '@name' or a concrete DM/channel ID." thrown in HKUDS/nanobot.

Source

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

            )
            for member_value in cast(list[object], response.get("members", [])):
                member = cast(dict[str, Any], member_value)
                if self._member_matches_handle(member, normalized):
                    user_id = str(member.get("id") or "")
                    if not user_id:
                        continue
                    dm_id = await self._open_dm_for_user(user_id)
                    self._target_cache[cache_key] = dm_id
                    return dm_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 user '{handle}' was not found. Use '@name' or a concrete DM/channel ID."
        )

    async def _open_dm_for_user(self, user_id: str) -> str:
        web_api = self._require_web_api()
        response = cast(
            dict[str, Any],
            await web_api.conversations_open(users=user_id),
        )
        channel = cast(dict[str, Any], response.get("channel") or {})
        channel_id = str(channel.get("id") or "")
        if not channel_id:
            raise ValueError(f"Slack DM target for user '{user_id}' could not be opened.")
        return channel_id

    @staticmethod
    def _normalize_target_name(value: str) -> str:
        return value.strip().lstrip("#@").lower()

View on GitHub (pinned to 42f37dc4c0)

When it happens

Trigger: Thrown at nanobot/channels/slack/runtime.py:373 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/fc71de1e95ed3c71. Report an issue: GitHub.