使用 Twilio API 检测传入消息并读取其内容

Using Twilio API detect incoming messages and read their contents

这就是我一收到短信就想做的事情:

Message received
Read contents
if contents=='abc' do process 1

我知道如何使用 Ngrok 来做到这一点,但我不想为每个新会话更新 Twilio 中的本地主机地址。

这里是 Twilio 开发人员布道者。

如果您知道如何使用 ngrok 执行此操作,那么您已经完成了一半,因为您可能已经构建了执行此任务的应用程序并 运行 它在本地。

如果您希望此 运行 永久 URL 不变,那么您需要将您的应用程序部署到某处的服务器,并指向一个域。由于您使用的是 Python,因此您可以尝试使用 Heroku to host the application. Alternatively, if you rewrite your application in Node.js you could take advantage of Twilio Functions 之类的方法来托管您的代码。

如果这有帮助,请告诉我。