discorb 0.11.3 → 0.11.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60cb51026c0c1eb4e339a808b7510dd6ff7ee01a3a14b556f9b563eb35c5a14c
4
- data.tar.gz: ab9d5a60d0c798af8dc61b3d43bbdd29f289cd1d0b709080ffeb89e0c37319b0
3
+ metadata.gz: 3154cd1b844888bec798cdead182285e335733206758fddea8c2fd8e0015499e
4
+ data.tar.gz: 9d0ba163982a7676045dce791409227f2c99c3e28bce29cae25033b85f7485a5
5
5
  SHA512:
6
- metadata.gz: dafecc3709155ce8c2d445b7ca19c5aa68744db6235f21dddea897dbc6d9c0dea83a226e49b6ef0a86649557abe7cb85463b43235cd721c5209d52c1cef31e07
7
- data.tar.gz: 1f14f8800518ac494b2776d595585723a7e9a715be3c8f48b6ebc9a3857ae175951b82b1e1954765e2949df8839d9f995c1516f0db71825367806f06ecdb7707
6
+ metadata.gz: 20ee7dd354fc5be471617ed61367ceb85bad364cd8e2afd95df9c46453665b61c15d387c2bafb36b295836f5cb02f699edfc3118af4fa6c39e30a52f72904e6d
7
+ data.tar.gz: c860a7fa1335a7be40dafa7e9bda5bbfd6a7d7e7790ece875db350b154f3e7ab7f523387b5be4a77f4cae7f43c01b3a726f2c917dd81c2b97502f0097b9b5ecc
data/Changelog.md CHANGED
@@ -4,6 +4,10 @@
4
4
 
5
5
  ## v0.11
6
6
 
7
+ ### v0.11.4
8
+
9
+ - Fix: Fix unpinning messages
10
+
7
11
  ### v0.11.3
8
12
 
9
13
  - Add: Add `Snowflake#id` as alias for `Snowflake#to_s`
@@ -482,48 +482,6 @@ module Discorb
482
482
  end
483
483
  end
484
484
 
485
- #
486
- # Fetch the pinned messages in the channel.
487
- # @macro async
488
- # @macro http
489
- #
490
- # @return [Async::Task<Array<Discorb::Message>>] The pinned messages in the channel.
491
- #
492
- def fetch_pins
493
- Async do
494
- _resp, data = @client.http.get("/channels/#{@id}/pins").wait
495
- data.map { |pin| Message.new(@client, pin) }
496
- end
497
- end
498
-
499
- #
500
- # Pin a message in the channel.
501
- # @macro async
502
- # @macro http
503
- #
504
- # @param [Discorb::Message] message The message to pin.
505
- # @param [String] reason The reason of pinning the message.
506
- #
507
- def pin_message(message, reason: nil)
508
- Async do
509
- @client.http.put("/channels/#{@id}/pins/#{message.id}", {}, audit_log_reason: reason).wait
510
- end
511
- end
512
-
513
- #
514
- # Unpin a message in the channel.
515
- # @macro async
516
- # @macro http
517
- #
518
- # @param [Discorb::Message] message The message to unpin.
519
- # @param [String] reason The reason of unpinning the message.
520
- #
521
- def unpin_message(message, reason: nil)
522
- Async do
523
- @client.http.delete("/channels/#{@id}/pins/#{message.id}", {}, audit_log_reason: reason).wait
524
- end
525
- end
526
-
527
485
  #
528
486
  # Start thread in the channel.
529
487
  # @macro async
@@ -4,7 +4,7 @@ module Discorb
4
4
  # @return [String] The API base URL.
5
5
  API_BASE_URL = "https://discord.com/api/v9"
6
6
  # @return [String] The version of discorb.
7
- VERSION = "0.11.3"
7
+ VERSION = "0.11.4"
8
8
  # @return [String] The user agent for the bot.
9
9
  USER_AGENT = "DiscordBot (https://discorb-lib.github.io #{VERSION}) Ruby/#{RUBY_VERSION}"
10
10
 
@@ -142,6 +142,48 @@ module Discorb
142
142
  end
143
143
  end
144
144
 
145
+ #
146
+ # Fetch the pinned messages in the channel.
147
+ # @macro async
148
+ # @macro http
149
+ #
150
+ # @return [Async::Task<Array<Discorb::Message>>] The pinned messages in the channel.
151
+ #
152
+ def fetch_pins
153
+ Async do
154
+ _resp, data = @client.http.get("/channels/#{channel_id.wait}/pins").wait
155
+ data.map { |pin| Message.new(@client, pin) }
156
+ end
157
+ end
158
+
159
+ #
160
+ # Pin a message in the channel.
161
+ # @macro async
162
+ # @macro http
163
+ #
164
+ # @param [Discorb::Message] message The message to pin.
165
+ # @param [String] reason The reason of pinning the message.
166
+ #
167
+ def pin_message(message, reason: nil)
168
+ Async do
169
+ @client.http.put("/channels/#{channel_id.wait}/pins/#{message.id}", {}, audit_log_reason: reason).wait
170
+ end
171
+ end
172
+
173
+ #
174
+ # Unpin a message in the channel.
175
+ # @macro async
176
+ # @macro http
177
+ #
178
+ # @param [Discorb::Message] message The message to unpin.
179
+ # @param [String] reason The reason of unpinning the message.
180
+ #
181
+ def unpin_message(message, reason: nil)
182
+ Async do
183
+ @client.http.delete("/channels/#{channel_id.wait}/pins/#{message.id}", audit_log_reason: reason).wait
184
+ end
185
+ end
186
+
145
187
  #
146
188
  # Trigger the typing indicator in the channel.
147
189
  # @macro async
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discorb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.3
4
+ version: 0.11.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - sevenc-nanashi