How to use the vk-io.Keyboard.textButton function in vk-io

To help you get started, we’ve selected a few vk-io 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 negezor / vk-io / docs / examples / questionnaire / scenes / signup.js View on Github external
const { Keyboard } = require('vk-io');

const { StepScene } = require('../middlewares/wizard');

const cancelButton = Keyboard.textButton({
	label: 'Cancel',
	color: Keyboard.NEGATIVE_COLOR,
	payload: {
		command: 'cancel'
	}
});

const helpButton = Keyboard.textButton({
	label: 'Help',
	payload: {
		command: 'help'
	}
});

const allowGenders = ['male', 'female'];
github negezor / vk-io / docs / examples / questionnaire / scenes / signup.js View on Github external
const { Keyboard } = require('vk-io');

const { StepScene } = require('../middlewares/wizard');

const cancelButton = Keyboard.textButton({
	label: 'Cancel',
	color: Keyboard.NEGATIVE_COLOR,
	payload: {
		command: 'cancel'
	}
});

const helpButton = Keyboard.textButton({
	label: 'Help',
	payload: {
		command: 'help'
	}
});

const allowGenders = ['male', 'female'];

module.exports = new StepScene('signup', {
	steps: [
		async (context, { firstTime }) => {
			const { text: username } = context;

			if (firstTime || !username) {
				await context.send({
					message: `
github negezor / vk-io / docs / examples / questionnaire / scenes / signup.js View on Github external
async (context, { firstTime }) => {
			if (firstTime) {
				await context.send({
					message: `
						How old are you?
					`,
					keyboard: Keyboard.keyboard([
						Keyboard.textButton({
							label: 'Skip',
							payload: {
								command: 'skip'
							}
						}),
						cancelButton
					])
				});

				return;
			}

			if (context.state.command === 'skip') {
				await context.send('Age setting skipped');

				await context.step.next();
github negezor / vk-io / docs / examples / questionnaire / bot.js View on Github external
message: `
			My commands list

			/help -- Commands list
			${profileText.trim()}
		`,
		keyboard: Keyboard.keyboard([
			Keyboard.textButton({
				label: 'Help',
				payload: {
					command: 'help'
				}
			}),
			hasUser
				? [
					Keyboard.textButton({
						label: 'Profile',
						payload: {
							command: 'profile'
						}
					}),
					Keyboard.textButton({
						label: 'Sign Out',
						payload: {
							command: 'signout'
						}
					})
				]
				: Keyboard.textButton({
					label: 'Sign Up',
					payload: {
						command: 'signup'