from twilio.rest import Client
import random

def send_otp(phone_number):
    otp = str(random.randint(100000, 999999))  # Generate a 6-digit OTP
    client = Client("TWILIO_ACCOUNT_SID", "TWILIO_AUTH_TOKEN")
    message = client.messages.create(
        body=f"Your OTP code for door access is {otp}",
        from_="YOUR_TWILIO_PHONE_NUMBER",
        to=phone_number
    )
    return otp
