Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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'];
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: `
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();
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'