ULOG #12: Finishing the Back-End (bot) for Ulog-Communities

in #ulog5 years ago

image.png

Repository

https://github.com/surpassinggoogle/ulog-communities

Task Request

https://steemit.com/utopian-io/@surpassinggoogle/task-request-help-us-develop-a-summon-bot-that-can-vote-and-comment-on-authors-designed-to-run-ulog-communities-and-ulog-subtags

Pull Requests

Implementation
  1. Parameterized bot command and overseer max vote weight config - this was not included in the original TR specifications but a feature that surfaced during development. I needed a way for a summoner to specify the vote weight a post will get. This PR added that.
  2. Use MongoDB to get overseer info - This PR was a major modification because it changed the source of the overseer configuration from being hard-coded in config.ts to data stored in mongo db. This PR completes the TR on the back-end side, and the front-end to modify the overseer info will be developed in a new repository.
Refactors
  1. Use string interpolation to dynamically create failed comment; code reformats and refactor - although based on the TR, Terry was okay with having a fixed or generic template that includes all of the criteria that will be used as a reply to a summoner if he did not satisfy any of the criteria, this PR took it a step further by having a dynamic template that used flags whether to display or not a certain criterion.
  2. Add check if bot already voted on post; added overseer configs - as I was testing the bot, there were cases where in a post was up-voted but did not receive the new vote weight which resulted to wasted vote power. This PR added the vote check and included it in one of the up-vote criteria to be sent as a reply to a summoner.

Feature in Action

https://ulogs.org/@east.autovote/ulog-ulog-communities-demo

image.png

Lesson Learned

Initially, I planned of having the overseer configuration hard-coded in config.ts and just let Terry update the codes for additional overseers. However, a part of me was dissatisfied with this level of quality.

As someone who was mentored to practice excellence and to finish what I start, I opted to pursue implementing the overseer configuration persisted somewhere to be modifiable from a web front-end. I initially planned it to be stored in a text file, but my instinct said to go with a database.

GitHub Account

https://github.com/eastmaels

This post was made from https://ulogs.org

Sort:  

Hi there,

Great implementation and great solution for the task request. Congrats.

Regarding the error handling on voting, do you have anything in your mind to implement a retry mechanism, here?

Also, if the voting fails, it might be good to log the corresponding error to debug the problem.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Hi Emre thanks for the tip regarding logging a more descriptive info of post in error handling when voting fails. For now, I haven't considered adding a retry attempt if vote fails. Based on your experience developing bots for steem, which particular case did you encounter most often that required a vote retry? I'm thinking of addressing the problem when it arises.

Thank you for your review, @emrebeyler! Keep up the good work!

Nice work there you are back once again with great implementations :)

Thank you. Always looking for ways to contribute to the development of Steem. :)

Thanks for the update :-)

This comment was made from https://ulogs.org

Hey, @eastmael!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Congratulations! Your post has been selected as a daily Steemit truffle! It is listed on rank 21 of all contributions awarded today. You can find the TOP DAILY TRUFFLE PICKS HERE.

I upvoted your contribution because to my mind your post is at least 6 SBD worth and should receive 68 votes. It's now up to the lovely Steemit community to make this come true.

I am TrufflePig, an Artificial Intelligence Bot that helps minnows and content curators using Machine Learning. If you are curious how I select content, you can find an explanation here!

Have a nice day and sincerely yours,
trufflepig
TrufflePig

I found a very good info, thank you that you have been on my side

Hi @eastmael!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Coin Marketplace

STEEM 0.35
TRX 0.12
JST 0.040
BTC 70601.40
ETH 3576.96
USDT 1.00
SBD 4.75