Skip to content

sxqib/DiscordTranslateBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Translator Bot

This repository contains the source code for TransBot, a real-time message translation bot for Discord. TransBot is an abbreviation for "Translator Bot".

Overview

This project is implemented using the Pycord library. This README provides detailed instructions on how to configure and deploy the bot on your local machine.

Prerequisites

Before proceeding with the setup, ensure that the following requirements are met:

  • A Discord bot
  • Python programming language
  • Py-cord library

Bot Configuration

  1. Navigate to the Discord Developer Portal, sign in, and select the "New Application" button.

    image

  2. Enter the desired bot name and accept the Terms of Service.

    image

  3. Provide a description and tags for the bot, then select "Save Changes".

    image

  4. Navigate to the "Bot" tab and create a new bot.

    image

  5. Reset the bot token and store it in a secure location.

    image

    image

Repository Setup

  1. Clone this repository using the command git clone https://github.com/yakovexplorer/DiscordTranslateBot.git.
  2. Change the current working directory to the repository using cd DiscordTranslateBot.
  3. Rename the file "env.example" to ".env" and open it for editing.
  4. Add the values for "DISCORD_TOKEN", and "OPENAI_API_KEY" in the .env file, with your information, as shown below, and save the changes.
    • DISCORD_TOKEN='YOUR DISCORD BOT TOKEN'
    • OPENAI_API_KEY='YOUR OPENAI API KEY'

Dependency Installation

  1. Install Python by visiting the Python Downloads page and following the provided instructions.
  2. Open a command prompt or terminal window and enter pip install py-cord to install the Py-cord library.
  3. Enter pip install translatepy to install the Translatepy library.
  4. Enter pip install python-dotenv to install the Python-dotenv library.
  5. Enter pip install psutil to install the Psutil library.
  6. Enter pip install aiofiles to install the Aiofiles library.
  7. Enter pip install openai to install the OpenAI library.
  8. Enter pip install tiktoken to install the tiktoken library.

Bot Execution

  1. Navigate to the DiscordTransBot directory on your local machine.
  2. Execute the command python3 DiscordBot.py or python DiscordBot.py to start the bot.

Bot Invitation

  1. Return to the Discord Developer Portal and access your bot's OAuth2 page.

  2. Use the URL generator tool to create an invitation link for your bot. image image

  3. Copy the generated link and paste it into your web browser to invite your bot to your server.

Screenshots

The following images showcase some of the features provided by this bot:

image

image

image

Licensing

The source code contained within this repository is licensed under the GNU General Public License v3.0. We strongly recommend reviewing the licensing terms specified in this file.

Releases

No releases published

Packages

No packages published

Languages