Build A Slackbot

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ต.ค. 2024
  • In this tutorial we will build a Slackbot using JavaScript/Node.js that reaches out to 2 public APIs and tells random jokes within Slack. We will use the Slackbots.js library to achieve this.
    Code:
    github.com/bra...
    💖 Become a Patron: Show support & get perks!
    / traversymedia
    Website & Udemy Courses
    www.traversymed...
    Follow Traversy Media:
    / traversymedia
    / traversymedia
    / traversymedia
    The Developer Hangout: Public Discord Server
    / discord

ความคิดเห็น • 170

  • @robbiealixsantos
    @robbiealixsantos 4 ปีที่แล้ว +34

    thanks man, you have been keeping me employed for the last 4 years

    • @floweemusic8008
      @floweemusic8008 4 ปีที่แล้ว +5

      You still employed my man?

    • @naazbegum3325
      @naazbegum3325 2 ปีที่แล้ว

      @@floweemusic8008 000äpli9luillp*0ĺl

  • @Coco-uk5yn
    @Coco-uk5yn 6 ปีที่แล้ว +2

    Thanks Mr Brad. Next week I'll be joining as a UI/UX developer at a startup and the first thing I'll be doing is donating you at patreon. I owe you a lot and you are a savior to most of us budding developers. Thanks a ton. Continue your good work and God bless.

  • @AtomCoder
    @AtomCoder 5 ปีที่แล้ว +2

    Nice tutorial. Currently your code allows you to trigger the bot with or without "@jokebot", so simply entering "chucknorris" will trigger the bot. As a suggestion, you could do something like this within the handleMessage() function:
    if(message.includes(''))
    {
    var text = message.split(" ").pop();
    if(text == 'chucknorris')
    {
    getAPIData();
    }
    }
    Basically it first checks for the existence of the bot ID and then it simply splits the string to get the text that triggers the bot. This ensures that your api data call is only triggered when using the bot.
    A great starter tutorial to get the ball rolling for project.

  • @joelgreek
    @joelgreek 5 ปีที่แล้ว +1

    Awesome video! If you want the bot to post messages with the profile picture you add in the slack-api instead of an emoji, you can add:
    as_user: true
    inside the 'const: params:'- curly brackets instead of 'icon_emoji'. When 'as_user' is set to 'true', the bot will post as a user instead of as a bot.
    Thank you for this video!

  • @justinmathews6630
    @justinmathews6630 6 ปีที่แล้ว

    This is one of the first tutorials I did that actually worked! I didn't have to modify anything or troubleshoot your code, it just worked. Well done sir and I'll be using this to get started with a custom Jenkins Slack Bot. Thanks!

  • @cathymurry4331
    @cathymurry4331 5 ปีที่แล้ว

    Learning to work with technology helped me to get a better understanding of how people are working and reacting to each other. I recommend Slack plugins like Moodbit that sends me regular reports on the team’s emotion through emotion-sensing AI technology.
    It's really helpful to detect the problem immediately and work on it rather than wait until the survey that comes once a year.

  • @ben.thornhill
    @ben.thornhill 5 ปีที่แล้ว

    Brad, you should start a weekly podcast. Your content is the best and I love your down-to-earth approach to learning.

  • @onakoyakorede
    @onakoyakorede 6 ปีที่แล้ว

    Hey brad, saying your videos are good is an understatement. I'm already attached to your addictive videos. You're just too awesome. I don't know if i'm in a position to actually request for videos but i was wondering if you could make something on bootstrap-vue. Regardless you make them or not i still find your contents fascinating. Good Job!!!

  • @greenmansession
    @greenmansession 4 ปีที่แล้ว +3

    Hi Brad, Slack has made some major changes to it's API and App features. Can you create an updated tutorial covering this please?

  • @wellingtonchanda4067
    @wellingtonchanda4067 6 ปีที่แล้ว +4

    Hey Traversy can you please do a video on how best we can keep a user activity data ( history log )

  • @vincesanchez7790
    @vincesanchez7790 6 ปีที่แล้ว +5

    i enrolled in your course on udemy Brad all of them :)

  • @burhankalu2682
    @burhankalu2682 6 ปีที่แล้ว +3

    I downloaded your css and html5 tutorials bro all i can say is thanks for making life easy ❤.

  • @liveandlearn1702
    @liveandlearn1702 6 ปีที่แล้ว +1

    OMG such an wesome tutorial, you're a great teacher, thanks for sharing! Do you know if it is technically possible to have the bot *respond to the user as a thread* as opposed to inline right below the query? My idea would bring up a nice bit of content and don't want to clutter the main chat...

  • @zaryabbaloch5266
    @zaryabbaloch5266 4 ปีที่แล้ว +1

    Thanks alot for this wonderful tutorial, only question is that it is implementable in classical slack app (depreciated now), can you please do another with new slack app

  • @irwinpalomo7212
    @irwinpalomo7212 6 ปีที่แล้ว +7

    God bless you Brad.

  • @RagavanRajanrahav
    @RagavanRajanrahav 6 ปีที่แล้ว

    so cool. first time experiencing my slackbot is responding. Thanks Brad for this brilliant tutorial!!

  • @johnday941
    @johnday941 6 ปีที่แล้ว +1

    Come up with the more complicated bot, like Dialogflow + slack

  • @ZeeshanTamboli
    @ZeeshanTamboli 6 ปีที่แล้ว

    This is so cool! I use Slack everyday at my work and I love it.

  • @matthewtetley7048
    @matthewtetley7048 6 ปีที่แล้ว

    I'm guessing you could make a bunch of cases and use them in this type of bot and have the bot run many if it got selected @Traversy Media

  • @SuprunAlexey
    @SuprunAlexey 6 ปีที่แล้ว +8

    Wooow, really-really nice 👍🏻 I like your videos!

  • @nithin_satheesan
    @nithin_satheesan 5 ปีที่แล้ว

    Clear and concise. Well done!

  • @apurvsawant5703
    @apurvsawant5703 3 ปีที่แล้ว

    Thank you for such simple explaination.

  • @ThePedroGF
    @ThePedroGF 6 ปีที่แล้ว

    The feedback for the jokes was the best :) Nice content!

  • @Udodelig1
    @Udodelig1 6 ปีที่แล้ว

    You are the best teacher! Would love to see you make an NGXS tutorial!

  • @niccubagonoc9907
    @niccubagonoc9907 6 ปีที่แล้ว

    Great tutorial Brad! Can you do your next tutorial on multiple user roles using Passport's local strategy? That would be a really awesome tutorial (since there's nothing about it here on youtube)

  • @tridvaenazdaj
    @tridvaenazdaj 5 ปีที่แล้ว

    Hi Brad. Thanks for great tutorials here and on Udemy. I'm not a slack user but I'd love to see how you build a twitter bot someday in the future. The one that grabs data from some other API and tweet that data. I wonder how CSS-trick twitter bot works when automatically post every new article published on their website.

  • @davecoder7118
    @davecoder7118 6 ปีที่แล้ว

    So, why does the datatype matter in `if(rand === 1)`? If it's string '1' or boolean true, it should evaluate to false? That makes no sense in this context.

  • @shariatpurorg9148
    @shariatpurorg9148 6 ปีที่แล้ว

    Found it super helpful. Thank you!!!
    Wondering if you can do another simple video from scratch building slash command bot example for Slack.

  • @kennymoreno5735
    @kennymoreno5735 6 ปีที่แล้ว

    ''It seems someone stole yor Boston cap, I swear wasn't me'' Thanks Brad :)

  • @Chandasouk
    @Chandasouk 6 ปีที่แล้ว

    You ever get into chatbots? I messed around with Microsoft Bot Framework a while back but didn't get too far in it.

  • @nikhilgoyal007
    @nikhilgoyal007 6 ปีที่แล้ว

    thanks much, very helpful! died laughing at the wooly mammoth joke)

  • @estongreub1796
    @estongreub1796 ปีที่แล้ว

    To do this do you have to have the Enterprise plan of Slack?

  • @akashrajpurohit97
    @akashrajpurohit97 6 ปีที่แล้ว

    Another amazing video Brad..Can you tell me what's your code editor theme in VsCode?

  • @Lampgram
    @Lampgram 6 ปีที่แล้ว +3

    Firstly got it on Instagram, then finally here

  • @qcmira2024
    @qcmira2024 4 ปีที่แล้ว

    As always, awesome tutorial ! Thanks Brad !

  • @utkarshdubey8641
    @utkarshdubey8641 6 ปีที่แล้ว +20

    Finally a bot. Looling for a discord bot too

    • @TraversyMedia
      @TraversyMedia  6 ปีที่แล้ว +15

      Already looking into it :)

    • @utkarshdubey8641
      @utkarshdubey8641 6 ปีที่แล้ว +1

      Nice, but there is a request. Please try to make it in Python. Discord.py as it offers more functionality.
      Anyways glad you replied to me.

    • @ARCtrooper98
      @ARCtrooper98 6 ปีที่แล้ว

      +1 Support this, looking forward for a discord bot using Discord.py

    • @satyajeetkumarjha1482
      @satyajeetkumarjha1482 6 ปีที่แล้ว

      Traversy Media hey brad I am waiting for your react course on udemy .

    • @TaelurAlexis
      @TaelurAlexis 6 ปีที่แล้ว

      Jeez lol

  • @webdeveloperify
    @webdeveloperify 4 ปีที่แล้ว

    Hi Travis, love to see each of your tutorials. Is it possible to create some tutorials for developing bot in Microsoft Teams?

  • @srdjagunjic
    @srdjagunjic 6 ปีที่แล้ว

    Keep it up with these Nodejs tutorials! Thanks!

  • @muhammadhamzaasif2128
    @muhammadhamzaasif2128 6 ปีที่แล้ว

    Really Awesome
    Please make a video on MEAN stack using latest trends, techniques and technologies of MEAN stack

  • @VukotaDjLewu95
    @VukotaDjLewu95 4 ปีที่แล้ว +2

    Please help. I can't add a bot. When I create a workspace and my app and when I click on the Bots field then send me to HomePage. I really don't know why.

    • @kevinsulatra2661
      @kevinsulatra2661 4 ปีที่แล้ว

      Do you have permission to add bot? Maybe you need to request it before you can install a bot.

    • @VukotaDjLewu95
      @VukotaDjLewu95 4 ปีที่แล้ว

      i finished before 3 months :D

  • @acidfire980
    @acidfire980 4 ปีที่แล้ว

    Quite helpful. Especially the token bit. haha For real.

  • @Juanmv05
    @Juanmv05 6 ปีที่แล้ว

    My favorite teacher ! Do something with NativeScript ! :D

  • @DC-no9kw
    @DC-no9kw 4 ปีที่แล้ว +2

    when I try to run it it shows me not_allowed_tocken_type do you know how I can fix it?

    • @david43454
      @david43454 4 ปีที่แล้ว

      Did you find a fix? I am having the same issue

    • @mayemami8057
      @mayemami8057 4 ปีที่แล้ว

      @@david43454 Did you resolve this issue, I am facing the same issue

    • @matthewspach
      @matthewspach 3 ปีที่แล้ว

      same for me. I tried to debug in several ways, no luck

  • @sairammuthineni9796
    @sairammuthineni9796 6 ปีที่แล้ว

    Hey brad. As usual very informative content. Can you please make a video on chatbot for websites?

  • @HordeonSC2
    @HordeonSC2 6 ปีที่แล้ว

    Could you please make a series:
    Symfony 3 from scratch to deployment. (Or just the deployment part of it, that would really help me)

  • @songcham.moingay
    @songcham.moingay 6 ปีที่แล้ว

    Thank you Brad. What theme did you use in your VS code?

  • @annez8598
    @annez8598 6 ปีที่แล้ว

    It is a fun learning experience to follow your tutorials such as this one. It would be great if you could teach us how to host the bot. Many Thanks!

    • @siddhantshukla8463
      @siddhantshukla8463 ปีที่แล้ว

      Have you figured it out how to host such bots?

  • @januszszubert7469
    @januszszubert7469 5 ปีที่แล้ว +1

    Thank you for this awesome tutorial!!

  • @lightninginmyhands4878
    @lightninginmyhands4878 5 ปีที่แล้ว

    This is great. Hoping to find one build in Python.

  • @Khalyomede
    @Khalyomede 6 ปีที่แล้ว

    Thank you for this great tutorial, appreciated it a lot! Did you plan on making a Facebook Bot tutorial in a next video?

  • @juliencolombain7440
    @juliencolombain7440 4 ปีที่แล้ว

    Very nice video thank you Brad. Does anyone know to host your slackbot on heroku?

  • @albertograu3318
    @albertograu3318 6 ปีที่แล้ว

    You are an awesome teacher. Thanks for the great content!

  • @rocktimsaikia1394
    @rocktimsaikia1394 6 ปีที่แล้ว

    Awesome man.Huge admirer . Love your videos.Anyway could you make a tutorial on creating a twitter bot using Javascript and other JS frameworks. ? It would be great help if you could do that.

  • @KevinMarchese
    @KevinMarchese 5 ปีที่แล้ว

    I love the way you explain things! thank you for the video. Can you have multiable bots users for one app? I don't think so.

  • @George-yd1ns
    @George-yd1ns 6 ปีที่แล้ว

    What're your thoughts on GitHub bring bought by Microsoft?

  • @buiductai489
    @buiductai489 6 ปีที่แล้ว

    Hi Brad, can you make a video about chatbot messenger using Nodejs, I am really excited. By the way, your video is very useful

  • @charlesbovalis6591
    @charlesbovalis6591 5 ปีที่แล้ว

    Brad - do you have a video on how to send a message to a slack-channel using a slack-bot and Python ?

  • @codecorner131
    @codecorner131 6 ปีที่แล้ว

    Simple ans clear 👍 you are a great man Brad.

  • @rahulr4667
    @rahulr4667 6 ปีที่แล้ว

    This time without a hat buddy.. grt8..

  • @89serge
    @89serge 6 ปีที่แล้ว

    Can you invoke the /poll command using postMessageToChannel?

  • @adriansun2999
    @adriansun2999 6 ปีที่แล้ว

    Great video - more, please!

  • @fabrytomas
    @fabrytomas 5 ปีที่แล้ว

    Really nice tutorial! Thanks!

  • @markadell
    @markadell 6 ปีที่แล้ว

    Really nice thank you! Could you do a video about Lumen - PHP Micro-Framework? :)

  • @Saywhatohno
    @Saywhatohno 3 ปีที่แล้ว

    is there a way to create a slackbot which controls adobe license so if anyone wants to sign into adobe apps they can sign out a license from slackbot and do it that way?

  • @doriomer
    @doriomer 6 ปีที่แล้ว

    Can i use this tutorial also to make a TelegramBot in nodeJs? is it the same principles?
    I'm a new php developer - should i build bots in PHP or NodeJS, what is better?
    thank you for your time reading my msg.

  • @milosmik
    @milosmik 6 ปีที่แล้ว

    What is your think about selling GitHub?

  • @raisshaikh259
    @raisshaikh259 6 ปีที่แล้ว

    My favorite youtuber

  • @ajishjoy3778
    @ajishjoy3778 2 ปีที่แล้ว

    Hey thanks for the video, Can you please help me resolve the error , as I am getting one while doing the npm start. It is throwing from vow\lib\vow.js:105
    throw e;
    Error: not_allowed_token_type

  • @sanchithaseshadri2166
    @sanchithaseshadri2166 5 ปีที่แล้ว +1

    This is amazing, thanks a ton! You're awesome

  • @davecoder7118
    @davecoder7118 6 ปีที่แล้ว

    What's the point of the second = in `data.type !== 'message'`? 'message' will never be any other data type besides a string...

  • @vijayu707
    @vijayu707 6 ปีที่แล้ว

    Good video. Thanks, Brad.

  • @HumbleDorg
    @HumbleDorg 5 ปีที่แล้ว

    Hello sir,
    Thank you for this tutorial.
    I have an issue : when i do a handle function with a condition with includes, it just spams the channel like a loop
    function handleMessage(text) {
    if (text.includes(' php')) {
    params = {
    q: 'php'
    };

    bot.postMessageToChannel(
    'général',
    `you wrote php`
    );
    }
    }

  • @DonHaul
    @DonHaul 6 ปีที่แล้ว

    When I deploy it to heroku it doenst, work. Is this implementation really possible to run on heroku?
    On their site, they configure it using incoming web hooks

  • @shelletonianhuman
    @shelletonianhuman 6 ปีที่แล้ว

    I hosted my bot on glitch i think it's a great place To host IT its Also pretty easy to host IT on glitch

  • @souvikpodder7187
    @souvikpodder7187 5 ปีที่แล้ว

    Error: connect ETIMEDOUT 52.222.189.82:443 I am getting this error when i am starting the node app.

  • @ashutoshsenger9266
    @ashutoshsenger9266 6 ปีที่แล้ว

    hey Brad.im getting error as message.includes is not a function.pls help me

  • @the_thinker8
    @the_thinker8 4 ปีที่แล้ว

    Hi @Traversary Media great video man. Can you let me know how to host it on heroku? I had tried it to host but it did not responded.

  • @satyajeetkumarjha1482
    @satyajeetkumarjha1482 6 ปีที่แล้ว

    hey,
    i have taken your mern stack course and there is one small mistake at one part where you ask users to enter skills which is basically an array and you have used a validator to check if it is correct or not but validator checks only the strings and not arrays.Please correct that thing in your course and code.

    • @satyajeetkumarjha1482
      @satyajeetkumarjha1482 6 ปีที่แล้ว

      Florian Suess oh yes I do take part in Q&A of the course and it is the best couress that I have taken on udemy .

  • @gowthams8340
    @gowthams8340 6 ปีที่แล้ว

    Really amazing Brad !

  • @TheCodebookInc
    @TheCodebookInc 6 ปีที่แล้ว

    Can you add voice recognition system in which it hears and responds in voice

  • @goodxg1
    @goodxg1 4 ปีที่แล้ว

    does this still work for people? i was able to get it to work. kept saying authorization code error. I made sure it was the authorization one.
    will this work the same for slash commands?

  • @mspanhaak
    @mspanhaak 5 ปีที่แล้ว

    This was an awesome tutorial! Thanks a lot :-)

  • @michamazurkiewicz80
    @michamazurkiewicz80 4 ปีที่แล้ว

    I am getting warn (deprecaterd request@2.88.2) during npm i slackbots and then when try node start it doesnt work. How can i solve it :(

  • @christophermartinez1769
    @christophermartinez1769 6 ปีที่แล้ว

    HELP!!!
    Did anyone got this error?:
    " TypeError: Cannot read property 'includes' of undefined "
    At line 37:
    function handleMessage(message) {
    if (message.includes(' chucknorris')) {
    chuckJoke();
    } else if (message.includes(' yomama')) {
    yoMamaJoke();
    } else if (message.includes(' random')) {
    randomJoke();
    } else if (message.includes(' help')) {
    runHelp();
    }
    }
    HELP!

  • @nonikita
    @nonikita 4 ปีที่แล้ว

    Can you do a version for 2020 with Python ?

  • @yoemasey
    @yoemasey 4 ปีที่แล้ว

    You are the best!!! Thank you so much for your tutorial!!!

    • @MrFatlius
      @MrFatlius 4 ปีที่แล้ว

      hi, have u face the error of " not allow token type"? how will u fix it?

    • @yoemasey
      @yoemasey 4 ปีที่แล้ว

      Hokwan Liu sorrry for the late reply. I did not get any error.

    • @quangkhanhchu3022
      @quangkhanhchu3022 4 ปีที่แล้ว

      @@MrFatlius i got the same error as your, do you have any solution for that?

    • @zaryabbaloch5266
      @zaryabbaloch5266 4 ปีที่แล้ว

      @@quangkhanhchu3022 for the previous version of slackbot you could follow this tutorial, new versions dont support this library

  • @bizzle98
    @bizzle98 6 ปีที่แล้ว +1

    Please... please do a playlist on creating a responsive wordpress theme *NOT A BUSINESS THEME* because that's all that's out there on youtube. Was hoping for a how to create a Newspaper magazine or an editorial/news theme from *SCRATCH* all tutorials out there are not actually coding it

  • @carlos.arenas
    @carlos.arenas 6 ปีที่แล้ว

    You are the man! Thanks!

  • @Timvoortaal
    @Timvoortaal 5 ปีที่แล้ว

    what program do you use there for the syntax editing?

    • @Matt-ft5xi
      @Matt-ft5xi 5 ปีที่แล้ว

      It is called vscode by Microsoft

  • @janosmarta8258
    @janosmarta8258 6 ปีที่แล้ว

    I like to see your hair sensei, its a new perspective from you, thx your great insirational works!:))

    • @TraversyMedia
      @TraversyMedia  6 ปีที่แล้ว

      Haha, I didn't even realize that. I don't think I have ever not wore a hat in a video. Usually I am just too lazy to throw gel in my hair :)

    • @janosmarta8258
      @janosmarta8258 6 ปีที่แล้ว +1

      Traversy Media It was just a surprise, anyway I like your bigB caps, I am a celtic fan so its reasonable :D
      I am doing the edX.org PennX webprogrammer course.JS, jQuery, React and Node.js their line where we advance, I am very eager for these languages and frameworks, maybe once in future I will understand prototype function mechanisms too.
      Can you take a look on it and tell your magical words about it?:)
      courses.edx.org/courses/course-v1:PennX+SD4x+2T2017/course/

  • @kimfucku8074
    @kimfucku8074 5 ปีที่แล้ว

    You got a like for being a practical programer!!

  • @judahdsouza6168
    @judahdsouza6168 2 ปีที่แล้ว +1

    The steps in this tutorial no longer work due to a change in the slackbot library, follow TechnoTim's video instead.

  • @puptiz1
    @puptiz1 5 ปีที่แล้ว

    great tutorial ! thanks !!!

  • @jyotsnasingh3198
    @jyotsnasingh3198 3 ปีที่แล้ว

    Can e build an app/bot to message users on DM?

  • @deepakkoirala1237
    @deepakkoirala1237 6 ปีที่แล้ว

    Great video, thanks

  • @abrahamemmanuel4906
    @abrahamemmanuel4906 6 ปีที่แล้ว

    Love from Lagos NG 😘

  • @jomarmilan6215
    @jomarmilan6215 4 ปีที่แล้ว

    Help, there is no Add a bot user button

  • @leopng
    @leopng 6 ปีที่แล้ว

    Awesome ! Thanks a lot

  • @APURVAWORLD
    @APURVAWORLD 4 ปีที่แล้ว +1

    Slack has got some latest changes after which you will get an error - 'not allowed token type'.
    Please follow this github.com/slackapi/hubot-slack/issues/584 for fix.

  • @pavankumarr7089
    @pavankumarr7089 5 ปีที่แล้ว

    Nice can you do it in PHP