Nightbot custom command arguments

Currently my command is

$(eval a = `$(twitch $(channel) "{{uptimeLength}}")`;a.includes("hour")?a=parseInt(a)*60+59:a=parseInt(a);m=`$(urlfetch json$(1)/$(2))`;r=JSON.parse(m);m=0;w=0;l=0;c=new Date();c.setMinutes(c.getMinutes()-a);for(i=0;i<;i++){d=new Date([i].date);[i].mmr_change_to_last_game;if(d<c){break;}p>0?w+=1:l+=1;m+=p;} `${m >= 0 ? `Up ${m}` : `Down ${m}`}RR ${w}-${l}`;)

This command allows a user to search up the match history by entering two arguments
name tag

i was wondering if there was a way that a user can just enter it as one argument such as
butter#pop and it would be split by #

I would also like to know how I can bypass the character limit that the nightbot custom commands have? I know i can use pastebin but I dont see any tutorials on how to have code inside pastebin and fetch from there.

For example in this command i would also like to add if the channel status is offline the command would be disabled but it would be too long to add.

for this first portion, all u needa do is make that command the second command that a smaller command aliases to…
command 1…

$(eval `$(query)`.replace(`#`,` `))

then alias that to the command u have and u’re done… OR… i was able to tweak it enough to squeeze in the only work while u’re streaming functionality like this…

$(eval a=`$(twitch $(channel) "{{uptimeLength}}")`;b=(a)=>{a.includes("hour")?a=parseInt(a)*60+59:a=parseInt(a);m=`$(urlfetch json$(1)/$(2))`;r=JSON.parse(m);m=0;w=0;l=0;c=new Date();c.setMinutes(c.getMinutes()-a);for(i=0;i<;i++){d=new Date([i].date);[i].mmr_change_to_last_game;if(d<c){break;}p>0?w+=1:l+=1;m+=p} `${m>=0?`Up ${m}`:`Down ${m}`}RR ${w}-${l}`};a.includes(` not `)?`Please try again when I'm online`:b(a))

as far as the pastebin bit, well, i’m still learning that too… i know how to get data that way, but still working out how to run code from there


Thanks for sharing these insights mate as I found it very much useful and informative to be honest.

1 Like

Hello, thank you for providing some information on this topic

could you explain more on what you mean by the first part?

am i making a seperate command with just

$(eval `$(query)`.replace(`#`,` `))

and giving it an alias of the first command

example: my main command would be

$(eval up_time=`$(twitch $(channel) "{{uptimeLength}}")`;m='$(urlfetch json$(1)/$(2))';r = JSON.parse(m);s='$(twitch $(channel) "{{status}}")'; $(urlfetch json

and a secondary command

$(eval `$(query)`.replace(`#`,` `))

yes and yes, except u need to reverse them, so the tiny command is first

1 Like

Thank you i was able to get the command working.

1 Like