Guest User

Untitled

a guest
Mar 20th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. var appInsights = require('applicationinsights');
  2. var telemetryModule = require('./telemetry-module.js');
  3. appInsights.setup(process.env.APPINSIGHTS_INSTRUMENTATION_KEY).start();
  4. var appInsightsClient = new appInsights.TelemetryClient();
  5. var timesAsked = 0;
  6.  
  7. bot.dialog('Greeting', session => {
  8. session.endDialog('Hi there!');
  9.  
  10. appInsightsClient.trackEvent({ name: 'Greeting', properties: session.message.text });
  11. appInsightsClient.trackMetric({name: 'Number of times asked', properties: timesAsked++});
  12.  
  13. }).triggerAction({
  14. matches: /^hi/i
  15. });
Add Comment
Please, Sign In to add comment