hi i'm new in flask and twilio, i'm try to send 2 images with 1 request but just appears the last image that i put in the array
this is my code
from flask import Flask, request
from twilio.twiml.messaging_response import MessagingResponse
from twilio.rest import Client
from dotenv import load_dotenv
import os
load_dotenv()
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello, World!"
@app.route("/sms", methods=['POST'])
def sms_reply():
"""Respond to incoming calls with a simple text message."""
# Fetch the message
msg = request.form.get('Body')
# CLIENT
client = Client(os.getenv("TWILIO_ID"), os.getenv("AUTH_TOKEN"))
number = request.values.get('From', '')
# creating the message
if msg == "imagen":
message = client.messages.create(
from_='whatsapp:+14155238886',
media_url=["https://demo.twilio.com/owl.png", "https://demo.twilio.com/bunny.png"],
to=number
)
resp = MessagingResponse()
resp.message("imagen : {}".format(message.body))
return str(resp)
how could see in the "media_url" parameter i put 2 urls, but twilio just send my 1, i made a mistake?. i try it in this way too
mss = MessagingResponse()
resp = mss.message("this is a message")
resp.body("imagen1")
resp.media("https://demo.twilio.com/owl.png")
resp.body("imagen2")
resp.media("https://demo.twilio.com/bunny.png")
return str(resp)
but is the same. thnks for ur help
