2024-08-27 18:44:32 +08:00
|
|
|
|
/*
|
|
|
|
|
|
* Copyright © 2024 RTAkland
|
|
|
|
|
|
* Author: RTAkland
|
|
|
|
|
|
* Date: 2024/8/27
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package cn.rtast.fancybot.commands
|
|
|
|
|
|
|
2024-09-26 05:20:10 +08:00
|
|
|
|
import cn.rtast.fancybot.annotations.CommandDescription
|
2024-10-02 21:02:05 +08:00
|
|
|
|
import cn.rtast.fancybot.enums.CommandAction
|
|
|
|
|
|
import cn.rtast.fancybot.util.file.insertActionRecord
|
2024-08-27 18:44:32 +08:00
|
|
|
|
import cn.rtast.rob.entity.GroupMessage
|
|
|
|
|
|
import cn.rtast.rob.util.BaseCommand
|
|
|
|
|
|
|
2024-09-26 05:20:10 +08:00
|
|
|
|
@CommandDescription("Echo")
|
2024-09-03 16:41:06 +08:00
|
|
|
|
class EchoCommand : BaseCommand() {
|
2024-08-30 15:05:51 +08:00
|
|
|
|
override val commandNames = listOf("/echo")
|
2024-08-27 18:44:32 +08:00
|
|
|
|
|
2024-10-31 14:02:04 +08:00
|
|
|
|
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
2024-10-19 19:29:00 +08:00
|
|
|
|
if (message.sender.isAdmin || message.sender.isOwner) {
|
2024-10-24 16:55:14 +08:00
|
|
|
|
message.reply(args.joinToString(" "))
|
2024-10-19 19:29:00 +08:00
|
|
|
|
insertActionRecord(CommandAction.Echo, message.sender.userId)
|
|
|
|
|
|
} else {
|
2024-10-04 20:52:54 +08:00
|
|
|
|
message.reply("你不许用echo")
|
|
|
|
|
|
}
|
2024-08-27 18:44:32 +08:00
|
|
|
|
}
|
2024-10-15 19:07:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@CommandDescription("精神错乱(×), 胡言乱语(√)")
|
|
|
|
|
|
class ShuffleEchoCommand : BaseCommand() {
|
|
|
|
|
|
override val commandNames = listOf("/secho", "/se")
|
|
|
|
|
|
|
2024-10-31 14:02:04 +08:00
|
|
|
|
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
2024-10-19 19:29:00 +08:00
|
|
|
|
if (message.sender.isAdmin || message.sender.isOwner) {
|
|
|
|
|
|
message.reply(message.rawMessage.toList().shuffled().joinToString(""))
|
|
|
|
|
|
insertActionRecord(CommandAction.Echo, message.sender.userId)
|
2024-10-24 16:55:14 +08:00
|
|
|
|
} else {
|
2024-10-15 19:07:18 +08:00
|
|
|
|
message.reply("你不许用echo")
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-08-27 18:44:32 +08:00
|
|
|
|
}
|