Coder Social home page Coder Social logo

emojibot's Introduction

Emojibot

Learning AWS Lambda on Node.js.

Getting started

  • Create an AWS account if haven't got one already

  • Install Serverless and configure your AWS credentials

  • Create your Slack app and configure its credentials by creating a local.yml file:

     # Local variables -- DO NOT COMMIT!
     
     dev:
       slack:
         clientId: "<Your Dev Slack App Client ID>"
         clientSecret: <Your Dev Slack App Client Secret>
     
     production:
       slack:
         clientId: "<Your Production Slack App Client ID>"
         clientSecret: <Your Production Slack App Client Secret>
    

    Note that the client id must be quoted otherwise it is interpreted as a number. Do not commit this file. It is already Git ignored.

  • Deploy the server to AWS Lambda:

     npm install
     serverless deploy
    

    Make a note of the endpoints output once it has deployed, e.g.:

     endpoints:
       GET - https://ab12cd34ef.execute-api.eu-west-1.amazonaws.com/dev/install
       GET - https://ab12cd34ef.execute-api.eu-west-1.amazonaws.com/dev/authorized
       POST - https://ab12cd34ef.execute-api.eu-west-1.amazonaws.com/dev/event
    
  • Go to your Slack app settings and update them to point to your server:

    • Select 'OAuth & Permissions' and under 'Redirect URLs' add the authorized endpoint
    • Select 'Event Subscriptions' and:
      • Turn on 'Enable Events'
      • In the 'Request URL' box paste the event endpoint
      • Under 'Subscribe to Bot Events' add bot user events for:
        • message.channels
        • message.groups
        • message.im
        • message.mpim
    • Select 'Bot Users' and add a bot user
  • Finally, install your Slack app by visiting your install endpoint and clicking the 'Add to Slack' button

See also

emojibot's People

Contributors

markhobson avatar sjwarner avatar sjwarner-bp avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.