Alexa提醒:SCHEDULE_RELATIVE不起作用

时间:2020-02-03 16:42:37

标签: python alexa-skills-kit alexa-skill reminders

我一直在尝试在我的Alexa技能上安排一个相对提醒,但是它一直进入异常处理程序。我尝试了多种提醒方式,但仍无法安排提醒时间。关于如何处理此问题有任何建议吗?

    tz_SG = pytz.timezone('Asia/Singapore')
    request_time = datetime.now(tz_SG).strftime("%Y-%m-%dT%H:%M:%S.%f")
    trigger = Trigger(object_type=TriggerType.SCHEDULED_RELATIVE, offset_in_seconds=10)
    text = SpokenText(locale = 'en-SG', ssml = '<speak>This is your reminder</speak>', text = 'This is your reminder')
    alert_info = AlertInfo(spoken_info=SpokenInfo(content=[text]))
    push_notification = PushNotification(status=PushNotificationStatus.ENABLED)
    reminder_request = ReminderRequest(request_time, trigger, alert_info, push_notification)

    reminder_response = reminderApiClient.create_reminder(reminder_request)
    speech_text = "Great! I've activated the medication reminders for you."
    logger.info("Created reminder: {}". format(reminder_response))
    return handler_input.response_builder.speak(speech_text).set_card(SimpleCard("Reminder created with id", reminder_response.alert_token)).response

0 个答案:

没有答案