V
V
Valentin Galkin2018-01-28 16:29:08
Node.js
Valentin Galkin, 2018-01-28 16:29:08

Can't run node.js error on startup?

bot.onText(/\/start/, (msg) => {
const text = "Добро Пожаловать в Наш бот-магазин.Выбирите что Вас интерисует?Выбирите раздел."
bot.sendMessage(msg.chat.id, text, {
  reply_markup:   {
    keyboard: [
    [KB.regulation,KB.share],[KB.city,KB.goods],[KB.vacancies,KB.current_events]




    ]


  }
})
    })


bot.on('message', msg => {
  switch (msg.text) {
   case KB.regulation:
    break
     case KB.back:
    break
     case KB.share:
      break
   case KB.back
      break
     case KB.city:
       sendSityScreen(msg.chat.id)
      break
     case KB.back:
      bot.sendMessage(msg.chat.id,'Что вы хотите сделать?',{
      	reply_markup:   {
    keyboard: [
    [KB.regulation,KB.share],[KB.city,KB.goods],[KB.vacancies,KB.current_events]




    ]


  }

      })
      break 
     case KB.goods:
      break
     case KB.vacancies:
      break
     case KB.current_events:
      break
     case KB.rus_1:
     case KB.rus_2:
     case KB.rus_3:
      break
  }



})

function sensSityScreen(chatId){
 bot.sendMessage (chatId,'Выбирите город:'{
 	reply_markup:{
 		keyboard:[
      [KB.rus_1,KB.rus_2,KB.rus_3],
      [KB.back]
 		]
 	}
 })

}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Ernest Faizullin, 2018-01-28
@erniesto77

most likely, the buttons (buttons) are incorrectly formed in the keyboard (
keyboard ) ; wrap the code in your post in a code lang="javascript" tag

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question