const Alexa = require('ask-sdk-core'); const Util = require('util.js'); const LaunchRequestHandler = { canHandle(handlerInput) { return Alexa.getRequestType(handlerInput.requestEnvelope) === 'LaunchRequest'; }, handle(handlerInput) { if (Alexa.getSupportedInterfaces(handlerInput.requestEnvelope)) { return MainAction(handlerInput); } else { const speechText = '申し訳ございません。このスキルは画面付きデバイスのみ対応しております。'; return handlerInput.responseBuilder .speak(speechText) .getResponse(); } } }; function MainAction(handlerInput) { const S_TAKUMI = '新元号は「' //声質を変えるために、rateやpitchを追加 const E_TAKUMI = '」であります。 ' const myList = '万中久乾亀亨享仁保元勝化吉同和喜嘉国大天字安宝寛寿平康延建弘徳応感慶成承授政文斉昌明昭景暦正武永治泰白祚神祥禄禎福老至興衡観護貞銅長雉雲霊養令' // S3から画像URLを取得 const pictureUrl = Util.getS3PreSignedUrl("Media/gengo.png"); // 生成する文字列の長さ var l = 2; var cl = myList.length; var r = ""; for(var i=0; i