Reputation: 211
@philnash had a solution [here][1]
that I tried and had a problem - I'm using Twilio's Cloud Functions and getting no intellisense on client.messages - any idea how to reference the correct library
client.messages.create({
Upvotes: 0
Views: 43
Reputation: 10781
In the screenshot, you spelled client wrong, 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");
});
};
You should update the Twilio client library version as well, 3.29.2 is pretty old.
Upvotes: 1