-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathchat.go
46 lines (37 loc) · 1.22 KB
/
chat.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
package events
import (
"github.com/golang/protobuf/proto"
gcmcc "github.com/paralin/go-dota2/protocol"
)
// ChatMessage is emitted when a chat message is observed.
type ChatMessage struct {
gcmcc.CMsgDOTAChatMessage
}
// GetDotaEventMsgID returns the dota message ID of the event.
func (e *ChatMessage) GetDotaEventMsgID() gcmcc.EDOTAGCMsg {
return gcmcc.EDOTAGCMsg_k_EMsgGCChatMessage
}
// GetEventBody returns the event body.
func (e *ChatMessage) GetEventBody() proto.Message {
return &e.CMsgDOTAChatMessage
}
// GetEventName returns the chat message event name.
func (e *ChatMessage) GetEventName() string {
return "ChatMessage"
}
// JoinedChatChannel is emitted when we join a chat channel.
type JoinedChatChannel struct {
gcmcc.CMsgDOTAJoinChatChannelResponse
}
// GetDotaEventMsgID returns the dota message ID of the event.
func (e *JoinedChatChannel) GetDotaEventMsgID() gcmcc.EDOTAGCMsg {
return gcmcc.EDOTAGCMsg_k_EMsgGCJoinChatChannelResponse
}
// GetEventBody returns the event body.
func (e *JoinedChatChannel) GetEventBody() proto.Message {
return &e.CMsgDOTAJoinChatChannelResponse
}
// GetEventName returns the chat message event name.
func (e *JoinedChatChannel) GetEventName() string {
return "JoinedChatChannel"
}