discordrb 3.4.3 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +44 -18
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -1
  4. data/.github/ISSUE_TEMPLATE/feature_request.md +0 -1
  5. data/.github/workflows/codeql.yml +65 -0
  6. data/.markdownlint.json +4 -0
  7. data/.rubocop.yml +8 -2
  8. data/CHANGELOG.md +390 -225
  9. data/LICENSE.txt +1 -1
  10. data/README.md +37 -25
  11. data/discordrb-webhooks.gemspec +4 -1
  12. data/discordrb.gemspec +9 -6
  13. data/lib/discordrb/api/application.rb +202 -0
  14. data/lib/discordrb/api/channel.rb +177 -11
  15. data/lib/discordrb/api/interaction.rb +54 -0
  16. data/lib/discordrb/api/invite.rb +2 -2
  17. data/lib/discordrb/api/server.rb +40 -19
  18. data/lib/discordrb/api/user.rb +8 -3
  19. data/lib/discordrb/api/webhook.rb +57 -0
  20. data/lib/discordrb/api.rb +19 -5
  21. data/lib/discordrb/bot.rb +317 -32
  22. data/lib/discordrb/cache.rb +27 -22
  23. data/lib/discordrb/commands/command_bot.rb +6 -4
  24. data/lib/discordrb/commands/container.rb +1 -1
  25. data/lib/discordrb/commands/parser.rb +2 -2
  26. data/lib/discordrb/commands/rate_limiter.rb +1 -1
  27. data/lib/discordrb/container.rb +132 -3
  28. data/lib/discordrb/data/attachment.rb +15 -0
  29. data/lib/discordrb/data/audit_logs.rb +3 -3
  30. data/lib/discordrb/data/channel.rb +167 -23
  31. data/lib/discordrb/data/component.rb +229 -0
  32. data/lib/discordrb/data/integration.rb +42 -3
  33. data/lib/discordrb/data/interaction.rb +800 -0
  34. data/lib/discordrb/data/invite.rb +1 -1
  35. data/lib/discordrb/data/member.rb +108 -33
  36. data/lib/discordrb/data/message.rb +99 -19
  37. data/lib/discordrb/data/overwrite.rb +13 -7
  38. data/lib/discordrb/data/role.rb +58 -1
  39. data/lib/discordrb/data/server.rb +82 -80
  40. data/lib/discordrb/data/user.rb +69 -9
  41. data/lib/discordrb/data/webhook.rb +97 -4
  42. data/lib/discordrb/data.rb +3 -0
  43. data/lib/discordrb/errors.rb +44 -3
  44. data/lib/discordrb/events/channels.rb +1 -1
  45. data/lib/discordrb/events/interactions.rb +482 -0
  46. data/lib/discordrb/events/message.rb +9 -6
  47. data/lib/discordrb/events/presence.rb +21 -14
  48. data/lib/discordrb/events/reactions.rb +0 -1
  49. data/lib/discordrb/events/threads.rb +96 -0
  50. data/lib/discordrb/gateway.rb +30 -17
  51. data/lib/discordrb/permissions.rb +59 -34
  52. data/lib/discordrb/version.rb +1 -1
  53. data/lib/discordrb/voice/encoder.rb +2 -2
  54. data/lib/discordrb/voice/network.rb +18 -7
  55. data/lib/discordrb/voice/sodium.rb +3 -1
  56. data/lib/discordrb/voice/voice_bot.rb +3 -3
  57. data/lib/discordrb/webhooks.rb +2 -0
  58. data/lib/discordrb.rb +37 -4
  59. metadata +48 -14
  60. data/.codeclimate.yml +0 -16
  61. data/.travis.yml +0 -32
  62. data/bin/travis_build_docs.sh +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5c0ecfd68356ed63ea61a7b99bb5d32e358f74b23c2f729ab531e4848bc770d
4
- data.tar.gz: 4c5917f1b7a1a3e97d875a0244a8fa8e9583bce025053505b960de9e900ca16f
3
+ metadata.gz: 256d58c280ec27b90dbe4c160b04853b72fede9123336085343141e4d0e6ad4a
4
+ data.tar.gz: 8f4db65b7491433052cc99b1a0e633fc773efd8076edbd4ad44a5bc3ed4b5a14
5
5
  SHA512:
6
- metadata.gz: '09b5b31c7e7f15c7053c476ae0c2fd11839b7f5b82c4dea330764da42321c8333559df72273cdffbafe91bc9452a51a4bece945a2e6b3a8774af5fce409750fb'
7
- data.tar.gz: 1743f21d2ad48858e8ebed88984fdf5cecb2ce5878ae0cbf32dbccc451175daa1d0f37c571efa100dadd94dcb169b17515bc691884d9583e00b40f57b45242ff
6
+ metadata.gz: ed49c17ab20befc243747a942d4401b513670220d76632b796df000e9232bebd5d6f58c6ce7a1bb5a16f03d8d88ec1b2c5c6131e1ddd20784cf4b7248111a979
7
+ data.tar.gz: 01fb50074b67c0bcb3c96ed2cc4e76aad57600e94fa22793c588e66c98fddd796f7a7087817b9d7926975e28e956d950ce7fd1d778e73edf26c32be49dabbedb
data/.circleci/config.yml CHANGED
@@ -27,45 +27,50 @@ commands:
27
27
  - ./vendor/bundle
28
28
 
29
29
  jobs:
30
- test_ruby_25:
30
+ test_ruby_27:
31
31
  docker:
32
- - image: ruby:2.5-alpine
32
+ - image: ruby:2.7-alpine
33
33
  steps:
34
34
  - setup-env
35
35
  - run:
36
36
  name: Run RSpec
37
- command: bundle exec rspec
37
+ command: bundle exec rspec --format progress --format RspecJunitFormatter -o ~/rspec/rspec.xml
38
+ - store_test_results:
39
+ path: ~/rspec
38
40
 
39
- test_ruby_26:
41
+ test_ruby_30:
40
42
  docker:
41
- - image: ruby:2.6-alpine
43
+ - image: ruby:3.0-alpine
42
44
  steps:
43
45
  - setup-env
44
46
  - run:
45
47
  name: Run RSpec
46
- command: bundle exec rspec
48
+ command: bundle exec rspec --format progress --format RspecJunitFormatter -o ~/rspec/rspec.xml
49
+ - store_test_results:
50
+ path: ~/rspec
47
51
 
48
- test_ruby_27:
52
+
53
+ test_ruby_31:
49
54
  docker:
50
- - image: ruby:2.7-alpine
55
+ - image: ruby:3.1-alpine
51
56
  steps:
52
57
  - setup-env
53
58
  - run:
54
59
  name: Run RSpec
55
- command: bundle exec rspec
60
+ command: bundle exec rspec --format progress --format RspecJunitFormatter -o ~/rspec/rspec.xml
56
61
 
57
62
  rubocop:
58
63
  docker:
59
- - image: ruby:2.5-alpine
64
+ - image: ruby:2.7-alpine
60
65
  steps:
61
66
  - setup-env
62
67
  - run:
63
68
  name: Run Rubocop
64
- command: bundle exec rubocop -P
69
+ command: bundle exec rubocop
65
70
 
66
71
  yard:
67
72
  docker:
68
- - image: ruby:2.5-alpine
73
+ - image: ruby:2.7-alpine
69
74
  steps:
70
75
  - setup-env
71
76
  - attach_workspace:
@@ -79,13 +84,22 @@ jobs:
79
84
  - docs
80
85
 
81
86
  pages:
82
- machine: true
87
+ docker:
88
+ - image: alpine
83
89
  steps:
90
+ - run:
91
+ name: Install OS packages
92
+ command: apk add git openssh-client-default
84
93
  - attach_workspace:
85
94
  at: /tmp/workspace
86
95
  - run:
87
96
  name: Clone docs
88
- command: git clone $CIRCLE_REPOSITORY_URL -b gh-pages .
97
+ command: |
98
+ mkdir -p ~/.ssh
99
+
100
+ echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=' >> ~/.ssh/known_hosts
101
+
102
+ git clone $CIRCLE_REPOSITORY_URL -b gh-pages .
89
103
  - add_ssh_keys:
90
104
  fingerprints:
91
105
  - "9a:4c:50:94:23:46:81:74:41:97:87:04:4e:59:4b:4e"
