Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnPinned Cannot Listen From Channel Auto Pinned Message #244

Closed
du5 opened this issue Jan 8, 2020 · 5 comments
Closed

OnPinned Cannot Listen From Channel Auto Pinned Message #244

du5 opened this issue Jan 8, 2020 · 5 comments
Labels
Milestone

Comments

@du5
Copy link

du5 commented Jan 8, 2020

OnPinned = "\apinned"

@du5 du5 closed this as completed Jan 8, 2020
@du5 du5 reopened this Jan 8, 2020
@demget
Copy link
Collaborator

demget commented Mar 29, 2020

You're right. I will fix it in v2.1.

@demget demget added the bug label Mar 29, 2020
@demget demget added this to the 2.1 milestone Mar 29, 2020
@du5
Copy link
Author

du5 commented Apr 7, 2020

@demget thanks

@demget demget added the ready label Apr 16, 2020
@demget demget closed this as completed in 4cab32f Apr 26, 2020
@du5
Copy link
Author

du5 commented Jun 5, 2020

@demget Still can't monitor the pinned notifications of channel-linked groups

@du5
Copy link
Author

du5 commented Jun 5, 2020

My current solution

chat is group, 777000 is telegram chaneel pinned sender id

disEvent := []string{tb.OnPhoto, tb.OnAudio, tb.OnDocument,
	tb.OnSticker, tb.OnVideo, tb.OnVoice, tb.OnVideoNote, tb.OnContact,
	tb.OnLocation, tb.OnVenue}
exists, _ := In_array(OnEvent, disEvent)
if m.Sender.ID == 777000 {
	b.Pin(&tb.Message{ID: pinnedMessageID, Chat: m.Chat})
	return
}

du5 added a commit to du5/telebot that referenced this issue Jun 5, 2020
@du5 du5 mentioned this issue Jun 5, 2020
@du5
Copy link
Author

du5 commented Jun 5, 2020

if m.Sender != nil && (m.Sender.ID == 777000 && (m.Chat.Type == ChatGroup || m.Chat.Type == ChatSuperGroup)) {
	b.handle(OnPinned, m)
	return
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants