func (c *Client) Emit(command string, data interface{}) (err error) {
	var op uint
	switch command {
	case event.Heartbeat:
		op = opcode.Heartbeat
	case event.Identify:
		op = opcode.Identify
	case event.Resume:
		op = opcode.Resume
	case event.RequestGuildMembers:
		op = opcode.RequestGuildMembers
	case event.VoiceStateUpdate:
		op = opcode.VoiceStateUpdate
	case event.StatusUpdate:
		op = opcode.StatusUpdate
	default:
		err = NewErrorUnsupportedEventName(command)
		return
	}

	c.sendChan <- &gatewayPayload{
		Op:   op,
		Data: data,
	}
	return
}
// Emit emits a command to the Discord Socket API
Emit emits a command to the Discord Socket API
// Emit emits a command to the Discord Socket API
func (c *Client) Emit(command string, data interface{}) (err error) {
	var op uint
	switch command {
	case event.Heartbeat:
		op = opcode.Heartbeat
	case event.Identify:
		op = opcode.Identify
	case event.Resume:
		op = opcode.Resume
	case event.RequestGuildMembers:
		op = opcode.RequestGuildMembers
	case event.VoiceStateUpdate:
		op = opcode.VoiceStateUpdate
	case event.StatusUpdate:
		op = opcode.StatusUpdate
	default:
		err = NewErrorUnsupportedEventName(command)
		return
	}
	c.sendChan <- &gatewayPayload{
		Op:   op,
		Data: data,
	}
	return
}
func ( c * Client ) Emit ( command string , data interface { } ) ( err error ) { var op uint switch command { case event . Heartbeat : op = opcode . Heartbeat case event . Identify : op = opcode . Identify case event . Resume : op = opcode . Resume case event . RequestGuildMembers : op = opcode . RequestGuildMembers case event . VoiceStateUpdate : op = opcode . VoiceStateUpdate case event . StatusUpdate : op = opcode . StatusUpdate default : err = NewErrorUnsupportedEventName ( command ) return } c . sendChan <- & gatewayPayload { Op : op , Data : data , } return }
Emit emits a command to the Discord Socket API
Emit emits a command to the Discord Socket API