discorb 0.9.3 → 0.9.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 +4 -4
- data/.github/workflows/build_main.yml +2 -0
- data/Changelog.md +8 -1
- data/README.md +6 -6
- data/Rakefile +4 -1
- data/assets/banner.svg +101 -101
- data/docs/cli/run.md +3 -3
- data/lib/discorb/app_command.rb +8 -8
- data/lib/discorb/application.rb +3 -3
- data/lib/discorb/asset.rb +2 -2
- data/lib/discorb/audit_logs.rb +7 -7
- data/lib/discorb/channel.rb +10 -10
- data/lib/discorb/common.rb +3 -3
- data/lib/discorb/components.rb +2 -2
- data/lib/discorb/embed.rb +2 -2
- data/lib/discorb/emoji.rb +3 -3
- data/lib/discorb/error.rb +2 -2
- data/lib/discorb/exe/init.rb +8 -8
- data/lib/discorb/exe/run.rb +1 -1
- data/lib/discorb/extension.rb +1 -1
- data/lib/discorb/file.rb +1 -1
- data/lib/discorb/gateway.rb +8 -8
- data/lib/discorb/gateway_requests.rb +1 -1
- data/lib/discorb/guild.rb +7 -7
- data/lib/discorb/guild_template.rb +4 -4
- data/lib/discorb/http.rb +1 -1
- data/lib/discorb/integration.rb +3 -3
- data/lib/discorb/interaction.rb +13 -13
- data/lib/discorb/invite.rb +2 -2
- data/lib/discorb/log.rb +1 -1
- data/lib/discorb/member.rb +1 -1
- data/lib/discorb/message.rb +30 -6
- data/lib/discorb/modules.rb +10 -8
- data/lib/discorb/permission.rb +2 -2
- data/lib/discorb/presence.rb +8 -8
- data/lib/discorb/rate_limit.rb +1 -1
- data/lib/discorb/reaction.rb +1 -1
- data/lib/discorb/role.rb +2 -2
- data/lib/discorb/sticker.rb +3 -3
- data/lib/discorb/user.rb +2 -2
- data/lib/discorb/utils/colored_puts.rb +3 -3
- data/lib/discorb/utils.rb +1 -1
- data/lib/discorb/voice_state.rb +3 -3
- data/lib/discorb/webhook.rb +7 -8
- data/lib/discorb.rb +1 -1
- data/sig/discorb.rbs +2 -2
- data/template-replace/files/css/common.css +25 -0
- data/template-replace/files/favicon.png +0 -0
- data/template-replace/scripts/favicon.rb +9 -0
- 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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
58
|
+
# @private
|
59
59
|
def initialize(resp, data)
|
60
60
|
@code = data[:code]
|
61
61
|
@response = resp
|
data/lib/discorb/exe/init.rb
CHANGED
@@ -6,7 +6,7 @@ require_relative "../utils/colored_puts"
|
|
6
6
|
|
7
7
|
$path = Dir.pwd
|
8
8
|
|
9
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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."
|
data/lib/discorb/exe/run.rb
CHANGED
data/lib/discorb/extension.rb
CHANGED
data/lib/discorb/file.rb
CHANGED
data/lib/discorb/gateway.rb
CHANGED
@@ -16,7 +16,7 @@ module Discorb
|
|
16
16
|
# Represents an event.
|
17
17
|
#
|
18
18
|
class GatewayEvent
|
19
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
461
|
+
# @private
|
462
462
|
def initialize(client, data)
|
463
463
|
@client = client
|
464
464
|
@data = data
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
177
|
+
# @private
|
178
178
|
def initialize(data)
|
179
179
|
@name = data[:name]
|
180
180
|
@position = data[:position]
|
data/lib/discorb/http.rb
CHANGED
data/lib/discorb/integration.rb
CHANGED
@@ -43,7 +43,7 @@ module Discorb
|
|
43
43
|
1 => :kick,
|
44
44
|
}
|
45
45
|
|
46
|
-
#
|
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
|
-
#
|
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
|
-
#
|
104
|
+
# @private
|
105
105
|
def initialize(data)
|
106
106
|
@id = data[:id]
|
107
107
|
@name = data[:name]
|
data/lib/discorb/interaction.rb
CHANGED
@@ -33,7 +33,7 @@ module Discorb
|
|
33
33
|
@interaction_type = nil
|
34
34
|
@interaction_name = nil
|
35
35
|
|
36
|
-
#
|
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
|
-
#
|
74
|
+
# @private
|
75
75
|
attr_reader :interaction_type, :interaction_name, :event_name
|
76
76
|
|
77
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
433
|
+
# @private
|
434
434
|
attr_reader :command_type
|
435
435
|
|
436
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
472
|
+
# @private
|
473
473
|
attr_reader :component_type
|
474
474
|
|
475
|
-
#
|
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
|
-
#
|
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
|
data/lib/discorb/invite.rb
CHANGED
@@ -72,7 +72,7 @@ module Discorb
|
|
72
72
|
2 => :guild,
|
73
73
|
}.freeze
|
74
74
|
|
75
|
-
#
|
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
|
-
#
|
141
|
+
# @private
|
142
142
|
attr_reader :target_types
|
143
143
|
end
|
144
144
|
end
|
data/lib/discorb/log.rb
CHANGED
data/lib/discorb/member.rb
CHANGED
data/lib/discorb/message.rb
CHANGED
@@ -29,7 +29,7 @@ module Discorb
|
|
29
29
|
@replied_user = replied_user
|
30
30
|
end
|
31
31
|
|
32
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
675
|
+
# @private
|
652
676
|
attr_reader :type
|
653
677
|
end
|
654
678
|
end
|
655
679
|
|
656
680
|
class << self
|
657
|
-
#
|
681
|
+
# @private
|
658
682
|
attr_reader :message_type
|
659
683
|
end
|
660
684
|
end
|
data/lib/discorb/modules.rb
CHANGED
@@ -192,18 +192,20 @@ module Discorb
|
|
192
192
|
# end
|
193
193
|
#
|
194
194
|
def typing
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
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
|
-
|
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
|
data/lib/discorb/permission.rb
CHANGED
@@ -138,7 +138,7 @@ module Discorb
|
|
138
138
|
}.freeze
|
139
139
|
@bits = @raw_bits.transform_values { |v| 1 << v }.freeze
|
140
140
|
|
141
|
-
#
|
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
|
-
#
|
251
|
+
# @private
|
252
252
|
attr_reader :bits
|
253
253
|
|
254
254
|
#
|
data/lib/discorb/presence.rb
CHANGED
@@ -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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
278
|
+
# @private
|
279
279
|
def initialize(data)
|
280
280
|
@desktop = data[:desktop]&.to_sym || :offline
|
281
281
|
@mobile = data[:mobile]&.to_sym || :offline
|