DIYgod/RSSHub · error · ConfigNotFoundError
Telegram Sticker Pack RSS is disabled due to the lack of <a
Error message
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>
What it means
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.
Source
Thrown at lib/routes/telegram/stickerpack.ts:29
view: ViewType.Pictures,
example: '/telegram/stickerpack/DIYgod',
parameters: { name: 'Sticker Pack name, available in the sharing URL' },
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false,
},
name: 'Sticker Pack',
maintainers: ['DIYgod'],
handler,
};
async function handler(ctx) {
if (!config.telegram || !config.telegram.token) {
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>');
}
const name = ctx.req.param('name');
const token = config.telegram.token;
const response = await ofetch(`https://api.telegram.org/bot${token}/getStickerSet?name=${name}`);
const list = response.result.stickers.map((item) => ({
title: item.emoji,
description: item.file_id,
guid: item.file_id,
}));
const items = await Promise.all(
list.map((item) =>
cache.tryGet(`telegram:stickerpack:${item.guid}`, async () => {
const response = await ofetch(`https://api.telegram.org/bot${token}/getFile?file_id=${item.guid}`);
item.description = `<img src="https://api.telegram.org/file/bot${token}/${response.result.file_path}" />`;
return item;
})View on GitHub (pinned to bed535e087)
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.
Example fix
// before
if (!config.telegram || !config.telegram.token) {
throw new ConfigNotFoundError('Telegram Sticker Pack RSS is disabled ...');
}
// after: keep the guard but make it operator-actionable
if (!config.telegram?.token) {
throw new ConfigNotFoundError('Telegram Sticker Pack RSS requires TELEGRAM_TOKEN. Create a bot with @BotFather and set TELEGRAM_TOKEN in your RSSHub config.');
} Defensive patterns
Strategy: validation
Validate before calling
import { config } from '@/config';
function stickerPackAvailable(): boolean {
return Boolean(config.telegram?.token);
}
// expose route only when stickerPackAvailable(); otherwise it returns 404/disabled Type guard
function hasTelegramBotToken(): boolean {
return Boolean(config.telegram && (config.telegram as { token?: string }).token);
} Try / catch
// at the route registration layer, gate the route:
if (!hasTelegramBotToken()) {
// do not register the stickerpack route; or return a 404 with guidance
}
// inside handler, the existing throw is the fallback. Prevention
- 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.
When it happens
Trigger: Requesting /telegram/stickerpack/:name on an RSSHub instance whose TELEGRAM_TOKEN environment variable (mapped to config.telegram.token) was never set or was emptied.
Common situations: 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.
Related errors
- TELEGRAM_SESSION is not configured
- Cannot start TG: ${err}
- Authentication failed. Access denied.\n${requestPath}
- Login required
- Disqus RSS is disabled due to the lack of <a href="https://d
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/08a56feda1aa04d6.
Report an issue: GitHub.