Skip to content

Gateway

Marco Cusano edited this page May 13, 2019 · 1 revision

get external-link

Returns an object with a single valid WSS URL, which the client can use for Connecting. Clients should cache this value and only call this endpoint to retrieve a new URL if they are unable to properly establish a connection using the cached version of the URL.

$discord->gateway->get();

getBot external-link

Returns an object based on the information in Get Gateway, plus additional metadata that can help during the operation of large or sharded bots. Unlike the Get Gateway, this route should not be cached for extended periods of time as the value is not guaranteed to be the same per-call, and changes as the bot joins/leaves guilds.

$discord->gateway->getBot();

client

Only available if run_bot config is true and if is running on a non-webserver (PHP CLI only). Click here if you want to know more.