mirror of
https://github.com/fumiama/ReiBot.git
synced 2026-06-05 00:50:25 +08:00
fix detail
This commit is contained in:
11
rule.go
11
rule.go
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
ctrl "github.com/FloatTech/zbpctrl"
|
||||
"github.com/FloatTech/zbputils/img/text"
|
||||
"github.com/FloatTech/zbputils/img/writer"
|
||||
"github.com/FloatTech/zbputils/process"
|
||||
tgba "github.com/go-telegram-bot-api/telegram-bot-api/v5"
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -308,14 +309,20 @@ func init() {
|
||||
msgs = append(msgs, i, ": ", service.EnableMarkIn(gid), key, "\n", service, "\n\n")
|
||||
return true
|
||||
})
|
||||
data, err := text.RenderToBase64(fmt.Sprint(msgs...), text.FontFile, 400, 20)
|
||||
img, err := text.Render(fmt.Sprint(msgs...), text.FontFile, 400, 20)
|
||||
if err != nil {
|
||||
logrus.Errorf("[control] %v", err)
|
||||
}
|
||||
_, _ = ctx.Caller.Send(tgba.NewPhoto(ctx.Message.Chat.ID, tgba.FileBytes{
|
||||
data, cl := writer.ToBytes(img.Image())
|
||||
_, err = ctx.Caller.Send(tgba.NewPhoto(ctx.Message.Chat.ID, tgba.FileBytes{
|
||||
Name: "服务详情",
|
||||
Bytes: data,
|
||||
}))
|
||||
cl()
|
||||
if err != nil {
|
||||
_, _ = ctx.Caller.Send(tgba.NewMessage(ctx.Message.Chat.ID, "ERROR: "+err.Error()))
|
||||
return
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user