feat: add ai tts command

This commit is contained in:
2024-11-03 20:15:53 +08:00
parent 7935597a05
commit b3410e6d07
3 files changed
+15 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
[versions]
kotlinVersion = "2.0.20"
ronebotVersion = "2.3.0"
ronebotVersion = "2.3.2"
shadowVersion = "8.3.0"
okhttpVersion = "5.0.0-alpha.14"
exposedVersion = "0.53.0"
+2 -1
View File
@@ -124,7 +124,8 @@ val commands = listOf(
MinecraftWikiCommand(), GaoKaoDaysRemainCommand(), IdiomExplainCommand(), NiuziManagerCommand(),
TodayEatCommand(), TodayDrinkCommand(), MCLoginCommand(), RCONCommand(),
GravatarCommand(), PastebinCommand(), ShuffleEchoCommand(), TodayDontEatCommand(),
TodayDontDrinkCommand(), MCBotCommand(), HTTPCatCommand(), HTTPDogCommand()
TodayDontDrinkCommand(), MCBotCommand(), HTTPCatCommand(), HTTPDogCommand(),
AITTSCommand()
)
val permissionCommands = listOf<PermissionCommand>()
@@ -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)
}
}