tomaarsen / twitchmarkovchain Goto Github PK
View Code? Open in Web Editor NEWTwitch Bot for generating messages based on what it learned from chat
License: MIT License
Twitch Bot for generating messages based on what it learned from chat
License: MIT License
I've been using this bot for a quite a while rn and i must say it's one of the best from what i've seen out there, even if we're using portuguese instead of english with him he got the hang of the basic structure pretty quickly and is already experimenting with combining other words and phrases, but i would like to ask/know if it's possible to make a feature where the bot generates an answer after somebody sends a message in chat instead of the timer, i'm going to be honest with you i don't know how this bot works 100% that's why i'm interested to know if such a thing is possible
Thanks for the attention, Diogo
Comments with "x x x" should be entered in the database if at least k% of messages of the format "x x y" (where y can equal x) are of the format "x x y" where y ≠ x
This will allow for the bot to produce messages like "LUL LUL LUL BANNED" if "LUL LUL BANNED" and "LUL LUL LUL" are both in the database. Of course, the message could be 20 LULs, but the probability of this is ((100-k)/100)^20 which is gonna be pretty low if k is something like 50
I don't seem to understand how much information is needed for the bot to work. It seems that no matter how many messages I send, !generate just gives me "There is not enough learned information yet." I really have no clue what I'm doing wrong, if anybody could help me.
Hey, I'm wondering if there's a way to combine the data gathered from several different channels into one db file, instead of being limited to data from one channel at a time
This is a very naive question, but I have managed to download and install the bot using conda.
How do I activate it? Do I simply need to link it to a bot account, or is there something else I need to do?
apologies if this is the wrong place for this kind of issue, but I seem to have gotten my installation of the bot stuck to the wrong account. I understand how it happened (I used the wrong OAuth password) but I can't figure out how to fix it, as no amount of modifying (or even deleting) files on my computer changes anything. presumably there are files uploaded elsewhere that would need to be modified/deleted to get this set up on the right account, but I don't know how to do that.
will pick a character and then select data that starts with that character. However, this means that the bot needs to learn sentences that start with any of the 27 possible tokens before it stops saying "There is not enough learned information yet."
.
This can definitely be improved.
Obviously a select on all MarkovStart
tables as opposed to just one will work, but I would love to keep the program somewhat efficient even if it has enormous amounts of information.
This can also be fixed by altering the structure of the database, which currently exists of very many tables to avoid the seemingly exponential increase in query time relative to the row count.
Perhaps switching to a different database structure will help too.
Trying to generate sentences with !g and words such as "I'm", "haven't", "can't" etc. doesn't work, I believe they are saved properly in the database and the bot uses them normally when it picks them itself, but it breaks if you try to put them in a !g command.
Typing "!g i've" makes the bot say "I haven't learned what to do with "i 've" yet."
Typing "!g can't" makes it say "I haven't learned what to do with "ca n't" yet."
It does have data for the actual words in the database but it looks like something goes wrong with splitting the words and putting them back together when generating.
Hello,
I need help with running the bot. When I run it it gives me this error:
File "c:\Users\Uživatel\Desktop\TwitchMarkovChain-master\Database.py", line 160, in execute
with sqlite3.connect(self.db_name) as conn:
sqlite3.OperationalError: unable to open database file
Do you know how to fix it?
Thanks
Is it possible to disable whispers or the possibility for a setting to turn them off?
I've been fiddling with it for a while but I'm not having any luck disabling whispers which is getting the bot shadowbanned from Twitch.
Hello
I, a total python noob, have foolishly decided to try and install this chatbot. I think I've got it all setup correctly, installed the websocket in the same folder and edited the settings file with the required info and oath code but when I try to run the MarkovChainBot.py file nothing happens. If I try to execute it in command prompt I get the error "No pyvenv.cfg file"
What am I missing?
The detokenizer isn't prepending spaces before quotes like it says it should in the Tokenizer.py examples.
If I use one of the examples on the detokenizer:
["He", "said", "''", "heya", "!", "''", "yesterday", "."]
it returns:
He said"heya!" yesterday.
There have been increasing problems with the program crashing more regulary over the last months, but I was always able to restart it and it worked again just fine. But since yesterday, the authentication fails within the first three steps when I try to run it. I tried updating thr oauth token, but it didn't help. I guess the old authentication method is finally not working with twitch anymore. :/
I guess this project is dead, but I just wanted to reach out anyways. My viewers always loved the feature!
A timed, toggleable message explains how the bot works by linking to https://cubiedev.github.io/TwitchMarkovChain/#how-it-works.
This will also remind users that the bot is live.
The internal Timer between a message can then also be used for implementing #8.
after installing requirements and generating the settings.json.
sudo python3 MarkovChainBot.py
[2021-10-10 16:35:36,001] [Database] [INFO ] - Updating Database to new version - supports better punctuation handling.
[2021-10-10 16:35:36,003] [Database] [INFO ] - Created a copy of the database called "MarkovChain__modified.db". The update will modify this file.
Traceback (most recent call last):
File "MarkovChainBot.py", line 570, in
MarkovChain()
File "MarkovChainBot.py", line 30, in init
self.db = Database(self.chan)
File "/home/rainer/TwitchMarkovChain/Database.py", line 96, in init
self.update_v3(channel)
File "/home/rainer/TwitchMarkovChain/Database.py", line 411, in update_v3
modify_start(table)
File "/home/rainer/TwitchMarkovChain/Database.py", line 331, in modify_start
data = self.execute(f"SELECT * FROM {table};", fetch=True)
File "/home/rainer/TwitchMarkovChain/Database.py", line 516, in execute
cur.execute(sql)
sqlite3.OperationalError: no such table: MarkovStartA
When I try to run the MarkovChainBot.py file in Command Prompt, I get the following text:
C:\Users\USER ONE\Documents\Kadoomed\TwitchMarkovChain-master\TwitchMarkovChain-master>python MarkovChainBot.py
[2021-11-02 14:48:53,620] [Database] [INFO ] - Updating Database to new version - supports better punctuation handling.
[2021-11-02 14:48:53,621] [Database] [INFO ] - Created a copy of the database called "MarkovChain_kadoomed_modified.db". The update will modify this file.
Traceback (most recent call last):
File "C:\Users\USER ONE\Documents\Kadoomed\TwitchMarkovChain-master\TwitchMarkovChain-master\MarkovChainBot.py", line 570, in
MarkovChain()
File "C:\Users\USER ONE\Documents\Kadoomed\TwitchMarkovChain-master\TwitchMarkovChain-master\MarkovChainBot.py", line 30, in init
self.db = Database(self.chan)
File "C:\Users\USER ONE\Documents\Kadoomed\TwitchMarkovChain-master\TwitchMarkovChain-master\Database.py", line 96, in init
self.update_v3(channel)
File "C:\Users\USER ONE\Documents\Kadoomed\TwitchMarkovChain-master\TwitchMarkovChain-master\Database.py", line 411, in update_v3
modify_start(table)
File "C:\Users\USER ONE\Documents\Kadoomed\TwitchMarkovChain-master\TwitchMarkovChain-master\Database.py", line 331, in modify_start
data = self.execute(f"SELECT * FROM {table};", fetch=True)
File "C:\Users\USER ONE\Documents\Kadoomed\TwitchMarkovChain-master\TwitchMarkovChain-master\Database.py", line 516, in execute
cur.execute(sql)
sqlite3.OperationalError: no such table: MarkovStartA
Again, I have very little experience with Python so I'm not sure what this means, but it looks like it's trying to check data in a table which hasn't been created in the database is that correct? I can't see an obvious reason for this to happen to me but not to others who are running the same script. Any ideas?
When I try and send !enable to my bot through a whisper, this message appears in my CLI
[2021-11-18 22:47:20,713] [__main__] [INFO ] - Your settings prevent you from sending this whisper.
I can't find anything in any of the .py files that even returns that message.
i was thinking of using self.check_if_permissions(m)
to accomplish this but i couldnt get it to work, any help on this?
Very new to vscode/python so its very likely a me issue, but does anyone know why this might be?
Here is the error i got:
line 500, in execute_commit with sqlite3.connect(self.db_name) as conn: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ sqlite3.OperationalError: unable to open database file
Hello! I'm a long time user of your program and so far it has been working flawlessly! But recently i formatted my SSD and while trying to set up the bot again i installed Python, Git and ran the requirement.txt command with no problems, but as soon as i tried to run the file MarkovChainBot.py it gave me this error:
Could not find platform independent libraries <prefix>
Traceback (most recent call last):
File "C:\Users\Administrator\Downloads\TwitchMarkovChain-2.4\TwitchMarkovChain-2.4\MarkovChainBot.py", line 4, in <module>
from TwitchWebsocket import Message, TwitchWebsocket
File "C:\Users\Administrator\Downloads\TwitchMarkovChain-2.4\TwitchMarkovChain-2.4\TwitchWebsocket.py", line 8, in <module>
from TwitchWebsocket.Message import Message
ModuleNotFoundError: No module named 'TwitchWebsocket.Message'; 'TwitchWebsocket' is not a package
I tried to download the TwitchWebSocket myself and copy the message and twitchwebsocket files into the folder but to no avail, rerunning the requirements command just gave back that the requirement was already satisfied, so i'm not sure what's going on or how to fix, any help is highly appreciated!
Not a very important feature but could be neat to have the bot just keep talking with a cooldown between messages.
I'm trying to run the bot but it just outputs this
[2021-09-20 01:10:14,417] [Database] [INFO ] - Updating Database to new version - supports better punctuation handling.
[2021-09-20 01:10:14,423] [Database] [INFO ] - Created a copy of the database called "MarkovChain_yabbe_modified.db". The update will modify this file.
Traceback (most recent call last):
File "C:\Users\wrk\Desktop\bt\TwitchMarkovChain\MarkovChainBot.py", line 570, in
MarkovChain()
File "C:\Users\wrk\Desktop\bt\TwitchMarkovChain\MarkovChainBot.py", line 30, in init
self.db = Database(self.chan)
File "C:\Users\wrk\Desktop\bt\TwitchMarkovChain\Database.py", line 96, in init
self.update_v3(channel)
File "C:\Users\wrk\Desktop\bt\TwitchMarkovChain\Database.py", line 411, in update_v3
modify_start(table)
File "C:\Users\wrk\Desktop\bt\TwitchMarkovChain\Database.py", line 331, in modify_start
data = self.execute(f"SELECT * FROM {table};", fetch=True)
File "C:\Users\wrk\Desktop\bt\TwitchMarkovChain\Database.py", line 516, in execute
cur.execute(sql)
sqlite3.OperationalError: no such table: MarkovStartA
What am i missing?
unsure if a bug or not implemented yet but while other commands such as !setcd can be whispered to the bot and it will listen to them, whispering !generate seems to be ignored by the bot
Is it possible to make databases from older versions of the bot work with the newest one? It breaks whenever I give it my database that's got the most chat messages gathered.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.