shuppet / raku-api-discord

Raku module for interacting with the Discord API.
https://shuppet.com
BSD 3-Clause "New" or "Revised" License
30 stars 3 forks source link

Hardcoded Gateway URL #51

Open kawaii opened 4 years ago

kawaii commented 4 years ago

Currently, we hardcode the gateway URL like so;

#| Host to which to connect. Can be overridden for testing e.g.
has Str $.ws-host = 'gateway.discord.gg';

According to the documentation this behaviour is wrong. and in actuality we should be calling the Get Gateway or Get Gateway Bot endpoints for this information.

https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params

https://discord.com/developers/docs/topics/gateway#get-gateway https://discord.com/developers/docs/topics/gateway#get-gateway-bot

I think it's still useful to be able to override the gateway URL, so we should keep that in mind when refactoring.