Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpCode 4001 (Invalid Opcode or Payload) when using gateway.presence_update #12

Open
cubuzz opened this issue Nov 18, 2020 · 1 comment

Comments

@cubuzz
Copy link

cubuzz commented Nov 18, 2020

Either I am too stupid, or

rest = Vox::HTTP::Client.new(token)
gateway = Vox::Gateway::Client.new(url: rest.get_gateway[:url], token: token)

gateway.on(:READY) do |data|
  gateway.presence_update(status: 'dnd')
end

will run

DEBUG -- Vox::Gateway::Client : Sending PRESENCE_UPDATE {:status=>"dnd", :afk=>false}
DEBUG -- Vox::Gateway::WebSocket : [OUT] {"op":3,"d":{"status":"dnd","afk":false}}

throws

DEBUG -- Vox::Gateway::WebSocket : WebSocket is closing (4001) Unknown opcode.
WARN  -- Vox::Gateway::Client : Websocket closed (4001 Unknown opcode.)
ERROR -- Vox::Gateway::Client : Unknown opcode.

As via Discord Docs:

CODE | DESCRIPTION | EXPLANATION
 
4001 | Unknown opcode | You sent an invalid Gateway opcode or an invalid payload for an opcode. Don't do that!
@cubuzz
Copy link
Author

cubuzz commented Nov 20, 2020

For doc purposes: It turns out that this is invalid for the V8 API either way. Swarley will be looking into this shortly. Thanks bro! ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant