mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-12 18:20:27 +00:00
fix tts
This commit is contained in:
@@ -178,15 +178,10 @@ func (tts *ttsmode) getAPIKey(ctx *zero.Ctx) string {
|
||||
return url.QueryEscape(tts.APIKey)
|
||||
}
|
||||
|
||||
func (tts *ttsmode) setAPIKey(ctx *zero.Ctx, key string) error {
|
||||
gid := ctx.Event.GroupID
|
||||
if gid == 0 {
|
||||
gid = -ctx.Event.UserID
|
||||
}
|
||||
m := ctx.State["manager"].(*ctrl.Control[*zero.Ctx])
|
||||
err := m.Manager.SetExtra(gid, &key)
|
||||
func (tts *ttsmode) setAPIKey(m *ctrl.Control[*zero.Ctx], grp int64, key string) error {
|
||||
err := m.Manager.SetExtra(grp, &key)
|
||||
if err != nil {
|
||||
return errors.New("内部错误")
|
||||
return err
|
||||
}
|
||||
tts.APIKey = key
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user