discordgo icon indicating copy to clipboard operation
discordgo copied to clipboard

WASM support?

Open superloach opened this issue 4 years ago • 0 comments

I think being able to target WASM would allow for some interesting use cases of this library.

what I have found so far:

  • bot token errors on ws open
Get https://discordapp.com/api/v6/gateway: net/http: fetch() failed: <object>
  • bot token errors on rest api call
Get https://discordapp.com/api/v6/users/@me: net/http: fetch() failed: <object>
  • auth/login errors on ws open and rest api call
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://discordapp.com/api/v6/auth/login. (Reason: missing token ‘user-agent’ in CORS header ‘Access-Control-Allow-Headers’ from CORS preflight channel).
Unable to fetch discord authentication token. Post https://discordapp.com/api/v6/auth/login: net/http: fetch() failed: <object>
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://discordapp.com/api/v6/auth/login. (Reason: CORS request did not succeed).

I have a feeling those fetch() failed: <object> bits are where the useful error info would be, but I don't know how to get to it.

I'm using Go 1.13 and wasmserve, if that makes a difference

superloach avatar Jan 10 '20 22:01 superloach