{"record":{"id":"e667f0ac28432641","repo":"DIYgod/RSSHub","slug":"discord-rss-is-disabled-due-to-the-lack-of-authori","errorCode":null,"errorMessage":"Discord RSS is disabled due to the lack of authorization config","messagePattern":"Discord RSS is disabled due to the lack of authorization config","errorType":"exception","errorClass":"ConfigNotFoundError","httpStatus":null,"severity":"error","filePath":"lib/routes/discord/quest.ts","lineNumber":38,"sourceCode":"        antiCrawler: false,\n        supportBT: false,\n        supportPodcast: false,\n        supportScihub: false,\n    },\n    radar: [\n        {\n            source: ['discord.com/quest-home'],\n        },\n    ],\n    name: 'Quests',\n    maintainers: ['TonyRL'],\n    handler,\n};\n\nasync function handler() {\n    const { authorization } = config.discord || {};\n    if (!authorization) {\n        throw new ConfigNotFoundError('Discord RSS is disabled due to the lack of authorization config');\n    }\n\n    const questData = await getQuests(authorization);\n\n    const items = questData.quests.map((quest) => {\n        const tasks = Object.values(quest.config.task_config.tasks).map((task) => task.event_name);\n        return {\n            title: `${quest.config.messages.quest_name} - Claim ${quest.config.rewards_config.rewards[0].messages.name}`,\n            description: tasks.join(', '),\n            author: quest.config.messages.game_publisher,\n            pubDate: parseDate(quest.config.starts_at),\n            category: tasks,\n            link: quest.config.application.link.split('?', 1)[0],\n            guid: quest.id,\n        };\n    });\n\n    return {","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/discord/quest.ts#L20-L56","documentation":"The Discord quests route requires config.discord.authorization to be set. The handler destructures authorization from config.discord (defaulting to {}), and if it is falsy, throws ConfigNotFoundError. Without the authorization token, the route cannot call getQuests() which reads Discord's quest/activity API.","triggerScenarios":"config.discord is either undefined or an object without an authorization property. The handler immediately exits before making any API calls. This is the same root cause as error 173 but in the quests route — the config check is duplicated across Discord routes.","commonSituations":"DISCORD_AUTHORIZATION environment variable not set; token was valid but has since expired; the deployment's config module does not properly parse the env var into config.discord.authorization; new deployment that hasn't been configured yet.","solutions":["Set DISCORD_AUTHORIZATION in your environment or .env file.","Verify the token is still valid by making a test Discord API call.","Check the RSSHub config loading code to ensure the env var maps correctly to config.discord.authorization.","Restart the RSSHub process after configuration changes."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!config.discord?.authorization) {\n    throw new ConfigNotFoundError('Set DISCORD_AUTHORIZATION to use Discord quest routes');\n}","typeGuard":"function hasDiscordAuth(cfg: any): cfg is { discord: { authorization: string } } {\n    return typeof cfg?.discord?.authorization === 'string' && cfg.discord.authorization.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Set DISCORD_AUTHORIZATION environment variable.","Use a shared config check helper to avoid duplicating the guard across Discord routes.","Test the token periodically since Discord tokens can expire."],"tags":["discord","configuration","authentication","config-not-found","self-hosted"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}