fix: fix reaction target
This commit is contained in:
2 files changed
+9
-4
No files matched your search
@@ -11,6 +11,7 @@ import cn.rtast.fancybot.annotations.CommandDescription
|
||||
import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.enums.QQFace
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.OneBotAction
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
|
||||
@CommandDescription("让你的消息得到回应(reaction)!")
|
||||
@@ -18,11 +19,11 @@ class ReactionCommand : BaseCommand() {
|
||||
override val commandNames = listOf("reaction", "回应")
|
||||
|
||||
companion object {
|
||||
suspend fun reaction(message: GroupMessage, limit: Int = 30) {
|
||||
(0..limit - 1).forEach { message.reaction(QQFace.entries.random()) }
|
||||
suspend fun reaction(action: OneBotAction, groupId: Long, messageId: Long, limit: Int = 30) {
|
||||
(0..limit - 1).forEach { action.reaction(groupId, messageId, QQFace.entries.random().id.toString()) }
|
||||
}
|
||||
}
|
||||
|
||||
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