Lobby command sending nulls

I created this command (!setlobby) for setting the lobby command
edit !lobby $(1) - twitch.tv/$(1) | $(2) - twitch.tv/$(2) | $(3) - twitch.tv/$(3)| $(4) - twitch.tv/$(4)
but it only works if I provide 4 twitch usernames, when I provide only 1, 2 or 3 it just leaves them as “null”, how can I make it stop if it didn’t find $(2) or $(3) or $(4)?

mod command: !setlobby raedvlr
command: !lobby
response: raedvlr - twitch.tv/raedvlr | null - twitch.tv/null | null - twitch.tv/null| null - twitch.tv/null

This should do the trick:

!addcom !setlobby -ul=moderator -a=!editcom !lobby $(eval S=[];P=decodeURIComponent(`$(querystring)`).replace(/@/g,``).split(` `);for(x in P){S.push(` ${P[x].replace(`%`,``)}${P[x].includes(`%`)?` `:` - twitch.tv/${P[x]}`} `)}S.join(`|`))

Thank you very much, I appreciate your help <3

is it possible to put like an % before the username to skip the URL part? and just put the username?
!setlobby raedvlr %assistval
Response would be: raedvlr - twitch.tv/raedvlr | assistval

Yes I edited the command above so now if u include a % there is no link

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.