TelegramChatStats icon indicating copy to clipboard operation
TelegramChatStats copied to clipboard

KeyError: 'from'

Open danzerzine opened this issue 3 years ago • 3 comments

Hi, I've followed the instruction, but get the following error message, could you please point to possible solution?

importing raw data...
input data is a single chat export
calculating metrics...
Traceback (most recent call last):
  File "telegram-statistics.py", line 267, in <module>
    main()
  File "telegram-statistics.py", line 209, in main
    calculate_metrics(chat_data, date_filter)
  File "telegram-statistics.py", line 137, in calculate_metrics
    metrics = _message_numerics(chat_data, date_filter)
  File "/work/_message_numerics.py", line 24, in _message_numerics
    metrics["A"]["name"] = chat["messages"][1]["from"]
KeyError: 'from'

danzerzine avatar May 09 '22 21:05 danzerzine

I'm having the identical issue.

aleks648 avatar Jul 31 '22 22:07 aleks648

What type of chat are you exporting @aleks648 and @danzerzine ? Is it from a group, or a bot? I just tested it with two different single chat exports and I cannot reproduce the problem.

mnemocron avatar Aug 01 '22 08:08 mnemocron

What type of chat are you exporting @aleks648 and @danzerzine ? Is it from a group, or a bot? I just tested it with two different single chat exports and I cannot reproduce the problem.

"type": "public_supergroup",

celgus avatar Nov 02 '22 21:11 celgus