Closed s5bug closed 5 years ago
@AdamChlupacek could you please take a loot on this one? This seem to be specific to discord usage.
@sorenbug Checking out your code and doing bit of tracking, it would seem that the error is coming from how the decode of the websocket frames into string is handled. By default it would seem that you are getting the default implicit val implicitStringCodec: Codec[String] = utf8_32
decoder which is utf8 prefixed with size. In case of websocket therre is no size prefix so you need just plain utf8.
If you change the line client.websocket(req, pipe)
into client.websocket(req, pipe)(scodec.codecs.utf8, scodec.codecs.utf8)
, it will be just doing plain utf8 decode and it will work.
It works! Thank you!
I'm using websockets here and here.
A test on your end can be done like so:
Replacing
TOKEN_HERE
with a Bot token you get from the Discord Developer Console.