Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
vk-chat-bot
Advanced tools
A library for easy creation of chat bots for VK communities (uses Callback API).
This is a chat bot library for VK communities (groups).
See the wiki for description of all features.
Changelog is available here.
npm i vk-chat-bot
You can find the example in the vk-chat-bot-example
repository.
Also, you can take a look at the step-by-step Heroku Deploy Guide.
First, require()
the library:
const vk = require('vk-chat-bot')
Then, create your bot using the vk.bot
function (see Params object for more information about params
):
var params = {
vk_token: 'your_vk_access_token',
confirmation_token: 'f123456',
group_id: 1234567,
secret: 's3r10us1y_s3cr3t_phr4s3',
port: 12345,
cmd_prefix: "/"
}
var {bot, core} = vk.bot(params)
See Core
wiki to learn more about behavior functions.
Here are some examples:
// No matching handler is found
core.on('no_match', $ => {
$.text("I don't know how to respond to your message.")
})
var Keyboard = vk.kbd.Keyboard
var Button = vk.kbd.Button
var colors = vk.kbd.colors
core.cmd('keyboard', $ => {
// Set 'true' instead of 'false' to make it disapper after a button was pressed
var kbd = new Keyboard([
// Rows
[
new Button('Default'),
new Button('Primary', colors.primary),
new Button('Negative', colors.negative),
new Button('Positive', colors.positive)
],
[
new Button('Maximum rows is 10, columns - 4.')
],
], false)
$.text('Here is your keyboard, as promised.')
$.keyboard(kbd)
})
// Searches for cmd_prefix + 'help', e.g. "/help"
core.cmd('help', $ => {
// bot.help() returns the help message
$.text('Test Bot v1.0' + core.help())
// Attach an image from
// https://vk.com/team?z=photo6492_45624077
$.attach('photo', 6492, 456240778)
}, 'shows the help message')
// Use case-insensitive regex to find words "hi", "hello" or "hey"
core.regex(/h(i|ello|ey)/i, $ => {
$.text('Hello, I am a test bot. You said: ' + $.msg)
})
Start the bot:
bot.start()
The bot will log some useful information, see Logging wiki for more information.
Having issues?
Found a bug?
Something does not seem right?
Or you have a feature request?
Open an issue.
You know how to make vk-chat-bot
better?
git clone git@github.com:username/vk-chat-bot
git add *
git commit -m "Small description of what you changed"
git push -u origin master
This project is licensed under the terms of the MIT license.
[10.0.2] - 2018-07-08
require('colors')
FAQs
Package for easy creation of chat bots for VK communities (uses Callback API).
The npm package vk-chat-bot receives a total of 0 weekly downloads. As such, vk-chat-bot popularity was classified as not popular.
We found that vk-chat-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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.