INNER CODE UNIT · Go

main

instead-hub/instead · src/tiny/ifbot/tg-bot/main.go:12

func main() {
	if len(os.Args) != 2 {
		fmt.Println("BOT Token missing")
		os.Exit(1)
	}
	bot, err := tgbotapi.NewBotAPI(os.Args[1])
	if err != nil {
		log.Panic(err)
	}

	// bot.Debug = true
	log.Printf("Authorized on account %s", bot.Self.UserName)

	u := tgbotapi.NewUpdate(0)
	u.Timeout = 60

	updates, err := bot.GetUpdatesChan(u)
	for update := range updates {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…