Character Limit - Command to store and deduct number from Followers (Follow-Bots)

Hi,

some Background Info

There are a lot of Followbots on Twitch and some Viewers complain,
when Streamers celebrate this fake numbers.
There is a way to ban/block them via Commander Root Tools
but only with actual Streamer Account access.
Since you could accidentally kick all your followers this isn’t something that i would want a unexperienced streamer to perform and kill all his progress.

So my Idea was to simply add a !followers command that would deduct the number of known Bots from the Commander Root Site (which can be checked by every Mod) from the Twitch numbers.
Since there is no way to save values directly in Nightbot i used the CustomAPI Quote System to have a command for all the Mods to Update the Known Bots number.

That gave me 3 commands:

!followers - (split + join because of the added thousands separator)

has already $(eval "$(twitch $(channel) "{{followers}}")".split(",").join("") - $(urlfetch https://twitch.center/customapi/quote?token=d1d06372&data=1&no_id=1); ) Followers. *Not including known Bots

!setbots x - (1x quote needed to be created first)

$(urlfetch https://twitch.center/customapi/editquote?token=176fd9d9e5804630&data=1 $(querystring)&silent=1)

!getbots

$(urlfetch https://twitch.center/customapi/quote?token=d1d06372&data=1&no_id=1)

Following that my idea was to make one !bots command with multiple arguments.
This generally works but isnt pretty (not a programmer).
Problem is that the URL’s blow this beyond the 500 character limit

!bots get | set x | url

$(eval 
input="$(1)";
number="$(2)";
channel="$(channel)";

if(input=="set")
	{$(urlfetch twitch.center/customapi/editquote?token=176fd9d9e5804630&data=1 number&silent=1);
	output="Bots set to "+$(urlfetch twitch.center/customapi/quote?token=d1d06372&data=1&no_id=1);}
else if(input=="get")
	{output="Bots are set to "+$(urlfetch twitch.center/customapi/quote?token=d1d06372&data=1&no_id=1);}
else if(input=="link"||a=="url")
	{output="Click on Link and set known Bots to yes twitch-tools.rootonline.de/followerlist_viewer.php?channel="+channel;}
else
	{output="No valid argument given. Arguments are: set <number> = set the bot count. get = get the bot count. url or link = get the CommanderRoot-Link;"}
output;)

Now i now i can put this on to pastebin and make a urlfetch for everything bigger, but i have to convert it somehow to json and also cant use nightbot commands?

Anyone who could help me with some more infos on that?

Maybe i’m going to the wrong direction or i missunderstand something completely,
or having some major format issues?

$(eval const INPUT= "$(1)"; const NUMBER= "$(2)"; const CHANNEL="$(channel)"; $(urlfetch json https://pastebin.com/raw/MS2Jvw2k); ${OUTPUT};)

Pastebin

const OUTPUT = "";

switch (INPUT()) {
  case "set":
    $(urlfetch twitch.center/customapi/editquote?token=176fd9d9e5804630&data=1 ${NUMBER}&silent=1);
	const OUTPUT = "Bots set to "+$(urlfetch twitch.center/customapi/quote?token=d1d06372&data=1&no_id=1);
    break;
  case "get":
    const output= "Bots are set to "+$(urlfetch twitch.center/customapi/quote?token=d1d06372&data=1&no_id=1);
    break;
  case "link":
  case "url":
    const OUTPUT = "Click on Link and set known Bots to yes twitch-tools.rootonline.de/followerlist_viewer.php?channel="+${CHANNEL};
    break;
  default:
   const OUTPUT = "No valid argument given. Arguments are: set <number> = set the bot count. get = get the bot count. url or link = get the CommanderRoot-Link";
        break;
    }
  }
}

first, i’d have to say u shouldn’t share your quote list token, and after working on this that should be changed… i also don’t think urlfetch will work from inside the paste, could be wrong there… and u’ll have to rearrange some stuff and use an alias, because the way nightbot reads command variables like urlfetch, it will always do the urlfetch whether the code leads there or not… aka if u don’t type “set” it will still do that urlfetch and if there’s no second argument it will save the error for lack of second argument into the quote system replacing the number u would’ve put in earlier… i’m rather experienced with this sort of thing, so i’ll tinker and see if i can squeeze all that in

ok, so this is what i came up with… kinda over condensed the first command cause i expected more to go in it, lol, but yeah…
first command…

$(eval i=`$(1)`;i==`set`?`1 1 $(2)`:i==`get`?`1 0 0`:i==`link`||i==`url`?`0 0 0`:`-1 0 0`)

aliased to second command…

$(eval `$(urlfetch https://twitch.center/customapi/editquote?token=176fd9d9e5804630&data=$(2)%20$(3))`;i=$(1);i>0?`Bots ${$(2)<1?`are `:``}set to $(urlfetch https://twitch.center/customapi/quote?token=d1d06372&data=1&no_id=1)`:i==0?`Click on Link and set known Bots to yes twitch-tools.rootonline.de/followerlist_viewer.php?channel=$(channel)`:`No valid argument given. Arguments are: set <number> = set the bot count. get = get the bot count. url or link = get the CommanderRoot-Link`)

and i tested it, it works ^^
p.s. it’s defo not as pretty, but all the spaces, tabs and carriage returns r characters and count against your character limit

1 Like

First of all, thanks for that great solution.
The tokens are from a test account, so not in use besides testing.
Didn’t know you could call a 2nd command as alias ,
and also shorten the logic down so much.

I was even able to check for 2nd arg as number for the set, which i guess is the shortest way to do it?

$(eval i=`$(1)`;n=`$(2)`;i==`set`&&!isNaN(n)?`1 1 $(2)`:i==`get`?`1 0 0`:i==`link`||i==`url`?`0 0 0`:`-1 0 0`)

So based on the alias logic, couldn’t one technically create a long chain of commands with passing through the inputs as outputs?

no problemo ^^
ok, that’s cool, i have a couple test ones too, lol
i’m also curious to know if that works… before i say this, i’ve found it is best to take in the arguments as strings like we did there, because u can get other crazy errors that would transfer into the quote list if u don’t… but i’m not sure how js’s data type flexibility will work with that “isNaN” and the data being taken in as a string (what i do is n='$(2)';i=='set'&&n==n*1) because technically it is NaN (not a number)

and for the bad news… u can only link 2 commands together by alias… what i would give for just a 3rd… i could do so much more with just a 3rd

p.s. well, ok, not entirely accurate… u can link as many commands as u want, to the same alias… but u can’t go to another alias after already going to one

1 Like

srry for late respone yes it works perfectly, thanks again for the help :+1:

If anyone wanna use it:

Installing it

  1. Click this to get 3 commands with public (short) and secret token (long one)
  2. Create a command from 2nd one of Step 1 (with addquote in it)
  3. use that new command to set 1 new #1 quote
  4. Delete that command again
  5. Add the commands below, but change out the tokens

!followers

$(channel) has already $(eval "$(twitch $(channel) "{{followers}}")".split(",").join("") - $(urlfetch https://twitch.center/customapi/quote?token=d1d06372&data=1&no_id=1); ) Followers. *Not including known Bots

!bot (set as alias for !zbotfetch)

$(eval i=`$(1)`;n=`$(2)`;i==`set`&&!isNaN(n)?`1 1 $(2)`:i==`get`?`1 0 0`:i==`link`||i==`url`?`0 0 0`:`-1 0 0`)

!zbotfetch

$(eval `$(urlfetch https://twitch.center/customapi/editquote?token=176fd9d9e5804630&data=$(2)%20$(3))`;i=$(1);i>0?`Bots ${$(2)<1?`are `:``}set to $(urlfetch https://twitch.center/customapi/quote?token=d1d06372&data=1&no_id=1)`:i==0?`Click on Link and set known Bots to yes twitch-tools.rootonline.de/followerlist_viewer.php?channel=$(channel)`:`No valid argument given. Arguments are: set <number> = set the bot count. get = get the bot count. url or link = get the CommanderRoot-Link`)

Using it

  1. Get the Link with !bot url and click it
  2. Login via Twitch and wait until loaded
  3. Set “Is known bot” to Yes and note Filtered follows
  4. Set “Is known bot” to Any and set “Is disabled” to Yes and note Filtered follows
  5. Use command !bot set x and replace x with bot and disabled numbers combined
  6. You can check again with !bot get or !followers
1 Like

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