____  ___    _  _     _   _ _____     _______
 / ___|/ _ \  | || |   | | | |_ _\ \   / / ____|
| |  _| | | | | || |_  | |_| || | \ \ / /|  _|
| |_| | |_| | |__   _| |  _  || |  \ V / | |___
 \____|\___/     |_|   |_| |_|___|  \_/  |_____|

 --- A GOPHER-LIKE INTERFACE FOR HIVE BLOCKCHAIN ---

Hug.Bot Python Code on GitHub

BY: @hannes-stoffel | CREATED: March 8, 2025, 5:45 p.m. | VOTES: 62 | PAYOUT: $1.19 | [ VOTE ]

[IMAGE: https://files.peakd.com/file/peakd-hive/hannes-stoffel/23swg4z9JyM688t4tg4UQE793JqJzpZq6vf6mNoNqjawU9RrvKNz9RjaHnbJmdhQCp7gZ.png]

[IMAGE: https://files.peakd.com/file/peakd-hive/hannes-stoffel/23tuzGXBcfgWpCsBCVfTWEtathf2cPoqKGAip6P68Ra1E6f74zAeJjYWFhNcoKjgRmqBW.png]

The Release

Here it is:

The source code for @hug.bot is now public on GitHub

The Features

The bot performs the following actions:

For the developer/operator it brings:

The Story

And for those interested, here is the story of how it got there:

Many moons ago @slothlydoesit mentioned to me, that he was looking for a coder to write some scripts for Slothbuzz Community. I did work as a coder in the late 90s and early 2000s albeit my experience would not bring me very far today. I wrote mostly Pascal (later on Delphi) code in those days.

I did not know how the Hive Blockchain actually works. To be honest, even today I think I just scratched the surface of understanding it, but I learn something new about Hive almost every day.

So why not combine that with learning a new language? I had heard a lot about Python and @slothlydoesit did some leg work to lure me in. He found the code for Hive Pizza Bot. That was my starting point.

Since I already had experience in coding I knew about if clauses and while loops. I knew about Classes and Objects and all that stuff. The big obstacle was to learn what's so special about Python and how Hive actually works.

For Python there are many Tutorials available as text and video so I was able to catch up fast enough to get the script up and running. Then I started to learn about Hive. I was able to watch the live feed of the blocks, inspect every block, and so on. Over time it dawned on me how things are handled in the background.

I got the script to a most basic version of what we (me for hug.bot and @slothlydoesit for sloth.buzz) wanted: Get triggered by a command in a comment, transfer a token and reply with a comment.

That was not really worth publishing and I said when there are some more features to it and it's a nice, clean and stable code, I will publish it to give back to the community. After all, if it were not for someone else making their code open source, I think I never would have had a chance to get this code to where it is today.

Over time, while adding those new features and hunting down bugs, I started to extend my Python knowledge. Every day I discovered something new. With every feature or bug hunt I find some new way to implement it or correct what was wrong.

I promised to release the code the moment it is satisfactory to me. Well, that point was never reached. Self doubt always was and is present. How can I be sure this is it when I find better ways to write this code every day I work on it? I finally reached the conclusion: I never will be sure, it never will be perfect. Perfect is the enemy of good

So I'm not aiming for that anymore. It is running stable, it is doing what I want it to do. That is good. And that is all. There will always be a better way to do things. But there will also be worse ways.

I took the last two weeks to clean up the code one final time. Rewrote one or two "crutch" parts, wrote a lot of comments, put in some documentation and finally started to learn another skill: Github.

And here we are. If you read this far, I thank you very much for your interest in my story and I wish you a nice weekend and enjoy spreading !hug 🤗

Cheers and !Hug

Hannes

[IMAGE: https://files.peakd.com/file/peakd-hive/hannes-stoffel/23tuzGXBcfgWpCsBCVfTWEtathf2cPoqKGAip6P68Ra1E6f74zAeJjYWFhNcoKjgRmqBW.png]

[IMAGE: https://files.peakd.com/file/peakd-hive/hannes-stoffel/AK9Pum3tqrjmd9QsvDeYRbq8pp4w1RCX2x4Vf83ekzgu8GKpuHW5EviEzo85VHK.png] @hannes-stoffel is a geek with a dayjob. He writes about his passions (including his family of course), geek stuff and every day anecdotes. In his spare time he improves his Python skills while working on the code of @hug.bot and @sloth.buzz community bot.
TAGS: [ #python ] [ #hive ] [ #opensource ] [ #slothbuzz ] [ #bbh ] [ #cent ] [ #pimp ] [ #proofofbrain ]

Replies

@commentrewarder | March 11, 2025, 5:46 p.m. | Votes: 0 | [ VOTE ]

@hannes-stoffel, I'm refunding 0.124 HIVE and 0.029 HBD, because there are no comments to reward.

@slothlydoesit | March 16, 2025, 3:50 p.m. | Votes: 0 | [ VOTE ]

Typical sloth late to the party, not sure how this post slipped me by, love the code, thanks for all the effort you've put in thus far! Sloth buzz wouldnt be much without your buzz driving us forward.

@cryptounicorn420 | March 26, 2025, 10:49 a.m. | Votes: 0 | [ VOTE ]

Excellent post. !BBH

[ BACK TO TRENDING ] [ BACK TO MENU ]
CMD>