|
|
|
@ -35,9 +35,9 @@ func main() { |
|
|
|
|
u := tgbotapi.NewUpdate(0) |
|
|
|
|
u.Timeout = 60 |
|
|
|
|
|
|
|
|
|
err = bot.UpdatesChan(u) |
|
|
|
|
updates, err := bot.GetUpdatesChan(u) |
|
|
|
|
|
|
|
|
|
for update := range bot.Updates { |
|
|
|
|
for update := range updates { |
|
|
|
|
log.Printf("[%s] %s", update.Message.From.UserName, update.Message.Text) |
|
|
|
|
|
|
|
|
|
msg := tgbotapi.NewMessage(update.Message.Chat.ID, update.Message.Text) |
|
|
|
@ -74,10 +74,10 @@ func main() { |
|
|
|
|
log.Fatal(err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bot.ListenForWebhook("/"+bot.Token) |
|
|
|
|
updates, _ := bot.ListenForWebhook("/" + bot.Token) |
|
|
|
|
go http.ListenAndServeTLS("0.0.0.0:8443", "cert.pem", "key.pem", nil) |
|
|
|
|
|
|
|
|
|
for update := range bot.Updates { |
|
|
|
|
for update := range updates { |
|
|
|
|
log.Printf("%+v\n", update) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|