Stephard 2.0 successfully implemented into #teammalaysia group!

in utopian-io •  7 years ago  (edited)

Yesterday, Stephard 2.0 had successfully implemented into #teammalaysia discord group. Therefore, I will talk a bit about the updates in a technical perspective.


Checkout the previous post on the release on Stephard 1.0.

[ Utopian Link | Steemit Link ]


Bug Fixes

Thanks for @codingdefined pointed out the possible issues in the previous post.

  • What was the issue(s)?

    • In our previous implementation of Stephard (version 1.0), the approach was stateless (without database), therefore there is a possibility of abusing it with deleting old messages in discord and send it again in discord channel.
    • User of discord are unable to track their last post, which means they need to do it manually by scrolling back to their older messages.
  • What was the solution?

    • In this version 2 update, I added a Database which is MongoDB. The database will store the discord ID, steem ID, and the last post datetime.
    • Since there is database implemented, user can track their last post datetime.

New Features

  • What feature(s) did you add?
    • Prevent abuse of post-promo channel to the next level.
    • Some of the commands for registration.

Screen Shot 2018-01-18 at 3.00.38 PM.png

  • *reg <steem_name> to link discord account to steem username

Screen Shot 2018-01-18 at 3.02.54 PM.png

  • *update <steem_name> to update your steem username

Screen Shot 2018-01-18 at 3.03.00 PM.png

  • *last to check your last post datetime.

Screen Shot 2018-01-18 at 3.03.32 PM.png

  • How did you implement it/them?
    • This version 2 update, I added 2 bots instead of a single one.
      • stephard-2 is the watcher that will approve or reject a post.
      • stephard-2-reg is the registration bot, to link user's discord ID to their respective, user can check their last post datetime.

Details about stephard-2-reg

I implemented MongoDB into the bot.

This is how the schema looks like for User.

let userSchema = new Schema({
  name: { type: String, required: true },
  discordid: { type: String, required: true, unique: true },
  steemname: { type: String, required: true },
  lastpostdatetime: { type: Number }
});

The schema links user discord ID and steem user name. The lastpostdatetime is to keep track the time in UNIX, so that we can make sure everyone shared their link after 18 hours of the previous message.

The library (NPM Package) that I use:-

  • discord.js - the official discord NPM package
  • mongoose - the object modelling for MongoDB

About this Projects

Stephard version 2.0



Designed by Freepik

  • What is the project about?
    This project is building a bot called stephard that will prevent discord user in our channel abuse post-promo. The on going goal is to create a upvote bot based on the post-promo channel, and upvotes post that shared by our community.

  • Technology Stack

    • Node.js
    • Babel
    • MongoDB
    • Hosting at Digital Ocean (Ubuntu 1GB RAM)
  • Roadmap

    • Prevent abuse of post-promo channel by implementing a bot [DONE]
    • Show steem username link to discord name
    • Implement Upvote Bot that automatically upvote based on link in post-promo channel
  • How to contribute?
    This project is under MIT License with 2 Github Repository, feel free to send in issues and Pull Request.

What's Next?

  • This bot will be implement to Qurator post-promo channel on discord within this week.
  • Adding Test into the workflow. Considering using Mocha for BDD.
  • After this, I will start building upvote bot in #teammlaysia channel.



Posted on Utopian.io - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Hey @superoo7 I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Rock on Stephard. You're a real treasure to #teammalaysia. Appreciate all your contribution benefiting all of us :)

You're welcome man. You also did a lot of great job for us too!

Your contribution has been approved.

For questions and feedback you can contact us on Discord.

[utopian-moderator]

Thank you moderator, that was quick

Awesome stuff bro! Even though I'm not familiar with all of the technical details, it was a insightful read. Thanks for your work on the Team malaysia discord man.

You're welcome man. Learn a lot on the way of building bot

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by superoo7 from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.

  ·  7 years ago 

@superoo Way to go bro. It's about time to let Steemit know about this awesome tool :)

Thank you @superoo7. I don't understand the technical part that you are doing, but what I know, the system is really helpful.

Thank you very much.

You are welcome 😁
Thanks for stopping by

Cheers