diff --git a/fbchat/_client.py b/fbchat/_client.py index a7edab79..b63dc19c 100644 --- a/fbchat/_client.py +++ b/fbchat/_client.py @@ -1091,23 +1091,25 @@ def sendUri(self, uri, message=None, thread_id=None, thread_type=ThreadType.USER data["action_type"] = "ma-type:user-generated-message" data["shareable_attachment[share_type]"] = urlData["share_type"] # most uri params will come back as dict - if isinstance(urlData['share_params'], dict): + if isinstance(urlData["share_params"], dict): data["has_attachment"] = True for key in urlData["share_params"]: if isinstance(urlData["share_params"][key], dict): for key2 in urlData["share_params"][key]: data[ - "shareable_attachment[share_params][{}][{}]".format(key, key2) + "shareable_attachment[share_params][{}][{}]".format( + key, key2 + ) ] = urlData["share_params"][key][key2] else: - data["shareable_attachment[share_params][{}]".format(key)] = urlData[ - "share_params" - ][key] + data[ + "shareable_attachment[share_params][{}]".format(key) + ] = urlData["share_params"][key] # some (such as facebook profile pages) will just be a list else: data["has_attachment"] = False - for index, val in enumerate(urlData['share_params']): - data['shareable_attachment[share_params][{}]'.format(index)] = val + for index, val in enumerate(urlData["share_params"]): + data["shareable_attachment[share_params][{}]".format(index)] = val return self._doSendRequest(data) def sendEmoji(