Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot subscribe to the event when a user joins or leaves a channel #134

Open
aayani opened this issue Aug 13, 2019 · 3 comments
Open

Cannot subscribe to the event when a user joins or leaves a channel #134

aayani opened this issue Aug 13, 2019 · 3 comments

Comments

@aayani
Copy link

aayani commented Aug 13, 2019

instead getting an error with this JSON in response {"type":"error","error":{"msg":"invalid message type: null","code":3,"source":"gs-bom-hhur"}}

@7c
Copy link

7c commented Aug 20, 2019

I also keep getting this strange bot message to onMessage. Any clue why this might be ?

2019-08-20T15:21:24.460Z bot onMessage was called
2019-08-20T15:21:24.460Z bot msg:{"type":"error","error":{"msg":"invalid message type: null","code":3,"source":"gs-iad-4jhr"}}
2019-08-20T15:21:49.608Z bot onMessage was called
2019-08-20T15:21:49.608Z bot msg:{"type":"error","error":{"msg":"invalid message type: null","code":3,"source":"gs-iad-4jhr"}}
2019-08-20T15:22:14.460Z bot onMessage was called
2019-08-20T15:22:14.460Z bot msg:{"type":"error","error":{"msg":"invalid message type: null","code":3,"source":"gs-iad-4jhr"}}
2019-08-20T15:22:39.465Z bot onMessage was called
2019-08-20T15:22:39.465Z bot msg:{"type":"error","error":{"msg":"invalid message type: null","code":3,"source":"gs-iad-4jhr"}}
2019-08-20T15:23:04.461Z bot onMessage was called
2019-08-20T15:23:04.461Z bot msg:{"type":"error","error":{"msg":"invalid message type: null","code":3,"source":"gs-iad-4jhr"}}
2019-08-20T15:23:29.462Z bot onMessage was called
2019-08-20T15:23:29.462Z bot msg:{"type":"error","error":{"msg":"invalid message type: null","code":3,"source":"gs-iad-4jhr"}}

@guigallo
Copy link

receiving same error many times too:

{ type: 'error', error: { msg: 'invalid message type: null', code: 3, source: 'gs-gru-3ydt' } }

@elDudarino
Copy link

Was anyone able to figure this out? I've been trying to subscribe to _join events and none appear to work. I am trying to capture when a user joins the general channel or others but never seems to trigger:

if (data.subtype !== 'bot_message') {
	if (data.type === 'message') {
		
		if (data.subtype == 'member_joined_channel') {
			console.log('member join subtype');
			console.log(data);
			const params = {
				icon_emoji: ':information_source:',
			};
			
			bot.postMessage(notifications_channel_id, 'NEW CHANNEL JOIN: member_joined_channel subtype triggered' , params);
		}

		if (data.subtype == 'team_join') {
			console.log('member join team_join subtype');
			console.log(data);
			const params = {
				icon_emoji: ':information_source:',
			};
			
			bot.postMessage(notifications_channel_id, 'NEW CHANNEL JOIN: team_join subtype triggered' , params);
		}

		if (data.subtype == 'channel_join') {
			console.log('channel_join  join subtype');
			console.log(data);
			const params = {
				icon_emoji: ':information_source:',
			};
			
			bot.postMessage(notifications_channel_id, 'NEW CHANNEL JOIN: channel_join subtype triggered' , params);
		}

.....................

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants