Skip to content

Commit

Permalink
any_text / any_entities to Message
Browse files Browse the repository at this point in the history
  • Loading branch information
Badiboy committed Aug 17, 2024
1 parent 31a73ff commit 2d41d2a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions telebot/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,14 @@ def user_shared(self):
logger.warning('The parameter "user_shared" is deprecated, use "users_shared" instead')
return self.users_shared

@property
def any_text(self):
return self.caption if (self.caption is not None) else self.text

@property
def any_entities(self):
return self.caption_entities if (self.caption_entities is not None) else self.entities


# noinspection PyShadowingBuiltins
class MessageEntity(Dictionaryable, JsonSerializable, JsonDeserializable):
Expand Down

0 comments on commit 2d41d2a

Please sign in to comment.