DIYgod/RSSHub · error · ConfigNotFoundError
Discord RSS is disabled due to the lack of <a href="https://
Error message
Discord 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 Discord channel messages route requires server-side configuration of a Discord authorization token (config.discord.authorization). This token is a self-bot or user token used to read channel messages via Discord's API. If config.discord is not set or lacks the authorization field, a ConfigNotFoundError is thrown with a link to the configuration documentation.
Source
Thrown at lib/routes/discord/channel.ts:41
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false,
},
radar: [
{
source: ['discord.com/channels/:guildId/:channelId/:messageID', 'discord.com/channels/:guildId/:channelId'],
},
],
name: 'Channel Messages',
maintainers: ['TonyRL'],
handler,
};
async function handler(ctx) {
if (!config.discord || !config.discord.authorization) {
throw new ConfigNotFoundError('Discord RSS is disabled due to the lack of <a href="https://docs.rsshub.app/deploy/config#route-specific-configurations">relevant config</a>');
}
const { authorization } = config.discord;
const channelId = ctx.req.param('channelId');
const channelInfo = await getChannel(channelId, authorization);
const messagesRaw = await getChannelMessages(channelId, authorization, ctx.req.query('limit') ?? 100);
const { name: channelName, topic: channelTopic, guild_id: guildId } = channelInfo as APITextChannel;
const guildInfo = await getGuild(guildId, authorization);
const { name: guildName, icon: guidIcon } = guildInfo;
const messages = messagesRaw.map((message): DataItem => ({
title: message.content.split('\n', 1)[0],
description: renderDescription({ message, guildInfo }),
author: `${message.author.global_name ?? message.author.username}(${message.author.username})`,
pubDate: parseDate(message.timestamp),
updated: message.edited_timestamp ? parseDate(message.edited_timestamp) : undefined,
category: `#${channelName}`,View on GitHub (pinned to bed535e087)
Solutions
- Set the DISCORD_AUTHORIZATION environment variable in your RSSHub deployment with a valid Discord token.
- Refer to https://docs.rsshub.app/deploy/config#route-specific-configurations for the exact variable name.
- Obtain a Discord authorization token from your browser's Network tab (Authorization header in Discord web requests).
- Restart RSSHub after setting the environment variable to ensure it is picked up.
Defensive patterns
Strategy: validation
Validate before calling
// Check config at deployment time
if (!process.env.DISCORD_AUTHORIZATION) {
console.warn('DISCORD_AUTHORIZATION is not set — Discord routes will not work');
}
// Runtime guard in handler
if (!config.discord?.authorization) {
throw new ConfigNotFoundError('Discord RSS is disabled — set DISCORD_AUTHORIZATION');
} Type guard
function hasDiscordConfig(cfg: any): cfg is { discord: { authorization: string } } {
return cfg?.discord?.authorization != null && typeof cfg.discord.authorization === 'string' && cfg.discord.authorization.length > 0;
} Prevention
- Set DISCORD_AUTHORIZATION in your deployment environment before enabling Discord routes.
- Verify the token is valid by testing a Discord API call directly.
- Regularly check token validity — Discord user tokens can be revoked.
- Document required environment variables in your deployment README.
When it happens
Trigger: The handler checks config.discord and config.discord.authorization. If either is falsy, the route cannot authenticate to Discord's API and immediately throws. This is a deployment configuration issue, not a runtime or user-input error.
Common situations: Self-hosted RSSHub instance without DISCORD_AUTHORIZATION environment variable set; the env var was named incorrectly (e.g., DISCORD_TOKEN instead of DISCORD_AUTHORIZATION); the Discord account token expired or was revoked; the config file is malformed and config.discord is undefined.
Related errors
- Discord RSS is disabled due to the lack of authorization con
- Discord RSS is disabled due to the lack of authorization con
- Discourse RSS is disabled due to the lack of <a href="https:
- 缺少对应论坛的cookie.
- 缺少对应 loginUid 的 Bilibili 用户登录后的 Cookie 值 <a href="https://do
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/63bb656af433c8e6.
Report an issue: GitHub.