Hi All,
Does anyone know what's wrong with my code below? as I really can't figure out what's the problem with my code.
import logging
import ask_sdk_core.utils as ask_utils
from ask_sdk_core.skill_builder import SkillBuilder
from ask_sdk_core.dispatch_components import AbstractRequestHandler
from ask_sdk_core.dispatch_components import AbstractExceptionHandler
from ask_sdk_core.handler_input import HandlerInput
from ask_sdk_model import Response
import json
import requests
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
timer = {
"duration": "PT15S",
"timerLabel": "Change name",
"creationBehavior": {
"displayExperience": {
"visibility": "VISIBLE"
}
},
"triggeringBehavior": {
"operation": {
"type": "ANNOUNCE",
"textToAnnounce": [
{
"locale": "en-US",
"text": "Break time"
}
]
},
"notificationConfig": {
"playAudible": True
}
}
}
class TimerHandler(AbstractRequestHandler):
def can_handle(self, handler_input):
return ask_utils.is_intent_name("TimerHandler")(handler_input)
def handle(self, handler_input):
r = r.requests.post("https://api.amazonalexa.com/v1/", timer)
speak_output = "Your timer is set for 15 seconds"
return (
handler_input.response_builder
.speak(speak_output)
# .ask("add a reprompt if you want to keep the session open for the user to respond")
.response
)