Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

pubnub/chat-engine-muter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository is a part of the ChatEngine Framework. For more information on building chat applications with PubNub, see our Chat Resource Center.

Mute Plugin for ChatEngine

Adds the ability to mute a user in a ChatEngine Chat

Quick Start

  1. 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', () => { ... });
  1. Attach this plugin to the channel you want, in this case global
ChatEngine.global.plugin(ChatEngineCore.plugin['chat-engine-mute']());
  1. 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)); // true
  1. 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)); // false

Support

  • If you need help, have a general question, have a feature request or to file a bug, contact support@pubnub.com.

Releases

No releases published

Packages

 
 
 

Contributors