discorb 0.19.0 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build_version.yml +2 -2
- data/.rubocop.yml +12 -75
- data/Changelog.md +10 -0
- data/Rakefile +482 -454
- data/lib/discorb/allowed_mentions.rb +68 -72
- data/lib/discorb/app_command/command.rb +466 -398
- data/lib/discorb/app_command/common.rb +65 -25
- data/lib/discorb/app_command/handler.rb +304 -266
- data/lib/discorb/app_command.rb +5 -5
- data/lib/discorb/application.rb +198 -197
- data/lib/discorb/asset.rb +101 -101
- data/lib/discorb/attachment.rb +134 -119
- data/lib/discorb/audit_logs.rb +412 -385
- data/lib/discorb/automod.rb +279 -269
- data/lib/discorb/channel/base.rb +107 -108
- data/lib/discorb/channel/category.rb +32 -32
- data/lib/discorb/channel/container.rb +44 -44
- data/lib/discorb/channel/dm.rb +26 -28
- data/lib/discorb/channel/guild.rb +311 -246
- data/lib/discorb/channel/stage.rb +156 -140
- data/lib/discorb/channel/text.rb +430 -336
- data/lib/discorb/channel/thread.rb +374 -325
- data/lib/discorb/channel/voice.rb +85 -79
- data/lib/discorb/channel.rb +5 -5
- data/lib/discorb/client.rb +635 -621
- data/lib/discorb/color.rb +178 -182
- data/lib/discorb/common.rb +168 -164
- data/lib/discorb/components/button.rb +107 -106
- data/lib/discorb/components/select_menu.rb +157 -145
- data/lib/discorb/components/text_input.rb +103 -106
- data/lib/discorb/components.rb +68 -66
- data/lib/discorb/dictionary.rb +135 -135
- data/lib/discorb/embed.rb +404 -398
- data/lib/discorb/emoji.rb +309 -302
- data/lib/discorb/emoji_table.rb +16099 -8857
- data/lib/discorb/error.rb +131 -131
- data/lib/discorb/event.rb +360 -314
- data/lib/discorb/event_handler.rb +39 -39
- data/lib/discorb/exe/about.rb +17 -17
- data/lib/discorb/exe/irb.rb +72 -67
- data/lib/discorb/exe/new.rb +323 -315
- data/lib/discorb/exe/run.rb +69 -68
- data/lib/discorb/exe/setup.rb +57 -55
- data/lib/discorb/exe/show.rb +12 -12
- data/lib/discorb/extend.rb +25 -45
- data/lib/discorb/extension.rb +89 -83
- data/lib/discorb/flag.rb +126 -128
- data/lib/discorb/gateway.rb +984 -804
- data/lib/discorb/gateway_events.rb +670 -638
- data/lib/discorb/gateway_requests.rb +45 -48
- data/lib/discorb/guild.rb +2115 -1626
- data/lib/discorb/guild_template.rb +280 -241
- data/lib/discorb/http.rb +247 -232
- data/lib/discorb/image.rb +42 -42
- data/lib/discorb/integration.rb +169 -161
- data/lib/discorb/intents.rb +161 -163
- data/lib/discorb/interaction/autocomplete.rb +76 -62
- data/lib/discorb/interaction/command.rb +279 -224
- data/lib/discorb/interaction/components.rb +114 -104
- data/lib/discorb/interaction/modal.rb +36 -32
- data/lib/discorb/interaction/response.rb +379 -336
- data/lib/discorb/interaction/root.rb +271 -257
- data/lib/discorb/interaction.rb +5 -5
- data/lib/discorb/invite.rb +154 -153
- data/lib/discorb/member.rb +344 -311
- data/lib/discorb/message.rb +615 -544
- data/lib/discorb/message_meta.rb +197 -186
- data/lib/discorb/modules.rb +371 -290
- data/lib/discorb/permission.rb +305 -291
- data/lib/discorb/presence.rb +352 -346
- data/lib/discorb/rate_limit.rb +81 -76
- data/lib/discorb/reaction.rb +55 -54
- data/lib/discorb/role.rb +272 -240
- data/lib/discorb/shard.rb +76 -74
- data/lib/discorb/sticker.rb +193 -171
- data/lib/discorb/user.rb +205 -188
- data/lib/discorb/utils/colored_puts.rb +16 -16
- data/lib/discorb/utils.rb +12 -16
- data/lib/discorb/voice_state.rb +305 -281
- data/lib/discorb/webhook.rb +537 -507
- data/lib/discorb.rb +62 -56
- data/sig/discorb/application.rbs +2 -0
- data/sig/discorb/automod.rbs +10 -1
- data/sig/discorb/guild.rbs +2 -0
- data/sig/discorb/message.rbs +2 -0
- data/sig/discorb/user.rbs +22 -20
- metadata +2 -2
data/lib/discorb/voice_state.rb
CHANGED
@@ -1,281 +1,305 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Discorb
|
4
|
-
#
|
5
|
-
# Represents a state of user in voice channel.
|
6
|
-
#
|
7
|
-
class VoiceState < DiscordModel
|
8
|
-
# @return [Discorb::Member] The member associated with this voice state.
|
9
|
-
attr_reader :member
|
10
|
-
# @return [Discorb::Snowflake] The ID of the guild this voice state is for.
|
11
|
-
attr_reader :session_id
|
12
|
-
# @return [Time] The time at which the user requested to speak.
|
13
|
-
attr_reader :request_to_speak_timestamp
|
14
|
-
# @return [Boolean] Whether the user is deafened.
|
15
|
-
attr_reader :self_deaf
|
16
|
-
alias self_deaf? self_deaf
|
17
|
-
# @return [Boolean] Whether the user is muted.
|
18
|
-
attr_reader :self_mute
|
19
|
-
alias self_mute? self_mute
|
20
|
-
# @return [Boolean] Whether the user is streaming.
|
21
|
-
attr_reader :self_stream
|
22
|
-
alias stream? self_stream
|
23
|
-
alias live? stream?
|
24
|
-
# @return [Boolean] Whether the user is video-enabled.
|
25
|
-
attr_reader :self_video
|
26
|
-
alias video? self_video
|
27
|
-
# @return [Boolean] Whether the user is suppressed. (Is at audience)
|
28
|
-
attr_reader :suppress
|
29
|
-
alias suppress? suppress
|
30
|
-
|
31
|
-
# @!attribute [r] deaf?
|
32
|
-
# @return [Boolean] Whether the user is deafened.
|
33
|
-
# @!attribute [r] mute?
|
34
|
-
# @return [Boolean] Whether the user is muted.
|
35
|
-
# @!attribute [r] server_deaf?
|
36
|
-
# @return [Boolean] Whether the user is deafened on the server.
|
37
|
-
# @!attribute [r] server_mute?
|
38
|
-
# @return [Boolean] Whether the user is muted on the server.
|
39
|
-
# @!attribute [r] guild
|
40
|
-
# @macro client_cache
|
41
|
-
# @return [Discorb::Guild] The guild this voice state is for.
|
42
|
-
# @!attribute [r] channel
|
43
|
-
# @macro client_cache
|
44
|
-
# @return [Discorb::Channel] The channel this voice state is for.
|
45
|
-
# @!attribute [r] user
|
46
|
-
# @macro client_cache
|
47
|
-
# @return [Discorb::User] The user this voice state is for.
|
48
|
-
|
49
|
-
#
|
50
|
-
# Initialize a new voice state.
|
51
|
-
# @private
|
52
|
-
#
|
53
|
-
# @param [Discorb::Client] client The client this voice state belongs to.
|
54
|
-
# @param [Hash] data The data of the voice state.
|
55
|
-
#
|
56
|
-
def initialize(client, data)
|
57
|
-
@client = client
|
58
|
-
_set_data(data)
|
59
|
-
end
|
60
|
-
|
61
|
-
def deaf?
|
62
|
-
@deaf || @self_deaf
|
63
|
-
end
|
64
|
-
|
65
|
-
def mute?
|
66
|
-
@mute || @self_mute
|
67
|
-
end
|
68
|
-
|
69
|
-
def server_deaf?
|
70
|
-
@deaf
|
71
|
-
end
|
72
|
-
|
73
|
-
def server_mute?
|
74
|
-
@mute
|
75
|
-
end
|
76
|
-
|
77
|
-
def guild
|
78
|
-
@guild_id && @client.guilds[@guild_id]
|
79
|
-
end
|
80
|
-
|
81
|
-
def channel
|
82
|
-
@channel_id && @client.channels[@channel_id]
|
83
|
-
end
|
84
|
-
|
85
|
-
def user
|
86
|
-
@client.users[@user_id]
|
87
|
-
end
|
88
|
-
|
89
|
-
private
|
90
|
-
|
91
|
-
def _set_data(data)
|
92
|
-
@data = data
|
93
|
-
@guild_id = data[:guild_id]
|
94
|
-
@channel_id = data[:channel_id]
|
95
|
-
@user_id = data[:user_id]
|
96
|
-
unless guild.nil?
|
97
|
-
@member =
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
@
|
111
|
-
@
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
#
|
129
|
-
|
130
|
-
#
|
131
|
-
|
132
|
-
#
|
133
|
-
|
134
|
-
|
135
|
-
#
|
136
|
-
#
|
137
|
-
# @return [
|
138
|
-
|
139
|
-
@
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
#
|
145
|
-
#
|
146
|
-
#
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
#
|
151
|
-
#
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
@
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
#
|
190
|
-
#
|
191
|
-
#
|
192
|
-
# @
|
193
|
-
#
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Discorb
|
4
|
+
#
|
5
|
+
# Represents a state of user in voice channel.
|
6
|
+
#
|
7
|
+
class VoiceState < DiscordModel
|
8
|
+
# @return [Discorb::Member] The member associated with this voice state.
|
9
|
+
attr_reader :member
|
10
|
+
# @return [Discorb::Snowflake] The ID of the guild this voice state is for.
|
11
|
+
attr_reader :session_id
|
12
|
+
# @return [Time] The time at which the user requested to speak.
|
13
|
+
attr_reader :request_to_speak_timestamp
|
14
|
+
# @return [Boolean] Whether the user is deafened.
|
15
|
+
attr_reader :self_deaf
|
16
|
+
alias self_deaf? self_deaf
|
17
|
+
# @return [Boolean] Whether the user is muted.
|
18
|
+
attr_reader :self_mute
|
19
|
+
alias self_mute? self_mute
|
20
|
+
# @return [Boolean] Whether the user is streaming.
|
21
|
+
attr_reader :self_stream
|
22
|
+
alias stream? self_stream
|
23
|
+
alias live? stream?
|
24
|
+
# @return [Boolean] Whether the user is video-enabled.
|
25
|
+
attr_reader :self_video
|
26
|
+
alias video? self_video
|
27
|
+
# @return [Boolean] Whether the user is suppressed. (Is at audience)
|
28
|
+
attr_reader :suppress
|
29
|
+
alias suppress? suppress
|
30
|
+
|
31
|
+
# @!attribute [r] deaf?
|
32
|
+
# @return [Boolean] Whether the user is deafened.
|
33
|
+
# @!attribute [r] mute?
|
34
|
+
# @return [Boolean] Whether the user is muted.
|
35
|
+
# @!attribute [r] server_deaf?
|
36
|
+
# @return [Boolean] Whether the user is deafened on the server.
|
37
|
+
# @!attribute [r] server_mute?
|
38
|
+
# @return [Boolean] Whether the user is muted on the server.
|
39
|
+
# @!attribute [r] guild
|
40
|
+
# @macro client_cache
|
41
|
+
# @return [Discorb::Guild] The guild this voice state is for.
|
42
|
+
# @!attribute [r] channel
|
43
|
+
# @macro client_cache
|
44
|
+
# @return [Discorb::Channel] The channel this voice state is for.
|
45
|
+
# @!attribute [r] user
|
46
|
+
# @macro client_cache
|
47
|
+
# @return [Discorb::User] The user this voice state is for.
|
48
|
+
|
49
|
+
#
|
50
|
+
# Initialize a new voice state.
|
51
|
+
# @private
|
52
|
+
#
|
53
|
+
# @param [Discorb::Client] client The client this voice state belongs to.
|
54
|
+
# @param [Hash] data The data of the voice state.
|
55
|
+
#
|
56
|
+
def initialize(client, data)
|
57
|
+
@client = client
|
58
|
+
_set_data(data)
|
59
|
+
end
|
60
|
+
|
61
|
+
def deaf?
|
62
|
+
@deaf || @self_deaf
|
63
|
+
end
|
64
|
+
|
65
|
+
def mute?
|
66
|
+
@mute || @self_mute
|
67
|
+
end
|
68
|
+
|
69
|
+
def server_deaf?
|
70
|
+
@deaf
|
71
|
+
end
|
72
|
+
|
73
|
+
def server_mute?
|
74
|
+
@mute
|
75
|
+
end
|
76
|
+
|
77
|
+
def guild
|
78
|
+
@guild_id && @client.guilds[@guild_id]
|
79
|
+
end
|
80
|
+
|
81
|
+
def channel
|
82
|
+
@channel_id && @client.channels[@channel_id]
|
83
|
+
end
|
84
|
+
|
85
|
+
def user
|
86
|
+
@client.users[@user_id]
|
87
|
+
end
|
88
|
+
|
89
|
+
private
|
90
|
+
|
91
|
+
def _set_data(data)
|
92
|
+
@data = data
|
93
|
+
@guild_id = data[:guild_id]
|
94
|
+
@channel_id = data[:channel_id]
|
95
|
+
@user_id = data[:user_id]
|
96
|
+
unless guild.nil?
|
97
|
+
@member =
|
98
|
+
if data.key?(:member)
|
99
|
+
guild.members[data[:user_id]] ||
|
100
|
+
Member.new(
|
101
|
+
@client,
|
102
|
+
@guild_id,
|
103
|
+
data[:member][:user],
|
104
|
+
data[:member]
|
105
|
+
)
|
106
|
+
else
|
107
|
+
guild.members[data[:user_id]]
|
108
|
+
end
|
109
|
+
end
|
110
|
+
@session_id = data[:session_id]
|
111
|
+
@deaf = data[:deaf]
|
112
|
+
@mute = data[:mute]
|
113
|
+
@self_deaf = data[:self_deaf]
|
114
|
+
@self_mute = data[:self_mute]
|
115
|
+
@self_stream = data[:self_stream]
|
116
|
+
@self_video = data[:self_video]
|
117
|
+
@suppress = data[:suppress]
|
118
|
+
@request_to_speak_timestamp =
|
119
|
+
data[:request_to_speak_timestamp] &&
|
120
|
+
Time.iso8601(data[:request_to_speak_timestamp])
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
#
|
125
|
+
# Represents a stage instance of a voice state.
|
126
|
+
#
|
127
|
+
class StageInstance < DiscordModel
|
128
|
+
# @return [Discorb::Snowflake] The ID of the guild this voice state is for.
|
129
|
+
attr_reader :id
|
130
|
+
# @return [String] The topic of the stage instance.
|
131
|
+
attr_reader :topic
|
132
|
+
# @return [:public, :guild_only] The privacy level of the stage instance.
|
133
|
+
attr_reader :privacy_level
|
134
|
+
|
135
|
+
# @!attribute [r] guild
|
136
|
+
# @macro client_cache
|
137
|
+
# @return [Discorb::Guild] The guild this voice state is for.
|
138
|
+
# @!attribute [r] channel
|
139
|
+
# @macro client_cache
|
140
|
+
# @return [Discorb::Channel] The channel this voice state is for.
|
141
|
+
# @!attribute [r] discoverable?
|
142
|
+
# @return [Boolean] Whether the stage instance is discoverable.
|
143
|
+
# @!attribute [r] public?
|
144
|
+
# @return [Boolean] Whether the stage instance is public.
|
145
|
+
# @!attribute [r] guild_only?
|
146
|
+
# @return [Boolean] Whether the stage instance is guild-only.
|
147
|
+
|
148
|
+
@privacy_level = { 1 => :public, 2 => :guild_only }
|
149
|
+
|
150
|
+
#
|
151
|
+
# Initialize a new instance of the StageInstance class.
|
152
|
+
# @private
|
153
|
+
#
|
154
|
+
# @param [Discorb::Client] client The client.
|
155
|
+
# @param [Hash] data The data of the stage instance.
|
156
|
+
# @param [Boolean] no_cache Whether to disable caching.
|
157
|
+
#
|
158
|
+
def initialize(client, data, no_cache: false)
|
159
|
+
@client = client
|
160
|
+
@data = data
|
161
|
+
_set_data(data)
|
162
|
+
channel.stage_instances[@id] = self unless no_cache
|
163
|
+
end
|
164
|
+
|
165
|
+
def guild
|
166
|
+
@client.guilds[@data[:guild_id]]
|
167
|
+
end
|
168
|
+
|
169
|
+
def channel
|
170
|
+
@client.channels[@data[:channel_id]]
|
171
|
+
end
|
172
|
+
|
173
|
+
def discoverable?
|
174
|
+
!@discoverable_disabled
|
175
|
+
end
|
176
|
+
|
177
|
+
def public?
|
178
|
+
@privacy_level == :public
|
179
|
+
end
|
180
|
+
|
181
|
+
def guild_only?
|
182
|
+
@privacy_level == :guild_only
|
183
|
+
end
|
184
|
+
|
185
|
+
def inspect
|
186
|
+
"#<#{self.class} topic=#{@topic.inspect}>"
|
187
|
+
end
|
188
|
+
|
189
|
+
#
|
190
|
+
# Edits the stage instance.
|
191
|
+
# @async
|
192
|
+
# @macro edit
|
193
|
+
#
|
194
|
+
# @param [String] topic The new topic of the stage instance.
|
195
|
+
# @param [:public, :guild_only] privacy_level The new privacy level of the stage instance.
|
196
|
+
# @param [String] reason The reason for editing the stage instance.
|
197
|
+
#
|
198
|
+
# @return [Async::Task<void>] The task.
|
199
|
+
#
|
200
|
+
def edit(topic: Discorb::Unset, privacy_level: Discorb::Unset, reason: nil)
|
201
|
+
Async do
|
202
|
+
payload = {}
|
203
|
+
payload[:topic] = topic if topic != Discorb::Unset
|
204
|
+
payload[:privacy_level] = PRIVACY_LEVEL.key(
|
205
|
+
privacy_level
|
206
|
+
) if privacy_level != Discorb::Unset
|
207
|
+
@client
|
208
|
+
.http
|
209
|
+
.request(
|
210
|
+
Route.new(
|
211
|
+
"/stage-instances/#{@channel_id}",
|
212
|
+
"//stage-instances/:channel_id",
|
213
|
+
:patch
|
214
|
+
),
|
215
|
+
payload,
|
216
|
+
audit_log_reason: reason
|
217
|
+
)
|
218
|
+
.wait
|
219
|
+
self
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
alias modify edit
|
224
|
+
|
225
|
+
#
|
226
|
+
# Deletes the stage instance.
|
227
|
+
#
|
228
|
+
# @param [String] reason The reason for deleting the stage instance.
|
229
|
+
#
|
230
|
+
# @return [Async::Task<void>] The task.
|
231
|
+
#
|
232
|
+
def delete(reason: nil)
|
233
|
+
Async do
|
234
|
+
@client
|
235
|
+
.http
|
236
|
+
.request(
|
237
|
+
Route.new(
|
238
|
+
"/stage-instances/#{@channel_id}",
|
239
|
+
"//stage-instances/:stage_instance_id",
|
240
|
+
:delete
|
241
|
+
),
|
242
|
+
{},
|
243
|
+
audit_log_reason: reason
|
244
|
+
)
|
245
|
+
.wait
|
246
|
+
self
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
alias destroy delete
|
251
|
+
alias end delete
|
252
|
+
|
253
|
+
private
|
254
|
+
|
255
|
+
def _set_data(data)
|
256
|
+
@id = Snowflake.new(data[:id])
|
257
|
+
@guild_id = Snowflake.new(data[:guild_id])
|
258
|
+
@channel_id = Snowflake.new(data[:channel_id])
|
259
|
+
@topic = data[:topic]
|
260
|
+
@privacy_level = PRIVACY_LEVEL[data[:privacy_level]]
|
261
|
+
@discoverable_disabled = data[:discoverable_disabled]
|
262
|
+
end
|
263
|
+
|
264
|
+
class << self
|
265
|
+
attr_reader :privacy_level
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
#
|
270
|
+
# Represents a voice region.
|
271
|
+
#
|
272
|
+
class VoiceRegion < DiscordModel
|
273
|
+
# @return [Discorb::Snowflake] The ID of the voice region.
|
274
|
+
attr_reader :id
|
275
|
+
# @return [String] The name of the voice region.
|
276
|
+
attr_reader :name
|
277
|
+
# @return [Boolean] Whether the voice region is VIP.
|
278
|
+
attr_reader :vip
|
279
|
+
alias vip? vip
|
280
|
+
# @return [Boolean] Whether the voice region is optimal.
|
281
|
+
attr_reader :optimal
|
282
|
+
alias optimal? optimal
|
283
|
+
# @return [Boolean] Whether the voice region is deprecated.
|
284
|
+
attr_reader :deprecated
|
285
|
+
alias deprecated? deprecated
|
286
|
+
# @return [Boolean] Whether the voice region is custom.
|
287
|
+
attr_reader :custom
|
288
|
+
alias custom? custom
|
289
|
+
|
290
|
+
#
|
291
|
+
# Initialize a new instance of the VoiceRegion class.
|
292
|
+
# @private
|
293
|
+
#
|
294
|
+
# @param [Hash] data The data of the voice region.
|
295
|
+
#
|
296
|
+
def initialize(data)
|
297
|
+
@id = data[:id]
|
298
|
+
@name = data[:name]
|
299
|
+
@vip = data[:vip]
|
300
|
+
@optimal = data[:optimal]
|
301
|
+
@deprecated = data[:deprecated]
|
302
|
+
@custom = data[:custom]
|
303
|
+
end
|
304
|
+
end
|
305
|
+
end
|