README.md in cosgrove-0.0.4.0 vs README.md in cosgrove-0.0.4.1
- old
+ new
@@ -3,13 +3,12 @@
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.
## New features
-
-* Support for SteemApi (replacing SteemData; dropped mongodb support)
-* Optimized interactive messages to update as data is acquired in realtime
+
+* Engine support provided by the `Cosgrove::Utils` module.
* Bug fixes
* Gem updates.
## Features
@@ -26,10 +25,12 @@
* `disable_comment_voting` - only posts can get votes.
* `CommentJob` for creating automated replies.
* Callback `on_success_upvote_job` which can be used to, for example, reply to the post after being upvoted.
* Market data now uses Bittrex instead of Poloniex.
* `operators` to keep track of steem accounts that can do things like block upvotes (by blockchain mute).
+ * Support for HiveSQL
+ * Optimized interactive messages to update as data is acquired in realtime
## Installation
```bash
$ gem install cosgrove
@@ -64,10 +65,15 @@
:disable_comment_voting: true
:chain:
:steem_account:
:steem_posting_wif:
:steem_api_url: https://api.steemit.com
+ :steem_engine_api_url: https://api.steem-engine.com/rpc
+ :hive_engine_api_url: https://api.hive-engine.com/rpc
+ :hive_account:
+ :hive_posting_wif:
+ :hive_api_url: https://api.steem.house
:discord:
:log_mode: info
```
You will need to request a `token` and `client_id` from Discord (see below).
@@ -86,25 +92,23 @@
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).
-## SteemSQL
+## HiveSQL
-Some features provided by `cosgrove` require access to [SteemSQL](http://steemsql.com/), which is a Microsoft SQL database containing all the Steem blockchain data.
+Some features provided by `cosgrove` require access to [HiveSQL](http://hivesql.io/), which is a Microsoft SQL database containing all the Steem blockchain data.
**Please note:**
-> SteemSQL has moved to a monthly subscription model and the default free account/password “steemit/steemit” has been disabled.
+If you intend to use HiveSQL, you can provide the credentials in `authorize-hive-sql.sh`, then use this terminal command to enable HiveSQL just before running your bot. Copy the example `example-authorize-hive-sql.sh` and add your credentials:
-If you intend to use SteemSQL, you can provide the credentials in `authorize-steem-sql.sh`, then use this terminal command to enable SteemSQL just before running your bot. Copy the example `example-authorize-steem-sql.sh` and add your credentials:
-
```bash
-source path/to/authorize-steem-sql.sh
+source path/to/authorize-hive-sql.sh
```
-Features that currently require SteemSQL:
+Features that currently require HiveSQL:
* Details in `$mvests` command
* Any command that tries to suggest account names
* `$upvote` (when checking for dailly limits)
@@ -121,9 +125,37 @@
bot = Cosgrove::Bot.new
bot.message(with_text: 'Ping!') do |event|
event.respond 'Pong!'
+end
+
+bot.run
+```
+
+### Engine Lookups
+
+Here's an example of a bot that does Engine API calls when you type: `$bal ENG alice`
+
+```ruby
+require 'cosgrove'
+
+include Cosgrove::Utils
+
+bot = Cosgrove::Bot.new
+
+bot.command :bal do |event, *args|
+ symbol = args[0].strip.upcase
+ account = args[0].strip.downcase
+ params = {
+ query: {
+ symbol: symbol,
+ account: account
+ }
+ }
+ result = steem_engine_contracts(:findOne, params)
+
+ "#{result['balance']}'s '#{result['symbol']}: #{result['balance']}"
end
bot.run
```