Skip to content

Instantly share code, notes, and snippets.

@kypkyp
Last active December 24, 2016 19:44
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kypkyp/5c2f6c4ec91615b9f962403ad8c435d1 to your computer and use it in GitHub Desktop.
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