fbchat-dev / fbchat

Facebook Chat (Messenger) for Python
https://fbchat.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.19k stars 412 forks source link

AttributeError: 'NoneType' object has no attribute 'get' #635

Closed MohamadOday closed 3 years ago

MohamadOday commented 3 years ago

Description of the problem

When i try to use the fetchThreadMessages function i get this error but the wired thing is when i used it in a group of 3 users only i didn't get any errors !

Code to reproduce

justtest = client.fetchThreadMessages(thread_id=thread_id, limit=5000,before=1610553062000)

Traceback

justtest = client.fetchThreadMessages(thread_id=thread_id, limit=5000,before=1610553062000)
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/fbchat/_client.py", line 774, in fetchThreadMessages
    messages = [
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/fbchat/_client.py", line 775, in <listcomp>
    Message._from_graphql(message)
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/fbchat/_message.py", line 258, in _from_graphql
    rtn.replied_to = cls._from_graphql(data["replied_to_message"]["message"])
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/fbchat/_message.py", line 205, in _from_graphql
    if data.get("message_sender") is None:
AttributeError: 'NoneType' object has no attribute 'get'

Environment information

MohamadOday commented 3 years ago

any help?

MohamadOday commented 3 years ago

Yeah i just used timestamps to fix it.