Slack app to translate messages using papago proxy (for free!)
Since everything is free, it is not guaranteed that the Vercel serverless configuration will not hit its limit at some point. Use it with caution; but for now it works great.
So I wrote papago proxy which is really just a serverless function with Puppeteer grabbing translation from Papago, on Vercel, for free.
Then I wrote this project to make it installable on Slack as an app, also hosted on Vercel for free (I'm still not sure if it is not restricted).
That's the main reason it would:
- take almost up to 5~10 seconds to actually provide a translation because everything is free, which means it's slow. But it's good for non-immediate purpose conversation where English (or other languages supported by Papago) to Korean translation or vice versa is needed.
- sometimes not work when the serverless function not warmed up (for example, if you just got to work and just started to send the first message for today). Just try again and it might just work.
Deploy papago proxy first if you haven't already
- Fork/clone this repository
- Sign up for vercel
- Add the forked/cloned repository to vercel
- Give a shot to
your-vercel-deployment-link.vercel.app/api/translate?text=hello%20from%20papago%20proxy
to see if the deployment is successful.
-
Fork/clone this repository
-
Sign up for vercel
-
Add the forked/cloned repository to vercel (make
src
the root project directory) -
Create and add a Slack app to your workspace
-
Add appropriate scopes to the app on https://api.slack.com/apps/your-app-id/oauth:
-
Add event subscription to your app on https://api.slack.com/apps/your-app-id/event-subscriptions. Insert
your-vercel-deployment-link-for-papago-proxy-slack-app.vercel.app/api/event-subscription
for the Request URL Input. It should soon become verified. Subscribe tomessage.channels
event too for both bot and user events: -
Add your app to any channels.
-
Add
SLACK_USER_OAUTH_TOKEN
from to your deployment of Vercel, from https://api.slack.com/apps/your-app-id/oauth.Add
TRANSLATE_API_URL
asyour-vercel-deployment-link-for-papago-proxy.vercel.app/api/translate
(the deployment created for papago proxy)LOGFLARE_*
is for logging on Logflare.Sign up and insert
LOGFLARE_API_KEY
andLOGFLARE_SOURCE_TOKEN
on Vercel as needed if you want logging on Logflare too. This however is optional. -
Use it on Slack
This gives a higher chance that translation is sometimes not going to work because potentially lots of people might be using it. I recommend DIY. However, if your will is still to use the app that already exists on Slack, I'm planning to publish the app very soon, but I need to configure Redirect URLs and some stuffs, so I will do them later.