Add usage
This commit is contained in:
		
							
								
								
									
										10
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								main.go
									
									
									
									
									
								
							@@ -26,12 +26,20 @@ import (
 | 
			
		||||
var Version 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() {
 | 
			
		||||
 | 
			
		||||
	apiToken = os.Getenv("TGLB_API_TOKEN")
 | 
			
		||||
 | 
			
		||||
	if apiToken == "" {
 | 
			
		||||
		log.Panicln("TG_API_TOKEN is empty")
 | 
			
		||||
		log.Print(usage)
 | 
			
		||||
		log.Panicln("TGLB_API_TOKEN is empty")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	port, unixSocketPath := func() (int, string) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user