Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have the fairly common situation where I do not want a bot to be added to a group space. The reason is that the bot will receive some protected data. While the current framework easily handles the case where the bot is spoken to, I want to be able to respond immediately to the membership created event by inviting the person that added the bot to the room immediately to private room. This is only possibly by tracking which person added the bot to a room which is only available in the webhook and not the REST resource in form of an actorId.
This code change will propagate the actorId in form of an email address as a property on the bot so the bot can DM the person in a private room.
I also fixed an issue where a bot when trying to say an array throws an exception in the array due to the way the typeof === object is handled. Example:
bot.say(blah_my_array) throws the exception in how it is used for a query
I fixed it by reordering the if-else clause so that the least specific (object) is last and that typeof===string also applies to Array.isArray(true).
I added an example how to use PubNub as a webhook channel. This will help with firewall issues and is a good addition to your socket2me example. There is an example md4 and new pubnub in the templates folder.