discorb 0.9.3 → 0.10.0

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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build_main.yml +2 -0
  3. data/Changelog.md +298 -247
  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/extension.md +16 -22
  10. data/docs/license.md +5 -1
  11. data/examples/extension/main.rb +1 -1
  12. data/examples/extension/message_expander.rb +4 -6
  13. data/lib/discorb/app_command.rb +12 -10
  14. data/lib/discorb/application.rb +3 -3
  15. data/lib/discorb/asset.rb +2 -2
  16. data/lib/discorb/audit_logs.rb +7 -7
  17. data/lib/discorb/channel.rb +10 -10
  18. data/lib/discorb/client.rb +22 -23
  19. data/lib/discorb/common.rb +6 -25
  20. data/lib/discorb/components.rb +31 -3
  21. data/lib/discorb/embed.rb +2 -2
  22. data/lib/discorb/emoji.rb +3 -3
  23. data/lib/discorb/error.rb +2 -2
  24. data/lib/discorb/exe/init.rb +8 -8
  25. data/lib/discorb/exe/run.rb +1 -1
  26. data/lib/discorb/extend.rb +21 -0
  27. data/lib/discorb/extension.rb +60 -47
  28. data/lib/discorb/file.rb +19 -1
  29. data/lib/discorb/gateway.rb +8 -8
  30. data/lib/discorb/gateway_requests.rb +1 -1
  31. data/lib/discorb/guild.rb +7 -7
  32. data/lib/discorb/guild_template.rb +4 -4
  33. data/lib/discorb/http.rb +1 -1
  34. data/lib/discorb/integration.rb +3 -3
  35. data/lib/discorb/interaction.rb +36 -32
  36. data/lib/discorb/invite.rb +2 -2
  37. data/lib/discorb/log.rb +1 -1
  38. data/lib/discorb/member.rb +1 -1
  39. data/lib/discorb/message.rb +34 -10
  40. data/lib/discorb/modules.rb +15 -49
  41. data/lib/discorb/permission.rb +2 -2
  42. data/lib/discorb/presence.rb +8 -8
  43. data/lib/discorb/rate_limit.rb +1 -1
  44. data/lib/discorb/reaction.rb +1 -1
  45. data/lib/discorb/role.rb +2 -2
  46. data/lib/discorb/sticker.rb +3 -3
  47. data/lib/discorb/user.rb +2 -2
  48. data/lib/discorb/utils/colored_puts.rb +3 -3
  49. data/lib/discorb/utils.rb +1 -21
  50. data/lib/discorb/voice_state.rb +3 -3
  51. data/lib/discorb/webhook.rb +7 -8
  52. data/lib/discorb.rb +1 -1
  53. data/sig/discorb.rbs +2 -2
  54. data/template-replace/files/css/common.css +26 -0
  55. data/template-replace/files/favicon.png +0 -0
  56. data/template-replace/scripts/arrow.rb +7 -0
  57. data/template-replace/scripts/favicon.rb +9 -0
  58. data/template-replace/scripts/version.rb +20 -5
  59. metadata +5 -2
data/lib/discorb/guild.rb CHANGED
@@ -118,14 +118,14 @@ module Discorb
118
118
  @default_message_notifications = %i[all_messages only_mentions].freeze
119
119
  @explicit_content_filter = %i[disabled_in_text members_without_roles all_members].freeze
120
120
 
121
- # @!visibility private
121
+ # @private
122
122
  def initialize(client, data, is_create_event)
123
123
  @client = client
124
124
  @data = {}
125
125
  _set_data(data, is_create_event)
126
126
  end
127
127
 
128
- # @!visibility private
128
+ # @private
129
129
  def update!
130
130
  Async do
131
131
  _, data = @client.get("/guilds/#{@id}").wait
@@ -952,7 +952,7 @@ module Discorb
952
952
  # @!attribute [r] url
953
953
  # @return [String] The vanity URL.
954
954
 
955
- # @!visibility private
955
+ # @private
956
956
  def initialize(client, guild, data)
957
957
  @client = client
958
958
  @guild = guild
@@ -987,7 +987,7 @@ module Discorb
987
987
  # @!attribute [r] json_url
988
988
  # @return [String] The JSON URL.
989
989
 
990
- # @!visibility private
990
+ # @private
991
991
  def initialize(client, guild_id, data)
992
992
  @client = client
993
993
  @enabled = data[:enabled]
@@ -1050,7 +1050,7 @@ module Discorb
1050
1050
  # @return [String] The reason for the ban.
1051
1051
  attr_reader :reason
1052
1052
 
1053
- # @!visibility private
1053
+ # @private
1054
1054
  def initialize(client, guild, data)
1055
1055
  @client = client
1056
1056
  @guild = guild
@@ -1060,7 +1060,7 @@ module Discorb
1060
1060
  end
1061
1061
 
1062
1062
  class << self
1063
- # @!visibility private
1063
+ # @private
1064
1064
  attr_reader :nsfw_levels, :mfa_levels, :verification_levels, :default_message_notifications, :explicit_content_filter
1065
1065
 
1066
1066
  #
@@ -1175,7 +1175,7 @@ module Discorb
1175
1175
  # @return [Discorb::Guild] The guild the welcome screen belongs to.
1176
1176
  attr_reader :guild
1177
1177
 
1178
- # @!visibility private
1178
+ # @private
1179
1179
  def initialize(client, guild, data)
1180
1180
  @client = client
1181
1181
  @description = data[:description]
@@ -33,7 +33,7 @@ module Discorb
33
33
  # @return [Discorb::Guild] The guild this template is based on.
34
34
  # @return [nil] Client wasn't able to find the guild this template is based on.
35
35
 
36
- # @!visibility private
36
+ # @private
37
37
  def initialize(client, data)
38
38
  @client = client
39
39
  _set_data(data)
@@ -117,7 +117,7 @@ module Discorb
117
117
  attr_reader :widget_enabled
118
118
  alias widget_enabled? widget_enabled
119
119
 
120
- # @!visibility private
120
+ # @private
121
121
  def initialize(data)
122
122
  @name = data[:name]
123
123
  @description = data[:description]
@@ -143,7 +143,7 @@ module Discorb
143
143
  # @return [Discorb::Color] The color of the role.
144
144
  attr_reader :color
145
145
 
146
- # @!visibility private
146
+ # @private
147
147
  def initialize(data)
148
148
  @name = data[:name]
149
149
  @permissions = Permission.new(data[:permissions])
@@ -174,7 +174,7 @@ module Discorb
174
174
  # @return [Class] The class of the channel.
175
175
  attr_reader :type
176
176
 
177
- # @!visibility private
177
+ # @private
178
178
  def initialize(data)
179
179
  @name = data[:name]
180
180
  @position = data[:position]
data/lib/discorb/http.rb CHANGED
@@ -10,7 +10,7 @@ module Discorb
10
10
  class HTTP
11
11
  @nil_body = nil
12
12
 
13
- # @!visibility private
13
+ # @private
14
14
  def initialize(client)
15
15
  @client = client
16
16
  @ratelimit_handler = RatelimitHandler.new(client)
@@ -43,7 +43,7 @@ module Discorb
43
43
  1 => :kick,
44
44
  }
45
45
 
46
- # @!visibility private
46
+ # @private
47
47
  def initialize(client, data, guild_id, no_cache: false)
48
48
  @client = client
49
49
  @data = data
@@ -88,7 +88,7 @@ module Discorb
88
88
  end
89
89
 
90
90
  class << self
91
- # @!visibility private
91
+ # @private
92
92
  attr_reader :expire_behavior
93
93
  end
94
94
 
@@ -101,7 +101,7 @@ module Discorb
101
101
  # @return [String] The name of the account.
102
102
  attr_reader :name
103
103
 
104
- # @!visibility private
104
+ # @private
105
105
  def initialize(data)
106
106
  @id = data[:id]
107
107
  @name = data[:name]
@@ -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
@@ -184,7 +184,7 @@ module Discorb
184
184
  end
185
185
 
186
186
  class CallbackMessage
187
- # @!visibility private
187
+ # @private
188
188
  def initialize(client, data, application_id, token)
189
189
  @client = client
190
190
  @data = data
@@ -198,7 +198,6 @@ module Discorb
198
198
  # @macro http
