feat: add zibi command

This commit is contained in:
2024-09-18 16:52:28 +08:00
parent 4d22b1ea55
commit d284381554
3 files changed
+37 -3

No files matched your search

+2 -2
View File
@@ -1,6 +1,6 @@
[versions] [versions]
kotlinVersion = "2.0.10" kotlinVersion = "2.0.10"
ronebotVersion = "1.7.2" ronebotVersion = "1.8.1"
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"
@@ -17,7 +17,7 @@ exposedCore = { group = "org.jetbrains.exposed", name = "exposed-core", version.
exposedJDBC = { group = "org.jetbrains.exposed", name = "exposed-jdbc", version.ref = "exposedVersion" } exposedJDBC = { group = "org.jetbrains.exposed", name = "exposed-jdbc", version.ref = "exposedVersion" }
sqliteJDBC = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqliteJDBCVersion" } sqliteJDBC = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqliteJDBCVersion" }
animated-gif-lib = { group = "com.madgag", name = "animated-gif-lib", version.ref = "animatedGifLibVersion" } animated-gif-lib = { group = "com.madgag", name = "animated-gif-lib", version.ref = "animatedGifLibVersion" }
simple-java-mail = {group="org.simplejavamail", name="simple-java-mail",version.ref="simpleJavaMailVersion"} simple-java-mail = { group = "org.simplejavamail", name = "simple-java-mail", version.ref = "simpleJavaMailVersion" }
[bundles] [bundles]
@@ -159,7 +159,7 @@ val commands = listOf(
CompilerCommand(), GPTCommand(), CompilerCommand(), GPTCommand(),
GithubUserCommand(), AboutCommand(), GithubUserCommand(), AboutCommand(),
MusicPlayUrlCommand(), DomainPriceCommand(), MusicPlayUrlCommand(), DomainPriceCommand(),
SendMailCommand() SendMailCommand(), ZiBiCommand()
) )
suspend fun main() { suspend fun main() {
@@ -0,0 +1,34 @@
/*
* Copyright © 2024 RTAkland
* Author: RTAkland
* Date: 2024/9/18
*/
package cn.rtast.fancybot.commands
import cn.rtast.rob.entity.GroupMessage
import cn.rtast.rob.util.BaseCommand
import cn.rtast.rob.util.ob.MessageChain
import cn.rtast.rob.util.ob.OBMessage
class ZiBiCommand : BaseCommand() {
override val commandNames = listOf("/自闭", "自闭")
override suspend fun executeGroup(listener: OBMessage, message: GroupMessage, args: List<String>) {
try {
val duration = if (args.isEmpty()) 1 else args.first().toInt()
message.sender.ban(duration * 60)
val msg = MessageChain.Builder()
.addText("你先自闭${duration}分钟吧~")
.build()
message.reply(msg)
} catch (_: Exception) {
val msg = MessageChain.Builder()
.addText("你输入有误所以我决定让你自闭1天~")
.build()
message.reply(msg)
message.sender.ban(86400)
}
}
}