discorb 0.16.0 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitattributes +1 -0
- data/.github/workflows/build_main.yml +2 -2
- data/.github/workflows/build_version.yml +1 -1
- data/.github/workflows/codeql-analysis.yml +1 -1
- data/.github/workflows/lint-push.yml +3 -5
- data/.github/workflows/lint.yml +2 -4
- data/.github/workflows/spec.yml +33 -0
- data/.github/workflows/validate.yml +21 -0
- data/.gitignore +2 -0
- data/.lefthook/commit-msg/validator.rb +5 -0
- data/.rspec +2 -0
- data/.rspec_parallel +2 -0
- data/.rubocop.yml +43 -6
- data/Changelog.md +30 -1
- data/Gemfile +20 -8
- data/Rakefile +226 -98
- data/Steepfile +28 -0
- data/bin/console +3 -3
- data/docs/Examples.md +1 -1
- data/docs/application_command.md +156 -47
- data/docs/cli/irb.md +2 -2
- data/docs/cli/new.md +14 -9
- data/docs/cli/run.md +7 -11
- data/docs/cli.md +17 -10
- data/docs/events.md +247 -213
- data/docs/extension.md +1 -2
- data/docs/faq.md +0 -1
- data/docs/tutorial.md +18 -18
- data/docs/voice_events.md +106 -106
- data/examples/commands/message.rb +68 -0
- data/examples/commands/permission.rb +19 -0
- data/examples/commands/slash.rb +48 -0
- data/examples/commands/user.rb +54 -0
- data/examples/components/authorization_button.rb +4 -3
- data/examples/components/select_menu.rb +6 -3
- data/examples/extension/main.rb +2 -1
- data/examples/extension/message_expander.rb +6 -2
- data/examples/sig/commands/message.rbs +5 -0
- data/examples/simple/eval.rb +3 -2
- data/examples/simple/ping_pong.rb +2 -1
- data/examples/simple/rolepanel.rb +17 -6
- data/examples/simple/shard.rb +3 -2
- data/examples/simple/wait_for_message.rb +4 -1
- data/exe/discorb +33 -18
- data/lefthook.yml +45 -0
- data/lib/discorb/allowed_mentions.rb +2 -1
- data/lib/discorb/app_command/command.rb +130 -72
- data/lib/discorb/app_command/common.rb +25 -0
- data/lib/discorb/app_command/handler.rb +130 -33
- data/lib/discorb/app_command.rb +2 -1
- data/lib/discorb/application.rb +1 -0
- data/lib/discorb/asset.rb +1 -2
- data/lib/discorb/attachment.rb +1 -1
- data/lib/discorb/audit_logs.rb +19 -10
- data/lib/discorb/automod.rb +269 -0
- data/lib/discorb/channel/base.rb +108 -0
- data/lib/discorb/channel/category.rb +32 -0
- data/lib/discorb/channel/container.rb +44 -0
- data/lib/discorb/channel/dm.rb +28 -0
- data/lib/discorb/channel/guild.rb +246 -0
- data/lib/discorb/channel/stage.rb +140 -0
- data/lib/discorb/channel/text.rb +336 -0
- data/lib/discorb/channel/thread.rb +325 -0
- data/lib/discorb/channel/voice.rb +79 -0
- data/lib/discorb/channel.rb +2 -1165
- data/lib/discorb/client.rb +50 -36
- data/lib/discorb/color.rb +37 -60
- data/lib/discorb/common.rb +2 -1
- data/lib/discorb/components/button.rb +2 -1
- data/lib/discorb/components/select_menu.rb +4 -2
- data/lib/discorb/components/text_input.rb +12 -2
- data/lib/discorb/components.rb +1 -1
- data/lib/discorb/dictionary.rb +1 -1
- data/lib/discorb/embed.rb +26 -10
- data/lib/discorb/emoji.rb +31 -4
- data/lib/discorb/emoji_table.rb +4969 -3
- data/lib/discorb/event.rb +29 -4
- data/lib/discorb/exe/about.rb +2 -1
- data/lib/discorb/exe/irb.rb +2 -4
- data/lib/discorb/exe/new.rb +89 -26
- data/lib/discorb/exe/run.rb +8 -22
- data/lib/discorb/exe/setup.rb +25 -12
- data/lib/discorb/exe/show.rb +4 -3
- data/lib/discorb/extend.rb +1 -0
- data/lib/discorb/extension.rb +6 -7
- data/lib/discorb/flag.rb +13 -2
- data/lib/discorb/gateway.rb +79 -589
- data/lib/discorb/gateway_events.rb +638 -0
- data/lib/discorb/guild.rb +318 -67
- data/lib/discorb/guild_template.rb +11 -5
- data/lib/discorb/http.rb +53 -24
- data/lib/discorb/integration.rb +4 -1
- data/lib/discorb/intents.rb +28 -19
- data/lib/discorb/interaction/autocomplete.rb +28 -16
- data/lib/discorb/interaction/command.rb +42 -14
- data/lib/discorb/interaction/components.rb +5 -2
- data/lib/discorb/interaction/modal.rb +0 -1
- data/lib/discorb/interaction/response.rb +125 -26
- data/lib/discorb/interaction/root.rb +13 -13
- data/lib/discorb/interaction.rb +1 -0
- data/lib/discorb/invite.rb +5 -2
- data/lib/discorb/member.rb +28 -8
- data/lib/discorb/message.rb +60 -25
- data/lib/discorb/message_meta.rb +3 -3
- data/lib/discorb/modules.rb +59 -16
- data/lib/discorb/presence.rb +2 -0
- data/lib/discorb/rate_limit.rb +7 -2
- data/lib/discorb/reaction.rb +2 -2
- data/lib/discorb/role.rb +20 -5
- data/lib/discorb/shard.rb +1 -1
- data/lib/discorb/sticker.rb +9 -8
- data/lib/discorb/user.rb +4 -3
- data/lib/discorb/utils/colored_puts.rb +1 -0
- data/lib/discorb/voice_state.rb +6 -2
- data/lib/discorb/webhook.rb +64 -31
- data/lib/discorb.rb +7 -5
- data/po/yard.pot +20 -20
- data/rbs_collection.lock.yaml +88 -0
- data/rbs_collection.yaml +21 -0
- data/sig/async.rbs +11 -0
- data/sig/discorb/activity.rbs +23 -0
- data/sig/discorb/allowed_mentions.rbs +44 -0
- data/sig/discorb/app_command/base.rbs +282 -0
- data/sig/discorb/app_command/handler.rbs +171 -0
- data/sig/discorb/application.rbs +142 -0
- data/sig/discorb/asset.rbs +32 -0
- data/sig/discorb/attachment.rbs +91 -0
- data/sig/discorb/audit_log.rbs +231 -0
- data/sig/discorb/automod.rbs +128 -0
- data/sig/discorb/avatar.rbs +26 -0
- data/sig/discorb/channel/base.rbs +179 -0
- data/sig/discorb/channel/category.rbs +56 -0
- data/sig/discorb/channel/container.rbs +29 -0
- data/sig/discorb/channel/dm.rbs +14 -0
- data/sig/discorb/channel/news.rbs +20 -0
- data/sig/discorb/channel/stage.rbs +77 -0
- data/sig/discorb/channel/text.rbs +158 -0
- data/sig/discorb/channel/thread.rbs +185 -0
- data/sig/discorb/channel/voice.rbs +41 -0
- data/sig/discorb/client.rbs +2495 -0
- data/sig/discorb/color.rbs +142 -0
- data/sig/discorb/component/base.rbs +28 -0
- data/sig/discorb/component/button.rbs +65 -0
- data/sig/discorb/component/select_menu.rbs +107 -0
- data/sig/discorb/component/text_input.rbs +69 -0
- data/sig/discorb/connectable.rbs +8 -0
- data/sig/discorb/custom_emoji.rbs +90 -0
- data/sig/discorb/dictionary.rbs +85 -0
- data/sig/discorb/discord_model.rbs +15 -0
- data/sig/discorb/embed.rbs +279 -0
- data/sig/discorb/emoji.rbs +13 -0
- data/sig/discorb/error.rbs +73 -0
- data/sig/discorb/event_handler.rbs +27 -0
- data/sig/discorb/extension.rbs +1734 -0
- data/sig/discorb/flag.rbs +72 -0
- data/sig/discorb/gateway.rbs +481 -0
- data/sig/discorb/guild.rbs +870 -0
- data/sig/discorb/guild_template.rbs +174 -0
- data/sig/discorb/http.rbs +147 -0
- data/sig/discorb/image.rbs +20 -0
- data/sig/discorb/integration.rbs +118 -0
- data/sig/discorb/intents.rbs +97 -0
- data/sig/discorb/interaction/autocomplete.rbs +9 -0
- data/sig/discorb/interaction/base.rbs +66 -0
- data/sig/discorb/interaction/command.rbs +66 -0
- data/sig/discorb/interaction/message_component.rbs +140 -0
- data/sig/discorb/interaction/modal.rbs +50 -0
- data/sig/discorb/interaction/responder.rbs +157 -0
- data/sig/discorb/invite.rbs +86 -0
- data/sig/discorb/member.rbs +187 -0
- data/sig/discorb/message.rbs +469 -0
- data/sig/discorb/messageable.rbs +153 -0
- data/sig/discorb/partial_emoji.rbs +35 -0
- data/sig/discorb/permissions.rbs +149 -0
- data/sig/discorb/presence.rbs +237 -0
- data/sig/discorb/reaction.rbs +33 -0
- data/sig/discorb/role.rbs +145 -0
- data/sig/discorb/scheduled_event.rbs +148 -0
- data/sig/discorb/shard.rbs +62 -0
- data/sig/discorb/snowflake.rbs +56 -0
- data/sig/discorb/stage_instance.rbs +63 -0
- data/sig/discorb/sticker.rbs +116 -0
- data/sig/discorb/system_channel_flag.rbs +17 -0
- data/sig/discorb/unicode_emoji.rbs +49 -0
- data/sig/discorb/user.rbs +93 -0
- data/sig/discorb/utils.rbs +8 -0
- data/sig/discorb/voice_region.rbs +30 -0
- data/sig/discorb/voice_state.rbs +71 -0
- data/sig/discorb/webhook.rbs +327 -0
- data/sig/discorb/welcome_screen.rbs +78 -0
- data/sig/discorb.rbs +6 -7230
- data/sig/manifest.yaml +3 -0
- data/sig/override.rbs +19 -0
- data/template-replace/files/css/common.css +4 -0
- metadata +102 -6
- data/examples/commands/bookmarker.rb +0 -42
- data/examples/commands/hello.rb +0 -10
- data/examples/commands/inspect.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 117db5f0857b3da9f0c3a642da5c012b0e6b458aa61c2590b31df28540f04732
|
4
|
+
data.tar.gz: '08b41acb91e31536970e4a8545f7b29a656ea50fbc813eecde02463acff31cb1'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 511b7faf125d98e9da7120fe7a3dfae5f224dfcb4891e989cab8183db22ebd0f569685e3e7a7f00040d9ee539d5efaa5fa178f10a0137f79b155026944560a2e
|
7
|
+
data.tar.gz: 86ced549c50cc26a3a512964614587ff74690b67ed64810355fb307081407b87083151903febfe5f6fb634918365d88e1171af09070b1dbb838c5bcb0a31b9b5
|
data/.gitattributes
CHANGED
@@ -3,7 +3,7 @@ name: Build YARD with main
|
|
3
3
|
on:
|
4
4
|
workflow_dispatch:
|
5
5
|
schedule:
|
6
|
-
- cron: "
|
6
|
+
- cron: "0 * * * *"
|
7
7
|
|
8
8
|
jobs:
|
9
9
|
main:
|
@@ -11,7 +11,7 @@ jobs:
|
|
11
11
|
runs-on: ubuntu-latest
|
12
12
|
|
13
13
|
steps:
|
14
|
-
- uses: actions/checkout@
|
14
|
+
- uses: actions/checkout@v3
|
15
15
|
with:
|
16
16
|
fetch-depth: 0
|
17
17
|
- name: Set up Ruby
|
@@ -1,20 +1,18 @@
|
|
1
1
|
name: Lint with RuboCop
|
2
2
|
on:
|
3
3
|
push:
|
4
|
-
branches:
|
5
|
-
- main
|
6
4
|
jobs:
|
7
5
|
rubocop:
|
8
6
|
runs-on: ubuntu-latest
|
9
7
|
steps:
|
10
8
|
- name: Checkout repository
|
11
|
-
uses: actions/checkout@
|
9
|
+
uses: actions/checkout@v3
|
12
10
|
- uses: ruby/setup-ruby@v1
|
13
11
|
with:
|
14
12
|
ruby-version: 3.0.0
|
15
13
|
- name: Install gems
|
16
14
|
run: |
|
17
|
-
|
15
|
+
bundle install
|
18
16
|
- name: Run rubocop
|
19
17
|
run: |
|
20
|
-
|
18
|
+
rake lint
|
data/.github/workflows/lint.yml
CHANGED
@@ -6,11 +6,9 @@ jobs:
|
|
6
6
|
runs-on: ubuntu-latest
|
7
7
|
steps:
|
8
8
|
- name: Checkout repository
|
9
|
-
uses: actions/checkout@
|
9
|
+
uses: actions/checkout@v3
|
10
10
|
- uses: ruby/setup-ruby@v1
|
11
11
|
with:
|
12
12
|
ruby-version: 3.0.0
|
13
13
|
- name: rubocop
|
14
|
-
uses: reviewdog/action-rubocop@v2
|
15
|
-
with:
|
16
|
-
rubocop_version: 1.25
|
14
|
+
uses: reviewdog/action-rubocop@v2
|
@@ -0,0 +1,33 @@
|
|
1
|
+
name: Run spec
|
2
|
+
|
3
|
+
on:
|
4
|
+
workflow_dispatch:
|
5
|
+
push:
|
6
|
+
branches:
|
7
|
+
- main
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
main:
|
11
|
+
strategy:
|
12
|
+
matrix:
|
13
|
+
ruby-version:
|
14
|
+
- "3.0"
|
15
|
+
- "3.1"
|
16
|
+
os:
|
17
|
+
- "ubuntu-latest"
|
18
|
+
- "windows-latest"
|
19
|
+
runs-on: ${{ matrix.os }}
|
20
|
+
steps:
|
21
|
+
- name: Set up Ruby
|
22
|
+
uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby-version }}
|
25
|
+
bundler-cache: true
|
26
|
+
- name: Checkout repository
|
27
|
+
uses: actions/checkout@v3
|
28
|
+
- name: Install dependencies
|
29
|
+
run: |
|
30
|
+
bundle install
|
31
|
+
gem update uri
|
32
|
+
- name: Run spec
|
33
|
+
run: bundle exec rake spec
|
@@ -0,0 +1,21 @@
|
|
1
|
+
name: Validate rbs
|
2
|
+
on:
|
3
|
+
- push
|
4
|
+
jobs:
|
5
|
+
validate:
|
6
|
+
runs-on: ubuntu-latest
|
7
|
+
steps:
|
8
|
+
- name: Checkout repository
|
9
|
+
uses: actions/checkout@v3
|
10
|
+
- uses: ruby/setup-ruby@v1
|
11
|
+
with:
|
12
|
+
ruby-version: 3.0.0
|
13
|
+
- name: Install collection
|
14
|
+
run: |
|
15
|
+
gem update rbs
|
16
|
+
bundle install
|
17
|
+
rbs collection install
|
18
|
+
- name: Validate
|
19
|
+
run: |
|
20
|
+
rbs -I sig validate
|
21
|
+
|
data/.gitignore
CHANGED
data/.rspec
ADDED
data/.rspec_parallel
ADDED
data/.rubocop.yml
CHANGED
@@ -2,13 +2,38 @@ AllCops:
|
|
2
2
|
NewCops: enable
|
3
3
|
TargetRubyVersion: 3.0
|
4
4
|
Exclude:
|
5
|
-
-
|
5
|
+
- lib/discorb/emoji_table.rb
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
require:
|
8
|
+
- rubocop-rake
|
9
|
+
- rubocop-rspec
|
10
|
+
|
11
|
+
# Layout:
|
12
|
+
# Enabled: false
|
9
13
|
Metrics:
|
10
14
|
Enabled: false
|
11
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:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Layout/ElseAlignment:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Layout/EndAlignment:
|
35
|
+
Enabled: false
|
36
|
+
|
12
37
|
Style/TrailingCommaInHashLiteral: # Disabled for rufo
|
13
38
|
EnforcedStyleForMultiline: consistent_comma
|
14
39
|
|
@@ -25,6 +50,9 @@ Style/TrailingCommaInArguments: # Disabled for rufo
|
|
25
50
|
Style/StringLiteralsInInterpolation: # Disabled for rufo
|
26
51
|
Enabled: false
|
27
52
|
|
53
|
+
Layout/SpaceAroundOperators: # Changed for rufo
|
54
|
+
EnforcedStyleForExponentOperator: space
|
55
|
+
|
28
56
|
Style/StringConcatenation: # + looks better
|
29
57
|
Enabled: false
|
30
58
|
|
@@ -67,8 +95,17 @@ Lint/Debugger: # For /exe
|
|
67
95
|
Style/GuardClause: # For make it extendable
|
68
96
|
Enabled: false
|
69
97
|
|
70
|
-
Layout/EndOfLine: # For git
|
71
|
-
EnforcedStyle: lf
|
72
|
-
|
73
98
|
Lint/ScriptPermission: # For GitHub Actions
|
99
|
+
Enabled: false
|
100
|
+
|
101
|
+
Style/NumericLiterals: # For style
|
102
|
+
Enabled: false
|
103
|
+
|
104
|
+
RSpec/FilePath:
|
105
|
+
Enabled: false
|
106
|
+
|
107
|
+
RSpec/ExampleLength:
|
108
|
+
Enabled: false
|
109
|
+
|
110
|
+
RSpec/MultipleExpectations:
|
74
111
|
Enabled: false
|
data/Changelog.md
CHANGED
@@ -4,6 +4,36 @@
|
|
4
4
|
|
5
5
|
# Changelog
|
6
6
|
|
7
|
+
## v0.18
|
8
|
+
|
9
|
+
### v0.18.0
|
10
|
+
|
11
|
+
- Change!: `XXX#fired_by` is now `XXX#user` or `XXX#member`.
|
12
|
+
- Change!: `Message#to_reference` returns `Message::Reference`.
|
13
|
+
- Change!: `TextChannel#default_auto_archive_duration` is now Integer.
|
14
|
+
- Add: Support AutoMod.
|
15
|
+
- Change: `discorb new` doesn't do initial commit.
|
16
|
+
|
17
|
+
## v0.17
|
18
|
+
|
19
|
+
### v0.17.1
|
20
|
+
|
21
|
+
- Add: Add valid rbs file.
|
22
|
+
- Change: Message content intent warning will show only once.
|
23
|
+
- Update: Update audit log events.
|
24
|
+
|
25
|
+
### v0.17.0
|
26
|
+
|
27
|
+
- Change!: Delete `Interaction#target` and `Interaction#fired_by`.
|
28
|
+
- Change: `Interaction#user` and `Interaction#member` are same.
|
29
|
+
- Add: Include Messageable in VoiceChannel
|
30
|
+
- Add: Add `--[no-]bundler` option to `discorb` command.
|
31
|
+
- Add: Add `--[no-]comment` option to `discorb new` command.
|
32
|
+
- Fix PermissionOverwrite was initialized with string.
|
33
|
+
- Fix emoji with different skin tones raises ArgumentError.
|
34
|
+
- Fix `Asset#endpoint` raises NameError.
|
35
|
+
- Fix `:error` event may call itself.
|
36
|
+
|
7
37
|
## v0.16
|
8
38
|
|
9
39
|
### v0.16.0
|
@@ -456,4 +486,3 @@ end
|
|
456
486
|
### v0.0.1
|
457
487
|
|
458
488
|
- Initial release
|
459
|
-
|
data/Gemfile
CHANGED
@@ -7,10 +7,23 @@ gemspec
|
|
7
7
|
|
8
8
|
gem "rake", "~> 13.0"
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
# Rubocop
|
11
|
+
gem "rubocop", "~> 1.25"
|
12
|
+
gem "rubocop-rake", "~> 0.6.0"
|
13
|
+
gem "rubocop-rspec", "~> 2.9"
|
14
|
+
|
15
|
+
# RSpec
|
16
|
+
gem "async-rspec", "~> 1.16"
|
17
|
+
gem "parallel_tests", "~> 3.8"
|
18
|
+
gem "rspec", "~> 3.11"
|
19
|
+
|
20
|
+
# Typecheck
|
21
|
+
gem "steep", "~> 1.0"
|
22
|
+
|
23
|
+
# Other development tools
|
24
|
+
gem "lefthook", "~> 0.7.7"
|
25
|
+
gem "rufo", "~> 0.13.0"
|
26
|
+
gem "sord", "~> 3.0.1"
|
14
27
|
|
15
28
|
group :docs, optional: true do
|
16
29
|
gem "crowdin-api", "~> 1.0"
|
@@ -19,7 +32,6 @@ group :docs, optional: true do
|
|
19
32
|
gem "rubyzip", "~> 2.3"
|
20
33
|
gem "yard", "~> 0.9.26"
|
21
34
|
end
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
35
|
+
|
36
|
+
gem "syntax_tree", "~> 2.8"
|
37
|
+
gem "syntax_tree-rbs", "~> 0.4.0"
|