1.1.0 • Published 6 years ago

botota v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

botota

Framefork for creating Bots in social network VK.com

Usage

const botota = require('botota')
const bot = new botota.Bot({
    token: "afbd70140d0b9cf4fa8ddbsbdf219k3b7073cc90cc89752baaa6aad5as0fa333se91c30b8an1k75ds7d2d", //example token
    v: '5.80', //version API, STRING type!
})


bot.on( (msg) => {
    msg.reply({
        text: 'Hello World!'
    })
})

bot.command('tick', (msg) => {
    msg.reply({
        text: 'tack'
    })
})

bot.event('group_join', (event) => {
    event.reply({
        text: 'Thank for subscribe!'
    })
}

API callings

.api

.api(method_name, params)

Usage

...
(async() =>{
   const messages = await bot.api('messages.getById', {
       message_ids: [1,2,3,4,5]
   }) 
})()

.execute

.execute(method_name, params)

Usage

...
(async() => {
   const chat = await bot.execute('messages.getChat', {
       chat_id: 42
   }) 
})()

Events

.event(event_name, callback)

Callback any Callback API event

.on(callback)

Callback any incoming message

.use(callback)

Callback any new message

.command(command, callback)

Callback any incoming message which starts with command

.mention(callback)

Callback any incoming message where the group is mentioned

.chat(callback)

Callback any incoming message from chats

.user(callback)

Callback any incoming message from users

1.1.0

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago