discorb 0.9.0 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build_main.yml +2 -0
  3. data/Changelog.md +28 -1
  4. data/README.md +6 -6
  5. data/Rakefile +7 -1
  6. data/assets/banner.svg +101 -101
  7. data/docs/application_command.md +8 -7
  8. data/docs/cli/run.md +3 -3
  9. data/docs/faq.md +1 -1
  10. data/docs/license.md +1 -1
  11. data/lib/discorb/app_command.rb +12 -10
  12. data/lib/discorb/application.rb +3 -3
  13. data/lib/discorb/asset.rb +2 -2
  14. data/lib/discorb/audit_logs.rb +7 -7
  15. data/lib/discorb/channel.rb +10 -10
  16. data/lib/discorb/common.rb +3 -3
  17. data/lib/discorb/components.rb +2 -2
  18. data/lib/discorb/embed.rb +2 -2
  19. data/lib/discorb/emoji.rb +3 -3
  20. data/lib/discorb/error.rb +2 -2
  21. data/lib/discorb/exe/init.rb +8 -8
  22. data/lib/discorb/exe/run.rb +1 -1
  23. data/lib/discorb/extend.rb +21 -0
  24. data/lib/discorb/extension.rb +1 -1
  25. data/lib/discorb/file.rb +19 -1
  26. data/lib/discorb/gateway.rb +10 -12
  27. data/lib/discorb/gateway_requests.rb +1 -1
  28. data/lib/discorb/guild.rb +7 -7
  29. data/lib/discorb/guild_template.rb +4 -4
  30. data/lib/discorb/http.rb +1 -1
  31. data/lib/discorb/integration.rb +3 -3
  32. data/lib/discorb/interaction.rb +104 -35
  33. data/lib/discorb/invite.rb +2 -2
  34. data/lib/discorb/log.rb +1 -1
  35. data/lib/discorb/member.rb +1 -1
  36. data/lib/discorb/message.rb +34 -10
  37. data/lib/discorb/modules.rb +11 -9
  38. data/lib/discorb/permission.rb +2 -2
  39. data/lib/discorb/presence.rb +8 -8
  40. data/lib/discorb/rate_limit.rb +1 -1
  41. data/lib/discorb/reaction.rb +1 -1
  42. data/lib/discorb/role.rb +2 -2
  43. data/lib/discorb/sticker.rb +3 -3
  44. data/lib/discorb/user.rb +2 -2
  45. data/lib/discorb/utils/colored_puts.rb +3 -3
  46. data/lib/discorb/utils.rb +1 -1
  47. data/lib/discorb/voice_state.rb +3 -3
  48. data/lib/discorb/webhook.rb +7 -8
  49. data/lib/discorb.rb +1 -1
  50. data/sig/discorb.rbs +2 -2
  51. data/template-replace/files/css/common.css +25 -0
  52. data/template-replace/files/favicon.png +0 -0
  53. data/template-replace/scripts/arrow.rb +7 -0
  54. data/template-replace/scripts/favicon.rb +9 -0
  55. metadata +5 -2
@@ -33,7 +33,7 @@ module Discorb
33
33
  @interaction_type = nil
34
34
  @interaction_name = nil
35
35
 
36
- # @!visibility private
36
+ # @private
37
37
  def initialize(client, data)
38
38
  @client = client
39
39
  @id = Snowflake.new(data[:id])
@@ -71,10 +71,10 @@ module Discorb
71
71
  end
72
72
 
73
73
  class << self
74
- # @!visibility private
74
+ # @private
75
75
  attr_reader :interaction_type, :interaction_name, :event_name
76
76
 
77
- # @!visibility private
77
+ # @private
78
78
  def make_interaction(client, data)
79
79
  interaction = nil
80
80
  descendants.each do |klass|
@@ -87,7 +87,7 @@ module Discorb
87
87
  interaction
88
88
  end
89
89
 
90
- # @!visibility private
90
+ # @private
91
91
  def descendants
92
92
  ObjectSpace.each_object(Class).select { |klass| klass < self }
93
93
  end
@@ -131,6 +131,8 @@ module Discorb
131
131
  # @param [Array<Discorb::Component>, Array<Array<Discorb::Component>>] components The components to send.
132
132
  # @param [Boolean] ephemeral Whether to make the response ephemeral.
133
133
  #
134
+ # @return [Discorb::Interaction::SourceResponse::CallbackMessage, Discorb::Webhook::Message] The callback message.
135
+ #
134
136
  def post(content = nil, tts: false, embed: nil, embeds: nil, allowed_mentions: nil, components: nil, ephemeral: false)
135
137
  Async do
136
138
  payload = {}
@@ -165,14 +167,78 @@ module Discorb
165
167
  end
166
168
  payload[:flags] = (ephemeral ? 1 << 6 : 0)
167
169
 
168
- if @responded
169
- @client.http.post("/webhooks/#{@application_id}/#{@token}", payload).wait
170
- elsif @defered
171
- @client.http.patch("/webhooks/#{@application_id}/#{@token}/messages/@original", payload).wait
172
- else
173
- @client.http.post("/interactions/#{@id}/#{@token}/callback", { type: 4, data: payload }).wait
174
- end
170
+ ret = if @responded
171
+ _resp, data = @client.http.post("/webhooks/#{@application_id}/#{@token}", payload).wait
172
+ webhook = Webhook::URLWebhook.new("/webhooks/#{@application_id}/#{@token}")
173
+ Webhook::Message.new(webhook, data, @client)
174
+ elsif @defered
175
+ @client.http.patch("/webhooks/#{@application_id}/#{@token}/messages/@original", payload).wait
176
+ CallbackMessage.new(@client, payload, @application_id, @token)
177
+ else
178
+ @client.http.post("/interactions/#{@id}/#{@token}/callback", { type: 4, data: payload }).wait
179
+ CallbackMessage.new(@client, payload, @application_id, @token)
180
+ end
175
181
  @responded = true
182
+ ret
183
+ end
184
+ end
185
+
186
+ class CallbackMessage
187
+ # @private
188
+ def initialize(client, data, application_id, token)
189
+ @client = client
190
+ @data = data
191
+ @application_id = application_id
192
+ @token = token
193
+ end
194
+
195
+ #
196
+ # Edits the callback message.
197
+ # @macro async
198
+ # @macro http
199
+ # @macro edit
200
+ #
201
+ # @param [String] content The new content of the message.
202
+ # @param [Discorb::Embed] embed The new embed of the message.
203
+ # @param [Array<Discorb::Embed>] embeds The new embeds of the message.
204
+ # @param [Array<Discorb::Attachment>] attachments The attachments to remain.
205
+ # @param [Discorb::File] file The file to send.
206
+ # @param [Array<Discorb::File>] files The files to send.
207
+ #
208
+ def edit(
209
+ content = :unset,
210
+ embed: :unset, embeds: :unset,
211
+ file: :unset, files: :unset,
212
+ attachments: :unset
213
+ )
214
+ Async do
215
+ payload = {}
216
+ payload[:content] = content if content != :unset
217
+ payload[:embeds] = embed ? [embed.to_hash] : [] if embed != :unset
218
+ payload[:embeds] = embeds.map(&:to_hash) if embeds != :unset
219
+ payload[:attachments] = attachments.map(&:to_hash) if attachments != :unset
220
+ files = [file] if file != :unset
221
+ if files == :unset
222
+ headers = {
223
+ "Content-Type" => "application/json",
224
+ }
225
+ else
226
+ headers, payload = HTTP.multipart(payload, files)
227
+ end
228
+ @client.http.patch("/webhooks/#{@application_id}/#{@token}/messages/@original", payload, headers: headers).wait
229
+ end
230
+ end
231
+
232
+ alias modify edit
233
+
234
+ #
235
+ # Deletes the callback message.
236
+ # @note This will fail if the message is ephemeral.
237
+ #
238
+ def delete!
239
+ Async do
240
+ @client.http.delete("/webhooks/#{@application_id}/#{@token}/messages/@original").wait
241
+ end
176
242
  end
177
243
  end
178
244
  end
@@ -296,28 +362,31 @@ module Discorb
296
362
  options = data[:options]
297
363
  end
298
364
  end
299
- options ||= []
300
- options.map! do |option|
301
- case option[:type]
302
- when 3, 4, 5, 10
303
- option[:value]
304
- when 6
305
- guild.members[option[:value]] || guild.fetch_member(option[:value]).wait
306
- when 7
307
- guild.channels[option[:value]] || guild.fetch_channels.wait.find { |channel| channel.id == option[:value] }
308
- when 8
309
- guild.roles[option[:value]] || guild.fetch_roles.wait.find { |role| role.id == option[:value] }
310
- when 9
311
- guild.members[option[:value]] || guild.roles[option[:value]] || guild.fetch_member(option[:value]).wait || guild.fetch_roles.wait.find { |role| role.id == option[:value] }
312
- end
313
- end
314
365
 
