Code Monkey home page Code Monkey logo

discord-translator's Introduction

Translation bot built using discord.js and Google Translate API.

Features

  • Translate custom messages
  • Translate messages by reacting with flag emoji
  • Translate last message(s) in channel
  • Translate to multiple languages at once
  • Automatic translation of channels with option to forward translations to users or seperate channels.
  • Supports 100+ languages

Discord Usage

  • Write !translate help or !t help for a list of commands.

Deploy to Heroku

To deploy a free translation bot that you can add to your discord server, follow these easy steps.

1. Fork this repo.

  • If you don't yet have a github account, create one! It's free and easy.
  • Use the button in the upper righthand side of this page to fork the repo so that it will be associated with your github account.

2. Create a new Discord App

  • Give app a friendly name and click the Create App button
    • I like the name C-3PO, but feel free to pick something different if you fear George Lucas's wrath. Maybe C-4PO
  • Take note of the app CLIENT ID, you will need it later
  • Scroll down to the Bot section
  • Click the Create a Bot User button
  • Click the Yes, do it! button
  • Copy the bot's TOKEN, you will need it later

3. Create a Heroku account (It's free!)

  • Create a new app. It's name must be unique and composed of all lowercase letters and dashes. Something like yourname-discordbot is fine
  • Under Deployment Method select Github. Connect to your github account and search for this repo by name.
  • Scroll down to the manual deploy section, and select the heroku-deployment branch. Click deploy branch, and wait for the successfully deployed message.
  • Go to the Resources tab and look for the addons section. Search 'Postgres', and add a 'Hobby Dev - Free' version of Heroku Postgres. This will be automatically attached as your bot's database.
  • Go to the Settings tab. Click to reveal Config Variables, then add a new one. The key will be DISCORD_TOKEN, and the value will be your discord bot's token that you copied earlier.
  • Add DISCORD_BOT_OWNER, and the value will be your Discord Main User ID.
  • Go to the Overview tab and click configure dynos. Turn off the default web npm start dyno and turn on the worker node src/bot.js dyno. Your bot will now be up and running!

4. Invite your bot to your server and configure it!

5. Troubleshooting

  • You can set up debugging webhooks using the following steps
    1. Create a new channel on your server to recieve the webhooks, let's say #webhooks.
    2. Go to Server Settings -> Webhooks -> Create Webhook. Select the #webhooks channel, then copy the webhook's URL. It will look something like https://discordapp.com/api/webhooks/012345678901234567/VCj9yOOtJF9VCm-BU2F9xrbnoWD5gBZZ-UU1mZHcxi5VLgr3bPb9NanRJM8YD9cpBisL
    3. In the Settings tab of your Heroku app add the following Config Variables (values extracted from your URL):
      • DISCORD_DEBUG_WEBHOOK_ID : 012345678901234567
      • DISCORD_DEBUG_WEBHOOK_TOKEN : VCj9yOOtJF9VCm-BU2F9xrbnoWD5gBZZ-UU1mZHcxi5VLgr3bPb9NanRJM8YD9cpBisL
    4. Restart your app's worker node src/bot.js dyno, and you will begin to recieve debugging messages in your #webhooks channel.
  • If your bot in unresponsive, the first thing to check is Heroku. Log in and manually restart the worker node src/bot.js dyno.
  • For further troubleshooting, it's helpful to install the Heroku command line interface. Once installed you can login from a terminal with heroku login and check your apps logs with heroku logs --tail -a <your-app-name>
  • If you are unable to solve a problem yourself, report it with as much detail as possible in this repo's issue tracker.

Commands

Credits & License

This project was originally released by #redacted# under the MIT license. He chose to take the project private/commercial at version 0.4.2 Beta. #redacted# forked the project and renamed it #redacted# after his dog. #redacted# forked #redacted# and added the necessary modifications for simple and free deployment of the bot using Heroku. Both would like to thank #redacted# for his hard work and making these early versions OSS so that others may learn and build on his hard work to share with the community.

Unlicensed and authors name redacted as requested.

discord-translator's People

Contributors

alooakbar avatar aziznatour avatar bellerbrock avatar deb4sh avatar karlg100 avatar lucifel1853 avatar notmyself avatar vkedwardli avatar

Watchers

 avatar  avatar

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.