feat: announce command list
This commit is contained in:
parent
37dffe56ce
commit
440d36b291
2 changed files with 22 additions and 2 deletions
10
cfg.go
10
cfg.go
|
|
@ -10,8 +10,9 @@ import (
|
|||
)
|
||||
|
||||
type Config struct {
|
||||
AdminUIDs map[int64]struct{}
|
||||
TGBotToken string
|
||||
AdminUIDs map[int64]struct{}
|
||||
TGBotToken string
|
||||
TGAnnounceCommands bool
|
||||
|
||||
WatchedInterface string
|
||||
MonthlyTrafficLimitGiB int
|
||||
|
|
@ -42,6 +43,11 @@ func LoadCfg() error {
|
|||
cfg.AdminUIDs[uid] = struct{}{}
|
||||
}
|
||||
|
||||
announceCmdsEnv := os.Getenv("TG_ANNOUNCE_CMDS")
|
||||
if !lo.Contains([]string{"", "no", "false", "0"}, strings.ToLower(announceCmdsEnv)) {
|
||||
cfg.TGAnnounceCommands = true
|
||||
}
|
||||
|
||||
cfg.WatchedInterface = "eth0"
|
||||
if iface := os.Getenv("TG_WATCHED_INTERFACE"); iface != "" {
|
||||
cfg.WatchedInterface = iface
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue