-
Notifications
You must be signed in to change notification settings - Fork 1
Add chat member filters #10
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
Conversation
roziscoding
left a comment
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.
This is awesome work.
TYSM!
KnorpelSenf
left a comment
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.
Implementation looks great!
Regarding the docs: It's awesome to have such great descriptions, but they are not duplicated in the repo and the website. In general, we tend to only give very short quickstarts in the README files and link to the website for everything else. This makes sure that the docs don't start to diverge and it also reduces the maintenance overhead.
You may or may not remove them, do whatever you think is best. That being said, you might want to save the effort in the future.
I just have a few nitpicks, the changes LGTM otherwise:
Co-authored-by: KnorpelSenf <[email protected]>
KnorpelSenf
left a comment
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.
LGTM after you and @roziscoding have figured out how to prevent line wrapping
KnorpelSenf
left a comment
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.
LGTM, @roziscoding?
|
any update on this? I would like to use it in one of my projects |
|
oh, my bad. LGTM! |
| * ```typescript | ||
| * // listen for updates where the bot enters a group/supergroup | ||
| * bot.chatType(['group', 'supergroup']).filter( | ||
| * myChatMemberFilter('out', 'in'), | ||
| * (ctx) => { | ||
| * const { old_chat_member: oldChatMember, new_chat_member: newChatMember } = | ||
| * ctx.myChatMember; | ||
| * // ... | ||
| * }, | ||
| * ); |
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.
This is poorly formatted. It is missing the end tag for the fenced markdown. Our website's CI system detected this: https://github.com/grammyjs/website/actions/runs/14077798929/job/39423885725?pr=1204
/cc @rojvv
This pull request adds chat member filters to the plugin, a convenient way to filter for chat member statuses and updates.
I moved the original code to a separate
storage.tsfile and created afilters.tsfile containing the new filters, everything is exported frommod.ts.I updated the README to explain how the new filters can be used.