Make debug mode available as option of true/false

This commit is contained in:
null31 2024-09-14 03:11:52 +02:00
parent c48c9f2e30
commit b4d07821f3
Signed by: null31
GPG Key ID: CAB4CF4EE49720FF
3 changed files with 4 additions and 2 deletions

View File

@ -2,5 +2,6 @@
"bot_token": "ID:Secret",
"chat_id": "USER_OR_CHAT_ID",
"geoip_city": "geolite2-city.mmdb",
"geoip_asn": "geolite2-asn.mmdb"
"geoip_asn": "geolite2-asn.mmdb",
"debug": false
}

View File

@ -24,7 +24,7 @@ func main() {
log.Fatalf("Failed to create bot: %v", err)
}
bot.Debug = true
bot.Debug = config.Debug
log.Printf("Authorized on account %s", bot.Self.UserName)
// Set up an update config to filter messages from the chat

View File

@ -11,6 +11,7 @@ type Config struct {
ChatID string `json:"chat_id"`
GeoIP_City string `json:"geoip_city"`
GeoIP_ASN string `json:"geoip_asn"`
Debug bool `json:"debug"`
}
func LoadConfig(file string) (Config, error) {