private void LoadDataFromFile()
        {
            BotMessageData data = SerializationUtilities.LoadData();

            if (data.RendomMessages != null)
            {
                RendomMessages = data.RendomMessages.ToList();
            }
            else
            {
                RendomMessages = new List <string>();
            }

            MessagesListToTreeView();
            textBoxFirstMessage.Text = data.FirstMessage;
        }
예제 #2
0
        public async Task <Message> Post([FromBody] Message message)
        {
            if (_isFirst)
            {
                BotData  = SerializationUtilities.LoadData();
                _isFirst = false;
            }

            if (message.Type == "Message")
            {
                return(await Conversation.SendAsync(message, () => new DialogWithLogic()));
            }
            else
            {
                return(HandleSystemMessage(message));
            }
        }