Пример #1
0
        private void Start()
        {
            string reply = riveScript.reply("REEL", "시작하자");

            SplitSpeechLines(reply);
            PlayCommand();
        }
Пример #2
0
        void login(bool fromBot)
        {
            try
            {
                Auth.SetUserCredentials
                (
                    ConsumerKey,
                    ConsumerSecret,
                    UserAccessToken,
                    UserAccessSecret
                );
                _authenticatedUser = User.GetAuthenticatedUser();
                if (_authenticatedUser == null)
                {
                    var latestexception = ExceptionHandler.GetLastException();
                    MessageBox.Show(latestexception.TwitterDescription);

                    if (fromBot)
                    {
                        var reply = bot.reply("local_user", "login failed");
                        newPanel(false, "(bot) : " + reply);
                    }
                }
                else
                {
                    MessageBox.Show("Logged In as " + _authenticatedUser.ScreenName);
                    if (fromBot)
                    {
                        var reply = bot.reply("local_user", "login complete");
                        newPanel(false, "(bot) : " + reply);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(@"Something went wrong when we tried to execute the http request : '{0}'", ex.Message);

                if (fromBot)
                {
                    var reply = bot.reply("local_user", "login failed");
                    newPanel(false, "(bot) : " + reply);
                }
            }
        }
Пример #3
0
 private void btnGetReply_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(txtUserMessage.Text))
     {
         txtChatArea.AppendText($"Test User: {txtUserMessage.Text}\r\n");
         var reply = rs.reply("Test User", txtUserMessage.Text);
         if (!string.IsNullOrEmpty(reply))
         {
             txtChatArea.AppendText($"Bot: {reply}\r\n");
         }
     }
 }
 public string GetReply(string question)
 {
     return(riveScript.reply("REEL", question));
 }