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

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@eastmael·
0.000 HBD
ULOG #12: Finishing the Back-End (bot) for Ulog-Communities
![image.png](https://ipfs.busy.org/ipfs/Qmb9gHCaUYTyea4aBioUDvPWAGMbo5aH2Q8THoETiotzK4)

### 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](https://github.com/surpassinggoogle/ulog-communities/pull/7) - 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](https://github.com/surpassinggoogle/ulog-communities/pull/9) - 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](https://github.com/surpassinggoogle/ulog-communities-web).  

##### Refactors

1. [Use string interpolation to dynamically create failed comment; code reformats and refactor](https://github.com/surpassinggoogle/ulog-communities/pull/6) - 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](https://github.com/surpassinggoogle/ulog-communities/pull/8) - 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](https://ipfs.busy.org/ipfs/QmZcKyg1MbB9AW88AKPVA2prHvJqXF7f8dQieTCjdL4TPF)

#### 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<br/><div class="pull-right promo"><sub><p>This post was made from https://ulogs.org</p></sub></div>
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,