Showing
2 changed files
with
2 additions
and
48 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 </h2><br> |
3 | 3 | ||
4 | - | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
4 | + | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -300,51 +300,5 @@ runHelp = () =>{ | ... | @@ -300,51 +300,5 @@ runHelp = () =>{ |
300 | comment = "Thanks for using Joker bot!:ghost::ghost:laugh:\nBot info: type '@joker --help'\nBot functions: @joker tell me [something] " | 300 | comment = "Thanks for using Joker bot!:ghost::ghost:laugh:\nBot info: type '@joker --help'\nBot functions: @joker tell me [something] " |
301 | bot.postMessageToChannel('everyone', "Type @joker and write a joke that you would like\n ex- @joker random",face); | 301 | bot.postMessageToChannel('everyone', "Type @joker and write a joke that you would like\n ex- @joker random",face); |
302 | 302 | ||
303 | + } | ||
303 | } | 304 | } |
304 | -} | ||
305 | - | ||
306 | - | ||
307 | - // function generalJoke(){ | ||
308 | - // dboperation.getdata(dbname, collec, "general") | ||
309 | - // .then((data) =>{ | ||
310 | - // var query = { state: 'OK' }; | ||
311 | - // var n = data.count(query); | ||
312 | - // var r = Math.floor(Math.random() * n); | ||
313 | - // var randomElement = data.find(query).limit(1).skip(r); | ||
314 | - // var question = randomElement.setup; | ||
315 | - // var joke = randomElement.punchline; | ||
316 | - // const face = { | ||
317 | - // icon_emoji: ':laughing:' | ||
318 | - // }; | ||
319 | - | ||
320 | - // bot.postMessageToChannel('everyone', question, joke, face); | ||
321 | - // bot.postMessageToChannel('full-stack-web', question, joke, face); | ||
322 | - // bot.postMessageToChannel('bot_test', question, joke, face); | ||
323 | - // }); | ||
324 | - // }; | ||
325 | - | ||
326 | - // // Tell a yomama Joke | ||
327 | - // function yomamaJoke(){ | ||
328 | - // axios.get('http://api.yomomma.info/') | ||
329 | - // .then(res =>{ | ||
330 | - // const joke = res.data.joke; | ||
331 | - | ||
332 | - // const face = { | ||
333 | - // icon_emoji: ':laughing:' | ||
334 | - // }; | ||
335 | - | ||
336 | - // bot.postMessageToChannel('everyone', `Yo mama: ${joke}`,face); | ||
337 | - // bot.postMessageToChannel('full-stack-web', `Yo mama: ${joke}`,face); | ||
338 | - // bot.postMessageToChannel('bot_test', `Yo mama: ${joke}`,face); | ||
339 | - | ||
340 | - // }); | ||
341 | - // }; | ||
342 | - // //Tell random joke | ||
343 | - // function runhelp(){ | ||
344 | - // const face = { | ||
345 | - // icon_emoji: ':question:' | ||
346 | - // }; | ||
347 | - | ||
348 | - // bot.postMessageToChannel('everyone', "Type @joker and write a joke that you would like\n ex- @joker random",face); | ||
349 | - // bot.postMessageToChannel('full-stack-web', "Type @joker and write a joke that you would like\n ex- @joker random",face); | ||
350 | - // } | ... | ... |
-
Please register or login to post a comment