Hey @killer_virus!
Heroku stopped offering free services, so that may be why the API these commands rely on is dead.
That said, if you found this set of commands, I’m sure you saw our answer on how to make a similar command from scratch: Riddle Command for Nightbot - #10 by Emily
But, I understand you want something a bit different than the command we built there, so here’s how to re-create the command you wanted to use using Nightbot and Pastebin:
First create a Pastebin account so you can go back to your pastes later to edit them, then create a paste following the template below, and save it as “public” or “unlisted”, but not “private.”
[{
"riddle": "YOUR_FIRST_RIDDLE",
"answer": "YOUR_FIRST_ANSWER"
},
{
"riddle": "YOUR_SECOND_RIDDLE",
"answer": "YOUR_SECOND_ANSWER"
},
// ...
{
"riddle": "YOUR_LAST_RIDDLE",
"answer": "YOUR_LAST_ANSWER"
}]
This is JSON, you can make sure you wrote it properly by using a tool like JSON Formatter. (don’t forget to remove // ...
, this is a comment, it’s here to suggest that there are more inputs between the second and last riddles)
Now for the commands:
!addcom !riddle $(eval riddles = $(urlfetch json https://pastebin.com/raw/XXXXXXXX); r = Math.floor(Math.random() * riddles.length); `Riddle #${r + 1}: ${riddles[r].riddle}`;)
!addcom !answer $(eval riddles = $(urlfetch json https://pastebin.com/raw/XXXXXXXX); n = parseInt('$(1)') - 1; isNaN('$(1)') ? 'There was an error: only feed the command the riddle\'s ID (without the #)' : (n < 0 || n > riddles.length) ? 'There was an error: this riddle\'s ID doesn\'t exists' : `Answer #${n + 1}: ${riddles[n].answer}`;)
In both commands, replace XXXXXXXX
with the paste ID, which you’ll find in the URL once created.
If you want to make the !answer
command mod-only, add -ul=mod
between !answer
and $(eval)
.