Skip to content

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

@cubuzz

Description

@cubuzz

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions