def _doSendRequest(self, data, get_thread_id=False):
        """Sends the data to `SendURL`, and returns the message ID or None on failure"""
        j = self._post(self.req_url.SEND, data, fix_request=True, as_json=True)

        # update JS token if received in response
        fb_dtsg = get_jsmods_require(j, 2)
        if fb_dtsg is not None:
            self._payload_default["fb_dtsg"] = fb_dtsg

        try:
            message_ids = [
                (action["message_id"], action["thread_fbid"])
                for action in j["payload"]["actions"]
                if "message_id" in action
            ]
            if len(message_ids) != 1:
                log.warning("Got multiple message ids' back: {}".format(message_ids))
            if get_thread_id:
                return message_ids[0]
            else:
                return message_ids[0][0]
        except (KeyError, IndexError, TypeError) as e:
            raise FBchatException(
                "Error when sending message: "
                "No message IDs could be found: {}".format(j)
            )
def _doSendRequest ( self , data , get_thread_id = False ) : j = self . _post ( self . req_url . SEND , data , fix_request = True , as_json = True ) fb_dtsg = get_jsmods_require ( j , 2 ) if fb_dtsg is not None : self . _payload_default [ "fb_dtsg" ] = fb_dtsg try : message_ids = [ ( action [ "message_id" ] , action [ "thread_fbid" ] ) for action in j [ "payload" ] [ "actions" ] if "message_id" in action ] if len ( message_ids ) != 1 : log . warning ( "Got multiple message ids' back: {}" . format ( message_ids ) ) if get_thread_id : return message_ids [ 0 ] else : return message_ids [ 0 ] [ 0 ] except ( KeyError , IndexError , TypeError ) as e : raise FBchatException ( "Error when sending message: " "No message IDs could be found: {}" . format ( j ) )
Sends the data to `SendURL`, and returns the message ID or None on failure