It's alive!
Picture from imgflip.com
A new bot in town?
Thanks to input by community members in the slothbuzz discord the idea of a tipping bot took shape.
The quickest solution was taking the code from Pizza Bot and send it on its way with a few adjustments. You know, the typical stuff. Giving out SLOTHBUZZ tokens instead of PIZZA and what command to look for.
But, oh my, that code is now over two years old. And sadly the bot crashed over and over again.
Of course we know the actual PIZZA bot to be working perfectly. As do many other bots. But there is no code available to replicate that for the sloth.
All the currently running bots (as far as I could research) are somewhat closed source. I understand and join that sentiment. Why give away something for free if we worked so hard to get it working?
Getting back into the game
After 10 years of absence I decided to get back into the game. I have never done python programming before but a few other languages.
After a crash course tutorial on python to get the basics down I took a look at the code to figure out what is wrong.
A big thank you to the PIZZA Guild for putting it up there. It helped me a lot to get started and to figure out how things should work.
To get the most out of it for myself, I decided to start from scratch. The PIZZA code was a big help in pointing me into the right direction and what libraries to use.
I opened my own little Discord test server and after just a few lines of code I was able to read this message:
From there I built a new bot from scratch, step by step.
What does it do?
It is a pure tipping bot. It reads the comments from the blockchain and looks for one specific command (to be set in the config file).
Then it checks the wallet of the comment author if it meets the requirements for a call.
If the call is accepted the tip is sent and a comment written to inform the author and recipient.
Otherwise a comment is written to inform why the call failed. Except for self tipping and tipping the bot. If you do that, it will simply be ignored.
If a Discord webhook is provided in the config file, all those actions are logged into that discord channel.
What is different?
First of all I did not integrate any kind of vote following. The goal was a pure tipping bot.
I put in exception handlers to at least get a discord message out if something causes a crash. That way we can notice it much earlier, as long as the exception is not related to network or Discord failure.
The configuration of tipping levels is completely different.
The old config needed one config section per tipping level and adjusted code to read in that config. Now it is based on a list that can have as many entries as you want:
In this example we put in 5 tipping levels:
- 50 Tokens staked: make 50 calls per day with 0.01 tipped
- 20 Tokens staked: make 40 calls per day with 0.01 tipped
- 10 Tokens staked: make 30 calls per day with 0.01 tipped
- 5 Tokens staked: make 20 calls per day with 0.01 tipped
- 1 Token staked: make 10 calls per day with 0.01 tipped
We can simply adjust these numbers in the config with as many entries as needed.
A few other options have been introduced, including these two:
This comma separated list (like the staking levels above) will allow community moderators and ambassadors to tip without restriction and the need to stake up a lot of tokens.
And with the permlink added to the log message, the Discord looks like this:
The internal logic was completely rewritten. I thought about going on a bug hunt and simply try to fix the bot. But then again, I wanted to gain the most experience in a new language. So I decided for a rewrite.
So what now?
Now I'm waiting for my baby to go live as sloth.buzz bot and hope it won't disappoint me. The bot is live, that was the main goal. If Now with that accomplished I will have some time to work on the next version.
In the meantime I am in a pickle. On one hand I remember the feeling of frustration when we were looking for a bot to put to use. So many are live on the chain and none available to be put to use. How great would it have been had we stumbled upon this code? Problem solved.
On the other hand I had a lot of fun learning python and have to admit I really started to like this language. And of course, honestly, I don't want to simply hand out free stuff. After all, the others aren't doing it either.
In the future
Once Now that the bot is live and running I want to develop the next version. There are many ideas in my head on how to further improve its usefulness to the community. And I am already getting excellent suggestions on what to implement next.
When that is done and the new version is running live, I will put today's version up on github for everyone else to use for free. That should get rid of my pickle situation.
If you are interested in the code before that time, feel free to contact me. I am sure we can work something out.
Thank you for reading and look out for the !SLOTH
Awesome post! Awesome bot! We'll hopefully have it up and running soon!
Thanks for all the time and effort you spent on this! Glad you found your buzz of coding again! The possibilities are endless on Hive!
Thanks for giving me the opportunity. 😊
So nice to see it up and running and doing its thing.
!BBH
@slothbuzz! Your Content Is Awesome so I just sent 1 $BBH (Bitcoin Backed Hive) to your account on behalf of @hannes-stoffel. (2/20)
💪🫵💪🫵🔥🫵💪🫵💪
😍
Again, awesome work Bro, thanks so much 🙏
!SLOTH
@hannes-stoffel! You post is buzzing, you were tipped 0.01 SLOTHBUZZ on behalf of @patlebo.
Learn more about the SLOTHBUZZ Token at [Sloth.Buzz](https://www.sloth.buzz/@slothbuzz/sloth-buzz-but-what-is-it-token-curator-witness-outpost-these-sloths-are-buzzing-everywhere) and consider sharing your post there or using the #slothbuzz next time
(1/3)
Thank you very much. 😊
Glad it is up and running now.
!PIZZA
It's ALIVE!!!
!ALIVE !PIMP
But more improtantly !SLOTH
You must be killin' it out here!
@slothbuzz just slapped you with 1.000 PIMP, @hannes-stoffel.
You earned 1.000 PIMP for the strong hand.
They're getting a workout and slapped 1/1 possible people today.
Read about some PIMP Shit or Look for the PIMP District
@hannes-stoffel! You post is buzzing, you were tipped 0.01 SLOTHBUZZ on behalf of @slothbuzz.
Learn more about the SLOTHBUZZ Token at [Sloth.Buzz](https://www.sloth.buzz/@slothbuzz/sloth-buzz-but-what-is-it-token-curator-witness-outpost-these-sloths-are-buzzing-everywhere) and consider sharing your post there or using the #slothbuzz next time
(1/4)
@hannes-stoffel! You Are Alive so I just staked 0.1 $ALIVE to your account on behalf of @slothbuzz. (1/10)
The tip has been paid for by the We Are Alive Tribe through the earnings on @alive.chat, feel free to swing by our daily chat any time you want.
!LOL
Indeed. 😁
lolztoken.com
He was gladiator.
Credit: reddit
@slothbuzz, I sent you an $LOLZ on behalf of @hannes-stoffel
(1/4)
!PIZZA
Posted using sloth.buzz
thanks. 😊
!BEER
View or trade
BEER
.Hey @anandkj611, here is a little bit of
BEER
from @hannes-stoffel for you. Enjoy it!Do you want to win SOME BEER together with your friends and draw the
BEERKING
.PIZZA Holders sent $PIZZA tips in this post's comments:
anandkj611 tipped hannes-stoffel (x1)
@hannes-stoffel(1/5) tipped @patlebo (x1)
Join us in Discord!
Awesome result :)
!SLOTH
Posted using sloth.buzz
@hannes-stoffel! You post is buzzing, you were tipped 0.01 SLOTHBUZZ on behalf of @herman-german.
Learn more about the SLOTHBUZZ Token at [Sloth.Buzz](https://www.sloth.buzz/@slothbuzz/sloth-buzz-but-what-is-it-token-curator-witness-outpost-these-sloths-are-buzzing-everywhere) and consider sharing your post there or using the #slothbuzz next time
(1/3)
thank you 😊
!Luv
@herman-german, @hannes-stoffel(1/10) sent you LUV. | tools | discord | community | HiveWiki | NFT | <>< daily