2023. 11. 28. 23:27ㆍDataEngineer
Slack에서 버튼식 알림을 주고 버튼 Value를 사용해 어떤 일을 처리 할 수 있는 방법이 없을까? 찾아보다가 Slack에서 제공하는 Slack bolt 라이브러리를 찾았다
깃허브 주소 : https://github.com/SlackAPI/bolt-python
GitHub - slackapi/bolt-python: A framework to build Slack apps using Python
A framework to build Slack apps using Python. Contribute to slackapi/bolt-python development by creating an account on GitHub.
github.com
Docs 주소 : https://slack.dev/bolt-python/concepts
Slack | Bolt for Python
Slack apps installed on multiple workspaces will need to implement OAuth, then store installation information (like access tokens) securely. By providing client_id, client_secret, scopes, installation_store, and state_store when initializing App, Bolt for
slack.dev
Slack Bolt를 사용하기 전 먼저 Slack 앱을 만들어줘야한다!
Slack 앱 만들기
https://api.slack.com/apps 홈페이지에 들어가고 Create New App을 눌러주고 From scratch로 App을 생성
Basic Information에서 Signing Secret을 따로 복사해둔다
OAuth & Permissions 에서 원하는 Scope를 불러내고 install to Workspace로 Bot User OAuth Token을 얻어낸다
밑의 Request URL에 ngrok을 이용한 주소나 서버 주소를 입력하고 뒤에 꼭 /slack/events를 붙여줘야한다 ( 단, scoket mode를 사용할 경우 필요 없음 )
여기까지가 Slack Bolt를 사용하기 위한 세팅
'DataEngineer' 카테고리의 다른 글
특정 GPU만 사용하기 (0) | 2023.11.07 |
---|