Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
handle_messages mit Versand eines Bildes
def handle_messages(data):
"""handle all incoming messages"""
messaging_events = data['entry'][0]['messaging']
for event in messaging_events:
sender_id = event['sender']['id']
# check if we actually have some input
if "message" in event and event['message'].get("text","") != "":
text = event['message']['text']
# send a simple text reply
reply = "Toll, Du hast folgendes gesagt: "+text
send_text(sender_id, reply)
# send an image additionally
send_text(sender_id, "Ein Bot von")
send_image(sender_id, "https://comlounge.net/wp-content/uploads/2016/02/cropped-Logo_COMlounge.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.