hubotで動く褒めbot作りました。
module.exports = ((robot) => { const keyword = /(だん|達成|できた|できた|出来た|完成)(ー|!|!|1|1)*$/i; const help = `\`\`\` はじめに: gj_chanが部屋にいなければ呼ぶ /invite @gj_chan command: @gj_chan -h : ヘルプテキスト表示 keyword: ${keyword.toString()} \`\`\``; robot.respond(/-h/i, (res) => { res.send(help); }); robot.hear(keyword, (res) => { res.send('やったー!'); }); });
今は文字で固定レスポンスだけど、ランダムポストにしたり画像つけてくれたりするようにしたいなー。
0 件のコメント:
コメントを投稿