I tryed out some coding with the nightbot. But iam struggle at the moment because I have no idea how to solve it.
I breakdown this script to this short test code:
The command looks like:
!setnumber usernum
For example:
!setnumber 2
And i wanna trigger test2 but he calls me unexpected token ‘{’
$(eval var usernum = “$(1)”;
If (usernum == “1”) {“test1”}
Else if (usernum == “2”) {test2}
Else if (usernum == “3”) {test3}
Else {Error})
I try something different but there is the same error. What do iam wrong?
(I also try for $(1) this $(query) but nothing changed. And it’s important for me to do $(1) because I want to add there later more input variables for $(2) $(3) and so on.
Hey iam struggle now at the last point of integration. I think about the creation of this command with a command in chat. Is this the way to get this working? Or I forgot something?
Apologies for the delay in response. Unfortunately you cannot trigger eval before aliases. Data passed in the “message” field is passed as arguments to the alias.
In other words:
You have a command !test with !testalias as the alias and some data as the message.
You use the command !test
!testalias is called internally as !testalias some data