在 tweetinvi 中查找推文的 tweetID [英] Finding the tweetID of a tweet in tweetinvi

查看:52
本文介绍了在 tweetinvi 中查找推文的 tweetID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 C# 编程比较陌生(为学校项目自己学习),并决定尝试使用 TweetInvi 来实现 Twitter 功能.到目前为止一切顺利,身份验证和发布已启动并运行,但我正在努力找出如何使用 DestroyTweet() 方法.它和许多其他方法都需要一个 tweetID 参数,我不知道如何找到特定的推文.

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.

使用下面的代码发布一条推文,如何找到这条推文的tweetID?

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.

推荐答案

简单的解决方案.如前所述,您需要从 PublishTweet 取回推文.

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();

这篇关于在 tweetinvi 中查找推文的 tweetID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