Files
FancyBot/src/main/kotlin/cn/rtast/fancybot/Const.kt
T

144 lines
5.2 KiB
Kotlin
Raw Normal View History

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
2024-10-15 19:07:18 +08:00
import cn.rtast.fancybot.commands.ShuffleEchoCommand
2024-09-24 20:21:30 +08:00
import cn.rtast.fancybot.commands.StatusCommand
2024-10-07 20:12:04 +08:00
import cn.rtast.fancybot.commands.SupportMeCommand
2024-09-24 20:21:30 +08:00
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
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-17 12:51:20 +08:00
import cn.rtast.fancybot.enums.DatabaseType
import cn.rtast.fancybot.enums.ImageBedType
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.*
import cn.rtast.fancybot.util.file.BlackListManager
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
2024-10-13 14:16:00 +08:00
import cn.rtast.fancybot.util.file.RCONManager
2024-09-24 20:21:30 +08:00
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-10-08 20:45:56 +08:00
const val API_RTAST_URL = "https://api.rtast.cn"
2024-10-15 11:13:54 +08:00
const val PBI_API_URL = "https://pbi.us.kg"
2024-08-30 14:24:46 +08:00
val DEFAULT_CONFIG = Config(
2024-10-17 12:51:20 +08:00
database = Config.Database(
DatabaseType.SQLite,
"127.0.0.1",
3306,
"root",
"114514",
"fancybot"
),
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",
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",
noticeUser = 114514L,
2024-10-08 15:15:51 +08:00
selfId = 114514L,
2024-10-08 20:45:56 +08:00
tianXingApiKey = "1145141919810",
githubUser = "RTAkland",
githubImageRepo = "Static-Images",
imageBedType = ImageBedType.Github,
cloudflareAccountId = "111",
cloudflareR2AccessKeyId = "11111",
cloudflareR2SecretKey = "222",
cloudflareR2BucketName = "fancybot",
cloudflareR2PublicUrl = "https://114514.com",
2024-10-11 11:08:18 +08:00
apiSpaceKey = "114514",
2024-10-11 20:49:32 +08:00
apiRtastKey = "114514",
2024-10-15 15:40:33 +08:00
azureAppClientId = "114514",
youtubeDataApiKey = "114514"
2024-09-24 20:21:30 +08:00
)
val configManager = ConfigManager()
val itemManager = ItemManager()
val niuziManager = NiuziManager()
val niuziBankManager = NiuziBankManager()
val blackListManager = BlackListManager()
2024-10-13 14:16:00 +08:00
val rconManager = RCONManager()
2024-09-24 20:21:30 +08:00
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(
2024-10-09 23:28:57 +08:00
EchoCommand(), JrrpCommand(), NiuziRedeemCommand(), HitokotoCommand(),
KFCCommand(), GenerateQRCodeCommand(), 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(),
SendLikeCommand(), NiuziTransferCommand(), NiuziSignCommand(), NiuziJiJianCommand(),
NiuziQueryCommand(), MyNiuziCommand(), NiuziBankCommand(), WithdrawCommand(),
BankTransferCommand(), CreateBankAccountCommand(), BankBalanceCommand(), DepositCommand(),
AnimeSearchCommand(), LlamaCommand(), QQMusicCommand(), BullShitGenerateCommand(),
NiuziRankCommand(), NiuziBankRankCommand(), ShotSelfCommand(), TenSetuCommand(),
ReactionCommand(), MCSkinCommand(), GithubLatestCommitCommand(), RandomMusicCommand(),
ZDJDCommand(), ScanQRCodeCommand(), TTSCommand(), SlimeChunkHelperCommand(),
SupportMeCommand(), TheCatCommand(), TheHistoryOfTodayCommand(), MCVersionCommand(),
MinecraftWikiCommand(), GaoKaoDaysRemainCommand(), IdiomExplainCommand(), NiuziManagerCommand(),
2024-10-14 17:26:59 +08:00
TodayEatCommand(), TodayDrinkCommand(), MCLoginCommand(), RCONCommand(),
2024-10-17 21:36:45 +08:00
GravatarCommand(), PastebinCommand(), ShuffleEchoCommand(), TodayDontEatCommand(),
2024-10-18 00:56:37 +08:00
TodayDontDrinkCommand(), MCBotCommand()
2024-09-25 14:48:59 +08:00
)