Having trouble using urlfetch

I am trying to make a command to return a random response from an array, I made a PHP script for it and have it hosted, however when I try to use urlfetch to retrieve the text I want it tries to get the source code which is more than 400 characters so Nightbot just outputs [Response must be less than 400 characters] into chat. I’m not really sure what I am doing wrong, I’m pretty new to PHP so any help would be greatly appreciated.

What do you see if you directly visit your script in your browser, does it work there, or do you see the source code?
If you see the source the problem is related to your server/hosting (make sure file extension is .php?).

An other common issue is, depending on your hosting, that the hosting company injects a piece of javascript into your page which makes your response longer then 400 characters. Try to do a cURL request to your custom api link and see what it returns.

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