Skip to content

Instantly share code, notes, and snippets.

View rob-derosa's full-sized avatar
🍕

Rob DeRosa rob-derosa

🍕
  • GitHub Staff
  • Colorado
View GitHub Profile
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Schema;
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Schema;
const http = require('http');
global.XMLHttpRequest = require('xhr2');
global.WebSocket = require('ws');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
const http = require('http');
global.XMLHttpRequest = require('xhr2');
global.WebSocket = require('ws');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
{
"status": "Succeeded",
"recognitionResults": [
{
"page": 1,
"clockwiseOrientation": 0.32,
"width": 8.5,
"height": 11,
"unit": "inch",
"lines": [
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"speak": "Tom's Pie is a pizza restaurant which is rated 9.3 by customers.",
"type": "ColumnSet",
"columns": [
{
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Dialogs;
var choices = new[] { "Microsoft", "Google", "Facebook" };
var card1 = new HeroCard
{
Title = "Microsoft",
Text = "A place you can add more text.",
Images = new List<CardImage> { new CardImage("http://www.firstroboticscanada.org/new/wp-content/uploads/2016/12/Microsoft-Logo.jpg") },
Subtitle = "Subtitle information goes here.",
Buttons = new List<CardAction>() { new CardAction(ActionTypes.ImBack, "Select", value: "Microsoft") },
};
private async Task<DialogTurnResult> DisplayTokenPhase1Async(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
var json = await File.ReadAllTextAsync("./Cards/NextEpisodeCard.json");
var reply = stepContext.Context.Activity.CreateReply();
reply.AttachmentLayout = AttachmentLayoutTypes.Carousel;
foreach(var item in _favorites.Where(f => f.Show.NextEpisode?.FirstAired.ToLocalTime().Subtract(DateTime.Now).Days <= 14))
{
var episodeJson = json.Replace("{{Show.Title}}", item.Show.Title)
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.
at Microsoft.Bot.Connector.Authentication.JwtTokenValidation.AuthenticateRequest(IActivity activity, String authHeader, ICredentialProvider credentials, IChannelProvider provider, HttpClient httpClient) in D:\a\1\s\libraries\Microsoft.Bot.Connector\Authentication\JwtTokenValidation.cs:line 50
at Microsoft.Bot.Builder.BotFrameworkAdapter.ProcessActivityAsync(String authHeader, Activity activity, BotCallbackHandler callback, CancellationToken cancellationToken) in D:\a\1\s\libraries\Microsoft.Bot.Builder\BotFrameworkAdapter.cs:line 203
at Microsoft.Bot.Builder.Integration.AspNet.Core.BotFrameworkHttpAdapter.ProcessAsync(HttpRequest httpRequest, HttpResponse httpResponse, IBot bot, CancellationToken cancellationToken) in D:\a\1\s\libraries\integration\Microsoft.Bot.Builder.Inte