| 114 | |
| 115 | <b>🔧 使用方法:</b> |
| 116 | • <code>${mainPrefix}tts <文本></code> - 合成语音 |
| 117 | • <code>${mainPrefix}tts config <key> <region></code> - 配置 API |
| 118 | • <code>${mainPrefix}tts voice <VoiceName></code> - 设置语音 |
| 119 | • <code>${mainPrefix}tts style <Style></code> - 设置风格 (如 cheerful, sad, chat, clear) |
| 120 | • <code>${mainPrefix}tts rate <Rate></code> - 设置语速 (0.5 ~ 2.0, 默认为 1.0) |
| 121 | • <code>${mainPrefix}tts voices [filter]</code> - 列出音色 (默认 zh-CN) |
| 122 | • <code>${mainPrefix}tts list</code> - 查看当前配置 |
| 123 | |
| 124 | <b>💡 提示:</b> |
| 125 | • 样式需要该音色支持才能生效 (如 Xiaoxiao 支持 cheerful) |
| 126 | • 清除风格使用 <code>${mainPrefix}tts style clear</code>`; |
| 127 | |
| 128 | // ========== 插件类 ========== |
| 129 | class TTSPlugin extends Plugin { |
| 130 | |
| 131 | name = "tts"; |
| 132 | description = () => getHelpText(); |
| 133 | |
| 134 | cmdHandlers = { |
| 135 | tts: async (msg: Api.Message) => { |
| 136 | const text = (msg.message || "").trim(); |