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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/elephrame/bot.rb +4 -1
- data/lib/elephrame/streaming/streaming.rb +3 -2
- data/lib/elephrame/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3047355c6ddb30f39deed09340f218ace45c35fa3a708ede96e501f3f2b6911
|
4
|
+
data.tar.gz: f0948d711fa2115cd6b55f2b4b6a23ec74008a73529d29c71206fffa4b5e7cce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be84cbec9572c6b8d9af87df3ea6b089241d96a1d097a53aea9a569fca74632a55e21b0ed099fb89d061365686aa4306af82ef4ca1447a4950f966017d2aba7c
|
7
|
+
data.tar.gz: 16a0cac4be2a53952f0f14954ea51dca3bdbd859ed0a9bd64cf59986c50a0393b8f96c5f58fedf45228c6972f7e48d8eb249f4c325e3fddef2e7fb3a40453c24
|
data/Gemfile.lock
CHANGED
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: '',
|
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
|
|
data/lib/elephrame/version.rb
CHANGED