我有一些代码:
internal TwitterResponse<TwitterStatus> UpdateTweet(string Tweet)
{
TwitterResponse<TwitterStatus> tweetResponse = null;
OAuthTokens tokens = new OAuthTokens();
tokens.AccessToken = accessToken;
tokens.AccessTokenSecret = accessTokenSecret;
tokens.ConsumerKey = consumerKey;
tokens.ConsumerSecret = consumerSecret;
tweetResponse = TwitterStatus.Update(tokens, Tweet);
return tweetResponse;
}
此代码将推文发送给经过身份验证的用户,但我需要发送给指定的用户。
最佳答案
推文文本应以“@<用户名>”开头,以将推文定向到特定人员。请记住,这仍然是一条公共(public)推文(前提是经过身份验证的用户不 protected )。要将经过身份验证的用户的私有(private)消息发送给其他用户,您可以使用 TwitterDirectMessage 类或在推文中添加前缀“d
因此,要发送针对用户的公开推文,请执行以下操作:@twit_er_izer 只是想打个招呼。
要发送直接消息,请执行以下操作:d twit_er_izer 只是想打个招呼。
(或使用直接消息类。)
关于c# - 如何向目标用户发送推文?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8757224/