当前位置: 首页>>代码示例>>C#>>正文


C# Comment.Reply方法代码示例

本文整理汇总了C#中Comment.Reply方法的典型用法代码示例。如果您正苦于以下问题:C# Comment.Reply方法的具体用法?C# Comment.Reply怎么用?C# Comment.Reply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Comment的用法示例。


在下文中一共展示了Comment.Reply方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PostComment

        static void PostComment(string cmd, Comment comment)
        {
            var content = String.Empty;
            if (cmd.StartsWith("rules"))
            {
                Console.WriteLine("rules");
                content = @"* Posts must pertain to the Canadian Football League.

            * Don't downvote based on someone's crest or opinion.

            * Racist or Hate language is forbidden. You can trash talk but keep it civil.

            * Don't repost stories, instead check if they've already been posted. Reposted stories/articles will be removed.";
            }
            else if (cmd.StartsWith("diff") || cmd.StartsWith("differences") || cmd.StartsWith("nfl"))
            {
                Console.WriteLine("differences");
                content = @"#CFL Rules and how they differ from the NFL
            **The Field**: The CFL field is 110 yards long and has 20 yard long endzones, compared to 100 yards and 10 yard endzones in the NFL. The field width in the CFL is 65 yards and 53.5 yards in the NFL. The goalposts in the CFL are also at the front of the endzone, compared to the end of it like in the NFL.

            **Team Size**: Teams have 12 players on the field, one more than the 11 in the NFL. Total roster size is 46 players and they can dress 44 players, compared to 53 in the NFL.  The extra player is usually a Halfback and Slotback.

            **Downs and Plays**: There are 3 downs to make 10 yards in the CFL. The play clock is 20 seconds compared to 40 in the NFL. The two players on the ends of the line of scrimmage may also be in motion along the line, while the RB('s) and other receivers can basically be in motion any where behind the line of scrimmage. Also defence players must be 1 yard away from the line of scrimmage before the snap.

            **Punt Returning**: There's no fair catch in the CFL, instead players must give 5 yards to the returner. If they're within 5 yards when it's in the air then it's a 15 yard penalty and if it's on the ground then it's a 5 yard penalty.

            **Scoring**: A Single Point, called the Rouge. This is only in the CFL and a single point is rewarded to the kicking team when

            1) Kicking team misses a field goal or punts the football and the receiving team catches the football and decides not to run out of their own end zone. The kicking team will receive 1 point.

            2) Kicking team misses a field goal or punts the football and the ball goes out of bounds in the end zone. The kicking team will receive 1 point.

            **Time Warning**: In the CFL there's a 3 minute warning at the end of each half, instead of a 2 minute warning in the NFL.

            **Slotbacks**: Canadian football has an offensive player called a Slotback, who is a larger-sized eligible receiver somewhat like an American tight end but who usually gets a running start to prevent getting jammed. Most offensive schemes often use several slotbacks at once.

            **Open Field Kick**: Canadian football retains the open-field kick as a legal play, allowing a kick to be taken from anywhere on the field. [Here's the ending of a game that involved multiple free kicks.](https://www.youtube.com/watch?v=d5BFaykcxGg)

            **Schedule**: The CFL regular season begins in June and ends in early November. Playoffs begin the following week and the championship game called the Grey Cup will be played in the last Sunday in November. Each team will play 18 regular season games in 20 weeks, as well as 2 pre-season games. CFL games are scheduled are sometimes scattered throughout the week, but the majority of the games are played Friday, Saturday, Sunday. There may also be some games during Thursday and Tuesday.

            Tuesday is for when one team (Argos) have to play twice in a week.  Thursday is for some Bomber games when everyone wants to enjoy the 2 months of summer Winnipeg gets at the cabin on the weekend.  Riders are often on Sunday.  BC and Calgary play on the second half of Wendy’s Friday Night Football, East teams play on the first half usually.  Note I am talking about home games.  Friday is like Sunday for the NFL.  We get back to back games.  Saturday is more prevalent in the second half of the season so that games can be held earlier in cold climates.

            For more information, check out [this thread](https://www.reddit.com/r/CFL/comments/38gmtg/new_to_cfl_football_who_should_you_cheer_for_how/)";
            }
            else if (cmd.StartsWith("domethunder") || cmd.StartsWith("dome"))
            {
                Console.WriteLine("DOME THUNDER");
                content = @"[DOME THUNDER!!](http://www.handwhammy.com/DomeThunder.jpg)";
            }
            else if (cmd.StartsWith("info"))
            {
                Console.WriteLine("info");
                content = @"[This will help you](https://www.reddit.com/r/CFL/comments/38gmtg/new_to_cfl_football_who_should_you_cheer_for_how/)";
            }
            else if (cmd.StartsWith("radioactive"))
            {
                Console.WriteLine("radioactive");
                content = @"I'M WAKING UP

            I FEEL IT IN MY BONES

            ENOUGH TO MAKE MY SYSTEM BLOW

            WELCOME TO THE NEW AGE

            TO THE NEW AGE

            WELCOME TO THE NEW AGE

            [TO THE NEW AGE](https://www.youtube.com/watch?v=ktvTqknDobU)";
            }
            else if (cmd.StartsWith("trashtalkham") || cmd.StartsWith("wittytrashtalk"))
            {
                content += @"[That's nice](http://handwhammy.com/GC101.jpg)";
            }
            else if (cmd.StartsWith("trashtalkwpg"))
            {
                content += @"[That's nice](http://handwhammy.com/GC97.png)";
            }

            if (!String.IsNullOrWhiteSpace(content))
            {
                content += @"
            *****

            [[Feedback]](http://www.reddit.com/message/compose/?to=HomerSPC&subject=CFLBot+Feedback)";

                try
                {
                    var toPost = comment.Reply(content);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
            }
        }
开发者ID:streibeb,项目名称:CFLBot_CSharp,代码行数:97,代码来源:Program.cs

示例2: ReplyToComment

    private void ReplyToComment(Comment comment)
    {
      var context = CommentRegex.Match(comment.Body).Value;
      var phrase = PhraseRegex.Match(context).Value;
      var swappedPhrase = Regex.Replace(phrase, "-ass ", " ass-", RegexOptions.IgnoreCase);
      var sb = new StringBuilder();

      sb.AppendLine($">[{context.Replace(phrase, swappedPhrase)}](https://xkcd.com/37/)");
      sb.AppendLine();
      sb.AppendLine("*****");
      sb.AppendLine(@"I'm a bot. [Check out my source code on GitHub](https://github.com/PachowStudios/SweetAssBot/");

      comment.Reply(sb.ToString());
      Replies.Add($"{comment.Author} => {context}\n");
    }
开发者ID:PachowStudios,项目名称:SweetAssBot,代码行数:15,代码来源:Bot.cs


注:本文中的Comment.Reply方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。