How to use the vk-io.Keyboard.keyboard 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
async onLeave(context, { canceled }) {
		if (canceled) {
			await context.send('Registration canceled', {
				keyboard: Keyboard.keyboard([helpButton])
			});

			return;
		}

		context.session.user = context.wizard.state;

		await context.send('Register completed! Write /profile', {
			keyboard: Keyboard.keyboard([
				[
					Keyboard.textButton({
						label: 'Profile',
						color: Keyboard.PRIMARY_COLOR,
						payload: {
							command: 'profile'
						}
					}),
					helpButton
				]
			])
		});
	}
});
github negezor / vk-io / docs / examples / questionnaire / bot.js View on Github external
const profileText = hasUser
		? `
			/profile -- Profile
			/signout -- Sign Out
		`
		: '/signup - Sign Up';

	await context.send({
		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',