discorb 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build_main.yml +2 -0
  3. data/Changelog.md +8 -1
  4. data/README.md +6 -6
  5. data/Rakefile +4 -1
  6. data/assets/banner.svg +101 -101
  7. data/docs/cli/run.md +3 -3
  8. data/lib/discorb/app_command.rb +8 -8
  9. data/lib/discorb/application.rb +3 -3
  10. data/lib/discorb/asset.rb +2 -2
  11. data/lib/discorb/audit_logs.rb +7 -7
  12. data/lib/discorb/channel.rb +10 -10
  13. data/lib/discorb/common.rb +3 -3
  14. data/lib/discorb/components.rb +2 -2
  15. data/lib/discorb/embed.rb +2 -2
  16. data/lib/discorb/emoji.rb +3 -3
  17. data/lib/discorb/error.rb +2 -2
  18. data/lib/discorb/exe/init.rb +8 -8
  19. data/lib/discorb/exe/run.rb +1 -1
  20. data/lib/discorb/extension.rb +1 -1
  21. data/lib/discorb/file.rb +1 -1
  22. data/lib/discorb/gateway.rb +8 -8
  23. data/lib/discorb/gateway_requests.rb +1 -1
  24. data/lib/discorb/guild.rb +7 -7
  25. data/lib/discorb/guild_template.rb +4 -4
  26. data/lib/discorb/http.rb +1 -1
  27. data/lib/discorb/integration.rb +3 -3
  28. data/lib/discorb/interaction.rb +13 -13
  29. data/lib/discorb/invite.rb +2 -2
  30. data/lib/discorb/log.rb +1 -1
  31. data/lib/discorb/member.rb +1 -1
  32. data/lib/discorb/message.rb +30 -6
  33. data/lib/discorb/modules.rb +10 -8
  34. data/lib/discorb/permission.rb +2 -2
  35. data/lib/discorb/presence.rb +8 -8
  36. data/lib/discorb/rate_limit.rb +1 -1
  37. data/lib/discorb/reaction.rb +1 -1
  38. data/lib/discorb/role.rb +2 -2
  39. data/lib/discorb/sticker.rb +3 -3
  40. data/lib/discorb/user.rb +2 -2
  41. data/lib/discorb/utils/colored_puts.rb +3 -3
  42. data/lib/discorb/utils.rb +1 -1
  43. data/lib/discorb/voice_state.rb +3 -3
  44. data/lib/discorb/webhook.rb +7 -8
  45. data/lib/discorb.rb +1 -1
  46. data/sig/discorb.rbs +2 -2
  47. data/template-replace/files/css/common.css +25 -0
  48. data/template-replace/files/favicon.png +0 -0
  49. data/template-replace/scripts/favicon.rb +9 -0
  50. metadata +4 -2
data/lib/discorb/emoji.rb CHANGED
@@ -40,7 +40,7 @@ module Discorb
40
40
  # @!attribute [r] roles?
41
41
  # @return [Boolean] whether or not this emoji is restricted to certain roles.
42
42
 
43
- # @!visibility private
43
+ # @private
44
44
  def initialize(client, guild, data)
45
45
  @client = client
46
46
  @guild = guild
@@ -147,7 +147,7 @@ module Discorb
147
147
  attr_reader :deleted
148
148
  alias deleted? deleted
149
149
 
150
- # @!visibility private
150
+ # @private
151
151
  def initialize(data)
152
152
  @id = Snowflake.new(data[:id])
153
153
  @name = data[:name]
@@ -189,7 +189,7 @@ module Discorb
189
189
  # @return [Integer] The skin tone of the emoji.
190
190
  attr_reader :skin_tone
191
191
 
192
- # @!visibility private
192
+ # @private
193
193
  def initialize(name, tone: 0)
194
194
  if EmojiTable::DISCORD_TO_UNICODE.key?(name)
195
195
  @name = name
data/lib/discorb/error.rb CHANGED
@@ -43,7 +43,7 @@ module Discorb
43
43
  # @return [Net::HTTPResponse] the HTTP response.
44
44
  attr_reader :response
45
45
 
46
- # @!visibility private
46
+ # @private
47
47
  def initialize(resp, data)
48
48
  @code = data[:code]
49
49
  @response = resp
@@ -55,7 +55,7 @@ module Discorb
55
55
  # Represents a 400 error.
