Untitled
unknown
plain_text
a month ago
533 B
4
Indexable
def extract_message_details(message): """Extracts key details from incoming messages.""" sender_id = message["from"] message_type = message.get("type", "unknown") timestamp = message.get("timestamp") if message_type == "text": return "text", sender_id, message["text"]["body"], None, timestamp elif message_type in ["image", "video", "audio", "document"]: return message_type, sender_id, None, message[message_type]["id"], timestamp return "unknown", sender_id, None, None, timestamp
Editor is loading...
Leave a Comment