Пример #1
0
        static void GeneratingAnswers(ChatBot chatBot)
        {
            string currentMessageText = string.Empty;

            while (true)
            {
                var dialogs = vkApi.Messages.GetDialogs(new MessagesDialogsGetParams {
                    Count = 1, /* Unread = true, */ Unanswered = true
                });

                Message message;
                if (dialogs.Messages.Count > 0)
                {
                    foreach (var msg in dialogs.Messages)
                    {
                        chatBot.GenAnswer(msg.Body);
                    }
                }
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            ChatBot chatBot = new ChatBot();

            chatBot.GetStr += ChatBot_GetStr;

            Auth();
            vkApi.Status.Set("Mode \"матершинник\" is ON");

            myID = vkApi.UserId.Value;
            Console.WriteLine(new string('-', 100));
            Console.WriteLine(vkApi.Account.GetInfo());
            Console.WriteLine(new string('-', 100));

            while (true)
            {
                chatBot.GenAnswer(GetMessage());

                //ConsoleCtrlCheck(CtrlTypes.CTRL_CLOSE_EVENT);
            }
        }