hbplugin-server-chat-interceptor
v1.0.0
Published
SkeldJS Hindenburg plugin to intercept Room.sendChat
Downloads
5
Maintainers
Readme
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