Search code examples
c#twittertweetinvi

Finding the tweetID of a tweet in tweetinvi


I am relatively new to programming in C# (Learning on my own for a school project) and decided to try using TweetInvi to implement Twitter functionality. So far it's going good, got the authentication and publishing up and running, but I'm struggling to find out how to use the DestroyTweet() method. It, and many other methods takes a tweetID parameter, which I can't figure out of how to find for a specific tweet.

Using the following code to publish a tweet, how can i find the tweetID of this tweet?

public ITweet publishTweet(string text)
{
   return Tweet.PublishTweet(text);
}

// Snippet from a test method in main class.
twitter.twitterUser.publishTweet(System.Console.ReadLine());

// Still working on GUI so using ReadLine for now.

It's probably an easy solution, but I just can't figure it out! Thanks in advance.


Solution

  • Simple solution. As explained before you need to take the tweet back from PublishTweet.

    string text = "text";
    ITweet tweet = Tweet.PublishTweet(text);
    bool destroySuccess = tweet.Destroy();