Introducing: Cosgrove - A STEEM Centric Discord Bot Framework
radiator·@inertia·
0.000 HBDIntroducing: Cosgrove - A STEEM Centric Discord Bot Framework
# [Cosgrove](https://github.com/steem-third-party/cosgrove) Cosgrove is a STEEM Centric Discord Bot Framework that allows you to write your own Discord bots that interact with the STEEM blockchain. One example of a bot that uses this framework is [@banjo](https://steemit.com/steemdata/@inertia/introducing-banjo) on SteemSpeak. Many (not all) features work on Golos as well. ## Features * **Registration** * `$register <account> [chain]` - associate `account` with your Discord user (`chain` default `steem`) * **Verification** * `$verify <account> [chain]` - check `account` association with Discord users (`chain` default `steem`) * **Up Voting** * `$upvote [url]` - upvote from cosgrove; empty or `^` to upvote last steemit link ## Installation ```bash $ gem install cosgrove ``` ... or in your `Gemfile` ```ruby gem 'steemdata-rb', require: 'steemdata', git: 'git@github.com:steem-third-party/steemdata-rb.git' gem 'cosgrove' ``` ## Setup Add a config file to your `ruby` project called `config.yml`: ```yaml :cosgrove: :token: :client_id: :secret: set this :chain: :steem_account: :steem_posting_wif: :golos_account: :golos_posting_wif: :steem_api_url: https://steemd.steemit.com :golos_api_url: https://ws.golos.io :discord: :log_mode: info ``` You will need to request a `token` and `client_id` from Discord (see below). Provide the accounts and `wif` private postings keys if you want your bot to upvote posts. You should change the `secret` key using the output of: ```ruby SecureRandom.hex(32) ``` ## Bot Registration 1. Request a new bot here: https://discordapp.com/developers/applications/me#top 2. Register an `application` and create an `app bot user`. 3. Replace `APP_CLIENT_ID` with the App's Client ID in this URL: https://discordapp.com/oauth2/authorize?&client_id=APP_CLIENT_ID&scope=bot&permissions=153600 4. Give that URL to the Discord server/guild owner and have them authorize the bot. 5. Set the `token` and `client_id` in your bot constructor (see below). ## Usage Cosgrove is based on `discordrb`, see: https://github.com/meew0/discordrb All features offered by `discordrb` are available in Cosgrove. In addition, Cosgrove comes with pre-defined commands. See them by typing: `$help` You can add you features thusly: ```ruby require 'cosgrove' bot = Cosgrove::Bot.new bot.message(with_text: 'Ping!') do |event| event.respond 'Pong!' end bot.run ``` ## Tests * Clone the client repository into a directory of your choice: * `git clone git@github.com:steem-third-party/cosgrove.git` * Navigate into the new folder * `cd cosgrove` * Basic tests can be invoked as follows: * `rake` * To run tests with parallelization and local code coverage: * `HELL_ENABLED=true rake` --- <center> <img src="http://i.imgur.com/7V09fNf.jpg" /> </center> See my previous Ruby How To posts in: [#radiator](https://steemit.com/created/radiator) [#ruby](https://steemit.com/created/ruby) ## Get in touch! If you're using Cosgrove, I'd love to hear from you. Drop me a line and tell me what you think! I'm @inertia on STEEM and Discord. ## License I don't believe in intellectual "property". If you do, consider Cosgrove as licensed under a Creative Commons [](http://creativecommons.org/publicdomain/zero/1.0/) License.
👍 inertia, letc, tamersameeh, aqeelmalik, camilojjj, ausbitbank, krystle, tarazkp, awesomianist, jyp, lagisnotgood, yangyang, banjo, rouketas, aggroed, minnowsupport, furion, makishart, bosjaya, elviento, dimimp, bhavnapatel68, bnt, uvas, whoib, moksamol, livingfree, ptytrader, havok777, darth-azrael, baddiiesfr, ratnameutia, ekitcho, robrigo, biophil, rok-sivante, freeyourmind, snowflake, philipnbrown, ozymandias, someonewhoisme, sharingeverybite, shenanigator, webdeals, rebel, donato, mrwang, speda, michaellamden68, transhuman, sunscape, prameshtyagi, steem-meme, graveric60, hilarski, dodders007, angel76, bue-witness, profitgenerator, bue, mini, healthcare, boy, bunny, moon, daniel.pan, coininstant, helen.tan, craigslist, honusurf, steemcenterwiki, aismor, gifmaster, midnas-howler, sethlinson, lola-carola, steemitlotteries, msg768, vidallia, jtstreetman, bola, kaeptnkook, bones, rexusmo, teamsteem, dahaz159, lauralemons, hitmeasap, virtualgrowth, lamech-m, someguy123, thegame, steembets, steemland.com, steemprentice, omarrium, lukinsawyer, uruiamme, momerathalice, jamesallen, teojin0503, pheonike, dolov, musiclover, illuminated, luckyjack, seablue, drewley, crowdfundedwhale, trafalgar, sandra, ihashfury, jason, jacobts, thomasgutierrez, trolling, vi1son, maikel, trans-juanmi, corvuscoraxx, juliosalas, joanawatts, afk, goldmatters, ameramr, amrizal, treasury, asksisk, shadowbrokers, joha09sohi, kurtbeil, etcmike, sumdumphok, bitcoinparadise, crok, antonyip, aaronpake, automaton, pimpmoney, barrydutton, clayboyn, steemwart, ydauti, robertor, mariacherries, kwak, avvah, jkkim, ianlim, gogo.tattoo, runridefly, sneakgeekz, ercpok, enjoywithtroy, grognak, the50, sephiroth, fabien, sandunfernando, nevermore, hangeul, zentat, geoffrey, lordvader, ace-one, victorvazco, abdullar, emilniz, wagnertamanaha, g-ladys, jdc, frankbacon, inna-yatsuk, spbesner, mathworksheets, alaysiababin, klye, sassal, wattacut, dez1337, elevator09, kaz1k, genics, responsive, elyaque, patelincho, titusfrost, krnel, judasp, etcbits, bledarus, nate-atkins, macartem, robertdurst10, julianita, transisto, user786, cljg918, the-ego-is-you, riskdebonair, saintrola, lautenglye, circuitshark, robert-call, proctologic, whalie, recrypto, newsflash, thedegensloth, fem-of-war, fyrstikken, dionj, muhammadraza, codypanama, giftedgaia, elprofe62, rmcfarlane, sandy143007, jlufer, da-dawn, staticinstance, schlees, abdularhman, epicdesigns, thatsweeneyguy, goingmobile, parthpatel, victorier, technium, dikkyamiputra, surprisebit, knuckz, mateusmourams, finux, o5faruk, rubenalexander, positivesteem, lifeasalion, linkku, ardina, justinejuly, yasiin, saleg25, nomad88, kiddarko, xcoil, diablocro, dienhassan, aeico, abbeymelchizedek, calinconst, juliash, bycz, samuelpaddy, mandibil, damarth, toniesteem, sabsel, cryptocurrencyb, piercetheveil, crisgojar, mutant-x, neroru, coocoocachoo, being-human, levfevzi, pr1m3, fridjon, pairmike, robi8888, panknil, tskeene, jkaj2000, emrekaykusuz, rublevoy, alexpmorris, punitchoudhary, hadif66, thuhtetnaing, jet4498, siragrays, drakos, binjeeclick, rowrowboatboat, maikol665, irwandi, triinoxys, caps, lonewolfahat, blingtendo, dliveupvote,