Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 1.43 KB

README.md

File metadata and controls

42 lines (34 loc) · 1.43 KB

Statusbot

Programmatically update your Slack status


Setup

Slack

  1. Create a legacy slack token here.

    (You'll need this info later)

  2. Create a new app in slack here.

    1. Go to oAuth & Permissions
    2. Add a scope for modifying user profiles: users.profile.write
    3. Install the app to your workspace

AWS

  1. Create a new user in IAM
    1. Grant the user admin access

    2. Create an access key

    3. Download the .csv

      (you'll need this info in the next step)

Serverless

  1. If not already installed, run npm i -g serverless in terminal

  2. Then run:

    serverless config credentials --provider aws --key <<KEY FROM CSV>> --secret <<SECRET FROM CSV>>

  3. Afterward cd into the statusbot directory then run: npm init; npm i;

  4. Finally run: serverless deploy to deploy the lambda to AWS

You can now use the provided endpoint to make POST requests (Body JSON required- see below).


Usage

IFTTT

If This Than That is an extremely flexible way to trigger the lamba.

  1. You can use any trigger for the 'This'. (I used the Location trigger)

  2. Use Webhooks for the 'That'

  3. Enter your endpoint url

  4. Switch the mime type to POST

  5. Input the following json in the body:

    { "token": <<LEGACY SLACK TOKEN>>", "profile": {"status_text":"In the office","status_emoji":":office:"} }