This bot can make HUE attendance from slack slash command.
This bot runs as a web app within a Google app script.
You can make this bot work by registering it as a request URL for the Slack API slash command.
To use it, you need to set up Google apps scripts, and Slack API.
- Enable Google Apps Script API
https://script.google.com/home/usersettings - Clone this repository to your local machine.
- Run
make push
to install the dependencies and the necessary libraries, authenticate with Google, create a new GAS project and upload the code. - Run
make deploy
to deploy the project as a web app.
The first time you publish it as a web application, you will need to authorize it, so please follow the steps below. Open the script editor. (make open
)
Click Deploy > New deployment.
Select Web app as the deployment type.
Choose who can access your web app and who will execute it.
Click Deploy.
For more information, please refer to the official Google documentation.
https://developers.google.com/apps-script/concepts/deployments - Run
make application
to open the deployed web app in your browser. Follow the instructions on the web app to install the Slack app and perform OAuth authentication. The web app will automatically upload the App manifest to Slack and configure the necessary settings for you.
- Create New App
https://api.slack.com/apps
Please make a note ofApp Credentials
displayed after registration.
In order to run the application and change its behavior, you need to set the following Google Apps scripts property.
Property name | Required | Setting Value | Description |
---|---|---|---|
WORKS_DOMAIN | ○ | ex) lwi0.hue.worksap.com , lwi0-cws.company.works-hi.com |
Specify a domain for the the HUE MOBILE login URL. |
WORKS_PROXY_DOMAIN | ○ | ex) miserarenaiyo.netlify.app |
Specify the URL where you deployed works-kintai-slask-command-netlify-functions |
START_REACTION | optional | defalut: sunny (:sunny:) | Set the reaction emoji for Mentored Attendance messages. |
END_REACTION | optional | defalut: confetti_ball (:confetti_ball:) | Set the reaction emoji for Mentored off messages. |
- Open Project
$ make open
- Add Scirpt properties
File > Project properties > Scirpt properties > Add row
Setting Property & Value
The usage of this bot is as follows.
- Invite bots to your channel (e.g. /invite @hue-kintai-bot)
- Register works authentication
Enter your user ID and password in the dialog that appears after executing the following slash command.
/kintai config
- Begin or end attendance
You can send a message with a mentions or use the slash command to register your attendance.
- When you go to work with a message with a Mention
@hue-kintai-bot おはようございます。出勤します
- If you use the slash command to go to work
/kintai start