twilio - 基于 Twilio 云的函数和库
问题描述
@philnash 有一个[here][1]
我尝试过但遇到问题的解决方案 - 我正在使用 Twilio 的云功能,并且在 client.messages 上没有智能感知 - 知道如何引用正确的库
client.messages.create({
解决方案
在屏幕截图中,您拼写错误的客户,cleint
.
exports.handler = function(context, event, callback) {
const twilioClient = context.getTwilioClient();
twilioClient.messages
.create({
body: 'Hello World',
to: '+14075551212',
from: '+18025551212 ',
}).then(message => {
console.log('Created call using callback');
console.log(message.sid);
callback();
})
.catch(error => {
console.log(error);
callback("error");
});
};
您还应该更新Twilio 客户端库版本,3.29.2 已经很老了。
推荐阅读
- javascript - 在切换按钮中将我的内部 div 切换到另一侧
- ffmpeg - FFMPEG 和 AVCONV 混合音频文件降低音量
- google-apps-script - 谷歌表格脚本,在 30 多秒后超时
- charts - Jmeter - 将 MyValues 附加到仪表板报告
- sapui5 - 翻译无法正确显示非 ASCII 字符
- php - 如何以可折叠的方式显示产品波段和模型
- angular - 如何从数组值中删除小数点值?
- java - 尝试使用 Microsoft Graph Java SDK 从共享 Outlook 日历中获取空闲/忙碌时段时出现错误 401
- raspberry-pi - 如何在树莓派上使用 omxh264enc 将图像传送到 gstreamer?
- python - 如何在kivy中将标签制作为按钮