+20
-10
@@ -34,16 +34,26 @@ type botOptsFileJSONAPI struct {
|
||||
|
||||
// BotOptsFileJSON is the JSON file representation of BotOpts.
|
||||
type BotOptsFileJSON struct {
|
||||
Version int `json:"version"`
|
||||
Token string `json:"token"`
|
||||
UpdateTypes []tgapi.UpdateType `json:"update_types"`
|
||||
Debug bool `json:"debug"`
|
||||
ErrorTemplate string `json:"error_template"`
|
||||
Prefixes []string `json:"prefixes"`
|
||||
Logger botOptsFileJSONLogger `json:"logger"`
|
||||
API botOptsFileJSONAPI `json:"api"`
|
||||
StrictPayloadType bool `json:"strict_payload_type"`
|
||||
MaxWorkers int `json:"max_workers"`
|
||||
// Version identifies the JSON configuration format version.
|
||||
Version int `json:"version"`
|
||||
// Token is the Telegram bot token.
|
||||
Token string `json:"token"`
|
||||
// UpdateTypes limits the update kinds requested from Telegram.
|
||||
UpdateTypes []tgapi.UpdateType `json:"update_types"`
|
||||
// Debug enables debug logging.
|
||||
Debug bool `json:"debug"`
|
||||
// ErrorTemplate formats user-facing handler errors.
|
||||
ErrorTemplate string `json:"error_template"`
|
||||
// Prefixes contains accepted command prefixes.
|
||||
Prefixes []string `json:"prefixes"`
|
||||
// Logger contains file logging options.
|
||||
Logger botOptsFileJSONLogger `json:"logger"`
|
||||
// API contains Telegram client and rate-limit options.
|
||||
API botOptsFileJSONAPI `json:"api"`
|
||||
// StrictPayloadType requires callback payloads to use the configured encoding.
|
||||
StrictPayloadType bool `json:"strict_payload_type"`
|
||||
// MaxWorkers limits concurrent update handlers.
|
||||
MaxWorkers int `json:"max_workers"`
|
||||
}
|
||||
|
||||
// BotOptsFileJSONCodec encodes and decodes BotOpts using BotOptsFileJSON.
|
||||
|
||||
Reference in New Issue
Block a user