Answer the question
In order to leave comments, you need to log in
Why such strange things with scope?
Hello. The code is like this:
switch (data) {
case 'buy': //как купить BTC
const keys = message.buy.key[lng];
keys.chat_id = msg.message.chat.id;
keys.message_id = msg.message.message_id;
bot.editMessageText(message.buy.text[lng], keys);
break;
case 'sell': //как продать BTC
const keys = message.sell.key[lng];
bot.editMessageText(message.sell.text[lng], keys);
break;
}
Answer the question
In order to leave comments, you need to log in
You have 2 times the declaration of const keys inside one block (the whole switch is one block)
, you can wrap each case in your own block, then it will work
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question