GithubHelp home page GithubHelp logo

waanimals-slack-docbot's Introduction

WA Animals DocBot

General purpose SlackBot for WA Animals

Slack Setup

Create secret from the slack_signing_secret

aws ssm put-parameter \
  --name waanimals_slack_signing_secret \
  --type String \
  --value XXXXXXXXXXXXXXXXXXXXXXXX

Create a secret for the Animals in care sheet ID

aws ssm put-parameter \
  --name waanimals_gcloud_sheet_animals \
  --type String \
  --value XXXXXXXXXXXXXXXXXXXXXXXX

Google Sheets API Setup

Follow the guide here and put the credentials file in docbot/utils/gauth.json

Testing

serverless offline start --stage=test
curl -X POST \
  http://localhost:3000 \
  -H 'Content-Type: application/json' \
  -d 'token=XXXXXXXXXXXXXXXXXXXXXXXXXX&team_id=TL00AB204&team_domain=waanimals&channel_id=GL8LA7DUP&channel_name=privategroup&user_id=UL0UV78CU&user_name=nathan&command=%2Fmicrochip&text=Testing&response_url=https%3A%2F%2Fhooks.slack.com%2Fcommands%2XXXXXXXXXXXXXXXXXXXXXXXXXX%2XXXXXXXXXXXXXXXXXXXXXXXXXX&trigger_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

Deploy

serverless deploy --stage=dev

Assume Role

response=$(aws sts assume-role --role-arn arn:aws:iam::XXXXXXXXXXXX:role/SandboxDev --role-session-name "Serverless")

# Set Variables
export AWS_ACCESS_KEY_ID=$(echo $response | jq -r '.Credentials.AccessKeyId')
export AWS_SECRET_ACCESS_KEY=$(echo $response | jq -r '.Credentials.SecretAccessKey')
export AWS_SESSION_TOKEN=$(echo ${response} | jq -r '.Credentials.SessionToken')

waanimals-slack-docbot's People

Contributors

t04glovern avatar

Watchers

James Cloos 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.