From ff382096f90f8402bb0e85888b4cc3ffb3723ca0 Mon Sep 17 00:00:00 2001 From: adan-ea <57812567+adan-ea@users.noreply.github.com> Date: Fri, 24 Nov 2023 23:31:35 +0100 Subject: [PATCH] Fix Twitch access token check and update Twitch avatar URL fetching --- src/modules/twitchLive/tasks/twitchAlert.cron.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/twitchLive/tasks/twitchAlert.cron.ts b/src/modules/twitchLive/tasks/twitchAlert.cron.ts index 6471953..65d6747 100644 --- a/src/modules/twitchLive/tasks/twitchAlert.cron.ts +++ b/src/modules/twitchLive/tasks/twitchAlert.cron.ts @@ -42,7 +42,7 @@ const streamersList = new Map(); export default function (): cron.ScheduledTask { return cron.schedule('* * * * *', () => { try { - if (!twitch.access_token) return; //logger.warn('Twitch access token is not defined'); + if (!twitch.access_token) return logger.warn('Twitch access token is not defined'); for (const guild of guildsCache) { handleGuild(guild); } @@ -142,8 +142,8 @@ export const sendLiveEmbed = async (streamData: Stream, twitchLive: ITwitchLive, ) as TextChannel; if (!channel) return; - const twitchAvatarURL: string = await ( - // @ts-ignore + const twitchAvatarURL: string = await // @ts-ignore + ( await fetch(`https://decapi.me/twitch/avatar/${user_name}`) ).text();