-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add reactions support. #142
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Some small changes but otherwise very happy with this.
Thanks a lot!
func FromUserID(id int64) filters.Reaction { | ||
return func(mru *gotgbot.MessageReactionUpdated) bool { | ||
if mru.User != nil { | ||
return mru.User.Id == id | ||
} | ||
|
||
return false | ||
} | ||
} | ||
|
||
func FromAnonymousChatID(id int64) filters.Reaction { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Random thought: should we be merging this to a single item? How are the other handlers doing it? I'm not sure it makes sense to have both, since only one can trigger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, yep, correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you think about merge them and name as FromPeer
?
I don't know how Telegram names such things exactly in BotAPI, but in MTProto it's named usually as Peer
.
…rename FromChatID to ChatID, rename New(Old)ReactionIn to New(Old)ReactionEmoji.
|
What
This introduces support for handling new reactions that are set on messages.
Adds new filters:
Reaction.FromUserID(id int64)
- Checks whether the reaction from specified user or not.Reaction.FromAnonymousChatID(id int64)
- Checks whether the reaction from specified anonymous channel\admin or not.Reaction.FromChatID(id int64)
- Checks if the reaction has been set in specified chatReaction.New(Old)ReactionIn(reaction string)
- Checks if the newly set(removed) reaction contains emoji, which is provided asreaction
argument.Impact