Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Build your Chatbots like Rails Apps

Build your Chatbots like Rails Apps

Chat platforms are continuing to grow at an accelerated pace as product owners are expanding their services to chat. “Be where your users are” is a motto that many companies are practicing and chat is one of those platforms where it makes it easier for users to use these services.

As the chat platform expands, the availability of libraries, examples, and experience around these platforms is slow to catch up. Frameworks like Rails and Laravel help developers get their services onto the web in record speed but these types of frameworks do not exist for chat platforms. That lack of availability can leave chat developers to re-invent the common capabilities which slows down development on the chat platforms.

Why can’t we develop for chat platforms like we do for the web or for mobile? Why can’t we get further away from the metal and build more rapidly for these platforms.

I spend most of my days building for chat platforms and I feel like these libraries should exist. In fact, I have built several versions of these libraries and I want to share the knowledge I have gained.

In this session, we will look at how these chat platforms, Slack in particular, work and how we can take advantage of concepts we learned building traditional web applications and apply those to help build for chat platforms with less boiler plate code, less setup, and more familiarity. We will look at how we can build an MVC framework for chatbot platforms.

Jamie Wright

August 06, 2022
Tweet

More Decks by Jamie Wright

Other Decks in Programming

Transcript

  1. USER PLATFORM APP OPS CHANNEL /HELP { CHANNEL: ‘C1234’, USER:

    ‘U8324’, TEAM: ‘T4390’, MESSAGE: ‘/HELP’ } CHAT.POST_MESSAGE(‘HERE IS THE HELP YOU REQUESTED:’) OPS CHANNEL HERE IS THE HELP YOU REQUESTED:
  2. USER PLATFORM APP OPS CHANNEL /HELP { CHANNEL: ‘C1234’, USER:

    ‘U8324’, TEAM: ‘T4390’, MESSAGE: ‘/HELP’ } HOW SLACK WORKS
  3. ROUTER D E F I N E C O N

    F I G U R AT I O N
  4. ROUTER D E F I N E C O N

    F I G U R AT I O N
  5. ROUTER D E F I N E C O N

    F I G U R AT I O N
  6. ROUTER D E F I N E P L AT

    F O R M R O U T E R
  7. ROUTER D E F I N E P L AT

    F O R M R O U T E R
  8. ROUTER D E F I N E S L A

    C K R O U T E R
  9. ROUTER D E F I N E S L A

    C K R O U T E R
  10. ROUTER D E F I N E S L A

    C K A C T I O N R O U T E
  11. ROUTER D E F I N E S L A

    C K A C T I O N R O U T E
  12. MIDDLEWARE D E F I N I N G M

    I D D L E W A R E
  13. ROUTING A NICE BLACK BOX YOUR APP ROUTER CONTROLLERS TEMPLATES

    AUTHORIZATION LOW-LEVEL API PLATFORM LIBRARIES HIDE THE PLUMBING
  14. EVERYTHING HAS A PLACE VIEWS CONTROLLERS MODELS ROUTES > BUSINESS

    LOGIC > HANDLES PLATFORM REQUESTS > RUNS MIDDLEWARE > PASSES CONTEXT > CREATES CONTROLLER > RUNS ACTION > HANDLES REQUEST > PREPARES RESPONSE > RENDERS RESPONSE(S) > RETRIEVE DATA > UPDATE DATA > INTEGRATES DATA > PROVIDES RESPONSE
  15. EXTENSION POINTS USER REQUEST PLATFORM APP ROUTER FINDS ROUTE MIDDLEWARE

    IS RUN CONTROLLER IS CREATED ACTION IS CALLED TEMPLATE IS RENDERED RESPONSE IS SENT USER RESPONSE
  16. HARDER TO DEBUG > NOMETHODERROR: UNDEFINED METHOD `SHOW’ FOR NIL:NILCLASS

    > /.GEM/RUBY/3.1.0/GEMS/STRIPE-5.48.0/LIB/STRIPE/WEBHOOK.RB:104:IN `VERIFY_HEADER > /.GEM/RUBY/3.1.0/GEMS/JOURNEY-0.6.2/LIB/JOURNEY/CONTROLLER.RB:6:IN `SEND_ACTION' > /.GEM/RUBY/3.1.0/GEMS/JOURNEY-0.6.2/LIB/JOURNEY/ROUTER:34:IN `FIND_ROUTE’ > … > … > … > … > … > … > … C A L L S T A C K
  17. RANDOM ACCESS MEMORY USER CAN YOU SCHEDULE A MEETING? APP

    I SURE CAN. WITH WHOM? USER WITH TIM. APP GOT IT. WHEN? USER TOMORROW AT 2. APP DONE. I SCHEDULED A MEETING WITH TIM TOMORROW AT 2.
  18. RANDOM ACCESS MEMORY CAN YOU SCHEDULE A MEETING? USER CAN

    YOU SCHEDULE A MEETING WITH TIM TOMORROW AT 2? APP DONE. I SCHEDULED YOUR MEETING WITH TIM FOR TOMORROW AT 2. CAN YOU SCHEDULE A MEETING? USER ACTUALLY CAN YOU MAKE IT FOR 3? APP DONE. I RE-SCHEDULED IT FOR TOMORROW AT 3.
  19. DISCOVERABILITY T R A I N I N G W

    H E E L S ARE YOU READY FOR THE MEETING? YOU CAN REPLY WITH ‘Y’ES OR ’N’O. APP USER YES. MEETING SCHEDULED! DID YOU KNOW YOU CAN REQUEST A RESCHEDULE BY REPLYING ‘RE-SCHEDULE’? APP
  20. VALIDATION ANDY WANTS TO MEET WITH YOU TODAY AT 2.

    APP ARE YOU AVAILABLE? USER BLERG.
  21. VALIDATION I’M SORRY ‘BLERG’ IS NOT AN ANSWER. APP ACKNOWLEDGE

    THE RESPONSE 1. YOU CAN RESPOND ‘YES’ OR ‘NO’ APP PROVIDE CORRECT OPTIONS 2. ANDY WANTS TO MEET WITH YOU TODAY AT 2. APP ARE YOU AVAILABLE? RE-ASK THE QUESTION 3.
  22. SELECTION WHERE DO YOU WANT TO MEET MACKENZIE TONIGHT? APP

    USER 1. 1. COFFEE SHOP 2. RESTAURANT 3. BAR APP O P T I O N R E D U C T I O N
  23. SELECTION OK. WHICH COFFEE SHOP? APP O P T I

    O N R E D U C T I O N 1. CAFE JOE’S 2. STARBUCKS ON MAIN 3. PERKATORY APP
  24. RESPONSE SAMPLING YES APP OK APP CORRECT APP WRONG APP

    NOPE APP LOOKS GOOD APP 👍 APP ✌ APP THAT’S WHAT SHE SAID APP COOL APP