0

我有一个活跃的 Skype 机器人。

如何将我的机器人从 Skype 记录的聊天导出为文本或 Db?

我不知道从哪里开始。请给我发送指南或其他内容,可以添加我的代码以从 Skype 导出记录的数据。

这是我的 dialog.cs 代码:

using System;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Connector;
using System.Linq;
using System.Data.SqlClient;

namespace Angela.Dialogs
{
    [Serializable]
    public class RootDialog : IDialog<object>
    {
        DateTime localDate = DateTime.Now;
        String DateToday = "";


        public Task StartAsync(IDialogContext context)
        {



            context.Wait(MessageReceivedAsync);

            return Task.CompletedTask;
        }



        private async Task MessageReceivedAsync(IDialogContext context, IAwaitable<object> result)
        {
            var activity = await result as Activity;

            // calculate something for us to return
            int length = (activity.Text ?? string.Empty).Length;

            // return our reply to the user
            String Usermessage = activity.Text.ToString().ToLower();
            //if (DateTime.UtcNow.AddHours(8)=)
            //{

            //            }

            if (Usermessage.Contains("hello") || Usermessage.Contains("hi") || Usermessage.Contains("good day") || Usermessage.Contains("good morning"))
            {

                await context.PostAsync($"Good day " + activity.From.Name.ToString() + ":)");



            }
            else if (Usermessage.Contains("good night") || Usermessage.Contains("night") || Usermessage.Contains("see you") || Usermessage.Contains("bye"))
            {

                await context.PostAsync($"Good Night " + activity.From.Name.ToString() + ", Sleep well!");



            }

            else if (Usermessage.Contains("who is angela") || Usermessage.Contains("who you") || Usermessage.Contains("kinsa ka") || Usermessage.Contains("who are you"))
            {

                await context.PostAsync("I am Angela is a bot for Design4web! Nice meeting you " + activity.From.Name.ToString());



            }
            else if (Usermessage.Contains("thank you"))
            {

                await context.PostAsync("You're welcome " + activity.From.Name.ToString());



                await context.PostAsync("Hi " + activity.From.Name.ToString() + ", My name is ANGELA!, nice meeting you!");


            }


}
}
4

0 回答 0