Files
FancyBot/src/main/kotlin/cn/rtast/fancybot/commands/misc/ReactionCommand.kt
T

28 lines
821 B
Kotlin
Raw Normal View History

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-24 16:55:14 +08:00
suspend fun reaction(message: GroupMessage, limit: Int = 30) {
(0..limit - 1).forEach { message.reaction(QQFace.entries.random()) }
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-24 16:55:14 +08:00
reaction(message)
2024-10-01 18:54:25 +08:00
}