mirror of
https://github.com/jie65535/mirai-console-jcf-plugin.git
synced 2025-06-09 17:59:15 +08:00
添加订阅配置与持久化对象
- 添加配置:检查间隔、订阅信息推送bot - 添加数据:订阅记录、模组最新文件的id集合
This commit is contained in:
parent
682cdbeb38
commit
f1e6e2fbf5
@ -20,4 +20,16 @@ object PluginConfig : AutoSavePluginConfig("JCurseforgeConfig") {
|
||||
MinecraftService.ModClass.CUSTOMIZATION to "cfcustom ",
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* 订阅信息推送bot
|
||||
*/
|
||||
@ValueDescription("订阅信息推送bot(qq id)")
|
||||
val subscribeSender: Long by value(-1L)
|
||||
|
||||
/**
|
||||
* 检查间隔
|
||||
*/
|
||||
@ValueDescription("检查间隔(单位:秒)")
|
||||
val checkInterval: Long by value(60 * 60 * 4L)
|
||||
}
|
||||
|
36
src/main/kotlin/top/jie65535/jcf/PluginData.kt
Normal file
36
src/main/kotlin/top/jie65535/jcf/PluginData.kt
Normal file
@ -0,0 +1,36 @@
|
||||
package top.jie65535.jcf
|
||||
|
||||
import net.mamoe.mirai.console.data.AutoSavePluginData
|
||||
import net.mamoe.mirai.console.data.value
|
||||
import net.mamoe.mirai.console.data.ValueDescription
|
||||
|
||||
object PluginData : AutoSavePluginData("JCurseforgeData") {
|
||||
|
||||
/**
|
||||
* 模组最新文件的id集合
|
||||
* ```json
|
||||
* {
|
||||
* mod_id: file_id,
|
||||
* ...
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
@ValueDescription("模组最新文件的id集合")
|
||||
var modsLastFile: MutableMap<Int, Int> by value()
|
||||
|
||||
/**
|
||||
* 订阅记录
|
||||
* ```json
|
||||
* {
|
||||
* mod_id: {
|
||||
* group_id: [ qq_id, ... ],
|
||||
* ...
|
||||
* },
|
||||
* ...
|
||||
* }
|
||||
* ```
|
||||
* 个人订阅时,group为0
|
||||
*/
|
||||
@ValueDescription("订阅记录")
|
||||
var subscriptionSet: MutableMap<Int, MutableMap<Long, MutableList<Long>>> by value()
|
||||
}
|
Loading…
Reference in New Issue
Block a user