🚀 DAY 3 OF LAUNCH WEEK: Introducing Webhook Events for Pull Request Scans.Learn more →
Socket
Book a DemoInstallSign in
Socket

@vk-io/hear

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vk-io/hear

Hear for the library vk-io

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

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);

Keywords

vk

FAQs

Package last updated on 31 Mar 2023

Did you know?

Socket

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.

Install

Related posts