我有一个标准的 Twilio 功能:
exports.handler = (context, event, callback) =>
{
const calledNumber = event.CalledNumber;
if(calledNumber == "+18008675309")
{
const TheFunction = Runtime.getFunctions()['CheckForDessert'].path;
const Function = require(TheFunction)
var AvailableToDial = Function.CheckBusinessHours({"dessert":"yes"})
}
...
}
CheckForDessert 功能:
exports.CheckBusinessHours = function(context, event, callback) {
console.log(event)
return 'blankText'
};
如何让 CheckForDesserts 函数访问传递给它的数据,即键“dessert”设置为“yes”?
我尝试过发送字符串、JSON 等,但我遗漏了一些东西,因为 CheckForDessert 函数内的 console.log 只给了我“未定义”。谢谢!