315
366
  unless (command = @client.bottom_commands.find { |c| c.to_s == name && c.type_raw == 1 })
316
367
  @client.log.warn "Unknown command name #{name}, ignoreing"
317
368
  next
318
369
  end
319
370
 
320
- command.block.call(self, *options)
371
+ option_map = command.options.map { |k, v| [k.to_s, v[:default]] }.to_h
372
+ options ||= []
373
+ options.each do |option|
374
+ val = case option[:type]
375
+ when 3, 4, 5, 10
376
+ option[:value]
377
+ when 6
378
+ guild.members[option[:value]] || guild.fetch_member(option[:value]).wait
379
+ when 7
380
+ guild.channels[option[:value]] || guild.fetch_channels.wait.find { |channel| channel.id == option[:value] }
381
+ when 8
382
+ guild.roles[option[:value]] || guild.fetch_roles.wait.find { |role| role.id == option[:value] }
383
+ when 9
384
+ guild.members[option[:value]] || guild.roles[option[:value]] || guild.fetch_member(option[:value]).wait || guild.fetch_roles.wait.find { |role| role.id == option[:value] }
385
+ end
386
+ option_map[option[:name]] = val
387
+ end
388
+
389
+ command.block.call(self, *command.options.map { |k, v| option_map[k.to_s] })
321
390
  end
322
391
  end
323
392
  end
@@ -351,7 +420,7 @@ module Discorb
351
420
  private
352
421
 
353
422
  def _set_data(data)
354
- @target = Message.new(@client, data[:resolved][:messages][data[:target_id].to_sym])
423
+ @target = Message.new(@client, data[:resolved][:messages][data[:target_id].to_sym].merge(guild_id: @guild_id.to_s))
355
424
  @client.commands.find { |c| c.name == data[:name] && c.type_raw == 3 }.block.call(self, @target)
356
425
  end
357
426
  end
@@ -363,10 +432,10 @@ module Discorb
363
432
  end
364
433
 
365
434
  class << self
366
- # @!visibility private
435
+ # @private
367
436
  attr_reader :command_type
368
437
 
369
- # @!visibility private
438
+ # @private
370
439
  def make_interaction(client, data)
371
440
  nested_classes.each do |klass|
372
441
  return klass.new(client, data) if !klass.command_type.nil? && klass.command_type == data[:data][:type]
@@ -375,7 +444,7 @@ module Discorb
375
444
  CommandInteraction.new(client, data)
376
445
  end
377
446
 
378
- # @!visibility private
447
+ # @private
379
448
  def nested_classes
380
449
  constants.select { |c| const_get(c).is_a? Class }.map { |c| const_get(c) }
381
450
  end
@@ -395,17 +464,17 @@ module Discorb
395
464
  @interaction_type = 3
396
465
  @interaction_name = :message_component
397
466
 
398
- # @!visibility private
467
+ # @private
399
468
  def initialize(client, data)
400
469
  super
401
470
  @message = Message.new(@client, data[:message].merge({ member: data[:member] }))
402
471
  end
403
472
 
404
473
  class << self
405
- # @!visibility private
474
+ # @private
406
475
  attr_reader :component_type
407
476
 
408
- # @!visibility private
477
+ # @private
409
478
  def make_interaction(client, data)
410
479
  nested_classes.each do |klass|
411
480
  return klass.new(client, data) if !klass.component_type.nil? && klass.component_type == data[:data][:component_type]
@@ -414,7 +483,7 @@ module Discorb
414
483
  MessageComponentInteraction.new(client, data)
415
484
  end
416
485
 
417
- # @!visibility private
486
+ # @private
418
487
  def nested_classes
419
488
  constants.select { |c| const_get(c).is_a? Class }.map { |c| const_get(c) }
420
489
  end
@@ -72,7 +72,7 @@ module Discorb
72
72
  2 => :guild,
73
73
  }.freeze
74
74
 
75
- # @!visibility private
75
+ # @private
76
76
  def initialize(client, data, gateway)
