Trying to make my own random generated response command

Can anyone help? I’m trying to make my own Random response generated command and nightbot keeps telling me (right hand side of Instanceof is not an object) can anyone tell me what I’m doing wrong? Here is my command as of now,

!commands add !maam Ma’am, this is a $(eval a=[‘McDonald’s’, ‘Wendy’s’, ‘Chick-fil-A’, ‘Burger King’, ‘Taco Bell’, ‘Chipotle’, ‘Jack in the Box’, ‘KFC’, ‘Popeyes’, ‘Sonic’, ‘Subway’];a[Math.floor(Math.random() * a.length)]:wink:


The quotation marks in the strings “McDonald’s” and “Wendy’s” need to be escaped, typically by typing \' instead of just '… or this issue can be sidestepped by using backticks instead of quotation marks to surround the strings. Here is a cleaned up version of your command:

!addcom -cd=5 !maam Ma’am, this is a $(eval a=[`McDonald's`,`Wendy's`,`Chick-fil-A`,`Burger King`,`Taco Bell`,`Chipotle`,`Jack in the Box`,`KFC`,`Popeyes`,`Sonic`,`Subway`];a[Math.floor(Math.random()*a.length)])

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