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