chore: format code

This commit is contained in:
2024-10-15 18:58:12 +08:00
parent c4e6f9e348
commit 6b4ef38443
5 files changed
+35 -5

No files matched your search

@@ -4,6 +4,7 @@
* Date: 2024/10/7
*/
@file:Suppress("unused")
package cn.rtast.fancybot.util
@@ -15,4 +16,8 @@ object Logger {
inline fun <reified T> getLogger(): Logger {
return LoggerFactory.getLogger(T::class.simpleName).also { it.atLevel(Level.INFO) }
}
fun getLogger(name: String): Logger {
return LoggerFactory.getLogger(name)
}
}
@@ -24,11 +24,9 @@ suspend fun OneBotListener.getUserName(groupId: Long, userId: Long): String {
return info.card ?: info.nickname
}
fun initCommandAndItem(rob: ROneBotFactory) {
fun initCommand(rob: ROneBotFactory) {
val commandManager = rob.commandManager
commands.forEach { commandManager.register(it) }
items.forEach { itemManager.register(it) }
tasks.forEach { rob.scheduler.scheduleTask(it.value, 1000L, it.key) }
}
fun initFilesDir() {
@@ -43,4 +41,12 @@ fun initSetuIndex() {
val fileContent = Http.get("$ASSETS_BASE_URL/files/pixiv_index_v3.json")
file.writeText(fileContent)
}
}
fun initItems() {
items.forEach { itemManager.register(it) }
}
fun initBackgroundTasks(rob: ROneBotFactory) {
tasks.forEach { rob.scheduler.scheduleTask(it.value, 1000L, it.key) }
}