Modified !random command for unlimited filtered names

Found the following !random command in this forum for choosing a username from someone in chat and I’d love to modify it to have it point to a paste.gg link that could include unlimited usernames to filter in order to get around the character limit of the command message.

$(eval r=$(urlfetch json http://tmi.twitch.tv/group/user/$(channel)/chatters);try{c=JSON.parse(r).chatters;a=c.vips.concat(c.moderators,c.staff,c.admins,c.global_mods,c.viewers).filter(n=>![$(user),'Nightbot','Anotherttvviewer', 'Cardboard_live', 'Commanderroot', 'Lurxx', 'metaviews', 'Rewardtts', "Streamelements"].some(o=>n.toLowerCase()==o.toLowerCase()));a.length?a[Math.floor(Math.random()*a.length)]:"No chatters"}catch(e){Couldn’t fetch the list of chatters: ${e}: ${r}.slice(0,400)})

Hey @evalhelpquestion!

Can you please link the topic instead of copying the command without formatting the text to code? It’d makes our lives easier.

I could already have solved your topic, but I have to correct all the issues the lack of formatting has caused first, or I could have looked for which topic you got the code from, but it’s time we volunteers don’t have.

And in the future, if you need to format text as code, you have three options:

  • put the code after four spaces on a new line, with the previous line being empty,
  • put the code between three backticks ` on new lines on each ends of the code,
  • use the preformatted text button 221204221149 (6th one) or Ctrl+E.

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