feat: 添加回复功能
This commit is contained in:
parent
212634e8d2
commit
af232c2ecf
24
action/cq_msg_gen.go
Normal file
24
action/cq_msg_gen.go
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package action
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func GenReply(msgId int32, text string, qq int64, time int64, seq int64) string {
|
||||||
|
if msgId == 0 {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
cq_str := "[CQ:reply,id=" + fmt.Sprint(msgId)
|
||||||
|
if text != "" {
|
||||||
|
cq_str += ",text=" + text
|
||||||
|
}
|
||||||
|
if qq != 0 {
|
||||||
|
cq_str += ",qq=" + fmt.Sprint(qq)
|
||||||
|
}
|
||||||
|
if time != 0 {
|
||||||
|
cq_str += ",time=" + fmt.Sprint(time)
|
||||||
|
}
|
||||||
|
if seq != 0 {
|
||||||
|
cq_str += ",seq=" + fmt.Sprint(seq)
|
||||||
|
}
|
||||||
|
cq_str += "]"
|
||||||
|
return cq_str
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user