Skip to content

Instantly share code, notes, and snippets.

View dgkanatsios's full-sized avatar

Dimitris-Ilias Gkanatsios dgkanatsios

View GitHub Profile
public class BookParkingDialogChain : IDialog<object>
{
private string selectedName, selectedEmail, selectedPhoneNumber;
private string selectedLicensePlate;
private ParkingAreaDetails selectedParkingLocationDetails;
private DateTime arrivalDateTime, departureDateTime;
private ParkingLotDetails selectedParkingLot;
ParkAroundBot.Data.ReserveTravelResponse result;
private bool finalConfirmation;
public sealed class CustomTextInputDialog : IDialog<string>
{
private CustomTextInputDialog()
{ }
public string InputPrompt { get; private set; }
public string WrongInputPrompt { get; private set; }
public ICustomInputValidator Validator { get; private set; }
[Serializable]
public class DateTimeInputDialog : IDialog<DateTime>
{
/// <summary>
/// If it is null, we're looking for DateTimeFrom
/// Else, we're looking for DateTimeTo
/// </summary>
private DateTime? inputDateTime;
private ParkingAreaDetails selectedParkingLocationDetails;
[Serializable]
public class FullnameInputDialog : IDialog<string>
{
public async Task StartAsync(IDialogContext context)
{
var msg = context.MakeMessage();
var attachments = new List<Attachment>();
msg.AttachmentLayout = AttachmentLayoutTypes.List;
var actions = new List<CardAction>()
private async Task ProcessFinished(IDialogContext ctx, IAwaitable<bool> confirmation)
{
bool userConfirmed = await confirmation;
if (userConfirmed == false)
{
ctx.Done("finished");
return;
}
result = await
@dgkanatsios
dgkanatsios / LoopWhileDialog.cs
Created May 11, 2017 11:25
A LoopWhileDialog for BotBuilder C# SDK
using Microsoft.Bot.Builder.Dialogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
namespace ParkAroundBot.CustomDialog
{
public static class Extensions
@dgkanatsios
dgkanatsios / sentimentanalysisgreek.js
Last active April 21, 2018 20:12
Sentiment analysis via Azure Text Analytics API
const request = require('request');
const fs = require('fs');
const url = 'https://westus.api.cognitive.microsoft.com/text/analytics/v2.0/sentiment';
const textanalyticskey = '<YOUR_TEXT_ANALYTICS_KEY>';
const data = JSON.parse(fs.readFileSync('test.json', 'utf8'));
request.post(url,
{
@dgkanatsios
dgkanatsios / test.json
Last active July 4, 2017 11:20
Reviews in Greek
[
{
"id": "1",
"text": "Δυσκολεύομαι να πιστέψω ότι υπάρχουν πράγματα που λειτουργούν τέλεια στην Ελλάδα. Ευχαριστώ και συγχαρητήρια για την προσπάθειά σας!"
},
{
"id": "2",
"text": "Όλα καλά. Ευχαριστώ πολύ!!"
},
{
const restify = require('restify');
const builder = require('botbuilder');
const os = require('os');
const server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
console.log('%s listening to %s', server.name, server.url);
});
var connector = new builder.ChatConnector({
FROM node:boron
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
COPY samplebot.js /usr/src/app
EXPOSE 3978
CMD [ "node", "samplebot" ]