
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.
You can easily install this nodejs module with npm
npm install vk-api-bot
After installation you should require module and create bot object:
const VKBot = require('vk-api-bot')
const bot = new VKBot(token, group_id, prefix, commands)
bot.listen()
Token
is string which you can recieve following this instruction.
Group_id
is your group identifier.
Prefix
is sybmol, that you'll write before bot's commands.
Commands
is array, that contains list of commands, with which bot will interact.
Listen
function is necessary to bot start read incomming messages.
const commands = [
{
command: 'commandName',
desc: 'Command description',
action: function (userId, value) {
console.log(`Message from user ${userId}`)
}
},
...another commands
]
When the bot recieved a message - he parsing it and if the first word equals one of defined commands he execute the corresponding function, which contains two parameters: userId
- identifier of user who sended a message and value
- some value, has been written after command in a message. If you don't wrote some addition values to command, parameter value
will be equal undefined
.
Desc
parameter is description of command. It's doesn't using now, but it will be implemented in closest patch.
Bot can respond to all messages. It can be used by hanle message
event.
const VKBot = require('vk-api-bot')
const bot = new VKBot(token, group_id, prefix, commands)
bot.on('message', response => {
console.log(`Message ${response.message} was recieved from user with id ${response.userId}`)
})
bot.listen()
In additoin bot have this list of methods:
userId
and message
.method
, the list of which is here and your group token, which contains in bot.token
parameter. And this function contains two unnecassary parameters: parameters
is object of transmitted parameters to the api method (the names of object parameters must be the same as transmitted parameters names), callback
is callback function like function(data){}
.
FAQs
Module for develop vk.com bot
The npm package vk-api-bot receives a total of 0 weekly downloads. As such, vk-api-bot popularity was classified as not popular.
We found that vk-api-bot 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.