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 on SteemSpeak.
Many (not all) features work on Golos as well.
$register <account> [chain] - associate account with your Discord user (chain default steem)$verify <account> [chain] - check account association with Discord users (chain default steem)$upvote [url] - upvote from cosgrove; empty or ^ to upvote last steemit link$ gem install cosgrove
... or in your Gemfile
gem 'steemdata-rb', require: 'steemdata', git: '[email protected]:steem-third-party/steemdata-rb.git'
gem 'cosgrove'
Add a config file to your ruby project called config.yml:
: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:
SecureRandom.hex(32)
application and create an app bot user.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=153600token and client_id in your bot constructor (see below).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:
require 'cosgrove'
bot = Cosgrove::Bot.new
bot.message(with_text: 'Ping!') do |event|
event.respond 'Pong!'
end
bot.run
git clone [email protected]:steem-third-party/cosgrove.gitcd cosgroverakeHELL_ENABLED=true rakeSee my previous Ruby How To posts in: #radiator #ruby
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.
I don't believe in intellectual "property". If you do, consider Cosgrove as licensed under a Creative Commons