Skip to content

Conversation

@rayz1065
Copy link
Member

This pull request adds documentation for chat member filters in the chat-members plugin section.

grammyjs/chat-members#10

Let me know if the paragraph structure or anything else could be improved.

@github-actions
Copy link

github-actions bot commented Jan 23, 2025

@github-actions github-actions bot temporarily deployed to pull request January 23, 2025 14:18 Inactive
Copy link
Member

@KnorpelSenf KnorpelSenf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a few things here and there, mostly nitpicks. Thanks for the extensive docs, though, we need more people like you who do this!

@github-actions github-actions bot temporarily deployed to pull request January 24, 2025 11:37 Inactive
@github-actions github-actions bot temporarily deployed to pull request January 24, 2025 12:04 Inactive
@github-actions github-actions bot temporarily deployed to pull request January 27, 2025 22:51 Inactive
@rayz1065 rayz1065 requested a review from KnorpelSenf January 28, 2025 09:23
Copy link
Member

@KnorpelSenf KnorpelSenf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KnorpelSenf
Copy link
Member

@roziscoding anything else?

@roziscoding
Copy link
Contributor

@roziscoding anything else?

not at all, this looks great!
thanks @rayz1065!

@KnorpelSenf KnorpelSenf requested a review from rojvv January 30, 2025 14:02
@github-actions github-actions bot temporarily deployed to pull request February 6, 2025 15:21 Inactive
Copy link
Member

@KnorpelSenf KnorpelSenf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

If you want, you can add a few lines to the existing code example and contrast it with the code that is necessary without this plugin. This would be similar to how the explanations for the hydrate plugin work. This is just an idea, feel free to ignore it—I approve either way.

@github-actions github-actions bot temporarily deployed to pull request February 14, 2025 10:43 Inactive
@rayz1065
Copy link
Member Author

add a few lines to the existing code example and contrast it with the code

Were you thinking something like:

In contrast, filtering for users joining a group/supergroup without this plugin would require the following code:

// filter for users joining the group without the plugin
bot
  .chatType(["group", "supergroup"])
  .on("chat_member")
  .filter(
    (ctx) => {
      const { old_chat_member: oldMember, new_chat_member: newMember } =
        ctx.chatMember;
      return (
        (["kicked", "left"].includes(oldMember.status) ||
          (oldMember.status === "restricted" && !oldMember.is_member)) &&
        (["administrator", "creator", "member"].includes(newMember.status) ||
          (newMember.status === "restricted" && newMember.is_member))
      );
    },
    (ctx) => {
      ctx.chatMember.new_chat_member.status; // type is not narrowed :(
    }
  );

Right after the code-group showing the various filters?

@KnorpelSenf
Copy link
Member

Yes, except that I would include it in the existing code group and add comments

// WITHOUT this plugin:
complexCode
// WITH this plugin:
easyCode

but that's just something to try out, I am not saying that I'm sure it's better

@github-actions github-actions bot temporarily deployed to pull request February 17, 2025 12:00 Inactive
@github-actions github-actions bot temporarily deployed to pull request April 19, 2025 12:53 Inactive
@niusia-ua niusia-ua added the 🇺🇦 UK Modifies or is related to the Ukrainian translations. label Apr 19, 2025
@ppabcd ppabcd added the 🇮🇩 ID Modifies or is related to the Indonesian translations. label Apr 21, 2025
@github-actions github-actions bot temporarily deployed to pull request April 21, 2025 12:59 Inactive
@habemuscode habemuscode added the 🇪🇸 ES Modifies or is related to the Spanish translations. label Jun 21, 2025
@github-actions github-actions bot temporarily deployed to pull request August 16, 2025 19:51 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 23, 2025 13:04 Inactive
@github-actions github-actions bot temporarily deployed to pull request September 3, 2025 10:03 Inactive
@github-actions github-actions bot temporarily deployed to pull request September 3, 2025 14:51 Inactive
@github-actions github-actions bot temporarily deployed to pull request October 12, 2025 14:21 Inactive
@github-actions github-actions bot temporarily deployed to pull request November 3, 2025 13:18 Inactive
@grammyz grammyz added the 🇨🇳 ZH Modifies or is related to the Chinese translations. label Nov 3, 2025
@github-actions github-actions bot temporarily deployed to pull request November 3, 2025 14:06 Inactive
@KnorpelSenf KnorpelSenf added 🇨🇳 ZH Modifies or is related to the Chinese translations. and removed 🇨🇳 ZH Modifies or is related to the Chinese translations. labels Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🇨🇳 ZH Modifies or is related to the Chinese translations. 🇪🇸 ES Modifies or is related to the Spanish translations. 🇮🇩 ID Modifies or is related to the Indonesian translations. ready for translation Translator intervention is required. 🇺🇦 UK Modifies or is related to the Ukrainian translations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.