Tweepy-创建推文
我正在尝试创建一个Twitter机器人,该机器人会在列表中鸣叫随机选择的文本。
当我使用client.create_tweet(text ='test')
函数时,我会收到一条消息,说我缺少所需的位置参数'self'。据我了解,这种类型的错误是当您不初始化函数时会获得的错误,但是这些是斜纹中的预定义函数。我导入了访问令牌和秘密,以及API Secret and Key,当然,导入Tweepy
。
我想念什么吗?我应该将作为参数包括的self
是什么?
I'm trying to create a twitter bot that would tweet a randomly selected text within a list.
When I use the Client.create_tweet(text='test')
function, I get a message saying that I'm missing a required positional argument 'self'. From what I understand, this type of error is what you get when you don't initialized a function but those are predefined functions within Tweepy. I've imported access token and secret as well as api secret and key under, of course, import tweepy
.
Am I missing something? What is the self
that I should be including as parameter?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
糟糕,这是一种创建带有曲折的推文的简单方法
以启动您需要创建客户端并插入自钥匙:
之后,您可以使用付费捕获错误,如果有:
最后,现在,您可以运行PY文件
Oops, here's a simple way to create a tweet with tweepy
to start you need to create the Client and insert your self keys:
after that you can use try pay catch errors if you have:
finally, now you can run the py file