c# - 如何向目标用户发送推文?

标签 c# twitter twitterizer

我有一些代码:

  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/

相关文章:

c# - .Net Core Action Method 查询字符串参数的验证

c# - 向 Restful 架构添加一些通知

blackberry - Blackberry Twitter Integration 推特照片

c# - 如何在 C# 中发推文

c# - Application_AuthenticateRequest 和 FormsAuthentication_OnAuthenticate 有什么区别

c# - Unity3d 中的 Matrix.RotateAt

ios - NO_CRASH_STACK + 0 [Xcode 10.1] 崩溃

python - Pep8 E501 : line too long error

asp.net - 将 Twitter 集成到 Asp.net