77
77
  @client = client
78
78
  @data = data[:data]
@@ -138,7 +138,7 @@ module Discorb
138
138
  end
139
139
 
140
140
  class << self
141
- # @!visibility private
141
+ # @private
142
142
  attr_reader :target_types
143
143
  end
144
144
  end
data/lib/discorb/log.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Discorb
4
- # @!visibility private
4
+ # @private
5
5
  class Logger
6
6
  attr_accessor :out, :colorize_log
7
7
 
@@ -62,7 +62,7 @@ module Discorb
62
62
  # @!attribute [r] owner?
63
63
  # @return [Boolean] Whether the member is the owner of the guild.
64
64
 
65
- # @!visibility private
65
+ # @private
66
66
  def initialize(client, guild_id, user_data, member_data)
67
67
  @guild_id = guild_id
68
68
  @client = client
@@ -29,7 +29,7 @@ module Discorb
29
29
  @replied_user = replied_user
30
30
  end
31
31
 
32
- # @!visibility private
32
+ # @private
33
33
  def to_hash(other = nil)
34
34
  payload = {
35
35
  parse: %w[everyone roles users],
@@ -183,8 +183,32 @@ module Discorb
183
183
  # @!attribute [r] embed
184
184
  # @return [Discorb::Embed] The embed of the message.
185
185
  # @return [nil] If the message has no embed.
186
+ # @!attribute [r] embed?
187
+ # @return [Boolean] Whether the message has an embed.
188
+ # @!attribute [r] reply?
189
+ # @return [Boolean] Whether the message is a reply.
190
+ # @!attribute [r] dm?
191
+ # @return [Boolean] Whether the message was sent in a DM.
192
+ # @!attribute [r] guild?
193
+ # @return [Boolean] Whether the message was sent in a guild.
194
+
195
+ def embed?
196
+ @embeds.any?
197
+ end
198
+
199
+ def reply?
200
+ !@message_reference.nil?
201
+ end
202
+
203
+ def dm?
204
+ @guild_id.nil?
205
+ end
206
+
207
+ def guild?
208
+ !@guild_id.nil?
209
+ end
186
210
 
187
- # @!visibility private
211
+ # @private
188
212
  def initialize(client, data, no_cache: false)
189
213
  @client = client
190
214
  @data = {}
@@ -272,11 +296,11 @@ module Discorb
272
296
  # @param [Array<Discorb::Component>, Array<Array<Discorb::Component>>] components The components to send.
273
297
  # @param [Boolean] supress Whether to supress embeds.
274
298
  #
275
- def edit(message_id, content = nil, embed: nil, embeds: nil, allowed_mentions: nil,
276
- components: nil, supress: nil)
299
+ def edit(content = nil, embed: nil, embeds: nil, allowed_mentions: nil,
300
+ components: nil, supress: nil)
277
301
  Async do
278
- channel.edit_message(@id, message_id, content, embed: embed, embeds: embeds, allowed_mentions: allowed_mentions,
279
- components: components, supress: supress).wait
302
+ channel.edit_message(@id, content, embed: embed, embeds: embeds, allowed_mentions: allowed_mentions,
303
+ components: components, supress: supress).wait
280
304
  end
281
305
  end
282
306
 
@@ -616,7 +640,7 @@ module Discorb
616
640
  # @return [Discorb::User] The user.
617
641
  attr_reader :user
618
642
 
619
- # @!visibility private
643
+ # @private
620
644
  def initialize(client, data)
621
645
  @id = Snowflake.new(data[:id])
622
646
  @name = data[:name]
@@ -641,20 +665,20 @@ module Discorb
641
665
  5 => :join_request,
642
666
  }
643
667
 
644
- # @!visibility private
668
+ # @private
645
669
  def initialize(data)
646
670
  @name = data[:name]
647
671
  @type = self.class.type(data[:type])
648
672
  end
649
673
 
650
674
  class << self
651
- # @!visibility private
675
+ # @private
652
676
  attr_reader :type
653
677
  end
654
678
  end
655
679
 
656
680
  class << self
657
- # @!visibility private
681
+ # @private
658
682
  attr_reader :message_type
659
683
  end
660
684
  end
@@ -113,7 +113,7 @@ module Discorb
113
113
  end
114
114
  end
115
115
  tmp_components << tmp_row
116
- payload[:flags] = (supress ? 1 << 2 : 0) unless flags.nil?
116
+ payload[:flags] = (supress ? 1 << 2 : 0) unless supress.nil?
117
117
  payload[:components] = tmp_components.filter { |c| c.length.positive? }.map { |c| { type: 1, components: c.map(&:to_hash) } }
118
118
  end
119
119
  @client.http.patch("/channels/#{channel_id.wait}/messages/#{message_id}", payload).wait
@@ -192,18 +192,20 @@ module Discorb
192
192
  # end
193
193
  #
194
194
  def typing
195
- Async do |task|
196
- if block_given?
197
- begin
198
- post_task = task.async do
195
+ if block_given?
196
+ begin
197
+ post_task = Async do
198
+ loop do
199
199
  @client.http.post("/channels/#{@id}/typing", {})
200
200
  sleep(5)
201
201
  end
202
- yield
203
- ensure
204
- post_task.stop
205
202
  end
206
- else
203
+ yield
204
+ ensure
205
+ post_task.stop
206
+ end
207
+ else
208
+ Async do |task|
207
209
  @client.http.post("/channels/#{@id}/typing", {})
208
210
  end
209
211
  end
@@ -138,7 +138,7 @@ module Discorb
138
138
  }.freeze
139
139
  @bits = @raw_bits.transform_values { |v| 1 << v }.freeze
140
140
 
141
- # @!visibility private
141
+ # @private
142
142
  def initialize(allow, deny)
143
143
  @allow = allow
144
144
  @deny = deny
@@ -248,7 +248,7 @@ module Discorb
248
248
  end
249
249
 
250
250
  class << self
251
- # @!visibility private
251
+ # @private
252
252
  attr_reader :bits
253
253
 
254
254
  #
@@ -19,7 +19,7 @@ module Discorb
19
19
  # @!attribute [r] activity
20
20
  # @return [Discorb::Presence::Activity] The activity of the presence.
21
21
 
22
- # @!visibility private
22
+ # @private
23
23
  def initialize(client, data)
24
24
  @client = client
25
25
  @data = data
@@ -89,7 +89,7 @@ module Discorb
89
89
  5 => :competing,
90
90
  }
91
91
 
92
- # @!visibility private
92
+ # @private
93
93
  def initialize(data)
94
94
  @name = data[:name]
95
95
  @type = self.class.activity_types[data[:type]]
@@ -140,7 +140,7 @@ module Discorb
140
140
  # @return [Time] The end time of the activity.
141
141
  attr_reader :end
142
142
 
143
- # @!visibility private
143
+ # @private
144
144
  def initialize(data)
145
145
  @start = data[:start] && Time.at(data[:start])
146
146
  @end = data[:end] && Time.at(data[:end])
@@ -156,7 +156,7 @@ module Discorb
156
156
  # @!attribute [r] max_size
157
157
  # @return [Integer] The max size of the party.
158
158
 
159
- # @!visibility private
159
+ # @private
160
160
  def initialize(data)
161
161
  @id = data[:id]
162
162
  @size = data[:size]
@@ -226,7 +226,7 @@ module Discorb
226
226
  # @return [String] The match secret of the activity.
227
227
  attr_reader :match
228
228
 
229
- # @!visibility private
229
+ # @private
230
230
  def initialize(data)
231
231
  @join = data[:join]
232
232
  @spectate = data[:spectate]
@@ -244,7 +244,7 @@ module Discorb
244
244
  attr_reader :url
245
245
  alias text label
246
246
 
247
- # @!visibility private
247
+ # @private
248
248
  def initialize(data)
249
249
  @label = data[0]
250
250
  @url = data[1]
@@ -252,7 +252,7 @@ module Discorb
252
252
  end
253
253
 
254
254
  class << self
255
- # @!visibility private
255
+ # @private
256
256
  attr_reader :activity_types
257
257
  end
258
258
  end
@@ -275,7 +275,7 @@ module Discorb
275
275
  # @!attribute [r] web?
276
276
  # @return [Boolean] Whether the user is not offline on web.
277
277
 
278
- # @!visibility private
278
+ # @private
279
279
  def initialize(data)
280
280
  @desktop = data[:desktop]&.to_sym || :offline
281
281
  @mobile = data[:mobile]&.to_sym || :offline
@@ -6,7 +6,7 @@ module Discorb
6
6
  # @private
7
7
  #
8
8
  class RatelimitHandler
9
- # @!visibility private
9
+ # @private
10
10
  def initialize(client)
11
11
  @client = client
12
12
  @ratelimit_hash = {}
@@ -16,7 +16,7 @@ module Discorb
16
16
  alias me? me
17
17
  alias reacted? me
18
18
 
19
- # @!visibility private
19
+ # @private
20
20
  def initialize(message, data)
21
21
  @message = message
22
22
  _set_data(data)
data/lib/discorb/role.rb CHANGED
@@ -36,7 +36,7 @@ module Discorb
36
36
 
37
37
  include Comparable
38
38
 
39
- # @!visibility private
39
+ # @private
40
40
  def initialize(client, guild, data)
41
41
  @client = client
42
42
  @guild = guild
@@ -154,7 +154,7 @@ module Discorb
154
154
  # @!attribute [r] integration?
155
155
  # @return [Boolean] Whether the role is an integration role.
156
156
 
157
- # @!visibility private
157
+ # @private
158
158
  def initialize(data)
159
159
  @bot_id = Snowflake.new(data[:bot_id])
160
160
  @integration_id = Snowflake.new(data[:integration_id])
@@ -38,7 +38,7 @@ module Discorb
38
38
  2 => :apng,
39
39
  3 => :lottie,
40
40
  }
41
- # @!visibility private
41
+ # @private
42
42
  def initialize(client, data)
43
43
  @client = client
44
44
  _set_data(data)
@@ -116,7 +116,7 @@ module Discorb
116
116
  # @return [Discorb::Asset] The banner of the pack.
117
117
  attr_reader :banner
118
118
 
119
- # @!visibility private
119
+ # @private
120
120
  def initialize(client, data)
121
121
  @client = client
122
122
  @id = Snowflake.new(data[:id])
@@ -150,7 +150,7 @@ module Discorb
150
150
  end
151
151
 
152
152
  class << self
153
- # @!visibility private
153
+ # @private
154
154
  attr_reader :sticker_type, :sticker_format
155
155
  end
156
156
  end
data/lib/discorb/user.rb CHANGED
@@ -26,7 +26,7 @@ module Discorb
26
26
 
27
27
  include Discorb::Messageable
28
28
 
29
- # @!visibility private
29
+ # @private
30
30
  def initialize(client, data)
31
31
  @client = client
32
32
  @data = {}
@@ -73,7 +73,7 @@ module Discorb
73
73
 
74
74
  alias app_owner? bot_owner?
75
75
 
76
- # @!visibility private
76
+ # @private
77
77
  def channel_id
78
78
  Async do
79
79
  next @dm_channel_id if @dm_channel_id
@@ -1,14 +1,14 @@
1
- # @!visibility private
1
+ # @private
2
2
  def sputs(text)
3
3
  puts "\e[92m#{text}\e[m"
4
4
  end
5
5
 
6
- # @!visibility private
6
+ # @private
7
7
  def eputs(text)
8
8
  puts "\e[91m#{text}\e[m"
9
9
  end
10
10
 
11
- # @!visibility private
11
+ # @private
12
12
  def iputs(text)
13
13
  puts "\e[90m#{text}\e[m"
14
14
  end
data/lib/discorb/utils.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Discorb
4
- # @!visibility private
4
+ # @private
5
5
  module Utils
6
6
  def try(object, message, ...)
7
7
  if object.respond_to?(message)
@@ -43,7 +43,7 @@ module Discorb
43
43
  # @macro client_cache
44
44
  # @return [Discorb::User] The user this voice state is for.
45
45
 
46
- # @!visibility private
46
+ # @private
47
47
  def initialize(client, data)
48
48
  @client = client
49
49
  _set_data(data)
@@ -132,7 +132,7 @@ module Discorb
132
132
  2 => :guild_only,
133
133
  }
134
134
 
135
- # @!visibility private
135
+ # @private
136
136
  def initialize(client, data, no_cache: false)
137
137
  @client = client
138
138
  @data = data
@@ -238,7 +238,7 @@ module Discorb
238
238
  attr_reader :custom
239
239
  alias custom? custom
240
240
 
241
- # @!visibility private
241
+ # @private
242
242
  def initialize(data)
243
243
  @id = data[:id]
244
244
  @name = data[:name]