feat: 添加喜报功能

This commit is contained in:
lixiangwuxian
2024-10-09 01:30:50 +08:00
parent f5e9b74c5a
commit c13b7f2068
12 changed files with 95 additions and 18 deletions

22
handler/xibao/xibao.go Normal file
View 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