Skip to main content


This method checks whether an HTTP request to one of several external URLs returns 200 OK.


The method accepts two arguments.

methodStringRequest HTTP method. The preferred ones are GET and HEAD.
urlsArray of stringsThe external URLs to be checked.
$http.check("HEAD", ["", ""]);

The method returns an array with one element: the first URL that returned 200 OK. If none of them returned 200 OK, the method returns [null].


There is also a similar method called $http.checkUrls. It has the same arguments as $http.check, but returns an array with all URLs that returned 200 OK.

How to use

This method can be helpful when integrating the bot with audio streaming services. You can configure the main service URL as well as its mirrors in the config, and use the first available URL for streaming.

$global.STREAM_URLS = [

theme: /

state: PlayRadio
q!: * (play/turn on) [the] radio *
$temp.urls = $http.check("GET", $global.STREAM_URLS);
if: typeof $temp.urls[0] === "string"
audio: {{ $temp.urls[0] }}
a: I had no luck connecting to the radio station. Please try again.