@vk-io/hear
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.0 • Public • Published

    VK-IO Hear

    NPM version Build Status NPM downloads Code quality

    VK-IO Hear - Simple implementation of the hears ⚙️

    Installation

    Node.js 12.0.0 or newer is required

    Yarn

    Recommended

    yarn add @vk-io/hear
    

    NPM

    npm i @vk-io/hear
    

    Example usage

    import { VK, MessageContext } from 'vk-io';
    
    import { HearManager } from '@vk-io/hear';
    
    const vk = new VK({
    	token: process.env.TOKEN
    });
    
    const hearManager = new HearManager<MessageContext>();
    
    vk.updates.on('message_new', hearManager.middleware);
    
    hearManager.hear(/^hello$/, async (context) => {
    	await context.send('Hello!');
    });
    
    vk.updates.start().catch(console.error);

    Keywords

    Install

    npm i @vk-io/hear

    DownloadsWeekly Downloads

    197

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    12.2 kB

    Total Files

    10

    Last publish

    Collaborators

    • negezor