Mute Plugin for Chat Engine
Adds the ability to mute a user in a ChatEngine Chat
Quick Start
- Have a ChatEngine server running already, instantiate a client and connect it
const ChatEngine = ChatEngineCore.create({
publishKey: 'pub-key-here',
subscribeKey: 'sub-key-here'
});
ChatEngine.connect('Username');
ChatEngine.on('$.ready', () => { ... });
- Attach this plugin to the channel you want, in this case global
ChatEngine.global.plugin(ChatEngineCore.plugin['chat-engine-mute']());
- Pass a user object to the muter to mute a user
let user = ChatEngine.global.users['user-uuid'];
ChatEngine.global.muter.mute(user);
console.log(ChatEngine.global.muter.isMuted(user));
- Pass a user object to the muter to unmute a user
let user = ChatEngine.global.users['user-uuid'];
ChatEngine.global.muter.umute(user);
console.log(ChatEngine.global.muter.isMuted(user));