Google App Script बाट टेलिग्राम च्याट बोट (Telegram Chat Bot From Google App Script)
यो परियोजना गुगल एप स्क्रिप्ट (Google App Script) को प्रयोग गरी सजिलैसँग टेलिग्राम च्याट बोट (Telegram Chat Bot) बनाउन मद्दत गर्ने एउटा पुस्तकालय (Library) को रूपमा विकास गरिएको हो।
प्रयोग (Usage) Link to heading
प्रोजेक्ट आइडी (Project ID): MPYd_nqgatBHdfoP1CC636z6333tZbdFa
रिसोर्सेज (Resources) > लाइब्रेरीहरू (Libraries) मा जानुहोस् र माथिको प्रोजेक्ट आइडी (Project ID) प्रयोग गरी यो पुस्तकालय (Library) थप्नुहोस्।
उदाहरणबाट सिक्नुहोस् (Learn By Example) Link to heading
इको बोट (Echo Bot) बनाउने नमुना कोड Link to heading
BOT = new Bot(token);
BOT.addResponse(
(message) => {
let mes = { "text": message.text };
BOT.sendMessage(message.chat.id,mes);
return true;
},
(message) => true);
function doPost(request)
{
let response=BOT.response(request);
return response;
}
म्यानुअल्ली (Manually) अपडेट (Update) प्राप्त गर्ने तरिका Link to heading
let updates = JSON.parse(BOT.getUpdates()).result;
for ( upIndex = 0; upIndex < updates.length; upIndex++)
{
let update = updates[upIndex];
BOT.respondToMessage(update.message);
}