简体   繁体   English

Stream 用户的推文使用 twitter API js

[英]Stream a user's tweets using twitter API js

hi i am trying to stream all @elonmusk's tweets using twitter API and send his tweets to my discord server.嗨,我正在尝试 stream 使用 twitter API 的所有@elonmusk 的推文并将他的推文发送到我的 Z15882BCDDA7ZABA553 服务器。

currently i can stream tweets with the word 'meme' and send them to my discord server, here is my current code:目前我可以在 stream 推文中使用“meme”一词并将它们发送到我的 discord 服务器,这是我当前的代码:

discordClient.on('ready', () => {

    st.stream('meme', function(tweet){

        const channel = discordClient.channels.cache.get('my discord server id');

        channel.send(tweet.text);

    });

});

but i don't know how to stream a user's tweets.但我不知道如何 stream 用户的推文。 please help me请帮我

Use the follow keyword.使用follow关键字。 The documentation says this:文档是这样说的:

follow A comma-separated list of user IDs, indicating the users whose Tweets should be delivered on the stream.以逗号分隔的用户 ID 列表,指示其推文应在 stream 上传递的用户。 Following protected users is not supported.不支持关注受保护的用户。 For each user specified, the stream will contain: Tweets created by the user.对于指定的每个用户,stream 将包含: 用户创建的推文。 Tweets which are retweeted by the user.用户转发的推文。 Replies to any Tweet created by the user.回复用户创建的任何推文。 Retweets of any Tweet created by the user.用户创建的任何推文的转推。 Manual replies, created without pressing a reply button (eg “@twitterapi I agree”).手动回复,无需按下回复按钮即可创建(例如“@twitterapi 我同意”)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM