diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a013eef..aab4703 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -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" diff --git a/src/main/kotlin/cn/rtast/fancybot/Const.kt b/src/main/kotlin/cn/rtast/fancybot/Const.kt index 40a7c0a..554e231 100644 --- a/src/main/kotlin/cn/rtast/fancybot/Const.kt +++ b/src/main/kotlin/cn/rtast/fancybot/Const.kt @@ -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() \ No newline at end of file diff --git a/src/main/kotlin/cn/rtast/fancybot/commands/misc/TTSCommand.kt b/src/main/kotlin/cn/rtast/fancybot/commands/misc/TTSCommand.kt index 62c73e4..35b7f00 100644 --- a/src/main/kotlin/cn/rtast/fancybot/commands/misc/TTSCommand.kt +++ b/src/main/kotlin/cn/rtast/fancybot/commands/misc/TTSCommand.kt @@ -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) { + 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) + } } \ No newline at end of file