2024-10-01 18:54:25 +08:00
|
|
|
/*
|
|
|
|
|
* Copyright © 2024 RTAkland
|
|
|
|
|
* Author: RTAkland
|
|
|
|
|
* Date: 2024/10/1
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package cn.rtast.fancybot.commands.misc
|
|
|
|
|
|
2024-10-11 19:24:33 +08:00
|
|
|
import cn.rtast.fancybot.annotations.CommandDescription
|
2024-10-01 18:54:25 +08:00
|
|
|
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
|
|
|
|
|
|
2024-10-11 19:24:33 +08:00
|
|
|
@CommandDescription("让你的消息得到回应(reaction)!")
|
2024-10-01 18:54:25 +08:00
|
|
|
class ReactionCommand : BaseCommand() {
|
|
|
|
|
override val commandNames = listOf("reaction", "回应")
|
|
|
|
|
|
2024-10-11 19:28:22 +08:00
|
|
|
companion object {
|
2024-10-11 19:36:22 +08:00
|
|
|
suspend fun reaction(listener: OneBotListener, message: GroupMessage, messageId: Long, limit: Int = 30) {
|
|
|
|
|
(0..limit - 1).forEach {
|
|
|
|
|
listener.reaction(
|
|
|
|
|
message.groupId,
|
|
|
|
|
messageId,
|
|
|
|
|
QQFace.entries.random().id.toString()
|
|
|
|
|
)
|
2024-10-11 19:28:22 +08:00
|
|
|
}
|
2024-10-01 18:54:25 +08:00
|
|
|
}
|
|
|
|
|
}
|
2024-10-11 19:28:22 +08:00
|
|
|
|
|
|
|
|
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) =
|
2024-10-11 19:36:22 +08:00
|
|
|
reaction(listener, message, message.messageId)
|
2024-10-01 18:54:25 +08:00
|
|
|
}
|