forked from LagrangeDev/LagrangeGo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
source.go
33 lines (29 loc) · 651 Bytes
/
source.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
package message
type SourceType byte
// MessageSourceType 常量
const (
SourcePrivate SourceType = 1 << iota
SourceGroup SourceType = 1 << iota
SourceGuildChannel SourceType = 1 << iota
SourceGuildDirect SourceType = 1 << iota
)
func (t SourceType) String() string {
switch t {
case SourcePrivate:
return "私聊"
case SourceGroup:
return "群聊"
case SourceGuildChannel:
return "频道"
case SourceGuildDirect:
return "频道私聊"
default:
return "unknown"
}
}
// Source 消息来源
type Source struct {
SourceType SourceType
PrimaryID int64 // 群号/QQ号/guild_id
SecondaryID int64 // channel_id
}