You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lettelegrambot=require("node-telegram-bot-api");// You need to get the bot token from botfather in Telegramlettoken="Your bot token";letbot=newtelegrambot(token,{poling: true});bot.onText(/\/start/,(msg)=>{letchatId=msg.chat.idbot.sendMessage(chatId,"welcome to bot")})bot.on("message",(msg)=>{letchatId=msg.chat.id;letreplyMarkup={inline_keyboard: [[{text: "click To button 1",callback_data: "click 1"},{text: "click To button 2",callback_data: "click 2"},],],};if(msg.text=="list"){bot.sendMessage(chatId,`Hello ${msg.from.first_name} welcome to bot`,{reply_markup: replyMarkup});}});bot.on("callback_query",(msg)=>{letdata=msg.data;letchatId=msg.from.id;if(data=="click 1"){bot.sendMessage(chatId,"Option 1 was clicked");}elseif(data=="click 2"){bot.sendMessage(chatId,"Option 2 was clicked");}});