1.0.0 • Published 3 years ago

hbplugin-server-chat-interceptor v1.0.0

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
3 years ago

hbplugin-server-chat-interceptor

This is a SkeldJS Hindenburg api plugin to intercept Room.sendChat messages

Getting started

Run yarn add hbplugin-server-chat-interceptor in your plugin directory.

Intercept messages with InterceptSendChat

Examples:

import { InterceptSendChat } from "hbplugin-server-chat-interceptor";
import { WorkerPlugin } from "@skeldjs/hindenburg";

export class extends WorkerPlugin {
    @InterceptSendChat
    onSendChat(ctx: ChatInterceptionContext) {
        console.log(ctx.options);
    }
}

or

import { InterceptSendChat } from "hbplugin-server-chat-interceptor";

class MyInterception {
    @InterceptSendChat(MyPlugin)
    onSendChat(ctx: ChatInterceptionContext) {
        console.log(ctx.message);
    }
}

Compiling

Clone the project git clone https://github.com/gabriel-nsiqueira/hbplugin-server-chat-interceptor Install dependencies yarn install Run the build script yarn build