Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaierbs committed Mar 19, 2021
1 parent be8c486 commit 14df239
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions fbbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ def message_webhook(data):
# log(messaging_event["message"])
if "text" in messaging_event["message"]:
message_text = messaging_event["message"]["text"] # the message's text
# log("sending message from {sender} to {recipient}: {text}"
log("sending message from {sender} to {recipient}: {text}"
.format(recipient=recipient_id, sender=sender_id, text=message_text))

try:
stations = message_text.split(' nach ')
if len(stations) == 2:
log('Search connections')
connections = bahnconnection.connections(stations[0], stations[1])
log('Found connections: {}'.format(str(connections)))
connections = bahnconnection.connections('Darmstadt', 'Frankfurt')
Expand Down Expand Up @@ -104,9 +103,6 @@ def send_attachment(recipient_id, attachment_type, image_data):
params = {
"access_token": os.environ["PAGE_ACCESS_TOKEN"]
}
headers = {
"Content-Type": "application/json"
}
data = {
'recipient': json.dumps({
'id': recipient_id
Expand Down

0 comments on commit 14df239

Please sign in to comment.