Giter Site home page Giter Site logo

translator-bot's Introduction

Discord Translator Bot

Description

This is a discord bot who translate any language to spanish.


Bot working

Technologies used


Installation

After you download the project you need to create two files:

.env
google_api_key.json

It will look something like this.
Final look of the project directory tree
Now we need our credentials, first let's get the discord token.

Discord

On Discord Developer Portal, Applications section create a new application. After that, enter on that new app and create a new Bot on the Bot section at the left side.
Now clic the Reset Token button, you will get a long string of characters, copy that and insert it on the .env file.

# .env file
DISCORD_TOKEN=TOKENYOUCOPYWITHCONTROLC

To invite it to your server go the the OAth2/URL Generator Section, clic on bot and give it the Send Messages Text Permission then copy the invite link.

Google Cloud

To get the json file can be a hassle, but bear it with me.
First you need a Google Cloud account with billing allowed.
Go to the console and create a new project (the name can't be changed later so be careful), the create menu is next to the Google logo.
Use the search bar and type translation, that will get you to the market place (don't worry, it won't cost if you are using the free credits) clic on Cloud Translation API. Now you need to allow it to your project, just clic on enable.
Go the Credentials seccion at the left side then Create a new credential, for this project we will use Service Account. Fill the requested data and clic the create and continue button.
Go to the credentials menu, at the bottom, you can see the created account then clic it.
Clic the Key Section. When inside, clic the Add Key button, a pop-up menu will appear, you need to select the Json format then create. Seconds after the file will be downloaded.
Now you need to add that file your project directory. Use the image at the start of the tutorial as your guide.

Poetry

After have all the neccesary credentials, let's run the bot, to do that we will use poetry. You need to have it installed on your system before hand. If not, use the link at Technologies used to install it. After that, run the commands below to initiate the project.

# Install dependencies
poetry install

# Run the application
poetry run python app/app.py

On discord

Below there is a list with available commands with use cases examples.

  • !!
    Translate from any language to spanish.
# On the discord app
User-input> !!I want to translate this
Bot-output> quiero traducir esto
User-input> !!Good Bot
Bot-output> buen bot

translator-bot's People

Contributors

migue28 avatar

Watchers

 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.