Example #1
0
 /// <summary>
 /// Check if a Tweet should be handled
 /// </summary>
 /// <param name="tweet">Tweet to check</param>
 /// <param name="user">The current bot user</param>
 /// <returns>Boolean</returns>
 public static bool CheckTweet(ITweet tweet, Tweetinvi.Models.IUser user)
 {
     return(!tweet.IsRetweet &&                //  NOT A RETWEET
            tweet.InReplyToStatusId == null && //  NOT A REPLY
            tweet.CreatedBy.Id != user.Id &&   //  NOT SENT BY THE BOT
            tweet.Media.Count > 0);
 }
Example #2
0
        public static string CheckTweetDetails(ITweet tweet, Tweetinvi.Models.IUser user)
        {
            string msg = "Tweet checks : ";

            if (!tweet.IsRetweet)
            {
                msg += "\nIsNotRetweet        : PASSED";
            }
            else
            {
                msg += "\nIsNotRetweet        : FAILED";
            }

            if (tweet.CreatedBy.Id != user.Id)
            {
                msg += "\nNotSentByBot        : PASSED";
            }
            else
            {
                msg += "\nNotSentByBot        : FAILED";
            }

            if (tweet.InReplyToStatusId == null)
            {
                msg += "\nNotAReply           : PASSED";
            }
            else
            {
                msg += "\nNotAReply           : FAILED";
            }

            if (tweet.Media.Count > 0)
            {
                msg += "\nHasMedias           : PASSED";
            }
            else
            {
                msg += "\nHasMedias           : FAILED";
            }
            return(msg);
        }