Command no longer working

Hello,

I use Nightbot for a customized gambling command in my discord server, and it’s worked fine for several months (minus the few times it went down for servers). I pulled the code for the command from a help thread here and modified it a little to match my needs, but I’m really not sure how to troubleshoot it (especially since nothing has changed on my side, it’s just no longer working).

Here’s the code (I had to add remove the pastebin link bc no links allowed.):
$(eval z=decodeURIComponent;const a=z("$(querystring $(user))"),{die:b,responses:c}=JSON.parse(z("$(querystring $(urlfetch json pastebin link))")),d=(a=>Math.ceil(Math.random()*a))(b),e=((a,b)=>{const c=Object.keys(a).map(Number).sort((c,a)=>a-c);for(const d of c)if(b>=d)return a[d];throw new Error(“responses”)})(c,d);${a} rolls the dice and hits a **${d}**. ${e})

Here’s the contents of the pastebin (pastebin/com/raw/isHe61hS):

{
“die”: 1000,
“responses”: {
“2”: “Better luck next time! :game_die:”,
“23”: “Better luck next time! :game_die:”,
“25”: “Don’t give up! No one likes a quitter! :game_die:”,
“41”: “Not this time! Better luck next roll. :game_die:”,
“43”: “You’ll get it next time! Roll again. :game_die:”,
“68”: “Try again! :game_die:”,
“70”: “Just keep rolling! :game_die:”,
“99”: “Oh no! Better luck next time. :game_die:”,
“101”: “Not this time! Better roll again. :game_die:”,
“142”: “Try again! You’ll get it next time. :game_die:”,
“144”: “Call that a roll? Put some elbow grease into it! :game_die:”,
“315”: “Oh no! Better luck next time. :game_die:”,
“317”: “Just one more roll! Yeah, keep telling yourself that… :game_die:”,
“368”: “Just one more roll! Yeah, keep telling yourself that… :game_die:”,
“370”: “Just one more roll! Yeah, keep telling yourself that… :game_die:”,
“403”: “Not this time! Better roll again. :game_die:”,
“405”: “So close, but still no cigar. :game_die:”,
“419”: “So close, but still no cigar. :game_die:”,
“421”: “Maybe next time! :game_die:”,
“554”: “Nope, not this one. Roll again! :game_die:”,
“618”: “Nope, not this one. Roll again! :game_die:”,
“620”: “If you’re not first you’re last! Shake n Bake baby! :game_die:”,
“556”: “Not this roll! Maybe kiss the dice? :game_die:”,
“665”: “You’ll get it next time! :game_die:”,
“667”: “Good luck! You’ll need it. :game_die:”,
“736”: “Oof, maybe next roll? Try again! :game_die:”,
“738”: “Nope, not this one! You’ll get it next time. :game_die:”,
“776”: “Roll again! :game_die:”,
“778”: “So close, but so far away. Try again! :game_die:”,
“899”: “Can’t you taste the winning numbers!?! Roll again! :game_die:”,
“901”: “You’re not trying hard enough. Keep rolling! :game_die:”,
“999”: “Oof, better luck next time. :game_die:”,
“1”: "Congratulations to our next Loot Tink! <@&698297564499411005> ",
“24”: "The moment you give up, is the moment you let someone else win. - Kobe Bryant ~ Paying homage to the Legend Black Mamba! ",
“42”: “The meaning of life, the universe, and everything.”,
“69”: "Haha, nice. Congratulations to our next Loot Tink giggity! <@&698297564499411005> ",
“100”: "Congratulations to our next Loot Tink! <@&698297564499411005> ",
“143”: “lul <@&698297564499411005>”,
“316”: "Stone Cold would be so proud of you! And that’s the bottom line, ’cause Stone Cold said so! Congratulations to our next Loot Tink Cheers! <@&698297564499411005> ",
“369”: "3-6-9 Damn She Fine! Tribute to the Ying Yang Twins! ",
“404”: “Error: Not Found”,
“420”: "Blaze it and congratulations on becoming our next Loot Tink! <@&698297564499411005> “,
“555”: " Troll Time <@&698297564499411005>”,
“619”: "Rey Mysterio TIME!!! ",
“666”: "Congratulations on rolling the number of the Devil and becoming our next Loot Tink! <@&698297564499411005> ",
“737”: “You monster! There were people in that plane!”,
“777”: "Now that’s some good luck! Congratulations to our next Loot Tink! <@&698297564499411005> ",
“900”: "I consider skateboarding an art form, a lifestyle and a sport. - Tony Hawk ~ Paying homage to the king Tony Hawk! ",
“1000”: "Congratulations to our next Loot Tink! <@&698297564499411005> "
}
}
Basically, it randomly generates a number and pulls the appropriate string from the pastebin to print. It’s worked perfectly fine before two days ago, but now Nightbot only prints “Unexpected token R in JSON at position 0” and I have no idea why. Any help would be greatly appreciated!

Hey @somethingmossy!

Your Pastebin is set to private, it should be unlisted.

Ohhhhhh i see! Looks like pastebin updated and changed it to private because its SMART filters detected “potentially offensive content.” I guess I’ll have to see if I can get that appealed… thanks for letting me know!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.