Create a gist now

Instantly share code, notes, and snippets.

/**
* ping-pong-bot
*
* created by yuna miyashita
*/
module.exports = (robot) => {
robot.router.post('/', (req, res) => {
// メッセージを選択する
const msgObj = {
'eigyo':'営業に来客です',
'soumu':'総務に来客です',
'keiri':'経理に来客です',
'dev':'開発に来客です'
}
const msg = msgObj[req.body.value];
// 指定したチャンネルにメッセージを送信する
robot.send({room: 'ABEELT41'}, msg);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment