
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
A fuss-free, thin wrapper around Telegram Bot API for Node.js. No frills.
Updated for Telegram Bot API 5.1.
Works with Node 15.12.0.
Runs on latest Node version 15.12.0
. Tested on 10.16.0
and 12.10.0
as well.
Note: Slimbot patch versions (e.g. x.y.Z) do not track or reflect Telegram Bot API changes.
npm i slimbot
const Slimbot = require('slimbot');
const slimbot = new Slimbot('123456789:AA...');
// Register listeners
slimbot.on('message', message => {
slimbot.sendMessage(message.chat.id, 'Message received');
});
// Call API
slimbot.startPolling();
Now go ahead and type a message to your bot in Telegram. It should reply you with 'Message received' in the chat. Check out all other events you can listen to in the wiki.
All methods return a promise. This means you can inspect the returned objects if you want to:
slimbot.sendMessage('123456789', 'Message received')
.then(message => {
console.log(message);
});
In this case, the sendMessage
method returns a Message object as stated in the documentation.
You can also use callbacks instead of promises:
const Slimbot = require('./src/slimbot');
const slimbot = new Slimbot(process.env['TELEGRAM_BOT_TOKEN']);
function callback(err, obj) {
if (err) {
// handle error
console.log(obj);
}
// handle returned object
console.log(obj);
};
slimbot.on('message', message => {
slimbot.sendMessage(message.chat.id, 'Message received', callback);
});
slimbot.startPolling(callback);
Learn more about the implementation details in the Wiki. Feel free to contribute to the Wiki or add more examples.
Heartfelt thanks to the following folks for making Slimbot better: @lgg @ago @rpaskin @matteocontrini @jakimenko @nahanil
The guiding principle for this library is to be as simple as possible. I put serious thought into adding features to guard against bloat. Nonetheless, I am very open to dialogue and contributions are most welcome.
If you have built a public bot using this library, send me a PM and I'll feature it here.
FAQs
Simple and minimal Telegram Bot API for Node.js. No frills.
The npm package slimbot receives a total of 517 weekly downloads. As such, slimbot popularity was classified as not popular.
We found that slimbot 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.