나는 이것으로 몸부림 쳤고 지금은 효과가있다. Amazon이 제공하는 샘플 AlexaSkill.js 모듈을 사용하는 경우 을 입력하면 그림 카드를 다루는 데 몇 개의 섹션을 추가해야합니다. 지금
askWithPictureCard: function(speechOutput, repromptSpeech, cardTitle, cardContent, smallImageURL, largeImageURL) {
this._context.succeed(buildSpeechletResponse({
session: this._session,
output: speechOutput,
reprompt: repromptSpeech,
cardTitle: cardTitle,
cardContent: cardContent,
cardSmallImageURL: smallImageURL,
cardLargeImageURL: largeImageURL,
shouldEndSession: false
}));
당신이 그것을 호출 할 수 있습니다
if (options.cardSmallImageURL && options.cardLargeImageURL) {
alexaResponse.card = {
type: "Standard",
title: options.cardTitle,
text: options.cardContent,
image: {
smallImageUrl: options.cardSmallImageURL,
largeImageUrl: options.cardLargeImageURL
}
};
}
는 그 다음 askWithCard 정의 더 아래 후이를 추가하십시오 buildSpeechletResponse 섹션에서
은 유사한 유형 후 "단순"섹션이 추가 아마 상수보다 변수를 사용합니다. 이 (가) 사용하여 테스트되었습니다.
response.askWithPictureCard ('이 음성 출력', '이 카드의 제목입니다' '이것은 다시 메시지입니다' '이 카드 텍스트가의 필드가 텍스트 cardContent하지라고주의' 'https://s3.amazonaws.com/thisisthesmallpictureurl-small.jpg', 'https://s3.amazonaws.com/thisisthebigpictureurl-big.jpg');
그런 다음 유사한 프로세스에 따라 tellWithPictureCard 함수를 추가하십시오.