Last active
December 24, 2016 19:44
-
-
Save kypkyp/5c2f6c4ec91615b9f962403ad8c435d1 to your computer and use it in GitHub Desktop.
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
controller.hears(['tweet '], 'direct_mention,mention,ambient', function(bot, message) { | |
var output = message.text.slice(10,message.text.length); | |
if(message.channel === "C2Z3UJWAW"){ | |
twitterClient.post('statuses/update', {status: "[from #kyp_memo]" + output}, function(error, tweet, response) | |
if(!error){ | |
bot.say({ | |
channel:"C2Z3UJWAW", | |
text:"https://twitter.com/_kypu/status/" + tweet.id_str, // tweet.id ではない!(utgwさんに感謝) | |
}); | |
}else{ | |
bot.say({ | |
channel:"C2Z3UJWAW", | |
text:"ERROR" | |
}); | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment