
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
node-telegram-bot-api
Advanced tools
Node.js module to interact with official Telegram Bot API. A bot token is needed, to obtain one, talk to @botfather and create a new bot.
npm install node-telegram-bot-api
var TelegramBot = require('node-telegram-bot-api');
var token = 'YOUR_TELEGRAM_BOT_TOKEN';
// Setup polling way
var bot = new TelegramBot(token, {polling: true});
bot.on('message', function (msg) {
var chatId = msg.chat.id;
// photo can be: a file path, a stream or a Telegram file_id
var photo = 'bot.gif';
bot.sendPhoto(chatId, photo, {caption: "I'm a bot!"});
});
There are some other examples on examples.
Both request method to obtain messages are implemented. To use standard polling, set polling: true
on options
. Notice that webHook will need a valid (not self signed) SSL certificate.
Emmits message
when a message arrives.
See: https://core.telegram.org/bots/api
Returns basic information about the bot in form of a User
object.
Specify an url to receive incoming updates via an outgoing webHook.
See: https://core.telegram.org/bots/api#setwebhook
Use this method to receive incoming updates using long polling
See: https://core.telegram.org/bots/api#getupdates
Send text message.
See: https://core.telegram.org/bots/api#sendmessage
Forward messages of any kind.
Send photo
See: https://core.telegram.org/bots/api#sendphoto
file_id
previously uploadedSend audio
See: https://core.telegram.org/bots/api#sendaudio
file_id
previously uploaded.Send Document
See: https://core.telegram.org/bots/api#sendDocument
file_id
previously uploaded.Send .webp stickers.
See: https://core.telegram.org/bots/api#sendsticker
file_id
previously uploaded.Send video files, Telegram clients support mp4 videos (other formats may be sent whith sendDocument
)
See: https://core.telegram.org/bots/api#sendvideo
file_id
previously uploaded.Send chat action.
typing
for text messages,
upload_photo
for photos, record_video
or upload_video
for videos,
record_audio
or upload_audio
for audio files, upload_document
for general files,
find_location
for location data.
See: https://core.telegram.org/bots/api#sendchataction
FAQs
Telegram Bot API
The npm package node-telegram-bot-api receives a total of 96,069 weekly downloads. As such, node-telegram-bot-api popularity was classified as popular.
We found that node-telegram-bot-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.