Skip to content

Commit

Permalink
Log post channel joins/leaves to stream (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
ifvictr committed May 8, 2020
1 parent 25b1b90 commit 15913c2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/index.js
Expand Up @@ -173,3 +173,15 @@ controller.on('slash_command', async (bot, message) => {
const commandHandler = commands.get(subcommand)
await commandHandler(bot, message, args)
})

controller.on('member_joined_channel', async (bot, message) => {
if (message.channel === process.env.SLACK_POST_CHANNEL_ID) {
await sendMessage(bot, process.env.SLACK_STREAM_CHANNEL_ID, `_<@${message.user}> joined <#${process.env.SLACK_POST_CHANNEL_ID}>._`)
}
})

controller.on('member_left_channel', async (bot, message) => {
if (message.channel === process.env.SLACK_POST_CHANNEL_ID) {
await sendMessage(bot, process.env.SLACK_STREAM_CHANNEL_ID, `_<@${message.user}> left <#${process.env.SLACK_POST_CHANNEL_ID}>._`)
}
})

0 comments on commit 15913c2

Please sign in to comment.