ehForwarderBot / efb-fb-messenger-slave

EFB Facebook Messenger Slave, a channel for EH Forwarder Bot.
GNU Affero General Public License v3.0
8 stars 0 forks source link

fbchat.models.FBchatException: Could not get ThreadColor from color: FFFF9C19 #1

Closed blueset closed 5 years ago

blueset commented 5 years ago
Traceback (most recent call last):

  File "/usr/local/lib/python3.6/dist-packages/fbchat/graphql.py", line 32, in graphql_color_to_enum
    return ThreadColor('#{}'.format(color[2:].lower()))

  File "/usr/lib/python3.6/enum.py", line 291, in __call__
    return cls.__new__(cls, value)

  File "/usr/lib/python3.6/enum.py", line 533, in __new__
    return cls._missing_(value)

  File "/usr/lib/python3.6/enum.py", line 546, in _missing_
    raise ValueError("%r is not a valid %s" % (value, cls.__name__))

ValueError: '#ff9c19' is not a valid ThreadColor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/usr/local/lib/python3.6/dist-packages/fbchat/client.py", line 2282, in _parseMessage
    self.onUnknownMesssageType(msg=m)

  File "/usr/local/lib/python3.6/dist-packages/efb_fb_messenger_slave/efms_client.py", line 479, in onUnknownMesssageType
    self.on_message_reaction(i['deltaMessageReaction'])

  File "/usr/local/lib/python3.6/dist-packages/efb_fb_messenger_slave/efms_client.py", line 491, in on_message_reaction
    efb_msg = self.build_message(message_id, thread_id, msg.author, msg)

  File "/usr/local/lib/python3.6/dist-packages/efb_fb_messenger_slave/efms_client.py", line 442, in build_message
    efb_msg.chat = EFMSChat(self.channel, uid=thread_id)

  File "/usr/local/lib/python3.6/dist-packages/efb_fb_messenger_slave/efms_chat.py", line 47, in __init__
    self.load_chat()

  File "/usr/local/lib/python3.6/dist-packages/efb_fb_messenger_slave/efms_chat.py", line 64, in load_chat
    thread = self.client.fetchThreadInfo(self.chat_uid)[str(self.chat_uid)]

  File "/usr/local/lib/python3.6/dist-packages/fbchat/client.py", line 805, in fetchThreadInfo
    rtn[_id] = graphql_to_group(entry)

  File "/usr/local/lib/python3.6/dist-packages/fbchat/graphql.py", line 291, in graphql_to_group
    c_info = get_customization_info(group)

  File "/usr/local/lib/python3.6/dist-packages/fbchat/graphql.py", line 43, in get_customization_info
    'color': graphql_color_to_enum(info.get('outgoing_bubble_color'))

  File "/usr/local/lib/python3.6/dist-packages/fbchat/graphql.py", line 34, in graphql_color_to_enum
    raise FBchatException('Could not get ThreadColor from color: {}'.format(color))

fbchat.models.FBchatException: Could not get ThreadColor from color: FFFF9C19
blueset commented 5 years ago

Should be fixed in fbchat 1.7.0 as now ThreadColor enum is extending itself when a new color is found.