Add usage
This commit is contained in:
parent
2aa043b5fc
commit
6f111a42e9
10
main.go
10
main.go
@ -26,12 +26,20 @@ import (
|
|||||||
var Version string
|
var Version string
|
||||||
var apiToken string
|
var apiToken string
|
||||||
|
|
||||||
|
var usage string = `Telegram List bot
|
||||||
|
Environment variables:
|
||||||
|
TGLB_API_TOKEN (required): See https://core.telegram.org/bots#how-do-i-create-a-bot
|
||||||
|
TGLB_PORT (default 28923): Set numerical port or unix//run/path.sock for unix socket
|
||||||
|
TGLB_DATA_PATH (default .): Directory path where list data is stored
|
||||||
|
`
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
apiToken = os.Getenv("TGLB_API_TOKEN")
|
apiToken = os.Getenv("TGLB_API_TOKEN")
|
||||||
|
|
||||||
if apiToken == "" {
|
if apiToken == "" {
|
||||||
log.Panicln("TG_API_TOKEN is empty")
|
log.Print(usage)
|
||||||
|
log.Panicln("TGLB_API_TOKEN is empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
port, unixSocketPath := func() (int, string) {
|
port, unixSocketPath := func() (int, string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user