Tweepy 2.1:将成员添加到列表 [英] Tweepy 2.1: Add member to a list

查看:45
本文介绍了Tweepy 2.1:将成员添加到列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Tweepy2.1,我尝试将我的 Twitter 帐户的成员 (people) 添加到列表 (testlist) 中:

导入tweepy...api = tweepy.API(auth)api.add_list_member(测试列表,人)

我收到以下错误:

TweepError: [{'message': '您必须指定列表 ID 或 slug 和所有者', 'code': 112}]

我尝试了其他调用 add_list_member 函数的方法,但没有任何效果.另外,我对不完整的 Tweepy 文档有一些困难.

有人有解决此问题的方法吗?

解决方案

我想补充一下 Charles 已经解释过的内容.
您也可以通过他/她的用户 ID 添加列表成员.

api.add_list_member(user_id=1234, slug='testlist', owner_screen_name='@myTwitterName')

请查看tweepy api中的参数1

Using Tweepy2.1, I am trying to add a member (people) of my Twitter account to a list (testlist) with:

import tweepy

...

api = tweepy.API(auth)

api.add_list_member(testlist, people)

I get the following error:

TweepError: [{'message': 'You must specify either a list ID or a slug and owner', 'code': 112}]

I have tried other ways of calling the add_list_member function, but nothing worked. Also, I have some difficulties with the incomplete Tweepy documentation.

Anyone have a solution for this issue?

解决方案

I would like to add what has been explained by Charles.
You can also add list member by his/her user id.

api.add_list_member(user_id=1234, slug='testlist', owner_screen_name='@myTwitterName')

Please review the parameters in tweepy api 1

这篇关于Tweepy 2.1:将成员添加到列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