Closed somesh1234567 closed 2 years ago
Hello,
Your script had some syntax errors in it. When I pasted your code into the RiveScript Playground and clicked "Run" with the Debug checkbox open, the RiveScript debug log printed some errors when evaluating the object macro:
With those problems resolved, the macro parses and makes the HTTP request but gets an Unauthorized error from the API (probably because of the "{APPID}" placeholder in the API URL not being correct). https://play.rivescript.com/s/QAFrFxptew
Bot says: "Testing javascript... [ERR: Error raised by object macro]."
So we got the fetch() trying to do its thing, if you have more trouble with it (with your correct {APPID} in there, etc.), that will be between you and the OpenWeathermap API to resolve further (it may need CORS headers to allow cross origin requests between the play.rivescript.com domain and the weather API, etc.)