Skip to content

Instantly share code, notes, and snippets.

@yianni-ververis
Last active May 3, 2018 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yianni-ververis/622f3326ccf8dba73e30fdd81d06422d to your computer and use it in GitHub Desktop.
Save yianni-ververis/622f3326ccf8dba73e30fdd81d06422d to your computer and use it in GitHub Desktop.
QlikBotNode - Telegram user input in waterfall
const Extra = require('telegraf/extra');
const Markup = require('telegraf/markup');
const Composer = require('telegraf/composer')
const Stage = require('telegraf/stage')
const WizardScene = require('telegraf/scenes/wizard')
/***************
* HELPDESK
**************/
// BUTTONS
const keyboardHelpdesk = Markup.inlineKeyboard([
[
Markup.urlButton('View Demo', 'https://demos.qlik.com/qliksense/HelpdeskManagement'),
Markup.callbackButton(config.text[lang].helpdesk.highPriorityCases.button, 'helpdeskHighPriorityCases')
],
[
Markup.callbackButton(config.text[lang].helpdesk.mediumPriorityCases.button, 'helpdeskMediumPriorityCases'),
Markup.callbackButton(config.text[lang].helpdesk.lowPriorityCases.button, 'helpdeskLowPriorityCases')
],
[
Markup.callbackButton('Case Owner - Total', 'helpdeskCustom'),
]
]);
const superWizard = new WizardScene('super-wizard',
(ctx) => {
ctx.reply('Step 1 - What is your game title?')
return ctx.wizard.next()
},
(ctx) => {
ctx.reply('Step 2 - you typed: ' + ctx.update.message.text)
return ctx.wizard.next()
}
)
const stage = new Stage([superWizard], { default: 'super-wizard' })
bot.use(stage.middleware())
bot.action('helpdeskCustom', (ctx) => {
try {
const stage = new Stage([superWizard], { default: 'super-wizard' })
bot.use(stage.middleware())
}
catch (error) {
site.logger.info(`error: ${error}`, { route: `api/sense-bot/telegram::helpdeskLowPriorityCases()` });
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment