I am creating a Hubot script to do some stuffs. However due to some circumstances, we need to make sure certain commands only works when sent via PM (private message) instead of channels (e.g. telling the bot to save some password).
As a workaround, I am currently using this checker function:
is_private = (res) -> res.message.room == res.message.user.name
We are currently using this with Slack, but need to make the script also works with other adapters as well since we're going to release it as open source project.
Is this method reliable enough? Is there any built-in methods to check this?