mirror of
https://github.com/fumiama/ReiBot.git
synced 2026-06-23 13:40:30 +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"
|
ctrl "github.com/FloatTech/zbpctrl"
|
||||||
"github.com/FloatTech/zbputils/img/text"
|
"github.com/FloatTech/zbputils/img/text"
|
||||||
|
"github.com/FloatTech/zbputils/img/writer"
|
||||||
"github.com/FloatTech/zbputils/process"
|
"github.com/FloatTech/zbputils/process"
|
||||||
tgba "github.com/go-telegram-bot-api/telegram-bot-api/v5"
|
tgba "github.com/go-telegram-bot-api/telegram-bot-api/v5"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
@@ -308,14 +309,20 @@ func init() {
|
|||||||
msgs = append(msgs, i, ": ", service.EnableMarkIn(gid), key, "\n", service, "\n\n")
|
msgs = append(msgs, i, ": ", service.EnableMarkIn(gid), key, "\n", service, "\n\n")
|
||||||
return true
|
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 {
|
if err != nil {
|
||||||
logrus.Errorf("[control] %v", err)
|
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: "服务详情",
|
Name: "服务详情",
|
||||||
Bytes: data,
|
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