{"record":{"id":"08a56feda1aa04d6","repo":"DIYgod/RSSHub","slug":"telegram-sticker-pack-rss-is-disabled-due-to-the-l","errorCode":null,"errorMessage":"Telegram Sticker Pack RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/config#route-specific-configurations\">relevant config</a>","messagePattern":"Telegram Sticker Pack RSS is disabled due to the lack of <a href=\"https://docs\\.rsshub\\.app/deploy/config#route-specific-configurations\">relevant config</a>","errorType":"exception","errorClass":"ConfigNotFoundError","httpStatus":503,"severity":"error","filePath":"lib/routes/telegram/stickerpack.ts","lineNumber":29,"sourceCode":"    view: ViewType.Pictures,\n    example: '/telegram/stickerpack/DIYgod',\n    parameters: { name: 'Sticker Pack name, available in the sharing URL' },\n    features: {\n        requireConfig: false,\n        requirePuppeteer: false,\n        antiCrawler: false,\n        supportBT: false,\n        supportPodcast: false,\n        supportScihub: false,\n    },\n    name: 'Sticker Pack',\n    maintainers: ['DIYgod'],\n    handler,\n};\n\nasync function handler(ctx) {\n    if (!config.telegram || !config.telegram.token) {\n        throw new ConfigNotFoundError('Telegram Sticker Pack RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/config#route-specific-configurations\">relevant config</a>');\n    }\n    const name = ctx.req.param('name');\n    const token = config.telegram.token;\n    const response = await ofetch(`https://api.telegram.org/bot${token}/getStickerSet?name=${name}`);\n\n    const list = response.result.stickers.map((item) => ({\n        title: item.emoji,\n        description: item.file_id,\n        guid: item.file_id,\n    }));\n\n    const items = await Promise.all(\n        list.map((item) =>\n            cache.tryGet(`telegram:stickerpack:${item.guid}`, async () => {\n                const response = await ofetch(`https://api.telegram.org/bot${token}/getFile?file_id=${item.guid}`);\n                item.description = `<img src=\"https://api.telegram.org/file/bot${token}/${response.result.file_path}\" />`;\n                return item;\n            })","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/telegram/stickerpack.ts#L11-L47","documentation":"The Sticker Pack route uses the Telegram Bot API (api.telegram.org/bot<token>/getStickerSet) which requires a bot token. The handler throws ConfigNotFoundError when config.telegram or config.telegram.token is absent, because without a token the Bot API call cannot be authenticated.","triggerScenarios":"Requesting /telegram/stickerpack/:name on an RSSHub instance whose TELEGRAM_TOKEN environment variable (mapped to config.telegram.token) was never set or was emptied.","commonSituations":"Self-hosted RSSHub deployed without setting TELEGRAM_TOKEN; the token env var name changed or was removed from .env; the route is enabled by default but the operator did not opt into the Telegram config block.","solutions":["Set TELEGRAM_TOKEN in the RSSHub environment (.env) to a valid bot token from @BotFather and restart RSSHub.","Confirm config.telegram.token is actually read by checking lib/config.ts maps TELEGRAM_TOKEN correctly.","If you cannot obtain a bot token, disable the stickerpack route or remove it from your instance to avoid the error surfacing to users.","Generate/rotate the token with @BotFather if the existing one was revoked."],"exampleFix":"// before\nif (!config.telegram || !config.telegram.token) {\n    throw new ConfigNotFoundError('Telegram Sticker Pack RSS is disabled ...');\n}\n\n// after: keep the guard but make it operator-actionable\nif (!config.telegram?.token) {\n    throw new ConfigNotFoundError('Telegram Sticker Pack RSS requires TELEGRAM_TOKEN. Create a bot with @BotFather and set TELEGRAM_TOKEN in your RSSHub config.');\n}","handlingStrategy":"validation","validationCode":"import { config } from '@/config';\nfunction stickerPackAvailable(): boolean {\n    return Boolean(config.telegram?.token);\n}\n// expose route only when stickerPackAvailable(); otherwise it returns 404/disabled","typeGuard":"function hasTelegramBotToken(): boolean {\n    return Boolean(config.telegram && (config.telegram as { token?: string }).token);\n}","tryCatchPattern":"// at the route registration layer, gate the route:\nif (!hasTelegramBotToken()) {\n    // do not register the stickerpack route; or return a 404 with guidance\n}\n// inside handler, the existing throw is the fallback.","preventionTips":["Set TELEGRAM_TOKEN from @BotFather before enabling the route.","Gate the route registration on config presence so unconfigured routes are not exposed.","Document required env vars per route so operators know to set TELEGRAM_TOKEN.","Rotate the token via @BotFather if it is revoked."],"tags":["config","telegram","auth","environment"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}