i tested the command on cmd with console.log(lojaMensagem) and is working, but when i put on Alexa Skill it gives me a error, can you help me? And yes, i put the npm packages correctly! Sorry if the question is soo obvious, i'm new on Alexa Skills
const LojaDoDiaHandler = {
canHandle(handlerInput) {
return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest'
&& Alexa.getIntentName(handlerInput.requestEnvelope) === 'LojaDoDia';
},
handle(handlerInput) {
const { get } = require('axios');
(async handle => {
const itemsName = []
const shop = await get(
'https://fortniteapi.io/v2/shop?lang=pt-BR',
{ headers: { Authorization: 'my api key' } }
)
for (const item of shop.data.shop)
itemsName.push(item.displayName)
const lojaMensagem = `Os itens da loja de hoje são ${itemsName.join('. ')}`
console.log(lojaMensagem)
return handlerInput.responseBuilder
.speak(lojaMensagem)
.reprompt('') // Se eu quiser resposta
.getResponse
})()
}`