Skip to content

Conversation

matthewdickinson
Copy link

Added basic support for the Google Hangouts Chat protocol.

@stojanovic
Copy link
Member

Thanks, this looks cool. I'll test it during the weekend and merge or comment.

P.S. Sorry for the late reply.

@stojanovic
Copy link
Member

@matthewdickinson I need some help with setting up a chatbot. Can you write a short instructions how to do that?

I created a bot as described here, but I can't activate the bot. Also, I got credentials for the chatbot, do I need to use them somehow?

Copy link
Member

@stojanovic stojanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a few minor comments on the code, but none of them is important for merging.

if (isEnabled('alexa')) {
alexaSetup(api, messageHandlerPromise, logError);
}
if (isEnabled('google-hangouts-chat')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use just hangouts because it's shorter but still describes the platform uniquely.


module.exports = function googleHangoutsSetup(api, bot, logError, optionalParser, optionalResponder) {
let parser = optionalParser || googleHangoutsParse;
let responder = optionalResponder || googleHangoutsReply;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use const instead of let for both parser and responder, as they are not re-assigned. I guess should update that for other bots too.

expect(parse({message: {}})).toBeUndefined();
});
it('should return original request with an empty text if the intent is missing', () => {
let msg = {message: {foo: 'bar'}, type: 'ADDED_TO_SPACE'};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

msg is never re-assigned, use const

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

Successfully merging this pull request may close these issues.

2 participants