discorb 0.16.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +1 -0
  3. data/.github/workflows/build_main.yml +2 -2
  4. data/.github/workflows/build_version.yml +1 -1
  5. data/.github/workflows/codeql-analysis.yml +1 -1
  6. data/.github/workflows/lint-push.yml +3 -5
  7. data/.github/workflows/lint.yml +2 -4
  8. data/.github/workflows/spec.yml +33 -0
  9. data/.github/workflows/validate.yml +21 -0
  10. data/.gitignore +2 -0
  11. data/.lefthook/commit-msg/validator.rb +5 -0
  12. data/.rspec +2 -0
  13. data/.rspec_parallel +2 -0
  14. data/.rubocop.yml +43 -6
  15. data/Changelog.md +30 -1
  16. data/Gemfile +20 -8
  17. data/Rakefile +226 -98
  18. data/Steepfile +28 -0
  19. data/bin/console +3 -3
  20. data/docs/Examples.md +1 -1
  21. data/docs/application_command.md +156 -47
  22. data/docs/cli/irb.md +2 -2
  23. data/docs/cli/new.md +14 -9
  24. data/docs/cli/run.md +7 -11
  25. data/docs/cli.md +17 -10
  26. data/docs/events.md +247 -213
  27. data/docs/extension.md +1 -2
  28. data/docs/faq.md +0 -1
  29. data/docs/tutorial.md +18 -18
  30. data/docs/voice_events.md +106 -106
  31. data/examples/commands/message.rb +68 -0
  32. data/examples/commands/permission.rb +19 -0
  33. data/examples/commands/slash.rb +48 -0
  34. data/examples/commands/user.rb +54 -0
  35. data/examples/components/authorization_button.rb +4 -3
  36. data/examples/components/select_menu.rb +6 -3
  37. data/examples/extension/main.rb +2 -1
  38. data/examples/extension/message_expander.rb +6 -2
  39. data/examples/sig/commands/message.rbs +5 -0
  40. data/examples/simple/eval.rb +3 -2
  41. data/examples/simple/ping_pong.rb +2 -1
  42. data/examples/simple/rolepanel.rb +17 -6
  43. data/examples/simple/shard.rb +3 -2
  44. data/examples/simple/wait_for_message.rb +4 -1
  45. data/exe/discorb +33 -18
  46. data/lefthook.yml +45 -0
  47. data/lib/discorb/allowed_mentions.rb +2 -1
  48. data/lib/discorb/app_command/command.rb +130 -72
  49. data/lib/discorb/app_command/common.rb +25 -0
  50. data/lib/discorb/app_command/handler.rb +130 -33
  51. data/lib/discorb/app_command.rb +2 -1
  52. data/lib/discorb/application.rb +1 -0
  53. data/lib/discorb/asset.rb +1 -2
  54. data/lib/discorb/attachment.rb +1 -1
  55. data/lib/discorb/audit_logs.rb +19 -10
  56. data/lib/discorb/automod.rb +269 -0
  57. data/lib/discorb/channel/base.rb +108 -0
  58. data/lib/discorb/channel/category.rb +32 -0
  59. data/lib/discorb/channel/container.rb +44 -0
  60. data/lib/discorb/channel/dm.rb +28 -0
  61. data/lib/discorb/channel/guild.rb +246 -0
  62. data/lib/discorb/channel/stage.rb +140 -0
  63. data/lib/discorb/channel/text.rb +336 -0
  64. data/lib/discorb/channel/thread.rb +325 -0
  65. data/lib/discorb/channel/voice.rb +79 -0
  66. data/lib/discorb/channel.rb +2 -1165
  67. data/lib/discorb/client.rb +50 -36
  68. data/lib/discorb/color.rb +37 -60
  69. data/lib/discorb/common.rb +2 -1
  70. data/lib/discorb/components/button.rb +2 -1
  71. data/lib/discorb/components/select_menu.rb +4 -2
  72. data/lib/discorb/components/text_input.rb +12 -2
  73. data/lib/discorb/components.rb +1 -1
  74. data/lib/discorb/dictionary.rb +1 -1
  75. data/lib/discorb/embed.rb +26 -10
  76. data/lib/discorb/emoji.rb +31 -4
  77. data/lib/discorb/emoji_table.rb +4969 -3
  78. data/lib/discorb/event.rb +29 -4
  79. data/lib/discorb/exe/about.rb +2 -1
  80. data/lib/discorb/exe/irb.rb +2 -4
  81. data/lib/discorb/exe/new.rb +89 -26
  82. data/lib/discorb/exe/run.rb +8 -22
  83. data/lib/discorb/exe/setup.rb +25 -12
  84. data/lib/discorb/exe/show.rb +4 -3
  85. data/lib/discorb/extend.rb +1 -0
  86. data/lib/discorb/extension.rb +6 -7
  87. data/lib/discorb/flag.rb +13 -2
  88. data/lib/discorb/gateway.rb +79 -589
  89. data/lib/discorb/gateway_events.rb +638 -0
  90. data/lib/discorb/guild.rb +318 -67
  91. data/lib/discorb/guild_template.rb +11 -5
  92. data/lib/discorb/http.rb +53 -24
  93. data/lib/discorb/integration.rb +4 -1
  94. data/lib/discorb/intents.rb +28 -19
  95. data/lib/discorb/interaction/autocomplete.rb +28 -16
  96. data/lib/discorb/interaction/command.rb +42 -14
  97. data/lib/discorb/interaction/components.rb +5 -2
  98. data/lib/discorb/interaction/modal.rb +0 -1
  99. data/lib/discorb/interaction/response.rb +125 -26
  100. data/lib/discorb/interaction/root.rb +13 -13
  101. data/lib/discorb/interaction.rb +1 -0
  102. data/lib/discorb/invite.rb +5 -2
  103. data/lib/discorb/member.rb +28 -8
  104. data/lib/discorb/message.rb +60 -25
  105. data/lib/discorb/message_meta.rb +3 -3
  106. data/lib/discorb/modules.rb +59 -16
  107. data/lib/discorb/presence.rb +2 -0
  108. data/lib/discorb/rate_limit.rb +7 -2
  109. data/lib/discorb/reaction.rb +2 -2
  110. data/lib/discorb/role.rb +20 -5
  111. data/lib/discorb/shard.rb +1 -1
  112. data/lib/discorb/sticker.rb +9 -8
  113. data/lib/discorb/user.rb +4 -3
  114. data/lib/discorb/utils/colored_puts.rb +1 -0
  115. data/lib/discorb/voice_state.rb +6 -2
  116. data/lib/discorb/webhook.rb +64 -31
  117. data/lib/discorb.rb +7 -5
  118. data/po/yard.pot +20 -20
  119. data/rbs_collection.lock.yaml +88 -0
  120. data/rbs_collection.yaml +21 -0
  121. data/sig/async.rbs +11 -0
  122. data/sig/discorb/activity.rbs +23 -0
  123. data/sig/discorb/allowed_mentions.rbs +44 -0
  124. data/sig/discorb/app_command/base.rbs +282 -0
  125. data/sig/discorb/app_command/handler.rbs +171 -0
  126. data/sig/discorb/application.rbs +142 -0
  127. data/sig/discorb/asset.rbs +32 -0
  128. data/sig/discorb/attachment.rbs +91 -0
  129. data/sig/discorb/audit_log.rbs +231 -0
  130. data/sig/discorb/automod.rbs +128 -0
  131. data/sig/discorb/avatar.rbs +26 -0
  132. data/sig/discorb/channel/base.rbs +179 -0
  133. data/sig/discorb/channel/category.rbs +56 -0
  134. data/sig/discorb/channel/container.rbs +29 -0
  135. data/sig/discorb/channel/dm.rbs +14 -0
  136. data/sig/discorb/channel/news.rbs +20 -0
  137. data/sig/discorb/channel/stage.rbs +77 -0
  138. data/sig/discorb/channel/text.rbs +158 -0
  139. data/sig/discorb/channel/thread.rbs +185 -0
  140. data/sig/discorb/channel/voice.rbs +41 -0
  141. data/sig/discorb/client.rbs +2495 -0
  142. data/sig/discorb/color.rbs +142 -0
  143. data/sig/discorb/component/base.rbs +28 -0
  144. data/sig/discorb/component/button.rbs +65 -0
  145. data/sig/discorb/component/select_menu.rbs +107 -0
  146. data/sig/discorb/component/text_input.rbs +69 -0
  147. data/sig/discorb/connectable.rbs +8 -0
  148. data/sig/discorb/custom_emoji.rbs +90 -0
  149. data/sig/discorb/dictionary.rbs +85 -0
  150. data/sig/discorb/discord_model.rbs +15 -0
  151. data/sig/discorb/embed.rbs +279 -0
  152. data/sig/discorb/emoji.rbs +13 -0
  153. data/sig/discorb/error.rbs +73 -0
  154. data/sig/discorb/event_handler.rbs +27 -0
  155. data/sig/discorb/extension.rbs +1734 -0
  156. data/sig/discorb/flag.rbs +72 -0
  157. data/sig/discorb/gateway.rbs +481 -0
  158. data/sig/discorb/guild.rbs +870 -0
  159. data/sig/discorb/guild_template.rbs +174 -0
  160. data/sig/discorb/http.rbs +147 -0
  161. data/sig/discorb/image.rbs +20 -0
  162. data/sig/discorb/integration.rbs +118 -0
  163. data/sig/discorb/intents.rbs +97 -0
  164. data/sig/discorb/interaction/autocomplete.rbs +9 -0
  165. data/sig/discorb/interaction/base.rbs +66 -0
  166. data/sig/discorb/interaction/command.rbs +66 -0
  167. data/sig/discorb/interaction/message_component.rbs +140 -0
  168. data/sig/discorb/interaction/modal.rbs +50 -0
  169. data/sig/discorb/interaction/responder.rbs +157 -0
  170. data/sig/discorb/invite.rbs +86 -0
  171. data/sig/discorb/member.rbs +187 -0
  172. data/sig/discorb/message.rbs +469 -0
  173. data/sig/discorb/messageable.rbs +153 -0
  174. data/sig/discorb/partial_emoji.rbs +35 -0
  175. data/sig/discorb/permissions.rbs +149 -0
  176. data/sig/discorb/presence.rbs +237 -0
  177. data/sig/discorb/reaction.rbs +33 -0
  178. data/sig/discorb/role.rbs +145 -0
  179. data/sig/discorb/scheduled_event.rbs +148 -0
  180. data/sig/discorb/shard.rbs +62 -0
  181. data/sig/discorb/snowflake.rbs +56 -0
  182. data/sig/discorb/stage_instance.rbs +63 -0
  183. data/sig/discorb/sticker.rbs +116 -0
  184. data/sig/discorb/system_channel_flag.rbs +17 -0
  185. data/sig/discorb/unicode_emoji.rbs +49 -0
  186. data/sig/discorb/user.rbs +93 -0
  187. data/sig/discorb/utils.rbs +8 -0
  188. data/sig/discorb/voice_region.rbs +30 -0
  189. data/sig/discorb/voice_state.rbs +71 -0
  190. data/sig/discorb/webhook.rbs +327 -0
  191. data/sig/discorb/welcome_screen.rbs +78 -0
  192. data/sig/discorb.rbs +6 -7230
  193. data/sig/manifest.yaml +3 -0
  194. data/sig/override.rbs +19 -0
  195. data/template-replace/files/css/common.css +4 -0
  196. metadata +102 -6
  197. data/examples/commands/bookmarker.rb +0 -42
  198. data/examples/commands/hello.rb +0 -10
  199. data/examples/commands/inspect.rb +0 -25
@@ -13,12 +13,13 @@ From: [Discord API docs](https://discord.com/developers/docs/interactions/applic
13
13
  ## How do I register an application command?
14
14
 
15
15
  Write to your script:
16
+
16
17
  - {Discorb::ApplicationCommand::Handler.slash}, {Discorb::ApplicationCommand::Handler.slash_group} for slash commands,
17
18
  - {Discorb::ApplicationCommand::Handler.user_command} for user menu commands,
18
19
  - {Discorb::ApplicationCommand::Handler.message_command} for message menu commands.
19
20
 
20
21
  And then run `discorb setup` to register your application commands.
21
- {file:docs/cli/setup.md Learn more about `discorb setup`}.
22
+ {file:docs/cli/setup.md Learn more about `discorb setup`}.
22
23
 
23
24
  ### Note
24
25
 
@@ -43,41 +44,47 @@ client.run(ENV["DISCORD_BOT_TOKEN"])
43
44
 
44
45
  {Discorb::ApplicationCommand::Handler#slash} takes 5 arguments:
45
46
 
46
- | Argument | Description |
47
- |---------|-------------|
48
- | `command_name` | The name of the command. |
49
- | `description` | The description of the command. |
50
- | `options` | A hash of options. |
51
- | `guild_ids` | The ID of the guild to register the command in. |
52
- | `block` | A block that will be called when the command is invoked. |
47
+ | Argument | Description |
48
+ | -------------- | -------------------------------------------------------- |
49
+ | `command_name` | The name of the command. |
50
+ | `description` | The description of the command. |
51
+ | `options` | A hash of options. |
52
+ | `guild_ids` | The ID of the guild to register the command in. |
53
+ | `block` | A block that will be called when the command is invoked. |
53
54
 
54
55
  Block will be called with a {Discorb::Interaction} object and specified options.
55
56
 
57
+ #### Register options
58
+
59
+ You can set hash to `options` argument.
56
60
  In `options`, hash should be like this:
57
61
 
58
62
  ```ruby
59
63
  {
60
- "Name" => {
64
+ "name" => {
61
65
  type: :string,
62
66
  required: true,
63
67
  description: "The description of the command."
64
68
  }
65
69
  }
66
70
  ```
67
- | Key | Type | Description |
68
- | --- | --- | --- |
69
- | `:description` | `String` | Description of the option. |
70
- | `:required` | Whether the argument is required. `optional` will be used if not specified. |
71
- | `:optional` | Whether the argument is optional. `required` will be used if not specified. |
72
- | `:type` | `Object` | Type of the option. |
73
- | `:choice` | `Hash{String => String, Integer, Float}` | Choice of the option. |
74
- | `:default` | `Object` | Default value of the option. |
75
- | `:channel_types` | `Array<Class<Discorb::Channel>>` | Type of the channel option. |
76
- | `:autocomplete` | `Proc` | Autocomplete function. |
77
- | `:range` | `Range` | Range of the option. Only valid for numeric options. (`:int`, `:float`) |
71
+
72
+ | Key | Type | Description |
73
+ | ------------------------ | ---------------------------------------- | ------------------------------------------------------------------------------------- |
74
+ | `:name_localizations` | `Hash{Symbol => String}` | Localizations of option name. |
75
+ | `:description` | `String` | Description of the option. |
76
+ | `:required` | `Boolean(true\|false)` | Whether the argument is required. `optional` will be used if not specified. |
77
+ | `:optional` | `Boolean(true\|false)` | Whether the argument is optional. `required` will be used if not specified. |
78
+ | `:type` | `Object` | Type of the option. |
79
+ | `:choices` | `Hash{String => String, Integer, Float}` | Choice of the option. |
80
+ | `:choices_localizations` | `Hash{String => Hash{Symbol => String}}` | Localization of the choice. Key must be the name of a choice. (See below for example) |
81
+ | `:default` | `Object` | Default value of the option. |
82
+ | `:channel_types` | `Array<Class<Discorb::Channel>>` | Type of the channel option. |
83
+ | `:autocomplete` | `Proc` | Autocomplete function. |
84
+ | `:range` | `Range` | Range of the option. Only valid for numeric options. (`:int`, `:float`) |
78
85
 
79
86
  `choices` should be unspecified if you don't want to use it.
80
- `choices` is hash like this:
87
+ `choices` example:
81
88
 
82
89
  ```ruby
83
90
  {
@@ -103,15 +110,28 @@ The key will be displayed in the user menu, and the value will be used as the ar
103
110
 
104
111
  In `type`, You must use one of the following:
105
112
 
106
- | Name | Description | Aliases|
107
- | --- | --- | --- |
108
- | `:string` | String argument. | `:str` |
109
- | `:integer` | Integer argument. | `:int` |
110
- | `:float` | Float argument. | None |
111
- | `:boolean` | Boolean argument. | `:bool` |
112
- | `:user` | User argument. | `:member` |
113
- | `:channel` | Channel argument. | None |
114
- | `:role` | Role argument. | None |
113
+ | Name | Description | Aliases |
114
+ | ---------- | ----------------- | --------- |
115
+ | `:string` | String argument. | `:str` |
116
+ | `:integer` | Integer argument. | `:int` |
117
+ | `:float` | Float argument. | None |
118
+ | `:boolean` | Boolean argument. | `:bool` |
119
+ | `:user` | User argument. | `:member` |
120
+ | `:channel` | Channel argument. | None |
121
+ | `:role` | Role argument. | None |
122
+
123
+ The block will receive the options as arguments.
124
+
125
+ ```ruby
126
+ client.slash("hello", "Bot greets", {
127
+ "name" => {
128
+ type: :string,
129
+ description: "Name"
130
+ }
131
+ }) do |interaction, name|
132
+ interaction.post("Hello, #{name}!", ephemeral: true)
133
+ end
134
+ ```
115
135
 
116
136
  #### Group Slash Commands
117
137
 
@@ -277,21 +297,21 @@ client.user_command("hello") do |interaction, user|
277
297
  interaction.post("Hello, #{user.name}!")
278
298
  end
279
299
  ```
300
+
280
301
  {Discorb::ApplicationCommand::Handler.user_command} takes 3 arguments:
281
302
 
282
- | Parameter | Description |
283
- | --- | --- |
284
- | `command_name` | The name of the command. |
285
- | `guild_ids` | The ID of the guild to register the command in. |
286
- | `block` | A block that will be called when the command is invoked. |
303
+ | Parameter | Description |
304
+ | -------------- | -------------------------------------------------------- |
305
+ | `command_name` | The name of the command. |
306
+ | `guild_ids` | The ID of the guild to register the command in. |
307
+ | `block` | A block that will be called when the command is invoked. |
287
308
 
288
309
  `block` will be called with two arguments:
289
310
 
290
- | Parameter | Description |
291
- | --- | --- |
311
+ | Parameter | Description |
312
+ | ------------- | ----------------------- |
292
313
  | `interaction` | The interaction object. |
293
- | `user` | The user object. |
294
-
314
+ | `user` | The user object. |
295
315
 
296
316
  ### Register Message Context Menu Command
297
317
 
@@ -303,15 +323,104 @@ end
303
323
 
304
324
  {Discorb::ApplicationCommand::Handler.message_command} takes 3 arguments:
305
325
 
306
- | Parameter | Description |
307
- | --- | --- |
308
- | `command_name` | The name of the command. |
309
- | `guild_ids` | The ID of the guild to register the command in. |
310
- | `block` | A block that will be called when the command is invoked. |
326
+ | Parameter | Description |
327
+ | -------------- | -------------------------------------------------------- |
328
+ | `command_name` | The name of the command. |
329
+ | `guild_ids` | The ID of the guild to register the command in. |
330
+ | `block` | A block that will be called when the command is invoked. |
311
331
 
312
332
  `block` will be called with two arguments:
313
333
 
314
- | Parameter | Description |
315
- | --- | --- |
334
+ | Parameter | Description |
335
+ | ------------- | ----------------------- |
316
336
  | `interaction` | The interaction object. |
317
- | `message` | The message object. |
337
+ | `message` | The message object. |
338
+
339
+ ### Localizing command
340
+
341
+ You can localize commands with passing parameters, or setting Hash to name.
342
+ Also, you can change the text by checking `interaction.locale` and `interaction.guild_locale`.
343
+
344
+ Command name localize example:
345
+
346
+ ```ruby
347
+ localizations = {
348
+ localized: {
349
+ text: {
350
+ en: "Hello, %s!",
351
+ ja: "%sさん、こんにちは!",
352
+ },
353
+ },
354
+ }
355
+
356
+ client.slash({
357
+ default: "greet",
358
+ ja: "挨拶",
359
+ }, {
360
+ default: "Bot greets. Cute OwO",
361
+ ja: "Botが挨拶します。かわいいね",
362
+ }, {
363
+ "name" => {
364
+ name_localizations: {
365
+ ja: "名前",
366
+ },
367
+ description: {
368
+ default: "The name to greet.",
369
+ ja: "挨拶する人の名前。",
370
+ },
371
+ type: :string,
372
+ optional: true,
373
+ },
374
+ }) do |interaction, name|
375
+ interaction.post(
376
+ (localizations[:localized][:text][interaction.locale] || localizations[:localized][:text][:en]) % [name || interaction.target.to_s_user],
377
+ ephemeral: true,
378
+ )
379
+ end
380
+ ```
381
+
382
+ Option localize example:
383
+
384
+ ```ruby
385
+ {
386
+ "vocaloid" => {
387
+ name_localizations: {
388
+ ja: "ボカロ",
389
+ },
390
+ required: true,
391
+ description: "The vocaloid which you like.",
392
+ description_localizations: {
393
+ ja: "好きなボカロ。",
394
+ },
395
+ type: :string,
396
+ choices: {
397
+ "Hatsune Miku" => "miku",
398
+ "Kagamine Rin" => "rin",
399
+ "Kagamine Len" => "len",
400
+ "Megurine Luka" => "luka",
401
+ "MEIKO" => "meiko",
402
+ "KAITO" => "kaito",
403
+ },
404
+ choice_localizations: {
405
+ "Hatsune Miku" => {
406
+ ja: "初音ミク",
407
+ },
408
+ "Kagamine Rin" => {
409
+ ja: "鏡音リン",
410
+ },
411
+ "Kagamine Len" => {
412
+ ja: "鏡音レン",
413
+ },
414
+ "Megurine Luka" => {
415
+ ja: "巡音ルカ",
416
+ },
417
+ "MEIKO" => {
418
+ ja: "MEIKO",
419
+ },
420
+ "KAITO" => {
421
+ ja: "KAITO",
422
+ },
423
+ }
424
+ }
425
+ }
426
+ ```
data/docs/cli/irb.md CHANGED
@@ -6,7 +6,6 @@
6
6
 
7
7
  This command will start an interactive Ruby shell with connected client.
8
8
 
9
-
10
9
  ## Usage
11
10
 
12
11
  ```
@@ -16,6 +15,7 @@ discorb irb [options]
16
15
  ### Load a token
17
16
 
18
17
  discorb irb will load a token from...
18
+
19
19
  1. the `DISCORD_BOT_TOKEN` environment variable
20
20
  2. the `DISCORD_TOKEN` environment variable
21
21
  3. `token` file in the current directory(customizable with `-t` option)
@@ -36,4 +36,4 @@ Token file to load.
36
36
 
37
37
  #### `message`
38
38
 
39
- Last message received.
39
+ Last message received.
data/docs/cli/new.md CHANGED
@@ -56,16 +56,21 @@ Default to TOKEN.
56
56
  Whether to overwrite an existing directory.
57
57
  Default to false.
58
58
 
59
+ ### `--[no-]comment`
60
+
61
+ Whether to write comment in main.rb.
62
+ Default to true.
63
+
59
64
  ## File structure
60
65
 
61
66
  The following files will be created:
62
67
 
63
- | File | Description |
64
- | ---- | ----------- |
65
- | `.env` | Environment variables. |
66
- | `main.rb` | Main script. |
67
- | `.gitignore` | Git ignore file. Won't be created if `--git` is false. |
68
- | `Gemfile` | Gemfile. Won't be created if `--bundle` is false. |
69
- | `Gemfile.lock` | Gemfile lock file. Won't be created if `--bundle` is false. |
70
- | `README.md` | Readme file. Won't be created if `--desc` is false. |
71
- | `.env.sample` | Sample environment variables. Won't be created if `--desc` is false. |
68
+ | File | Description |
69
+ | -------------- | -------------------------------------------------------------------- |
70
+ | `.env` | Environment variables. |
71
+ | `main.rb` | Main script. |
72
+ | `.gitignore` | Git ignore file. Won't be created if `--git` is false. |
73
+ | `Gemfile` | Gemfile. Won't be created if `--bundle` is false. |
74
+ | `Gemfile.lock` | Gemfile lock file. Won't be created if `--bundle` is false. |
75
+ | `README.md` | Readme file. Won't be created if `--desc` is false. |
76
+ | `.env.sample` | Sample environment variables. Won't be created if `--desc` is false. |
data/docs/cli/run.md CHANGED
@@ -6,7 +6,6 @@
6
6
 
7
7
  This command will run a client.
8
8
 
9
-
10
9
  ## Usage
11
10
 
12
11
  ```
@@ -31,12 +30,12 @@ The title of the process.
31
30
  Specify the log level.
32
31
  Should be one of the following:
33
32
 
34
- * `none`
35
- * `debug`
36
- * `info`
37
- * `warn`
38
- * `error`
39
- * `fatal`
33
+ - `none`
34
+ - `debug`
35
+ - `info`
36
+ - `warn`
37
+ - `error`
38
+ - `fatal`
40
39
 
41
40
  #### `-f`, `--log-file`
42
41
 
@@ -47,6 +46,7 @@ You can use `stdout` to write to the standard output, and `stderr` to write to t
47
46
 
48
47
  Whether to colorize the log output.
49
48
  If not specified, the default will be:
49
+
50
50
  - `true` if the file to write logs to is `stdout` or `stderr`.
51
51
  - `false` otherwise.
52
52
 
@@ -57,7 +57,3 @@ Whether to set up application commands.
57
57
  #### `-e`, `--env`
58
58
 
59
59
  The name of the environment variable to use for token, or just `-t` or `--token` for intractive prompt.
60
-
61
- #### `-b`, `--bundler`
62
-
63
- Whether to use bundler to load the script.
data/docs/cli.md CHANGED
@@ -9,20 +9,27 @@ discorb has a CLI tool for developing.
9
9
  ## Usage
10
10
 
11
11
  ```bash
12
- bundle exec discorb <command> ...
12
+ Usage: discorb [options] [subcommand [options]]
13
13
  ```
14
14
 
15
+ ## Options
16
+
17
+ ### `-b`, `--[no-]bundler`
18
+
19
+ Whether to use bundler.
20
+ Default to true.
21
+
15
22
  ## Commands
16
23
 
17
24
  Currently, discorb has the following commands:
18
25
 
19
- | Command | Description |
20
- |---------|-------------|
21
- | {file:docs/cli/new.md `new`} | Create a new project. |
22
- | {file:docs/cli/irb.md `irb`} | Start an interactive Ruby shell with connected client. |
23
- | {file:docs/cli/run.md `run`} | Run a client. |
24
- | {file:docs/cli/setup.md `setup`} | Setup application commands. |
25
- | `show` | Show your environment. (No document) |
26
- | `about` | Show discorb's information. (No document) |
26
+ | Command | Description |
27
+ | -------------------------------- | ------------------------------------------------------ |
28
+ | {file:docs/cli/new.md `new`} | Create a new project. |
29
+ | {file:docs/cli/irb.md `irb`} | Start an interactive Ruby shell with connected client. |
30
+ | {file:docs/cli/run.md `run`} | Run a client. |
31
+ | {file:docs/cli/setup.md `setup`} | Setup application commands. |
32
+ | `show` | Show your environment. (No document) |
33
+ | `about` | Show discorb's information. (No document) |
27
34
 
28
- Click the command name to see the document.
35
+ Click the command name to see the document.