From 8d5e19753d7680d0c1b750231e127c4ea12ec6aa Mon Sep 17 00:00:00 2001 From: Brian Le Date: Tue, 24 Oct 2023 12:34:19 -0700 Subject: [PATCH] Fix log header in spotify manager (#1758) --- src/helpers/spotify_manager.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/helpers/spotify_manager.ts b/src/helpers/spotify_manager.ts index 05771d37b..c78e946ed 100644 --- a/src/helpers/spotify_manager.ts +++ b/src/helpers/spotify_manager.ts @@ -95,9 +95,14 @@ export default class SpotifyManager { truncated: false, }; - const logHeader = `${getDebugLogHeader( - (messageContext || interaction)!, - )}, playlistID = ${playlistID}`; + let logHeader: string; + if (messageContext || interaction) { + logHeader = `${getDebugLogHeader( + (messageContext || interaction)!, + )}, playlistID = ${playlistID}`; + } else { + logHeader = `guildID = ${guildID}. playlistID = ${playlistID}`; + } if ( !process.env.SPOTIFY_CLIENT_ID ||