@@ -111,16 +125,28 @@ jobs:
111
125
  workflows:
112
126
  test:
113
127
  jobs:
114
- - test_ruby_25
115
- - test_ruby_26
116
128
  - test_ruby_27
129
+ - test_ruby_30
130
+ - test_ruby_31
117
131
  - rubocop
118
132
  - yard
119
133
  deploy:
120
134
  jobs:
121
135
  - yard:
122
- filters: {branches: {only: main}, tags: {only: /^v.*/}}
136
+ filters:
137
+ branches:
138
+ only:
139
+ - main
140
+ - slash_commands
141
+ tags:
142
+ only: /^v.*/
123
143
  - pages:
124
144
  requires:
125
145
  - yard
126
- filters: {branches: {only: main}, tags: {only: /^v.*/}}
146
+ filters:
147
+ branches:
148
+ only:
149
+ - main
150
+ - slash_commands
151
+ tags:
152
+ only: /^v.*/
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: Bug report
3
3
  about: Report a bug to help us improve the library
4
-
5
4
  ---
6
5
 
7
6
  # Summary
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: Feature Request
3
3
  about: Request a new feature, or change an existing one
4
-
5
4
  ---
6
5
 
7
6
  <!---
@@ -0,0 +1,65 @@
1
+ name: "CodeQL"
2
+
3
+ on:
4
+ push:
5
+ branches: [ 'main' ]
6
+ pull_request:
7
+ # The branches below must be a subset of the branches above
8
+ branches: [ 'main' ]
9
+ schedule:
10
+ - cron: '29 6 * * 5'
11
+
12
+ jobs:
13
+ analyze:
14
+ name: Analyze
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ actions: read
18
+ contents: read
19
+ security-events: write
20
+
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ language: [ 'ruby' ]
25
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
26
+ # Use only 'java' to analyze code written in Java, Kotlin or both
27
+ # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
28
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
29
+
30
+ steps:
31
+ - name: Checkout repository
32
+ uses: actions/checkout@v3
33
+
34
+ # Initializes the CodeQL tools for scanning.
35
+ - name: Initialize CodeQL
36
+ uses: github/codeql-action/init@v2
37
+ with:
38
+ languages: ${{ matrix.language }}
39
+ # If you wish to specify custom queries, you can do so here or in a config file.
40
+ # By default, queries listed here will override any specified in a config file.
41
+ # Prefix the list here with "+" to use these queries and those in the config file.
42
+
43
+ # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
44
+ # queries: security-extended,security-and-quality
45
+
46
+
47
+ # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
48
+ # If this step fails, then you should remove it and run the build manually (see below)
49
+ - name: Autobuild
50
+ uses: github/codeql-action/autobuild@v2
51
+
52
+ # ℹ️ Command-line programs to run using the OS shell.
53
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
54
+
55
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
56
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
57
+
58
+ # - run: |
59
+ # echo "Run, Build Application using script"
60
+ # ./location_of_script_within_repo/buildscript.sh
61
+
62
+ - name: Perform CodeQL Analysis
63
+ uses: github/codeql-action/analyze@v2
64
+ with:
65
+ category: "/language:${{matrix.language}}"
@@ -0,0 +1,4 @@
1
+ {
2
+ "MD013": false,
3
+ "MD024": { "siblings_only": true }
4
+ }
data/.rubocop.yml CHANGED
@@ -1,4 +1,6 @@
1
- require: rubocop-performance
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rake
2
4
 
3
5
  inherit_mode:
4
6
  merge:
@@ -6,7 +8,7 @@ inherit_mode:
6
8
 
7
9
  AllCops:
8
10
  NewCops: enable
9
- TargetRubyVersion: 2.5
11
+ TargetRubyVersion: 2.7
10
12
 
11
13
  # Disable line length checks
12
14
  Layout/LineLength:
@@ -38,6 +40,10 @@ Security/Eval:
38
40
  Style/Alias:
39
41
  Enabled: false
40
42
 
43
+ # Had to disable this globally because it's being silently autocorrected even with local disable comments?
44
+ Style/BisectedAttrAccessor:
45
+ Enabled: false
46
+
41
47
  # Prefer compact module/class defs
42
48
  Style/ClassAndModuleChildren:
43
49
  Enabled: false