feat: add reaction other's message command
This commit is contained in:
2 files changed
+10
-4
No files matched your search
@@ -7,6 +7,7 @@
|
||||
|
||||
package cn.rtast.fancybot
|
||||
|
||||
import cn.rtast.fancybot.commands.misc.ReactionCommand
|
||||
import cn.rtast.fancybot.commands.misc.ScanQRCodeCommand
|
||||
import cn.rtast.fancybot.commands.misc.ShortLinkCommand.Companion.makeShortLink
|
||||
import cn.rtast.fancybot.commands.parse.*
|
||||
@@ -81,7 +82,7 @@ class FancyBot : OneBotListener {
|
||||
val getMsg = this.getMessage(replyId.toString().toLong())
|
||||
ImageURLCommand.callback(message, getMsg)
|
||||
}
|
||||
|
||||
if (command.contains("reaction")) ReactionCommand.reaction(message)
|
||||
if (command.contains("图床")) {
|
||||
val getMsg = this.getMessage(replyId.toString().toLong())
|
||||
val imagesUrl = ImageURLCommand.getImageUrl(getMsg)
|
||||
|
||||
@@ -17,9 +17,14 @@ 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<String>) {
|
||||
(0..29).forEach { _ ->
|
||||
message.reaction(QQFace.entries.random())
|
||||
companion object {
|
||||
suspend fun reaction(message: GroupMessage, limit: Int = 30) {
|
||||
(0..limit - 1).forEach { _ ->
|
||||
message.reaction(QQFace.entries.random())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) =
|
||||
reaction(message)
|
||||
}
|
||||
Reference in New Issue
Block a user