cosgrove 0.0.3rc1 → 0.0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/Gemfile.lock +12 -18
- data/README.md +15 -9
- data/cosgrove.gemspec +1 -0
- data/lib/cosgrove.rb +2 -0
- data/lib/cosgrove/comment_job.rb +2 -2
- data/lib/cosgrove/upvote_job.rb +1 -1
- data/lib/cosgrove/utils.rb +1 -1
- data/lib/cosgrove/version.rb +1 -1
- metadata +24 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98ba86984f44b954735318c62f777b6f866317aa
|
4
|
+
data.tar.gz: 63e2cfebd97a768ef26bd15998fdaac58561d6cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9f2941326f6ef68dac80bf31ca860e032c003976553510b9f96fab8ccbe685992b6cad3c6084cd6cdb4c2004b4efc4d3ddc4073c88129e7cbc1c935f550bc8b
|
7
|
+
data.tar.gz: 503b1dfec30ff481c10db6c6f9dfe5813ee17828ef36bc5fc900d2368af12f19c7a70a3d2469d43fecb44e65e8178846c1ad10a221ac05813c2c4acfd9c8eef2
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,15 +1,3 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git://github.com/steem-third-party/steem_api.git
|
3
|
-
revision: de44a65a21fa9f31db2a160132713a46b7cc7330
|
4
|
-
specs:
|
5
|
-
steem_api (1.0.0)
|
6
|
-
activerecord (>= 4, < 6)
|
7
|
-
activerecord-sqlserver-adapter (>= 4, < 6)
|
8
|
-
awesome_print (~> 1.7, >= 1.7.0)
|
9
|
-
nokogiri (~> 1.8)
|
10
|
-
rest-client (~> 2.0)
|
11
|
-
tiny_tds (~> 1.3)
|
12
|
-
|
13
1
|
GIT
|
14
2
|
remote: https://github.com/sparklemotion/mechanize.git
|
15
3
|
revision: f68b1a0bdeee9ec7c9a8b7854f8e6b81d62c43b2
|
@@ -28,7 +16,7 @@ GIT
|
|
28
16
|
PATH
|
29
17
|
remote: .
|
30
18
|
specs:
|
31
|
-
cosgrove (0.0.
|
19
|
+
cosgrove (0.0.3.1)
|
32
20
|
activesupport (~> 5.1, >= 5.1.1)
|
33
21
|
ai4r (~> 1.13, >= 1.13)
|
34
22
|
awesome_print (~> 1.7, >= 1.7.0)
|
@@ -42,6 +30,7 @@ PATH
|
|
42
30
|
rdiscount (~> 2.2, >= 2.2.0.1)
|
43
31
|
rmagick (~> 2.16, >= 2.16.0)
|
44
32
|
steem-slap (~> 0.0, >= 0.0.2)
|
33
|
+
steem_api (~> 1.1, >= 1.1.0)
|
45
34
|
steem_data (~> 0.0, >= 0.0.3)
|
46
35
|
wolfram-alpha (~> 0.3, >= 0.3.1)
|
47
36
|
|
@@ -81,7 +70,7 @@ GEM
|
|
81
70
|
arel (8.0.0)
|
82
71
|
awesome_print (1.8.0)
|
83
72
|
bitcoin-ruby (0.0.14)
|
84
|
-
bson (4.
|
73
|
+
bson (4.3.0)
|
85
74
|
builder (3.2.3)
|
86
75
|
concurrent-ruby (1.0.5)
|
87
76
|
connection_pool (2.2.1)
|
@@ -132,8 +121,8 @@ GEM
|
|
132
121
|
minitest (~> 5.0)
|
133
122
|
minitest-proveit (1.0.0)
|
134
123
|
minitest (> 5, < 7)
|
135
|
-
mongo (2.
|
136
|
-
bson (>= 4.
|
124
|
+
mongo (2.5.0)
|
125
|
+
bson (>= 4.3.0, < 5.0.0)
|
137
126
|
mongoid (6.2.1)
|
138
127
|
activemodel (~> 5.1)
|
139
128
|
mongo (>= 2.4.1, < 3.0.0)
|
@@ -187,6 +176,12 @@ GEM
|
|
187
176
|
simplecov-html (~> 0.10.0)
|
188
177
|
simplecov-html (0.10.2)
|
189
178
|
steem-slap (0.0.3)
|
179
|
+
steem_api (1.1.0)
|
180
|
+
activerecord (>= 4, < 6)
|
181
|
+
activerecord-sqlserver-adapter (>= 4, < 6)
|
182
|
+
nokogiri (~> 1.8)
|
183
|
+
rest-client (~> 2.0)
|
184
|
+
tiny_tds (~> 1.3)
|
190
185
|
steem_data (0.0.3)
|
191
186
|
mongoid (~> 6.1, >= 6.1.0)
|
192
187
|
thor (0.20.0)
|
@@ -199,7 +194,7 @@ GEM
|
|
199
194
|
unf_ext
|
200
195
|
unf_ext (0.0.7.4)
|
201
196
|
vcr (3.0.3)
|
202
|
-
webmock (3.
|
197
|
+
webmock (3.3.0)
|
203
198
|
addressable (>= 2.3.6)
|
204
199
|
crack (>= 0.3.2)
|
205
200
|
hashdiff
|
@@ -224,7 +219,6 @@ DEPENDENCIES
|
|
224
219
|
minitest-proveit (~> 1.0, >= 1.0.0)
|
225
220
|
rake (~> 12.1, >= 12.1.0)
|
226
221
|
simplecov (~> 0.11, >= 0.11.2)
|
227
|
-
steem_api!
|
228
222
|
vcr (~> 3.0, >= 3.0.3)
|
229
223
|
webmock (~> 3.0, >= 3.0.1)
|
230
224
|
yard (~> 0.8, >= 0.8.7.6)
|
data/README.md
CHANGED
@@ -8,15 +8,8 @@ Many (not all) features work on Golos as well.
|
|
8
8
|
|
9
9
|
## New features
|
10
10
|
|
11
|
-
* Added
|
12
|
-
|
13
|
-
* `upvote_rules` - uses channel specific rules.
|
14
|
-
* `100.00 %` - can be any valid voting percentage.
|
15
|
-
* `disable_comment_voting` - only posts can get votes.
|
16
|
-
* Added `CommentJob` for creating automated replies.
|
17
|
-
* Added callback `on_success_upvote_job` which can be used to, for example, reply to the post after being upvoted.
|
18
|
-
* Market data now uses Bittrex instead of Poloniex.
|
19
|
-
* Added `operators` to keep track of steem accounts that can do things like block upvotes (by blockchain mute).
|
11
|
+
* Added support for SteemApi as a fallback to SteemData.
|
12
|
+
* Gem updates.
|
20
13
|
|
21
14
|
## Features
|
22
15
|
|
@@ -26,6 +19,15 @@ Many (not all) features work on Golos as well.
|
|
26
19
|
* `$verify <account> [chain]` - check `account` association with Discord users (`chain` default `steem`)
|
27
20
|
* **Up Voting**
|
28
21
|
* `$upvote [url]` - upvote from cosgrove; empty or `^` to upvote last steemit link
|
22
|
+
* The ability for each discord channel to have its own upvote weight, as well as have a default. Upvote voting weight can be:
|
23
|
+
* `dynamic` - uses the bot's current voting recharge percent as the upvote percent.
|
24
|
+
* `upvote_rules` - uses channel specific rules.
|
25
|
+
* `100.00 %` - can be any valid voting percentage.
|
26
|
+
* `disable_comment_voting` - only posts can get votes.
|
27
|
+
* `CommentJob` for creating automated replies.
|
28
|
+
* Callback `on_success_upvote_job` which can be used to, for example, reply to the post after being upvoted.
|
29
|
+
* Market data now uses Bittrex instead of Poloniex.
|
30
|
+
* `operators` to keep track of steem accounts that can do things like block upvotes (by blockchain mute).
|
29
31
|
|
30
32
|
## Installation
|
31
33
|
|
@@ -128,6 +130,10 @@ bot.run
|
|
128
130
|
|
129
131
|
See my previous Ruby How To posts in: [#radiator](https://steemit.com/created/radiator) [#ruby](https://steemit.com/created/ruby)
|
130
132
|
|
133
|
+
Also see:
|
134
|
+
* [Introducing: Cosgrove - A STEEM Centric Discord Bot Framework](https://steemit.com/radiator/@inertia/introducing-cosgrove-a-steem-centric-discord-bot-framework)
|
135
|
+
* [How to Write a Discord Bot in Ruby](https://steemit.com/radiator/@inertia/how-to-write-a-discord-bot-in-ruby)
|
136
|
+
|
131
137
|
## Get in touch!
|
132
138
|
|
133
139
|
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.
|
data/cosgrove.gemspec
CHANGED
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
|
31
31
|
spec.add_dependency 'radiator', '~> 0.3', '>= 0.3.15'
|
32
32
|
spec.add_dependency 'steem_data', '~> 0.0', '>= 0.0.3'
|
33
|
+
spec.add_dependency 'steem_api', '~> 1.1', '>= 1.1.0'
|
33
34
|
spec.add_dependency 'golos_cloud', '~> 1.0', '>= 1.0.0'
|
34
35
|
spec.add_dependency 'discordrb', '~> 3.2', '>= 3.2.1'
|
35
36
|
spec.add_dependency 'ai4r', '~> 1.13', '>= 1.13'
|
data/lib/cosgrove.rb
CHANGED
data/lib/cosgrove/comment_job.rb
CHANGED
@@ -14,7 +14,7 @@ module Cosgrove
|
|
14
14
|
|
15
15
|
return if author.nil?
|
16
16
|
|
17
|
-
post = find_comment(chain: chain,
|
17
|
+
post = find_comment(chain: chain, author_name: author_name, permlink: permlink)
|
18
18
|
|
19
19
|
if post.nil?
|
20
20
|
cannot_find_input(event)
|
@@ -50,7 +50,7 @@ module Cosgrove
|
|
50
50
|
'Unable to vote.'
|
51
51
|
# elsif template == :welcome && author.post_count != 1
|
52
52
|
# 'Sorry, this function is intended to welcome new authors.'
|
53
|
-
elsif find_comment(chain: :steem,
|
53
|
+
elsif find_comment(chain: :steem, author_name: steem_account, parent_permlink: post.permlink).any?
|
54
54
|
title = post.title
|
55
55
|
title = post.permlink if title.empty?
|
56
56
|
"I already commented on #{title} by #{post.author}."
|
data/lib/cosgrove/upvote_job.rb
CHANGED
@@ -22,7 +22,7 @@ module Cosgrove
|
|
22
22
|
muters << steem_account
|
23
23
|
muted = muted by: muters, chain: :steem
|
24
24
|
|
25
|
-
post = find_comment(
|
25
|
+
post = find_comment(chain: :steem, author_name: author_name, permlink: permlink)
|
26
26
|
|
27
27
|
if post.nil?
|
28
28
|
cannot_find_input(event)
|
data/lib/cosgrove/utils.rb
CHANGED
data/lib/cosgrove/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cosgrove
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -230,6 +230,26 @@ dependencies:
|
|
230
230
|
- - ">="
|
231
231
|
- !ruby/object:Gem::Version
|
232
232
|
version: 0.0.3
|
233
|
+
- !ruby/object:Gem::Dependency
|
234
|
+
name: steem_api
|
235
|
+
requirement: !ruby/object:Gem::Requirement
|
236
|
+
requirements:
|
237
|
+
- - "~>"
|
238
|
+
- !ruby/object:Gem::Version
|
239
|
+
version: '1.1'
|
240
|
+
- - ">="
|
241
|
+
- !ruby/object:Gem::Version
|
242
|
+
version: 1.1.0
|
243
|
+
type: :runtime
|
244
|
+
prerelease: false
|
245
|
+
version_requirements: !ruby/object:Gem::Requirement
|
246
|
+
requirements:
|
247
|
+
- - "~>"
|
248
|
+
- !ruby/object:Gem::Version
|
249
|
+
version: '1.1'
|
250
|
+
- - ">="
|
251
|
+
- !ruby/object:Gem::Version
|
252
|
+
version: 1.1.0
|
233
253
|
- !ruby/object:Gem::Dependency
|
234
254
|
name: golos_cloud
|
235
255
|
requirement: !ruby/object:Gem::Requirement
|
@@ -534,9 +554,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
534
554
|
version: '0'
|
535
555
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
536
556
|
requirements:
|
537
|
-
- - "
|
557
|
+
- - ">="
|
538
558
|
- !ruby/object:Gem::Version
|
539
|
-
version:
|
559
|
+
version: '0'
|
540
560
|
requirements: []
|
541
561
|
rubyforge_project:
|
542
562
|
rubygems_version: 2.6.14
|