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

1.1.1 • Public • Published

VK-IO Hear

NPM version Build Status NPM downloads

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

📦 Installation

Node.js 12.20.0 or newer is required

  • Using npm (recommended)
    npm i @vk-io/hear
  • Using Yarn
    yarn add @vk-io/hear
  • Using pnpm
    pnpm add @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);

Readme

Keywords

Package Sidebar

Install

npm i @vk-io/hear

Weekly Downloads

83

Version

1.1.1

License

MIT

Unpacked Size

12.2 kB

Total Files

8

Last publish

Collaborators

  • negezor