Create a gist now

Instantly share code, notes, and snippets.

@kypkyp /bot4.js
Last active Dec 24, 2016

What would you like to do?
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