🚩 Honyaku Flag
A Slack app that translates a message when an emoji reaction added to the message. Inspired by reacjilator.
🤖 Set up the app
- Create the new app.
- Subscribe to workspace events (Add
reaction_addedevent and subscribe url to be notified of events).
- Add permission scopes by reference to the following list.
channels:historyAccess user’s public channels
channels:readAccess information about user’s public channels
reactions:readAccess the workspace’s emoji reaction history
Install the app to the workspace and note
OAuth Access Token,
Bot User OAuth Access Tokenand
Create the Google Cloud Translation API by reference to the following page.
- Rename the
.envand add credentials.
SLACK_BOT_TOKEN=<Bot User OAuth Access Token> SLACK_OAUTH_TOKEN=<OAuth Access Token> SLACK_SIGNING_SECRET=<Signing Secret> TRANSLATION_API_TOKEN=<Google Cloud Translation API Token>
If you want to run the app only on the channel which the app was invited, you need to add
Add a permission scope:
users:readAccess your workspace’s profile information
SLACK_USER_ID by reference to the following page (Select the workspace which the app was installed and input
SLACK_BOT_TOKEN as a token).
Subscribe locally events from Slack
Set up to subscribe locally events by reference to the following page.
Add the URL of
Request URL with Event Subscriptions page in Slack (Concatenate the URL of
Forwarding to the path
$ ngrok http 8080 ngrok by @inconshreveable (Ctrl+C to quit) Session Status online Session Expires 7 hours, 47 minutes Update update available (version 2.3.34, Ctrl-U to update Version 2.2.8 Region United States (us) Web Interface http://127.0.0.1:4040 Forwarding http://foobar.ngrok.io -> localhost:3000 Forwarding https://foobar.ngrok.io -> localhost:3000
Run the app
$ npm install $ npm run dev