我不确定我在哪里犯了错误,我目前正在使用 tweepy python 并使用推特 api

I'm not sure where I made a mistake here, i'm currently using tweepy, python and working with the twitter api

我正在使用 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'

我一直在按照我阅读的内容 here 添加选项来测试它是否有效。

quick_reply_options 不在当前版本的 tweepy 中:https://github.com/tweepy/tweepy/pull/1364

稍后可能会添加,但目前,您需要保持在当前版本的参数范围内。