feat: 添加悲报
This commit is contained in:
parent
abd9531fb0
commit
7aebdeae56
@ -8,10 +8,11 @@ import (
|
||||
|
||||
func init() {
|
||||
handler.RegisterHandler("喜报", xiBao)
|
||||
handler.RegisterHandler("悲报", beiBao)
|
||||
}
|
||||
|
||||
func xiBao(msg model.Message) (reply model.Reply) {
|
||||
xibao.GenerateCongratulationImage(msg.Msg[len("喜报 "):], "./tmp/xibao.png")
|
||||
xibao.GenerateCongratulationImage(msg.Msg[len("喜报 "):], "./resource/xibao_background.png", "./tmp/xibao.png", true)
|
||||
return model.Reply{
|
||||
ReplyMsg: "[CQ:image,file=file:///root/qqbot/tmp/xibao.png]",
|
||||
ReferOriginMsg: true,
|
||||
@ -19,4 +20,11 @@ func xiBao(msg model.Message) (reply model.Reply) {
|
||||
}
|
||||
}
|
||||
|
||||
//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
|
||||
func beiBao(msg model.Message) (reply model.Reply) {
|
||||
xibao.GenerateCongratulationImage(msg.Msg[len("悲报 "):], "./resource/beibao_background.png", "./tmp/beibao.png", false)
|
||||
return model.Reply{
|
||||
ReplyMsg: "[CQ:image,file=file:///root/qqbot/tmp/beibao.png]",
|
||||
ReferOriginMsg: true,
|
||||
FromMsg: msg,
|
||||
}
|
||||
}
|
||||
|
2
main.go
2
main.go
@ -4,11 +4,13 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"git.lxtend.com/qqbot/sqlite3"
|
||||
wsclient "git.lxtend.com/qqbot/ws_client"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// 创建 WebSocket 客户端
|
||||
sqlite3.InitDB()
|
||||
client, err := wsclient.NewWebSocketClient("ws", "localhost:3001", "")
|
||||
if err != nil {
|
||||
log.Print("Error creating WebSocket client:", err)
|
||||
|
BIN
resource/beibao_background.png
Normal file
BIN
resource/beibao_background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.0 MiB |
Loading…
x
Reference in New Issue
Block a user