Created
January 26, 2015 15:16
-
-
Save kemayo/8e51823636cefa623a50 to your computer and use it in GitHub Desktop.
Hubot plugin to drop a skype conference call link into the chat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Description | |
# Drop a link into chat which will work as a skype conference call for the requested user | |
# | |
# Dependencies: | |
# "slack-node": "^0.0.95" | |
# "hubot-slack-attachment": "^1.0.0" | |
# | |
# Configuration: | |
# HUBOT_SLACK_TOKEN | |
# HUBOT_SLACK_INCOMING_WEBHOOK | |
# | |
# Commands: | |
# hubot skype call - respond with a link that will call the user | |
# | |
# Author: | |
# kemayo | |
Slack = require('slack-node') | |
module.exports = (robot) -> | |
slack = new Slack process.env.HUBOT_SLACK_TOKEN | |
robot.respond /skype call/i, (msg) -> | |
slack.api 'users.info', {user: msg.message.user.id}, (err, response) -> | |
user = response.user | |
if not (user and user.profile and user.profile.skype) | |
return | |
# I feel this _should_ work, but the link doesn't get parsed out | |
# msg.send '<skype:' + user.profile.skype + '?call&token=' + msg.message.room + '|Start a call>' | |
attachment = | |
message: msg.message, | |
content: | |
# see https://api.slack.com/docs/attachments | |
fallback: 'Skype call to skype:' + user.profile.skype + '?call&token=' + msg.message.room | |
text: '<skype:' + user.profile.skype + '?call&token=' + msg.message.room + '|Start a call>' | |
# channel: msg.message.room | |
# username: robot.name | |
# icon_url: "..." | |
# icon_emoji: "..." | |
robot.emit 'slack.attachment', attachment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment