/
session_command.go
58 lines (45 loc) · 1.85 KB
/
session_command.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Code generated by github.com/switchupcb/copygen
// DO NOT EDIT.
package wrapper
// SendEvent sends an Opcode 1 Heartbeat event to the Discord Gateway.
func (c *Heartbeat) SendEvent(bot *Client, session *Session) error {
if err := writeEvent(bot, session, FlagGatewayOpcodeHeartbeat, FlagGatewaySendEventNameHeartbeat, c); err != nil {
return err
}
return nil
}
// SendEvent sends an Opcode 2 Identify event to the Discord Gateway.
func (c *Identify) SendEvent(bot *Client, session *Session) error {
if err := writeEvent(bot, session, FlagGatewayOpcodeIdentify, FlagGatewaySendEventNameIdentify, c); err != nil {
return err
}
return nil
}
// SendEvent sends an Opcode 3 UpdatePresence event to the Discord Gateway.
func (c *GatewayPresenceUpdate) SendEvent(bot *Client, session *Session) error {
if err := writeEvent(bot, session, FlagGatewayOpcodePresenceUpdate, FlagGatewaySendEventNameUpdatePresence, c); err != nil {
return err
}
return nil
}
// SendEvent sends an Opcode 4 UpdateVoiceState event to the Discord Gateway.
func (c *VoiceStateUpdate) SendEvent(bot *Client, session *Session) error {
if err := writeEvent(bot, session, FlagGatewayOpcodeVoiceStateUpdate, FlagGatewaySendEventNameUpdateVoiceState, c); err != nil {
return err
}
return nil
}
// SendEvent sends an Opcode 6 Resume event to the Discord Gateway.
func (c *Resume) SendEvent(bot *Client, session *Session) error {
if err := writeEvent(bot, session, FlagGatewayOpcodeResume, FlagGatewaySendEventNameResume, c); err != nil {
return err
}
return nil
}
// SendEvent sends an Opcode 8 RequestGuildMembers event to the Discord Gateway.
func (c *RequestGuildMembers) SendEvent(bot *Client, session *Session) error {
if err := writeEvent(bot, session, FlagGatewayOpcodeRequestGuildMembers, FlagGatewaySendEventNameRequestGuildMembers, c); err != nil {
return err
}
return nil
}