Skip to content

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

Description

@Timtendo12
 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?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions