Im new to this Forum and I havent found any Question or Answer that can help me.
I want to do a !me command that responds to the user that calls it.
I am able to urlfetch a raw pastebin document and save it in an array, with each line being split accordingly with a split char (§ in my case).
Now i want to iterate this array and no matter what I do, i alway get “Right hand side of ‘instanceof’ is not an object”.
FeelsBadMan.
Here is my code:
$(eval var a = "$(urlfetch https://pastebin.com/raw/CU40yg5v)".split("§");
var user = "$(user)";
for(int i = 0; i < a.length; i++){
if(a[i].startsWith(user)){
a[i].split(":")[1]; }}})
I cant get it to work. Can anyone give me a hint on what im doing wrong?
Looks like you want Nightbot to search through the array and look for whatever item matches the user’s name, then output the phrase associated with the name (ie. it should output ‘cmonBruh’ for Craktil), so I edited the code such that it’ll output some error message if it fails to find a username in the array: