Code Monkey home page Code Monkey logo

deepl-for-slack's Introduction

DeepL App for Slack

DeepL for Slack is a Slack integration that enables end-users to translate channel messages into a different lanuage just by adding reaction emoji.

Features

Shortcut to run DeepL Translate API

Slack users can run DeepL Translate API in a modal.

Post a translated text in thread

This works mostly the same as reacjilator.

Prerequisites

To run this app, the following accounts are required.

  • DeepL Pro (for Developers) account
  • Slack workspace and user account
  • Heroku account

If you already have all of them, setting up this app requires only 5 minutes.

Set up

Create your DeepL Pro (for Developers) account

Refer to the following resources for more details:

Create your Slack App

Use the App Manifest file to configure a new app!

  • Got to Settings > Install App in the left pane

    • Click Install App to Workspace button
    • Click Allow button in the OAuth confirmation page
    • Save the Bot User OAuth Access Token value (xoxb-***)
  • Go to Settings > Basic Information in the left pane

    • Scroll down to App Credentials section
    • Click Show button in Signing Secret section
    • Save the Signing Secret value

Deploy to Heroku

Deploy

  • Confirm your billing settings
  • Deploy this app with the following env variables
    • SLACK_SIGNING_SECRET: Settings > Basic Information > App Credentials > Signing Secret in the Slack app config page
    • SLACK_BOT_TOKEN: Settings > Install App > Bot User OAuth Access Token in the Slack app config page
    • DEEPL_AUTH_KEY: Authentication Key for DeepL API in the DeepL Pro account page
    • DEEPL_FREE_API_PLAN: Set to "1" if you are using the DeepL API Free Plan (the default is "0" for Pro Plan)
  • You may need to change the "Dyno Type" to enable the app

Slack App (Step 2)

  • Go to Features > Event Subscriptions in the left pane

    • Set the Request URL to https://{your app's Heroku domain}/slack/events
    • Click Save Changes button at the bottom for sure
  • Go to Features > Interactivity & Shortcuts in the left pane

    • Set the Request URL to https://{your app's Heroku domain}/slack/events
    • Click Save Changes button at the bottom for sure

Verify it works in Slack

  • Go to your Slack workspace

  • Run /invite @deepl_translation in a channel

  • Post a message saying In functional programming, a monad is a design pattern that allows structuring programs generically while automating away boilerplate code needed by the program logic. Monads achieve this by providing their own data type (a particular type for each type of monad), which represents a specific form of computation, along with one procedure to wrap values of any basic type within the monad (yielding a monadic value) and another to compose functions that output monadic values (called monadic functions).

  • Add a reaction :flag-jp: to the message

  • Check a new message in its thread

  • Click โšก (Shortcuts) button

  • Click Open DeepL Tool

  • Enter a text and the language on the modal

License

The MIT License

Related Projects

If you are looking for more functionalities, take a look at the following awesome projects:

deepl-for-slack's People

Contributors

dependabot[bot] avatar janjoch avatar krmax44 avatar seratch avatar utilforever avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

deepl-for-slack's Issues

[FeatureRequest] disable flags multiple click

Hello,
First of all, thanks a lot for sharing that very nice tool ! Much appreciated.

We are using it for few hours now, but we already facing an issue people not respecting the easy "no multiple flags" rules on messages.

Is there any way to prevent people to do that or, better said, not having the API call if someone already clicked that once ?

Thanks

Translations posting multiple times

It appears that when people are using the flag button and only clicking it once, it will post the translation multiple times.

My current suspicion is that if someone makes a post, and then immediatly edits it. The translation (when it happens) occurs multiple times for each version - although I cannot prove this.

I'm not a coder, but I was wondering if you could help me solve this?

Feature request: Automatic translation

Thank you for this great project and easy installation.

I was wondering if there is a way to automatically translate between two (pre-set) languages when the bot is included in a channel.
We need a feature like the current Kiara slack bot offers so we don't have to click the flags as a reaction.
It would be very helpful if you could add this.

Deploy to Heroku didn't work with error message.

Cannot deploy new app from your link and it shows this error below.
"We couldn't deploy your app because the source code violates the Salesforce Acceptable Use and External-Facing Services Policy."

Garbled URL hyperlinks in messages

There seems to be an issue with messages that have (longer) hyperlinks being translated (where the links are formatted as text), where deepL garbles the formatting.

Short links work fine, but long links show up in the translated message with the URL and the display text combined into one.

ex. trying to add a amazon link containing some katakana text: https://www.amazon.co.jp/-/en/%E5%8E%9F%E6%B2%A2-%E4%BC%8A%E9%83%BD%E5%A4%AB/dp/406288173X/ref=sr_1_5?crid=4GX3PIC6051G&keywords=%E6%97%A5%E6%9C%AC%E8%AA%9E&qid=1673340326&sprefix=%E6%97%A5%E6%9C%AC%E8%AA%9E%2Caps%2C217&sr=8-5

SCR-20230111-dqv

Node version?

hi
I was following your Qiita page and successfully deploied 2 weeks before.
but when I try today, got error message from Heroku. can you teach me how to check it?
the full log is below:

-----> Building on the Heroku-20 stack
-----> Deleting 1 files matching .slugignore patterns.
-----> Determining which buildpack to use for this app
-----> Node.js app detected

-----> Creating runtime environment

   NPM_CONFIG_LOGLEVEL=error
   NODE_VERBOSE=false
   NODE_ENV=production
   NODE_MODULES_CACHE=true

-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)

   Resolving node version 14.x...
   Downloading and installing node 14.17.6...
   Using default npm version: 6.14.15

-----> Installing dependencies
Installing node modules

   > [email protected] postinstall /tmp/build_ddbc3522/node_modules/nodemon
   > node bin/postinstall || exit 0
   
   Love nodemon? You can now support the project via the open collective:
    > https://opencollective.com/nodemon/donate
   
   added 277 packages in 6.195s

-----> Build
Running build

   > [email protected] build /tmp/build_ddbc3522
   > tsc -p .
   
   src/runnner.ts(71,11): error TS2322: Type 'Option[]' is not assignable to type 'PlainTextOption[]'.
     Type 'Option' is not assignable to type 'PlainTextOption'.
       Type 'MrkdwnOption' is not assignable to type 'PlainTextOption'.
         The types of 'text.type' are incompatible between these types.
           Type '"mrkdwn"' is not assignable to type '"plain_text"'.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: tsc -p .
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.Qmp7p/_logs/2021-09-12T14_28_44_164Z-debug.log
-----> Build failed

   We're sorry this build is failing! You can troubleshoot common issues here:
   https://devcenter.heroku.com/articles/troubleshooting-node-deploys
   
   Some possible problems:
   
   - Node version not specified in package.json
     https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
   
   Love,
   Heroku

! Push rejected, failed to compile Node.js app.
! Push failed

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.