discorb 0.18.0 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build_version.yml +2 -2
  3. data/.rubocop.yml +12 -75
  4. data/Changelog.md +25 -0
  5. data/Gemfile +4 -4
  6. data/README.md +2 -1
  7. data/Rakefile +482 -459
  8. data/Steepfile +8 -6
  9. data/docs/application_command.md +1 -0
  10. data/docs/events.md +2 -2
  11. data/docs/voice_events.md +6 -6
  12. data/lib/discorb/allowed_mentions.rb +68 -72
  13. data/lib/discorb/app_command/command.rb +466 -394
  14. data/lib/discorb/app_command/common.rb +65 -25
  15. data/lib/discorb/app_command/handler.rb +304 -265
  16. data/lib/discorb/app_command.rb +5 -5
  17. data/lib/discorb/application.rb +198 -197
  18. data/lib/discorb/asset.rb +101 -101
  19. data/lib/discorb/attachment.rb +134 -119
  20. data/lib/discorb/audit_logs.rb +412 -385
  21. data/lib/discorb/automod.rb +279 -269
  22. data/lib/discorb/channel/base.rb +107 -108
  23. data/lib/discorb/channel/category.rb +32 -32
  24. data/lib/discorb/channel/container.rb +44 -44
  25. data/lib/discorb/channel/dm.rb +26 -28
  26. data/lib/discorb/channel/guild.rb +311 -246
  27. data/lib/discorb/channel/stage.rb +156 -140
  28. data/lib/discorb/channel/text.rb +430 -336
  29. data/lib/discorb/channel/thread.rb +374 -325
  30. data/lib/discorb/channel/voice.rb +85 -79
  31. data/lib/discorb/channel.rb +5 -5
  32. data/lib/discorb/client.rb +635 -623
  33. data/lib/discorb/color.rb +178 -182
  34. data/lib/discorb/common.rb +168 -164
  35. data/lib/discorb/components/button.rb +107 -106
  36. data/lib/discorb/components/select_menu.rb +157 -145
  37. data/lib/discorb/components/text_input.rb +103 -106
  38. data/lib/discorb/components.rb +68 -66
  39. data/lib/discorb/dictionary.rb +135 -135
  40. data/lib/discorb/embed.rb +404 -398
  41. data/lib/discorb/emoji.rb +309 -302
  42. data/lib/discorb/emoji_table.rb +16099 -8857
  43. data/lib/discorb/error.rb +131 -131
  44. data/lib/discorb/event.rb +360 -314
  45. data/lib/discorb/event_handler.rb +39 -39
  46. data/lib/discorb/exe/about.rb +17 -17
  47. data/lib/discorb/exe/irb.rb +72 -67
  48. data/lib/discorb/exe/new.rb +323 -315
  49. data/lib/discorb/exe/run.rb +69 -68
  50. data/lib/discorb/exe/setup.rb +57 -55
  51. data/lib/discorb/exe/show.rb +12 -12
  52. data/lib/discorb/extend.rb +25 -45
  53. data/lib/discorb/extension.rb +89 -83
  54. data/lib/discorb/flag.rb +126 -128
  55. data/lib/discorb/gateway.rb +984 -794
  56. data/lib/discorb/gateway_events.rb +670 -638
  57. data/lib/discorb/gateway_requests.rb +45 -48
  58. data/lib/discorb/guild.rb +2115 -1626
  59. data/lib/discorb/guild_template.rb +280 -241
  60. data/lib/discorb/http.rb +247 -232
  61. data/lib/discorb/image.rb +42 -42
  62. data/lib/discorb/integration.rb +169 -161
  63. data/lib/discorb/intents.rb +161 -163
  64. data/lib/discorb/interaction/autocomplete.rb +76 -62
  65. data/lib/discorb/interaction/command.rb +279 -224
  66. data/lib/discorb/interaction/components.rb +114 -104
  67. data/lib/discorb/interaction/modal.rb +36 -32
  68. data/lib/discorb/interaction/response.rb +379 -330
  69. data/lib/discorb/interaction/root.rb +271 -118
  70. data/lib/discorb/interaction.rb +5 -5
  71. data/lib/discorb/invite.rb +154 -153
  72. data/lib/discorb/member.rb +344 -311
  73. data/lib/discorb/message.rb +615 -544
  74. data/lib/discorb/message_meta.rb +197 -186
  75. data/lib/discorb/modules.rb +371 -290
  76. data/lib/discorb/permission.rb +305 -289
  77. data/lib/discorb/presence.rb +352 -346
  78. data/lib/discorb/rate_limit.rb +81 -76
  79. data/lib/discorb/reaction.rb +55 -54
  80. data/lib/discorb/role.rb +272 -240
  81. data/lib/discorb/shard.rb +76 -74
  82. data/lib/discorb/sticker.rb +193 -171
  83. data/lib/discorb/user.rb +205 -188
  84. data/lib/discorb/utils/colored_puts.rb +16 -16
  85. data/lib/discorb/utils.rb +12 -16
  86. data/lib/discorb/voice_state.rb +305 -281
  87. data/lib/discorb/webhook.rb +537 -507
  88. data/lib/discorb.rb +62 -56
  89. data/sig/discorb/activity.rbs +1 -0
  90. data/sig/discorb/allowed_mentions.rbs +1 -0
  91. data/sig/discorb/app_command/base.rbs +7 -1
  92. data/sig/discorb/application.rbs +6 -0
  93. data/sig/discorb/asset.rbs +2 -0
  94. data/sig/discorb/attachment.rbs +8 -0
  95. data/sig/discorb/audit_log.rbs +7 -0
  96. data/sig/discorb/automod.rbs +32 -6
  97. data/sig/discorb/avatar.rbs +1 -0
  98. data/sig/discorb/channel/base.rbs +8 -1
  99. data/sig/discorb/channel/category.rbs +1 -0
  100. data/sig/discorb/channel/container.rbs +4 -0
  101. data/sig/discorb/channel/stage.rbs +4 -0
  102. data/sig/discorb/channel/text.rbs +2 -2
  103. data/sig/discorb/channel/thread.rbs +11 -0
  104. data/sig/discorb/channel/voice.rbs +2 -0
  105. data/sig/discorb/client.rbs +21 -20
  106. data/sig/discorb/color.rbs +6 -0
  107. data/sig/discorb/component/base.rbs +1 -0
  108. data/sig/discorb/component/button.rbs +2 -0
  109. data/sig/discorb/component/select_menu.rbs +4 -0
  110. data/sig/discorb/component/text_input.rbs +1 -0
  111. data/sig/discorb/custom_emoji.rbs +5 -1
  112. data/sig/discorb/dictionary.rbs +2 -0
  113. data/sig/discorb/discord_model.rbs +2 -0
  114. data/sig/discorb/embed.rbs +7 -0
  115. data/sig/discorb/emoji.rbs +1 -0
  116. data/sig/discorb/event_handler.rbs +2 -1
  117. data/sig/discorb/extension.rbs +13 -12
  118. data/sig/discorb/flag.rbs +2 -0
  119. data/sig/discorb/gateway.rbs +5 -0
  120. data/sig/discorb/guild.rbs +8 -4
  121. data/sig/discorb/guild_template.rbs +1 -1
  122. data/sig/discorb/http.rbs +4 -1
  123. data/sig/discorb/image.rbs +2 -0
  124. data/sig/discorb/integration.rbs +1 -1
  125. data/sig/discorb/intents.rbs +4 -3
  126. data/sig/discorb/interaction/base.rbs +36 -0
  127. data/sig/discorb/interaction/message_component.rbs +1 -2
  128. data/sig/discorb/interaction/modal.rbs +1 -2
  129. data/sig/discorb/interaction/responder.rbs +49 -49
  130. data/sig/discorb/invite.rbs +1 -1
  131. data/sig/discorb/member.rbs +2 -0
  132. data/sig/discorb/message.rbs +8 -1
  133. data/sig/discorb/messageable.rbs +1 -4
  134. data/sig/discorb/partial_emoji.rbs +3 -0
  135. data/sig/discorb/permissions.rbs +7 -0
  136. data/sig/discorb/presence.rbs +2 -0
  137. data/sig/discorb/reaction.rbs +5 -1
  138. data/sig/discorb/role.rbs +7 -1
  139. data/sig/discorb/scheduled_event.rbs +2 -1
  140. data/sig/discorb/shard.rbs +2 -1
  141. data/sig/discorb/snowflake.rbs +2 -0
  142. data/sig/discorb/stage_instance.rbs +9 -3
  143. data/sig/discorb/sticker.rbs +1 -1
  144. data/sig/discorb/unicode_emoji.rbs +4 -0
  145. data/sig/discorb/user.rbs +24 -20
  146. data/sig/discorb/webhook.rbs +17 -6
  147. data/sig/discorb/welcome_screen.rbs +1 -0
  148. data/sig/override.rbs +2 -0
  149. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 117db5f0857b3da9f0c3a642da5c012b0e6b458aa61c2590b31df28540f04732
4
- data.tar.gz: '08b41acb91e31536970e4a8545f7b29a656ea50fbc813eecde02463acff31cb1'
3
+ metadata.gz: 48edf0ba9d876f44795aebecf4cbb52242e92d5890eed6fa5f4df8ea64dcc5c6
4
+ data.tar.gz: f39d26d224a2970e9e6a8e0282dd260b5a0d01a889e9534c7060512dade36318
5
5
  SHA512:
6
- metadata.gz: 511b7faf125d98e9da7120fe7a3dfae5f224dfcb4891e989cab8183db22ebd0f569685e3e7a7f00040d9ee539d5efaa5fa178f10a0137f79b155026944560a2e
7
- data.tar.gz: 86ced549c50cc26a3a512964614587ff74690b67ed64810355fb307081407b87083151903febfe5f6fb634918365d88e1171af09070b1dbb838c5bcb0a31b9b5
6
+ metadata.gz: 1c8f401b26c4bfdbde8b6e7fd6cc9022cdf9f807b8fc48f62e3cbfa5fe366d6180bdadef07589dd885f22003a6ea1fb2ed9a55357ab8ac5929797767b9d294e1
7
+ data.tar.gz: 122b4b88bdea334e7ae5c3b4aa8f4b3787764c31e17009b590b571c93102f66dadf8db6995b1b2909e8af28ec68928912023ba428a7ee71f5dad292dbdf42d11
@@ -35,9 +35,9 @@ jobs:
35
35
  run: |
36
36
  bundle config --local with 'docs development lint'
37
37
  bundle install
38
- gem update uri
38
+ gem install yard
39
39
  - name: Generate document
40
- run: bundle exec rake document:build_all
40
+ run: rake document:build_all
41
41
  - name: Push document
42
42
  env:
43
43
  SSH_SECRET: ${{ secrets.SSH }}
data/.rubocop.yml CHANGED
@@ -4,101 +4,38 @@ AllCops:
4
4
  Exclude:
5
5
  - lib/discorb/emoji_table.rb
6
6
 
7
+ inherit_gem:
8
+ syntax_tree: config/rubocop.yml
9
+
7
10
  require:
8
11
  - rubocop-rake
9
12
  - rubocop-rspec
10
13
 
11
- # Layout:
12
- # Enabled: false
13
- Metrics:
14
- Enabled: false
15
-
16
- Layout/EndOfLine:
17
- EnforcedStyle: lf
18
-
19
- Layout/IndentationWidth:
20
- AllowedPatterns: ['if']
21
-
22
- Layout/HeredocIndentation:
23
- Enabled: false
24
-
25
- Layout/ClosingHeredocIndentation:
26
- Enabled: false
27
-
28
- Layout/CaseIndentation:
14
+ Naming/VariableNumber:
29
15
  Enabled: false
30
16
 
31
- Layout/ElseAlignment:
17
+ Lint/MissingSuper:
32
18
  Enabled: false
33
19
 
34
- Layout/EndAlignment:
35
- Enabled: false
36
-
37
- Style/TrailingCommaInHashLiteral: # Disabled for rufo
38
- EnforcedStyleForMultiline: consistent_comma
39
-
40
- Style/TrailingCommaInArrayLiteral: # Disabled for rufo
41
- EnforcedStyleForMultiline: consistent_comma
42
-
43
- Style/StringLiterals: # Disabled for rufo
44
- Enabled: true
45
- EnforcedStyle: double_quotes
46
-
47
- Style/TrailingCommaInArguments: # Disabled for rufo
48
- Enabled: false
49
-
50
- Style/StringLiteralsInInterpolation: # Disabled for rufo
51
- Enabled: false
52
-
53
- Layout/SpaceAroundOperators: # Changed for rufo
54
- EnforcedStyleForExponentOperator: space
55
-
56
- Style/StringConcatenation: # + looks better
57
- Enabled: false
58
-
59
- Lint/MissingSuper: # For abstract classes
60
- Enabled: false
61
-
62
- Lint/AssignmentInCondition: # Looks bad
63
- Enabled: false
64
-
65
- Style/PerlBackrefs: # It will be longer
66
- Enabled: false
67
-
68
- Style/RedundantSelf: # Looks local variable
69
- Enabled: false
70
-
71
- Naming/VariableNumber: # Discord API docs naming
72
- Enabled: false
73
-
74
- Style/ParallelAssignment: # It will be longer
75
- Enabled: false
76
-
77
- Style/RedundantInterpolation: # For make it extendable
78
- Enabled: false
79
-
80
- Style/Next: # For make it extendable
81
- Enabled: false
82
-
83
- Lint/ShadowedException: # False positive
20
+ Metrics:
84
21
  Enabled: false
