Skip to content

Commit 2d41d2a

Browse files
committed
any_text / any_entities to Message
1 parent 31a73ff commit 2d41d2a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

telebot/types.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,14 @@ def user_shared(self):
16181618
logger.warning('The parameter "user_shared" is deprecated, use "users_shared" instead')
16191619
return self.users_shared
16201620

1621+
@property
1622+
def any_text(self):
1623+
return self.caption if (self.caption is not None) else self.text
1624+
1625+
@property
1626+
def any_entities(self):
1627+
return self.caption_entities if (self.caption_entities is not None) else self.entities
1628+
16211629

16221630
# noinspection PyShadowingBuiltins
16231631
class MessageEntity(Dictionaryable, JsonSerializable, JsonDeserializable):

0 commit comments

Comments
 (0)