I saw this command in another thread but when I use it when offline it still shows.
$(eval u=$(twitch $(channel) "{{uptimeLength}}");if(u.toLowerCase()===channel is not live){Just offline} else{$(lastfm LASTFMNAMEACC "{{title}} by {{artist}}")})
The key is to check whether the streamer is live, and if not, send a string thatās made of a space, the bot wonāt throw an error, and the chat will automatically discard the message as empty:
The following commands can be tried,Replace the following text with āMESSAGE_LIVEā and āMESSAGE_OFFLIVEā.
$(eval s = $(twitch $(touser) "{{status}}"); s == āliveā ? $(twitch $(touser) "{{displayName}} is now ${s} MESSAGE_LIVE") : s == āofflineā ?$(twitch $(touser) "{{displayName}} is now ${s} MESSAGE_OFFLIVE") : ``;)
What do you mean by that? Because that command doesnāt send a response when Iām not live, so if it does for you, then you must have made a mistake in editing the code I provided.
Oh sorry, I meant that as working as intended (not showing in offline chat). But I messed it up for how it shows when online because now it shows an error:
What I think happened is that the quotes in your code were updated from " and ' to āā and āā, which usually happens when the code is copied in a word processor app, such as Microsoft Word for example, the issue is that JavaScript doesnāt recognize the latter quotes. To avoid it, copy/paste the code we provide on the forum directly in your Twitch chat, or in Nightbotās dashboard, and edit the code there, or use a note app, they donāt usually format the quotes, such as Notepad for example.