199
199
  # @macro edit
200
200
  #
201
- # @param [Discorb::Webhook::Message] message The message to edit.
202
201
  # @param [String] content The new content of the message.
203
202
  # @param [Discorb::Embed] embed The new embed of the message.
204
203
  # @param [Array<Discorb::Embed>] embeds The new embeds of the message.
@@ -256,7 +255,7 @@ module Discorb
256
255
  def defer_update(ephemeral: false)
257
256
  Async do
258
257
  @client.http.post("/interactions/#{@id}/#{@token}/callback", {
259
- type: 7,
258
+ type: 6,
260
259
  data: {
261
260
  flags: (ephemeral ? 1 << 6 : 0),
262
261
  },
@@ -311,7 +310,7 @@ module Discorb
311
310
  payload[:components] = tmp_components.filter { |c| c.length.positive? }.map { |c| { type: 1, components: c.map(&:to_hash) } }
312
311
  end
313
312
  payload[:flags] = (ephemeral ? 1 << 6 : 0)
314
- @client.http.post("/interactions/#{@id}/#{@token}/callback", { type: 6, data: payload }).wait
313
+ @client.http.post("/interactions/#{@id}/#{@token}/callback", { type: 7, data: payload }).wait
315
314
  end
316
315
  end
317
316
  end
@@ -363,28 +362,31 @@ module Discorb
363
362
  options = data[:options]
364
363
  end
365
364
  end
366
- options ||= []
367
- options.map! do |option|
368
- case option[:type]
369
- when 3, 4, 5, 10
370
- option[:value]
371
- when 6
372
- guild.members[option[:value]] || guild.fetch_member(option[:value]).wait
373
- when 7
374
- guild.channels[option[:value]] || guild.fetch_channels.wait.find { |channel| channel.id == option[:value] }
375
- when 8
376
- guild.roles[option[:value]] || guild.fetch_roles.wait.find { |role| role.id == option[:value] }
377
- when 9
378
- guild.members[option[:value]] || guild.roles[option[:value]] || guild.fetch_member(option[:value]).wait || guild.fetch_roles.wait.find { |role| role.id == option[:value] }
379
- end
380
- end
381
365
 
382
366
  unless (command = @client.bottom_commands.find { |c| c.to_s == name && c.type_raw == 1 })
383
367
  @client.log.warn "Unknown command name #{name}, ignoreing"
384
368
  next
385
369
  end
386
370
 
387
- 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] })
388
390
  end
389
391
  end
390
392
  end
@@ -418,7 +420,7 @@ module Discorb
418
420
  private
419
421
 
420
422
  def _set_data(data)
421
- @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))
422
424
  @client.commands.find { |c| c.name == data[:name] && c.type_raw == 3 }.block.call(self, @target)
423
425
  end
424
426
  end
@@ -430,10 +432,10 @@ module Discorb
430
432
  end
431
433
 
432
434
  class << self
433
- # @!visibility private
435
+ # @private
434
436
  attr_reader :command_type
435
437
 
436
- # @!visibility private
438
+ # @private
437
439
  def make_interaction(client, data)
438
440
  nested_classes.each do |klass|
439
441
  return klass.new(client, data) if !klass.command_type.nil? && klass.command_type == data[:data][:type]
@@ -442,7 +444,7 @@ module Discorb
442
444
  CommandInteraction.new(client, data)
443
445
  end
444
446
 
445
- # @!visibility private
447
+ # @private
446
448
  def nested_classes
447
449
  constants.select { |c| const_get(c).is_a? Class }.map { |c| const_get(c) }
448
450
  end
@@ -458,21 +460,23 @@ module Discorb
458
460
  include Interaction::UpdateResponse
459
461
  # @return [String] The content of the response.
460
462
  attr_reader :custom_id
463
+ # @return [Discorb::Message] The target message.
464
+ attr_reader :message
461
465
 
462
466
  @interaction_type = 3
463
467
  @interaction_name = :message_component
464
468
 
465
- # @!visibility private
469
+ # @private
466
470
  def initialize(client, data)
467
471
  super
468
472
  @message = Message.new(@client, data[:message].merge({ member: data[:member] }))
