Answer the question
In order to leave comments, you need to log in
How to get the necessary data from MessageEntity (Telegram bot, Python)?
I have an object. about like this.
call.message= {'content_type': 'text',
'message_id': 3704,
'from_user': {'id': 000000000,
'is_bot': True,
'first_name': 'testbot',
'username': 'test_bot',
'last_name': None,
'language_code': None},
'date': 1534805095,
'chat': {'type': 'private',
'last_name': None,
'first_name': 'Myza',
'username': 'vera_ira',
'id': 000000000,
'title': None,
'all_members_are_administrators': None,
'photo': None},
.... ....
'json': {'message_id': 3704,
'from': {'id': 000000000,
'is_bot': True,
'first_name': 'Irisbot',
'username': 'Via00000000000_bot'},
'chat': {'id': 000000000,
'first_name': 'Myza',
'username': 'vera_ira',
'type': 'private'},
'date': 1534805095,
'text': 'тттт ттттттттт ттттт тт т тттттт тттт ооооооо ттт тттт ттт.',
'entities': [{'offset': 32, 'length': 7, 'type': 'bold'}]}}
print(call.message.json.entities.offset)
print(call.message.json.entities.length)
AttributeError: 'dict' object has no attribute 'entities'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question