From 6b95e9a0cfead3e762e8f501a20b590882848720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyan=E2=98=85Nyan=E2=99=AA?= Date: Fri, 26 Jun 2026 23:38:59 +0800 Subject: [PATCH 1/2] Combined PRs (#3327) * Bump the npm_and_yarn group across 1 directory with 2 updates Bumps the npm_and_yarn group with 2 updates in the / directory: [js-yaml](https://github.com/nodeca/js-yaml) and [tar](https://github.com/isaacs/node-tar). Updates `js-yaml` from 4.1.1 to 4.2.0 - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](https://github.com/nodeca/js-yaml/commits) Updates `tar` from 7.5.11 to 7.5.16 - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](https://github.com/isaacs/node-tar/compare/v7.5.11...v7.5.16) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 4.2.0 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: tar dependency-version: 7.5.16 dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] * Bump discordrb from 3.7.2 to 3.8.0 Bumps [discordrb](https://github.com/shardlab/discordrb) from 3.7.2 to 3.8.0. - [Release notes](https://github.com/shardlab/discordrb/releases) - [Changelog](https://github.com/shardlab/discordrb/blob/main/CHANGELOG.md) - [Commits](https://github.com/shardlab/discordrb/compare/v3.7.2...v3.8.0) --- updated-dependencies: - dependency-name: discordrb dependency-version: 3.8.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump rubocop-rails from 2.35.4 to 2.35.5 Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.35.4 to 2.35.5. - [Release notes](https://github.com/rubocop/rubocop-rails/releases) - [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.35.4...v2.35.5) --- updated-dependencies: - dependency-name: rubocop-rails dependency-version: 2.35.5 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Bump globals from 17.6.0 to 17.7.0 Bumps [globals](https://github.com/sindresorhus/globals) from 17.6.0 to 17.7.0. - [Release notes](https://github.com/sindresorhus/globals/releases) - [Commits](https://github.com/sindresorhus/globals/compare/v17.6.0...v17.7.0) --- updated-dependencies: - dependency-name: globals dependency-version: 17.7.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump typescript-eslint from 8.61.1 to 8.62.0 Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.61.1 to 8.62.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.62.0/packages/typescript-eslint) --- updated-dependencies: - dependency-name: typescript-eslint dependency-version: 8.62.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump tapioca from 0.19.1 to 0.19.2 Bumps [tapioca](https://github.com/Shopify/tapioca) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/Shopify/tapioca/releases) - [Commits](https://github.com/Shopify/tapioca/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: tapioca dependency-version: 0.19.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .nvmrc | 2 +- .tool-versions | 2 +- Dockerfile | 2 +- Gemfile | 2 +- Gemfile.lock | 69 +- app/controllers/application_controller.rb | 1 + app/views/admin/game_ids/index.html.erb | 28 +- app/views/admin/users/index.html.erb | 28 +- package.json | 16 +- sorbet/config | 1 + ...by@1.3.6.rbi => concurrent-ruby@1.3.7.rbi} | 116 +- .../gems/{crass@1.0.6.rbi => crass@1.0.7.rbi} | 241 +- ...3.7.2.rbi => discordrb-webhooks@3.8.0.rbi} | 527 +++- ...iscordrb@3.7.2.rbi => discordrb@3.8.0.rbi} | 2564 +++++++++++------ ...p@3.4.3.rbi => faraday-net_http@3.4.4.rbi} | 0 ...{faraday@2.14.2.rbi => faraday@2.14.3.rbi} | 104 +- .../{fugit@1.12.1.rbi => fugit@1.12.2.rbi} | 170 +- ...{globalid@1.3.0.rbi => globalid@1.4.0.rbi} | 293 +- .../gems/{i18n@1.14.8.rbi => i18n@1.15.2.rbi} | 174 +- .../gems/{json@2.19.8.rbi => json@2.20.0.rbi} | 51 +- .../{msgpack@1.8.1.rbi => msgpack@1.8.3.rbi} | 0 ...et-imap@0.6.4.rbi => net-imap@0.6.4.1.rbi} | 601 ++-- ...okogiri@1.19.3.rbi => nokogiri@1.19.4.rbi} | 296 +- .../rbi/gems/{pp@0.6.3.rbi => pp@0.6.4.rbi} | 0 sorbet/rbi/gems/psych@5.3.1.rbi | 2325 --------------- ...ent@0.29.0.rbi => redis-client@0.30.0.rbi} | 0 sorbet/rbi/gems/stringio@3.2.0.rbi | 9 - ...r@0.8.0.rbi => websocket-driver@0.8.2.rbi} | 25 +- sorbet/tapioca/config.yml | 1 + yarn.lock | 552 ++-- 30 files changed, 3637 insertions(+), 4563 deletions(-) rename sorbet/rbi/gems/{concurrent-ruby@1.3.6.rbi => concurrent-ruby@1.3.7.rbi} (99%) rename sorbet/rbi/gems/{crass@1.0.6.rbi => crass@1.0.7.rbi} (64%) rename sorbet/rbi/gems/{discordrb-webhooks@3.7.2.rbi => discordrb-webhooks@3.8.0.rbi} (55%) rename sorbet/rbi/gems/{discordrb@3.7.2.rbi => discordrb@3.8.0.rbi} (89%) rename sorbet/rbi/gems/{faraday-net_http@3.4.3.rbi => faraday-net_http@3.4.4.rbi} (100%) rename sorbet/rbi/gems/{faraday@2.14.2.rbi => faraday@2.14.3.rbi} (97%) rename sorbet/rbi/gems/{fugit@1.12.1.rbi => fugit@1.12.2.rbi} (94%) rename sorbet/rbi/gems/{globalid@1.3.0.rbi => globalid@1.4.0.rbi} (67%) rename sorbet/rbi/gems/{i18n@1.14.8.rbi => i18n@1.15.2.rbi} (95%) rename sorbet/rbi/gems/{json@2.19.8.rbi => json@2.20.0.rbi} (98%) rename sorbet/rbi/gems/{msgpack@1.8.1.rbi => msgpack@1.8.3.rbi} (100%) rename sorbet/rbi/gems/{net-imap@0.6.4.rbi => net-imap@0.6.4.1.rbi} (97%) rename sorbet/rbi/gems/{nokogiri@1.19.3.rbi => nokogiri@1.19.4.rbi} (97%) rename sorbet/rbi/gems/{pp@0.6.3.rbi => pp@0.6.4.rbi} (100%) delete mode 100644 sorbet/rbi/gems/psych@5.3.1.rbi rename sorbet/rbi/gems/{redis-client@0.29.0.rbi => redis-client@0.30.0.rbi} (100%) delete mode 100644 sorbet/rbi/gems/stringio@3.2.0.rbi rename sorbet/rbi/gems/{websocket-driver@0.8.0.rbi => websocket-driver@0.8.2.rbi} (97%) diff --git a/.nvmrc b/.nvmrc index a4a7a41bc..5bcf9c6e6 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v24.14.0 +v24.18.0 diff --git a/.tool-versions b/.tool-versions index c83f73981..815a6a6ba 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -nodejs 24.14.0 +nodejs 24.18.0 ruby 4.0.5 diff --git a/Dockerfile b/Dockerfile index abc267081..ab76e817d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ADD --checksum=sha256:6e3d580f5bd7ccf2aa1e8df8d35c60d78e873c3ff8beb282c9bebd9149 https://deb.nodesource.com/setup_lts.x /tmp/setup_lts.x ENV BUNDLE_PATH=/gems -ENV NODE_VERSION=24.14.0 +ENV NODE_VERSION=24.18.0 RUN apt-get update && apt-get install -yq --no-install-recommends \ build-essential \ diff --git a/Gemfile b/Gemfile index 377c3f5e9..c080ffa57 100644 --- a/Gemfile +++ b/Gemfile @@ -93,7 +93,7 @@ gem "jwt", "~> 3.2" # gem "ferrum", "~> 0.13" -gem "discordrb", "~> 3.7.1" +gem "discordrb", "~> 3.8.0" gem "kodachroma", "~> 1.0" diff --git a/Gemfile.lock b/Gemfile.lock index 30ed801da..53ed1f5a5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -99,9 +99,9 @@ GEM regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) colorize (1.1.0) - concurrent-ruby (1.3.6) + concurrent-ruby (1.3.7) connection_pool (3.0.2) - crass (1.0.6) + crass (1.0.7) cronex (0.15.0) tzinfo unicode (>= 0.4.4.5) @@ -116,14 +116,14 @@ GEM railties (>= 7.0) responders warden (~> 1.2.3) - discordrb (3.7.2) + discordrb (3.8.0) base64 (~> 0.2) - discordrb-webhooks (~> 3.7.2) + discordrb-webhooks (~> 3.8.0) ffi (>= 1.9.24) opus-ruby rest-client (>= 2.0.0) websocket-client-simple (>= 0.9.0) - discordrb-webhooks (3.7.2) + discordrb-webhooks (3.8.0) rest-client (>= 2.0.0) domain_name (0.6.20240107) dotenv (3.2.0) @@ -149,7 +149,7 @@ GEM raabro (~> 1.4) gene_pool (1.5.0) concurrent-ruby (>= 1.0) - globalid (1.3.0) + globalid (1.4.0) activesupport (>= 6.1) graphlient (0.8.0) faraday (~> 2.0) @@ -172,7 +172,7 @@ GEM benchmark rack (>= 2.0) rainbow (>= 2.0.0) - i18n (1.14.8) + i18n (1.15.2) concurrent-ruby (~> 1.0) io-console (0.8.2) irb (1.18.0) @@ -180,7 +180,7 @@ GEM prism (>= 1.3.0) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.19.9) + json (2.20.0) jwt (3.2.0) base64 kodachroma (1.0.2) @@ -241,9 +241,9 @@ GEM net-protocol netrc (0.11.0) nio4r (2.7.5) - nokogiri (1.19.3-aarch64-linux-gnu) + nokogiri (1.19.4-aarch64-linux-gnu) racc (~> 1.4) - nokogiri (1.19.3-x86_64-linux-gnu) + nokogiri (1.19.4-x86_64-linux-gnu) racc (~> 1.4) opus-ruby (1.0.1) ffi @@ -258,14 +258,11 @@ GEM persistent_httparty (0.1.2) httparty (~> 0.9) persistent_http (< 2) - pp (0.6.3) + pp (0.6.4) prettyprint prettier_print (1.2.1) prettyprint (0.2.0) prism (1.9.0) - psych (5.4.0) - date - stringio public_suffix (7.0.5) puma (8.0.2) nio4r (~> 2.0) @@ -324,16 +321,17 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rbi (0.3.13) + rbi (0.3.14) prism (~> 1.0) rbs (>= 4.0.1) - rbs (4.0.2) + rbs (4.0.3) logger prism (>= 1.6.0) tsort - rdoc (7.2.0) + rdoc (8.0.0) erb - psych (>= 4.0.0) + prism (>= 1.6.0) + rbs (>= 4.0.0) tsort redis (5.4.1) redis-client (>= 0.22.0) @@ -375,7 +373,7 @@ GEM lint_roller (~> 1.1) rubocop (>= 1.75.0, < 2.0) rubocop-ast (>= 1.47.1, < 2.0) - rubocop-rails (2.35.4) + rubocop-rails (2.35.5) activesupport (>= 4.2.0) lint_roller (~> 1.1) rack (>= 1.1) @@ -388,8 +386,8 @@ GEM ruby-lsp-rails (0.4.8) ruby-lsp (>= 0.26.0, < 0.27.0) ruby-progressbar (1.13.0) - rubydex (0.2.5-aarch64-linux) - rubydex (0.2.5-x86_64-linux) + rubydex (0.2.6-aarch64-linux) + rubydex (0.2.6-x86_64-linux) rubyzip (2.4.1) securerandom (0.4.1) selenium-webdriver (4.10.0) @@ -411,26 +409,25 @@ GEM concurrent-ruby (~> 1.0, >= 1.0.5) sidekiq (>= 7.0.0, < 9.0.0) thor (>= 1.0, < 3.0) - sorbet (0.6.13308) - sorbet-static (= 0.6.13308) - sorbet-runtime (0.6.13308) - sorbet-static (0.6.13308-aarch64-linux) - sorbet-static (0.6.13308-x86_64-linux) - sorbet-static-and-runtime (0.6.13308) - sorbet (= 0.6.13308) - sorbet-runtime (= 0.6.13308) - spoom (1.7.16) + sorbet (0.6.13316) + sorbet-static (= 0.6.13316) + sorbet-runtime (0.6.13316) + sorbet-static (0.6.13316-aarch64-linux) + sorbet-static (0.6.13316-x86_64-linux) + sorbet-static-and-runtime (0.6.13316) + sorbet (= 0.6.13316) + sorbet-runtime (= 0.6.13316) + spoom (1.8.2) erubi (>= 1.10.0) prism (>= 0.28.0) - rbi (>= 0.3.3) + rbi (>= 0.3.14) rbs (>= 4.0.0.dev.5) rexml (>= 3.2.6) sorbet-static-and-runtime (>= 0.5.10187) thor (>= 0.19.2) - stringio (3.2.0) syntax_tree (6.3.0) prettier_print (>= 1.2.0) - tapioca (0.19.1) + tapioca (0.19.2) benchmark bundler (>= 2.2.25) netrc (>= 0.11.0) @@ -439,7 +436,7 @@ GEM require-hooks (>= 0.2.2) rubydex (>= 0.1.0.beta10) sorbet-static-and-runtime (>= 0.6.12698) - spoom (>= 1.7.9) + spoom (>= 1.7.16) thor (>= 1.2.0) tsort thor (1.5.0) @@ -477,7 +474,7 @@ GEM event_emitter mutex_m websocket - websocket-driver (0.8.1) + websocket-driver (0.8.2) base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -500,7 +497,7 @@ DEPENDENCIES colorize (~> 1.1) debug devise (~> 5.0) - discordrb (~> 3.7.1) + discordrb (~> 3.8.0) dotenv (~> 3.2.0) erb-formatter faraday (~> 2.14) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f9c569e88..7109c0a30 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true # typed: true +require "sorbet-runtime" require "anilist" require "application_responder" require "turnstile_verifier" diff --git a/app/views/admin/game_ids/index.html.erb b/app/views/admin/game_ids/index.html.erb index fd5253b37..663f8df62 100644 --- a/app/views/admin/game_ids/index.html.erb +++ b/app/views/admin/game_ids/index.html.erb @@ -3,27 +3,31 @@
-
+
- +
- +
- + diff --git a/app/views/admin/users/index.html.erb b/app/views/admin/users/index.html.erb index b7b70b83e..3a7ca7d85 100644 --- a/app/views/admin/users/index.html.erb +++ b/app/views/admin/users/index.html.erb @@ -3,24 +3,28 @@
-
+
- +
- +
- +
diff --git a/package.json b/package.json index 30d033d23..7767dfc08 100644 --- a/package.json +++ b/package.json @@ -36,9 +36,9 @@ "@tailwindcss/aspect-ratio": "^0.4.2", "@tailwindcss/forms": "^0.5.11", "@tailwindcss/typography": "^0.5.20", - "@types/node": "^25.9.3", - "@typescript-eslint/parser": "^8.61.0", - "autoprefixer": "^10.5.0", + "@types/node": "^26.0.1", + "@typescript-eslint/parser": "^8.62.0", + "autoprefixer": "^10.5.2", "cssnano": "^8.0.2", "cssnano-preset-advanced": "^8.0.2", "eslint": "^10.5.0", @@ -47,13 +47,13 @@ "eslint-plugin-import": "^2.32.0", "eslint-plugin-prettier": "^5.5.6", "eslint-plugin-tailwindcss": "^3.18.3", - "globals": "^17.6.0", + "globals": "^17.7.0", "iconify-icon": "^3.0.2", "postcss": "^8.5.15", "postcss-flexbugs-fixes": "^5.0.2", "postcss-import": "^16.1.1", "postcss-preset-env": "^11.3.1", - "prettier": "^3.8.4", + "prettier": "^3.8.5", "rollup-plugin-gzip": "^4.2.0", "rollup-plugin-visualizer": "^7.0.1", "sass-embedded": "1.100.0", @@ -61,13 +61,13 @@ "tailwindcss-animatecss": "^3.0.5", "terser": "^5.48.0", "typescript": "^6.0.3", - "typescript-eslint": "^8.61.1", - "vite": "^8.0.16", + "typescript-eslint": "^8.62.0", + "vite": "^8.1.0", "vite-plugin-full-reload": "^1.2.0", "vite-plugin-ruby": "^5.2.2" }, "engines": { - "node": "24.14.0", + "node": "24.18.0", "npm": ">= 11.8.0" }, "packageManager": "yarn@4.14.1" diff --git a/sorbet/config b/sorbet/config index 40f8a49d8..38d09fefe 100644 --- a/sorbet/config +++ b/sorbet/config @@ -4,3 +4,4 @@ --ignore=vendor/ --suppress-payload-superclass-redefinition-for=Net::IMAP::CommandData --suppress-payload-superclass-redefinition-for=Net::IMAP::Literal +--suppress-payload-superclass-redefinition-for=Net::IMAP::QuotedString diff --git a/sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi b/sorbet/rbi/gems/concurrent-ruby@1.3.7.rbi similarity index 99% rename from sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi rename to sorbet/rbi/gems/concurrent-ruby@1.3.7.rbi index a9d653a0f..33a0c5367 100644 --- a/sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi +++ b/sorbet/rbi/gems/concurrent-ruby@1.3.7.rbi @@ -1990,6 +1990,9 @@ module Concurrent::AtomicNumericCompareAndSetWrapper # # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb:10 def compare_and_set(old_value, new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb:33 + def compare_and_swap(old_value, new_value); end end # An object reference that may be updated atomically. All read and write @@ -2070,14 +2073,14 @@ end # @return [Object] the new value # @raise [Concurrent::ConcurrentUpdateError] if the update fails # -# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:126 +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:133 class Concurrent::AtomicReference < ::Concurrent::MutexAtomicReference - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:133 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:140 def inspect; end # @return [String] Short string representation. # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:129 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:136 def to_s; end end @@ -5260,47 +5263,46 @@ class Concurrent::MutexAtomicReference # @!macro atomic_reference_method_initialize # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:16 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:15 def initialize(value = T.unsafe(nil)); end - # @!macro atomic_reference_method_compare_and_set - # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:45 - def _compare_and_set(old_value, new_value); end - - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:13 - def compare_and_swap(old_value, new_value); end - # @!macro atomic_reference_method_get # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:23 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:22 def get; end # @!macro atomic_reference_method_get_and_set # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:35 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:34 def get_and_set(new_value); end # @!macro atomic_reference_method_set # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:29 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:28 def set(new_value); end - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:42 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:41 def swap(new_value); end - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:26 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:25 def value; end - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:32 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:31 def value=(new_value); end protected # @!visibility private # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:59 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:58 def synchronize; end + + private + + # @!macro atomic_reference_method_compare_and_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:44 + def _compare_and_set(old_value, new_value); end end # @!macro count_down_latch @@ -7620,13 +7622,13 @@ end # # @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantReadWriteLock.html java.util.concurrent.ReentrantReadWriteLock # -# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:31 +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:32 class Concurrent::ReadWriteLock < ::Concurrent::Synchronization::Object extend ::Concurrent::Synchronization::SafeInitialization # Create a new `ReadWriteLock` in the unlocked state. # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:59 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:60 def initialize; end # Acquire a read lock. If a write lock has been acquired will block until @@ -7637,7 +7639,7 @@ class Concurrent::ReadWriteLock < ::Concurrent::Synchronization::Object # @raise [Concurrent::ResourceLimitError] if the maximum number of readers # is exceeded. # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:111 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:113 def acquire_read_lock; end # Acquire a write lock. Will block and wait for all active readers and writers. @@ -7647,28 +7649,33 @@ class Concurrent::ReadWriteLock < ::Concurrent::Synchronization::Object # @raise [Concurrent::ResourceLimitError] if the maximum number of writers # is exceeded. # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:160 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:166 def acquire_write_lock; end # Queries whether any threads are waiting to acquire the read or write lock. # # @return [Boolean] true if any threads are waiting for a lock else false # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:214 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:227 def has_waiters?; end # Release a previously acquired read lock. # # @return [Boolean] true if the lock is successfully released # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:140 + # @raise [Concurrent::IllegalOperationError] if no read lock is currently held. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:144 def release_read_lock; end # Release a previously acquired write lock. # # @return [Boolean] true if the lock is successfully released # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:196 + # @raise [Concurrent::IllegalOperationError] if the write lock is not held + # by the current thread. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:206 def release_write_lock; end # Execute a block operation within a read lock. @@ -7681,7 +7688,7 @@ class Concurrent::ReadWriteLock < ::Concurrent::Synchronization::Object # @raise [Concurrent::ResourceLimitError] if the maximum number of readers # is exceeded. # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:75 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:77 def with_read_lock; end # Execute a block operation within a write lock. @@ -7694,72 +7701,72 @@ class Concurrent::ReadWriteLock < ::Concurrent::Synchronization::Object # @raise [Concurrent::ResourceLimitError] if the maximum number of readers # is exceeded. # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:94 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:96 def with_write_lock; end # Queries if the write lock is held by any thread. # # @return [Boolean] true if the write lock is held else false` # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:207 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:220 def write_locked?; end private # @!visibility private # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:246 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:259 def max_readers?(c = T.unsafe(nil)); end # @!visibility private # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:251 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:264 def max_writers?(c = T.unsafe(nil)); end # @!visibility private # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:221 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:234 def running_readers(c = T.unsafe(nil)); end # @!visibility private # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:226 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:239 def running_readers?(c = T.unsafe(nil)); end # @!visibility private # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:231 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:244 def running_writer?(c = T.unsafe(nil)); end # @!visibility private # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:241 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:254 def waiting_writer?(c = T.unsafe(nil)); end # @!visibility private # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:236 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:249 def waiting_writers(c = T.unsafe(nil)); end end # @!visibility private # -# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:40 +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:41 Concurrent::ReadWriteLock::MAX_READERS = T.let(T.unsafe(nil), Integer) # @!visibility private # -# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:43 +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:44 Concurrent::ReadWriteLock::MAX_WRITERS = T.let(T.unsafe(nil), Integer) # @!visibility private # -# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:37 +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:38 Concurrent::ReadWriteLock::RUNNING_WRITER = T.let(T.unsafe(nil), Integer) # @!visibility private # -# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:34 +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:35 Concurrent::ReadWriteLock::WAITING_WRITER = T.let(T.unsafe(nil), Integer) # Re-entrant read-write lock implementation @@ -7820,7 +7827,7 @@ class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object # @return [Boolean] true if the lock is successfully acquired # # @raise [Concurrent::ResourceLimitError] if the maximum number of readers - # is exceeded. + # or per-thread reentrant acquires is exceeded. # # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:162 def acquire_read_lock; end @@ -7832,21 +7839,21 @@ class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object # @raise [Concurrent::ResourceLimitError] if the maximum number of writers # is exceeded. # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:257 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:264 def acquire_write_lock; end # Release a previously acquired read lock. # # @return [Boolean] true if the lock is successfully released # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:236 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:243 def release_read_lock; end # Release a previously acquired write lock. # # @return [Boolean] true if the lock is successfully released # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:329 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:336 def release_write_lock; end # Try to acquire a read lock and return true if we succeed. If it cannot be @@ -7854,7 +7861,10 @@ class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object # # @return [Boolean] true if the lock is successfully acquired # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:215 + # @raise [Concurrent::ResourceLimitError] if the maximum number of per-thread + # reentrant acquires is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:220 def try_read_lock; end # Try to acquire a write lock and return true if we succeed. If it cannot be @@ -7862,7 +7872,7 @@ class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object # # @return [Boolean] true if the lock is successfully acquired # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:310 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:317 def try_write_lock; end # Execute a block operation within a read lock. @@ -7895,37 +7905,37 @@ class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object # @!visibility private # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:370 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:377 def max_readers?(c = T.unsafe(nil)); end # @!visibility private # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:375 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:382 def max_writers?(c = T.unsafe(nil)); end # @!visibility private # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:345 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:352 def running_readers(c = T.unsafe(nil)); end # @!visibility private # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:350 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:357 def running_readers?(c = T.unsafe(nil)); end # @!visibility private # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:355 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:362 def running_writer?(c = T.unsafe(nil)); end # @!visibility private # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:365 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:372 def waiting_or_running_writer?(c = T.unsafe(nil)); end # @!visibility private # - # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:360 + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:367 def waiting_writers(c = T.unsafe(nil)); end end diff --git a/sorbet/rbi/gems/crass@1.0.6.rbi b/sorbet/rbi/gems/crass@1.0.7.rbi similarity index 64% rename from sorbet/rbi/gems/crass@1.0.6.rbi rename to sorbet/rbi/gems/crass@1.0.7.rbi index ef7740f90..e5d241217 100644 --- a/sorbet/rbi/gems/crass@1.0.6.rbi +++ b/sorbet/rbi/gems/crass@1.0.7.rbi @@ -12,55 +12,66 @@ module Crass class << self # Parses _input_ as a CSS stylesheet and returns a parse tree. # - # See {Tokenizer#initialize} for _options_. + # Options: + # + # * **:maximum_depth** - Maximum nesting depth for simple blocks and + # functions. Constructs nested more deeply than this are discarded to + # prevent stack exhaustion. Defaults to {Parser::DEFAULT_MAXIMUM_DEPTH}. + # + # * **:preserve_comments** - If `true`, comments will be preserved as + # `:comment` tokens. + # + # * **:preserve_hacks** - If `true`, certain non-standard browser hacks + # such as the IE "*" hack will be preserved even though they violate + # CSS 3 syntax rules. # - # pkg:gem/crass#lib/crass.rb:10 + # pkg:gem/crass#lib/crass.rb:22 def parse(input, options = T.unsafe(nil)); end # Parses _input_ as a string of CSS properties (such as the contents of an # HTML element's `style` attribute) and returns a parse tree. # - # See {Tokenizer#initialize} for _options_. + # See {Crass.parse} for _options_. # - # pkg:gem/crass#lib/crass.rb:18 + # pkg:gem/crass#lib/crass.rb:30 def parse_properties(input, options = T.unsafe(nil)); end end end # Parses a CSS string or list of tokens. # -# 5. http://dev.w3.org/csswg/css-syntax/#parsing +# 5. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parsing # # pkg:gem/crass#lib/crass/parser.rb:10 class Crass::Parser # Initializes a parser based on the given _input_, which may be a CSS string # or an array of tokens. # - # See {Tokenizer#initialize} for _options_. + # See {Crass.parse} for _options_. # - # pkg:gem/crass#lib/crass/parser.rb:126 + # pkg:gem/crass#lib/crass/parser.rb:140 def initialize(input, options = T.unsafe(nil)); end # Consumes an at-rule and returns it. # - # 5.4.2. http://dev.w3.org/csswg/css-syntax-3/#consume-at-rule + # 5.4.2. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-at-rule # - # pkg:gem/crass#lib/crass/parser.rb:137 + # pkg:gem/crass#lib/crass/parser.rb:153 def consume_at_rule(input = T.unsafe(nil)); end # Consumes a component value and returns it, or `nil` if there are no more # tokens. # - # 5.4.6. http://dev.w3.org/csswg/css-syntax-3/#consume-a-component-value + # 5.4.6. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-component-value # - # pkg:gem/crass#lib/crass/parser.rb:184 + # pkg:gem/crass#lib/crass/parser.rb:200 def consume_component_value(input = T.unsafe(nil)); end # Consumes a declaration and returns it, or `nil` on parse error. # - # 5.4.5. http://dev.w3.org/csswg/css-syntax-3/#consume-a-declaration + # 5.4.5. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-declaration # - # pkg:gem/crass#lib/crass/parser.rb:209 + # pkg:gem/crass#lib/crass/parser.rb:225 def consume_declaration(input = T.unsafe(nil)); end # Consumes a list of declarations and returns them. @@ -73,44 +84,44 @@ class Crass::Parser # * **:strict** - Set to `true` to exclude non-standard `:comment`, # `:semicolon`, and `:whitespace` nodes. # - # 5.4.4. http://dev.w3.org/csswg/css-syntax/#consume-a-list-of-declarations + # 5.4.4. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-list-of-declarations # - # pkg:gem/crass#lib/crass/parser.rb:276 + # pkg:gem/crass#lib/crass/parser.rb:292 def consume_declarations(input = T.unsafe(nil), options = T.unsafe(nil)); end # Consumes a function and returns it. # - # 5.4.8. http://dev.w3.org/csswg/css-syntax-3/#consume-a-function + # 5.4.8. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-function # - # pkg:gem/crass#lib/crass/parser.rb:326 + # pkg:gem/crass#lib/crass/parser.rb:342 def consume_function(input = T.unsafe(nil)); end # Consumes a qualified rule and returns it, or `nil` if a parse error # occurs. # - # 5.4.3. http://dev.w3.org/csswg/css-syntax-3/#consume-a-qualified-rule + # 5.4.3. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-qualified-rule # - # pkg:gem/crass#lib/crass/parser.rb:357 + # pkg:gem/crass#lib/crass/parser.rb:383 def consume_qualified_rule(input = T.unsafe(nil)); end # Consumes a list of rules and returns them. # - # 5.4.1. http://dev.w3.org/csswg/css-syntax/#consume-a-list-of-rules + # 5.4.1. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-list-of-rules # - # pkg:gem/crass#lib/crass/parser.rb:398 + # pkg:gem/crass#lib/crass/parser.rb:424 def consume_rules(flags = T.unsafe(nil)); end # Consumes and returns a simple block associated with the current input # token. # - # 5.4.7. http://dev.w3.org/csswg/css-syntax/#consume-a-simple-block + # 5.4.7. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-simple-block # - # pkg:gem/crass#lib/crass/parser.rb:434 + # pkg:gem/crass#lib/crass/parser.rb:460 def consume_simple_block(input = T.unsafe(nil)); end # Creates and returns a new parse node with the given _properties_. # - # pkg:gem/crass#lib/crass/parser.rb:458 + # pkg:gem/crass#lib/crass/parser.rb:526 def create_node(type, properties = T.unsafe(nil)); end # Parses the given _input_ tokens into a selector node and returns it. @@ -118,98 +129,110 @@ class Crass::Parser # Doesn't bother splitting the selector list into individual selectors or # validating them. Feel free to do that yourself! It'll be fun! # - # pkg:gem/crass#lib/crass/parser.rb:466 + # pkg:gem/crass#lib/crass/parser.rb:534 def create_selector(input); end # Creates a `:style_rule` node from the given qualified _rule_, and returns # it. # - # pkg:gem/crass#lib/crass/parser.rb:474 + # pkg:gem/crass#lib/crass/parser.rb:542 def create_style_rule(rule); end + # Discards an over-nested simple block or function without recursing, then + # returns an `:error` node. Assumes `input.current` is the opening token (a + # `{`, `[`, `(`, or function token). + # + # This is reached only when the configured maximum nesting depth is + # exceeded. It iteratively consumes tokens up to the matching closing token + # (tracking nested blocks and functions with an explicit stack) so that a + # deeply nested construct can't exhaust the Ruby stack. + # + # pkg:gem/crass#lib/crass/parser.rb:501 + def discard_block(input); end + # Parses a single component value and returns it. # - # 5.3.7. http://dev.w3.org/csswg/css-syntax-3/#parse-a-component-value + # 5.3.7. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parse-a-component-value # - # pkg:gem/crass#lib/crass/parser.rb:483 + # pkg:gem/crass#lib/crass/parser.rb:551 def parse_component_value(input = T.unsafe(nil)); end # Parses a list of component values and returns an array of parsed tokens. # - # 5.3.8. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-component-values + # 5.3.8. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parse-a-list-of-component-values # - # pkg:gem/crass#lib/crass/parser.rb:510 + # pkg:gem/crass#lib/crass/parser.rb:578 def parse_component_values(input = T.unsafe(nil)); end # Parses a single declaration and returns it. # - # 5.3.5. http://dev.w3.org/csswg/css-syntax/#parse-a-declaration + # 5.3.5. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parse-a-declaration # - # pkg:gem/crass#lib/crass/parser.rb:524 + # pkg:gem/crass#lib/crass/parser.rb:592 def parse_declaration(input = T.unsafe(nil)); end # Parses a list of declarations and returns them. # # See {#consume_declarations} for _options_. # - # 5.3.6. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-declarations + # 5.3.6. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parse-a-list-of-declarations # - # pkg:gem/crass#lib/crass/parser.rb:552 + # pkg:gem/crass#lib/crass/parser.rb:620 def parse_declarations(input = T.unsafe(nil), options = T.unsafe(nil)); end # Parses a list of declarations and returns an array of `:property` nodes # (and any non-declaration nodes that were in the input). This is useful for # parsing the contents of an HTML element's `style` attribute. # - # pkg:gem/crass#lib/crass/parser.rb:560 + # pkg:gem/crass#lib/crass/parser.rb:628 def parse_properties(input = T.unsafe(nil)); end # Parses a single rule and returns it. # - # 5.3.4. http://dev.w3.org/csswg/css-syntax-3/#parse-a-rule + # 5.3.4. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parse-a-rule # - # pkg:gem/crass#lib/crass/parser.rb:586 + # pkg:gem/crass#lib/crass/parser.rb:654 def parse_rule(input = T.unsafe(nil)); end # Returns the unescaped value of a selector name or property declaration. # - # pkg:gem/crass#lib/crass/parser.rb:615 + # pkg:gem/crass#lib/crass/parser.rb:683 def parse_value(nodes); end # {TokenScanner} wrapping the tokens generated from this parser's input. # - # pkg:gem/crass#lib/crass/parser.rb:120 + # pkg:gem/crass#lib/crass/parser.rb:134 def tokens; end class << self # Parses CSS properties (such as the contents of an HTML element's `style` # attribute) and returns a parse tree. # - # See {Tokenizer#initialize} for _options_. + # See {Crass.parse} for _options_. # - # 5.3.6. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-declarations + # 5.3.6. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parse-a-list-of-declarations # - # pkg:gem/crass#lib/crass/parser.rb:25 + # pkg:gem/crass#lib/crass/parser.rb:39 def parse_properties(input, options = T.unsafe(nil)); end # Parses CSS rules (such as the content of a `@media` block) and returns a # parse tree. The only difference from {parse_stylesheet} is that CDO/CDC # nodes (``) aren't ignored. # - # See {Tokenizer#initialize} for _options_. + # See {Crass.parse} for _options_. # - # 5.3.3. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-rules + # 5.3.3. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parse-a-list-of-rules # - # pkg:gem/crass#lib/crass/parser.rb:36 + # pkg:gem/crass#lib/crass/parser.rb:50 def parse_rules(input, options = T.unsafe(nil)); end # Parses a CSS stylesheet and returns a parse tree. # - # See {Tokenizer#initialize} for _options_. + # See {Crass.parse} for _options_. # - # 5.3.2. http://dev.w3.org/csswg/css-syntax/#parse-a-stylesheet + # 5.3.2. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parse-a-stylesheet # - # pkg:gem/crass#lib/crass/parser.rb:54 + # pkg:gem/crass#lib/crass/parser.rb:68 def parse_stylesheet(input, options = T.unsafe(nil)); end # Converts a node or array of nodes into a CSS string based on their @@ -219,7 +242,7 @@ class Crass::Parser # # * **:exclude_comments** - When `true`, comments will be excluded. # - # pkg:gem/crass#lib/crass/parser.rb:74 + # pkg:gem/crass#lib/crass/parser.rb:88 def stringify(nodes, options = T.unsafe(nil)); end end end @@ -227,6 +250,22 @@ end # pkg:gem/crass#lib/crass/parser.rb:11 Crass::Parser::BLOCK_END_TOKENS = T.let(T.unsafe(nil), Hash) +# Default maximum nesting depth for simple blocks and functions. This is far +# higher than any legitimate CSS needs, but far below the depth at which +# Ruby would raise `SystemStackError` while recursively parsing nested +# constructs. +# +# Keeping this low also bounds memory usage: each nested simple block and +# function retains a `:tokens` array spanning its descendants for +# serialization, so the total serialization metadata grows with nesting +# depth. A modest limit prevents deeply nested (but otherwise valid) input +# from amplifying memory disproportionately. +# +# It can be overridden with the `:maximum_depth` option. +# +# pkg:gem/crass#lib/crass/parser.rb:29 +Crass::Parser::DEFAULT_MAXIMUM_DEPTH = T.let(T.unsafe(nil), Integer) + # Similar to a StringScanner, but with extra functionality needed to tokenize # CSS while preserving the original text. # @@ -234,20 +273,20 @@ Crass::Parser::BLOCK_END_TOKENS = T.let(T.unsafe(nil), Hash) class Crass::Scanner # Creates a Scanner instance for the given _input_ string or IO instance. # - # pkg:gem/crass#lib/crass/scanner.rb:25 + # pkg:gem/crass#lib/crass/scanner.rb:29 def initialize(input); end # Consumes the next character and returns it, advancing the pointer, or # an empty string if the end of the string has been reached. # - # pkg:gem/crass#lib/crass/scanner.rb:34 + # pkg:gem/crass#lib/crass/scanner.rb:38 def consume; end # Consumes the rest of the string and returns it, advancing the pointer to # the end of the string. Returns an empty string is the end of the string # has already been reached. # - # pkg:gem/crass#lib/crass/scanner.rb:46 + # pkg:gem/crass#lib/crass/scanner.rb:50 def consume_rest; end # Current character, or `nil` if the scanner hasn't yet consumed a @@ -259,19 +298,19 @@ class Crass::Scanner # Returns `true` if the end of the string has been reached, `false` # otherwise. # - # pkg:gem/crass#lib/crass/scanner.rb:57 + # pkg:gem/crass#lib/crass/scanner.rb:66 def eos?; end # Sets the marker to the position of the next character that will be # consumed. # - # pkg:gem/crass#lib/crass/scanner.rb:63 + # pkg:gem/crass#lib/crass/scanner.rb:72 def mark; end # Returns the substring between {#marker} and {#pos}, without altering the # pointer. # - # pkg:gem/crass#lib/crass/scanner.rb:69 + # pkg:gem/crass#lib/crass/scanner.rb:79 def marked; end # Current marker position. Use {#marked} to get the substring between @@ -290,50 +329,58 @@ class Crass::Scanner # doesn't consume them. The number of characters returned may be less than # _length_ if the end of the string is reached. # - # pkg:gem/crass#lib/crass/scanner.rb:80 + # pkg:gem/crass#lib/crass/scanner.rb:91 def peek(length = T.unsafe(nil)); end # Position of the next character that will be consumed. This is a character # position, not a byte position, so it accounts for multi-byte characters. # - # pkg:gem/crass#lib/crass/scanner.rb:19 + # Byte offsets (used internally for fast substring extraction) are tracked + # separately by the underlying StringScanner, whose `pos` always reflects + # the byte offset corresponding to this character position. + # + # pkg:gem/crass#lib/crass/scanner.rb:23 def pos; end # Position of the next character that will be consumed. This is a character # position, not a byte position, so it accounts for multi-byte characters. # - # pkg:gem/crass#lib/crass/scanner.rb:19 + # Byte offsets (used internally for fast substring extraction) are tracked + # separately by the underlying StringScanner, whose `pos` always reflects + # the byte offset corresponding to this character position. + # + # pkg:gem/crass#lib/crass/scanner.rb:23 def pos=(_arg0); end # Moves the pointer back one character without changing the value of # {#current}. The next call to {#consume} will re-consume the current # character. # - # pkg:gem/crass#lib/crass/scanner.rb:87 + # pkg:gem/crass#lib/crass/scanner.rb:103 def reconsume; end # Resets the pointer to the beginning of the string. # - # pkg:gem/crass#lib/crass/scanner.rb:93 + # pkg:gem/crass#lib/crass/scanner.rb:109 def reset; end # Tries to match _pattern_ at the current position. If it matches, the # matched substring will be returned and the pointer will be advanced. # Otherwise, `nil` will be returned. # - # pkg:gem/crass#lib/crass/scanner.rb:103 + # pkg:gem/crass#lib/crass/scanner.rb:122 def scan(pattern); end # Scans the string until the _pattern_ is matched. Returns the substring up # to and including the end of the match, and advances the pointer. If there # is no match, `nil` is returned and the pointer is not advanced. # - # pkg:gem/crass#lib/crass/scanner.rb:115 + # pkg:gem/crass#lib/crass/scanner.rb:134 def scan_until(pattern); end # String being scanned. # - # pkg:gem/crass#lib/crass/scanner.rb:22 + # pkg:gem/crass#lib/crass/scanner.rb:26 def string; end end @@ -386,7 +433,7 @@ end # Tokenizes a CSS string. # -# 4. http://dev.w3.org/csswg/css-syntax/#tokenization +# 4. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#tokenization # # pkg:gem/crass#lib/crass/tokenizer.rb:9 class Crass::Tokenizer @@ -406,23 +453,23 @@ class Crass::Tokenizer # Consumes a token and returns the token that was consumed. # - # 4.3.1. http://dev.w3.org/csswg/css-syntax/#consume-a-token + # 4.3.1. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-token # # pkg:gem/crass#lib/crass/tokenizer.rb:70 def consume; end # Consumes the remnants of a bad URL and returns the consumed text. # - # 4.3.15. http://dev.w3.org/csswg/css-syntax/#consume-the-remnants-of-a-bad-url + # 4.3.15. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-the-remnants-of-a-bad-url # - # pkg:gem/crass#lib/crass/tokenizer.rb:275 + # pkg:gem/crass#lib/crass/tokenizer.rb:276 def consume_bad_url; end # Consumes comments and returns them, or `nil` if no comments were consumed. # - # 4.3.2. http://dev.w3.org/csswg/css-syntax/#consume-comments + # 4.3.2. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-comments # - # pkg:gem/crass#lib/crass/tokenizer.rb:301 + # pkg:gem/crass#lib/crass/tokenizer.rb:302 def consume_comments; end # Consumes an escaped code point and returns its unescaped value. @@ -431,114 +478,114 @@ class Crass::Tokenizer # next character in the input has already been verified not to be a newline # or EOF. # - # 4.3.8. http://dev.w3.org/csswg/css-syntax/#consume-an-escaped-code-point + # 4.3.8. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-an-escaped-code-point # - # pkg:gem/crass#lib/crass/tokenizer.rb:326 + # pkg:gem/crass#lib/crass/tokenizer.rb:327 def consume_escaped; end # Consumes an ident-like token and returns it. # - # 4.3.4. http://dev.w3.org/csswg/css-syntax/#consume-an-ident-like-token + # 4.3.4. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-an-ident-like-token # - # pkg:gem/crass#lib/crass/tokenizer.rb:350 + # pkg:gem/crass#lib/crass/tokenizer.rb:351 def consume_ident; end # Consumes a name and returns it. # - # 4.3.12. http://dev.w3.org/csswg/css-syntax/#consume-a-name + # 4.3.12. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-name # - # pkg:gem/crass#lib/crass/tokenizer.rb:375 + # pkg:gem/crass#lib/crass/tokenizer.rb:376 def consume_name; end # Consumes a number and returns a 3-element array containing the number's # original representation, its numeric value, and its type (either # `:integer` or `:number`). # - # 4.3.13. http://dev.w3.org/csswg/css-syntax/#consume-a-number + # 4.3.13. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-number # - # pkg:gem/crass#lib/crass/tokenizer.rb:407 + # pkg:gem/crass#lib/crass/tokenizer.rb:408 def consume_number; end # Consumes a numeric token and returns it. # - # 4.3.3. http://dev.w3.org/csswg/css-syntax/#consume-a-numeric-token + # 4.3.3. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-numeric-token # - # pkg:gem/crass#lib/crass/tokenizer.rb:430 + # pkg:gem/crass#lib/crass/tokenizer.rb:431 def consume_numeric; end # Consumes a string token that ends at the given character, and returns the # token. # - # 4.3.5. http://dev.w3.org/csswg/css-syntax/#consume-a-string-token + # 4.3.5. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-string-token # - # pkg:gem/crass#lib/crass/tokenizer.rb:469 + # pkg:gem/crass#lib/crass/tokenizer.rb:470 def consume_string(ending = T.unsafe(nil)); end # Consumes a Unicode range token and returns it. Assumes the initial "u+" or # "U+" has already been consumed. # - # 4.3.7. http://dev.w3.org/csswg/css-syntax/#consume-a-unicode-range-token + # 4.3.7. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-unicode-range-token # - # pkg:gem/crass#lib/crass/tokenizer.rb:510 + # pkg:gem/crass#lib/crass/tokenizer.rb:511 def consume_unicode_range; end # Consumes a URL token and returns it. Assumes the original "url(" has # already been consumed. # - # 4.3.6. http://dev.w3.org/csswg/css-syntax/#consume-a-url-token + # 4.3.6. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-url-token # - # pkg:gem/crass#lib/crass/tokenizer.rb:542 + # pkg:gem/crass#lib/crass/tokenizer.rb:543 def consume_url; end # Converts a valid CSS number string into a number and returns the number. # - # 4.3.14. http://dev.w3.org/csswg/css-syntax/#convert-a-string-to-a-number + # 4.3.14. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#convert-a-string-to-a-number # - # pkg:gem/crass#lib/crass/tokenizer.rb:590 + # pkg:gem/crass#lib/crass/tokenizer.rb:591 def convert_string_to_number(str); end # Creates and returns a new token with the given _properties_. # - # pkg:gem/crass#lib/crass/tokenizer.rb:616 + # pkg:gem/crass#lib/crass/tokenizer.rb:643 def create_token(type, properties = T.unsafe(nil)); end # Preprocesses _input_ to prepare it for the tokenizer. # - # 3.3. http://dev.w3.org/csswg/css-syntax/#input-preprocessing + # 3.3. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#input-preprocessing # - # pkg:gem/crass#lib/crass/tokenizer.rb:627 + # pkg:gem/crass#lib/crass/tokenizer.rb:654 def preprocess(input); end # Returns `true` if the given three-character _text_ would start an # identifier. If _text_ is `nil`, the current and next two characters in the # input stream will be checked, but will not be consumed. # - # 4.3.10. http://dev.w3.org/csswg/css-syntax/#would-start-an-identifier + # 4.3.10. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#would-start-an-identifier # - # pkg:gem/crass#lib/crass/tokenizer.rb:642 + # pkg:gem/crass#lib/crass/tokenizer.rb:669 def start_identifier?(text = T.unsafe(nil)); end # Returns `true` if the given three-character _text_ would start a number. # If _text_ is `nil`, the current and next two characters in the input # stream will be checked, but will not be consumed. # - # 4.3.11. http://dev.w3.org/csswg/css-syntax/#starts-with-a-number + # 4.3.11. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#starts-with-a-number # - # pkg:gem/crass#lib/crass/tokenizer.rb:666 + # pkg:gem/crass#lib/crass/tokenizer.rb:693 def start_number?(text = T.unsafe(nil)); end # Tokenizes the input stream and returns an array of tokens. # - # pkg:gem/crass#lib/crass/tokenizer.rb:685 + # pkg:gem/crass#lib/crass/tokenizer.rb:712 def tokenize; end # Returns `true` if the given two-character _text_ is the beginning of a # valid escape sequence. If _text_ is `nil`, the current and next character # in the input stream will be checked, but will not be consumed. # - # 4.3.9. http://dev.w3.org/csswg/css-syntax/#starts-with-a-valid-escape + # 4.3.9. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#starts-with-a-valid-escape # - # pkg:gem/crass#lib/crass/tokenizer.rb:702 + # pkg:gem/crass#lib/crass/tokenizer.rb:729 def valid_escape?(text = T.unsafe(nil)); end class << self diff --git a/sorbet/rbi/gems/discordrb-webhooks@3.7.2.rbi b/sorbet/rbi/gems/discordrb-webhooks@3.8.0.rbi similarity index 55% rename from sorbet/rbi/gems/discordrb-webhooks@3.7.2.rbi rename to sorbet/rbi/gems/discordrb-webhooks@3.8.0.rbi index f11a9bc4b..54cd03235 100644 --- a/sorbet/rbi/gems/discordrb-webhooks@3.7.2.rbi +++ b/sorbet/rbi/gems/discordrb-webhooks@3.8.0.rbi @@ -589,21 +589,31 @@ end # # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:4 class Discordrb::Webhooks::Modal - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:60 + # @!visibility private + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:252 def initialize; end - # Add a new ActionRow to the view - # @yieldparam [RowBuilder] + # Add a label component to the view. + # @see LabelBuilder#initialize # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:68 - def row; end + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:265 + def label(*_arg0, **_arg1, &_arg2); end - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:58 - def rows; end + # @deprecated Please use {#label} instead. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:276 + def row(*_arg0, **_arg1, &_arg2); end + + # Add a text display component to the view. + # @see Webhooks::View::TextDisplayBuilder#initialize + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:271 + def text_display(*_arg0, **_arg1, &_arg2); end # @!visibility private # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:77 + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:259 def to_a; end end @@ -612,41 +622,194 @@ end # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:6 Discordrb::Webhooks::Modal::COMPONENT_TYPES = T.let(T.unsafe(nil), Hash) -# This builder is used when constructing an ActionRow. All current components must be within an action row, but this can -# change in the future. A message can have 5 action rows, each action row can hold a weight of 5. Buttons have a weight of 1, -# and dropdowns have a weight of 5. +# Builder for radio and checkbox groups. # -# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:14 -class Discordrb::Webhooks::Modal::RowBuilder +# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:23 +class Discordrb::Webhooks::Modal::GroupBuilder # @!visibility private # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:22 - def initialize; end + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:25 + def initialize(type, custom_id, id, options = T.unsafe(nil), required = T.unsafe(nil), min_values = T.unsafe(nil), max_values = T.unsafe(nil)); end + + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:57 + def button(value:, label:, description: T.unsafe(nil), default: T.unsafe(nil)); end + + # Add a checkbox component to the group. + # @param value [String] The value that the checkbox represents. + # @param label [String] The primary text of the checkbox. + # @param description [String, nil] The description of the checkbox. + # @param default [true, false, nil] Whether or not the checkbox should be checked by default. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:40 + def checkbox(value:, label:, description: T.unsafe(nil), default: T.unsafe(nil)); end + + # Add a radio button component to the group. + # @param value [String] The value that the radio button represents. + # @param label [String] The primary text of the radio button. + # @param description [String, nil] The description of the radio button. + # @param default [true, false, nil] Whether or not the radio button should be selected by default. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:51 + def radio_button(value:, label:, description: T.unsafe(nil), default: T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:60 + def to_h; end +end + +# This builder is used when adding a label component to a modal. +# +# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:74 +class Discordrb::Webhooks::Modal::LabelBuilder + # Create a label component. + # @param label [String, nil] The label of the label component. This + # field should always be passed, and will be required in 4.0. + # @param id [Integer, nil] The unique 32-bit ID of the label component. + # @param description [String, nil] The description of the label component. + # @yieldparam builder [LabelBuilder] Yields the initialized label component. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:87 + def initialize(label: T.unsafe(nil), id: T.unsafe(nil), description: T.unsafe(nil)); end + + # Add a select channel to the label component. + # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. + # There is a limit of 100 characters to each custom_id. + # @param id [Integer, nil] The unique 32-bit ID of the channel select. This is not to be confused with the `custom_id`. + # @param placeholder [String, nil] Default text to show when no entries are selected. + # @param min_values [Integer, nil] The minimum amount of values a user must select. + # @param max_values [Integer, nil] The maximum amount of values a user can select. + # @param required [true, false, nil] Whether a value must be selected for the component. + # @param types [Array, nil] The channel types to include in the select menu. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:187 + def channel_select(custom_id:, id: T.unsafe(nil), placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), required: T.unsafe(nil), types: T.unsafe(nil)); end + + # Add a standalone checkbox component to the label component. + # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. + # There is a limit of 100 characters to each custom_id. + # @param id [Integer, nil] The unique 32-bit ID of the checkbox component. This is not to be confused with the `custom_id`. + # @param default [true, false, nil] Whether or not the checkbox is checked by default. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:211 + def checkbox(custom_id:, id: T.unsafe(nil), default: T.unsafe(nil)); end + + # Add a group of checkboxes to the label component. + # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. + # There is a limit of 100 characters to each custom_id. + # @param id [Integer, nil] The unique 32-bit ID of the checkbox group component. This is not to be confused with the `custom_id`. + # @param checkboxes [Array] Checkboxes for the group. Can also be provided via the yielded builder. + # @param min_values [Integer, nil] The minimum number of checkboxes a user must check. + # @param max_values [Integer, nil] The maximum number of checkboxes a user is allowed to check. + # @param required [true, false, nil] Whether or not a checkbox must be checked. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:237 + def checkbox_group(custom_id:, id: T.unsafe(nil), checkboxes: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), required: T.unsafe(nil)); end + + # Add a file upload component to the label component. + # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. + # There is a limit of 100 characters to each custom_id. + # @param id [Integer, nil] The unique 32-bit ID of the file upload component. This is not to be confused with the `custom_id`. + # @param min_values [Integer, nil] The minimum amount of files a user must upload. + # @param max_values [Integer, nil] The maximum amount of files a user has to upload. + # @param required [true, false, nil] Whether or not a file must be uploaded to the component. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:202 + def file_upload(custom_id:, id: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), required: T.unsafe(nil)); end + + # Add a select mentionable to the label component. + # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. + # There is a limit of 100 characters to each custom_id. + # @param id [Integer, nil] The unique 32-bit ID of the mentionable select. This is not to be confused with the `custom_id`. + # @param placeholder [String, nil] Default text to show when no entries are selected. + # @param min_values [Integer, nil] The minimum amount of values a user must select. + # @param max_values [Integer, nil] The maximum amount of values a user can select. + # @param required [true, false, nil] Whether a value must be selected for the component. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:174 + def mentionable_select(custom_id:, id: T.unsafe(nil), placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), required: T.unsafe(nil)); end + + # Add a group of radio buttons to the label component. + # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. + # There is a limit of 100 characters to each custom_id. + # @param id [Integer, nil] The unique 32-bit ID of the radio group component. This is not to be confused with the `custom_id`. + # @param buttons [Array] Radio buttons for the group. Can also be provided via the yielded builder. + # @param required [true, false, nil] Whether or not a radio button in the group must be selected. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:221 + def radio_group(custom_id:, id: T.unsafe(nil), buttons: T.unsafe(nil), required: T.unsafe(nil)); end + + # Add a select role to the label component. + # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. + # There is a limit of 100 characters to each custom_id. + # @param id [Integer, nil] The unique 32-bit ID of the role select. This is not to be confused with the `custom_id`. + # @param placeholder [String, nil] Default text to show when no entries are selected. + # @param min_values [Integer, nil] The minimum amount of values a user must select. + # @param max_values [Integer, nil] The maximum amount of values a user can select. + # @param required [true, false, nil] Whether a value must be selected for the component. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:162 + def role_select(custom_id:, id: T.unsafe(nil), placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), required: T.unsafe(nil)); end - # Add a text input to this action row. + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:140 + def select_menu(custom_id:, id: T.unsafe(nil), options: T.unsafe(nil), placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), required: T.unsafe(nil)); end + + # Add a string select menu to the label component. + # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. + # There is a limit of 100 characters to each custom_id. + # @param id [Integer, nil] The unique 32-bit ID of the string select. This is not to be confused with the `custom_id`. + # @param options [Array] Options that can be selected in this menu. Can also be provided via the yielded builder. + # @param placeholder [String, nil] Default text to show when no entries are selected. + # @param min_values [Integer, nil] The minimum amount of values a user must select. + # @param max_values [Integer, nil] The maximum amount of values a user can select. + # @param required [true, false, nil] Whether a value must be selected for the component. + # @yieldparam builder [SelectMenuBuilder] The select menu builder is yielded to allow for the modification of attributes. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:132 + def string_select(custom_id:, id: T.unsafe(nil), options: T.unsafe(nil), placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), required: T.unsafe(nil)); end + + # Add a text input to the label component. # @param style [Symbol, Integer] The text input's style type. See {TEXT_INPUT_STYLES} # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. # There is a limit of 100 characters to each custom_id. - # @param label [String, nil] The text label for the field. + # @param id [Integer] The integer ID for this component. This is not to be confused with custom_id. # @param min_length [Integer, nil] The minimum input length for a text input, min 0, max 4000. # @param max_length [Integer, nil] The maximum input length for a text input, min 1, max 4000. # @param required [true, false, nil] Whether this component is required to be filled, default true. # @param value [String, nil] A pre-filled value for this component, max 4000 characters. # @param placeholder [String, nil] Custom placeholder text if the input is empty, max 100 characters + # @param label [String, nil] This parameter is deprecated and will be removed soon. Please pass this argument to {LabelBuilder#initialize} instead. # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:36 - def text_input(style:, custom_id:, label: T.unsafe(nil), min_length: T.unsafe(nil), max_length: T.unsafe(nil), required: T.unsafe(nil), value: T.unsafe(nil), placeholder: T.unsafe(nil)); end + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:106 + def text_input(style:, custom_id:, id: T.unsafe(nil), min_length: T.unsafe(nil), max_length: T.unsafe(nil), required: T.unsafe(nil), value: T.unsafe(nil), placeholder: T.unsafe(nil), label: T.unsafe(nil)); end # @!visibility private # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:53 + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:246 def to_h; end + + # Add a select user to the label component. + # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. + # There is a limit of 100 characters to each custom_id. + # @param id [Integer, nil] The unique 32-bit ID of the user select. This is not to be confused with the `custom_id`. + # @param placeholder [String, nil] Default text to show when no entries are selected. + # @param min_values [Integer, nil] The minimum amount of values a user must select. + # @param max_values [Integer, nil] The maximum amount of values a user can select. + # @param required [true, false, nil] Whether a value must be selected for the component. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:150 + def user_select(custom_id:, id: T.unsafe(nil), placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), required: T.unsafe(nil)); end end -# A mapping of short names to types of input styles. `short` is a single line where `paragraph` is a block. +# A mapping of text input styles to symbol names. `short` is a single line where `paragraph` is a block. # -# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:16 -Discordrb::Webhooks::Modal::RowBuilder::TEXT_INPUT_STYLES = T.let(T.unsafe(nil), Hash) +# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:76 +Discordrb::Webhooks::Modal::LabelBuilder::TEXT_INPUT_STYLES = T.let(T.unsafe(nil), Hash) + +# @deprecated This alias will be removed in future releases. +# +# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/modal.rb:279 +Discordrb::Webhooks::Modal::RowBuilder = Discordrb::Webhooks::Modal::LabelBuilder # The current version of discordrb-webhooks. # @@ -657,21 +820,59 @@ Discordrb::Webhooks::VERSION = T.let(T.unsafe(nil), String) # # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:4 class Discordrb::Webhooks::View - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:174 + # @!visibility private + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:420 def initialize; end - # Add a new ActionRow to the view - # @yieldparam [RowBuilder] + # Add a container component to the view. + # @see ContainerBuilder#initialize + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:459 + def container(*_arg0, **_arg1, &_arg2); end + + # Add a file component to the view. + # @see FileBuilder#initialize + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:439 + def file(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:443 + def file_display(*_arg0, **_arg1, &_arg2); end + + # Add a media gallery component to the view. + # @see MediaGalleryBuilder#initialize # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:182 - def row; end + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:471 + def media_gallery(*_arg0, **_arg1, &_arg2); end - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:172 - def rows; end + # Add a row component to the view. + # @see RowBuilder#initialize + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:433 + def row(*_arg0, **_arg1, &_arg2); end + + # Add a section component to the view. + # @see SectionBuilder#initialize + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:447 + def section(*_arg0, **_arg1, &_arg2); end + + # Add a separator component to the view. + # @see SeparatorBuilder#initialize + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:453 + def separator(*_arg0, **_arg1, &_arg2); end + + # Add a text display component to the view. + # @see TextDisplayBuilder#initialize + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:465 + def text_display(*_arg0, **_arg1, &_arg2); end # @!visibility private # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:191 + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:427 def to_a; end end @@ -681,74 +882,191 @@ end Discordrb::Webhooks::View::BUTTON_STYLES = T.let(T.unsafe(nil), Hash) # Component types. -# @see https://discord.com/developers/docs/interactions/message-components#component-types +# @see https://discord.com/developers/docs/components/reference#component-object-component-types # -# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:16 +# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:22 Discordrb::Webhooks::View::COMPONENT_TYPES = T.let(T.unsafe(nil), Hash) -# This builder is used when constructing an ActionRow. All current components must be within an action row, but this can -# change in the future. A message can have 5 action rows, each action row can hold a weight of 5. Buttons have a weight of 1, +# This builder can be used to construct a container. These are similar to embeds. +# +# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:344 +class Discordrb::Webhooks::View::ContainerBuilder + # Create a container component. + # @param id [Integer, nil] The unique 32-bit ID of the container component. + # @param colour [Array, Integer, String, ColourRGB, nil] The accent colour of the container + # component. This argument can be passed via the American spelling (`color:`) as well. + # @param spoiler [true, false] Whether or not to apply a spoiler label to the container component. + # @yieldparam builder [ContainerBuilder] Yields the initialized container component. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:351 + def initialize(id: T.unsafe(nil), color: T.unsafe(nil), colour: T.unsafe(nil), spoiler: T.unsafe(nil)); end + + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:411 + def color=(colour); end + + # Set the color of the container. + # @param colour [Array, Integer, String, ColourRGB, nil] The accent colour of the container component, or `nil` to clear the accent colour. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:400 + def colour=(colour); end + + # Add a file component to the container. + # @see FileBuilder#initialize + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:368 + def file(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:372 + def file_display(*_arg0, **_arg1, &_arg2); end + + # Add a media gallery component to the container. + # @see MediaGalleryBuilder#initialize + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:394 + def media_gallery(*_arg0, **_arg1, &_arg2); end + + # Add a row component to the container. + # @see RowBuilder#initialize + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:362 + def row(*_arg0, **_arg1, &_arg2); end + + # Add a section component to the container. + # @see SectionBuilder#initialize + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:376 + def section(*_arg0, **_arg1, &_arg2); end + + # Add a separator component to the container. + # @see SeparatorBuilder#initialize + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:382 + def separator(*_arg0, **_arg1, &_arg2); end + + # Add a text display component to the container. + # @see TextDisplayBuilder#initialize + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:388 + def text_display(*_arg0, **_arg1, &_arg2); end + + # @!visibility private + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:414 + def to_h; end +end + +# A file component lets you send a file via an attachment:// reference. +# +# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:243 +class Discordrb::Webhooks::View::FileBuilder + # Create a file component. + # @param url [String] An `attachment://` reference to the attached file. + # @param id [Integer, nil] The unique 32-bit ID of the file component. + # @param spoiler [true, false] Whether or not to apply a spoiler label to the file. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:248 + def initialize(url:, id: T.unsafe(nil), spoiler: T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:255 + def to_h; end +end + +# A media gallery component is a gallery grid. +# +# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:261 +class Discordrb::Webhooks::View::MediaGalleryBuilder + # Create a media gallery component. + # @param id [Integer, nil] The unique 32-bit ID of the media gallery component. + # @yieldparam builder [MediaGalleryBuilder] Yields the initialized media gallery component. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:265 + def initialize(id: T.unsafe(nil)); end + + # Add a gallery item to the media gallery component. + # @param url [String] The URL to the gallery item's media. + # @param description [String, nil] The description of the gallery item. + # @param spoiler [true, false] Whether or not to apply a spoiler label to the gallery item. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:276 + def item(url:, description: T.unsafe(nil), spoiler: T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:281 + def to_h; end +end + +# This builder is used when constructing an ActionRow. Button and select menu components must be within an action row, but this can +# change in the future. A message can have 10 action rows, each action row can hold a weight of 5. Buttons have a weight of 1, # and dropdowns have a weight of 5. # -# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:30 +# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:48 class Discordrb::Webhooks::View::RowBuilder # @!visibility private # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:32 - def initialize; end + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:50 + def initialize(id: T.unsafe(nil)); end # Add a button to this action row. # @param style [Symbol, Integer] The button's style type. See {BUTTON_STYLES} + # @param id [Integer, nil] The unique 32-bit ID of the button component. This is not to be confused with the `custom_id`. # @param label [String, nil] The text label for the button. Either a label or emoji must be provided. - # @param emoji [#to_h, String, Integer] An emoji ID, or unicode emoji to attach to the button. Can also be a object + # @param emoji [#to_h, String, Integer] An emoji ID, or unicode emoji to attach to the button. Can also be an object # that responds to `#to_h` which returns a hash in the format of `{ id: Integer, name: string }`. # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. # There is a limit of 100 characters to each custom_id. # @param disabled [true, false] Whether this button is disabled and shown as greyed out. # @param url [String, nil] The URL, when using a link style button. # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:45 - def button(style:, label: T.unsafe(nil), emoji: T.unsafe(nil), custom_id: T.unsafe(nil), disabled: T.unsafe(nil), url: T.unsafe(nil)); end + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:67 + def button(style:, id: T.unsafe(nil), label: T.unsafe(nil), emoji: T.unsafe(nil), custom_id: T.unsafe(nil), disabled: T.unsafe(nil), url: T.unsafe(nil)); end # Add a select channel to this action row. # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. # There is a limit of 100 characters to each custom_id. + # @param id [Integer, nil] The unique 32-bit ID of the channel select. This is not to be confused with the `custom_id`. # @param placeholder [String, nil] Default text to show when no entries are selected. # @param min_values [Integer, nil] The minimum amount of values a user must select. # @param max_values [Integer, nil] The maximum amount of values a user can select. # @param disabled [true, false, nil] Grey out the component to make it unusable. + # @param types [Array, nil] The channel types to include in the select menu. # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:117 - def channel_select(custom_id:, placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), disabled: T.unsafe(nil)); end + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:145 + def channel_select(custom_id:, id: T.unsafe(nil), placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), disabled: T.unsafe(nil), types: T.unsafe(nil)); end # Add a select mentionable to this action row. # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. # There is a limit of 100 characters to each custom_id. + # @param id [Integer, nil] The unique 32-bit ID of the mentionable select. This is not to be confused with the `custom_id`. # @param placeholder [String, nil] Default text to show when no entries are selected. # @param min_values [Integer, nil] The minimum amount of values a user must select. # @param max_values [Integer, nil] The maximum amount of values a user can select. # @param disabled [true, false, nil] Grey out the component to make it unusable. # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:106 - def mentionable_select(custom_id:, placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), disabled: T.unsafe(nil)); end + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:132 + def mentionable_select(custom_id:, id: T.unsafe(nil), placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), disabled: T.unsafe(nil)); end # Add a select role to this action row. # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. # There is a limit of 100 characters to each custom_id. + # @param id [Integer, nil] The unique 32-bit ID of the role select. This is not to be confused with the `custom_id`. # @param placeholder [String, nil] Default text to show when no entries are selected. # @param min_values [Integer, nil] The minimum amount of values a user must select. # @param max_values [Integer, nil] The maximum amount of values a user can select. # @param disabled [true, false, nil] Grey out the component to make it unusable. # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:95 - def role_select(custom_id:, placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), disabled: T.unsafe(nil)); end + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:120 + def role_select(custom_id:, id: T.unsafe(nil), placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), disabled: T.unsafe(nil)); end - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:75 - def select_menu(custom_id:, options: T.unsafe(nil), placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), disabled: T.unsafe(nil)); end + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:98 + def select_menu(custom_id:, options: T.unsafe(nil), id: T.unsafe(nil), placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), disabled: T.unsafe(nil)); end - # Add a select string to this action row. + # Add a string select to this action row. # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. # There is a limit of 100 characters to each custom_id. + # @param id [Integer, nil] The unique 32-bit ID of the string select. This is not to be confused with the `custom_id`. # @param options [Array] Options that can be selected in this menu. Can also be provided via the yielded builder. # @param placeholder [String, nil] Default text to show when no entries are selected. # @param min_values [Integer, nil] The minimum amount of values a user must select. @@ -756,48 +1074,135 @@ class Discordrb::Webhooks::View::RowBuilder # @param disabled [true, false, nil] Grey out the component to make it unusable. # @yieldparam builder [SelectMenuBuilder] # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:67 - def string_select(custom_id:, options: T.unsafe(nil), placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), disabled: T.unsafe(nil)); end + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:90 + def string_select(custom_id:, options: T.unsafe(nil), id: T.unsafe(nil), placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), disabled: T.unsafe(nil)); end # @!visibility private # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:122 + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:154 def to_h; end # Add a select user to this action row. # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. # There is a limit of 100 characters to each custom_id. + # @param id [Integer, nil] The unique 32-bit ID of the user select. This is not to be confused with the `custom_id`. # @param placeholder [String, nil] Default text to show when no entries are selected. # @param min_values [Integer, nil] The minimum amount of values a user must select. # @param max_values [Integer, nil] The maximum amount of values a user can select. # @param disabled [true, false, nil] Grey out the component to make it unusable. # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:84 - def user_select(custom_id:, placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), disabled: T.unsafe(nil)); end + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:108 + def user_select(custom_id:, id: T.unsafe(nil), placeholder: T.unsafe(nil), min_values: T.unsafe(nil), max_values: T.unsafe(nil), disabled: T.unsafe(nil)); end +end + +# Possible separator size names and values. +# +# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:15 +Discordrb::Webhooks::View::SEPARATOR_SIZES = T.let(T.unsafe(nil), Hash) + +# A section allows you to group together an accessory with text display components. +# +# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:287 +class Discordrb::Webhooks::View::SectionBuilder + # Create a section component. + # @param id [Integer, nil] The unique 32-bit ID of the section component. + # @yieldparam builder [SectionBuilder] Yields the initialized section component. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:291 + def initialize(id: T.unsafe(nil)); end + + # Set the button for the section. This is mutually exclusive with {#thumbnail}. + # @param style [Symbol, Integer] The button's style type. See {BUTTON_STYLES} + # @param id [Integer, nil] The unique 32-bit ID of the button component. This is not to be confused with the `custom_id`. + # @param label [String, nil] The text label for the button. Either a label or emoji must be provided. + # @param emoji [#to_h, String, Integer] An emoji ID, or unicode emoji to attach to the button. Can also be an object + # that responds to `#to_h` which returns a hash in the format of `{ id: Integer, name: string }`. + # @param custom_id [String] Custom IDs are used to pass state to the events that are raised from interactions. + # There is a limit of 100 characters to each custom_id. + # @param disabled [true, false] Whether this button is disabled and shown as greyed out. + # @param url [String, nil] The URL, when using a link style button. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:324 + def button(style:, id: T.unsafe(nil), label: T.unsafe(nil), emoji: T.unsafe(nil), custom_id: T.unsafe(nil), disabled: T.unsafe(nil), url: T.unsafe(nil)); end + + # Add a text display component to this section. + # @see TextDisplayBuilder#initialize + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:301 + def text_display(*_arg0, **_arg1, &_arg2); end + + # Set the thumbnail for the section. This is mutually exclusive with {#button}. + # @param url [String] The URL to the thumbnail image. + # @param id [Integer, nil] The unique 32-bit ID of the thumbnail component. + # @param description [String, nil] The description of the thumbnail. + # @param spoiler [true, false] Whether or not to apply a spoiler label to the thumbnail. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:310 + def thumbnail(url:, id: T.unsafe(nil), description: T.unsafe(nil), spoiler: T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:338 + def to_h; end end # A builder to assist in adding options to select menus. # -# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:128 +# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:160 class Discordrb::Webhooks::View::SelectMenuBuilder # @!visibility hidden # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:130 - def initialize(custom_id, options = T.unsafe(nil), placeholder = T.unsafe(nil), min_values = T.unsafe(nil), max_values = T.unsafe(nil), disabled = T.unsafe(nil), select_type: T.unsafe(nil)); end + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:162 + def initialize(custom_id, options = T.unsafe(nil), placeholder = T.unsafe(nil), min_values = T.unsafe(nil), max_values = T.unsafe(nil), disabled = T.unsafe(nil), select_type: T.unsafe(nil), id: T.unsafe(nil), required: T.unsafe(nil)); end # Add an option to this select menu. # @param label [String] The title of this option. # @param value [String] The value that this option represents. # @param description [String, nil] An optional description of the option. - # @param emoji [#to_h, String, Integer] An emoji ID, or unicode emoji to attach to the button. Can also be a object + # @param emoji [#to_h, String, Integer] An emoji ID, or unicode emoji to attach to the button. Can also be an object # that responds to `#to_h` which returns a hash in the format of `{ id: Integer, name: string }`. # @param default [true, false, nil] Whether this is the default selected option. # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:147 + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:181 def option(label:, value:, description: T.unsafe(nil), emoji: T.unsafe(nil), default: T.unsafe(nil)); end # @!visibility private # - # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:159 + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:193 + def to_h; end +end + +# A separator allows you to add a barrier between components. +# +# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:225 +class Discordrb::Webhooks::View::SeparatorBuilder + # Create a separator component. + # @param divider [true, false] Whether or not the separator should act as a visible barrier. + # @param id [Integer, nil] The unique 32-bit ID of the separator component. + # @param spacing [Symbol, Integer] The size of the separator component's padding. See {SEPARATOR_SIZES}. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:230 + def initialize(divider:, id: T.unsafe(nil), spacing: T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:237 + def to_h; end +end + +# A text display component allows you to send message content. +# +# pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:209 +class Discordrb::Webhooks::View::TextDisplayBuilder + # Create a text display component. + # @param content [String] The content of the text display component. + # @param id [Integer, nil] The unique 32-bit ID of the text display component. + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:213 + def initialize(content:, id: T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/discordrb-webhooks#lib/discordrb/webhooks/view.rb:219 def to_h; end end diff --git a/sorbet/rbi/gems/discordrb@3.7.2.rbi b/sorbet/rbi/gems/discordrb@3.8.0.rbi similarity index 89% rename from sorbet/rbi/gems/discordrb@3.7.2.rbi rename to sorbet/rbi/gems/discordrb@3.8.0.rbi index 10581be2b..b75514746 100644 --- a/sorbet/rbi/gems/discordrb@3.7.2.rbi +++ b/sorbet/rbi/gems/discordrb@3.8.0.rbi @@ -762,7 +762,7 @@ module Discordrb::API::Channel # Add a user to a thread. # https://discord.com/developers/docs/resources/channel#add-thread-member # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:510 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:525 def add_thread_member(token, channel_id, user_id); end # Delete messages in bulk @@ -865,6 +865,12 @@ module Discordrb::API::Channel # pkg:gem/discordrb#lib/discordrb/api/channel.rb:120 def edit_message(token, channel_id, message_id, message, mentions = T.unsafe(nil), embeds = T.unsafe(nil), components = T.unsafe(nil), flags = T.unsafe(nil)); end + # Follow an annoucement channel. + # https://discord.com/developers/docs/resources/channel#follow-announcement-channel + # + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:469 + def follow_channel(token, channel_id, webhook_channel_id, reason = T.unsafe(nil)); end + # Get a list of clients who reacted with a specific reaction on a message # https://discord.com/developers/docs/resources/channel#get-reactions # @@ -880,7 +886,7 @@ module Discordrb::API::Channel # Add the current user to a thread. # https://discord.com/developers/docs/resources/channel#join-thread # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:497 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:512 def join_thread(token, channel_id); end # Leave a group channel. @@ -893,37 +899,37 @@ module Discordrb::API::Channel # Remove the current user from a thread. # https://discord.com/developers/docs/resources/channel#leave-thread # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:523 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:538 def leave_thread(token, channel_id); end # List active threads # https://discord.com/developers/docs/resources/channel#list-active-threads # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:561 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:576 def list_active_threads(token, channel_id); end # List joined private archived threads. # https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:601 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:616 def list_joined_private_archived_threads(token, channel_id, before = T.unsafe(nil), limit = T.unsafe(nil)); end # List private archived threads. # https://discord.com/developers/docs/resources/channel#list-private-archived-threads # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:587 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:602 def list_private_archived_threads(token, channel_id, before = T.unsafe(nil), limit = T.unsafe(nil)); end # List public archived threads. # https://discord.com/developers/docs/resources/channel#list-public-archived-threads # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:573 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:588 def list_public_archived_threads(token, channel_id, before = T.unsafe(nil), limit = T.unsafe(nil)); end # Get the members of a thread. # https://discord.com/developers/docs/resources/channel#list-thread-members # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:547 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:562 def list_thread_members(token, channel_id, before, limit); end # Get a single message from a channel's history by id @@ -960,7 +966,7 @@ module Discordrb::API::Channel # Remove a user from a thread. # https://discord.com/developers/docs/resources/channel#remove-thread-member # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:535 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:550 def remove_thread_member(token, channel_id, user_id); end # Get a channel's data @@ -972,19 +978,19 @@ module Discordrb::API::Channel # Start a thread in a forum or media channel. # https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:615 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:630 def start_thread_in_forum_or_media_channel(token, channel_id, name, message, attachments = T.unsafe(nil), rate_limit_per_user = T.unsafe(nil), auto_archive_duration = T.unsafe(nil), applied_tags = T.unsafe(nil), reason = T.unsafe(nil)); end # Start a thread based off a channel message. # https://discord.com/developers/docs/resources/channel#start-thread-with-message # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:469 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:484 def start_thread_with_message(token, channel_id, message_id, name, auto_archive_duration); end # Start a thread without an associated message. # https://discord.com/developers/docs/resources/channel#start-thread-without-message # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:483 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:498 def start_thread_without_message(token, channel_id, name, auto_archive_duration, type = T.unsafe(nil)); end # Start typing (needs to be resent every 5 seconds to keep up the typing) @@ -1034,7 +1040,7 @@ module Discordrb::API::Channel # Add a user to a thread. # https://discord.com/developers/docs/resources/channel#add-thread-member # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:510 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:525 def add_thread_member(token, channel_id, user_id); end # Delete messages in bulk @@ -1137,6 +1143,12 @@ module Discordrb::API::Channel # pkg:gem/discordrb#lib/discordrb/api/channel.rb:120 def edit_message(token, channel_id, message_id, message, mentions = T.unsafe(nil), embeds = T.unsafe(nil), components = T.unsafe(nil), flags = T.unsafe(nil)); end + # Follow an annoucement channel. + # https://discord.com/developers/docs/resources/channel#follow-announcement-channel + # + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:469 + def follow_channel(token, channel_id, webhook_channel_id, reason = T.unsafe(nil)); end + # Get a list of clients who reacted with a specific reaction on a message # https://discord.com/developers/docs/resources/channel#get-reactions # @@ -1152,7 +1164,7 @@ module Discordrb::API::Channel # Add the current user to a thread. # https://discord.com/developers/docs/resources/channel#join-thread # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:497 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:512 def join_thread(token, channel_id); end # Leave a group channel. @@ -1165,37 +1177,37 @@ module Discordrb::API::Channel # Remove the current user from a thread. # https://discord.com/developers/docs/resources/channel#leave-thread # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:523 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:538 def leave_thread(token, channel_id); end # List active threads # https://discord.com/developers/docs/resources/channel#list-active-threads # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:561 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:576 def list_active_threads(token, channel_id); end # List joined private archived threads. # https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:601 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:616 def list_joined_private_archived_threads(token, channel_id, before = T.unsafe(nil), limit = T.unsafe(nil)); end # List private archived threads. # https://discord.com/developers/docs/resources/channel#list-private-archived-threads # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:587 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:602 def list_private_archived_threads(token, channel_id, before = T.unsafe(nil), limit = T.unsafe(nil)); end # List public archived threads. # https://discord.com/developers/docs/resources/channel#list-public-archived-threads # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:573 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:588 def list_public_archived_threads(token, channel_id, before = T.unsafe(nil), limit = T.unsafe(nil)); end # Get the members of a thread. # https://discord.com/developers/docs/resources/channel#list-thread-members # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:547 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:562 def list_thread_members(token, channel_id, before, limit); end # Get a single message from a channel's history by id @@ -1232,7 +1244,7 @@ module Discordrb::API::Channel # Remove a user from a thread. # https://discord.com/developers/docs/resources/channel#remove-thread-member # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:535 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:550 def remove_thread_member(token, channel_id, user_id); end # Get a channel's data @@ -1244,19 +1256,19 @@ module Discordrb::API::Channel # Start a thread in a forum or media channel. # https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:615 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:630 def start_thread_in_forum_or_media_channel(token, channel_id, name, message, attachments = T.unsafe(nil), rate_limit_per_user = T.unsafe(nil), auto_archive_duration = T.unsafe(nil), applied_tags = T.unsafe(nil), reason = T.unsafe(nil)); end # Start a thread based off a channel message. # https://discord.com/developers/docs/resources/channel#start-thread-with-message # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:469 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:484 def start_thread_with_message(token, channel_id, message_id, name, auto_archive_duration); end # Start a thread without an associated message. # https://discord.com/developers/docs/resources/channel#start-thread-without-message # - # pkg:gem/discordrb#lib/discordrb/api/channel.rb:483 + # pkg:gem/discordrb#lib/discordrb/api/channel.rb:498 def start_thread_without_message(token, channel_id, name, auto_archive_duration, type = T.unsafe(nil)); end # Start typing (needs to be resent every 5 seconds to keep up the typing) @@ -1325,7 +1337,7 @@ module Discordrb::API::Interaction # https://discord.com/developers/docs/interactions/slash-commands#edit-original-interaction-response # # pkg:gem/discordrb#lib/discordrb/api/interaction.rb:54 - def edit_original_interaction_response(interaction_token, application_id, content = T.unsafe(nil), embeds = T.unsafe(nil), allowed_mentions = T.unsafe(nil), components = T.unsafe(nil), attachments = T.unsafe(nil)); end + def edit_original_interaction_response(interaction_token, application_id, content = T.unsafe(nil), embeds = T.unsafe(nil), allowed_mentions = T.unsafe(nil), components = T.unsafe(nil), attachments = T.unsafe(nil), flags = T.unsafe(nil)); end # Get the original response to an interaction. # https://discord.com/developers/docs/interactions/slash-commands#get-original-interaction-response @@ -1356,7 +1368,7 @@ module Discordrb::API::Interaction # https://discord.com/developers/docs/interactions/slash-commands#edit-original-interaction-response # # pkg:gem/discordrb#lib/discordrb/api/interaction.rb:54 - def edit_original_interaction_response(interaction_token, application_id, content = T.unsafe(nil), embeds = T.unsafe(nil), allowed_mentions = T.unsafe(nil), components = T.unsafe(nil), attachments = T.unsafe(nil)); end + def edit_original_interaction_response(interaction_token, application_id, content = T.unsafe(nil), embeds = T.unsafe(nil), allowed_mentions = T.unsafe(nil), components = T.unsafe(nil), attachments = T.unsafe(nil), flags = T.unsafe(nil)); end # Get the original response to an interaction. # https://discord.com/developers/docs/interactions/slash-commands#get-original-interaction-response @@ -2141,7 +2153,7 @@ module Discordrb::API::Webhook # https://discord.com/developers/docs/resources/webhook#edit-webhook-message # # pkg:gem/discordrb#lib/discordrb/api/webhook.rb:123 - def token_edit_message(webhook_token, webhook_id, message_id, content = T.unsafe(nil), embeds = T.unsafe(nil), allowed_mentions = T.unsafe(nil), components = T.unsafe(nil), attachments = T.unsafe(nil)); end + def token_edit_message(webhook_token, webhook_id, message_id, content = T.unsafe(nil), embeds = T.unsafe(nil), allowed_mentions = T.unsafe(nil), components = T.unsafe(nil), attachments = T.unsafe(nil), flags = T.unsafe(nil)); end # Execute a webhook via token. # https://discord.com/developers/docs/resources/webhook#execute-webhook @@ -2202,7 +2214,7 @@ module Discordrb::API::Webhook # https://discord.com/developers/docs/resources/webhook#edit-webhook-message # # pkg:gem/discordrb#lib/discordrb/api/webhook.rb:123 - def token_edit_message(webhook_token, webhook_id, message_id, content = T.unsafe(nil), embeds = T.unsafe(nil), allowed_mentions = T.unsafe(nil), components = T.unsafe(nil), attachments = T.unsafe(nil)); end + def token_edit_message(webhook_token, webhook_id, message_id, content = T.unsafe(nil), embeds = T.unsafe(nil), allowed_mentions = T.unsafe(nil), components = T.unsafe(nil), attachments = T.unsafe(nil), flags = T.unsafe(nil)); end # Execute a webhook via token. # https://discord.com/developers/docs/resources/webhook#execute-webhook @@ -2574,9 +2586,10 @@ class Discordrb::AllowedMentions # `users` and `roles` allow for all mentions of the respective type to ping. `everyone` allows usage of `@everyone` and `@here` # @param users [Array] Users or user IDs that can be pinged. Cannot be used in conjunction with `"users"` in `parse` # @param roles [Array] Roles or role IDs that can be pinged. Cannot be used in conjunction with `"roles"` in `parse` + # @param replied_user [true, false, nil] For replies, whether to mention the author of the message being replied to. Defaults to no mention # - # pkg:gem/discordrb#lib/discordrb/allowed_mentions.rb:21 - def initialize(parse: T.unsafe(nil), users: T.unsafe(nil), roles: T.unsafe(nil)); end + # pkg:gem/discordrb#lib/discordrb/allowed_mentions.rb:26 + def initialize(parse: T.unsafe(nil), users: T.unsafe(nil), roles: T.unsafe(nil), replied_user: T.unsafe(nil)); end # @return [Array<"users", "roles", "everyone">, nil] # @@ -2588,6 +2601,19 @@ class Discordrb::AllowedMentions # pkg:gem/discordrb#lib/discordrb/allowed_mentions.rb:9 def parse=(_arg0); end + # @return [true, false, nil] + # + # pkg:gem/discordrb#lib/discordrb/allowed_mentions.rb:18 + def replied_user; end + + # @return [true, false, nil] + # + # pkg:gem/discordrb#lib/discordrb/allowed_mentions.rb:18 + def replied_user=(_arg0); end + + # pkg:gem/discordrb#lib/discordrb/allowed_mentions.rb:19 + def replied_user?; end + # @return [Array, nil] # # pkg:gem/discordrb#lib/discordrb/allowed_mentions.rb:15 @@ -2600,7 +2626,7 @@ class Discordrb::AllowedMentions # @!visibility private # - # pkg:gem/discordrb#lib/discordrb/allowed_mentions.rb:28 + # pkg:gem/discordrb#lib/discordrb/allowed_mentions.rb:34 def to_hash; end # @return [Array, nil] @@ -2666,32 +2692,32 @@ end # An ApplicationCommand for slash commands. # -# pkg:gem/discordrb#lib/discordrb/data/interaction.rb:359 +# pkg:gem/discordrb#lib/discordrb/data/interaction.rb:392 class Discordrb::ApplicationCommand # @!visibility private # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:393 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:426 def initialize(data, bot, server_id = T.unsafe(nil)); end # @return [Integer] # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:369 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:402 def application_id; end # @return [true, false] # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:381 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:414 def default_permission; end # Delete this application command. # @return (see Bot#delete_application_command) # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:435 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:468 def delete; end # @return [String] # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:378 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:411 def description; end # @param name [String] The name to use for this command. @@ -2701,136 +2727,136 @@ class Discordrb::ApplicationCommand # @yieldparam (see Bot#edit_application_command) # @return (see Bot#edit_application_command) # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:429 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:462 def edit(name: T.unsafe(nil), description: T.unsafe(nil), default_permission: T.unsafe(nil), nsfw: T.unsafe(nil), &block); end # @return [Integer] # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:387 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:420 def id; end # @param subcommand [String, nil] The subcommand to mention. # @param subcommand_group [String, nil] The subcommand group to mention. # @return [String] the layout to mention it in a message # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:409 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:442 def mention(subcommand_group: T.unsafe(nil), subcommand: T.unsafe(nil)); end # @return [String] # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:375 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:408 def name; end # @return [true, false] # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:390 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:423 def nsfw; end # @return [Hash] # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:384 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:417 def options; end # Get the permission configuration for the this application command on a specific server. # @param server_id [Integer, String, nil] The ID of the server to fetch command permissions for. # @return [Array] the permissions for this application command in the given server. # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:442 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:475 def permissions(server_id: T.unsafe(nil)); end # @return [Integer, nil] # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:372 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:405 def server_id; end - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:421 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:454 def to_s(subcommand_group: T.unsafe(nil), subcommand: T.unsafe(nil)); end end # An application command permission for a channel, member, or a role. # -# pkg:gem/discordrb#lib/discordrb/data/interaction.rb:453 +# pkg:gem/discordrb#lib/discordrb/data/interaction.rb:486 class Discordrb::ApplicationCommand::Permission # @!visibility private # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:472 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:505 def initialize(data, command, bot); end # Whether this permission is applied to every channel in the server. # @return [true, false] # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:509 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:542 def all_channels?; end # Whether this permission has been allowed, e.g has a green check in the UI. # @return [true, false] # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:484 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:517 def allowed?; end - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:535 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:568 def channel?; end # Whether this permission is the default for all commands that don't # contain explicit permission oerwrites. # @return [true, false] # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:503 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:536 def default?; end # Whether this permission has been denied, e.g has a red check in the UI. # @return [true, false] # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:490 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:523 def denied?; end # Whether this permission is applied to the everyone role in the server. # @return [true, false] # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:496 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:529 def everyone?; end - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:535 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:568 def member?; end - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:535 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:568 def role?; end # @return [Integer] the ID of the server this permission is for. # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:469 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:502 def server_id; end # Get the user, role, or channel(s) that this permission targets. # @return [Array, Role, Member] # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:515 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:548 def target; end # @return [Integer] the ID of the thing this permission is for. # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:466 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:499 def target_id; end - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:526 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:559 def targets; end # @return [Integer] the type of this permission. # @see TYPES # - # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:463 + # pkg:gem/discordrb#lib/discordrb/data/interaction.rb:496 def type; end end # Map of permission types. # -# pkg:gem/discordrb#lib/discordrb/data/interaction.rb:455 +# pkg:gem/discordrb#lib/discordrb/data/interaction.rb:488 Discordrb::ApplicationCommand::Permission::TYPES = T.let(T.unsafe(nil), Hash) # Command types. `chat_input` is a command that appears in the text input field. `user` and `message` types appear as context menus # for the respective resource. # -# pkg:gem/discordrb#lib/discordrb/data/interaction.rb:362 +# pkg:gem/discordrb#lib/discordrb/data/interaction.rb:395 Discordrb::ApplicationCommand::TYPES = T.let(T.unsafe(nil), Hash) # An attachment to a message @@ -3274,7 +3300,7 @@ end # Represents a Discord bot, including servers, users, etc. # -# pkg:gem/discordrb#lib/discordrb/bot.rb:43 +# pkg:gem/discordrb#lib/discordrb/bot.rb:44 class Discordrb::Bot include ::Discordrb::Events include ::Discordrb::EventContainer @@ -3322,13 +3348,13 @@ class Discordrb::Bot # exactly all the intents specified in the bitwise value. # @see Discordrb::INTENTS # - # pkg:gem/discordrb#lib/discordrb/bot.rb:114 + # pkg:gem/discordrb#lib/discordrb/bot.rb:115 def initialize(log_mode: T.unsafe(nil), token: T.unsafe(nil), client_id: T.unsafe(nil), type: T.unsafe(nil), name: T.unsafe(nil), fancy_log: T.unsafe(nil), suppress_ready: T.unsafe(nil), parse_self: T.unsafe(nil), shard_id: T.unsafe(nil), num_shards: T.unsafe(nil), redact_token: T.unsafe(nil), ignore_bots: T.unsafe(nil), compress_mode: T.unsafe(nil), intents: T.unsafe(nil)); end # Makes the bot join an invite to a server. # @param invite [String, Invite] The invite to join. For possible formats see {#resolve_invite_code}. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:302 + # pkg:gem/discordrb#lib/discordrb/bot.rb:309 def accept_invite(invite); end # Add an await the bot should listen to. For information on awaits, see {Await}. @@ -3340,7 +3366,7 @@ class Discordrb::Bot # @return [Await] The await that was created. # @deprecated Will be changed to blocking behavior in v4.0. Use {#add_await!} instead. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:684 + # pkg:gem/discordrb#lib/discordrb/bot.rb:691 def add_await(key, type, attributes = T.unsafe(nil), &block); end # Awaits an event, blocking the current thread until a response is received. @@ -3352,62 +3378,62 @@ class Discordrb::Bot # @return [Event, nil] The event object that was triggered, or `nil` if a `timeout` was set and no event was raised in time. # @raise [ArgumentError] if `timeout` is given and is not a positive numeric value # - # pkg:gem/discordrb#lib/discordrb/bot.rb:700 + # pkg:gem/discordrb#lib/discordrb/bot.rb:707 def add_await!(type, attributes = T.unsafe(nil)); end # Add a member to a thread # @param channel [Channel, Integer, String] # @param member [Member, Integer, String] # - # pkg:gem/discordrb#lib/discordrb/bot.rb:647 + # pkg:gem/discordrb#lib/discordrb/bot.rb:654 def add_thread_member(channel, member); end - # pkg:gem/discordrb#lib/discordrb/bot.rb:212 + # pkg:gem/discordrb#lib/discordrb/bot.rb:219 def all_emoji(id = T.unsafe(nil)); end # Fetches a single application emoji from its ID. # @param emoji_id [Integer, String] ID of the application emoji. # @return [Emoji] The application emoji. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:912 + # pkg:gem/discordrb#lib/discordrb/bot.rb:919 def application_emoji(emoji_id); end # Fetches all the application emojis that the bot can use. # @return [Array] Returns an array of emoji objects. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:904 + # pkg:gem/discordrb#lib/discordrb/bot.rb:911 def application_emojis; end # @return [Hash Await>] the list of registered {Await}s. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:63 + # pkg:gem/discordrb#lib/discordrb/bot.rb:64 def awaits; end - # pkg:gem/discordrb#lib/discordrb/bot.rb:616 + # pkg:gem/discordrb#lib/discordrb/bot.rb:623 def away; end - # pkg:gem/discordrb#lib/discordrb/bot.rb:243 + # pkg:gem/discordrb#lib/discordrb/bot.rb:250 def bot_app; end # The bot's OAuth application. # @return [Application, nil] The bot's application info. Returns `nil` if bot is not a bot account. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:236 + # pkg:gem/discordrb#lib/discordrb/bot.rb:243 def bot_application; end - # pkg:gem/discordrb#lib/discordrb/bot.rb:232 + # pkg:gem/discordrb#lib/discordrb/bot.rb:239 def bot_user; end # Sets the currently competing status to the specified name. # @param name [String] The name of the game to be competing in. # @return [String] The game that is being competed in now. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:597 + # pkg:gem/discordrb#lib/discordrb/bot.rb:604 def competing=(name); end # @return [true, false] whether or not the bot is currently connected to Discord. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:296 + # pkg:gem/discordrb#lib/discordrb/bot.rb:303 def connected?; end # Creates a new custom emoji that can be used by this application. @@ -3415,7 +3441,7 @@ class Discordrb::Bot # @param image [String, #read] Base64 string with the image data, or an object that responds to #read. # @return [Emoji] The emoji that has been created. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:921 + # pkg:gem/discordrb#lib/discordrb/bot.rb:928 def create_application_emoji(name:, image:); end # Creates a new application to do OAuth authorization with. This allows you to use OAuth to authorize users using @@ -3424,53 +3450,53 @@ class Discordrb::Bot # @param redirect_uris [Array] URIs that Discord should redirect your users to after authorizing. # @return [Array(String, String)] your applications' client ID and client secret to be used in OAuth authorization. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:477 + # pkg:gem/discordrb#lib/discordrb/bot.rb:484 def create_oauth_application(name, redirect_uris); end # @see Logger#debug # - # pkg:gem/discordrb#lib/discordrb/bot.rb:760 + # pkg:gem/discordrb#lib/discordrb/bot.rb:767 def debug(message); end # Sets debug mode. If debug mode is on, many things will be outputted to STDOUT. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:661 + # pkg:gem/discordrb#lib/discordrb/bot.rb:668 def debug=(new_debug); end # Remove an application command from the commands registered with discord. # @param command_id [String, Integer] The ID of the command to remove. # @param server_id [String, Integer] The ID of the server to delete this command from, global if `nil`. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:879 + # pkg:gem/discordrb#lib/discordrb/bot.rb:886 def delete_application_command(command_id, server_id: T.unsafe(nil)); end # Deletes an existing application emoji. # @param emoji_id [Integer, String, Emoji] ID of the application emoji to delete. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:938 + # pkg:gem/discordrb#lib/discordrb/bot.rb:945 def delete_application_emoji(emoji_id); end # Revokes an invite to a server. Will fail unless you have the *Manage Server* permission. # It is recommended that you use {Invite#delete} instead. # @param code [String, Invite] The invite to revoke. For possible formats see {#resolve_invite_code}. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:392 + # pkg:gem/discordrb#lib/discordrb/bot.rb:399 def delete_invite(code); end # Dispatches an event to this bot. Called by the gateway connection handler used internally. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:770 + # pkg:gem/discordrb#lib/discordrb/bot.rb:777 def dispatch(type, data); end # Sets the bot's status to DnD (red icon). # - # pkg:gem/discordrb#lib/discordrb/bot.rb:619 + # pkg:gem/discordrb#lib/discordrb/bot.rb:626 def dnd; end # @yieldparam [OptionBuilder] # @yieldparam [PermissionBuilder] # - # pkg:gem/discordrb#lib/discordrb/bot.rb:852 + # pkg:gem/discordrb#lib/discordrb/bot.rb:859 def edit_application_command(command_id, server_id: T.unsafe(nil), name: T.unsafe(nil), description: T.unsafe(nil), default_permission: T.unsafe(nil), type: T.unsafe(nil), default_member_permissions: T.unsafe(nil), contexts: T.unsafe(nil), nsfw: T.unsafe(nil)); end # @param command_id [Integer, String] @@ -3478,7 +3504,7 @@ class Discordrb::Bot # @param permissions [Array] An array of objects formatted as `{ id: ENTITY_ID, type: 1 or 2, permission: true or false }` # @param bearer_token [String] A valid bearer token that has permission to manage the server and its roles. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:891 + # pkg:gem/discordrb#lib/discordrb/bot.rb:898 def edit_application_command_permissions(command_id, server_id, permissions = T.unsafe(nil), bearer_token = T.unsafe(nil)); end # Edits an existing application emoji. @@ -3486,7 +3512,7 @@ class Discordrb::Bot # @param name [String] The new name of the emoji. # @return [Emoji] Returns the updated emoji object on success. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:931 + # pkg:gem/discordrb#lib/discordrb/bot.rb:938 def edit_application_emoji(emoji_id, name:); end # @overload emoji(id) @@ -3497,10 +3523,10 @@ class Discordrb::Bot # The list of emoji the bot can use. # @return [Array] the emoji available. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:201 + # pkg:gem/discordrb#lib/discordrb/bot.rb:202 def emoji(id = T.unsafe(nil)); end - # pkg:gem/discordrb#lib/discordrb/bot.rb:211 + # pkg:gem/discordrb#lib/discordrb/bot.rb:218 def emojis(id = T.unsafe(nil)); end # The list of currently running threads used to parse and call events. @@ -3509,47 +3535,47 @@ class Discordrb::Bot # how many events were executed before. # @return [Array] The threads. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:49 + # pkg:gem/discordrb#lib/discordrb/bot.rb:50 def event_threads; end # Finds an emoji by its name. # @param name [String] The emoji name that should be resolved. # @return [GlobalEmoji, nil] the emoji identified by the name, or `nil` if it couldn't be found. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:217 + # pkg:gem/discordrb#lib/discordrb/bot.rb:224 def find_emoji(name); end # Sets the currently playing game to the specified game. # @param name [String] The name of the game to be played. # @return [String] The game that is being played now. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:561 + # pkg:gem/discordrb#lib/discordrb/bot.rb:568 def game=(name); end # The gateway connection is an internal detail that is useless to most people. It is however essential while # debugging or developing discordrb itself, or while writing very custom bots. # @return [Gateway] the underlying {Gateway} object. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:68 + # pkg:gem/discordrb#lib/discordrb/bot.rb:69 def gateway; end # Get an application command by ID. # @param command_id [String, Integer] # @param server_id [String, Integer, nil] The ID of the server to get the command from. Global if `nil`. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:804 + # pkg:gem/discordrb#lib/discordrb/bot.rb:811 def get_application_command(command_id, server_id: T.unsafe(nil)); end # Get all application commands. # @param server_id [String, Integer, nil] The ID of the server to get the commands from. Global if `nil`. # @return [Array] # - # pkg:gem/discordrb#lib/discordrb/bot.rb:789 + # pkg:gem/discordrb#lib/discordrb/bot.rb:796 def get_application_commands(server_id: T.unsafe(nil)); end # Sets status to idle. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:611 + # pkg:gem/discordrb#lib/discordrb/bot.rb:618 def idle; end # Add a user to the list of ignored users. Those users will be ignored in message events at event processing level. @@ -3557,19 +3583,24 @@ class Discordrb::Bot # presence and any other events will still be received. # @param user [User, String, Integer] The user, or its ID, to be ignored. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:742 + # pkg:gem/discordrb#lib/discordrb/bot.rb:749 def ignore_user(user); end # Checks whether a user is being ignored. # @param user [User, String, Integer] The user, or its ID, to check. # @return [true, false] whether or not the user is ignored. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:755 + # pkg:gem/discordrb#lib/discordrb/bot.rb:762 def ignored?(user); end + # @!visibility private + # + # pkg:gem/discordrb#lib/discordrb/bot.rb:950 + def inspect; end + # Sets the bot's status to invisible (appears offline). # - # pkg:gem/discordrb#lib/discordrb/bot.rb:625 + # pkg:gem/discordrb#lib/discordrb/bot.rb:632 def invisible; end # Creates an OAuth invite URL that can be used to invite this bot to a particular server. @@ -3579,7 +3610,7 @@ class Discordrb::Bot # @param scopes [Array] Scopes that should be appended to invite url. # @return [String] the OAuth invite URL. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:313 + # pkg:gem/discordrb#lib/discordrb/bot.rb:320 def invite_url(server: T.unsafe(nil), permission_bits: T.unsafe(nil), redirect_uri: T.unsafe(nil), scopes: T.unsafe(nil)); end # Joins the bot's connection thread with the current thread. @@ -3587,59 +3618,59 @@ class Discordrb::Bot # manually triggered. or due to an error. This is necessary to have a # continuously running bot. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:283 + # pkg:gem/discordrb#lib/discordrb/bot.rb:290 def join; end # Join a thread # @param channel [Channel, Integer, String] # - # pkg:gem/discordrb#lib/discordrb/bot.rb:632 + # pkg:gem/discordrb#lib/discordrb/bot.rb:639 def join_thread(channel); end # Leave a thread # @param channel [Channel, Integer, String] # - # pkg:gem/discordrb#lib/discordrb/bot.rb:639 + # pkg:gem/discordrb#lib/discordrb/bot.rb:646 def leave_thread(channel); end # Sets the current listening status to the specified name. # @param name [String] The thing to be listened to. # @return [String] The thing that is now being listened to. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:571 + # pkg:gem/discordrb#lib/discordrb/bot.rb:578 def listening=(name); end # @see Logger#log_exception # - # pkg:gem/discordrb#lib/discordrb/bot.rb:765 + # pkg:gem/discordrb#lib/discordrb/bot.rb:772 def log_exception(e); end # Sets the logging mode # @see Logger#mode= # - # pkg:gem/discordrb#lib/discordrb/bot.rb:667 + # pkg:gem/discordrb#lib/discordrb/bot.rb:674 def mode=(new_mode); end # The bot's name which discordrb sends to Discord when making any request, so Discord can identify bots with the # same codebase. Not required but I recommend setting it anyway. # @return [String] The bot's name. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:57 + # pkg:gem/discordrb#lib/discordrb/bot.rb:58 def name; end # The bot's name which discordrb sends to Discord when making any request, so Discord can identify bots with the # same codebase. Not required but I recommend setting it anyway. # @return [String] The bot's name. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:57 + # pkg:gem/discordrb#lib/discordrb/bot.rb:58 def name=(_arg0); end - # pkg:gem/discordrb#lib/discordrb/bot.rb:608 + # pkg:gem/discordrb#lib/discordrb/bot.rb:615 def on; end # Sets status to online. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:603 + # pkg:gem/discordrb#lib/discordrb/bot.rb:610 def online; end # Gets the user, channel, role or emoji from a string. @@ -3647,7 +3678,7 @@ class Discordrb::Bot # @param server [Server, nil] The server of the associated mention. (recommended for role parsing, to speed things up) # @return [User, Channel, Role, Emoji] The user, channel, role or emoji identified by the mention, or `nil` if none exists. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:530 + # pkg:gem/discordrb#lib/discordrb/bot.rb:537 def parse_mention(mention, server = T.unsafe(nil)); end # Gets the users, channels, roles and emoji from a string. @@ -3655,33 +3686,33 @@ class Discordrb::Bot # @param server [Server, nil] The server of the associated mentions. (recommended for role parsing, to speed things up) # @return [Array] The array of users, channels, roles and emoji identified by the mentions, or `nil` if none exists. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:496 + # pkg:gem/discordrb#lib/discordrb/bot.rb:503 def parse_mentions(mentions, server = T.unsafe(nil)); end - # pkg:gem/discordrb#lib/discordrb/bot.rb:566 + # pkg:gem/discordrb#lib/discordrb/bot.rb:573 def playing=(name); end # The bot's user profile. This special user object can be used # to edit user data like the current username (see {Profile#username=}). # @return [Profile] The bot's profile that can be used to edit data. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:225 + # pkg:gem/discordrb#lib/discordrb/bot.rb:232 def profile; end # Makes the bot leave any groups with no recipients remaining # - # pkg:gem/discordrb#lib/discordrb/bot.rb:780 + # pkg:gem/discordrb#lib/discordrb/bot.rb:787 def prune_empty_groups; end # Raises a heartbeat event. Called by the gateway connection handler used internally. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:775 + # pkg:gem/discordrb#lib/discordrb/bot.rb:782 def raise_heartbeat_event; end # @return [String] the raw token, without any prefix # @see #token # - # pkg:gem/discordrb#lib/discordrb/bot.rb:255 + # pkg:gem/discordrb#lib/discordrb/bot.rb:262 def raw_token; end # @yieldparam [OptionBuilder] @@ -3699,14 +3730,14 @@ class Discordrb::Bot # end # end # - # pkg:gem/discordrb#lib/discordrb/bot.rb:827 + # pkg:gem/discordrb#lib/discordrb/bot.rb:834 def register_application_command(name, description, server_id: T.unsafe(nil), default_permission: T.unsafe(nil), type: T.unsafe(nil), default_member_permissions: T.unsafe(nil), contexts: T.unsafe(nil), nsfw: T.unsafe(nil)); end # Remove a member from a thread # @param channel [Channel, Integer, String] # @param member [Member, Integer, String] # - # pkg:gem/discordrb#lib/discordrb/bot.rb:655 + # pkg:gem/discordrb#lib/discordrb/bot.rb:662 def remove_thread_member(channel, member); end # Runs the bot, which logs into Discord and connects the WebSocket. This @@ -3722,7 +3753,7 @@ class Discordrb::Bot # this. If you need a way to safely run code after the bot is fully # connected, use a {#ready} event handler instead. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:271 + # pkg:gem/discordrb#lib/discordrb/bot.rb:278 def run(background = T.unsafe(nil)); end # Sends a file to a channel. If it is an image, it will automatically be embedded. @@ -3736,7 +3767,7 @@ class Discordrb::Bot # @example Send a file from disk # bot.send_file(83281822225530880, File.open('rubytaco.png', 'r')) # - # pkg:gem/discordrb#lib/discordrb/bot.rb:456 + # pkg:gem/discordrb#lib/discordrb/bot.rb:463 def send_file(channel, file, caption: T.unsafe(nil), tts: T.unsafe(nil), filename: T.unsafe(nil), spoiler: T.unsafe(nil)); end # Sends a text message to a channel given its ID and the message's content. @@ -3752,7 +3783,7 @@ class Discordrb::Bot # @param enforce_nonce [true, false] whether the nonce should be enforced and used for message de-duplication. # @return [Message] The message that was sent. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:409 + # pkg:gem/discordrb#lib/discordrb/bot.rb:416 def send_message(channel, content, tts = T.unsafe(nil), embeds = T.unsafe(nil), attachments = T.unsafe(nil), allowed_mentions = T.unsafe(nil), message_reference = T.unsafe(nil), components = T.unsafe(nil), flags = T.unsafe(nil), nonce = T.unsafe(nil), enforce_nonce = T.unsafe(nil)); end # Sends a text message to a channel given its ID and the message's content, @@ -3770,35 +3801,35 @@ class Discordrb::Bot # @param nonce [String, nil] A optional nonce in order to verify that a message was sent. Maximum of twenty-five characters. # @param enforce_nonce [true, false] whether the nonce should be enforced and used for message de-duplication. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:434 + # pkg:gem/discordrb#lib/discordrb/bot.rb:441 def send_temporary_message(channel, content, timeout, tts = T.unsafe(nil), embeds = T.unsafe(nil), attachments = T.unsafe(nil), allowed_mentions = T.unsafe(nil), message_reference = T.unsafe(nil), components = T.unsafe(nil), flags = T.unsafe(nil), nonce = T.unsafe(nil), enforce_nonce = T.unsafe(nil)); end # The list of servers the bot is currently in. # @return [Hash Server>] The servers by ID. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:180 + # pkg:gem/discordrb#lib/discordrb/bot.rb:181 def servers; end # @return [Array(Integer, Integer)] the current shard key # - # pkg:gem/discordrb#lib/discordrb/bot.rb:60 + # pkg:gem/discordrb#lib/discordrb/bot.rb:61 def shard_key; end # @return [true, false] whether or not the bot should parse its own messages. Off by default. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:52 + # pkg:gem/discordrb#lib/discordrb/bot.rb:53 def should_parse_self; end # @return [true, false] whether or not the bot should parse its own messages. Off by default. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:52 + # pkg:gem/discordrb#lib/discordrb/bot.rb:53 def should_parse_self=(_arg0); end # Stops the bot gracefully, disconnecting the websocket without immediately killing the thread. This means that # Discord is immediately aware of the closed connection and makes the bot appear offline instantly. # @note This method no longer takes an argument as of 3.4.0 # - # pkg:gem/discordrb#lib/discordrb/bot.rb:291 + # pkg:gem/discordrb#lib/discordrb/bot.rb:298 def stop(_no_sync = T.unsafe(nil)); end # Sets the currently online stream to the specified name and Twitch URL. @@ -3806,34 +3837,34 @@ class Discordrb::Bot # @param url [String] The url of the current Twitch stream. # @return [String] The stream name that is being displayed now. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:588 + # pkg:gem/discordrb#lib/discordrb/bot.rb:595 def stream(name, url); end # Prevents the READY packet from being printed regardless of debug mode. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:672 + # pkg:gem/discordrb#lib/discordrb/bot.rb:679 def suppress_ready_debug; end - # pkg:gem/discordrb#lib/discordrb/bot.rb:286 + # pkg:gem/discordrb#lib/discordrb/bot.rb:293 def sync; end # The list of members in threads the bot can see. # @return [Hash Hash Hash Object>>] # - # pkg:gem/discordrb#lib/discordrb/bot.rb:188 + # pkg:gem/discordrb#lib/discordrb/bot.rb:189 def thread_members; end # The Discord API token received when logging in. Useful to explicitly call # {API} methods. # @return [String] The API token. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:248 + # pkg:gem/discordrb#lib/discordrb/bot.rb:255 def token; end # Remove a user from the ignore list. # @param user [User, String, Integer] The user, or its ID, to be unignored. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:748 + # pkg:gem/discordrb#lib/discordrb/bot.rb:755 def unignore_user(user); end # Changes information about your OAuth application @@ -3843,7 +3874,7 @@ class Discordrb::Bot # @param icon [String, nil] A data URI for your icon image (for example a base 64 encoded image), or nil if no icon # should be set or changed. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:488 + # pkg:gem/discordrb#lib/discordrb/bot.rb:495 def update_oauth_application(name, redirect_uris, description = T.unsafe(nil), icon = T.unsafe(nil)); end # Updates presence status. @@ -3856,13 +3887,13 @@ class Discordrb::Bot # Can be 0 (Playing), 1 (Streaming), 2 (Listening), 3 (Watching), or 5 (Competing). # @see Gateway#send_status_update # - # pkg:gem/discordrb#lib/discordrb/bot.rb:543 + # pkg:gem/discordrb#lib/discordrb/bot.rb:550 def update_status(status, activity, url, since = T.unsafe(nil), afk = T.unsafe(nil), activity_type = T.unsafe(nil)); end # The list of users the bot shares a server with. # @return [Hash User>] The users by ID. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:172 + # pkg:gem/discordrb#lib/discordrb/bot.rb:173 def users; end # Gets the voice bot for a particular server or channel. You can connect to a new channel using the {#voice_connect} @@ -3870,7 +3901,7 @@ class Discordrb::Bot # @param thing [Channel, Server, Integer] the server or channel you want to get the voice bot for, or its ID. # @return [Voice::VoiceBot, nil] the VoiceBot for the thing you specified, or nil if there is no connection yet # - # pkg:gem/discordrb#lib/discordrb/bot.rb:334 + # pkg:gem/discordrb#lib/discordrb/bot.rb:341 def voice(thing); end # Connects to a voice channel, initializes network connections and returns the {Voice::VoiceBot} over which audio @@ -3882,7 +3913,7 @@ class Discordrb::Bot # (uses an XSalsa20 stream cipher for encryption and Poly1305 for authentication) # @return [Voice::VoiceBot] the initialized bot over which audio data can then be sent. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:353 + # pkg:gem/discordrb#lib/discordrb/bot.rb:360 def voice_connect(chan, encrypted = T.unsafe(nil)); end # Disconnects the client from a specific voice connection given the server ID. Usually it's more convenient to use @@ -3891,108 +3922,108 @@ class Discordrb::Bot # @param destroy_vws [true, false] Whether or not the VWS should also be destroyed. If you're calling this method # directly, you should leave it as true. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:382 + # pkg:gem/discordrb#lib/discordrb/bot.rb:389 def voice_destroy(server, destroy_vws = T.unsafe(nil)); end # @return [Hash VoiceBot>] the voice connections this bot currently has, by the server ID to which they are connected. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:328 + # pkg:gem/discordrb#lib/discordrb/bot.rb:335 def voices; end # Sets the current watching status to the specified name. # @param name [String] The thing to be watched. # @return [String] The thing that is now being watched. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:579 + # pkg:gem/discordrb#lib/discordrb/bot.rb:586 def watching=(name); end private # Internal handler for GUILD_MEMBER_ADD # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1128 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1140 def add_guild_member(data); end # Internal handler for MESSAGE_REACTION_ADD # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1230 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1242 def add_message_reaction(data); end # Internal handler for CHANNEL_RECIPIENT_ADD # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1108 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1120 def add_recipient(data); end # Internal handler for GUILD_BAN_ADD # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1239 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1251 def add_user_ban(data); end - # pkg:gem/discordrb#lib/discordrb/bot.rb:1811 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1849 def calculate_intents(intents); end - # pkg:gem/discordrb#lib/discordrb/bot.rb:1779 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1817 def call_event(handler, event); end # Internal handler for CHANNEL_CREATE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1062 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1074 def create_channel(data); end # Internal handler for GUILD_CREATE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1162 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1174 def create_guild(data); end # Internal handler for GUILD_ROLE_CREATE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1189 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1201 def create_guild_role(data); end # Internal handler for MESSAGE_CREATE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1218 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1230 def create_message(data); end # Internal handler for CHANNEL_DELETE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1090 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1102 def delete_channel(data); end # Internal handler for GUILD_DELETE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1172 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1184 def delete_guild(data); end # Internal handler for GUILD_MEMBER_DELETE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1150 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1162 def delete_guild_member(data); end # Internal handler for GUILD_ROLE_DELETE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1203 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1215 def delete_guild_role(data); end # Internal handler for MESSAGE_DELETE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1227 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1239 def delete_message(data); end # Throws a useful exception if there's currently no gateway connection. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:945 + # pkg:gem/discordrb#lib/discordrb/bot.rb:957 def gateway_check; end - # pkg:gem/discordrb#lib/discordrb/bot.rb:1797 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1835 def handle_awaits(event); end - # pkg:gem/discordrb#lib/discordrb/bot.rb:1260 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1272 def handle_dispatch(type, data); end # Notifies everything there is to be notified that the connection is now ready # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1758 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1796 def notify_ready; end # ####### ###### #### ## ## @@ -4003,116 +4034,116 @@ class Discordrb::Bot # ## ## ## ## ## ## ### # ####### ###### #### ## ## # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1252 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1264 def process_token(type, token); end - # pkg:gem/discordrb#lib/discordrb/bot.rb:1766 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1804 def raise_event(event); end # Internal handler for MESSAGE_REACTION_REMOVE_ALL # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1236 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1248 def remove_all_message_reactions(data); end # Internal handler for MESSAGE_REACTION_REMOVE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1233 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1245 def remove_message_reaction(data); end # Internal handler for CHANNEL_RECIPIENT_REMOVE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1118 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1130 def remove_recipient(data); end # Internal handler for GUILD_BAN_REMOVE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1242 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1254 def remove_user_ban(data); end # Internal handler for TYPING_START # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1221 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1233 def start_typing(data); end # Logs a warning if there are servers which are still unavailable. # e.g. due to a Discord outage or because the servers are large and taking a while to load. # - # pkg:gem/discordrb#lib/discordrb/bot.rb:951 + # pkg:gem/discordrb#lib/discordrb/bot.rb:963 def unavailable_servers_check; end # Internal handler for CHANNEL_UPDATE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1081 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1093 def update_channel(data); end # Internal handler for GUILD_UPDATE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1167 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1179 def update_guild(data); end # Internal handler for GUILD_EMOJIS_UPDATE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1211 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1223 def update_guild_emoji(data); end # Internal handler for GUILD_MEMBER_UPDATE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1137 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1149 def update_guild_member(data); end # Internal handler for GUILD_ROLE_UPDATE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1178 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1190 def update_guild_role(data); end # Internal handler for MESSAGE_UPDATE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1224 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1236 def update_message(data); end # Internal handler for PRESENCE_UPDATE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:968 + # pkg:gem/discordrb#lib/discordrb/bot.rb:980 def update_presence(data); end # Internal handler for VOICE_SERVER_UPDATE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1039 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1051 def update_voice_server(data); end # Internal handler for VOICE_STATE_UPDATE # - # pkg:gem/discordrb#lib/discordrb/bot.rb:1011 + # pkg:gem/discordrb#lib/discordrb/bot.rb:1023 def update_voice_state(data); end end # A bulk ban entry on a server # -# pkg:gem/discordrb#lib/discordrb/data/server.rb:1059 +# pkg:gem/discordrb#lib/discordrb/data/server.rb:1073 class Discordrb::BulkBan # @!visibility private # - # pkg:gem/discordrb#lib/discordrb/data/server.rb:1073 + # pkg:gem/discordrb#lib/discordrb/data/server.rb:1087 def initialize(data, server, reason); end # @return [Array] Array of user IDs that were banned. # - # pkg:gem/discordrb#lib/discordrb/data/server.rb:1067 + # pkg:gem/discordrb#lib/discordrb/data/server.rb:1081 def banned_users; end # @return [Array] Array of user IDs that couldn't be banned. # - # pkg:gem/discordrb#lib/discordrb/data/server.rb:1070 + # pkg:gem/discordrb#lib/discordrb/data/server.rb:1084 def failed_users; end # @return [String, nil] The reason these users were banned. # - # pkg:gem/discordrb#lib/discordrb/data/server.rb:1064 + # pkg:gem/discordrb#lib/discordrb/data/server.rb:1078 def reason; end # @return [Server] The server this bulk ban belongs to. # - # pkg:gem/discordrb#lib/discordrb/data/server.rb:1061 + # pkg:gem/discordrb#lib/discordrb/data/server.rb:1075 def server; end end @@ -4327,7 +4358,7 @@ class Discordrb::Channel # Add a member to the thread # @param member [Member, Integer, String] The member, or ID of the member, to add to this thread. # - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1055 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1065 def add_member(member); end # Adds a recipient to a group channel. @@ -4336,7 +4367,7 @@ class Discordrb::Channel # @note For internal use only # @!visibility private # - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1076 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1086 def add_recipient(recipient); end # @return [Time, nil] The timestamp of when this threads status last changed. @@ -4500,6 +4531,14 @@ class Discordrb::Channel # pkg:gem/discordrb#lib/discordrb/data/channel.rb:110 def flags; end + # Follow the announcement (news) channel to send crossposted messages to a target channel. + # @param target [Channel, Integer, String] The target channel to send crossposted messages to. + # @param reason [String, nil] The audit log reason shown for the created webhook in the target channel. + # @return [Integer] the ID of the created webhook in the target channel. + # + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:970 + def follow(target, reason: T.unsafe(nil)); end + # @return [true, false] whether or not this channel is a forum channel. # # pkg:gem/discordrb#lib/discordrb/data/channel.rb:273 @@ -4536,7 +4575,7 @@ class Discordrb::Channel # The default `inspect` method is overwritten to give more useful output. # - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1067 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1077 def inspect; end # @return [true, false, nil] For private threads, determines whether non-moderators can add other non-moderators to @@ -4559,7 +4598,7 @@ class Discordrb::Channel # Join this thread. # - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1039 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1049 def join_thread; end # @return [Time, nil] When the current user joined this thread. @@ -4567,14 +4606,14 @@ class Discordrb::Channel # pkg:gem/discordrb#lib/discordrb/data/channel.rb:89 def join_timestamp; end - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1133 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1143 def jump_link; end # Returns the last message or forum post created in this channel. # @return [Message, Channel, nil] the last message sent in this channel, # the most recent forum post if this is a forum or media channel, or `nil`. # - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:969 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:979 def last_message; end # @return [Integer, nil] The ID of the last message sent in this channel. This may not point to a valid message. @@ -4597,7 +4636,7 @@ class Discordrb::Channel # Leave this thread # - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1044 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1054 def leave_thread; end # pkg:gem/discordrb#lib/discordrb/data/channel.rb:55 @@ -4608,7 +4647,7 @@ class Discordrb::Channel # @return [String] a URL that a user can use to navigate to this channel in the client # - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1129 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1139 def link; end # Returns a single message from this channel's history by ID. @@ -4659,7 +4698,7 @@ class Discordrb::Channel # Members in the thread. # - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1049 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1059 def members; end # @return [String] a string that will mention the channel as a clickable link on Discord. @@ -4789,7 +4828,7 @@ class Discordrb::Channel # @note For internal use only # @!visibility private # - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1107 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1117 def process_last_message_id(id); end # Set the last pin timestamp of a channel. @@ -4797,7 +4836,7 @@ class Discordrb::Channel # @note For internal use only # @!visibility private # - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1099 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1109 def process_last_pin_timestamp(time); end # Delete the last N messages on this channel. @@ -4853,7 +4892,7 @@ class Discordrb::Channel # @param member [Member, Integer, String] The member, or ID of the member, to remove from a thread. # - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1060 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1070 def remove_member(member); end # Removes a recipient from a group channel. @@ -4862,7 +4901,7 @@ class Discordrb::Channel # @note For internal use only # @!visibility private # - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1088 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1098 def remove_recipient(recipient); end # @return [Overwrite] any role-type permission overwrites on this channel @@ -4886,7 +4925,7 @@ class Discordrb::Channel # @param allowed_mentions [Hash, Discordrb::AllowedMentions, false, nil] Mentions that are allowed to ping on this message. `false` disables all pings # @param message_reference [Message, String, Integer, nil] The message, or message ID, to reply to if any. # @param components [View, Array] Interaction components to associate with this message. - # @param flags [Integer] Flags for this message. Currently only SUPPRESS_EMBEDS (1 << 2) and SUPPRESS_NOTIFICATIONS (1 << 12) can be set. + # @param flags [Integer] Flags for this message. Currently only SUPPRESS_EMBEDS (1 << 2), SUPPRESS_NOTIFICATIONS (1 << 12), and IS_COMPONENTS_V2 (1 << 15) can be set. # @yield [embed] Yields the embed to allow for easy building inside a block. # @yieldparam embed [Discordrb::Webhooks::Embed] The embed from the parameters, or a new one. # @return [Message] The resulting message. @@ -4914,7 +4953,7 @@ class Discordrb::Channel # @param allowed_mentions [Hash, Discordrb::AllowedMentions, false, nil] Mentions that are allowed to ping on this message. `false` disables all pings # @param message_reference [Message, String, Integer, nil] The message, or message ID, to reply to if any. # @param components [View, Array] Interaction components to associate with this message. - # @param flags [Integer] Flags for this message. Currently only SUPPRESS_EMBEDS (1 << 2) and SUPPRESS_NOTIFICATIONS (1 << 12) can be set. + # @param flags [Integer] Flags for this message. Currently only SUPPRESS_EMBEDS (1 << 2), SUPPRESS_NOTIFICATIONS (1 << 12), and IS_COMPONENTS_V2 (1 << 15) can be set. # @return [Message] the message that was sent. # # pkg:gem/discordrb#lib/discordrb/data/channel.rb:483 @@ -4962,7 +5001,7 @@ class Discordrb::Channel # @param allowed_mentions [Hash, Discordrb::AllowedMentions, false, nil] Mentions that are allowed to ping on this message. `false` disables all pings # @param message_reference [Message, String, Integer, nil] The message, or message ID, to reply to if any. # @param components [View, Array] Interaction components to associate with this message. - # @param flags [Integer] Flags for this message. Currently only SUPPRESS_EMBEDS (1 << 2) and SUPPRESS_NOTIFICATIONS (1 << 12) can be set. + # @param flags [Integer] Flags for this message. Currently only SUPPRESS_EMBEDS (1 << 2), SUPPRESS_NOTIFICATIONS (1 << 12), and IS_COMPONENTS_V2 (1 << 15) can be set. # # pkg:gem/discordrb#lib/discordrb/data/channel.rb:499 def send_temporary_message(content, timeout, tts = T.unsafe(nil), embed = T.unsafe(nil), attachments = T.unsafe(nil), allowed_mentions = T.unsafe(nil), message_reference = T.unsafe(nil), components = T.unsafe(nil), flags = T.unsafe(nil)); end @@ -5023,7 +5062,7 @@ class Discordrb::Channel # @yieldparam view [Webhooks::View] An optional component builder. Arguments passed to the builder overwrite method data. # @return [Message] the starter message of the forum post. The forum post that was created can be accessed via {Message#thread}. # - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1016 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1026 def start_forum_thread(name:, auto_archive_duration: T.unsafe(nil), rate_limit_per_user: T.unsafe(nil), tags: T.unsafe(nil), content: T.unsafe(nil), embeds: T.unsafe(nil), allowed_mentions: T.unsafe(nil), components: T.unsafe(nil), stickers: T.unsafe(nil), attachments: T.unsafe(nil), flags: T.unsafe(nil), has_components: T.unsafe(nil), reason: T.unsafe(nil)); end # Start a thread. @@ -5034,7 +5073,7 @@ class Discordrb::Channel # @param type [Symbol, Integer] The type of thread to create. Can be a key from {TYPES} or the value. # @return [Channel] # - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:986 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:996 def start_thread(name, auto_archive_duration, message: T.unsafe(nil), type: T.unsafe(nil)); end # Starts typing, which displays the typing indicator on the client for five seconds. @@ -5113,7 +5152,7 @@ class Discordrb::Channel # @note For internal use only # @!visibility private # - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1114 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1124 def update_data(new_data = T.unsafe(nil)); end # Updates the cached data from another channel. @@ -5180,19 +5219,19 @@ class Discordrb::Channel # Deletes a list of messages on this channel using bulk delete. # - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1143 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1153 def bulk_delete(ids, strict = T.unsafe(nil), reason = T.unsafe(nil)); end - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1177 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1187 def process_permission_overwrites(overwrites); end - # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1160 + # pkg:gem/discordrb#lib/discordrb/data/channel.rb:1170 def update_channel_data(new_data); end end # For bulk_delete checking # -# pkg:gem/discordrb#lib/discordrb/data/channel.rb:1139 +# pkg:gem/discordrb#lib/discordrb/data/channel.rb:1149 Discordrb::Channel::TWO_WEEKS = T.let(T.unsafe(nil), Integer) # Map of channel types @@ -5774,244 +5813,667 @@ module Discordrb::Components end end -# Represents a row of components +# Represents a row of components. # -# pkg:gem/discordrb#lib/discordrb/data/component.rb:25 +# pkg:gem/discordrb#lib/discordrb/data/component.rb:49 class Discordrb::Components::ActionRow include ::Enumerable # @!visibility private # - # pkg:gem/discordrb#lib/discordrb/data/component.rb:32 + # pkg:gem/discordrb#lib/discordrb/data/component.rb:59 def initialize(data, bot); end - # Get all buttons in this row - # @return [Array