Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only allow code to post tweets from the account defined in the "follow" parameter. #183

Open
Timtendo12 opened this issue Oct 17, 2021 · 0 comments

Comments

@Timtendo12
Copy link

Timtendo12 commented Oct 17, 2021

 const parameters = {
      follow: `${config.TWITTER_USER_ID}`,  // The ID of the user it should follow, In this bots case its @FarCryGame
    };

    const stream = Tclient.stream("statuses/filter", parameters)
      .on("start", response => console.log("Starts checking for tweets"))
        .on("data", tweet => {
             const TwitterEmbed = new MessageEmbed()
               .setColor("ORANGE")
               .setTitle(`${tweet.user.name}`)
               .setDescription(`${tweet.text}`)
               .setURL(`https://www.twitter.com/Timtendo12/Status/` + `${tweet.id}`)
               .setAuthor(`${tweet.user.name}, posted a new tweet!`, 'https://pbs.twimg.com/profile_images/1286368132487995392/p-CyXKSj_400x400.jpg', 'https://www.twitter.com/Timtendo12');
            client.channels.cache.get(`${config.TWITTER_CHANNEL_ID}`).send({embeds: [TwitterEmbed]})
        })

Currently I have this code, It works. However, when someone else retweets, shares etc etc any tweet from the one defined in the following parameters it also outputs them retweeting them. How do you filter this so it will only output when the defined follower posts a tweet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant