Markov -> Generator ✔️
Chatlog -> Metadata ✔️
Scribe -> Reader ✔️
Speaker updated ✔️
Also:
- Updated to python-telegram-bot v. 12 callbacks
- Renamed a lot of variables and rewritten a lot of code to follow Python conventions
- Added a new argument for filter chat IDs
- Changed obtention of username from hardcoded to a library-provided function
- Added a new argument for bot nicknames that it can respond to
📝 Changed the whole script files hierarchy:
- velasco.py starts up the telegram bot
- speaker.py has all the bot behavior methods
- A Parrot is what stores a Markov object
- An Scribe stores a single chat's data
- A Speaker has an Scriptorium, with all active Scribes
- A Speaker has a single Parrot, the one associated with the last
Scribe that had to send a message
- An Archivist is in charge of loading the Scriptorium at startup, as
well as storing Scribes and Parrots in files
🐞 Fixed a bug that stopped new Parrots from being saved, prevented
because their non-existing file could not be loaded into the Speaker's
Parrot
- Added a "print" marker for the end of chat loading
- Added some code for future possible video compatibility in a panic
when normal Animation support didn't work
- Added ability to change Velasco's probability to answer replies to his
messages, per chat
- Rewritten save-to-file functions for slightly more readability, and
rewritten load-from-file functions accordingly
- Added ability to change the probability of random replies to replies
of Velasco's messages, per chat
- Rewritten the save-to-file and load-from-file methods for a slightly
more readable files and parsing
- Modularized my own ID. Now everyone cas use it's own version of
Velasco more easily
- Added 50% random replies to replies of Velasco's messages
- Rewritten some functions to better use resources in the libraries
- It now saves the dictionary of vocabulary directly into the file. No
need to deal with the full list of messages.
- This also means that the amount of elements kept in memory has been
reduced, since there is no need to keep a list with all the words one
after another,apart from the dictionary.
- Modularized some constants, like the frequency of saves if the
frequency of speaking is too large, or the stop words that mark the
start and end of a message.
- Now starts a message only on the start of a memorized message
- Now does markov chain key lookups with casefold for extra flexibility
- Now saves on /freq change too
- Now updates chat name in chatlog if it changes