!8ball api for Nightbot

Staff Edit: This API no longer exists. There is a !8ball command on our docs page that you can use instead.

1 Like

Almost works but when nightbot responds instead of saying in chat it responds with a link. This wouldn’t be a huge problem if the contents of the link didn’t change per user

If the .php link shows instead, you are not copy/pasting it properly. I changed the author’s post to make it more clear what you should use.

1 Like

The problem I am having with this command, nightbot will respond with the users name and the question asked; However, nothing else is out putted by nightbot.

Can you copy and paste the command you’re using?

!addcom !8ball $(user) asks: “$(query)” … $(customapi http://www.kendrickang.ca/twitch/8ball/twitch8ball.php) this is what I’m using but it just show: "user asks ______ … " and that’s it so there is just no answer to the question

I’ve received a message from nightbot stating this API needs to be updated via this link here - https://api.rtainc.co/twitch/8ball?format=

when i click on this link it brings me to a blank page. Can you explain how to update this api or how it can be fixed?

All of rtainc’s APIs with instructions can be found here.

The new 8-ball api is
https://api.rtainc.co/twitch/8ball?format=The+Magic+8-Ball+says...+[0]

Hey, I think the 8-ball api is down. Is there any way to fix it?

Alternative solution: Useful Custom APIs

tl;dr copy pasterino below

!editcom -cd=5 !8ball $(eval var sayings = ['Signs point to yes.', 'Yes.', 'Reply hazy, try again.', 'My sources say no.', 'You may rely on it.', 'Concentrate and ask again.', 'Outlook not so good.', 'It is decidedly so.', 'Better not tell you now.', 'Very doubtful.', 'Yes - definitely.', 'It is certain.', 'Cannot predict now.', 'Most likely.', 'Ask again later.', 'My reply is no.', 'Outlook good.', "Don't count on it."]; sayings[Math.floor(Math.random() * sayings.length)];) OSsloth

Add /me after !8ball if streamer prefers colored text. Cooldown is set to 5s, increase if needed

4 Likes

Thank you this helped! :smiley:

2 Likes

Is there a way to make it @ the user who asked the question?

Before the eval just put @$(user). So basically

!commands add -cd=5 !8ball @$(user) $(eval [rest of eval])
2 Likes

Thank you! It worked perfectly!

it says response must be less than 400 characters for me

This API no longer exists. There is a !8ball command on our docs page that you can use instead: https://docs.nightbot.tv/commands/variables/eval

1 Like