mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 13:59:39 +08:00
tts append 。
This commit is contained in:
parent
7ec2b46d75
commit
36b09b8e94
@ -2,6 +2,7 @@
|
|||||||
package aireply
|
package aireply
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -59,6 +60,7 @@ func init() { // 插件主体
|
|||||||
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("成功"))
|
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("成功"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
endpre := regexp.MustCompile(`\pP$`)
|
||||||
ent.OnMessage(zero.OnlyToMe).SetBlock(true).Limit(ctxext.LimitByUser).
|
ent.OnMessage(zero.OnlyToMe).SetBlock(true).Limit(ctxext.LimitByUser).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
msg := ctx.ExtractPlainText()
|
msg := ctx.ExtractPlainText()
|
||||||
@ -72,7 +74,12 @@ func init() { // 插件主体
|
|||||||
ctx.SendChain(message.Text("ERROR: ", err))
|
ctx.SendChain(message.Text("ERROR: ", err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
rec, err := speaker.Speak(ctx.Event.UserID, func() string { return reply })
|
rec, err := speaker.Speak(ctx.Event.UserID, func() string {
|
||||||
|
if !endpre.MatchString(reply) {
|
||||||
|
return reply + "。"
|
||||||
|
}
|
||||||
|
return reply
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(reply))
|
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(reply))
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user