hi, i wass trying to od a command that only worcks when im streaming cuz if ppl use it when im offline its weird im talking about !song info comand i have this:
$(twitch $(channel) “{{uptimeLength}}”)(eval u=‘$(twitch $(channel) “{{uptimeLength}}”)’; if(u===‘channel is not live’){‘Just offline’} else{‘$(lastfm LASTFMNAMEACC “{{title}} by {{artist}}”)’})
u’re pretty much there, i would only make a few minor alterations…
$(eval u=`$(twitch $(channel) "{{uptimeLength}}")’; if(u.toLowerCase()===`channel is not live`){`Just offline`} else{`$(lastfm LASTFMNAMEACC "{{title}} by {{artist}}")`})
Damn ty man now i seems that works but sadly my idea of ‘$(twitch $(channel) “{{uptimeLength}}”) doesnt works just appear Invalid or unexpected token have any idea to know if channel is streaming or not? sry for my bad english ;-;
it seems like the issue is with the $(channel) in $(twitch $(channel) "{{uptimeLength}}")… if u put the actual channel name it should work… not sure y that would give it an issue, but i actually have used that in several commands, but i always used the actual channel name when i did it
actually, nvm, i just tried it and that didn’t work either… but it works perfectly fine in this command, lol…
$(eval a="$(twitch DarthCentauri "{{uptimeLength}}")".split(" ");if(a[0]=="channel"){"Darth is not online right now, but come back on Wednesdays and Fridays at 7pm eastern time and 8pm on Saturdays. Or you can follow and catch those random streams too!"}else{b=5;c=0;d=" ";e=0;while(b==5){f=a[c][0];d+=a[c];if(f=="d"||f=="h"){d+=","};d+=" ";if(a[e]=="second"||a[e]=="seconds"){d+="and "};if(a[c]=="second"||a[c]=="seconds"){b=9};c++;e=c+2};"Darth has been kickin ass and takin names for"+d})
wow, that is old code, i wouldn’t do it like that anymore XD
well… i’m not sure what i did, but i fixed it, lol… at least the offline part… no idea what that music stuff is or if it works… but here ya go ^^
$(eval u=`$(twitch $(channel) "{{uptimeLength}}")`;if(u.toLowerCase()===`channel is not live`){`Just offline`} else{`$(lastfm LASTFMNAMEACC "{{title}} by {{artist}}")`})
tf u do man its 99 times ez code and now works cant belive ty so much atleast my 1st idea works only need someone to fix it XDDD nightbot should just add only online command option