{"record":{"id":"4850fb89eb9a03cf","repo":"HKUDS/nanobot","slug":"webhook-secret-token-must-be-1-256-characters-usin","errorCode":null,"errorMessage":"webhook_secret_token must be 1-256 characters using only A-Z, a-z, 0-9, _ and -","messagePattern":"webhook_secret_token must be 1-256 characters using only A-Z, a-z, 0-9, _ and -","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"nanobot/channels/telegram/runtime.py","lineNumber":453,"sourceCode":"            raise ValueError('webhook_path must start with \"/\"')\n        return value\n\n    @model_validator(mode=\"after\")\n    def validate_webhook_config(self) -> \"TelegramConfig\":\n        if self.mode != \"webhook\":\n            return self\n\n        url = self.webhook_url.strip()\n        if not url:\n            raise ValueError(\"webhook_url is required when Telegram mode is webhook\")\n        parsed = urlparse(url)\n        if parsed.scheme != \"https\" or not parsed.netloc:\n            raise ValueError(\"webhook_url must be a public HTTPS URL\")\n        secret = self.webhook_secret_token.strip()\n        if not secret:\n            raise ValueError(\"webhook_secret_token is required when Telegram mode is webhook\")\n        if len(secret) > 256 or re.match(r\"^[A-Za-z0-9_-]+$\", secret) is None:\n            raise ValueError(\n                \"webhook_secret_token must be 1-256 characters using only A-Z, a-z, 0-9, _ and -\"\n            )\n        return self\n\n\nclass TelegramChannel(BaseChannel):\n    \"\"\"\n    Telegram channel using long polling or webhook mode.\n\n    Long polling is the default. Webhook mode requires a public HTTPS URL and a\n    Telegram secret token.\n    \"\"\"\n\n    name = \"telegram\"\n    display_name = \"Telegram\"\n\n    # Commands registered with Telegram's command menu\n    BOT_COMMANDS: list[BotCommand] = [","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/channels/telegram/runtime.py#L435-L471","documentation":"Error \"webhook_secret_token must be 1-256 characters using only A-Z, a-z, 0-9, _ and -\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/channels/telegram/runtime.py:453 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}