
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-firestore-message-replier
Advanced tools
Node module which allows the bot to reply to a random message in the chat
Node module which allows the bot to reply to a random message in the chat.
You just set the probability between 1 and 100 and then the magic happens.
npm install node-telegram-firestore-message-replier
First create your own firestore db instance
node-telegram-firestore-message-replier initially works with node-telegram-bot-api.
const TelegramBot = require('node-telegram-bot-api');
const TelegramFirestoreMessageReplier = require('node-telegram-firestore-message-replier');
// initialize
const bot = new TelegramBot('BOT_TOKEN');
const replier = new TelegramFirestoreMessageReplier({
bot,
firestore: {
credential: require('./serviceKey.json'),
databaseUrl: 'https://YOUR_FIREBASE_URL.firebaseio.com',
docPath: 'collection/chats'
},
showChanceMessage: 'Current chance is CURRENT_CHANCE%',
setChanceMessage: 'Current chance changed from CURRENT_CHANCE% to NEXT_CHANCE%'
// CURRENT_CHANCE and NEXT_CHANCE strings will be replaced with currentChance and nextChance values
});
// on command "/chance" will show current chance value
bot.onText(/^\/chance($|@)/, msg => {
replier.showChance(msg);
});
// on command "/setchance 30" will set chance value to 30% to reply to the message
// command "/setchance" without value is equal to "/chance". So you can use only one command in your bot
bot.onText(/^\/chance(@.* )?(.+)?/, (msg, match) => {
const chanceValue = match[2];
replier.setChance(msg, chanceValue);
});
// handle each message to be ready for replying
bot.on('message', msg => {
// process() method calculates chance for message of being replied and calls one of the callbacks
// the chance is set previously via "/setchance <value>" command
replier.process(
msg,
repliedMsg => {
// success callback. Do something with lucky message
bot.sendMessage(repliedMsg.chat.id, repliedMsg);
},
repliedMsg => {
// error callback [optional]. Do something with unlucky message if you want
}
);
});
new TelegramFirestoreMessageReplier({
bot: <your bot instance> // previously created bot via node-telegram-bot-api
firestore: <object> // firestore db instance params
showChanceMessage: <string> // set message for show chance command
setChanceMessage: <string> // set message for change chance command
});
FAQs
Node module which allows the bot to reply to a random message in the chat
The npm package node-telegram-firestore-message-replier receives a total of 0 weekly downloads. As such, node-telegram-firestore-message-replier popularity was classified as not popular.
We found that node-telegram-firestore-message-replier 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.