# Channel handler not working

**URL:** <https://community.sendbird.com/t/channel-handler-not-working/322>\
**Category:** Miscellaneous\
**Created:** [May 27, 2020, 9:43am UTC](https://community.sendbird.com/t/channel-handler-not-working/322 "2020-05-27T09:43:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahulhidau](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@rahulhidau](https://community.sendbird.com/u/rahulhidau)\
**Post date:** [May 27, 2020, 9:43am UTC](https://community.sendbird.com/t/channel-handler-not-working/322/1 "2020-05-27T09:43:07Z")

</div>

var sb = new SendBird({appId: ‘XXXXXXXXXXXXXXXXX’});

var visitor\_id = ‘{$visitor.user\_id}’;  
sb.connect(visitor\_id, function(user, error) {

});

var ConnectionHandler = new sb.ConnectionHandler();  
ConnectionHandler.onReconnectStarted = function (id) {  
console.log(‘onReconnectStarted’);  
};

ConnectionHandler.onReconnectSucceeded = function (id) {  
console.log(‘onReconnectSucceeded’);  
};

ConnectionHandler.onReconnectFailed = function (id) {  
console.log(‘onReconnectFailed’);  
};  
sb.addConnectionHandler(‘uniqueID’, ConnectionHandler);

var ChannelHandler = new sb.ChannelHandler();  
ChannelHandler.onMessageReceived = function(channel, message) {  
console.log(‘dsfdsf’);  
console.log(channel, message);  
};  
ChannelHandler.onMessageUpdated = function(channel, message) {};  
ChannelHandler.onMessageDeleted = function(channel, messageId) {};  
ChannelHandler.onMentionReceived = function(channel, message) {};  
ChannelHandler.onChannelChanged = function(channel) {};  
ChannelHandler.onChannelDeleted = function(channelUrl, channelType) {};  
ChannelHandler.onChannelFrozen = function(channel) {};  
ChannelHandler.onChannelUnfrozen = function(channel) {};  
ChannelHandler.onMetaDataCreated = function(channel, metaData) {};  
ChannelHandler.onMetaDataUpdated = function(channel, metaData) {};  
ChannelHandler.onMetaDataDeleted = function(channel, metaDataKeys) {};  
ChannelHandler.onMetaCountersCreated = function(channel, metaCounter) {};  
ChannelHandler.onMetaCountersUpdated = function(channel, metaCounter) {};  
ChannelHandler.onMetaCountersDeleted = function(channel, metaCounterKeys) {};  
ChannelHandler.onChannelHidden = function(groupChannel) {};  
ChannelHandler.onUserReceivedInvitation = function(groupChannel, inviter, invitees) {};  
ChannelHandler.onUserDeclinedInvitation = function(groupChannel, inviter, invitee) {};  
ChannelHandler.onUserJoined = function(groupChannel, user) {};  
ChannelHandler.onUserLeft = function(groupChannel, user) {};  
ChannelHandler.onReadReceiptUpdated = function(groupChannel) {};  
ChannelHandler.onTypingStatusUpdated = function(groupChannel) {};  
ChannelHandler.onUserEntered = function(openChannel, user) {};  
ChannelHandler.onUserExited = function(openChannel, user) {};  
ChannelHandler.onUserMuted = function(channel, user) {};  
ChannelHandler.onUserUnmuted = function(channel, user) {};  
ChannelHandler.onUserBanned = function(channel, user) {};  
ChannelHandler.onUserUnbanned = function(channel, user) {};

sb.addChannelHandler(‘uniqueChannel’, ChannelHandler);

any one can please help me this is my code the event on message received is not working
