Skip to content

Commit 3bc1c99

Browse files
committed
add tips to console when token too short
1 parent f737bc8 commit 3bc1c99

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/plugin/OverflowCoreAsPlugin.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,16 @@ internal object OverflowCoreAsPlugin : Plugin, CommandOwner {
187187
appendLine()
188188
appendLine()
189189
}
190+
if (Overflow.instance.config.token.length <= 8) {
191+
ConsoleCommandSender.sendAnsiMessage {
192+
appendLine()
193+
reset().lightRed()
194+
append(" (!) ")
195+
reset().lightYellow()
196+
append("请注意,你没有设置 token 或 token 长度过短,如果你的 Onebot 服务暴露在公网中,将有可能被有心人士利用进行非法操作。").reset()
197+
appendLine()
198+
}
199+
}
190200
if (autoConnect) startWithConfig()
191201
}
192202

0 commit comments

Comments
 (0)