56
56
  #
57
57
  class BadRequestError < HTTPError
58
- # @!visibility private
58
+ # @private
59
59
  def initialize(resp, data)
60
60
  @code = data[:code]
61
61
  @response = resp
@@ -6,7 +6,7 @@ require_relative "../utils/colored_puts"
6
6
 
7
7
  $path = Dir.pwd
8
8
 
9
- # @!visibility private
9
+ # @private
10
10
  FILES = {
11
11
  "main.rb" => <<~'RUBY',
12
12
  require "discorb"
@@ -133,12 +133,12 @@ FILES = {
133
133
  MARKDOWN
134
134
  }
135
135
 
136
- # @!visibility private
136
+ # @private
137
137
  def create_file(name)
138
138
  File.write($path + "/#{name}", format(FILES[name], token: $values[:token], name: $values[:name]), mode: "wb")
139
139
  end
140
140
 
141
- # @!visibility private
141
+ # @private
142
142
  def make_files
143
143
  iputs "Making files..."
144
144
  create_file("main.rb")
@@ -146,7 +146,7 @@ def make_files
146
146
  sputs "Made files.\n"
147
147
  end
148
148
 
149
- # @!visibility private
149
+ # @private
150
150
  def bundle_init
151
151
  iputs "Initializing bundle..."
152
152
  create_file("Gemfile")
@@ -155,7 +155,7 @@ def bundle_init
155
155
  sputs "Installed gems.\n"
156
156
  end
157
157
 
158
- # @!visibility private
158
+ # @private
159
159
  def git_init
160
160
  create_file(".gitignore")
161
161
  iputs "Initializing git repository..."
@@ -167,7 +167,7 @@ def git_init
167
167
  " to change commit message of initial commit.\n"
168
168
  end
169
169
 
170
- # @!visibility private
170
+ # @private
171
171
  def make_descs
172
172
  iputs "Making descriptions..."
173
173
  create_file(".env.sample")
@@ -246,8 +246,8 @@ bundle_init if $values[:bundle]
246
246
 
247
247
  make_files
248
248
 
249
- git_init if $values[:git]
250
-
251
249
  make_descs if $values[:descs]
252
250
 
251
+ git_init if $values[:git]
252
+
253
253
  sputs "\nSuccessfully made a new project at \e[32m#{$path}\e[92m."
@@ -5,7 +5,7 @@ require "discorb/utils/colored_puts"
5
5
  require "io/console"
6
6
 
7
7
  ARGV.delete_at 0
8
- # @!visibility private
8
+ # @private
9
9
  LOG_LEVELS = %w[none debug info warn error fatal]
10
10
 
11
11
  opt = OptionParser.new <<~BANNER
@@ -54,7 +54,7 @@ module Discorb
54
54
  # @private
55
55
  attr_reader :bottom_commands
56
56
 
57
- # @!visibility private
57
+ # @private
58
58
  attr_accessor :client
59
59
 
60
60
  def self.extended(obj)
data/lib/discorb/file.rb CHANGED
@@ -32,7 +32,7 @@ module Discorb
32
32
  # @!attribute [r] image?
33
33
  # @return [Boolean] whether the file is an image.
34
34
 
35
- # @!visibility private
35
+ # @private
36
36
  def initialize(data)
37
37
  @id = Snowflake.new(data[:id])
38
38
  @filename = data[:filename]
@@ -16,7 +16,7 @@ module Discorb
16
16
  # Represents an event.
17
17
  #
18
18
  class GatewayEvent
19
- # @!visibility private
19
+ # @private
20
20
  def initialize(data)
21
21
  @data = data
22
22
  end
@@ -61,7 +61,7 @@ module Discorb
61
61
  alias reactor fired_by
62
62
  alias from fired_by
63
63
 
64
- # @!visibility private
64
+ # @private
65
65
  def initialize(client, data)
66
66
  @client = client
67
67
  @data = data
@@ -129,7 +129,7 @@ module Discorb
129
129
  # @return [Discorb::Message] The message the reaction was sent in.
130
130
  attr_reader :message
131
131
 
132
- # @!visibility private
132
+ # @private
133
133
  def initialize(client, data)
134
134
  @client = client
135
135
  @data = data
@@ -180,7 +180,7 @@ module Discorb
180
180
  # @return [Discorb::UnicodeEmoji, Discorb::PartialEmoji] The emoji that was reacted with.
181
181
  attr_reader :emoji
182
182
 
183
- # @!visibility private
183
+ # @private
184
184
  def initialize(client, data)
185
185
  @client = client
186
186
  @data = data
@@ -296,7 +296,7 @@ module Discorb
296
296
  # @macro client_cache
297
297
  # @return [Discorb::Guild] The guild the message was sent in.
298
298
 
299
- # @!visibility private
299
+ # @private
300
300
  def initialize(client, id, data)
301
301
  @client = client
302
302
  @id = id
@@ -328,7 +328,7 @@ module Discorb
328
328
  # @macro client_cache
329
329
  # @return [Discorb::Guild] The guild the message was sent in.
330
330
 
331
- # @!visibility private
331
+ # @private
332
332
  def initialize(client, data)
333
333
  @client = client
334
334
  @data = data
@@ -381,7 +381,7 @@ module Discorb
381
381
  # @macro client_cache
382
382
  # @return [Discorb::Member, Discorb::User] The member or user that started typing.
383
383
 
384
- # @!visibility private
384
+ # @private
385
385
  def initialize(client, data)
386
386
  @client = client
387
387
  @data = data
@@ -458,7 +458,7 @@ module Discorb
458
458
  # @macro client_cache
459
459
  # @return [Discorb::Guild] The guild where the webhook was updated.
460
460
 
461
- # @!visibility private
461
+ # @private
462
462
  def initialize(client, data)
463
463
  @client = client
464
464
  @data = data
@@ -40,7 +40,7 @@ module Discorb
40
40
  end
41
41
 
42
42
  class << self
43
- # @!visibility private
43
+ # @private
44
44
  attr_reader :types
45
45
  end
46
46
  end
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
@@ -418,7 +418,7 @@ module Discorb
418
418
  private
419
419
 
420
420
  def _set_data(data)
421
- @target = Message.new(@client, data[:resolved][:messages][data[:target_id].to_sym])
421
+ @target = Message.new(@client, data[:resolved][:messages][data[:target_id].to_sym].merge(guild_id: @guild_id.to_s))
422
422
  @client.commands.find { |c| c.name == data[:name] && c.type_raw == 3 }.block.call(self, @target)
423
423
  end
424
424
  end
@@ -430,10 +430,10 @@ module Discorb
430
430
  end
431
431
 
432
432
  class << self
433
- # @!visibility private
433
+ # @private
434
434
  attr_reader :command_type
435
435
 
436
- # @!visibility private
436
+ # @private
437
437
  def make_interaction(client, data)
438
438
  nested_classes.each do |klass|
439
439
  return klass.new(client, data) if !klass.command_type.nil? && klass.command_type == data[:data][:type]
@@ -442,7 +442,7 @@ module Discorb
442
442
  CommandInteraction.new(client, data)
443
443
  end
444
444
 
445
- # @!visibility private
445
+ # @private
446
446
  def nested_classes
447
447
  constants.select { |c| const_get(c).is_a? Class }.map { |c| const_get(c) }
448
448
  end
@@ -462,17 +462,17 @@ module Discorb
462
462
  @interaction_type = 3
463
463
  @interaction_name = :message_component
464
464
 
465
- # @!visibility private
465
+ # @private
466
466
  def initialize(client, data)
467
467
  super
468
468
  @message = Message.new(@client, data[:message].merge({ member: data[:member] }))
469
469
  end
470
470
 
471
471
  class << self
472
- # @!visibility private
472
+ # @private
473
473
  attr_reader :component_type
474
474
 
475
- # @!visibility private
475
+ # @private
476
476
  def make_interaction(client, data)
477
477
  nested_classes.each do |klass|
478
478
  return klass.new(client, data) if !klass.component_type.nil? && klass.component_type == data[:data][:component_type]
@@ -481,7 +481,7 @@ module Discorb
481
481
  MessageComponentInteraction.new(client, data)
482
482
  end
483
483
 
484
- # @!visibility private
484
+ # @private
485
485
  def nested_classes
486
486
  constants.select { |c| const_get(c).is_a? Class }.map { |c| const_get(c) }
487
487
  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 = {}
@@ -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
@@ -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 = {}