fix: fix reaction target
This commit is contained in:
2 files changed
+9
-4
No files matched your search
@@ -123,8 +123,12 @@ class FancyBot : OneBotListener {
|
|||||||
.joinToString { it.data.text!! }
|
.joinToString { it.data.text!! }
|
||||||
if (command.contains("/倒放") || command.contains("/df")) ReverseGIFCommand.reverse(message, getMsg)
|
if (command.contains("/倒放") || command.contains("/df")) ReverseGIFCommand.reverse(message, getMsg)
|
||||||
if (command.contains("/图来") || command.contains("/图链")) ImageURLCommand.callback(message, getMsg)
|
if (command.contains("/图来") || command.contains("/图链")) ImageURLCommand.callback(message, getMsg)
|
||||||
if (command.contains("/reaction")) ReactionCommand.reaction(message)
|
|
||||||
if (command.contains("/图床")) ImageBedCommand.execute(getMsg, message)
|
if (command.contains("/图床")) ImageBedCommand.execute(getMsg, message)
|
||||||
|
if (command.contains("/reaction")) ReactionCommand.reaction(
|
||||||
|
message.action,
|
||||||
|
message.groupId,
|
||||||
|
getMsg.messageId
|
||||||
|
)
|
||||||
if (command.contains("/sl") || command.contains("/short")) message.reply(
|
if (command.contains("/sl") || command.contains("/short")) message.reply(
|
||||||
plainTextContent.trim().makeShortLink()
|
plainTextContent.trim().makeShortLink()
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import cn.rtast.fancybot.annotations.CommandDescription
|
|||||||
import cn.rtast.rob.entity.GroupMessage
|
import cn.rtast.rob.entity.GroupMessage
|
||||||
import cn.rtast.rob.enums.QQFace
|
import cn.rtast.rob.enums.QQFace
|
||||||
import cn.rtast.rob.util.BaseCommand
|
import cn.rtast.rob.util.BaseCommand
|
||||||
|
import cn.rtast.rob.util.ob.OneBotAction
|
||||||
import cn.rtast.rob.util.ob.OneBotListener
|
import cn.rtast.rob.util.ob.OneBotListener
|
||||||
|
|
||||||
@CommandDescription("让你的消息得到回应(reaction)!")
|
@CommandDescription("让你的消息得到回应(reaction)!")
|
||||||
@@ -18,11 +19,11 @@ class ReactionCommand : BaseCommand() {
|
|||||||
override val commandNames = listOf("reaction", "回应")
|
override val commandNames = listOf("reaction", "回应")
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
suspend fun reaction(message: GroupMessage, limit: Int = 30) {
|
suspend fun reaction(action: OneBotAction, groupId: Long, messageId: Long, limit: Int = 30) {
|
||||||
(0..limit - 1).forEach { message.reaction(QQFace.entries.random()) }
|
(0..limit - 1).forEach { action.reaction(groupId, messageId, QQFace.entries.random().id.toString()) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) =
|
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) =
|
||||||
reaction(message)
|
reaction(message.action, message.groupId, message.messageId)
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user