Made up a script but I cannot fid the mistake Feel like a dummy!
Getting the error: “missing ) after argument list [:1:17]”.
Please help.
Nightbot is pulling this from pastebin:
There’s a lot going down that I’ll help breakdown. Whenever you send a command to nightbot, !hello for example, it will reply with a single message as the response. One command, one pre-set constant response. As needs for commands heighted came additional variables such as $(query) and $(urlfetch).
$(urlfetch) calls a remote url to retrieve and display a single response. It’s useful for building more complex commands that Nightbot does not support. The body that the remote url needs to return a response in plain text with less than 400 characters in its response.
Broadcaster: !addcom !lorem $(urlfetch https://loripsum.net/api/1/short/plaintext)
Broadcaster: !lorem
Nightbot: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Bork Quid enim? Duo Reges constructio interrete. Isto modo ne improbos quidem, si essent boni viri. Quid vero? Nemo igitur esse beatus potest.
Again the need for dynamic commands became requested and thus came $(eval) which added the idea running a limited version of Javascript. $(eval) allows simple javascript commands such as $(eval 2+2) to randomizers such an 8ball command.
8Ball Command
!commands add !8ball $(eval const responses = [‘All signs point to yes…’, ‘Yes!’, ‘My sources say nope.’, ‘You may rely on it.’, ‘Concentrate and ask again…’, ‘Outlook not so good…’, ‘It is decidedly so!’, ‘Better not tell you.’, ‘Very doubtful.’, ‘Yes - Definitely!’, ‘It is certain!’, ‘Most likely.’, ‘Ask again later.’, ‘No!’, ‘Outlook good.’, ‘Don't count on it.’]; responses[Math.floor(Math.random() * responses.length)]
In your example your loading a urlfetch of a pastebin, so Nightbot will replace this plain text into your command. If you have this urlfetch inside of another eval then your going to run into an issue running var rawText = $(urlfetch as that is not valid javascript syntax. What your attempting to do is far beyond what Nightbot’s parsing handles. Additionally any sort of AI generated code usually won’t work due to its hallucinations, Nightbot.say() doesn’t exist.