Skip to content

Commit

Permalink
feat: consume messages from channels
Browse files Browse the repository at this point in the history
  • Loading branch information
akurilov committed Dec 27, 2023
1 parent 2e7a863 commit a2c6735
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,7 @@ func main() {
chat := tgCtx.Chat()
switch chat.Type {
case telebot.ChatChannel:
err = chanPostHandler.Publish(tgCtx)
case telebot.ChatChannelPrivate:
err = chanPostHandler.Publish(tgCtx)
case telebot.ChatGroup:
err = subListHandlerFunc(tgCtx)
case telebot.ChatSuperGroup:
Expand Down Expand Up @@ -330,8 +328,7 @@ func main() {
b.Handle(telebot.OnPayment, service.ErrorHandlerFunc(service.Payment(paymentHandlers)))
//
b.Handle(telebot.OnChannelPost, func(tgCtx telebot.Context) error {
log.Info(fmt.Sprintf("Channel post: %+v", tgCtx.Message()))
return nil
return chanPostHandler.Publish(tgCtx)
})
b.Handle(telebot.OnAddedToGroup, func(tgCtx telebot.Context) error {
chat := tgCtx.Chat()
Expand Down

0 comments on commit a2c6735

Please sign in to comment.