Hey! I’m getting an annoying error that I’m sure is caused by my poor syntax. I’ve only ever used Java and C++ so I’m having trouble adjusting to JavaScript.
The purpose of the code is to basically count 3 different values based on the argument from nightbot using $(1), using just one command. I have this working fine with three separate commands, but I can’t force a cd from one command onto the others. So if someone calls !card1 they can still call !card2 which is a problem. My solution was to try and combine them all into one command, !card.
Okay, just as a final note, I ended up changing the code because NightBot was accessing the URLs regardless of the if statements. The new code is like this:
Okay, so it worked great for one day, and then completely broke down afterwards.
The code I’m using to display the results is breaking, having a " Cannot read property ‘length’ of null" error and otherwise display the wrong results for card 3, usually duplicating those of card 2. Can anyone look over this code and tell me what’s wrong? This code is just an edited version of something RokettoJanpu wrote for someone else, so I’m not 100% sure what’s going on: