D
D
darkgan2021-05-01 14:02:16
Node.js
darkgan, 2021-05-01 14:02:16

I wrote a bot on the js library (node-telegram-bot-api) and when I press the keyboard button 2 times, the text starts to split in two, what should I do?

const TelegramBot = require('node-telegram-bot-api');

const token = '*';

const bot = new TelegramBot(token, {
polling: {
interval: 300,
autoStart: true,
params: {
timeout: 10
}
}

});

console.info('start')

bot.on('message', msg => {

const chatId = msg.chat.id

if (msg.text === 'MY CONTACTS' ){

}else {
bot.sendMessage(chatId , 'Keyboard', {
reply_markup: {
keyboard: [
['Home','my website','MY CONTACTS'


})
}bot.onText(/MY CONTACTS/, function (msg) {
bot.sendMessage(chatId, 'MY CONTACTS', {
reply_markup: {
inline_keyboard: [
[
{
text: 'VK',
callback_data: 'There's nothing here )'
},
{
text: 'h',
callback_data: 'There's nothing here)'
},
{
text: 'h1',
callback_data:'There's nothing here)'
}
]


]
}
});
});
})


608d351638e65684798894.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question