Answer the question
In order to leave comments, you need to log in
How to make a response to an unknown command?
I use vk-io
updates.hear(/мой счёт/i, async (context) => {
await context.send(`Ваш счёт: ${Math.floor(context.user.balance)}`);
});
updates.hear(/магазин/i, async (context) => {
await context.send(`Вы перешли в раздел магазина`, {
keyboard:
Keyboard.keyboard([
[
Keyboard.textButton({
label: 'Улучшения',
color: Keyboard.POSITIVE_COLOR
})
],
Keyboard.textButton({
label: 'Назад',
color: Keyboard.DEFAULT_COLOR
})
])
});
});
Answer the question
In order to leave comments, you need to log in
from the library documentation :
updates.setHearFallbackHandler(async (context, next) => {
await context.send('Такой команды нет :(');
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question