telegram-bot-api icon indicating copy to clipboard operation
telegram-bot-api copied to clipboard

how can i receive channels and groups messages

Open no-1imit opened this issue 2 years ago • 2 comments

Hi, i use updates := bot.GetUpdatesChan(updateConfig) and loop update := range updates and i get only direct messages, how can i get messages users send in groups or channels?

no-1imit avatar May 20 '22 16:05 no-1imit

@no-1imit Did you manage to solve this problem? Thx

nickRiNi avatar Aug 04 '22 14:08 nickRiNi

to get updates from channels use u := tgbotapi.NewUpdate(0) u.AllowedUpdates = []string{"channel_post"} to access the messages in your for loop use update.ChannelPost

appleGun22 avatar Aug 15 '22 13:08 appleGun22