SteemPH Bot [KuyaBot] Update 07.08.18 - Trivia, Mining, and a whole lot more

@cloh76 · 2018-07-09 06:00 · utopian-io

123.gif

Repository

https://github.com/cloh76/Activity-Bot

It has been a few months since I updated and created a post about the SteemPH Community bot - KuyaBot. I have not had much time to work on updates and features that I have wanted for the longest time to implement. I took this weekend to try and get back on track amidst my busy schedule and was able to get some minor features added for the Community Bot.

My plan has always been to reduce the number of bots supporting the SteemPH Discord Server and we have already started down the path and removed 3 bots by integrating some of the functions and more widely used features into KuyaBot. I feel we have now reached a good balance of Bots with unique features to support the community.

With a little more effort, I continue to integrate and introduce new functions and features into KuyaBot. This weekend I worked on setting up additional activities which the community has asked for as well as features I previously set out to add but have been struggling to figure out.

New Features

As usual, you will find screenshots and code at the end of this post in order to stay organized. --- **Games and Fun** [Trivia] - Adding to the number of activities that are available to our community, I am proud to announce Trivia. It took me a little bit of time, but I was finally able to code a trivia game into KuyaBot using the Open Trivia Database. The community was previously asking for this function and although I knew what I wanted to do, I couldn't figure out how to make it happen. Since I am now using DBM to create and organize my bots, it helped make progress a bit easier. The trivia code allows all community users to join in and compete to see who can answer the most random multiple choice questions. [Mining] - This fun activity is exactly what it sounds like. Community members can purchase a PickAxe and mine for an assortment of random items within Discord. Just a few examples of random things participants will be able to find are Gems, Gold, Special Items - all which can be sold for Digital Pesos which they can add to their SteemPH Discord Bank accounts. They will also be able to randomly find Digital Pesos while mining as well as Digital Bitcoin. Currently, the Digital Bitcoin will be stored as a separate currency in users SteemPH Discord Bank, but this system will eventually pave the way for community members to earn the right to mine using my personal Bitcoin miners and earn real Bitcoin which will be stored and available to use. **Community** [Bank 2.0] - I have updated the Bank to include a reputation system which will not only serve as a system for future Buy/Sell features, but also for community involvement and support. Within the Bank, a function to store your Bitcoin balance has also been added. This is currently only a storage for Digital Bitcoin earned from the mining game mentioned above but is the foundation for a future mining reward system that will be incorporated which will focus on rewarding active and contributing participants of the community. [KuyaBot Upvotes Using Earned Discord Digital Pesos] - Although not yet complete, I am getting closer to finishing this function. Currently, all activity within Discord earns community members Discord Digital Pesos. My plan is for users to one day be able to use those banked Digital Pesos to pay KuyaBot for Upvotes on their Steemit, Utopian.io, DTube, and DLive content. I currently have the base code which allows the bot to upvote a post randomly by sending KuyaBot Digital Pesos and am continuously working on the code so users can specify the exact post they want to upvote. I'm hoping I can figure it out within the next week. More to come on this update! ### Ongoing Roadmap and things to come

[Games] - I am always trying to think of new games to add which can use the Digital Peso economy system I have built into the bot. Pokemon is still a work in progress and is a little more complicated to code given the dynamic complexity of the game. I'm trying to think of other games which can utilize both the Discord and Steem environment to help the community thrive. [Digital Peso Payment for Upvotes] - This is and will always be the most important and key update I continue to work on (at least until it is complete). This system will allow server members to use Digital Pesos as a form of payment for Upvotes. I continue to run into roadblocks, but as you can see from the update above, I am getting closer. ### Dependencies and Links

- DBM Mods dependencies - Open Trivia Database Dependency (opendtp) - General Wrex DBM Mods - KuyaBot|Activity Bot Github ### Screenshots and Code Samples

Trivia ![](https://cdn.steemitimages.com/DQmQpN1ukn8M5UNVakfr5E1ibYdb9cGSTaBqV8q1HoaGuK9/image.png)


{
  "name": "trivia",
  "permissions": "NONE",
  "restriction": "1",
  "_id": "Qwlbk",
  "actions": [
    {
      "member": "1",
      "varName": "",
      "info": "3",
      "storage": "1",
      "varName2": "username",
      "name": "Store Member Info"
    },
    {
      "token": "",
      "user": "",
      "pass": "",
      "url": "https://opentdb.com/api.php?amount=5&category=9&difficulty=easy&type=multiple",
      "path": "",
      "storage": "1",
      "varName": "triviaapi",
      "debugMode": "0",
      "headers": "",
      "name": "Store Json From WebAPI"
    },
    {
      "title": "Welcome!",
      "author": "",
      "color": "RANDOM",
      "timestamp": "false",
      "url": "",
      "authorIcon": "",
      "imageUrl": "",
      "thumbUrl": "",
      "storage": "1",
      "varName": "embedwelcome",
      "name": "Create Embed Message"
    },
    {
      "storage": "1",
      "varName": "embedwelcome",
      "message": "Welcome to trivia!\nWe hope you enjoy this trivia.\n\nThis trivia will focus on general knowledge. \n",
      "name": "Set Embed Description"
    },
    {
      "storage": "1",
      "varName": "embedwelcome",
      "message": "Trivia questions and answers via https://opentdb.com/\n",
      "footerIcon": "",
      "name": "Set Embed Footer"
    },
    {
      "storage": "1",
      "varName": "embedwelcome",
      "channel": "0",
      "varName2": "",
      "name": "Send Embed Message"
    },
    {
      "channel": "0",
      "varName": "",
      "message": "Let's get right into the first question shall we?",
      "storage": "0",
      "varName2": "",
      "name": "Send Message"
    },
    {
      "behavior": "0",
      "jsonObjectVarName": "triviaapi",
      "path": "results[0].question",
      "storage": "1",
      "varName": "question1",
      "name": "Parse From Stored Json"
    },
    {
      "behavior": "0",
      "jsonObjectVarName": "triviaapi",
      "path": "results[0].correct_answer",
      "storage": "1",
      "varName": "1correctanswer",
      "name": "Parse From Stored Json"
    },
    {
      "behavior": "0",
      "jsonObjectVarName": "triviaapi",
      "path": "results[0].incorrect_answers[0]",
      "storage": "1",
      "varName": "1incorrectanswer",
      "name": "Parse From Stored Json"
    },
    {
      "behavior": "0",
      "jsonObjectVarName": "triviaapi",
      "path": "results[0].incorrect_answers[1]",
      "storage": "1",
      "varName": "1incorrectanswer2",
      "name": "Parse From Stored Json"
    },
    {
      "behavior": "0",
      "jsonObjectVarName": "triviaapi",
      "path": "results[0].incorrect_answers[2]",
      "storage": "1",
      "varName": "1incorrectanswer3",
      "name": "Parse From Stored Json"
    },
    {
      "storage": "1",
      "varName": "randomanswer",
      "min": "1",
      "max": "3",
      "name": "Generate Random Number"
    },
    {
      "title": "Question",
      "author": "",
      "color": "RANDOM",
      "timestamp": "false",
      "url": "",
      "authorIcon": "",
      "imageUrl": "",
      "thumbUrl": "",
      "storage": "1",
      "varName": "question1embed",
      "name": "Create Embed Message"
    },
    {
      "storage": "1",
      "varName": "randomanswer",
      "comparison": "1",
      "value": "1",
      "iftrue": "0",
      "iftrueVal": "",
      "iffalse": "2",
      "iffalseVal": "19",
      "name": "Check Variable"
    },
    {
      "storage": "1",
      "varName": "question1embed",
      "message": "${tempVars(\"question1\")}\n\nYour Answers:\n${tempVars(\"1correctanswer\")}\n${tempVars(\"1incorrectanswer\")}\n${tempVars(\"1incorrectanswer2\")}\n${tempVars(\"1incorrectanswer3\")}\n\nWhich one is the correct answer.",
      "name": "Set Embed Description"
    },
    {
      "storage": "1",
      "varName": "randomanswer",
      "comparison": "1",
      "value": "1",
      "iftrue": "2",
      "iftrueVal": "28",
      "iffalse": "1",
      "iffalseVal": "",
      "name": "Check Variable"
    },
    {
      "name": "End Action Sequence"
    },
    {
      "storage": "1",
      "varName": "randomanswer",
      "comparison": "1",
      "value": "2",
      "iftrue": "0",
      "iftrueVal": "",
      "iffalse": "2",
      "iffalseVal": "24",
      "name": "Check Variable"
    },
    {
      "storage": "1",
      "varName": "question1embed",
      "message": "${tempVars(\"question1\")}\n\nYour Answers:\n${tempVars(\"1incorrectanswer\")}\n${tempVars(\"1correctanswer\")}\n${tempVars(\"1incorrectanswer2\")}\n${tempVars(\"1incorrectanswer3\")}\n\nWhich one is the correct answer.",
      "name": "Set Embed Description"
    },
    {
      "storage": "1",
      "varName": "randomanswer",
      "comparison": "1",
      "value": "2",
      "iftrue": "2",
      "iftrueVal": "28",
      "iffalse": "1",
      "iffalseVal": "",
      "name": "Check Variable"
    },
    {
      "name": "End Action Sequence"
    },
    {
      "name": "End Action Sequence"
    },
    {
      "storage": "1",
      "varName": "randomanswer",
      "comparison": "1",
      "value": "3",
      "iftrue": "0",
      "iftrueVal": "",
      "iffalse": "1",
      "iffalseVal": "",
      "name": "Check Variable"
    },
    {
      "storage": "1",
      "varName": "question1embed",
      "message": "${tempVars(\"question1\")}\n\nYour Answers:\n${tempVars(\"1incorrectanswer\")}\n${tempVars(\"1incorrectanswer2\")}\n${tempVars(\"1incorrectanswer3\")}\n${tempVars(\"1correctanswer\")}\nWhich one is the correct answer.",
      "name": "Set Embed Description"
    },
    {
      "storage": "1",
      "varName": "randomanswer",
      "comparison": "1",
      "value": "2",
      "iftrue": "2",
      "iftrueVal": "28",
      "iffalse": "1",
      "iffalseVal": "",
      "name": "Check Variable"
    },
    {
      "name": "End Action Sequence"
    },
    {
      "storage": "1",
      "varName": "question1embed",
      "message": "Please type your answer now!",
      "footerIcon": "",
      "name": "Set Embed Footer"
    },
    {
      "storage": "1",
      "varName": "question1embed",
      "channel": "0",
      "varName2": "",
      "name": "Send Embed Message"
    },
    {
      "storage": "0",
      "varName": "",
      "filter": "content.length > 0",
      "max": "1",
      "time": "60000",
      "varName2": "checkanswerquestionone",
      "storage2": "0",
      "iftrue": "0",
      "iftrueVal": "",
      "iffalse": "1",
      "iffalseVal": "",
      "name": "Await Response Call Action"
    },
    {
      "channel": "0",
      "varName": "",
      "info": "4",
      "storage": "1",
      "varName2": "question1answermessage",
      "name": "Store Channel Info"
    },
    {
      "message": "1",
      "varName": "question1answermessage",
      "info": "2",
      "storage": "1",
      "varName2": "question1text",
      "name": "Store Message Info"
    },
    {
      "storage": "1",
      "varName": "question1text",
      "comparison": "6",
      "value": "tempVars(\"1correctanswer\")",
      "iftrue": "2",
      "iftrueVal": "36",
      "iffalse": "0",
      "iffalseVal": "21",
      "name": "Check Variable"
    },
    {
      "channel": "0",
      "varName": "",
      "message": "**I'm sorry, you got the answer wrong, Better Luck Next Time**\nThe answer I was looking for was, ${tempVars(\"1correctanswer\")}",
      "storage": "0",
      "varName2": "",
      "name": "Send Message"
    },
    {
      "name": "End Action Sequence"
    },
    {
      "channel": "0",
      "varName": "",
      "message": "You have got the answer right! ${member}",
      "storage": "0",
      "varName2": "",
      "name": "Send Message"
    }
  ]
}

Mining ![](https://cdn.steemitimages.com/DQmeRum5jju92egkBV9AhBUTd8UNqTDrZQB62JJfYB5Lwf7/image.png) ![](https://cdn.steemitimages.com/DQmZnkC4EqCxXTorZmPDcpbrMuAH4J5r7MASUA9S7dQfQrG/image.png)


{
  "name": "mine",
  "permissions": "NONE",
  "restriction": "1",
  "_id": "LbPuW",
  "actions": [
    {
      "comment": "Mining System! Hopefully you enjoy this Mining system, Please let me know of your feedback!",
      "color": "#00ff80",
      "name": "Comment"
    },
    {
      "member": "1",
      "varName": "",
      "dataName": "pickaxe",
      "defaultVal": "0",
      "storage": "1",
      "varName2": "pickaxe",
      "name": "Store Member Data"
    },
    {
      "member": "1",
      "varName": "",
      "dataName": "Credit",
      "defaultVal": "0",
      "storage": "1",
      "varName2": "Credit",
      "name": "Store Member Data"
    },
    {
      "member": "1",
      "varName": "",
      "dataName": "bitcoinbalance",
      "defaultVal": "0",
      "storage": "1",
      "varName2": "bitcoinbalance",
      "name": "Store Member Data"
    },
    {
      "member": "1",
      "varName": "",
      "dataName": "cooldownmining",
      "defaultVal": "0",
      "storage": "1",
      "varName2": "cooldownmining",
      "name": "Store Member Data"
    },
    {
      "info": "0",
      "infoIndex": "1",
      "storage": "1",
      "varName": "param",
      "name": "Store Command Params"
    },
    {
      "comment": "Help Command.",
      "color": "#000000",
      "name": "Comment"
    },
    {
      "condition": "0",
      "comparison": "2",
      "value": "0",
      "iftrue": "2",
      "iftrueVal": "14",
      "iffalse": "0",
      "iffalseVal": "",
      "name": "Check Parameters"
    },
    {
      "title": "Help Menu",
      "author": "",
      "color": "RANDOM",
      "timestamp": "false",
      "url": "",
      "authorIcon": "",
      "imageUrl": "",
      "thumbUrl": "",
      "storage": "1",
      "varName": "helpembed",
      "name": "Create Embed Message"
    },
    {
      "storage": "1",
      "varName": "helpembed",
      "message": "!mine start - Go mining in the channel the command is done.\n!mine - for this mine command help.\n!mine pickaxe - Buy a pickaxe here.",
      "name": "Set Embed Description"
    },
    {
      "storage": "1",
      "varName": "helpembed",
      "channel": "0",
      "varName2": "",
      "name": "Send Embed Message"
    },
    {
      "name": "End Action Sequence"
    },
    {
      "comment": "BEGIN MINING COMMAND!",
      "color": "#000000",
      "name": "Comment"
    },
    {
      "storage": "1",
      "varName": "param",
      "comparison": "1",
      "value": "\"start\"",
      "iftrue": "0",
      "iftrueVal": "",
      "iffalse": "2",
      "iffalseVal": "103",
      "name": "Check Variable"
    },
    {
      "member": "1",
      "varName": "",
      "dataName": "pickaxe",
      "comparison": "1",
      "value": "1",
      "iftrue": "0",
      "iftrueVal": "",
      "iffalse": "2",
      "iffalseVal": "99",
      "name": "Check Member Data"
    },
    {
      "member": "1",
      "varName": "",
      "dataName": "cooldownmining",
      "comparison": "1",
      "value": "1",
      "iftrue": "2",
      "iftrueVal": "101",
      "iffalse": "0",
      "iffalseVal": "101",
      "name": "Check Member Data"
    },
    {
      "storage": "1",
      "varName": "randomsay",
      "min": "1",
      "max": "3",
      "name": "Generate Random Number"
    },
    {
      "member": "1",
      "varName": "",
      "dataName": "cooldownmining",
      "changeType": "0",
      "value": "1",
      "name": "Control Member Data"
    },
    {
      "storage": "1",
      "varName": "randomsay",
      "comparison": "1",
      "value": "1",
      "iftrue": "0",
      "iftrueVal": "",
      "iffalse": "2",
      "iffalseVal": "24",
      "name": "Check Variable"
    },
    {
      "channel": "0",
      "varName": "",
      "message": "**You head deep into the cave...**\n",
      "storage": "0",
      "varName2": "",
      "name": "Send Message"
    },
    {
      "storage": "1",
      "varName": "randomsay",
      "comparison": "1",
      "value": "1",
      "iftrue": "2",
      "iftrueVal": "31",
      "iffalse": "1",
      "iffalseVal": "",
      "name": "Check Variable"
    },
    {
      "name": "End Action Sequence"
    },
    {
      "storage": "1",
      "varName": "randomsay",
      "comparison": "1",
      "value": "2",
      "iftrue": "0",
      "iftrueVal": "",
      "iffalse": "2",
      "iffalseVal": "27",
      "name": "Check Variable"
    },
    {
      "channel": "0",
      "varName": "",
      "message": "**You make your way into the cave..**",
      "storage": "0",
      "varName2": "",
      "name": "Send Message"
    },
    {
      "storage": "1",
      "varName": "randomsay",
      "comparison": "1",
      "value": "2",
      "iftrue": "2",
      "iftrueVal": "31",
      "iffalse": "1",
      "iffalseVal": "46",
      "name": "Check Variable"
    },
    {
      "name": "End Action Sequence"
    },
    {
      "storage": "1",
      "varName": "randomsay",
      "comparison": "1",
      "value": "3",
      "iftrue": "0",
      "iftrueVal": "",
      "iffalse": "1",
      "iffalseVal": "",
      "name": "Check Variable"
    },
    {
      "channel": "0",
      "varName": "",
      "message": "**You have started mining..**",
      "storage": "0",
      "varName2": "",
      "name": "Send Message"
    },
    {
      "storage": "1",
      "varName": "randomsay",
      "comparison": "1",
      "value": "3",
      "iftrue": "2",
      "iftrueVal": "31",
      "iffalse": "1",
      "iffalseVal": "",
      "name": "Check Variable"
    },
    {
      "name": "End Action Sequence"
    },
    {
      "input": "0:",
      "wordLength": "2",
      "storage": "1",
      "varName": "timerandom",
      "name": "Randomize Letters"
    },
    {
      "time": "${tempVars(\"timerandom\")}",
      "measurement": "2",
      "name": "Wait"
    },
    {
      "storage": "1",
      "varName": "minerange",
      "min": "1",
      "max": "10",
      "name": "Generate Random Number"
    },
    {
      "storage": "1",
      "varName": "fishrange",
      "comparison": "1",
      "value": "1",
      "iftrue": "0",
      "iftrueVal": "",
      "iffalse": "2",
      "iffalseVal": "40",
      "name": "Check Variable"
    },
    {
      "channel": "0",
      "varName": "",
      "message": "**You were unable to find anything in your mining timeframe. ${member} ** ",
      "storage": "0",
      "varName2": "",
      "name": "Send Message"
    },
    {
      "member": "1",
      "varName": "",
      "dataName": "cooldownmining",
      "changeType": "0",
      "value": "1",
      "name": "Control Member Data"
    },
    {
      "time": "15",
      "measurement": "2",
      "name": "Wait"
    },
    {
      "member": "1",
      "varName": "",
      "dataName": "cooldownmining",
      "changeType": "0",
      "value": "0",
      "name": "Control Member Data"
    },
    {
      "name": "End Action Sequence"
    },
    {
      "storage": "1",
      "varName": "fishrange",
      "comparison": "1",
      "value": "2",
      "iftrue": "0",
      "if
            
#utopian-io #development #steemph #bot #javascript
Payout: 0.000 HBD
Votes: 173
More interactions (upvote, reblog, reply) coming soon.