From 8b81c43c5f6e5bc1877fc5dab1a470aeb06c4803 Mon Sep 17 00:00:00 2001 From: Charlie Hess Date: Fri, 28 Aug 2015 00:00:35 -0700 Subject: [PATCH] Log open DM's for debugging. --- src/bot.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bot.js b/src/bot.js index d6d0458..c1ce27e 100644 --- a/src/bot.js +++ b/src/bot.js @@ -135,6 +135,10 @@ class Bot { this.groups = _.keys(this.slack.groups) .map(k => this.slack.groups[k]) .filter(g => g.is_open && !g.is_archived); + + this.dms = _.keys(this.slack.dms) + .map(k => this.slack.dms[k]) + .filter(dm => dm.is_open); console.log(`Welcome to Slack. You are ${this.slack.self.name} of ${this.slack.team.name}`); @@ -147,6 +151,10 @@ class Bot { if (this.groups.length > 0) { console.log(`As well as: ${this.groups.map(g => g.name).join(', ')}`); } + + if (this.dms.length > 0) { + console.log(`Your open DM's: ${this.dms.map(dm => dm.name).join(', ')}`); + } } }