
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.
A simple Promise
based wrapper over Telegram Bot API with additional features.
npm install tg-yarl
const api = require('tg-yarl')('YOUR_TELEGRAM_BOT_TOKEN');
api.setWebhook('https://example.com/bot', './certificate.pem');
api.getMe().then(res => console.log(res.body));
api
.sendPhoto('chatId', './anonim.jpg', {caption: 'Anonymous'})
.then(res => console.log(res.body));
All methods return a Promise
.
A simple method for testing your bot's auth token. Returns basic information about the bot in form of a User object.
Specify an url to receive incoming updates via an outgoing webhook.
To use a self-signed certificate, you need to upload your public key certificate using certificate
parameter.
Use this method to receive incoming updates using long polling.
Send text message.
@channelusername
)Markdown
, if you want Telegram apps to show bold, italic and inline URLs in your bot's message.Forward messages of any kind.
@channelusername
)@channelusername
)Send photo.
@channelusername
)file_id
. See InputFile object for more info.Send audio.
@channelusername
)file_id
. See InputFile object for more info.Send document.
@channelusername
)file_id
. See InputFile object for more info.Send .webp stickers.
@channelusername
)file_id
. See InputFile object for more info.Send video.
@channelusername
)file_id
. See InputFile object for more info.Send voice.
@channelusername
)file_id
. See InputFile object for more info.Send location.
@channelusername
)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.
@channelusername
)Use this method to get a list of profile pictures for a user.
Use this method to get basic info about a file and prepare it for downloading.
Download file to specified path.
WritableStream
or new WritableStream
will be created with specified path.api.downloadFile('AgADAgADjagxGxAR6gbMzfh8LDtkU-9GhCoABOmH973MjLOBq7sAAgI', './file.jpg');
Custom keyboard.
Note: This method is chainable.
If you just want to hide the keyboard, then do this:
api.setKeyboard().sendMessage('chatId', 'Text');
//or
api.setKeyboard(true);
api.sendMessage('chatId', 'Text');
If you want to hide the keyboard to specific users only, then do this:
api.setKeyboard(true, true).sendMessage('chatId', 'Text');
//or
api.setKeyboard(true, true);
api.sendMessage('chatId', 'Text');
Note: This method is chainable.
For path
, file_id
, Buffer
and local Stream
just pass into variable:
var inputFile = './file.png'; //path
//or
var inputFile = 'AgADAgADjagxGxAR6gbMzfh8LDtkU-9GhCoABOmH973MjLOBq7sAAgI'; //file_id
//or
var inputFile = new Buffer(); //Buffer
//or
var inputFile = require('fs').createReadStream('./file.png'); //local Stream
api.sendPhoto('chatId', inputFile);
For remote Stream
:
var inputFile = {
value: require('https').request('https://avatars1.githubusercontent.com/u/2401029'),
filename: 'image.jpg'
};
api.sendPhoto('chatId', inputFile);
The MIT License (MIT)
Copyright (c) 2015 Alexey Bystrov
FAQs
A simple Promise based wrapper over Telegram Bot Api with additional features.
We found that tg-yarl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.