fix: fix message target
This commit is contained in:
2 files changed
+12
-5
No files matched your search
@@ -82,7 +82,10 @@ class FancyBot : OneBotListener {
|
|||||||
val getMsg = this.getMessage(replyId.toString().toLong())
|
val getMsg = this.getMessage(replyId.toString().toLong())
|
||||||
ImageURLCommand.callback(message, getMsg)
|
ImageURLCommand.callback(message, getMsg)
|
||||||
}
|
}
|
||||||
if (command.contains("reaction")) ReactionCommand.reaction(message)
|
if (command.contains("reaction")) {
|
||||||
|
val getMsg = this.getMessage(replyId.toString().toLong())
|
||||||
|
ReactionCommand.reaction(this, message, getMsg.messageId)
|
||||||
|
}
|
||||||
if (command.contains("图床")) {
|
if (command.contains("图床")) {
|
||||||
val getMsg = this.getMessage(replyId.toString().toLong())
|
val getMsg = this.getMessage(replyId.toString().toLong())
|
||||||
val imagesUrl = ImageURLCommand.getImageUrl(getMsg)
|
val imagesUrl = ImageURLCommand.getImageUrl(getMsg)
|
||||||
|
|||||||
@@ -18,13 +18,17 @@ 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(listener: OneBotListener, message: GroupMessage, messageId: Long, limit: Int = 30) {
|
||||||
(0..limit - 1).forEach { _ ->
|
(0..limit - 1).forEach {
|
||||||
message.reaction(QQFace.entries.random())
|
listener.reaction(
|
||||||
|
message.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(listener, message, message.messageId)
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user