-
Notifications
You must be signed in to change notification settings - Fork 0
/
file.application_command.html
437 lines (346 loc) · 56.6 KB
/
file.application_command.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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
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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="/favicon.png" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
File: Application Commands
— discorb v0.20.0 documentation
</title>
<link rel="stylesheet" href="css/style.css" type="text/css" />
<link rel="stylesheet" href="css/common.css" type="text/css" />
<script type="text/javascript">
pathId = "application_command";
relpath = '';
</script>
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
</head>
<body>
<div class="nav_wrap">
<iframe id="nav" src="file_list.html?1"></iframe>
<div id="resizer"></div>
</div>
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="a_index.html">Index</a> »
<span class="title">File: Application Commands</span>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="class_list.html">
<svg width="24" height="24">
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
</svg>
</a>
</div>
<div class="clear"></div>
</div>
<div id="content"><div id='filecontents'>
<h1 id="label-Application+Commands">Application Commands</h1>
<h2 id="label-What+is+an+application+command-3F">What is an application command?</h2>
<blockquote>
<p>Application commands are commands that an application can register to Discord. They provide users a first-class way of interacting directly with your application that feels deeply integrated into Discord.</p>
</blockquote>
<p>From: <a href="https://discord.com/developers/docs/interactions/application-commands#application-commands">Discord API docs</a></p>
<h2 id="label-How+do+I+register+an+application+command-3F">How do I register an application command?</h2>
<p>Write to your script:</p>
<ul><li>
<p><span class='object_link'><a href="Discorb/ApplicationCommand/Handler.html#slash-instance_method" title="Discorb::ApplicationCommand::Handler#slash (method)">Discorb::ApplicationCommand::Handler#slash</a></span>, <span class='object_link'><a href="Discorb/ApplicationCommand/Handler.html#slash_group-instance_method" title="Discorb::ApplicationCommand::Handler#slash_group (method)">Discorb::ApplicationCommand::Handler#slash_group</a></span> for slash commands,</p>
</li><li>
<p><span class='object_link'><a href="Discorb/ApplicationCommand/Handler.html#user_command-instance_method" title="Discorb::ApplicationCommand::Handler#user_command (method)">Discorb::ApplicationCommand::Handler#user_command</a></span> for user menu commands,</p>
</li><li>
<p><span class='object_link'><a href="Discorb/ApplicationCommand/Handler.html#message_command-instance_method" title="Discorb::ApplicationCommand::Handler#message_command (method)">Discorb::ApplicationCommand::Handler#message_command</a></span> for message menu commands.</p>
</li></ul>
<p>And then run <code>discorb setup</code> to register your application commands. <a href="file.setup.html" title="Learn more about <code>discorb setup</code>">Learn more about <code>discorb setup</code></a>.</p>
<h3 id="label-Note">Note</h3>
<p>To register a global command, it will take 1 hour to be registered. Guild commands will be registered immediately.</p>
<h3 id="label-Register+Slash+Commands">Register Slash Commands</h3>
<p>This example registers a slash command that says “Hello, world!” when the user types <code>/hello</code>.</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>discorb</span><span class='tstring_end'>"</span></span>
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Discorb.html" title="Discorb (module)">Discorb</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Discorb/Client.html" title="Discorb::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Discorb/Client.html#initialize-instance_method" title="Discorb::Client#initialize (method)">new</a></span></span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_slash'>slash</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>hello</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Greet for you</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interaction'>interaction</span><span class='op'>|</span>
<span class='id identifier rubyid_interaction'>interaction</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Hello World!</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>ephemeral:</span> <span class='kw'>true</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span><span class='lparen'>(</span><span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>DISCORD_BOT_TOKEN</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
</code></pre>
<p><span class='object_link'><a href="Discorb/ApplicationCommand/Handler.html#slash-instance_method" title="Discorb::ApplicationCommand::Handler#slash (method)">Discorb::ApplicationCommand::Handler#slash</a></span> takes 5 arguments:</p>
<p>| Argument | Description | | ————– | ——————————————————– | | <code>command_name</code> | The name of the command. | | <code>description</code> | The description of the command. | | <code>options</code> | A hash of options. | | <code>guild_ids</code> | The ID of the guild to register the command in. | | <code>block</code> | A block that will be called when the command is invoked. |</p>
<p>Block will be called with a <span class='object_link'><a href="Discorb/Interaction.html" title="Discorb::Interaction (class)">Discorb::Interaction</a></span> object and specified options.</p>
<h4 id="label-Register+options">Register options</h4>
<p>You can set hash to <code>options</code> argument. In <code>options</code>, hash should be like this:</p>
<pre class="code ruby"><code class="ruby"><span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>type:</span> <span class='symbol'>:string</span><span class='comma'>,</span>
<span class='label'>required:</span> <span class='kw'>true</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The description of the command.</span><span class='tstring_end'>"</span></span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span>
</code></pre>
<p>| Key | Type | Description | | ———————— | —————————————- | ————————————————————————————- | | <code>:name_localizations</code> | <code>Hash{Symbol => String}</code> | Localizations of option name. | | <code>:description</code> | <code>String</code> | Description of the option. | | <code>:required</code> | <code>Boolean(true\|false)</code> | Whether the argument is required. <code>optional</code> will be used if not specified. | | <code>:optional</code> | <code>Boolean(true\|false)</code> | Whether the argument is optional. <code>required</code> will be used if not specified. | | <code>:type</code> | <code>Object</code> | Type of the option. | | <code>:choices</code> | <code>Hash{String => String, Integer, Float}</code> | Choice of the option. | | <code>:choices_localizations</code> | <code>Hash{String => Hash{Symbol => String}}</code> | Localization of the choice. Key must be the name of a choice. (See below for example) | | <code>:default</code> | <code>Object</code> | Default value of the option. | | <code>:channel_types</code> | <code>Array<Class<Discorb::Channel>></code> | Type of the channel option. | | <code>:autocomplete</code> | <code>Proc</code> | Autocomplete function. | | <code>:range</code> | <code>Range</code> | Range of the option. Only valid for numeric options. (<code>:int</code>, <code>:float</code>) | | <code>:length</code> | <code>Range</code> | Range of length of the option. Only valid for <code>:string</code>. |</p>
<p><code>choices</code> should be unspecified if you don't want to use it. <code>choices</code> example:</p>
<pre class="code ruby"><code class="ruby"><span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>vocaloid</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>required:</span> <span class='kw'>true</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The vocaloid which you like.</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='label'>type:</span> <span class='symbol'>:string</span><span class='comma'>,</span>
<span class='label'>choices:</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Hatsune Miku</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>miku</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Kagamine Rin</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>rin</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Kagamine Len</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>len</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Megurine Luka</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>luka</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>MEIKO</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>meiko</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>KAITO</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>kaito</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span>
<span class='comment'># Note: This aritcle is written in 8/31.
</span></code></pre>
<p>The key will be displayed in the user menu, and the value will be used as the argument.</p>
<p>In <code>type</code>, You must use one of the following:</p>
<p>| Name | Description | Aliases | | ———- | —————– | ——— | | <code>:string</code> | String argument. | <code>:str</code> | | <code>:integer</code> | Integer argument. | <code>:int</code> | | <code>:float</code> | Float argument. | None | | <code>:boolean</code> | Boolean argument. | <code>:bool</code> | | <code>:user</code> | User argument. | <code>:member</code> | | <code>:channel</code> | Channel argument. | None | | <code>:role</code> | Role argument. | None |</p>
<p>The block will receive the options as arguments.</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_slash'>slash</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>hello</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Bot greets</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>type:</span> <span class='symbol'>:string</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Name</span><span class='tstring_end'>"</span></span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interaction'>interaction</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='op'>|</span>
<span class='id identifier rubyid_interaction'>interaction</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Hello, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>!</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>ephemeral:</span> <span class='kw'>true</span><span class='rparen'>)</span>
<span class='kw'>end</span>
</code></pre>
<h4 id="label-Group+Slash+Commands">Group Slash Commands</h4>
<p>To register a group of slash commands, use <span class='object_link'><a href="Discorb/ApplicationCommand/Handler.html#slash_group-instance_method" title="Discorb::ApplicationCommand::Handler#slash_group (method)">Discorb::ApplicationCommand::Handler#slash_group</a></span>.</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_group'>group</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_slash_group'>slash_group</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Set settings of bot.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_group'>group</span><span class='period'>.</span><span class='id identifier rubyid_slash'>slash</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>message_expand</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Whether bot should expand message.</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>enabled</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>type:</span> <span class='symbol'>:boolean</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Whether bot should expand message.</span><span class='tstring_end'>"</span></span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interaction'>interaction</span><span class='comma'>,</span> <span class='id identifier rubyid_enabled'>enabled</span><span class='op'>|</span>
<span class='comment'># ...
</span><span class='kw'>end</span>
<span class='id identifier rubyid_group'>group</span><span class='period'>.</span><span class='id identifier rubyid_slash'>slash</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>level</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Whether level system is enabled.</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>enabled</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>type:</span> <span class='symbol'>:boolean</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Whether level system is enabled.</span><span class='tstring_end'>"</span></span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interaction'>interaction</span><span class='comma'>,</span> <span class='id identifier rubyid_enabled'>enabled</span><span class='op'>|</span>
<span class='comment'># ...
</span><span class='kw'>end</span>
</code></pre>
<p>Since v0.5.1, You can use block for register commands.</p>
<pre class="code ruby"><code class="ruby">
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_slash_group'>slash_group</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Set settings of bot.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_group'>group</span><span class='op'>|</span>
<span class='id identifier rubyid_group'>group</span><span class='period'>.</span><span class='id identifier rubyid_slash'>slash</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>message_expand</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Whether bot should expand message.</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>enabled</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>type:</span> <span class='symbol'>:boolean</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Whether bot should expand message.</span><span class='tstring_end'>"</span></span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interaction'>interaction</span><span class='comma'>,</span> <span class='id identifier rubyid_enabled'>enabled</span><span class='op'>|</span>
<span class='comment'># ...
</span> <span class='kw'>end</span>
<span class='id identifier rubyid_group'>group</span><span class='period'>.</span><span class='id identifier rubyid_slash'>slash</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>bump_alert</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Whether level system is enabled.</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>enabled</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>type:</span> <span class='symbol'>:boolean</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Whether level system is enabled.</span><span class='tstring_end'>"</span></span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interaction'>interaction</span><span class='comma'>,</span> <span class='id identifier rubyid_enabled'>enabled</span><span class='op'>|</span>
<span class='comment'># ...
</span> <span class='kw'>end</span>
<span class='kw'>end</span>
</code></pre>
<p>You can make subcommand group by using <span class='object_link'><a href="Discorb/ApplicationCommand/Command/GroupCommand.html#group-instance_method" title="Discorb::ApplicationCommand::Command::GroupCommand#group (method)">Discorb::ApplicationCommand::Command::GroupCommand#group</a></span>.</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_group'>group</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_slash_group'>slash_group</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>permission</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Set/Get command permissions.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_group_user'>group_user</span> <span class='op'>=</span> <span class='id identifier rubyid_group'>group</span><span class='period'>.</span><span class='id identifier rubyid_group'>group</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>user</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Set/Get user's command permissions.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_group_user'>group_user</span><span class='period'>.</span><span class='id identifier rubyid_slash'>slash</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>set</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Set user's command permissions.</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>user_id</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>type:</span> <span class='symbol'>:user</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The user.</span><span class='tstring_end'>"</span></span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>value</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>type:</span> <span class='symbol'>:boolean</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Whether the user can use the command.</span><span class='tstring_end'>"</span></span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interaction'>interaction</span><span class='comma'>,</span> <span class='id identifier rubyid_user'>user</span><span class='op'>|</span>
<span class='comment'># ...
</span><span class='kw'>end</span>
<span class='id identifier rubyid_group_user'>group_user</span><span class='period'>.</span><span class='id identifier rubyid_slash'>slash</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>get</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Set user's command permissions.</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>user_id</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>type:</span> <span class='symbol'>:user</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The user.</span><span class='tstring_end'>"</span></span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interaction'>interaction</span><span class='comma'>,</span> <span class='id identifier rubyid_user'>user</span><span class='op'>|</span>
<span class='comment'># ...
</span><span class='kw'>end</span>
<span class='id identifier rubyid_group_user'>group_user</span> <span class='op'>=</span> <span class='id identifier rubyid_group'>group</span><span class='period'>.</span><span class='id identifier rubyid_group'>group</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>user</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Set/Get user's command permissions.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_group_user'>group_user</span><span class='period'>.</span><span class='id identifier rubyid_slash'>slash</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>set</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Set user's command permissions.</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>user_id</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>type:</span> <span class='symbol'>:user</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The user.</span><span class='tstring_end'>"</span></span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>value</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>type:</span> <span class='symbol'>:boolean</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Whether the user can use the command.</span><span class='tstring_end'>"</span></span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interaction'>interaction</span><span class='comma'>,</span> <span class='id identifier rubyid_user'>user</span><span class='op'>|</span>
<span class='comment'># ...
</span><span class='kw'>end</span>
<span class='id identifier rubyid_group_user'>group_user</span><span class='period'>.</span><span class='id identifier rubyid_slash'>slash</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>get</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Set user's command permissions.</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>user_id</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>type:</span> <span class='symbol'>:user</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The user.</span><span class='tstring_end'>"</span></span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interaction'>interaction</span><span class='comma'>,</span> <span class='id identifier rubyid_user'>user</span><span class='op'>|</span>
<span class='comment'># ...
</span><span class='kw'>end</span>
<span class='id identifier rubyid_group_role'>group_role</span> <span class='op'>=</span> <span class='id identifier rubyid_group'>group</span><span class='period'>.</span><span class='id identifier rubyid_group'>group</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>role</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Set/Get role's command permissions.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_group_role'>group_role</span><span class='period'>.</span><span class='id identifier rubyid_slash'>slash</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>set</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Set role's command permissions.</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>role_id</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>type:</span> <span class='symbol'>:role</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The role.</span><span class='tstring_end'>"</span></span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>value</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>type:</span> <span class='symbol'>:boolean</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Whether the role can use the command.</span><span class='tstring_end'>"</span></span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interaction'>interaction</span><span class='comma'>,</span> <span class='id identifier rubyid_role'>role</span><span class='op'>|</span>
<span class='comment'># ...
</span><span class='kw'>end</span>
<span class='id identifier rubyid_group_role'>group_role</span><span class='period'>.</span><span class='id identifier rubyid_slash'>slash</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>get</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Set role's command permissions.</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>role_id</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>type:</span> <span class='symbol'>:role</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The role.</span><span class='tstring_end'>"</span></span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interaction'>interaction</span><span class='comma'>,</span> <span class='id identifier rubyid_role'>role</span><span class='op'>|</span>
<span class='comment'># ...
</span><span class='kw'>end</span>
</code></pre>
<p>Same as above, you can use block for register commands since v0.5.1.</p>
<h4 id="label-Use+Auto+Completing">Use Auto Completing</h4>
<p>Since v0.11.0, you can use auto-completion by setting Proc to <code>:autocomplete</code> in options. The proc will be called with interaction object and the argument. The proc should return a hash of the autocomplete result.</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_slash'>slash</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>hello2</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Greet for you</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>target</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>type:</span> <span class='symbol'>:string</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Person to greet</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='label'>autocomplete:</span> <span class='tlambda'>-></span><span class='lparen'>(</span><span class='id identifier rubyid_interaction'>interaction</span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span> <span class='tlambeg'>{</span>
<span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>You</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_interaction'>interaction</span><span class='period'>.</span><span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interaction'>interaction</span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span><span class='op'>|</span>
<span class='id identifier rubyid_interaction'>interaction</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Hello, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_target'>target</span><span class='embexpr_end'>}</span><span class='tstring_content'>!</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
</code></pre>
<p>In the above example, <code>You</code> will be displayed in the user menu. Due to the limitation of Discord API, the proc must return the result in less than 3 second.</p>
<h3 id="label-Register+User+Context+Menu+Command">Register User Context Menu Command</h3>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_user_command'>user_command</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>hello</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interaction'>interaction</span><span class='comma'>,</span> <span class='id identifier rubyid_user'>user</span><span class='op'>|</span>
<span class='id identifier rubyid_interaction'>interaction</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Hello, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>!</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
</code></pre>
<p><span class='object_link'><a href="Discorb/ApplicationCommand/Handler.html#user_command-instance_method" title="Discorb::ApplicationCommand::Handler#user_command (method)">Discorb::ApplicationCommand::Handler#user_command</a></span> takes 3 arguments:</p>
<p>| Parameter | Description | | ————– | ——————————————————– | | <code>command_name</code> | The name of the command. | | <code>guild_ids</code> | The ID of the guild to register the command in. | | <code>block</code> | A block that will be called when the command is invoked. |</p>
<p><code>block</code> will be called with two arguments:</p>
<p>| Parameter | Description | | ————- | ———————– | | <code>interaction</code> | The interaction object. | | <code>user</code> | The user object. |</p>
<h3 id="label-Register+Message+Context+Menu+Command">Register Message Context Menu Command</h3>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_message_command'>message_command</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Bookmark</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interaction'>interaction</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='op'>|</span>
<span class='comment'># ...
</span><span class='kw'>end</span>
</code></pre>
<p><span class='object_link'><a href="Discorb/ApplicationCommand/Handler.html#message_command-instance_method" title="Discorb::ApplicationCommand::Handler#message_command (method)">Discorb::ApplicationCommand::Handler#message_command</a></span> takes 3 arguments:</p>
<p>| Parameter | Description | | ————– | ——————————————————– | | <code>command_name</code> | The name of the command. | | <code>guild_ids</code> | The ID of the guild to register the command in. | | <code>block</code> | A block that will be called when the command is invoked. |</p>
<p><code>block</code> will be called with two arguments:</p>
<p>| Parameter | Description | | ————- | ———————– | | <code>interaction</code> | The interaction object. | | <code>message</code> | The message object. |</p>
<h3 id="label-Localizing+command">Localizing command</h3>
<p>You can localize commands with passing parameters, or setting Hash to name. Also, you can change the text by checking <code>interaction.locale</code> and <code>interaction.guild_locale</code>.</p>
<p>Command name localize example:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_localizations'>localizations</span> <span class='op'>=</span> <span class='lbrace'>{</span>
<span class='label'>localized:</span> <span class='lbrace'>{</span>
<span class='label'>text:</span> <span class='lbrace'>{</span>
<span class='label'>en:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Hello, %s!</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='label'>ja:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%sさん、こんにちは!</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='rbrace'>}</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_slash'>slash</span><span class='lparen'>(</span><span class='lbrace'>{</span>
<span class='label'>default:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>greet</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='label'>ja:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>挨拶</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>default:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Bot greets. Cute OwO</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='label'>ja:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Botが挨拶します。かわいいね</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>name_localizations:</span> <span class='lbrace'>{</span>
<span class='label'>ja:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>名前</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='lbrace'>{</span>
<span class='label'>default:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The name to greet.</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='label'>ja:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>挨拶する人の名前。</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='label'>type:</span> <span class='symbol'>:string</span><span class='comma'>,</span>
<span class='label'>optional:</span> <span class='kw'>true</span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interaction'>interaction</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='op'>|</span>
<span class='id identifier rubyid_interaction'>interaction</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span>
<span class='lparen'>(</span><span class='id identifier rubyid_localizations'>localizations</span><span class='lbracket'>[</span><span class='symbol'>:localized</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:text</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_interaction'>interaction</span><span class='period'>.</span><span class='id identifier rubyid_locale'>locale</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_localizations'>localizations</span><span class='lbracket'>[</span><span class='symbol'>:localized</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:text</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:en</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'>%</span> <span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span> <span class='op'>||</span> <span class='id identifier rubyid_interaction'>interaction</span><span class='period'>.</span><span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_to_s_user'>to_s_user</span><span class='rbracket'>]</span><span class='comma'>,</span>
<span class='label'>ephemeral:</span> <span class='kw'>true</span><span class='comma'>,</span>
<span class='rparen'>)</span>
<span class='kw'>end</span>
</code></pre>
<p>Option localize example:</p>
<pre class="code ruby"><code class="ruby"><span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>vocaloid</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>name_localizations:</span> <span class='lbrace'>{</span>
<span class='label'>ja:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ボカロ</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='label'>required:</span> <span class='kw'>true</span><span class='comma'>,</span>
<span class='label'>description:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The vocaloid which you like.</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='label'>description_localizations:</span> <span class='lbrace'>{</span>
<span class='label'>ja:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>好きなボカロ。</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='label'>type:</span> <span class='symbol'>:string</span><span class='comma'>,</span>
<span class='label'>choices:</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Hatsune Miku</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>miku</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Kagamine Rin</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>rin</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Kagamine Len</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>len</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Megurine Luka</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>luka</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>MEIKO</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>meiko</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>KAITO</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>kaito</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='label'>choice_localizations:</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Hatsune Miku</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>ja:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>初音ミク</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Kagamine Rin</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>ja:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>鏡音リン</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Kagamine Len</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>ja:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>鏡音レン</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Megurine Luka</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>ja:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>巡音ルカ</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>MEIKO</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>ja:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>MEIKO</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>KAITO</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
<span class='label'>ja:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>KAITO</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span>
</code></pre>
</div></div>
<div id="footer">
Generated on Sat Sep 3 22:19:56 2022 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.28 (ruby-3.0.2).
</div>
</div>
</body>
</html>