Code Monkey home page Code Monkey logo

twitchgoogletranslate's Introduction

TwitchGoogleTranslate

Twitch Chat bot which uses Google Translate in a chain to modify input sentences into ridiculous new sentences.


Explanation

When the bot has started, it will start listening to chat messages in the channel listed in the settings.txt file. If any message starts with "!translate ", the bot will take the remainder of that message, and randomly choose a certain amount of languages. (This amount is also defined in the settings.txt file)

The bot will translate the remainder from the initial language (does not need to be English) to all languages that were randomly picked, in a chain. At the end, it will translate the sentence back to English, and it will be printed out in the Twitch chat.


Example

The console when sending the message "!translate How much wood could a woodchuck chuck, if a woodchuck could chuck wood?" in Twitch chat 3 times:

[Start]             : #cubiedev

[Initial]           : How much wood could a woodchuck chuck, if a woodchuck could chuck wood?
[To Cebuano]        : Pila ka kahoy ang mahimo nga usa ka kahoy nga kahoy, kung ang usa ka kahoy nga kahoy makagisi sa kahoy?
[To Nepali]         : कति काठको रूख हुन सक्छ, यदि रूखले रूख छोड्छ भने?
[To Thai]           : มีไม้เท่าไหร่ถ้าต้นไม้ออกจากต้นไม้?
[To English]        : How much wood is there if the tree leaves the tree?
[Path]              : English -> Cebuano -> Nepali -> Thai -> English

[Initial]           : How much wood could a woodchuck chuck, if a woodchuck could chuck wood?
[To Finnish]        : Kuinka paljon puuta voisi hakata puuhihnaa, jos puukouru voisi hakata puuta?
[To Chinese (traditional)]: 如果木屑可以切割木材,木材可以切割多少木材?
[To Kyrgyz]         : жыгач отун кесип мүмкүн болсо, анда канча жыгач устун кесип болот?
[To English]        : If he can cut firewood wood boards can be cut?
[Path]              : English -> Finnish -> Chinese (traditional) -> Kyrgyz -> English

[Initial]           : How much wood could a woodchuck chuck, if a woodchuck could chuck wood?
[To Xhosa]          : Ubungakanani umthi onokuthi ube ngumthi we-woodchuck chuck, ukuba i-woodchuck yayingakwazi ukuxubha ukhuni?
[To Uzbek]          : Yog'och daraxti yog'ochni cho'ktirolmasa, daraxt daraxt daraxti qanday daraxtga aylanishi mumkin?
[To Shona]          : Ndeupi rudzi rwemuti unogona kutendeuka mumuti kana muti wehuni usingadziki huni?
[To English]        : What kind of tree can turn into a tree or wood tree without wood?
[Path]              : English -> Xhosa -> Uzbek -> Shona -> English

Settings

This bot is controlled by a settings.txt file, which looks like:

{
    "Host": "irc.chat.twitch.tv",
    "Port": 6667,
    "Channel": "#<channel>",
    "Nickname": "<name>",
    "Authentication": "oauth:<auth>",
    "UseProxies": false,
    "Cooldown": 10,
    "AmountOfTranslations": 3,
    "Languages": [
        "Hawaiian"
    ]
}
Parameter Meaning Example
Host The URL that will be used. Do not change. "irc.chat.twitch.tv"
Port The Port that will be used. Do not change. 6667
Channel The Channel that will be connected to. "#CubieDev"
Nickname The Username of the bot account. "CubieB0T"
Authentication The OAuth token for the bot account. "oauth:pivogip8ybletucqdz4pkhag6itbax"
UseProxies Whether Proxies should be used False (recommended)
Cooldown How many seconds inbetween messages that the bot should translate 10
AmountOfTranslations How many languages the bot should choose to translate through 3 (Recommended)
Languages The chain of languages which will be translated through. If this list has languages, these languages will always be used in the listed order. If this list is empty, an amount of random languages will be chosen. ["Hawaiian"] (recommended)

Note that the example OAuth token is not an actual token, but merely a generated string to give an indication what it might look like.

I got my real OAuth token from https://twitchapps.com/tmi/.


Requirements

Among these modules is my own TwitchWebsocket wrapper, which makes making a Twitch chat bot a lot easier. This repository can be seen as an implementation using this wrapper.


Other Twitch Bots

twitchgoogletranslate's People

Contributors

tomaarsen avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

jae1379

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.