-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
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.
Just a couple of nitpicks, LGTM
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.
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 |
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.
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`. |
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.
Shouldn't that be clear by the description? : π€ it would at least have to be "by parameter by" ...
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.
well yeah, but the description of the parameter just looked a bit too short. I'm fine with keeping as is then
Co-authored-by: Harshil <[email protected]>
Co-authored-by: Harshil <[email protected]>
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... 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)CSI standard <https://standards.mousepawmedia.com/en/stable/csi.html>
__Added myself alphabetically toAUTHORS.rst
(optional)Added new classes & modules to the docs and all suitable__all__
sStability Policy <https://docs.python-telegram-bot.org/stability_policy.html>
_ in case of deprecations or changes to documented behavior