Skip to content

Conversation

@mordv
Copy link

@mordv mordv commented Apr 23, 2025

No description provided.

@KnorpelSenf
Copy link
Member

Why did you add this specific filter query and not one of the 1395 filter queries that are not mentioned on the page?

@mordv
Copy link
Author

mordv commented Apr 24, 2025

Same reason others were added - picked randomly.
There are only two L2 to which L3 can be applied, so I added caption_entities - thats the point of PR
It also plays nicely with this line

bot.on("message::url"); // messages with URL in text or caption (photos, etc)

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.

Sorry for the insane delay, I really don't have enough time for OSS recently. This can still be merged, but I don't fully agree yet:

Comment on lines +54 to 55
bot.on("message:caption_entities:url"); // captions containing a URL
bot.on("message:entities:code"); // messages containing a code snippet
Copy link
Member

Choose a reason for hiding this comment

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

How about this instead?

Suggested change
bot.on("message:caption_entities:url"); // captions containing a URL
bot.on("message:entities:code"); // messages containing a code snippet
bot.on("message:caption_entities:code"); // captions containing a code snippet

| `"message"` | `"message"` | `undefined` | `undefined` |
| `"message:entities"` | `"message"` | `"entities"` | `undefined` |
| `"message:entities:mention"` | `"message"` | `"entities"` | `"mention"` |
| `"message:caption_entities:url"` | `"message"` | `"caption_entities"` | `"url"` |
Copy link
Member

Choose a reason for hiding this comment

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

This is inconsistent with the other rows. The point here is to show how a single query is built up in three parts. Adding a second random query is confusing.

Let's revert.

Suggested change
| `"message:caption_entities:url"` | `"message"` | `"caption_entities"` | `"url"` |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants