mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-24 18:51:02 +08:00
🔥 🎨 tts
This commit is contained in:
parent
7f972e3d68
commit
6932643788
@ -25,8 +25,8 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
reNumber = "(\\-|\\+)?\\d+(\\.\\d+)?"
|
||||
t *ttsInstances
|
||||
t *ttsInstances
|
||||
re = regexp.MustCompile(`(\-|\+)?\d+(\.\d+)?`)
|
||||
)
|
||||
|
||||
type ttsInstances struct {
|
||||
@ -61,7 +61,6 @@ func init() {
|
||||
tts := newTTS(getSoundMode(ctx))
|
||||
ctx.SendChain(message.Record(tts.Speak(ctx.Event.UserID, func() string {
|
||||
reply := r.TalkPlain(msg, zero.BotConfig.NickName[0])
|
||||
re := regexp.MustCompile(reNumber)
|
||||
reply = re.ReplaceAllStringFunc(reply, func(s string) string {
|
||||
f, err := strconv.ParseFloat(s, 64)
|
||||
if err != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user