Giter VIP home page Giter VIP logo

troi-slack-bot's Introduction

๐Ÿค– โณ BleibTroy

Slack bot to help you fill out Troi. Uses the Bolt framework and the troi-library to talk with the Troi API.

๐Ÿ‘‰ Also check out our other self-built clients for Troi: Achill and troi-cli.

Setup the Slack app at api.slack.com

The following steps for setting up the Slack app are adapted from this tutorial. You need admin rights in your Slack workspace.

  • Create New App on api.slack.com/apps --> From scratch
  • On the Basic Information page you land, the Signing Secret under App Credentials is the SIGNING_SECRET we need
  • OAuth & Permissions --> Bot Token Scopes --> click Add an OAuth Scope --> chat:write, im:history, users:read, users:read.email
  • Scroll up to OAuth Tokens for Your Workspace and click Install to Workspace
  • After that, a Bot User OAuth Token gets generated, that's the BOT_USER_OAUTH_TOKEN we need
  • Under Socket Mode (left sidebar) turn on Enable Socket Mode, here you create the SOCKET_MODE_TOKEN
  • Under Event Subscriptions (left sidebar) turn on Enable Events and add the Bot User Events message.im
  • Under App Home (left sidebar) show bot as always online if you want to and set the checkmark below the turned on Messages Tab to active
  • Under App Manifest (left sidebar) set messages_tab_enabled to true (as seen here) --> Save Changes
  • If you make changes to scopes/permissions etc., reinstall the your app to the Workspace (under Basic Information, Install your app)

Setup the code locally

npm i

Create ./config.json:

{
  "TROI_API_URL": "",
  "TROI_CLIENT_NAME": "",
  "TROI_USERNAME": "",
  "TROI_PASSWORD": "",
  "SLACK_BOT_USER_OAUTH_TOKEN": "",
  "SLACK_SIGNING_SECRET": "",
  "SLACK_SOCKET_MODE_TOKEN": "",
  "GOOGLE_SHEETS_API_KEY": "",
  "GOOGLE_SHEET_TROI_SAYINGS_ID": ""
}

Run

npm start

troi-slack-bot's People

Contributors

benjaminaaron avatar hendrikschmidt avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

troi-slack-bot's Issues

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.