So im writing an quotscript for nightbot and im realizing that with an MySql database…
ive written all my code but now nigtbot only prints: Quote
my command is !randomquote
the response code is: Quote $(customapi http://myurl.com/quotes.php) !
the expected result: Quote #[QuoteId]: [Quote] !
the real result: Quote
(im not using the real url due to the fact that the url should be private)
Have you checked the output of your API? It should be a single line, less than 400 characters response that is formatted in plain text (not HTML). Any other formatting will not show up properly.
Well considering the rendered page is HTML and not plain text, that would be why it’s not being printed by Nightbot. Like already stated, it must return a single line in plain text, not HTML.
as is said, those html lines are autogenerated by firefox (my browser) if you visit an plaintext site…
the site does only contain the #[1]: IST… DAS… ALLES ? part !
an prove:
while this:
is not loaded by nightbot, (EDIT: the text in the <body> tag)
this is loaded just fine:
my toughts are that may the respond time of the “quotes.php” site is to long (like ~10 to ~20ms)
wile the “t.php” site can respond imediatly !
Well unless you can link to the specific API that is not working so it can be examined, there’s nothing we can do for you. The only URL I found for your Twitch channel was generating PHP warnings.
eventually it helps a bit.
at the moment i call the quotes.php file without any arguments !
EDIT: the url i use is: http://twitchstats.890m.com/quotes.php
So from your code, you’re getting stuck with $actionId = 1; or $actionId = 2; because you’re not properly parsing input querystring parameters. Checking for null is not enough. You can add echos inside the first two if-statements to test which it is stuck in, as well as the value of the $_GET parameter to see why your if-statement is failing.