def send_packet(opcode, packet)
      data = {
        op: opcode,
        d: packet
      }

      send(data.to_json)
    end
def send_packet(opcode, packet)
      data = {
        op: opcode,
        d: packet
      }

      send(data.to_json)
    end
Sends a custom packet over the connection. This can be useful to implement future yet unimplemented functionality
 or for testing. You probably shouldn't use this unless you know what you're doing.
 @param opcode [Integer] The opcode the packet should be sent as. Can be one of {Opcodes} or a custom value if
   necessary.
 @param packet [Object] Some arbitrary JSON-serialisable data that should be sent as the `d` field.