我不确定我在这里犯了什么错误,我目前正在使用 tweepy、python 并使用 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'

我正在按照我在此处阅读的内容添加选项以测试它是否有效。

盖凡

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

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

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

避免使用Tweepy限制Twitter API

AttributeError:使用Tweepy和Twitter API

使用python和tweepy的twitter“朋友”的完整列表

使用Tweepy / Python进入受保护的Twitter流

使用tweepy的python中不完整的twitter朋友列表

使用Python Tweepy从Twitter趋势主题数据中提取标签

使用 Tweepy 和 Python 在 Twitter 上上传媒体

Twitter API V2 403:禁止使用 tweepy

是否可以通过Tweepy使用Twitter流API执行NOT搜索?

如何通过 tweepy 使用 Twitter 搜索 API 执行布尔搜索

Tweepy使用多个API密钥和光标来搜索Twitter

带有Python Tweepy的Twitter Streaming API

我如何在这里使用 Python iter?

不使用 API 的 Python Twitter Scraper

Twitter(Tweepy):什么算作搜索API调用?

如何使用 Twitter API?

使用php的Twitter API

Python PIL - 为什么我不能在这里使用 ImageOps.colorize。?

适用于Twitter API的Python Tweepy返回“错误401:未经授权”

使用多个Twitter帐户的Twitter API流?

如何使用 Tweepy 和 Python 将坐标发送到 Twitter 状态更新

Tweepy使用user_id(Python脚本)从文本文件关注Twitter用户

在python中使用tweepy从Twitter提取带有一些特殊关键字的tweet

无法使用tweepy(Python)向Twitter用户提供快速回复选项

如何使用 Python 和 Tweepy 获取 Twitter 帐户的电子邮件?

MAX7219 Twitter流光,使用tweepy

在 Twitter API v2 上使用 tweepy v2 获取推文图像 url

twitter使用api爬行hashtag以使用python

使用Twitter API更改密码