feat: add ai tts command
This commit is contained in:
3 files changed
+15
-2
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
[versions]
|
[versions]
|
||||||
kotlinVersion = "2.0.20"
|
kotlinVersion = "2.0.20"
|
||||||
ronebotVersion = "2.3.0"
|
ronebotVersion = "2.3.2"
|
||||||
shadowVersion = "8.3.0"
|
shadowVersion = "8.3.0"
|
||||||
okhttpVersion = "5.0.0-alpha.14"
|
okhttpVersion = "5.0.0-alpha.14"
|
||||||
exposedVersion = "0.53.0"
|
exposedVersion = "0.53.0"
|
||||||
|
|||||||
@@ -124,7 +124,8 @@ val commands = listOf(
|
|||||||
MinecraftWikiCommand(), GaoKaoDaysRemainCommand(), IdiomExplainCommand(), NiuziManagerCommand(),
|
MinecraftWikiCommand(), GaoKaoDaysRemainCommand(), IdiomExplainCommand(), NiuziManagerCommand(),
|
||||||
TodayEatCommand(), TodayDrinkCommand(), MCLoginCommand(), RCONCommand(),
|
TodayEatCommand(), TodayDrinkCommand(), MCLoginCommand(), RCONCommand(),
|
||||||
GravatarCommand(), PastebinCommand(), ShuffleEchoCommand(), TodayDontEatCommand(),
|
GravatarCommand(), PastebinCommand(), ShuffleEchoCommand(), TodayDontEatCommand(),
|
||||||
TodayDontDrinkCommand(), MCBotCommand(), HTTPCatCommand(), HTTPDogCommand()
|
TodayDontDrinkCommand(), MCBotCommand(), HTTPCatCommand(), HTTPDogCommand(),
|
||||||
|
AITTSCommand()
|
||||||
)
|
)
|
||||||
|
|
||||||
val permissionCommands = listOf<PermissionCommand>()
|
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.Http
|
||||||
import cn.rtast.fancybot.util.str.proxy
|
import cn.rtast.fancybot.util.str.proxy
|
||||||
import cn.rtast.rob.entity.GroupMessage
|
import cn.rtast.rob.entity.GroupMessage
|
||||||
|
import cn.rtast.rob.enums.AIRecordCharacterType
|
||||||
import cn.rtast.rob.util.BaseCommand
|
import cn.rtast.rob.util.BaseCommand
|
||||||
import cn.rtast.rob.util.ob.MessageChain
|
import cn.rtast.rob.util.ob.MessageChain
|
||||||
import okhttp3.FormBody
|
import okhttp3.FormBody
|
||||||
@@ -39,4 +40,15 @@ class TTSCommand : BaseCommand() {
|
|||||||
.build()
|
.build()
|
||||||
message.reply(msg)
|
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