Skip to content

Translate Slack message with flag emoji(e.g. 🇯🇵 🇺🇸 🇬🇧) reaction. 😄

License

Notifications You must be signed in to change notification settings

uchimanajet7/reacjilator-chalice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reacjilator-chalice

Translate Slack message with flag emoji(e.g. 🇯🇵 🇺🇸 🇬🇧) reaction. 😄

Description

This is implemented slack/reacjilator with aws/chalice.

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.
  • Even when using other translation API you can easily respond.
  • Since it is a serverless configuration, it is easy to operate.

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.

Demo

2017-12-17 18_11_16

Installation

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

  2. Deploy bot using aws/chalice.

$ pip install chalice
$ chalice new-project reacjilator-chalice
$ cd reacjilator-chalice
$ git clone https://github.com/uchimanajet7/reacjilator-chalice
$ chalice deploy

Environment variables and so on need to be set individually. And prepare the resources of AWS necessary for execution.

Setting Example

  1. Environment variables settings are done with ./chalice/config.json file.
{
    "stages": {
        "dev": {
            "autogen_policy": true,
            "api_gateway_stage": "api"
        }
    },
    "environment_variables": {
        "SLACK_VERIFICATION_TOKEN": "YOUR_SLACK_VERIFICATION_TOKEN",
        "SLACK_TOKEN": "YOUR_SLACK_TOKEN",
        "YANDEX_API_KEY": "YOUR_YANDEX_API_KEY",
        "SNS_TOPIC_ARN": "YOUR_SNS_TOPIC_ARN",
        "SNS_SUBJECT": "slack event data"
    },
    "lambda_timeout": 180,
    "lambda_memory_size": 128,
    "version": "2.0",
    "app_name": "reacjilator"
}
  • About setting items
    • SLACK_VERIFICATION_TOKEN: String
      • Specify the token to use "Slack API".
    • SLACK_TOKEN: String
      • Specify the token to use "Slack API". - YANDEX_API_KEY: String
      • Specify the API key to use "Yandex API".
    • SNS_TOPIC_ARN: String
      • Specify ARN of "Amazon SNS".
    • SNS_SUBJECT: String
      • Specify the subject of SNS to be sent.

When you want to use channel filter

If you want to limit the channels that respond to flag emoji reactions, you need to create a list of allowed channels.

  1. Allowed channels settings are done with ./chalicelib/filter.json file.
{
    "C1234567R": "random",
    "C823A567R": "dev"
}

Specify the format channel ID: channel Name. 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. 😄

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages