-
Notifications
You must be signed in to change notification settings - Fork 0
/
kookMsgUtil.go
41 lines (37 loc) · 1.09 KB
/
kookMsgUtil.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
package main
import "github.com/lonelyevil/kook"
func updateKMsg(msgId string, content string) error {
return localSession.MessageUpdate((&kook.MessageUpdate{
MessageUpdateBase: kook.MessageUpdateBase{
MsgID: msgId,
Content: content,
},
}))
}
func sendKCard(target string, content string) (resp *kook.MessageResp, err error) {
return localSession.MessageCreate((&kook.MessageCreate{
MessageCreateBase: kook.MessageCreateBase{
Type: kook.MessageTypeCard,
TargetID: target,
Content: content,
},
}))
}
func sendMarkdown(target string, content string) (resp *kook.MessageResp, err error) {
return localSession.MessageCreate((&kook.MessageCreate{
MessageCreateBase: kook.MessageCreateBase{
Type: kook.MessageTypeKMarkdown,
TargetID: target,
Content: content,
},
}))
}
func sendMarkdownDirect(target string, content string) (mr *kook.MessageResp, err error) {
return localSession.DirectMessageCreate(&kook.DirectMessageCreate{
MessageCreateBase: kook.MessageCreateBase{
Type: kook.MessageTypeKMarkdown,
TargetID: target,
Content: content,
},
})
}