Showing
2 changed files
with
5 additions
and
5 deletions
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 |  | 4 |  |
... | \ 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)); |
... | @@ -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 | ... | ... |
-
Please register or login to post a comment