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

added a property addedBy to a bot #25

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ralfschiffert
Copy link

@ralfschiffert ralfschiffert commented Oct 24, 2018

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.

…o added the bot. this may be useful if we want to DM the person who added the bot, for example for bots that are disallowed in the group rooms. The bot can act immediately without needing to be addressed first
…n example4.md and working template in templates folder
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.

None yet

1 participant