tClient= TwilioRestClient(sid, token)
此代码引发异常:
twilio.base.obsolete.ObsoleteException:TwilioRestClient已被执行
从此版本的库中删除。请参考当前
指导文档。
似乎在任何地方都找不到对此的引用,这在几天前成功了!
使用python 3.7和VS2017
最佳答案
TwilioRestClient已贬值,删除单词“ TwilioRestClient”并按如下所示替换它:
from twilio.rest import Client
account = "Account number for Twilio"
token = "Token for Twilio Account"
client = Client(account, token)
message = client.messages.create(to="+ReceiverPhone#", from_="+TwilioPhone#",
body="Text message you are sending to receiver")
#print response back from Twilio
print message