ehforwarderbot / efb-fb-messenger-slave Goto Github PK
View Code? Open in Web Editor NEWEFB Facebook Messenger Slave, a channel for EH Forwarder Bot.
License: GNU Affero General Public License v3.0
EFB Facebook Messenger Slave, a channel for EH Forwarder Bot.
License: GNU Affero General Public License v3.0
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/fbchat/client.py", line 2278, in _parseMessage
thread_id=thread_id, thread_type=thread_type, ts=ts, metadata=metadata, msg=m)
File "/usr/local/lib/python3.6/dist-packages/efb_fb_messenger_slave/efms_client.py", line 384, in onMessage
threading.Thread(target=self.on_message, args=args, kwargs=kwargs).run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.6/dist-packages/efb_fb_messenger_slave/efms_client.py", line 427, in on_message
self.attach_media(efb_msg, attachments[0])
File "/usr/local/lib/python3.6/dist-packages/efb_fb_messenger_slave/efms_client.py", line 252, in attach_media
url = self.fetchImageUrl(attachment['id'])
File "/usr/local/lib/python3.6/dist-packages/efb_fb_messenger_slave/efms_client.py", line 59, in fetchImageUrl
j = check_request(self._get(ReqUrl.ATTACHMENT_PHOTO, query={'photo_id': str(image_id)}))
File "/usr/local/lib/python3.6/dist-packages/fbchat/utils.py", line 232, in check_request
check_json(j)
File "/usr/local/lib/python3.6/dist-packages/fbchat/utils.py", line 211, in check_json
raise FBchatFacebookError('Error #{} when sending request: {}'.format(j['error'], j['errorDescription']), fb_error_code=j['error'], fb_error_message=j['errorDescription'])
fbchat.models.FBchatFacebookError: Error #1357004 when sending request: Please try closing and re-opening your browser window.
fbchat (1.7.3) ,efb-fb-messenger-slave (2.0.0b10)
I run efms-auth
,but get error below.
Traceback (most recent call last):
File "/usr/local/bin/efms-auth", line 6, in <module>
from efb_fb_messenger_slave.__main__ import main
File "/usr/local/lib/python3.6/site-packages/efb_fb_messenger_slave/__init__.py", line 12, in <module>
from fbchat import FBchatUserError, ThreadLocation, logging
ImportError: cannot import name 'logging'
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
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/fbchat/client.py", line 2278, in _parseMessage
thread_id=thread_id, thread_type=thread_type, ts=ts, metadata=metadata, msg=m)
File "/usr/local/lib/python3.6/dist-packages/efb_fb_messenger_slave/efms_client.py", line 384, in onMessage
threading.Thread(target=self.on_message, args=args, kwargs=kwargs).run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.6/dist-packages/efb_fb_messenger_slave/efms_client.py", line 412, in on_message
efb_msg = self.build_message(mid, thread_id, author_id, message_object)
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 816, in fetchThreadInfo
raise FBchatException('{} had an unknown thread type: {}'.format(thread_ids[i], entry))
fbchat.models.FBchatException: 2267017340086666 had an unknown thread type: {'thread_key': {'thread_fbid': '2267017340086666', 'other_user_id': None}, 'name': 'Vatsal · Dell 23″ professional monitor', 'last_message': {'nodes': [{'snippet': 'Yes', 'message_sender': {'messaging_actor': {'id': '100001078163495'}}, 'timestamp_precise': '1561698007567', 'commerce_message_type': None, 'extensible_attachment': None, 'sticker': None, 'blob_attachments': []}]}, 'unread_count': 0, 'messages_count': 4, 'image': {'uri': 'https://scontent-lga3-1.xx.fbcdn.net/v/t1.6435-9/65204446_2323057997740116_7556936468447363072_n.jpg?_nc_cat=107&_nc_oc=AQm_NfLGwHYCryMpEEf-XDmSRxY9q-rEwSLpWEEDCd_XndgWZyc7SATD4MxsDK9S-3k&_nc_ht=scontent-lga3-1.xx&oh=780f85a4d9c582503bda029f99a3ef61&oe=5DC538D4'}, 'updated_time_precise': '1561698007567', 'mute_until': None, 'is_pin_protected': False, 'is_pinned': False, 'is_viewer_subscribed': True, 'thread_queue_enabled': True, 'folder': 'INBOX', 'has_viewer_archived': False, 'is_page_follow_up': False, 'cannot_reply_reason': None, 'ephemeral_ttl_mode': 0, 'customization_info': None, 'thread_theme': None, 'thread_admins': [], 'approval_mode': 0, 'joinable_mode': {'mode': '0', 'link': ''}, 'group_approval_queue': {'nodes': []}, 'thread_queue_metadata': {'approval_requests': {'nodes': []}}, 'event_reminders': {'nodes': []}, 'montage_thread': None, 'last_read_receipt': {'nodes': [{'timestamp_precise': '1561698007567'}]}, 'related_page_thread': None, 'rtc_call_data': {'call_state': 'NO_ONGOING_CALL', 'server_info_data': '', 'initiator': None}, 'marketplace_thread_data': {'for_sale_item': {'id': '1062874203904587', 'story_id': 'UzpfSTEwMTc5OTg1ODQ5MzE2ODI6MzEyMzQ4MTAyOTgwMDQ5', 'group_commerce_item_title': 'Dell 23″ professional monitor', 'formatted_price': {'text': '$85'}, 'location': {'reverse_geocode': {'city': 'Melbourne', 'state': 'VIC'}}, 'is_sold': False, 'primary_photo': {'image': {'uri': 'https://scontent-lga3-1.xx.fbcdn.net/v/t1.0-9/65318151_2323056564406926_4420521933230047232_n.jpg?_nc_cat=105&_nc_oc=AQmOFbY8cen93JdW7YDA76UabKUii6qaLRxIjYsainhug_MCILx2MVDh4DPtqmOSKCA&_nc_ht=scontent-lga3-1.xx&oh=a1f59e43804762567bc676119a46b571&oe=5D7C91CD'}}, 'url': 'https://www.facebook.com/marketplace/item/1062874203904587/'}, 'buyer': {'id': '623231456'}, 'seller': {'id': '100001078163495'}}, 'associated_object': None, 'privacy_mode': 1, 'reactions_mute_mode': 'REACTIONS_NOT_MUTED', 'mentions_mute_mode': 'MENTIONS_NOT_MUTED', 'customization_enabled': True, 'thread_type': 'MARKETPLACE', 'participant_add_mode_as_string': 'ADD', 'is_canonical_neo_user': False, 'participants_event_status': [], 'page_comm_item': None, 'admin_model_status_string': 'not_supported', 'groups_sync_status_string': 'UNSET', 'groups_sync_metadata': None, 'saved_messages': [], 'description': None, 'joinable_link': None, 'all_participants': {'nodes': [{'messaging_actor': {'id': '623231456', '__typename': 'User'}}, {'messaging_actor': {'id': '100001078163495', '__typename': 'User'}}]}}
[mid.$gAAit_BgpF3hxJBV4GFq8tAoXA5Ti] Failed to send it as image, sending as document. Reason: Wrong remote file id specified: can't unserialize it. wrong last symbol
[mid.$gAAit_BgpF3hxJBV4GFq8tAoXA5Ti] Error occurred while processing message from slave channel.
Message: <EFBMsg, <EFBChat: Tom Lynch (839810186) @ Facebook Messenger Slave>@<EFBChat: Machine learning (2443098062395256) @ Facebook Messenger Slave> [Image]:
[😠x2]; Attributes: None; Delivering to: <efb_telegram_master.TelegramChannel object at 0x7f0efba9b780>; Edited: True; System message: False; Substitutions: None; Target messages: None; UID: mid.$gAAit_BgpF3hxJBV4GFq8tAoXA5Ti; Reactions: {}; File: None (None @ None), None; Vendor: {}>
BadRequest()
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/efb_telegram_master/slave_message.py", line 379, in slave_message_image
reply_markup=reply_markup)
File "/usr/local/lib/python3.6/dist-packages/efb_telegram_master/bot_manager.py", line 230, in caption_affix
return fn(self, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/efb_telegram_master/bot_manager.py", line 360, in send_photo
return self.updater.bot.send_photo(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/telegram/bot.py", line 60, in decorator
result = func(self, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/telegram/bot.py", line 85, in decorator
result = self._request.post(url, data, timeout=kwargs.get('timeout'))
File "/usr/local/lib/python3.6/dist-packages/telegram/utils/request.py", line 278, in post
**urlopen_kwargs)
File "/usr/local/lib/python3.6/dist-packages/telegram/utils/request.py", line 215, in _request_wrapper
raise BadRequest(message)
telegram.error.BadRequest: Wrong remote file id specified: can't unserialize it. wrong last symbol
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/efb_telegram_master/slave_message.py", line 140, in send_message
tg_msg = self.slave_message_image(msg, tg_dest, msg_template, old_msg_id, target_msg_id, reply_markup)
File "/usr/local/lib/python3.6/dist-packages/efb_telegram_master/slave_message.py", line 385, in slave_message_image
reply_markup=reply_markup)
File "/usr/local/lib/python3.6/dist-packages/efb_telegram_master/bot_manager.py", line 230, in caption_affix
return fn(self, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/efb_telegram_master/bot_manager.py", line 342, in send_document
return self.updater.bot.send_document(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/telegram/bot.py", line 60, in decorator
result = func(self, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/telegram/bot.py", line 85, in decorator
result = self._request.post(url, data, timeout=kwargs.get('timeout'))
File "/usr/local/lib/python3.6/dist-packages/telegram/utils/request.py", line 278, in post
**urlopen_kwargs)
File "/usr/local/lib/python3.6/dist-packages/telegram/utils/request.py", line 215, in _request_wrapper
raise BadRequest(message)
telegram.error.BadRequest: Wrong remote file id specified: can't unserialize it. wrong last symbol
Facebook Messenger recently moved from the previous GraphQL protocol to MQTT over Websocket, which has broken the message retrieval code of upstream library fbchat
.
EFMS will suspend its development until fbchat
or another reasonably usable library has adopted the new websocket protocol.
See more details here: fbchat-dev/fbchat#483
Relevant issue: Schmavery/facebook-chat-api#763
Python Version: 3.6
efb-fb-slave Version: 2.0.0b14.dev3
Shell : bash
Locale : zh_CN.UTF-8
EFB Facebook Messenger Slave Session Updater
============================================
You are running EFMS 2.0.0b14.dev3.
This will update and overwrite your EFMS token by
log into your account again manually.
You usually need to do this when you want to log into
a new account, or when the previous session is expired.
This session is written to
/root/.ehforwarderbot/profiles/default/blueset.fbmessenger
To continue, press Enter/Return.
Email: [email protected]
Password:
Traceback (most recent call last):
File "/usr/local/bin/efms-auth", line 11, in <module>
load_entry_point('efb-fb-messenger-slave==2.0.0b14.dev3', 'console_scripts', 'efms-auth')()
File "/usr/local/lib/python3.6/site-packages/efb_fb_messenger_slave-2.0.0b14.dev3-py3.6.egg/efb_fb_messenger_slave/__main__.py", line 34, in main
File "/usr/local/lib/python3.6/site-packages/efb_fb_messenger_slave-2.0.0b14.dev3-py3.6.egg/efb_fb_messenger_slave/__main__.py", line 61, in run
File "/usr/local/lib/python3.6/site-packages/fbchat/_client.py", line 72, in __init__
self._log = self._base_log.getChild("client")
AttributeError: 'str' object has no attribute 'getChild'
2019-08-26 23:28:48,477 [ERROR]: telegram.ext.dispatcher (dispatcher.process_update; dispatcher.py:301)
An uncaught error was raised while processing the update
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/telegram/ext/dispatcher.py", line 279, in process_update
handler.handle_update(update, self)
File "/usr/local/lib/python3.6/site-packages/telegram/ext/commandhandler.py", line 173, in handle_update
return self.callback(dispatcher.bot, update, **optional_args)
File "/usr/local/lib/python3.6/site-packages/efb_telegram_master/commands.py", line 132, in extra_listing
msg += "\n\n<b>%s %s (%s)</b>" % (i.channel_emoji, i.module_name, i.module_id)
AttributeError: 'FBMessengerChannel' object has no attribute 'module_name'
#版本信息
EH Forwarder Bot
Version: 2.0.0b19
Python version:
3.6.9 (default, Aug 22 2019, 01:17:11)
[GCC 4.2.1 Compatible FreeBSD Clang 6.0.1 (tags/RELEASE_601/final 335540)]
Running on profile "default".
Master channel:
Telegram Master (blueset.telegram) 2.0.0b25 # Default instance
Slave channel:
Facebook Messenger Slave (blueset.fbmessenger) 2.0.0b14.dev4 # Default instance
Middlewares:
No middleware is enabled.
#错误日志 debug
2019-09-19 21:55:22,769 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:85)
Initializing slave blueset.fbmessenger...
Traceback (most recent call last):
File "/usr/local/bin/ehforwarderbot", line 11, in <module>
load_entry_point('ehforwarderbot==2.0.0b19', 'console_scripts', 'ehforwarderbot')()
File "/usr/local/lib/python3.6/site-packages/ehforwarderbot/__main__.py", line 269, in main
init(conf)
File "/usr/local/lib/python3.6/site-packages/ehforwarderbot/__main__.py", line 91, in init
coordinator.add_channel(cls(instance_id=instance_id))
File "/usr/local/lib/python3.6/site-packages/efb_fb_messenger_slave-2.0.0b14.dev4-py3.6.egg/efb_fb_messenger_slave/__init__.py", line 76, in __init__
File "/usr/local/lib/python3.6/site-packages/efb_fb_messenger_slave-2.0.0b14.dev4-py3.6.egg/efb_fb_messenger_slave/utils.py", line 21, in __init__
AttributeError: 'NoneType' object has no attribute 'get'
2019-09-19 22:09:39,119 [INFO]: ehforwarderbot.__main__ (__main__.stop_gracefully; __main__.py:59)
Valid master channel is not found.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/fbchat/client.py", line 2278, in _parseMessage
thread_id=thread_id, thread_type=thread_type, ts=ts, metadata=metadata, msg=m)
File "/usr/local/lib/python3.6/dist-packages/efb_fb_messenger_slave/efms_client.py", line 384, in onMessage
threading.Thread(target=self.on_message, args=args, kwargs=kwargs).run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.6/dist-packages/efb_fb_messenger_slave/efms_client.py", line 427, in on_message
self.attach_media(efb_msg, attachments[0])
File "/usr/local/lib/python3.6/dist-packages/efb_fb_messenger_slave/efms_client.py", line 252, in attach_media
url = self.fetchImageUrl(attachment['id'])
File "/usr/local/lib/python3.6/dist-packages/efb_fb_messenger_slave/efms_client.py", line 59, in fetchImageUrl
j = check_request(self._get(ReqUrl.ATTACHMENT_PHOTO, query={'photo_id': str(image_id)}))
File "/usr/local/lib/python3.6/dist-packages/fbchat/utils.py", line 232, in check_request
check_json(j)
File "/usr/local/lib/python3.6/dist-packages/fbchat/utils.py", line 211, in check_json
raise FBchatFacebookError('Error #{} when sending request: {}'.format(j['error'], j['errorDescription']), fb_error_code=j['error'], fb_error_message=j['errorDescription'])
fbchat.models.FBchatFacebookError: Error #1357031 when sending request: The content you requested cannot be displayed at the moment. It may be temporarily unavailable, the link you clicked on may have expired or you may not have permission to view this page.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.