The plugin implement this interface will be called when a new message is received from a client.

class MessageLoggerPlugin implements HandleMessagePlugin {
async handleMessage(ctx, message, next) {
const startTime = Date.now();
console.log('Received message:', message);
const result = await next();
console.log('Message processed in', Date.now() - startTime, 'ms');
return result;
}
}
interface HandleMessagePlugin {
    handleMessage(ctx: ClientContext, message: IncomingMessage, next: (() => Promise<HandleMessageResult>)): Promise<HandleMessageResult>;
}

Methods