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

image.png

Repository

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

Task Request

@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

@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

H2
H3
H4
Upload from PC
Video gallery
3 columns
2 columns
1 column
10 Comments