S
S
Sergey Stadnik2020-05-18 23:01:41
Node.js
Sergey Stadnik, 2020-05-18 23:01:41

How to make the bot respond to a command they don't understand?

There is a VK bot written in node js that works on commands.

How to make if the bot was written a command that he does not know, he would answer something like "I don't understand you" or "Sorry, I don't know this command yet"

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Nikolaevich, 2020-05-18
@nuriboy

switch (command) {
    case 'one': return this.oneResult()
    case 'two': return this.twoResult()
    default: return 'Извините, пока я не знаю этой команды'
}

S
Sergey Stadnik, 2020-05-18
@nuriboy

vk-io library

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question