Comparing version 2.1.3 to 2.1.4
{ | ||
"name": "nk-ntba", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"description": "Telegram bot api library for NodeJS. Developer's telegram: @NekitKuzmenko", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -118,1 +118,32 @@ Bot authorization: | ||
You can check available methods in source code of this library. | ||
Example of echo bot: | ||
``` | ||
const Bot = require('nk-ntba'); | ||
let bot = new Bot('API token of your bot'); | ||
bot.setCallback('message.text', async (msg) => { | ||
let cid = msg.chat.id; | ||
let msgid = msg.message_id; | ||
let tx = msg.text; | ||
let r = await bot.sendMessage(cid, `You sent: ${tx}`); | ||
setTimeout(() => { | ||
bot.deleteMessage(cid, msgid); | ||
bot.deleteMessage(cid, r.message_id); | ||
bot.sendMessage(cid, `Messages were deleted after 5 sec`); | ||
}, 5000); | ||
}); | ||
bot.listen({ | ||
long_polling: 300 | ||
}); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55458
148