Init commit
This commit is contained in:
27
main.go
Normal file
27
main.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"log"
|
||||
"tgbot/clients/telegram"
|
||||
)
|
||||
|
||||
const (
|
||||
tgBotHost = "api.telegram.org"
|
||||
)
|
||||
|
||||
func main() {
|
||||
tgClient = telegram.New(tgBotHost, mustToken())
|
||||
}
|
||||
|
||||
func mustToken() string {
|
||||
token := flag.String("token-bot-token", "", "token for access to telegram bot")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
if *token == "" {
|
||||
log.Fatal("token is not specified")
|
||||
}
|
||||
|
||||
return *token
|
||||
}
|
||||
Reference in New Issue
Block a user