469
473
  end
470
474
 
471
475
  class << self
472
- # @!visibility private
476
+ # @private
473
477
  attr_reader :component_type
474
478
 
475
- # @!visibility private
479
+ # @private
476
480
  def make_interaction(client, data)
477
481
  nested_classes.each do |klass|
478
482
  return klass.new(client, data) if !klass.component_type.nil? && klass.component_type == data[:data][:component_type]
@@ -481,7 +485,7 @@ module Discorb
481
485
  MessageComponentInteraction.new(client, data)
482
486
  end
483
487
 
484
- # @!visibility private
488
+ # @private
485
489
  def nested_classes
486
490
  constants.select { |c| const_get(c).is_a? Class }.map { |c| const_get(c) }
487
491
  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
@@ -37,26 +37,7 @@ module Discorb
37
37
  payload[:allowed_mentions] =
38
38
  allowed_mentions ? allowed_mentions.to_hash(@client.allowed_mentions) : @client.allowed_mentions.to_hash
39
39
  payload[:message_reference] = reference.to_reference if reference
40
- if components
41
- tmp_components = []
42
- tmp_row = []
43
- components.each do |c|
44
- case c
45
- when Array
46
- tmp_components << tmp_row
47
- tmp_row = []
48
- tmp_components << c
49
- when SelectMenu
50
- tmp_components << tmp_row
51
- tmp_row = []
52
- tmp_components << [c]
53
- else
54
- tmp_row << c
55
- end
56
- end
57
- tmp_components << tmp_row
58
- payload[:components] = tmp_components.filter { |c| c.length.positive? }.map { |c| { type: 1, components: c.map(&:to_hash) } }
59
- end
40
+ payload[:components] = Component.to_payload(components) if components
60
41
  files = [file] if file
61
42
  if files
62
43
  seperator, payload = HTTP.multipart(payload, files)
@@ -69,6 +50,8 @@ module Discorb
69
50
  end
70
51
  end
71
52
 
53
+ alias send_message post
54
+
72
55
  #
73
56
  # Edit a message.
74
57
  # @macro async
@@ -95,27 +78,8 @@ module Discorb
95
78
  payload[:embeds] = tmp_embed.map(&:to_hash) if tmp_embed
96
79
  payload[:allowed_mentions] =
97
80
  allowed_mentions ? allowed_mentions.to_hash(@client.allowed_mentions) : @client.allowed_mentions.to_hash
98
- if components
99
- tmp_components = []
100
- tmp_row = []
101
- components.each do |c|
102
- case c
103
- when Array
104
- tmp_components << tmp_row
105
- tmp_row = []
106
- tmp_components << c
107
- when SelectMenu
108
- tmp_components << tmp_row
109
- tmp_row = []
110
- tmp_components << [c]
111
- else
112
- tmp_row << c
113
- end
114
- end
115
- tmp_components << tmp_row
116
- payload[:flags] = (supress ? 1 << 2 : 0) unless flags.nil?
117
- payload[:components] = tmp_components.filter { |c| c.length.positive? }.map { |c| { type: 1, components: c.map(&:to_hash) } }
118
- end
81
+ payload[:components] = Component.to_payload(components) if components
82
+ payload[:flags] = (supress ? 1 << 2 : 0) unless supress.nil?
119
83
  @client.http.patch("/channels/#{channel_id.wait}/messages/#{message_id}", payload).wait
120
84
  end
121
85
  end
@@ -192,18 +156,20 @@ module Discorb
192
156
  # end
193
157
  #
194
158
  def typing
195
- Async do |task|
196
- if block_given?
197
- begin
198
- post_task = task.async do
159
+ if block_given?
160
+ begin
161
+ post_task = Async do
162
+ loop do
199
163
  @client.http.post("/channels/#{@id}/typing", {})
200
164
  sleep(5)
201
165
  end
202
- yield
203
- ensure
204
- post_task.stop
205
166
  end
206
- else
167
+ yield
168
+ ensure
169
+ post_task.stop
170
+ end
171
+ else
172
+ Async do |task|
207
173
  @client.http.post("/channels/#{@id}/typing", {})
208
174
  end
209
175
  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