feat: 添加喜报功能
This commit is contained in:
22
handler/xibao/xibao.go
Normal file
22
handler/xibao/xibao.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package xibao
|
||||
|
||||
import (
|
||||
"git.lxtend.com/qqbot/handler"
|
||||
"git.lxtend.com/qqbot/model"
|
||||
"git.lxtend.com/qqbot/service/xibao"
|
||||
)
|
||||
|
||||
func init() {
|
||||
handler.RegisterHandler("喜报", xiBao)
|
||||
}
|
||||
|
||||
func xiBao(msg model.Message) (reply model.Reply) {
|
||||
xibao.GenerateCongratulationImage(msg.Msg[len("喜报 "):], "./tmp/xibao.png")
|
||||
return model.Reply{
|
||||
ReplyMsg: "[CQ:image,file=file:///root/qqbot/tmp/xibao.png]",
|
||||
ReferOriginMsg: true,
|
||||
FromMsg: msg,
|
||||
}
|
||||
}
|
||||
|
||||
//docker run -d --name qqbot -v /root/qqbot:/root/qqbot -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro --restart=always qqbot
|
||||
Reference in New Issue
Block a user