Config

data class Config(var deviceInfoSeed: Long = DEFAULT_SIMBOT_MIRAI_DEVICE_INFO_SEED, var workingDir: File = BotConfiguration.Default.workingDir, var heartbeatPeriodMillis: Long = BotConfiguration.Default.heartbeatPeriodMillis, var statHeartbeatPeriodMillis: Long = BotConfiguration.Default.statHeartbeatPeriodMillis, var heartbeatTimeoutMillis: Long = BotConfiguration.Default.heartbeatTimeoutMillis, var heartbeatStrategy: BotConfiguration.HeartbeatStrategy = BotConfiguration.Default.heartbeatStrategy, var reconnectionRetryTimes: Int = BotConfiguration.Default.reconnectionRetryTimes, var autoReconnectOnForceOffline: Boolean = BotConfiguration.Default.autoReconnectOnForceOffline, var protocol: BotConfiguration.MiraiProtocol = BotConfiguration.Default.protocol, var highwayUploadCoroutineCount: Int = BotConfiguration.Default.highwayUploadCoroutineCount, var deviceInfoJson: DeviceInfo? = null, var simpleDeviceInfoJson: SimpleDeviceInfo? = null, var deviceInfoFile: String? = null, var deviceInfoConfiguration: DeviceInfoConfiguration? = DeviceInfoConfiguration.Auto(), var noNetworkLog: Boolean = false, var noBotLog: Boolean = false, var isShowingVerboseEventLog: Boolean = BotConfiguration.Default.isShowingVerboseEventLog, var cacheDir: File = BotConfiguration.Default.cacheDir, var contactListCacheConfiguration: MiraiBotVerifyInfoConfiguration.ContactListCacheConfiguration = ContactListCacheConfiguration(), var loginCacheEnabled: Boolean = BotConfiguration.Default.loginCacheEnabled, var convertLineSeparator: Boolean = BotConfiguration.Default.convertLineSeparator, recallMessageCacheStrategy: MiraiBotVerifyInfoConfiguration.RecallMessageCacheStrategyType? = null, var recallMessageCacheStrategyConfig: RecallMessageCacheStrategyConfiguration = RecallMessageCacheStrategyConfiguration.invalid(), var accountSecrets: Boolean = false)(source)

MiraiBotVerifyInfoConfiguration 中除了必要信息以外的额外配置信息。

Constructors

Link copied to clipboard
fun Config(deviceInfoSeed: Long = DEFAULT_SIMBOT_MIRAI_DEVICE_INFO_SEED, workingDir: File = BotConfiguration.Default.workingDir, heartbeatPeriodMillis: Long = BotConfiguration.Default.heartbeatPeriodMillis, statHeartbeatPeriodMillis: Long = BotConfiguration.Default.statHeartbeatPeriodMillis, heartbeatTimeoutMillis: Long = BotConfiguration.Default.heartbeatTimeoutMillis, heartbeatStrategy: BotConfiguration.HeartbeatStrategy = BotConfiguration.Default.heartbeatStrategy, reconnectionRetryTimes: Int = BotConfiguration.Default.reconnectionRetryTimes, autoReconnectOnForceOffline: Boolean = BotConfiguration.Default.autoReconnectOnForceOffline, protocol: BotConfiguration.MiraiProtocol = BotConfiguration.Default.protocol, highwayUploadCoroutineCount: Int = BotConfiguration.Default.highwayUploadCoroutineCount, deviceInfoJson: DeviceInfo? = null, simpleDeviceInfoJson: SimpleDeviceInfo? = null, deviceInfoFile: String? = null, deviceInfoConfiguration: DeviceInfoConfiguration? = DeviceInfoConfiguration.Auto(), noNetworkLog: Boolean = false, noBotLog: Boolean = false, isShowingVerboseEventLog: Boolean = BotConfiguration.Default.isShowingVerboseEventLog, cacheDir: File = BotConfiguration.Default.cacheDir, contactListCacheConfiguration: MiraiBotVerifyInfoConfiguration.ContactListCacheConfiguration = ContactListCacheConfiguration(), loginCacheEnabled: Boolean = BotConfiguration.Default.loginCacheEnabled, convertLineSeparator: Boolean = BotConfiguration.Default.convertLineSeparator, recallMessageCacheStrategy: MiraiBotVerifyInfoConfiguration.RecallMessageCacheStrategyType? = null, recallMessageCacheStrategyConfig: RecallMessageCacheStrategyConfiguration = RecallMessageCacheStrategyConfiguration.invalid(), accountSecrets: Boolean = false)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

将当前配置的信息转化为 MiraiBotConfiguration 实例。

Properties

Link copied to clipboard
var accountSecrets: Boolean = false

如果为 true, 则会使用 BotConfiguration.disableAccountSecretes 禁用 account.secrets 的保存。

Link copied to clipboard
Link copied to clipboard

是否处理接受到的特殊换行符, 默认为 true

Link copied to clipboard
Link copied to clipboard
@ApiStatus.ScheduledForRemoval(inVersion = "3.0.0.0")
var deviceInfoFile: String? = null

加载的设备信息json文件的路径。 如果是 classpath: 开头,则会优先尝试加载resource, 否则优先视为文件路径加载。

Link copied to clipboard
@ApiStatus.ScheduledForRemoval(inVersion = "3.0.0.0")
var deviceInfoJson: DeviceInfo? = null

如果是字符串,尝试解析为json 否则视为文件路径。 如果bot本身为json格式,则允许此处直接为json对象。

Link copied to clipboard

mirai配置自定义deviceInfoSeed的时候使用的随机种子。默认为1.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

是否开启登录缓存。

Link copied to clipboard
var noBotLog: Boolean = false

是否不输出Bot日志。当为true时等同于使用了 BotConfiguration.noBotLog

Link copied to clipboard
var noNetworkLog: Boolean = false

是否不输出网络日志。当为true时等同于使用了 BotConfiguration.noNetworkLog

Link copied to clipboard
Link copied to clipboard

消息撤回缓存策略,默认使用 不缓存 策略。

Link copied to clipboard
Link copied to clipboard
@ApiStatus.ScheduledForRemoval(inVersion = "3.0.0.0")
var simpleDeviceInfoJson: SimpleDeviceInfo? = null

优先使用 deviceInfo.

Link copied to clipboard

Mirai配置中的工作目录。