Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add MessageEntity.shift_entities and MessageEntity.concatenate #4376

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

Merged
merged 9 commits into from
Sep 1, 2024

Conversation

Bibo-Joshi
Copy link
Member

closes #4372

The implemented signature for ME.concatenate differs from the one proposed in #4372 to allow concanetating several tuples of text & entities at once.

  • Added .. versionadded:: NEXT.VERSION, .. versionchanged:: NEXT.VERSION, .. deprecated:: NEXT.VERSION or .. versionremoved:: NEXT.VERSION to the docstrings for user facing changes (for methods/class descriptions, arguments and attributes)
  • Created new or adapted existing unit tests
  • Documented code changes according to the CSI standard <https://standards.mousepawmedia.com/en/stable/csi.html>__
  • Added myself alphabetically to AUTHORS.rst (optional)
  • Added new classes & modules to the docs and all suitable __all__ s
  • Checked the Stability Policy <https://docs.python-telegram-bot.org/stability_policy.html>_ in case of deprecations or changes to documented behavior

Copy link
Contributor

@elpekenin elpekenin left a comment

Choose a reason for hiding this comment

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

Just a couple of nitpicks, LGTM

Copy link
Member

@harshil21 harshil21 left a comment

Choose a reason for hiding this comment

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

cool idea, I like it :)

by (Union[:obj:`str`, :obj:`int`]): Either the amount to shift the offset by or
a string whose length will be used as the amount to shift the offset by. In this
case, UTF-16 encoding will be used to calculate the length.
entities (Sequence[:class:`telegram.MessageEntity`]): Sequence of entities
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
entities (Sequence[:class:`telegram.MessageEntity`]): Sequence of entities
entities (Sequence[:class:`telegram.MessageEntity`]): Sequence of entities whose :paramref:`~telegram.MessageEntity.offset` will be shifted :param:`by`.

Copy link
Member Author

Choose a reason for hiding this comment

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

Shouldn't that be clear by the description? : πŸ€” it would at least have to be "by parameter by" ...

Copy link
Member

@harshil21 harshil21 Aug 26, 2024

Choose a reason for hiding this comment

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

well yeah, but the description of the parameter just looked a bit too short. I'm fine with keeping as is then

@Bibo-Joshi Bibo-Joshi merged commit e0f3686 into master Sep 1, 2024
26 of 27 checks passed
@Bibo-Joshi Bibo-Joshi deleted the me-convenience branch September 1, 2024 07:33
@github-actions github-actions bot locked and limited conversation to collaborators Sep 9, 2024
@Bibo-Joshi Bibo-Joshi added πŸ”Œ enhancement pr description: enhancement and removed enhancement labels Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
πŸ”Œ enhancement pr description: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Convenience Method for MessageEntity Concatenation
3 participants