Skip to content

Translate Slack message with flag emoji(e.g. 🇯🇵 🇺🇸 🇬🇧) reaction. 😄 Use only AWS Products(AWS Lambda functions in Go, Amazon Comprehend, Amazon Translate)

License

Notifications You must be signed in to change notification settings

uchimanajet7/go-reacjilator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-reacjilator

Translate Slack message with flag emoji(e.g. 🇯🇵 🇺🇸 🇬🇧) reaction. 😄 Use only AWS Products(AWS Lambda functions in Go, Amazon Comprehend, Amazon Translate)

Description

This is implemented slack/reacjilator with AWS Products. (AWS Lambda functions in Go, Amazon Comprehend, Amazon Translate)

You can easily translate Slack messages with flag emojiflag emoji(e.g. 🇯🇵 🇺🇸 🇬🇧) reaction.

The translated messages is sent back to the thread, so it does not interfere with other conversations.

Features

  • It works easily as Slack bot.
  • Use only AWS Products.
  • Of course, even when using other translation API you can easily respond.
  • Since it is a serverless configuration, it is easy to build and deploy.

Requirement

Usage

Install this bot on "Slack".

If you react to the message with the emoji of the flag, this bot translate the original message and post it under the message thread.

However, whether it can be translated depends on the product used for translation.

Demo

2017-12-17 18_11_16

Installation

  1. Refer to the following document and install this bot in "Slack".

  2. If you build from source yourself.

$ go get github.com/uchimanajet7/go-reacjilator
$ cd $GOPATH/src/github.com/uchimanajet7/go-reacjilator
$ go build
  1. Build and Deploy bot using AWS CLI and AWS SAM.

For deployment you need to be able to run the AWS CLI and prepare the AWS S3 resources necessary for AWS Lambda's operation in advance.

$ GOARCH=amd64 GOOS=linux go build -v -o build/go-reacjilator

$ aws cloudformation package \
    --template-file template.yml \
    --s3-bucket <YOUR_BUCKET_NAME> \
    --s3-prefix go-reacjilator \
    --output-template-file .template.yml

$ export SLACK_TOKEN=<YOUR_SLACK_TOKEN>
$ export SLACK_VERIFICATION_TOKEN=<YOUR_ SLACK_VERIFICATION_TOKEN>
$ export SLACK_CHANNEL_ID=<YOUR_SLACK_CHANNEL_ID>

$ aws cloudformation deploy \
    --template-file .template.yml \
    --stack-name go-reacjilator \
    --capabilities CAPABILITY_IAM \
    --parameter-overrides "SlackToken=$SLACK_TOKEN" "SlackVerificationToken=$SLACK_VERIFICATION_TOKEN" "SlackChannelID=$SLACK_CHANNEL_ID"
  • About setting items
    • s3-bucket <YOUR_BUCKET_NAME>: required
      • Specify the bucket name of AWS S3 prepared in advance.
    • SLACK_TOKEN=<YOUR_SLACK_TOKEN>: required
      • Specify the token to use "Slack API".
    • SLACK_VERIFICATION_TOKEN=<YOUR_ SLACK_VERIFICATION_TOKEN>: required
      • Specify the verification token to use "Slack API".
    • SLACK_CHANNEL_ID=<YOUR_SLACK_CHANNEL_ID>: optional
      • Specify slack channel ID to allow.
        • When you want to use channel filter
          • If you want to limit the channels that respond to flag emoji reactions, you need to specify one allowed channel.
          • Specify the channel ID.
          • Refer to the following for how to check the channel ID.

Author

uchimanajet7

Licence

MIT License

About

Translate Slack message with flag emoji(e.g. 🇯🇵 🇺🇸 🇬🇧) reaction. 😄 Use only AWS Products(AWS Lambda functions in Go, Amazon Comprehend, Amazon Translate)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages