Skip to content

Commit e4dd03e

Browse files
author
Felix Cheruiyot
committed
2 parents eabf015 + 84661e5 commit e4dd03e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pymessenger/bot.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
from enum import Enum
33

4+
import logging
45
import requests
56
from requests_toolbelt import MultipartEncoder
67

@@ -85,8 +86,11 @@ def send_attachment(self, recipient_id, attachment_type, attachment_path,
8586
multipart_header = {
8687
'Content-Type': multipart_data.content_type
8788
}
88-
return requests.post(self.graph_url, data=multipart_data,
89-
params=self.auth_args, headers=multipart_header).json()
89+
response = requests.post(self.graph_url, data=multipart_data,
90+
params=self.auth_args, headers=multipart_header).json()
91+
92+
logging.info(response)
93+
return response
9094

9195
def send_attachment_url(self, recipient_id, attachment_type, attachment_url,
9296
notification_type=NotificationType.regular):
@@ -285,7 +289,9 @@ def get_user_info(self, recipient_id, fields=None):
285289
request_endpoint = '{0}/{1}'.format(self.graph_url, recipient_id)
286290
response = requests.get(request_endpoint, params=params)
287291
if response.status_code == 200:
288-
return response.json()
292+
result = response.json()
293+
logging.info(result)
294+
return result
289295

290296
return None
291297

@@ -297,6 +303,7 @@ def send_raw(self, payload):
297303
json=payload
298304
)
299305
result = response.json()
306+
logging.info(result)
300307
return result
301308

302309
def _send_payload(self, payload):

0 commit comments

Comments
 (0)