김연준

Update README

1 <h1>Building a Slackbot</h1><br> 1 <h1>Building a Slackbot</h1><br>
2 -<h2>A slackbot that reacts to user's chat </h2><br> 2 +<h2>A slackbot that reacts to user's chat and sends jokes </h2><br>
3 3
4 ![joker_fix](https://user-images.githubusercontent.com/39256000/58455581-0ce84100-815d-11e9-833c-90c7af08f52f.jpg) 4 ![joker_fix](https://user-images.githubusercontent.com/39256000/58455581-0ce84100-815d-11e9-833c-90c7af08f52f.jpg)
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -7,7 +7,7 @@ const url = 'mongodb://localhost:27017/'; ...@@ -7,7 +7,7 @@ const url = 'mongodb://localhost:27017/';
7 exports.startbot = ()=>{ 7 exports.startbot = ()=>{
8 // Get authorization to use the slackbot 8 // Get authorization to use the slackbot
9 const bot = new SlackBot({ 9 const bot = new SlackBot({
10 - token : "xoxb-582582124755-587875604934-oewQRL6lzHXLkybUrg4CWJVJ", 10 + token : "xoxb-582582124755-587875604934-YBMZlb18wIdKQIEpyIV2dORa",
11 name : "Joker" 11 name : "Joker"
12 }); 12 });
13 13
...@@ -16,8 +16,8 @@ exports.startbot = ()=>{ ...@@ -16,8 +16,8 @@ exports.startbot = ()=>{
16 const face = { 16 const face = {
17 icon_emoji: ':bowtie:' 17 icon_emoji: ':bowtie:'
18 }; 18 };
19 - bot.postMessageToChannel('everyone', 'Have some fun with @Joker!\nFor commands write @joker help' 19 + bot.postMessageToChannel('everyone', 'Have some fun with @Joker!\nFor commands write @joker --help'
20 - , face); 20 + , face, '/play secret');
21 }); 21 });
22 // Error Handler 22 // Error Handler
23 bot.on('error', (err) => console.log(err)); 23 bot.on('error', (err) => console.log(err));
...@@ -55,7 +55,7 @@ function handleMessage(message, channel, user){ ...@@ -55,7 +55,7 @@ function handleMessage(message, channel, user){
55 else if(message.includes(' programming')){ 55 else if(message.includes(' programming')){
56 programmingJoke(); 56 programmingJoke();
57 } 57 }
58 - else if(message.includes(' me ')){ 58 + else if(message.includes(' me ')){
59 bot.postMessageToChannel('everyone', "Tell you what??? :nomouth:", embarrased); 59 bot.postMessageToChannel('everyone', "Tell you what??? :nomouth:", embarrased);
60 } 60 }
61 else{ 61 else{
...@@ -133,7 +133,7 @@ randomJoke= ()=>{ ...@@ -133,7 +133,7 @@ randomJoke= ()=>{
133 icon_emoji: ':laughing:' 133 icon_emoji: ':laughing:'
134 }; 134 };
135 setTimeout(function secondFunction(){ 135 setTimeout(function secondFunction(){
136 - bot.postMessageToChannel('everyone', `${joke}:stuck_out_tongue_winking_eye::laughing:`, face) 136 + bot.postMessageToChannel('everyone', `${joke}:stuck_out_tongue_winking_eye::laughing:`, face, '/play secret')
137 console.log( "허무개그 전송~~~~!") 137 console.log( "허무개그 전송~~~~!")
138 }, 3000); 138 }, 3000);
139 139
......