2024-08-27 19:15:47 +08:00
|
|
|
/*
|
|
|
|
|
* Copyright © 2024 RTAkland
|
|
|
|
|
* Author: RTAkland
|
|
|
|
|
* Date: 2024/8/27
|
|
|
|
|
*/
|
|
|
|
|
|
2024-10-05 16:36:51 +08:00
|
|
|
@file:Suppress("DEPRECATION")
|
2024-08-27 19:15:47 +08:00
|
|
|
|
|
|
|
|
package cn.rtast.fancybot
|
|
|
|
|
|
2024-09-24 20:21:30 +08:00
|
|
|
import cn.rtast.fancybot.commands.AboutCommand
|
|
|
|
|
import cn.rtast.fancybot.commands.EchoCommand
|
|
|
|
|
import cn.rtast.fancybot.commands.HelpCommand
|
|
|
|
|
import cn.rtast.fancybot.commands.StatusCommand
|
|
|
|
|
import cn.rtast.fancybot.commands.lookup.*
|
|
|
|
|
import cn.rtast.fancybot.commands.misc.*
|
|
|
|
|
import cn.rtast.fancybot.commands.niuzi.*
|
|
|
|
|
import cn.rtast.fancybot.commands.parse.AsciiArtCommand
|
|
|
|
|
import cn.rtast.fancybot.commands.parse.ReverseGIFCommand
|
2024-09-26 05:20:10 +08:00
|
|
|
import cn.rtast.fancybot.commands.misc.JrrpCommand
|
|
|
|
|
import cn.rtast.fancybot.commands.niuzi.NiuziRedeemCommand
|
|
|
|
|
import cn.rtast.fancybot.commands.misc.ShortLinkCommand
|
2024-08-30 14:24:46 +08:00
|
|
|
import cn.rtast.fancybot.entity.Config
|
2024-10-02 21:02:05 +08:00
|
|
|
import cn.rtast.fancybot.enums.ImageType
|
|
|
|
|
import cn.rtast.fancybot.enums.WSType
|
2024-09-28 20:53:49 +08:00
|
|
|
import cn.rtast.fancybot.items.*
|
2024-09-24 20:21:30 +08:00
|
|
|
import cn.rtast.fancybot.util.file.ConfigManager
|
|
|
|
|
import cn.rtast.fancybot.util.file.NiuziBankManager
|
|
|
|
|
import cn.rtast.fancybot.util.file.NiuziManager
|
|
|
|
|
import cn.rtast.fancybot.util.item.ItemManager
|
2024-10-05 20:59:30 +08:00
|
|
|
import cn.rtast.rob.ROneBotFactory
|
2024-08-27 19:15:47 +08:00
|
|
|
import com.google.gson.Gson
|
|
|
|
|
import com.google.gson.GsonBuilder
|
2024-09-24 20:21:30 +08:00
|
|
|
import java.time.Instant
|
2024-08-27 19:15:47 +08:00
|
|
|
|
|
|
|
|
val gson: Gson = GsonBuilder()
|
|
|
|
|
.setPrettyPrinting()
|
|
|
|
|
.disableHtmlEscaping()
|
|
|
|
|
.create()
|
2024-08-30 14:24:46 +08:00
|
|
|
|
|
|
|
|
const val ROOT_PATH = "./data"
|
2024-10-06 18:20:53 +08:00
|
|
|
const val ASSETS_BASE_URL = "https://static.rtast.cn"
|
2024-08-30 14:24:46 +08:00
|
|
|
|
|
|
|
|
val DEFAULT_CONFIG = Config(
|
2024-08-30 15:05:51 +08:00
|
|
|
ncmAPI = "https://ncm.rtast.cn",
|
|
|
|
|
wsAddress = "ws://127.0.0.1",
|
|
|
|
|
wsType = WSType.Client,
|
|
|
|
|
accessToken = "114514",
|
2024-09-03 21:38:50 +08:00
|
|
|
port = 6760,
|
2024-09-04 20:01:09 +08:00
|
|
|
listeningGroups = listOf(114514, 1919810),
|
2024-09-12 15:43:44 +08:00
|
|
|
qweatherKey = "114514",
|
2024-09-14 20:24:54 +08:00
|
|
|
githubKey = "1919810",
|
2024-09-15 13:27:14 +08:00
|
|
|
imageType = ImageType.PNG,
|
|
|
|
|
openAIAPIHost = "https://api.moonshot.cn",
|
2024-09-17 22:37:42 +08:00
|
|
|
openAIAPIKey = "114514",
|
2024-09-24 20:51:20 +08:00
|
|
|
openAIModel = "moonshot-v1-8k",
|
2024-09-17 22:37:42 +08:00
|
|
|
smtpHost = "127.0.0.1",
|
|
|
|
|
smtpPort = 25,
|
|
|
|
|
smtpUser = "114514",
|
|
|
|
|
smtpPassword = "1919810",
|
|
|
|
|
smtpFromAddress = "fancybot@repo.rtast.cn",
|
2024-09-18 13:06:23 +08:00
|
|
|
admins = listOf(3458671395L),
|
2024-09-24 20:51:20 +08:00
|
|
|
enableAntiRevoke = true,
|
|
|
|
|
llamaUrl = "http://127.0.0.1",
|
2024-09-25 23:04:49 +08:00
|
|
|
llamaModel = "llama3.1",
|
2024-09-26 21:56:44 +08:00
|
|
|
qqMusicApiUrl = "http://127.0.0.1:3200",
|
2024-09-28 12:37:18 +08:00
|
|
|
startUpNoticeUser = 114514L,
|
|
|
|
|
selfId = 114514L
|
2024-09-24 20:21:30 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
val configManager = ConfigManager()
|
|
|
|
|
val itemManager = ItemManager()
|
|
|
|
|
val niuziManager = NiuziManager()
|
|
|
|
|
val niuziBankManager = NiuziBankManager()
|
|
|
|
|
|
2024-09-27 23:31:01 +08:00
|
|
|
val START_UP_TIME = Instant.now().epochSecond
|
|
|
|
|
|
2024-09-24 20:21:30 +08:00
|
|
|
val items = listOf(
|
2024-09-28 16:31:55 +08:00
|
|
|
HeisiItem(), BaisiItem(),
|
2024-09-28 20:53:49 +08:00
|
|
|
SetuItem(), NiuziItem(),
|
2024-09-29 21:39:20 +08:00
|
|
|
TenSetuItem(), TenSetuR18Item()
|
2024-09-24 20:21:30 +08:00
|
|
|
)
|
|
|
|
|
|
2024-10-05 20:59:30 +08:00
|
|
|
val tasks = mapOf(
|
|
|
|
|
10000000L to suspend {
|
|
|
|
|
configManager.admins.forEach {
|
|
|
|
|
ROneBotFactory.action.sendLike(it, 1)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
2024-09-24 20:21:30 +08:00
|
|
|
val commands = listOf(
|
|
|
|
|
EchoCommand(), JrrpCommand(),
|
2024-09-26 05:20:10 +08:00
|
|
|
NiuziRedeemCommand(), HitokotoCommand(),
|
2024-09-26 17:42:49 +08:00
|
|
|
KFCCommand(), QRCodeCommand(),
|
2024-09-24 20:21:30 +08:00
|
|
|
AntiRevokeCommand(), MCPingCommand(),
|
|
|
|
|
WeatherCommand(), CigaretteCommand(),
|
|
|
|
|
RemakeCommand(), PixivCommand(),
|
|
|
|
|
RUACommand(), NslookupCommand(),
|
|
|
|
|
CompilerCommand(), AICommand(),
|
|
|
|
|
GithubUserCommand(), AboutCommand(),
|
|
|
|
|
MusicPlayUrlCommand(), DomainPriceCommand(),
|
|
|
|
|
SendMailCommand(), ZiBiCommand(),
|
|
|
|
|
UnsetZiBiCommand(), WikipediaCommand(),
|
|
|
|
|
AsciiArtCommand(), StatusCommand(),
|
|
|
|
|
JueCommand(), ShortLinkCommand(),
|
|
|
|
|
ShotOtherCommand(), ReverseGIFCommand(),
|
|
|
|
|
HelpCommand(), MusicCommand(),
|
2024-10-01 18:54:25 +08:00
|
|
|
SendLikeCommand(), NiuziTransferCommand(),
|
2024-09-24 20:21:30 +08:00
|
|
|
NiuziSignCommand(), NiuziJiJianCommand(),
|
|
|
|
|
NiuziQueryCommand(), MyNiuziCommand(),
|
|
|
|
|
NiuziBankCommand(), WithdrawCommand(),
|
|
|
|
|
BankTransferCommand(), CreateBankAccountCommand(),
|
|
|
|
|
BankBalanceCommand(), DepositCommand(),
|
2024-10-05 19:14:45 +08:00
|
|
|
AnimeSearchCommand(), LlamaCommand(),
|
2024-09-26 18:43:24 +08:00
|
|
|
QQMusicCommand(), BullShitGenerateCommand(),
|
2024-09-28 20:53:49 +08:00
|
|
|
NiuziRankCommand(), NiuziBankRankCommand(),
|
2024-10-01 18:54:25 +08:00
|
|
|
ShotSelfCommand(), TenSetuCommand(),
|
2024-10-03 16:59:07 +08:00
|
|
|
ReactionCommand(), MCSkinCommand(),
|
2024-10-05 19:40:44 +08:00
|
|
|
GithubLatestCommitCommand(), RandomMusicCommand(),
|
|
|
|
|
ZDJDCommand()
|
2024-09-25 14:48:59 +08:00
|
|
|
)
|