From d434507b9b42857635961903f307415f9d0bc4dd Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Sat, 6 Jan 2024 17:28:26 +1100 Subject: [PATCH] Fix variables being missing during the Redis attack. --- src/modules/YTModule.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/YTModule.ts b/src/modules/YTModule.ts index 7d44a8b..27b7ad6 100644 --- a/src/modules/YTModule.ts +++ b/src/modules/YTModule.ts @@ -20,6 +20,9 @@ export default async(client:TClient)=>{ DiscordChannelID = channel.dataValues.dcchannel; DiscordRoleID = channel.dataValues.dcrole; + if (!YTChannelID) return; + if (!DiscordChannelID ?? !DiscordRoleID) throw new Error('[YTModule] Discord channel/role ID is missing.'); + try { await Undici.request(`https://youtube.googleapis.com/youtube/v3/activities?part=snippet&channelId=${YTChannelID}&maxResults=2&key=${(await TSClient()).youtube}`, { signal: AbortSignal.timeout(10000),