Image created with deepai.org
Code overhaul
When I started developing a Hive bot I had almost no Python knowledge or any idea how read/write to the Hive blockchain. The over three years old pizza bot code was my only guideline to somehow get started.
Today, @hug.bot and @sloth.buzz moved to a new code. The configuration is now completely in a sqlite3 database. The bot itself moved from procedural to object oriented design. This makes the implementation of additional features much easier.
With the configuration parameters being read from a database as needed, the bots behaviour can now be altered while it is running.
On top I spent a lot of time (hopefully) improving exception handling when it comes to connection issues. During that process I also eliminated a few bugs that were hiding in the background. Luckily they did not cause any damage or larger issues, which explains how they were able to hide until now.
New Features
- The tipper can now also receive some tokens. Both values can be configured separately.
- The tip can now be staked to the receiving account
- The vote is now based on the receiver's token balance/stake
- The vote is now balanced to a baseline of the available mana. Nutshell: less mana - lower vote weight
All these features can be configured and/or turned on/off in the options.
Relevant Bugfixes
- Improved exception handling.
- Check if a post/comment has already been voted on before trying to cast a vote now works.
I bet I forgot one or two features or bugfixes. The last few days I spent a lot of small chunks of time with the code, fiddling a few lines here and there to either bring them up to styling or coding standard.
For the Future
Two weeks since introducing a more extensive data collection are almost over. The plan was to now start developing the evaluation of that data. Python has some nice libs to turn those statistics into diagrams. This way I extend my Python knowledge and I can try out the image uploader in the beem library.
With the configuration (and status) being live in a database I can now also start developing a real discord bot to query and alter that data. Already had a glance into that topic and it looks pretty exciting.
Thoughts and suggestions?
As always I am looking forward to your thoughts and suggestions. Is there any feature you would like the bot to have? Please leave a comment if you have any ideas. Thank you very much.
As a sloth Hannes does not post that much but when he does he tries making a buzz about it. In his free time he is working on his Python skills and busy improving the @hug.bot code. His family and coworkers are sometimes cause for interesting postings and whenever inspiration strikes he's good for an entertaining rant about random stuff that just comes to his mind. |
---|