From a2d4c53c465105a171117e409755370d4230651b Mon Sep 17 00:00:00 2001 From: Vlad Tomashpolskyi Date: Sat, 30 Mar 2024 22:57:48 +0100 Subject: [PATCH] feat: add allowed webhook permissions --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index d14db92..068e462 100644 --- a/main.go +++ b/main.go @@ -88,6 +88,7 @@ func main() { log.Printf("Authorized on account %s", bot.Self.UserName) wh, err := tgbotapi.NewWebhook(localURL + bot.Token) + wh.AllowedUpdates = []string{"channel_post"} if err != nil { log.Fatal(err) @@ -117,6 +118,9 @@ func main() { }() for update := range updates { + if debugMode { + log.Printf("[WARNING] -- %v", update) + } switch { case update.ChannelPost == nil: continue