Skip to content

masa-08/bot-stepn

Repository files navigation

bot-stepn

The Slack BOT program to keep track of STEPN.

It analyzes the following images and records the GST earned or used in the game in a Google Spreadsheet.

  • Results screen after walking
  • Screenshot of shoe level up
  • Screenshot of Shoe repair

Preparation

Prepare accounts for the following services

Preparation for Heroku

  1. Create an application and get URL of this application

Preparation for Slack

  1. Create a channel for BOT
  2. Prepare a bot token and a signing secret and keep them on hand (ref)
  3. Enable events(ref)
  4. Set the URL prepared by preparation for Heroku
  5. Add message.channels to subscribe event
  6. Add the application prepared in steps 2~5 to the channel created in step 1

Preparation for GCP

  1. Activate Cloud vision API
  2. Prepare a service account to access Cloud vision API and download the service account key
  3. Activate Google Sheets API and Google Drive API
  4. Create a new Google Spreadsheet and note the sheet ID.

Preparation for Heroku again

  1. Set environment variables on the app's dashboard. Set the following environment variables, referring to .env.sample
    1. SLACK_SIGNING_SECRET: Signing Secret prepared in preparation for Slack
    2. SLACK_BOT_TOKEN: Bot token prepared by Slack
    3. GOOGLE_SHEET_ID: ID of Google Spreadsheet prepared by GCP
    4. GOOGLE_CREDENTIALS: Copy and paste the contents of the service account key downloaded in preparation for GCP.
  2. Deploy this app to heroku

Usage

Record GST earned by walking

Post the results screen to the Slack channel after the walk.

result

Record GST spent repairing shoes

Take the following screenshot and post it to Slack

repair

Record GST consumed by leveling up shoes

Take the following screenshot and post it to Slack

levelup

About

STEPN用のBOT

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published