lambda_function.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:alexa-ive-fallen-and-cant-get-up 作者: heatherbooker 项目源码 文件源码
def contact(intent, session):
    card_title = intent['name']
    session_attributes = {}
    reprompt_text = None
    account_sid = "AC39d9722bca359c3885bd8e876492859d"
    auth_token  = "222f8028aa78ffbdecbb558badf6db93"
    client = TwilioRestClient(account_sid, auth_token)
    speech_output = "Something went wrong, sorry."
    should_end_session = True
    try:
        message = client.messages.create(body="Save me it's an emergency #mhacks", 
        to="+16478367351",    # Replace with your phone number
            from_="+15675100423") # Replace with your Twilio number
        print(message.sid)
        speech_output = "I contacted your physician"
    except twilio.TwilioRestException as e:
        print(e)
    return build_response(session_attributes, build_speechlet_response(
        card_title, speech_output, reprompt_text, should_end_session))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号