Giter Club home page Giter Club logo

akashi-slack's Introduction

ak4-slack

test

TL;DR

  • Slackからslash commandでAKASHIに打刻するためのAPI

※AKASHIの従業員設定->利用機能設定から公開APIを「利用する」に設定する必要があります

Demo

demo

Deploy

Create SlackApp

  • SlackAppを作成する

  • OAuth & Permissions -> Scopes -> Bot Token Scopesから

    • chat:write

    • commands

    • channels:join(打刻の通知先を設定しない場合は不要) をそれぞれ追加し、ワークスペースにAppをインストールする bot user scopes

Deploy to Heroku

Deploy

set conf vars

  • 環境変数を追加してデプロイする
    • AKASHI_COMPANY_ID: ログイン時に入力するAKASHIの企業ID
    • SLACK_BOT_TOKEN: 作成したSlackAppのBot User Token

bot user token

  • SLACK_CHANNEL_ID: 打刻を通知したいチャンネル(e.g. 勤怠報告チャンネルなど、設定しない場合通知されません)
  • SLACK_SIGNING_SECRET: リクエストの署名に使われる文字列

app credentials

  • Heroku Schedulerに以下のjobを追加する
    • curl https://[your-app-name].herokuapp.com/(Frequency: Every 10 minutes)
    • python refresh_user_tokens.py(Frequency: Daily at 6:00 PM UTC)

Set Up SlackApp

  • slash commandsの設定
    • slash commandを追加してrequest urlを設定する(パスは/slash)

slach command 1 slash command 2

  • interactivity
    • interactivity & shortcutsを設定する(パスは/actions

interactivity

Environment Veriables

  • AKASHI_COMPANY_ID
  • SLACK_BOT_TOKEN
  • SLACK_SIGNING_SECRET
  • DATABASE_URL
  • SLACK_CHANNEL_ID(optional)

Requirements

  • Python3.9+
  • Pipenv

Development

Installation

  • pipenv install --dev

Pipenv scripts

  • pipenv run start run local server

  • pipenv run sort run isort

  • pipenv run test-cov run tests

License

MIT

akashi-slack's People

Contributors

tfuji384 avatar dependabot[bot] avatar t2nagi 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.