Exemple #1
0
        public static async Task ContinueAsync(ITurnContext turnContext, TokenResponse tokenResponse)
        {
            if (turnContext == null)
            {
                throw new ArgumentNullException(nameof(turnContext));
            }

            if (tokenResponse == null)
            {
                throw new ArgumentNullException(nameof(tokenResponse));
            }

            // Pull in the data from the Microsoft Graph.
            var client = new SimpleGraphClient(tokenResponse.Token);

            var me = await client.GetMeAsync();

            var RoomList = await client.GetRoomList();

            var KG = me.CompanyName;

            //var Sala = await client.FindRoomAsync();
            string[] Sala  = { "Sala one", "Sala two", "Sala three" }; //lo puse yo
            var      reply = turnContext.Activity.CreateReply();

            reply.Text        = $"You are in {me} .n {me.Mail}  {me.CompanyName} and {me.Manager}";
            reply.Attachments = new List <Attachment> {
                Cards.CreateHeroCard(KG, Sala).ToAttachment()
            };
            await turnContext.SendActivityAsync(reply);
        }
Exemple #2
0
        // Enable the user to send an email via the bot.
        public static async Task SendMailAsync(ITurnContext turnContext, TokenResponse tokenResponse, string recipient)
        {
            if (turnContext == null)
            {
                throw new ArgumentNullException(nameof(turnContext));
            }

            if (tokenResponse == null)
            {
                throw new ArgumentNullException(nameof(tokenResponse));
            }

            var client = new SimpleGraphClient(tokenResponse.Token);
            var me     = await client.GetMeAsync();

            await client.SendMailAsync(
                recipient,
                "Message from a bot!",
                $"Hi there! I had this message sent from a bot. - Your friend, {me.DisplayName}");

            await turnContext.SendActivityAsync(
                $"I sent a message to '{recipient}' from your account.");
        }
Exemple #3
0
        public static async Task ListMeAsync(ITurnContext turnContext, TokenResponse tokenResponse)
        {
            if (turnContext == null)
            {
                throw new ArgumentNullException(nameof(turnContext));
            }

            if (tokenResponse == null)
            {
                throw new ArgumentNullException(nameof(tokenResponse));
            }

            // Pull in the data from the Microsoft Graph.
            var client = new SimpleGraphClient(tokenResponse.Token);
            var me     = await client.GetMeAsync();

            // var RoomList = await client.GetList();
            //var manager = await client.GetManagerAsync(); //by art
            // var photoResponse = await client.GetPhotoAsync(); //by art

            // Generate the reply activity.
            var reply = turnContext.Activity.CreateReply();

            //var photoText = string.Empty;
            //if (photoResponse != null)//by art
            //{//by art
            //    var replyAttachment = new Attachment(photoResponse.ContentType, photoResponse.Base64String);//by art
            //    reply.Attachments.Add(replyAttachment);//by art
            //}//by art
            //else//by art
            //{//by art
            //    photoText = "Consider adding an image to your Outlook profile.";//by art
            //}//by art

            reply.Text = $"You are {me} and youre in {me.CompanyName}";
            await turnContext.SendActivityAsync(reply);
        }