How to use the telegraf/extra.markup function in telegraf

To help you get started, we’ve selected a few telegraf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github telegraf / telegraf / docs / examples / media-bot.js View on Github external
bot.command('edit_media', (ctx) => ctx.replyWithAnimation(AnimationUrl1, Extra.markup((m) =>
  m.inlineKeyboard([
    m.callbackButton('Change media', 'swap_media')
  ])
)))
github qlik-bots / QlikBotNode / app / server / routes / api / sense-bot / telegram.js View on Github external
bot.command('cio', (ctx) => {
	try {
		site.logger.info(`cio-main`, { route: `api/sense-bot/telegram` });
		ctx.reply(config.text[lang].cio.welcome);
		ctx.replyWithPhoto({ url: 'https://sense-demo-staging.qlik.com/appcontent/d0dd198f-138b-41d8-a099-5c5071bd6b33/CIO-desktop-development.jpg' });
		ctx.telegram.sendCopy(ctx.from.id, ctx.message, Extra.markup(keyboardCio));
	}
	catch (error) {
		site.logger.info(`error: ${error}`, { route: `api/sense-bot/telegram::cio()` });
	}
});
bot.action('cioManagement', (ctx) => {
github qlik-bots / QlikBotNode / app / server / routes / api / sense-bot / telegram.js View on Github external
.then(result => {
				ctx.replyWithHTML(`
		<b>${config.text[lang].cio.customer.title}</b>
		${config.text[lang].cio.customer.kpi1}: <b>${result[0][0].qText}</b>
		${config.text[lang].cio.customer.kpi2}: <b>3.75</b>
		${config.text[lang].cio.customer.kpi3}: <b>${result[1][0].qText}</b>
		${config.text[lang].cio.customer.kpi4}: <b>${result[2][0].qText}</b>
		${config.text[lang].cio.customer.kpi5}: <b>${result[3][0].qText}</b>
		${config.text[lang].cio.customer.kpi6}: <b>${result[4][0].qText}</b>
		${config.text[lang].cio.customer.kpi7}: <b>${result[5][0].qText}</b>
		${config.text[lang].cio.customer.kpi8}: <b>${result[6][0].qText}</b>
			`, Extra.markup(keyboardCio));
			})
			.catch(error =&gt; ctx.reply(`Error: ${error}`));
github qlik-bots / QlikBotNode / app / server / routes / api / sense-bot / telegram.js View on Github external
bot.command('salesforce', (ctx) => {
	try {
		site.logger.info(`salesforce-main`, { route: `api/sense-bot/telegram` });
		ctx.reply(config.text[lang].salesforce.welcome);
		ctx.replyWithPhoto({ url: 'https://webapps.qlik.com/img/2017_salesforce.png' });
		ctx.telegram.sendCopy(ctx.from.id, ctx.message, Extra.markup(keyboardSalesforce));
	}
	catch (error) {
		site.logger.info(`error: ${error}`, { route: `api/sense-bot/telegram::salesforce()` });
	}
});
bot.action('salesforceChart', (ctx) => {
github albertincx / formatbot1 / src / api / routes / format / keyboards.js View on Github external
function hide() {
  const replyMarkup = Markup.removeKeyboard();
  return Extra.markup(replyMarkup);
}
github telegraf / telegraf / docs / examples / keyboard-bot.js View on Github external
bot.command('special', (ctx) => {
  return ctx.reply('Special buttons keyboard', Extra.markup((markup) => {
    return markup.resize()
      .keyboard([
        markup.contactRequestButton('Send contact'),
        markup.locationRequestButton('Send location')
      ])
  }))
})
github telegraf / telegraf / docs / examples / echo-bot-module.js View on Github external
bot.on('message', (ctx) => ctx.telegram.sendCopy(ctx.chat.id, ctx.message, Extra.markup(keyboard)))
bot.action('delete', ({ deleteMessage }) => deleteMessage())
github telegraf / telegraf / docs / examples / keyboard-bot.js View on Github external
bot.command('pyramid', (ctx) => {
  return ctx.reply('Keyboard wrap', Extra.markup(
    Markup.keyboard(['one', 'two', 'three', 'four', 'five', 'six'], {
      wrap: (btn, index, currentRow) => currentRow.length >= (index + 1) / 2
    })
  ))
})
github telegraf / telegraf / docs / examples / keyboard-bot.js View on Github external
bot.command('simple', (ctx) =&gt; {
  return ctx.replyWithHTML('<b>Coke</b> or <i>Pepsi?</i>', Extra.markup(
    Markup.keyboard(['Coke', 'Pepsi'])
  ))
})
github qlik-bots / QlikBotNode / app / server / routes / api / sense-bot / telegram.js View on Github external
.then(result =&gt; {
				ctx.replyWithHTML(`
		<b>${config.text[lang].salesforce.opportunities.title}</b>
		${config.text[lang].salesforce.opportunities.kpi1}: <b>${result[0][0].qText}</b>
		${config.text[lang].salesforce.opportunities.kpi2}: <b>${result[1][0].qText}</b>
		${config.text[lang].salesforce.opportunities.kpi3}: <b>${result[2][0].qText}</b>
		${config.text[lang].salesforce.opportunities.kpi4}: <b>${result[3][0].qText}</b>
		${config.text[lang].salesforce.opportunities.kpi5}: <b>${result[4][0].qText}</b>
		${config.text[lang].salesforce.opportunities.kpi6}: <b>${result[5][0].qText}</b>
		${config.text[lang].salesforce.opportunities.kpi7}: <b>${result[6][0].qText}</b>
			`, Extra.markup(keyboardSalesforce));
			})
			.catch(error =&gt; ctx.reply(`Error: ${error}`));