Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tomaarsen/twitchrhymebot

Twitch bot that periodically responds to messages with a rhyme
https://github.com/tomaarsen/twitchrhymebot

bot python rhyme rhyming twitch twitch-bot twitchbot

Last synced: 28 days ago
JSON representation

Twitch bot that periodically responds to messages with a rhyme

Awesome Lists containing this project

README

        

# TwitchRhymeBot
Twitch bot that periodically responds to messages with a rhyme

---
# Note

This program relies on a database generated by an outdated version of the [TwitchMarkovChain](https://github.com/CubieDev/TwitchMarkovChain) program. As a result, this program cannot easily be used.

---
# Explanation

When the bot has started, it will start listening to chat messages in the channel listed in the settings.txt file. Every "cooldown" seconds, as listed in the settings.txt file, the bot will respond to a message with a rhyme. The bot will try to ensure that the sound of the final word of the input message from the random chat user and the output message from the bot have the same sound. It will also try to match the syllable count of both messages.

---

# Example



Input: "its kinda useless"
Output: "Good job regardless"

Input: "Face your crimes!"
Output: "were great times"

Input: "bloody and stuff"
Output: "This game is tough"

---

# Settings
This bot is controlled by a settings.txt file, which looks like:
```
{
"Host": "irc.chat.twitch.tv",
"Port": 6667,
"Channel": "#",
"Nickname": "",
"Authentication": "oauth:",
"Cooldown": 300
}
```

| **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" |
| Cooldown | The cooldown between rhymes in seconds. | 300 |

*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/.

---

# Usage
Run the RhymeBot.py file

---

# Dependencies
This bot relies on having a MarkovChain_xxx.db file being in the same folder as the .py files.
More generally, this bot relies on the TwitchMarkovChain bot being run in the same folder, to create a database of sentences.

---

# Requirements
* [Python 3.6+](https://www.python.org/downloads/)
* [Module requirements](requirements.txt)

Install these modules using `pip install -r requirements.txt`

Among these modules is my own [TwitchWebsocket](https://github.com/CubieDev/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

* [TwitchMarkovChain](https://github.com/CubieDev/TwitchMarkovChain)
* [TwitchAIDungeon](https://github.com/CubieDev/TwitchAIDungeon)
* [TwitchGoogleTranslate](https://github.com/CubieDev/TwitchGoogleTranslate)
* [TwitchCubieBotGUI](https://github.com/CubieDev/TwitchCubieBotGUI)
* [TwitchCubieBot](https://github.com/CubieDev/TwitchCubieBot)
* [TwitchRandomRecipe](https://github.com/CubieDev/TwitchRandomRecipe)
* [TwitchUrbanDictionary](https://github.com/CubieDev/TwitchUrbanDictionary)
* [TwitchRhymeBot](https://github.com/CubieDev/TwitchRhymeBot)
* [TwitchWeather](https://github.com/CubieDev/TwitchWeather)
* [TwitchDeathCounter](https://github.com/CubieDev/TwitchDeathCounter)
* [TwitchSuggestDinner](https://github.com/CubieDev/TwitchSuggestDinner)
* [TwitchPickUser](https://github.com/CubieDev/TwitchPickUser)
* [TwitchSaveMessages](https://github.com/CubieDev/TwitchSaveMessages)
* [TwitchMMLevelPickerGUI](https://github.com/CubieDev/TwitchMMLevelPickerGUI) (Mario Maker 2 specific bot)
* [TwitchMMLevelQueueGUI](https://github.com/CubieDev/TwitchMMLevelQueueGUI) (Mario Maker 2 specific bot)
* [TwitchPackCounter](https://github.com/CubieDev/TwitchPackCounter) (Streamer specific bot)
* [TwitchDialCheck](https://github.com/CubieDev/TwitchDialCheck) (Streamer specific bot)
* [TwitchSendMessage](https://github.com/CubieDev/TwitchSendMessage) (Meant for debugging purposes)