feat: add ai tts command
This commit is contained in:
3 files changed
+15
-2
No files matched your search
@@ -12,6 +12,7 @@ import cn.rtast.fancybot.entity.tts.TTSResponse
|
||||
import cn.rtast.fancybot.util.Http
|
||||
import cn.rtast.fancybot.util.str.proxy
|
||||
import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.enums.AIRecordCharacterType
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import okhttp3.FormBody
|
||||
@@ -39,4 +40,15 @@ class TTSCommand : BaseCommand() {
|
||||
.build()
|
||||
message.reply(msg)
|
||||
}
|
||||
}
|
||||
|
||||
class AITTSCommand : BaseCommand() {
|
||||
override val commandNames = listOf("/aitts")
|
||||
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
val content = args.joinToString(" ").trim()
|
||||
val character = if (args.size == 1) AIRecordCharacterType.XiaoXin
|
||||
else AIRecordCharacterType.forName(args.last()) ?: AIRecordCharacterType.XiaoXin
|
||||
message.action.sendGroupAIRecord(message.groupId, character, content)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user