elephrame 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bacbf531fa6368eb2e401e3492192eb9ae230966edc62f3971f3566430b64f5
4
- data.tar.gz: 8a09ce7796b7acd043f73195fd7511eda01cd8f5abf6de2aa081f17aec1fa46c
3
+ metadata.gz: b3047355c6ddb30f39deed09340f218ace45c35fa3a708ede96e501f3f2b6911
4
+ data.tar.gz: f0948d711fa2115cd6b55f2b4b6a23ec74008a73529d29c71206fffa4b5e7cce
5
5
  SHA512:
6
- metadata.gz: f836c9f830ea5a24a52f8e708b96a6e26ecfff5c03182b0ccbf98787442f9ab4b9508bdd2ff9a340cd318723d265f97bd07506725048d2b2313bd86cd5451e99
7
- data.tar.gz: 356c31e481d1d7892759fed57dbc41610364624e60725c23ff53f788a2245e66e5a6843f88ab4cf7295065dcfcf193a8f252167f57f9c89195482714543a548d
6
+ metadata.gz: be84cbec9572c6b8d9af87df3ea6b089241d96a1d097a53aea9a569fca74632a55e21b0ed099fb89d061365686aa4306af82ef4ca1447a4950f966017d2aba7c
7
+ data.tar.gz: 16a0cac4be2a53952f0f14954ea51dca3bdbd859ed0a9bd64cf59986c50a0393b8f96c5f58fedf45228c6972f7e48d8eb249f4c325e3fddef2e7fb3a40453c24
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- elephrame (0.3.2)
4
+ elephrame (0.3.3)
5
5
  moostodon (~> 0.2.0)
6
6
  rufus-scheduler
7
7
 
data/README.md CHANGED
@@ -65,7 +65,7 @@ Exposed methods from bot object:
65
65
  - `client` this is the underlying mastodon rest client we use in the backend. use this to make custom calls to the api for which we don't provide a helper
66
66
  - `username` the name of the bot as fetched by verify_credentials
67
67
  - `strip_html` (defaults to true) if set, the framework will automatically strip all html symbols from the post content
68
- - `post(content, visibility: 'unlisted', spoiler: '', reply_id: '', media: [])` this provides an easy way to post statuses from inside code blocks
68
+ - `post(content, visibility: 'unlisted', spoiler: '', reply_id: '', hide_media: false, media: [])` this provides an easy way to post statuses from inside code blocks
69
69
  - `reply(content)` a shorthand method to reply to the last mention (Note: doesn't automatically @ the other user/s)
70
70
  - `find_ancestor(id, depth = 10, stop_at = 1)` looks backwards through reply chains for the most recent post the bot made starting at post `id` until it hits `depth` number of posts, or finds `stop_at` number of it's own posts
71
71
  - `no_bot?(account_id)` returns true if user with `account_id` has some form of "#NoBot" in their bio
data/lib/elephrame/bot.rb CHANGED
@@ -29,9 +29,11 @@ module Elephrame
29
29
  # @param visibility [String] visibility level
30
30
  # @param spoiler [String] text to use as content warning
31
31
  # @param reply_id [String] id of post to reply to
32
+ # @param hide_media [Bool] should we hide media?
32
33
  # @param media [Array<String>] array of file paths
33
34
 
34
- def post(text, visibility: 'unlisted', spoiler: '', reply_id: '', media: [])
35
+ def post(text, visibility: 'unlisted', spoiler: '',
36
+ reply_id: '', hide_media: false, media: [])
35
37
 
36
38
  unless media.empty?
37
39
  media.collect! {|m|
@@ -44,6 +46,7 @@ module Elephrame
44
46
  spoiler_text: spoiler,
45
47
  in_reply_to_id: reply_id,
46
48
  media_ids: media,
49
+ sensitive: hide_media,
47
50
  }
48
51
 
49
52
  @client.create_status text, options
@@ -35,7 +35,7 @@ module Elephrame
35
35
 
36
36
  # maybe also @ everyone from the mention? idk that seems like a bad idea tbh
37
37
  post(text, @mention_data[:vis], @mention_data[:spoiler],
38
- @mention_data[:id])
38
+ @mention_data[:id], @mention_data[:sensitive])
39
39
  end
40
40
 
41
41
  ##
@@ -48,7 +48,8 @@ module Elephrame
48
48
  id: mention.id,
49
49
  vis: mention.visibility,
50
50
  spoiler: mention.spoiler_text,
51
- mentions: mention.mentions
51
+ mentions: mention.mentions,
52
+ sensitive: mention.sensitive?
52
53
  }
53
54
  end
54
55
 
@@ -1,3 +1,3 @@
1
1
  module Elephrame
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elephrame
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zac