85
22
 
86
- Lint/AmbiguousOperatorPrecedence: # Not needed
23
+ Style/GlobalVars:
87
24
  Enabled: false
88
25
 
89
- Style/GlobalVars: # For /exe
26
+ Style/GuardClause:
90
27
  Enabled: false
91
28
 
92
- Lint/Debugger: # For /exe
29
+ Lint/AssignmentInCondition:
93
30
  Enabled: false
94
31
 
95
- Style/GuardClause: # For make it extendable
32
+ Style/IfUnlessModifier:
96
33
  Enabled: false
97
34
 
98
- Lint/ScriptPermission: # For GitHub Actions
35
+ Style/OptionalBooleanParameter:
99
36
  Enabled: false
100
37
 
101
- Style/NumericLiterals: # For style
38
+ Lint/ScriptPermission:
102
39
  Enabled: false
103
40
 
104
41
  RSpec/FilePath:
data/Changelog.md CHANGED
@@ -4,8 +4,33 @@
4
4
 
5
5
  # Changelog
6
6
 
7
+ ## v0.20
8
+
9
+ ### v0.20.0
10
+
11
+ - Update!: All flags are updated. `User::Flag` has many renames.
12
+ - Change!: Gateway version is always 10 now.
13
+ - Add: Add permissions field.
14
+ - Add: Support resume_gateway_url.
15
+ - Add: Add `AutoModRule#mention_total_limit`, `AutoModRule#allow_list`, and parameters to `Guild#create_automod_rule`.
16
+
17
+ ## v0.19
18
+
19
+ ### v0.19.0
20
+
21
+ - Change!: All bang methods don't have bang anymore. (ex: `Message#delete!`)
22
+ - Add: Add `%a{pure}` annotation to rbs.
23
+ - Add: Add low level APIs to Interaction.
24
+ - Update: Update IDENTIFY key.
25
+
7
26
  ## v0.18
8
27
 
28
+ ### v0.18.1
29
+
30
+ - Add: Support `:length` option for `:string` type.
31
+ - Add: Add `Interaction#app_permissions`
32
+ - Fix: Fix typing of `:autocomplete` option.
33
+
9
34
  ### v0.18.0
10
35
 
11
36
  - Change!: `XXX#fired_by` is now `XXX#user` or `XXX#member`.
data/Gemfile CHANGED
@@ -18,7 +18,7 @@ gem "parallel_tests", "~> 3.8"
18
18
  gem "rspec", "~> 3.11"
19
19
 
20
20
  # Typecheck
21
- gem "steep", "~> 1.0"
21
+ gem "steep", "~> 1.1"
22
22
 
23
23
  # Other development tools
24
24
  gem "lefthook", "~> 0.7.7"
@@ -32,6 +32,6 @@ group :docs, optional: true do
32
32
  gem "rubyzip", "~> 2.3"
33
33
  gem "yard", "~> 0.9.26"
34
34
  end
35
-
36
- gem "syntax_tree", "~> 2.8"
37
- gem "syntax_tree-rbs", "~> 0.4.0"
35
+
36
+ gem "syntax_tree", "~> 2.8"
37
+ gem "syntax_tree-rbs", "~> 0.5.0"
data/README.md CHANGED
@@ -99,7 +99,8 @@ end
99
99
  client.run(ENV["DISCORD_BOT_TOKEN"])
100
100
  ```
101
101
 
102
- Note you must run `discorb setup` before using slash commands.
102
+ > **Note**
103
+ > You must run `discorb setup` before using slash commands.
103
104
 
104
105
  ## Contributing
105
106