FMK Command issues

Command i am putting in Error i am getting Unexpected token ‘%’

Any help please?

$(eval r=$(urlfetch json$(channel)/chatters);try%7Bc=JSON.parse(r).chatters;a=c.vips.concat(c.moderators,c.staff,c.admins,c.global_mods,c.viewers).filter(n=%3E![Nightbot,UnwantedUser3].some(o=%3En.toLowerCase()==o.toLowerCase()));t=[];if(a.length<3) throw not enough chatters in chat;for(i=0;i<3;i++){t.push(a.splice(Math.floor(Math.random()*a.length),1))}$(user), fuck ${t[0]}, marry ${t[1]}, kill ${t[2]}}catch(e){Error: ${e}.slice(0,400)})

Hey @mrniceguy57!

Please format your code as such, for example: put four spaces before it.

Syntax is your biggest issue actually: there’s no string quotes in your code, and some of your characters were URL encoded (hence the Unexpected token ‘%’ error).

I think you got it from this post, the way they formatted their code removed the required backticks, you wouldn’t have had the issue if you edited the previous code in the post the way they did it: “just replace the letters A, B, C with the words you want”; but that doesn’t explain the URL encoded characters, perhaps you pasted the code in a URL bar and pressed enter?

Anyway, here’s the fix:

$(eval r='$(urlfetch json$(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=>!['Nightbot','UnwantedUser3'].some(o=>n.toLowerCase()==o.toLowerCase()));t=[];if(a.length<3) throw 'not enough chatters in chat';for(i=0;i<3;i++){t.push(a.splice(Math.floor(Math.random()*a.length),1))}`$(user), fuck ${t[0]}, marry ${t[1]}, kill ${t[2]}`}catch(e){`Error: ${e}`.slice(0,400)})

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