From 4cab32f46e27b9ce2615615c4116d71c73b1d3e3 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Apr 2020 14:22:01 +0300 Subject: [PATCH] Fire OnPinned for channel post (closes #244) --- bot.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bot.go b/bot.go index 60ee4db..b577a86 100644 --- a/bot.go +++ b/bot.go @@ -296,6 +296,13 @@ func (b *Bot) incomingUpdate(upd *Update) { } if upd.ChannelPost != nil { + m := upd.ChannelPost + + if m.PinnedMessage != nil { + b.handle(OnPinned, m) + return + } + b.handle(OnChannelPost, upd.ChannelPost) return }