Wondering what’s next for npm?Check out our public roadmap! »

    botota

    1.1.0 • Public • Published

    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

    Install

    npm i botota

    DownloadsWeekly Downloads

    1

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    22.5 kB

    Total Files

    31

    Last publish

    Collaborators

    • avatar