Giter VIP home page Giter VIP logo

slack-transbot's Introduction

slack-transbot

Slack translation bot

ToC

Dependencies

  • Slack client library

    pip3 install slackclient

  • Google translate library

    pip3 install googletrans

Translation map

  • Slack-transbot supports M-N translation map:

    channel_1 --> trans_channel_1

    channel_2 --> { trans_channel_1, trans_channel_2 }

Install new slack bot & Obtain slack bot's token

01

02

03

04

05

06

07

08

09

10

11

Create home channel for slack-transbot

Create a private channel (named home-transbot -- e.g). Let use this channel as home channel for slack-transbot. We will do all settings for slack-transbot in the home channel.

12

Invite slack-transbot (named transbot) to the channel.

13

Find slack-transbot user ID

In the home channel, click "View member list" -> Right-click on transbot -> Copy Link -> The copied link should look like https://...slack.com/team/UXXXXXXXX. The last part (UXXXXXXXX) is BOT_ID of slack-transbot.

14

Start slack-transbot

  • export following params as environment variables.

    BOT_TOKEN: Slack-transbot token (xoxb-xxxxxx..., e.g)

    BOT_ID: Slack-transbot user ID (UXXXXXXXX, e.g)

    BOT_NAME: Slack-transbot name (transbot, e.g)

    HOME_CHANNEL: Home channel for slack-transbot (home-transbot, e.g)

  • Start slack-transbot

    python3 /path/to/transbot.py path/to/transmap

    Where: path/to/transmap points to where to save translation map. If launching from scratch, simply points to a non-existing file.

  • Go to the home channel. If slack-transbot has started well you will see transbot is shown with a green circle under Apps section.

Configure slack-transbot

  • To configure slack-transbot, post command messages in the home channel.

  • @transbot help: Say hello and provide you some help.

  • @transbot list: Show translation map.

  • @transbot add src:dst: Add a pair of channels to translation map.

  • @transbot rm src:dst: Remove a pair of channels from translation map.

15

Test slack-transbot

  • Create two channels named test-src and test-dst. Invite slack-transbot to both channels.

  • In the home channel, post @transbot add test-src:test-dst.

16

  • Now, go to test-src channel and post some Korean messages. Check out translated messages in test-dst channel.

17

18

slack-transbot's People

Contributors

duong2179 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

slack-transbot's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.