我正在使用 tweepy 和 python 对 twitter dms 进行快速回复,但是我遇到了一个问题。
def dm():
followers = api.followers()
for follower in followers:
print(follower.id)
reply_options = [
{
"label": "A title test",
"description": "Just a description test",
"metadata": "external_id_1"
},
{
"label": "A title test 2",
"description": "Test Description 2",
"metadata": "external_id_2"
}
]
api.send_direct_message(follower.id,"Text", quick_reply_type="options",quick_reply_options = reply_options)
我遇到了这个输出:
File "c:/Users/Azizah Blackwood/Documents/GitHub/just-a-chatbot-test/chatBot.py", line 58, in <module>
dm()
File "c:/Users/Azizah Blackwood/Documents/GitHub/just-a-chatbot-test/chatBot.py", line 54, in dm
api.send_direct_message(follower.id,"Text", quick_reply_type="options",quick_reply_options = reply_options)
TypeError: send_direct_message() got an unexpected keyword argument 'quick_reply_options'
我正在按照我在此处阅读的内容添加选项以测试它是否有效。
quick_reply_options
不在当前版本的 tweepy 中:https : //github.com/tweepy/tweepy/pull/1364
它可能会在以后添加,但现在,您需要保持在当前版本的参数范围内。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句