chore: chore: chore: chore: chore: chore: chore
This commit is contained in:
4 files changed
+37
-42
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
[versions]
|
[versions]
|
||||||
kotlinVersion = "2.0.10"
|
kotlinVersion = "2.0.10"
|
||||||
ronebotVersion = "1.11.1"
|
ronebotVersion = "1.11.2"
|
||||||
shadowVersion = "8.3.0"
|
shadowVersion = "8.3.0"
|
||||||
okhttpVersion = "5.0.0-alpha.14"
|
okhttpVersion = "5.0.0-alpha.14"
|
||||||
exposedVersion = "0.53.0"
|
exposedVersion = "0.53.0"
|
||||||
|
|||||||
@@ -7,12 +7,7 @@
|
|||||||
|
|
||||||
package cn.rtast.fancybot
|
package cn.rtast.fancybot
|
||||||
|
|
||||||
import cn.rtast.fancybot.commands.parse.AsciiArtCommand
|
import cn.rtast.fancybot.commands.parse.*
|
||||||
import cn.rtast.fancybot.commands.parse.BVParseCommand
|
|
||||||
import cn.rtast.fancybot.commands.parse.CalculateCommand
|
|
||||||
import cn.rtast.fancybot.commands.parse.GitHubParseCommand
|
|
||||||
import cn.rtast.fancybot.commands.parse.ImageURLCommand
|
|
||||||
import cn.rtast.fancybot.commands.parse.ReverseGIFCommand
|
|
||||||
import cn.rtast.fancybot.entity.bili.CardShare
|
import cn.rtast.fancybot.entity.bili.CardShare
|
||||||
import cn.rtast.fancybot.entity.enums.WSType
|
import cn.rtast.fancybot.entity.enums.WSType
|
||||||
import cn.rtast.fancybot.util.initDatabase
|
import cn.rtast.fancybot.util.initDatabase
|
||||||
@@ -55,6 +50,7 @@ class FancyBot : OneBotListener {
|
|||||||
|
|
||||||
ReverseGIFCommand.callback(message)
|
ReverseGIFCommand.callback(message)
|
||||||
AsciiArtCommand.callback(message)
|
AsciiArtCommand.callback(message)
|
||||||
|
|
||||||
if (message.message.any { it.type == ArrayMessageType.reply }) { // Image url parse
|
if (message.message.any { it.type == ArrayMessageType.reply }) { // Image url parse
|
||||||
val command = message.message.reversed().find { it.type == ArrayMessageType.text }!!.data.text!!
|
val command = message.message.reversed().find { it.type == ArrayMessageType.text }!!.data.text!!
|
||||||
val replyId = message.message.find { it.type == ArrayMessageType.reply }!!.data.id!!
|
val replyId = message.message.find { it.type == ArrayMessageType.reply }!!.data.id!!
|
||||||
|
|||||||
@@ -87,7 +87,8 @@ class AsciiArtCommand : BaseCommand() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
suspend fun callback(message: GroupMessage) {
|
suspend fun callback(message: GroupMessage) {
|
||||||
if (message.sender.userId in waitingList) {
|
if (message.sender.userId !in waitingList) return
|
||||||
|
waitingList.removeIf { it == message.sender.userId }
|
||||||
if (message.message.any { it.type == ArrayMessageType.image }
|
if (message.message.any { it.type == ArrayMessageType.image }
|
||||||
|| message.message.any { it.type == ArrayMessageType.mface }) {
|
|| message.message.any { it.type == ArrayMessageType.mface }) {
|
||||||
val url = if (message.message.any { it.type == ArrayMessageType.image })
|
val url = if (message.message.any { it.type == ArrayMessageType.image })
|
||||||
@@ -121,8 +122,6 @@ class AsciiArtCommand : BaseCommand() {
|
|||||||
} else {
|
} else {
|
||||||
message.reply("回复错误已取消本次操作")
|
message.reply("回复错误已取消本次操作")
|
||||||
}
|
}
|
||||||
waitingList.removeIf { it == message.sender.userId }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ class ReverseGIFCommand : BaseCommand() {
|
|||||||
|
|
||||||
suspend fun callback(message: GroupMessage) {
|
suspend fun callback(message: GroupMessage) {
|
||||||
if (message.sender.userId !in waitingList) return
|
if (message.sender.userId !in waitingList) return
|
||||||
|
waitingList.removeIf { it == message.sender.userId }
|
||||||
val gifUrl = if (message.message.find { it.type == ArrayMessageType.mface } == null) {
|
val gifUrl = if (message.message.find { it.type == ArrayMessageType.mface } == null) {
|
||||||
message.message.find { it.type == ArrayMessageType.image }!!.data.file!!
|
message.message.find { it.type == ArrayMessageType.image }!!.data.file!!
|
||||||
} else {
|
} else {
|
||||||
@@ -44,14 +45,13 @@ class ReverseGIFCommand : BaseCommand() {
|
|||||||
val base64String = this.reverseGif(gifUrl)
|
val base64String = this.reverseGif(gifUrl)
|
||||||
val msg = MessageChain.Builder().addImage(base64String, true).build()
|
val msg = MessageChain.Builder().addImage(base64String, true).build()
|
||||||
message.reply(msg)
|
message.reply(msg)
|
||||||
waitingList.removeIf { it == message.sender.userId }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||||
if (message.sender.userId !in waitingList) {
|
if (message.sender.userId !in waitingList) {
|
||||||
waitingList.add(message.sender.userId)
|
|
||||||
message.reply("发送一张动图来继续操作")
|
message.reply("发送一张动图来继续操作")
|
||||||
|
waitingList.add(message.sender.userId)
|
||||||
} else {
|
} else {
|
||||||
message.reply("发送错误本次操作已取消")
|
message.reply("发送错误本次操作已取消")
|
||||||
waitingList.removeIf { it == message.sender.userId }
|
waitingList.removeIf { it == message.sender.userId }
|
||||||
|
|||||||
Reference in New Issue
Block a user