New Hug bot features

in SlothBuzz24 days ago

This sloth finally had some time and energy to get back into Python and Hive programming. I am lucky to have @slothlydoesit as a supporter to give me ideas, tasks and a home for the @hug.bot. So after sifting through all his ideas, I implemented three new main features and some minor fixes. Here is the

TL;DR

  1. The bot can now upvote. On top of a token, the recipient also gets their post upvoted. For now it's a configureable fixed amount.
  2. Collection post. The inspiration came from the Pimp token projekt. To get rid of the comment cludder in the conversations there will be one post by the bot and all the call response comments will be added to that one posting.
  3. Disable tagging. If someone does not want to be tagged by the bot commands, they can now respond with STOP and the bot will not tag the user anymore. If they want to be tagged again, they can respond with TAGME.

Python libs

Since I am still very new to Python programming I rely on the beem and hiveengine libs by @holger80. Unfortunately he was last active in August 2021. At the moment the basics are still working but the need for further development is definately there. That being said, while dealing with these libs and checking what they actually do helps a lot to start understanding a little bit how HIVE deals with its content.

Upvoting


So when the bot is called via !HUG command, the person you respond to gets a HUG token. You deem them to have hug worthy content so why not upvote it as well? The implementation is straight forward. Or is it? What if the call was to an older posting, where the payout already happened? We cannot vote anymore. What if a second person gives a hug responding to the same post? We cannot vote twice. So I had to built in a few more checks and also saved all the voting action to an sqlite3 database. This will allow for a curation report in the future. @slothlydoesit is already excited for that one. 🤣

At the moment the bot votes with a fixed 50% weight but only if the token call was successful. This limits to a max of 3 votes per user per day. I will monitor the mana balance and adjust accordingly. In the future the vote weight might depend on some more variables like available mana but also token amounts in your wallet. Maybe the token gets some value after all...

Collection Post


Inspired by the daily Pimp token posting the decision to do the same was easy. Removing the bot comments makes the original posting and human comments much more readable. By adding the comments to such a collection post the hugger and huggee still get informed, especially if the call was not a success and they want to find out why.

On top of getting rid of the clutter there is a chance for the bot to later on post additional information like statistics (working on it, 😜) and get some upvote rewards from others. At the moment the potential rewards of the postings are split into HP and HBD 50/50 like the usual posting setting. The HP will stay with the bot account to give the votes more value and in return increase curation rewards. The HBD are collected and will go to my account to maybe get a few cents back for running and coding the bot.

Disabling tagging


This feature was overdue. Most automated scripts have this and I was lucky until now that noone felt the need to yell at me for not having it, yet. Now it's here and if you are bothered by the bot tagging you, simply respond with a STOP and it will leave you alone. Others are still allowed to !hug you, if you don't want that, you have to talk to them 😏. And if they meet the conditions, you will still get the token.

I wonder if people would like a feature to be ignored by the bot in total. So others cannot even call the !hug on their posts. Well, people could still write the command in their comments (yep, you have to take it up with them) but the bot ignoring you would then mean you would not even get the token. Let me know if you would want me to implement that.

Minor fixes


These were mostly background fixes and code improvements. It is not where I want it to be, yet. That is because every day I learn something new about HIVE and Python which makes me revisit older lines and adjust them to this knowledge. Well, that's been one of the main reasons (maybe the main reason) why I started this project. To learn more about these two.

The most noticeable change in the foreground is the implementation of emoticons in the posting and comments of the bot. 😃

In the background I add some more error handling. Not really exciting for you all. 😴

Future updates

As mentioned above, I plan to give the upvoting some more mechanics. The daily posting might get a bit more statistical data. How many calls per day, how many succeeded or failed and so on. I guess that might be interesting for some people.

I would like to implement a delegation reward at some point but there are still too many technical questions in my mind on how to get all the relevant data for distributing the rewards to the delegators. I hope to solve these while working on some other features.

Do you have any ideas? Please let me know. 😉

Thank you


Thank you for reading until now and for your interest in this little project.

I want to give a special thank you to @metzli for delegating 1,000b RC to @hug.bot.

Also thank you to @anandkj611 (30b), @an-man (40b) and @slothlydoesit (111b) for delegating.

All the author rewards of this post are set to go to the delegators accordingly.
Yes, I am a sloth. I did not do the math for that one with correct proportions

Sort:  

!HUG 😁

Thank you :-)
!HUG

That's pretty nice! You got hugged by hug.bot!

Thank you for this! I don't give enough !HUG honestly I forget I have the token. Good reminder!!!

Great work on your bot! Good to see you found some time!

Thanks. Having a lot of fun while working on it.
!HUG 🤗

Congratulations @hannes-stoffel! You received a personal badge!

You powered-up at least 10 HIVE on Hive Power Up Day! This entitles you to a level 1 badge.
Participate in the next Power Up Day and try to power-up more HIVE to get a bigger Power-Bee.
May the Hive Power be with you!

You can view your badges on your board and compare yourself to others in the Ranking

Check out our last posts:

Hive Power Up Month Challenge - November 2024 Winners List
Hive Power Up Day - December 1st 2024
 23 days ago  

Let's HUG it out! Or we could just !SLOTH you up? Great content, awesome to see the HUG bot take the next step in it's Hive journey! And great to see you continue to refine and improve your Dev skills!

@hannes-stoffel! Your post is buzzing, you were tipped 0.01 SLOTHBUZZ on behalf of @slothbuzz.
Learn more about the SLOTHBUZZ Token at Sloth.Buzz and consider sharing your post there or using the #slothbuzz next time

(1/5)

Sounds great. Nice additions.
!HUG