返回 DeepSeek-Reasonix
bot_provenance.go
根目录 / internal / config / bot_provenance.go
1 package config
2
3 // BotInstallMayEnableGateway reports whether a finished bot install may switch
4 // the embedded gateway on. The first connection is onboarding and always may;
5 // after that an explicit [bot] enabled is the user's, so re-scanning a QR code
6 // to refresh credentials must not turn a deliberate false back on (#8041).
7 func BotInstallMayEnableGateway(c *Config) bool {
8 if c == nil {
9 return false
10 }
11 return len(c.Bot.Connections) == 0 || !tomlFileDefinesKey(UserConfigPath(), "bot", "enabled")
12 }
13
13 lines GO