0

I have a Skype bot active.

How do I export the logged chat from Skype with my bot into text or Db?

I don't know where to start. please send me a guide or something, can add in my code to export the logged data from Skype.

This is my dialog.cs code:

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!");


            }


}
}
Nae
  • 14,209
  • 7
  • 52
  • 79
  • Look into Entity Framework (probably the easiest to use, reason I reference, though ADO.NET, Dapper, or any number of methods could be employed), setup your database and models correctly, and then after you receive messages, dump Usermessage into the database in whatever manner you're wanting. – Robert Jan 24 '18 at 15:22
  • can you give me a link to understand with that function? or do you have a tutorial for that? thanks. – Jovel Mark Diaz Jan 25 '18 at 02:35
  • https://msdn.microsoft.com/en-us/library/ee712907(v=vs.113).aspx - can either go with code first or database first with those examples. Personally, I tend to manually do a bit of it (create the field in the database, create the property in the model) and then just turn off migrations. But code/database first are the typical methods. – Robert Jan 25 '18 at 15:31
  • thank you, i already add the data in database, Is there a way to export the data from database into text? or can view in website? – Jovel Mark Diaz Jan 26 '18 at 07:59

0 Answers0