Skip to content

Commit

Permalink
feat: add allowed webhook permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
wizzardich committed Mar 30, 2024
1 parent 7e8a134 commit a2d4c53
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -117,6 +118,9 @@ func main() {
}()

for update := range updates {
if debugMode {
log.Printf("[WARNING] -- %v", update)
}
switch {
case update.ChannelPost == nil:
continue
Expand Down

0 comments on commit a2d4c53

Please sign in to comment.