From 805c6d56c2d0ee13aee616b4c3098bdf900905f8 Mon Sep 17 00:00:00 2001 From: RTAkland Date: Tue, 1 Oct 2024 18:54:25 +0800 Subject: [PATCH] feat: add reaction command --- gradle/libs.versions.toml | 2 +- src/main/kotlin/cn/rtast/fancybot/Const.kt | 5 ++-- .../fancybot/commands/misc/ReactionCommand.kt | 23 +++++++++++++++++++ .../{LikeMeCommand.kt => SendLikeCommand.kt} | 2 +- 4 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 src/main/kotlin/cn/rtast/fancybot/commands/misc/ReactionCommand.kt rename src/main/kotlin/cn/rtast/fancybot/commands/misc/{LikeMeCommand.kt => SendLikeCommand.kt} (95%) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 38de203..0e336f0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] kotlinVersion = "2.0.10" -ronebotVersion = "1.11.8" +ronebotVersion = "1.12.0" 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 d20accf..448fc33 100644 --- a/src/main/kotlin/cn/rtast/fancybot/Const.kt +++ b/src/main/kotlin/cn/rtast/fancybot/Const.kt @@ -95,7 +95,7 @@ val commands = listOf( JueCommand(), ShortLinkCommand(), ShotOtherCommand(), ReverseGIFCommand(), HelpCommand(), MusicCommand(), - LikeMeCommand(), NiuziTransferCommand(), + SendLikeCommand(), NiuziTransferCommand(), NiuziSignCommand(), NiuziJiJianCommand(), NiuziQueryCommand(), MyNiuziCommand(), NiuziBankCommand(), WithdrawCommand(), @@ -104,5 +104,6 @@ val commands = listOf( DMSearchCommand(), LlamaCommand(), QQMusicCommand(), BullShitGenerateCommand(), NiuziRankCommand(), NiuziBankRankCommand(), - ShotSelfCommand(), TenSetuCommand() + ShotSelfCommand(), TenSetuCommand(), + ReactionCommand() ) \ No newline at end of file diff --git a/src/main/kotlin/cn/rtast/fancybot/commands/misc/ReactionCommand.kt b/src/main/kotlin/cn/rtast/fancybot/commands/misc/ReactionCommand.kt new file mode 100644 index 0000000..576a958 --- /dev/null +++ b/src/main/kotlin/cn/rtast/fancybot/commands/misc/ReactionCommand.kt @@ -0,0 +1,23 @@ +/* + * Copyright © 2024 RTAkland + * Author: RTAkland + * Date: 2024/10/1 + */ + + +package cn.rtast.fancybot.commands.misc + +import cn.rtast.rob.entity.GroupMessage +import cn.rtast.rob.enums.QQFace +import cn.rtast.rob.util.BaseCommand +import cn.rtast.rob.util.ob.OneBotListener + +class ReactionCommand : BaseCommand() { + override val commandNames = listOf("reaction", "回应") + + override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List) { + (0..29).forEach { _ -> + message.reaction(QQFace.entries.random()) + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/cn/rtast/fancybot/commands/misc/LikeMeCommand.kt b/src/main/kotlin/cn/rtast/fancybot/commands/misc/SendLikeCommand.kt similarity index 95% rename from src/main/kotlin/cn/rtast/fancybot/commands/misc/LikeMeCommand.kt rename to src/main/kotlin/cn/rtast/fancybot/commands/misc/SendLikeCommand.kt index ee0d7be..b9fb04b 100644 --- a/src/main/kotlin/cn/rtast/fancybot/commands/misc/LikeMeCommand.kt +++ b/src/main/kotlin/cn/rtast/fancybot/commands/misc/SendLikeCommand.kt @@ -14,7 +14,7 @@ import cn.rtast.rob.util.ob.MessageChain import cn.rtast.rob.util.ob.OneBotListener @CommandDescription("资料卡点赞") -class LikeMeCommand : BaseCommand() { +class SendLikeCommand : BaseCommand() { override val commandNames = listOf("赞我") override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List) {