本文整理汇总了C#中LinqToTwitter.TwitterContext.ReplyAsync方法的典型用法代码示例。如果您正苦于以下问题:C# TwitterContext.ReplyAsync方法的具体用法?C# TwitterContext.ReplyAsync怎么用?C# TwitterContext.ReplyAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinqToTwitter.TwitterContext
的用法示例。
在下文中一共展示了TwitterContext.ReplyAsync方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReplyAsync
public async Task<bool> ReplyAsync(ulong tweetId, string screenName, string content)
{
var tweetContent = CheckContent($"@{screenName} {content}");
try
{
using (var context = new TwitterContext(_selfAuthorizer))
{
await context.ReplyAsync(tweetId, tweetContent);
return true;
}
}
catch (TwitterQueryException ex) when (ex.StatusCode == HttpStatusCode.Forbidden) // In case of duplicate
{
return false;
}
}
示例2: ReplyAsync
static async Task ReplyAsync(TwitterContext twitterCtx)
{
ulong tweetID = 401033367283453953;
string status = "@JoeMayo Testing ReplyAsync #Linq2Twitter £ ";
Status tweet = await twitterCtx.ReplyAsync(tweetID, status);
if (tweet != null)
Console.WriteLine(
"Status returned: " +
"(" + tweet.StatusID + ")" +
tweet.User.Name + ", " +
tweet.Text + "\n");
}
示例3: SendTweetReply
public static void SendTweetReply( string twitterUser, string status, ulong replyId )
{
var twitterContext = new TwitterContext( TwitterHashtagMonitor.Authorizer );
var tweet = string.Format( "@{0} {1}", twitterUser, status);
Task.FromResult(twitterContext.ReplyAsync( replyId, tweet ) );
}
示例4: SendMoreInfo
public static void SendMoreInfo( string twitterUser, Challenge challenge, ulong replyId )
{
var twitterContext = new TwitterContext( TwitterHashtagMonitor.Authorizer );
var tweet = string.Format( "@{0} Congratulations! You earned {1} points, find out more about today's challenge at http://adventure-1.apphb.com/#/day/{2}/more", twitterUser, challenge.Value, challenge.ChallengeNumber );
Task.FromResult( twitterContext.ReplyAsync( replyId, tweet ) );
}