mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-07-01 21:07:23 +00:00
fix(config): 修复因正则表达式错误导致的 Token 检查失败.
由于表达式中限定的 BotId 为 Int 范围, 而目前的 TelegramUserId 已经扩展到 Long 了, 所以新的 Bot 是无法通过检查的, 已修正表达式问题.
This commit is contained in:
@ -264,7 +264,7 @@ object BotConfigSerializer : JsonSerializer<BotConfig>, JsonDeserializer<BotConf
|
||||
|
||||
object BotAccountSerializer : JsonDeserializer<BotAccount> {
|
||||
|
||||
private val tokenCheckRegex = Pattern.compile("\\d{9}:[a-zA-Z\\d_-]{35}")
|
||||
private val tokenCheckRegex = Pattern.compile("\\d+:[a-zA-Z\\d_-]{35}")
|
||||
|
||||
override fun deserialize(json: JsonElement?, typeOfT: Type?, context: JsonDeserializationContext?): BotAccount {
|
||||
if (json == null || json.isJsonNull) {
|
||||
|
Reference in New Issue
Block a user