【发布时间】:2021-05-01 18:04:40
【问题描述】:
我有这个基本功能,可以将消息发送回给我的 Twilio 号码发送消息的用户。
因此,如果号码 1234567890 向我的 twilio 号码发送一条消息,它会向 1234567890 发送一条消息。但是,我希望能够记录用户发送给我的内容。因此,如果他们给我发送hi,那么我可以使用它来查询我的数据库并向他们发送消息。
这是我的功能:
app.post('/sms', (req, res) => {
const twiml = new MessagingResponse();
twiml.message('The Robots are coming! Head for the hills!');
res.writeHead(200, {'Content-Type': 'text/xml'});
res.end(twiml.toString());
})
【问题讨论】:
标签: javascript node.js twilio