Unexpected identifier

Asked Aug 17, 2022·2 replies·Last activity 4 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

Hello! I've been playing around with this command, at one time I had it working, but now it's just returning with "unexpected identifier" Any help would be awesome!

!editcom !slap $(user) has slapped $(touser) with a $(eval a=[a blue teapot near the window, a glizzy, crack rock, the groundhog that keeps bothering Daze, 2 cans, my will to live]a[Math.floor(Math.random()*a.length)])

2 replies

Hiya, you forgot closing the array of items: ;

js
!editcom !slap $(user) has slapped $(touser) with a $(eval a=[`a blue teapot near the window`, `a glizzy`, `crack rock`, `the groundhog that keeps bothering Daze`, `2 cans`, `my will to live`]; a[Math.floor(Math.random()*a.length)])

AH! Thank you so much! I stared at that for so long.