diff --git a/vendor/better-sqlite3 b/vendor/better-sqlite3 new file mode 160000 index 0000000..7fa2365 --- /dev/null +++ b/vendor/better-sqlite3 @@ -0,0 +1 @@ +Subproject commit 7fa236543297bb3e01d84f8fcf0b8a068d6bc9ab diff --git a/vendor/discord-video-stream b/vendor/discord-video-stream new file mode 160000 index 0000000..f2b18ce --- /dev/null +++ b/vendor/discord-video-stream @@ -0,0 +1 @@ +Subproject commit f2b18cec7490743ec94a2c72f4e3e78541b6fc51 diff --git a/vendor/discord-video-stream/.github/workflows/biome.yml b/vendor/discord-video-stream/.github/workflows/biome.yml deleted file mode 100644 index 345cf45..0000000 --- a/vendor/discord-video-stream/.github/workflows/biome.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Biome Lint & Format Check - -on: - push: - pull_request: - -jobs: - quality: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Biome - uses: biomejs/setup-biome@v2 - with: - version: 2.3.8 - - name: Run Biome - run: biome ci . diff --git a/vendor/discord-video-stream/.github/workflows/publish_prerelease.yml b/vendor/discord-video-stream/.github/workflows/publish_prerelease.yml deleted file mode 100644 index b2af53c..0000000 --- a/vendor/discord-video-stream/.github/workflows/publish_prerelease.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Publish pkg.pr.new -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 9 - - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: "pnpm" - - - name: Install dependencies - run: pnpm install - - - name: Build - run: pnpm build - - - name: Publish - run: pnpx pkg-pr-new publish diff --git a/vendor/discord-video-stream/.gitignore b/vendor/discord-video-stream/.gitignore deleted file mode 100644 index e3a5c08..0000000 --- a/vendor/discord-video-stream/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -node_modules -dist -package-lock.json -#example/src/config.json -examples/*/node_modules -examples/*/dist \ No newline at end of file diff --git a/vendor/discord-video-stream/PERFORMANCE.md b/vendor/discord-video-stream/PERFORMANCE.md deleted file mode 100644 index 1839fd9..0000000 --- a/vendor/discord-video-stream/PERFORMANCE.md +++ /dev/null @@ -1,88 +0,0 @@ -# Performance related tweaks - -## `ultrafast` shouldn't be used for x264/5 - -In our testing, the `ultrafast` preset produces a lot of bitrate spikes, causing the stream to stutter. `superfast` and below seems to keep it under control pretty well. Do not use `ultrafast`. Previous versions of the library has `ultrafast` as the default, which has been changed after the testing. - -## Transport encryption methods - -> [!NOTE] -> This is no longer accurate as of [#195](https://github.com/Discord-RE/Discord-video-stream/pull/195), which replaces the custom UDP connection with standard WebRTC. This is kept here for historical purposes only. - -On CPUs without AES acceleration (very old x86 CPUs, certain ARM SoCs on single board computers, certain VMs that don't expose AES acceleration capability), the default encryption method (AES-256-GCM) might not be fast enough to handle high frame-rate + high bitrate streams. - -In such cases, you can enable the `forceChacha20Encryption` option on the `Streamer` instance (`streamer.opts.forceChacha20Encryption = true`) before starting a stream, to force the use of the faster Chacha20-Poly1305 encryption method. For even higher performance, also install the optional [`sodium-native`](https://www.npmjs.com/package/sodium-native) package to use the faster native version instead of the WASM version. - -Below are some benchmark results of the two encryption methods in various circumstances, for reference purposes only. All benchmarks are performed on a Ryzen 5 5600H. - -
-AES-256-GCM, with AES acceleration - -``` -PS C:\> openssl speed -elapsed -aead -evp aes-256-gcm -You have chosen to measure elapsed time instead of user CPU time. -Doing AES-256-GCM ops for 3s on 2 size blocks: 19046296 AES-256-GCM ops in 3.00s -Doing AES-256-GCM ops for 3s on 31 size blocks: 15299030 AES-256-GCM ops in 3.00s -Doing AES-256-GCM ops for 3s on 136 size blocks: 13580376 AES-256-GCM ops in 3.00s -Doing AES-256-GCM ops for 3s on 1024 size blocks: 7691855 AES-256-GCM ops in 3.00s -Doing AES-256-GCM ops for 3s on 8192 size blocks: 1648811 AES-256-GCM ops in 3.00s -Doing AES-256-GCM ops for 3s on 16384 size blocks: 863115 AES-256-GCM ops in 3.00s -version: 3.4.0 -built on: Tue Oct 22 23:27:41 2024 UTC -options: bn(64,64) -compiler: cl /Z7 /Fdossl_static.pdb /Gs0 /GF /Gy /MD /W3 /wd4090 /nologo /O2 -DL_ENDIAN -DOPENSSL_PIC -D"OPENSSL_BUILDING_OPENSSL" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"NDEBUG" -D_WINSOCK_DEPRECATED_NO_WARNINGS -D_WIN32_WINNT=0x0502 -CPUINFO: OPENSSL_ia32cap=0xfed8320b078bffff:0x400684219c97a9 -The 'numbers' are in 1000s of bytes per second processed. -type 2 bytes 31 bytes 136 bytes 1024 bytes 8192 bytes 16384 bytes -AES-256-GCM 12693.30k 158089.98k 615233.56k 2625486.51k 4500852.95k 4712187.99k -``` - -
- -
-AES-256-GCM, without AES acceleration - -``` -PS C:\> openssl speed -elapsed -aead -evp aes-256-gcm -You have chosen to measure elapsed time instead of user CPU time. -Doing AES-256-GCM ops for 3s on 2 size blocks: 6947831 AES-256-GCM ops in 3.00s -Doing AES-256-GCM ops for 3s on 31 size blocks: 4875037 AES-256-GCM ops in 3.00s -Doing AES-256-GCM ops for 3s on 136 size blocks: 3132696 AES-256-GCM ops in 3.00s -Doing AES-256-GCM ops for 3s on 1024 size blocks: 821006 AES-256-GCM ops in 3.00s -Doing AES-256-GCM ops for 3s on 8192 size blocks: 113769 AES-256-GCM ops in 3.00s -Doing AES-256-GCM ops for 3s on 16384 size blocks: 57074 AES-256-GCM ops in 3.00s -version: 3.4.0 -built on: Tue Oct 22 23:27:41 2024 UTC -options: bn(64,64) -compiler: cl /Z7 /Fdossl_static.pdb /Gs0 /GF /Gy /MD /W3 /wd4090 /nologo /O2 -DL_ENDIAN -DOPENSSL_PIC -D"OPENSSL_BUILDING_OPENSSL" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"NDEBUG" -D_WINSOCK_DEPRECATED_NO_WARNINGS -D_WIN32_WINNT=0x0502 -CPUINFO: OPENSSL_ia32cap=0xfcd83209078bffff:0x0 env:~0x200000200000000 -The 'numbers' are in 1000s of bytes per second processed. -type 2 bytes 31 bytes 136 bytes 1024 bytes 8192 bytes 16384 bytes -AES-256-GCM 4630.34k 50358.60k 142015.55k 280143.33k 310561.70k 311596.27k -``` - -
- -
-Chacha20-Poly1305 - -``` -PS C:\> openssl speed -elapsed -aead -evp chacha20-poly1305 -You have chosen to measure elapsed time instead of user CPU time. -Doing ChaCha20-Poly1305 ops for 3s on 2 size blocks: 8312139 ChaCha20-Poly1305 ops in 3.00s -Doing ChaCha20-Poly1305 ops for 3s on 31 size blocks: 7801222 ChaCha20-Poly1305 ops in 3.00s -Doing ChaCha20-Poly1305 ops for 3s on 136 size blocks: 5436377 ChaCha20-Poly1305 ops in 3.00s -Doing ChaCha20-Poly1305 ops for 3s on 1024 size blocks: 4182141 ChaCha20-Poly1305 ops in 3.00s -Doing ChaCha20-Poly1305 ops for 3s on 8192 size blocks: 903567 ChaCha20-Poly1305 ops in 3.00s -Doing ChaCha20-Poly1305 ops for 3s on 16384 size blocks: 472556 ChaCha20-Poly1305 ops in 3.00s -version: 3.4.0 -built on: Tue Oct 22 23:27:41 2024 UTC -options: bn(64,64) -compiler: cl /Z7 /Fdossl_static.pdb /Gs0 /GF /Gy /MD /W3 /wd4090 /nologo /O2 -DL_ENDIAN -DOPENSSL_PIC -D"OPENSSL_BUILDING_OPENSSL" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"NDEBUG" -D_WINSOCK_DEPRECATED_NO_WARNINGS -D_WIN32_WINNT=0x0502 -CPUINFO: OPENSSL_ia32cap=0xfed8320b078bffff:0x400684219c97a9 -The 'numbers' are in 1000s of bytes per second processed. -type 2 bytes 31 bytes 136 bytes 1024 bytes 8192 bytes 16384 bytes -ChaCha20-Poly1305 5539.58k 80585.77k 246284.90k 1427504.13k 2465696.49k 2580785.83k -``` - -
diff --git a/vendor/discord-video-stream/README.md b/vendor/discord-video-stream/README.md deleted file mode 100644 index 525cc06..0000000 --- a/vendor/discord-video-stream/README.md +++ /dev/null @@ -1,296 +0,0 @@ -# Discord self-bot video - -[![pkg.pr.new](https://pkg.pr.new/badge/Discord-RE/Discord-video-stream)](https://pkg.pr.new/~/Discord-RE/Discord-video-stream) - -Fork: [Discord-video-experiment](https://github.com/mrjvs/Discord-video-experiment) - -> [!CAUTION] -> Using any kind of automation programs on your account can result in your account getting permanently banned by Discord. Use at your own risk - -## Features - -- Playing video & audio in a voice channel (`Go Live`, or webcam video) - -## Implementation - -What I implemented and what I did not. - -### Video codecs - -- [ ] VP8 (once supported, removed for maintainability) -- [ ] VP9 -- [X] H.264 -- [X] H.265 -- [ ] AV1 - -### Packet types - -- [X] RTP (sending of realtime data) -- [ ] RTX (retransmission) - -### Connection types - -- [X] Regular Voice Connection -- [X] Go Live - -### Encryption - -- [X] Transport Encryption -- [X] [End-to-end Encryption](https://github.com/dank074/Discord-video-stream/issues/102) - -### Extras - -- [X] Figure out RTP header extensions (discord specific) (discord seems to use [one-byte RTP header extension](https://www.rfc-editor.org/rfc/rfc8285.html#section-4.2)) - -Extensions supported by Discord (taken from the webrtc sdp exchange) - -``` -"a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level" -"a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time" -"a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01" -"a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid" -"a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay" -"a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type" -"a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing" -"a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space" -"a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id" -"a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id" -"a=extmap:13 urn:3gpp:video-orientation" -"a=extmap:14 urn:ietf:params:rtp-hdrext:toffset" -``` - -## Requirements - -For full functionality, this library requires an FFmpeg build with `libzmq` enabled. Here is our recommendation: - -- Windows & Linux: [BtbN's FFmpeg Builds](https://github.com/BtbN/FFmpeg-Builds) -- macOS (Intel): [evermeet.cx](https://evermeet.cx/ffmpeg/) -- macOS (Apple Silicon): Install from Homebrew - -## Usage - -Install the package, alongside its peer-dependency discord.js-selfbot-v13: - -``` -npm install @dank074/discord-video-stream@latest -npm install discord.js-selfbot-v13@latest -``` - -> [!IMPORTANT] -> This library makes use of native dependencies (`node-av` and `node-datachannel`). If you use package managers that don't run install scripts by default (`pnpm`, `bun`, etc.), you'll need to allow running install scripts for `node-av` and `node-datachannel` for proper operation. - -Create a new Streamer, and pass it a selfbot Client - -```typescript -import { Client } from "discord.js-selfbot-v13"; -import { Streamer } from '@dank074/discord-video-stream'; - -const streamer = new Streamer(new Client()); -await streamer.client.login('TOKEN HERE'); -``` - -Make client join a voice channel - -```typescript -await streamer.joinVoice("GUILD ID HERE", "CHANNEL ID HERE"); -``` - -Start sending media - -```typescript -import { prepareStream, playStream, Utils, Encoders } from "@dank074/discord-video-stream" -try { - // NVENC is also available, change Encoders.software to Encoders.nvenc and - // adapt the settings - let encoder = Encoders.software({ - x264: { - preset: "superfast" - }, - x265: { - preset: "superfast" - } - }); - const { command, output } = prepareStream("DIRECT VIDEO URL OR READABLE STREAM HERE", { - encoder, - - // Specify either width or height for aspect ratio aware scaling - // Specify both for stretched output - height: 1080, - - // Force frame rate, or leave blank to use source frame rate - frameRate: 30, - bitrateVideo: 5000, - bitrateVideoMax: 7500, - videoCodec: Utils.normalizeVideoCodec("H264" /* or H265 */), - }); - command.on("error", (err, stdout, stderr) => { - // Handle ffmpeg errors here - }); - - await playStream(output, streamer, { - type: "go-live" // use "camera" for camera stream - }); - - console.log("Finished playing video"); -} catch (e) { - console.log(e); -} -``` - -## Encoder options available - -```typescript -/** - * A function returning encoder settings for a specific avg and max bitrate - * You can define your own, or use the pre-made functions in the library - */ -encoder: EncoderSettingsGetter; -/** - * Disable transcoding of the video stream. If specified, all video related - * options have no effects - * - * Only use this if your video stream is Discord streaming friendly, otherwise - * you'll get a glitchy output - */ -noTranscoding?: boolean; -/** - * Video output width - */ -width?: number; -/** - * Video output height - */ -height?: number; -/** - * Video output frames per second - */ -fps?: number; -/** - * Video average bitrate in kbps - */ -bitrateVideo?: number; -/** - * Video max bitrate in kbps - */ -bitrateVideoMax?: number; -/** - * Audio bitrate in kbps - */ -bitrateAudio?: number; -/** - * Enable audio output - */ -includeAudio?: boolean; -/** - * Enables hardware accelerated video decoding. Enabling this option might result in an exception - * being thrown by Ffmpeg process if your system does not support hardware acceleration - */ -hardwareAcceleratedDecoding?: boolean; -/** - * Output video codec. **Only** supports H264, H265, and VP8 currently - */ -videoCodec?: SupportedVideoCodec; -/** - * Adds ffmpeg params to minimize latency and start outputting video as fast as possible. - * Might create lag in video output in some rare cases - */ -minimizeLatency?: boolean; -/** - * Custom headers for HTTP requests - */ -customHeaders?: Record; -/** - * Custom input options to pass directly to ffmpeg - * These will be added to the command *before* other options - */ -customInputOptions?: string[]; -/** - * Custom ffmpeg flags/options to pass directly to ffmpeg - * These will be added to the command *after* other options - */ -customFfmpegFlags?: string[]; -``` - -## `playStream` options available - -```typescript -/** - * Set stream type as "Go Live" or camera stream - */ -type?: "go-live" | "camera", - -/** - * Override video width sent to Discord. - * - * DO NOT SPECIFY UNLESS YOU KNOW WHAT YOU'RE DOING! - */ -width?: number, - -/** - * Override video height sent to Discord. - * - * DO NOT SPECIFY UNLESS YOU KNOW WHAT YOU'RE DOING! - */ -height?: number, - -/** - * Override video frame rate sent to Discord. - * - * DO NOT SPECIFY UNLESS YOU KNOW WHAT YOU'RE DOING! - */ -frameRate?: number, - -/** - * Same as ffmpeg's `readrate_initial_burst` command line flag - * - * See https://ffmpeg.org/ffmpeg.html#:~:text=%2Dreadrate_initial_burst - */ -readrateInitialBurst?: number, -``` - -## Performance tips - -See [this page](./PERFORMANCE.md) for some tips on improving performance - -## Running example - -`examples/basic/src/config.json`: - -```json -"token": "SELF TOKEN HERE", -"acceptedAuthors": ["USER_ID_HERE"], -``` - -1. Configure your `config.json` with your accepted authors ids, and your self token -2. Generate js files with ```npm run build``` -3. Start program with: ```npm run start``` -4. Join a voice channel -5. Start streaming with commands: - -for go-live - -``` -$play-live -``` - -or for cam - -``` -$play-cam -``` - -for example: - -``` -$play-live http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4 -``` - -## FAQs - -- Can I stream on existing voice connection (CAM) and in a go-live connection simultaneously? - -Yes, just send the media packets over both connections. The voice gateway expects you to signal when a user turns on their camera, so make sure you signal using `client.signalVideo(guildId, channelId, true)` before you start sending cam media packets. - -- Does this library work with bot tokens? - -No, Discord blocks video from bots which is why this library uses a selfbot library as peer dependency. You must use a user token diff --git a/vendor/discord-video-stream/biome.json b/vendor/discord-video-stream/biome.json deleted file mode 100644 index f00758c..0000000 --- a/vendor/discord-video-stream/biome.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/2.3.8/schema.json", - "vcs": { - "enabled": true, - "clientKind": "git", - "useIgnoreFile": true - }, - "files": { - "ignoreUnknown": false, - "includes": ["./src/**/*"] - }, - "formatter": { - "enabled": true, - "indentStyle": "space", - "indentWidth": 2 - }, - "assist": { - "actions": { - "source": { - "organizeImports": "off" - } - } - }, - "linter": { - "enabled": true, - "rules": { - "recommended": true, - "style": { - "noNonNullAssertion": "off" - } - } - }, - "javascript": { - "formatter": { - "quoteStyle": "double" - } - } -} diff --git a/vendor/discord-video-stream/examples/basic/README.md b/vendor/discord-video-stream/examples/basic/README.md deleted file mode 100644 index 9c55934..0000000 --- a/vendor/discord-video-stream/examples/basic/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# basic example - -This example shows how to stream a video, both using the existing voice connection or with a Go Live connection, using the new API introduced in v4.1.3 \ No newline at end of file diff --git a/vendor/discord-video-stream/examples/basic/package.json b/vendor/discord-video-stream/examples/basic/package.json deleted file mode 100644 index 4c7676b..0000000 --- a/vendor/discord-video-stream/examples/basic/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "@dank074/discord-video-stream-example", - "version": "1.0.0", - "description": "", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "type": "module", - "dependencies": { - "@dank074/discord-video-stream": "^5.0.0", - "discord.js-selfbot-v13": "^3.5.1" - }, - "devDependencies": { - "@types/node": "^22.10.1", - "typescript": "^5.7.2" - }, - "scripts": { - "build": "tsc", - "start": "node ./dist/index.js", - "yeet": "npm run build && npm run start" - }, - "author": "", - "license": "ISC" -} diff --git a/vendor/discord-video-stream/examples/basic/src/config.json b/vendor/discord-video-stream/examples/basic/src/config.json deleted file mode 100644 index 569612e..0000000 --- a/vendor/discord-video-stream/examples/basic/src/config.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "token": "SELF TOKEN HERE", - "acceptedAuthors": ["USER_ID_HERE"], - "streamOpts": { - "width": 1280, - "height": 720, - "fps": 30, - "bitrateKbps": 1000, - "maxBitrateKbps": 2500, - "hardware_acceleration": false, - "videoCodec": "H264" - } -} \ No newline at end of file diff --git a/vendor/discord-video-stream/examples/basic/src/index.ts b/vendor/discord-video-stream/examples/basic/src/index.ts deleted file mode 100644 index b6e5421..0000000 --- a/vendor/discord-video-stream/examples/basic/src/index.ts +++ /dev/null @@ -1,112 +0,0 @@ -import { Client, StageChannel } from "discord.js-selfbot-v13"; -import { Streamer, Utils, prepareStream, playStream } from "@dank074/discord-video-stream"; -import config from "./config.json" with {type: "json"}; - -const streamer = new Streamer(new Client()); - -// ready event -streamer.client.on("ready", () => { - console.log(`--- ${streamer.client.user?.tag} is ready ---`); -}); - -let controller: AbortController; - -// message event -streamer.client.on("messageCreate", async (msg) => { - if (msg.author.bot) return; - - if (!config.acceptedAuthors.includes(msg.author.id)) return; - - if (!msg.content) return; - - if (msg.content.startsWith("$play-live")) { - const args = parseArgs(msg.content) - if (!args) return; - - const channel = msg.author.voice?.channel; - - if(!channel) return; - - console.log(`Attempting to join voice channel ${msg.guildId}/${channel.id}`); - await streamer.joinVoice(msg.guildId!, channel.id); - - if (channel instanceof StageChannel) - { - await streamer.client.user?.voice?.setSuppressed(false); - } - - controller?.abort(); - controller = new AbortController(); - - const { command, output } = prepareStream(args.url, { - width: config.streamOpts.width, - height: config.streamOpts.height, - frameRate: config.streamOpts.fps, - bitrateVideo: config.streamOpts.bitrateKbps, - bitrateVideoMax: config.streamOpts.maxBitrateKbps, - hardwareAcceleratedDecoding: config.streamOpts.hardware_acceleration, - videoCodec: Utils.normalizeVideoCodec(config.streamOpts.videoCodec) - }, controller.signal); - command.on("error", (err) => { - console.log("An error happened with ffmpeg"); - console.log(err); - }); - await playStream(output, streamer, undefined, controller.signal) - .catch(() => controller.abort()); - } else if (msg.content.startsWith("$play-cam")) { - const args = parseArgs(msg.content); - if (!args) return; - - const channel = msg.author.voice?.channel; - - if (!channel) return; - - console.log(`Attempting to join voice channel ${msg.guildId}/${channel.id}`); - const vc = await streamer.joinVoice(msg.guildId!, channel.id); - - if (channel instanceof StageChannel) - { - await streamer.client.user?.voice?.setSuppressed(false); - } - - controller?.abort(); - controller = new AbortController(); - - const { command, output } = prepareStream(args.url, { - width: config.streamOpts.width, - height: config.streamOpts.height, - frameRate: config.streamOpts.fps, - bitrateVideo: config.streamOpts.bitrateKbps, - bitrateVideoMax: config.streamOpts.maxBitrateKbps, - hardwareAcceleratedDecoding: config.streamOpts.hardware_acceleration, - videoCodec: Utils.normalizeVideoCodec(config.streamOpts.videoCodec) - }, controller.signal) - command.on("error", (err) => { - console.log("An error happened with ffmpeg"); - console.log(err); - }); - await playStream(output, streamer, undefined, controller.signal) - .catch(() => controller.abort()); - } else if (msg.content.startsWith("$disconnect")) { - controller?.abort(); - streamer.leaveVoice(); - } else if(msg.content.startsWith("$stop-stream")) { - controller?.abort(); - } -}); - -// login -streamer.client.login(config.token); - -function parseArgs(message: string): Args | undefined { - const args = message.split(" "); - if (args.length < 2) return; - - const url = args[1]; - - return { url } -} - -type Args = { - url: string; -} diff --git a/vendor/discord-video-stream/examples/basic/tsconfig.json b/vendor/discord-video-stream/examples/basic/tsconfig.json deleted file mode 100644 index 4d59fb9..0000000 --- a/vendor/discord-video-stream/examples/basic/tsconfig.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "NodeNext", /* Specify what module code is generated. */ - // "rootDir": "./", /* Specify the root folder within your source files. */ - "moduleResolution": "NodeNext", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - "resolveJsonModule": true, /* Enable importing .json files. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./dist", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - - /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ - "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - }, - "include": [ - "src/**/*" - ] -} \ No newline at end of file diff --git a/vendor/discord-video-stream/examples/puppeteer-stream/README.md b/vendor/discord-video-stream/examples/puppeteer-stream/README.md deleted file mode 100644 index d022f91..0000000 --- a/vendor/discord-video-stream/examples/puppeteer-stream/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# puppeteer stream example - -This example shows how to use puppeteer stream to stream a browser window \ No newline at end of file diff --git a/vendor/discord-video-stream/examples/puppeteer-stream/package.json b/vendor/discord-video-stream/examples/puppeteer-stream/package.json deleted file mode 100644 index d842c39..0000000 --- a/vendor/discord-video-stream/examples/puppeteer-stream/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@dank074/discord-video-stream-example-puppeteer", - "version": "1.0.0", - "description": "", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "type": "module", - "dependencies": { - "@dank074/discord-video-stream": "^5.0.0", - "discord.js-selfbot-v13": "^3.5.1", - "puppeteer": "^24.1.1", - "puppeteer-stream": "^3.0.19" - }, - "devDependencies": { - "@types/node": "^22.13.1", - "typescript": "^5.7.3" - }, - "scripts": { - "build": "tsc", - "start": "node ./dist/index.js", - "yeet": "npm run build && npm run start" - }, - "author": "", - "license": "ISC" -} diff --git a/vendor/discord-video-stream/examples/puppeteer-stream/src/config.json b/vendor/discord-video-stream/examples/puppeteer-stream/src/config.json deleted file mode 100644 index 569612e..0000000 --- a/vendor/discord-video-stream/examples/puppeteer-stream/src/config.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "token": "SELF TOKEN HERE", - "acceptedAuthors": ["USER_ID_HERE"], - "streamOpts": { - "width": 1280, - "height": 720, - "fps": 30, - "bitrateKbps": 1000, - "maxBitrateKbps": 2500, - "hardware_acceleration": false, - "videoCodec": "H264" - } -} \ No newline at end of file diff --git a/vendor/discord-video-stream/examples/puppeteer-stream/src/index.ts b/vendor/discord-video-stream/examples/puppeteer-stream/src/index.ts deleted file mode 100644 index ca91445..0000000 --- a/vendor/discord-video-stream/examples/puppeteer-stream/src/index.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { Client, StageChannel } from 'discord.js-selfbot-v13'; -import { Streamer, Utils, prepareStream, playStream } from "@dank074/discord-video-stream"; -import { executablePath } from 'puppeteer'; -import { launch, getStream } from 'puppeteer-stream'; -import config from "./config.json" with {type: "json"}; - -type BrowserOptions = { - width: number, - height: number -} - -const streamer = new Streamer(new Client()); -let browser: Awaited>; - -// ready event -streamer.client.on("ready", () => { - console.log(`--- ${streamer.client.user?.tag} is ready ---`); -}); - -let controller: AbortController; - -// message event -streamer.client.on("messageCreate", async (msg) => { - if (msg.author.bot) return; - - if (!config.acceptedAuthors.includes(msg.author.id)) return; - - if (!msg.content) return; - - if (msg.content.startsWith("$play-screen")) { - const args = msg.content.split(" "); - if (args.length < 2) return; - - const url = args[1]; - - if (!url) return; - - const channel = msg.author.voice?.channel; - - if (!channel) return; - - console.log(`Attempting to join voice channel ${msg.guildId}/${channel.id}`); - await streamer.joinVoice(msg.guildId!, channel.id); - - if (channel instanceof StageChannel) - { - await streamer.client.user?.voice?.setSuppressed(false); - } - - controller?.abort(); - controller = new AbortController(); - await streamPuppeteer(url, streamer, { - width: config.streamOpts.width, - height: config.streamOpts.height - }, controller.signal); - } else if (msg.content.startsWith("$disconnect")) { - controller?.abort(); - streamer.leaveVoice(); - } -}) - -// login -streamer.client.login(config.token); - -async function streamPuppeteer(url: string, streamer: Streamer, opts: BrowserOptions, cancelSignal?: AbortSignal) { - cancelSignal?.throwIfAborted(); - cancelSignal?.addEventListener("abort", () => { - browser.close(); - }, { once: true }); - browser = await launch({ - defaultViewport: { - width: opts.width, - height: opts.height, - }, - executablePath: executablePath() - }); - - const page = await browser.newPage(); - await page.goto(url); - - const stream = await getStream(page, { audio: true, video: true, mimeType: "video/webm;codecs=vp8,opus" }); - - try { - const { command, output } = prepareStream(stream, { - frameRate: config.streamOpts.fps, - bitrateVideo: config.streamOpts.bitrateKbps, - bitrateVideoMax: config.streamOpts.maxBitrateKbps, - hardwareAcceleratedDecoding: config.streamOpts.hardware_acceleration, - videoCodec: Utils.normalizeVideoCodec(config.streamOpts.videoCodec) - }, cancelSignal); - command.on("error", (err, stdout, stderr) => { - console.log("An error occurred with ffmpeg"); - console.log(err) - }); - - await playStream(output, streamer, { - // Use this to catch up with ffmpeg - readrateInitialBurst: 10 - }, cancelSignal); - console.log("Finished playing video"); - } catch (e) { - console.log(e); - } -} diff --git a/vendor/discord-video-stream/examples/puppeteer-stream/tsconfig.json b/vendor/discord-video-stream/examples/puppeteer-stream/tsconfig.json deleted file mode 100644 index 4d59fb9..0000000 --- a/vendor/discord-video-stream/examples/puppeteer-stream/tsconfig.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "NodeNext", /* Specify what module code is generated. */ - // "rootDir": "./", /* Specify the root folder within your source files. */ - "moduleResolution": "NodeNext", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - "resolveJsonModule": true, /* Enable importing .json files. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./dist", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - - /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ - "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - }, - "include": [ - "src/**/*" - ] -} \ No newline at end of file diff --git a/vendor/discord-video-stream/package.json b/vendor/discord-video-stream/package.json deleted file mode 100644 index 27fbe86..0000000 --- a/vendor/discord-video-stream/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "@dank074/discord-video-stream", - "version": "6.0.0", - "description": "Experiment for making video streaming work for discord selfbots", - "exports": "./dist/index.js", - "types": "dist/index.d.ts", - "type": "module", - "files": [ - "dist", - "src" - ], - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@lng2004/node-datachannel": "0.32.0-20260202", - "@snazzah/davey": "^0.1.8", - "debug-level": "^4.1.1", - "fluent-ffmpeg-simplified": "^0.1.0", - "node-av": "^5.2.2", - "p-debounce": "^5.1.0", - "sharp": "^0.34.5", - "zeromq": "^6.5.0" - }, - "devDependencies": { - "@biomejs/biome": "2.3.8", - "@types/fluent-ffmpeg": "^2.1.28", - "@types/node": "^25.0.1", - "discord.js-selfbot-v13": "workspace:*", - "pkg-pr-new": "^0.0.62", - "typescript": "^5.9.3" - }, - "peerDependencies": { - "discord.js-selfbot-v13": "^3.6.0" - }, - "engines": { - "node": ">=22.4.0" - }, - "scripts": { - "build": "tsc", - "lint": "biome lint --error-on-warnings .", - "lint:fix": "biome lint --write .", - "check": "biome check .", - "check:fix": "biome check --write ." - }, - "keywords": [ - "discord", - "video", - "voice", - "stream", - "go-live" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/dank074/Discord-video-stream.git" - }, - "contributors": [ - "Long Nguyen ", - "s074 ", - "mrjvs ", - "Elysia <71698422+aiko-chan-ai@users.noreply.github.com>", - "Fede14 ", - "Malthe Morsing Larsen <57196060+malthemorsing@users.noreply.github.com>" - ], - "license": "ISC", - "bugs": { - "url": "https://github.com/dank074/Discord-video-stream/issues" - }, - "homepage": "https://github.com/dank074/Discord-video-stream#readme" -} diff --git a/vendor/discord-video-stream/pnpm-lock.yaml b/vendor/discord-video-stream/pnpm-lock.yaml deleted file mode 100644 index c230e6d..0000000 --- a/vendor/discord-video-stream/pnpm-lock.yaml +++ /dev/null @@ -1,2689 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - dependencies: - '@lng2004/node-datachannel': - specifier: 0.32.0-20260202 - version: 0.32.0-20260202 - '@snazzah/davey': - specifier: ^0.1.8 - version: 0.1.8 - debug-level: - specifier: ^4.1.1 - version: 4.1.1 - fluent-ffmpeg-simplified: - specifier: ^0.1.0 - version: 0.1.0 - node-av: - specifier: ^5.2.2 - version: 5.2.2 - p-debounce: - specifier: ^5.1.0 - version: 5.1.0 - sharp: - specifier: ^0.34.5 - version: 0.34.5 - zeromq: - specifier: ^6.5.0 - version: 6.5.0 - devDependencies: - '@biomejs/biome': - specifier: 2.3.8 - version: 2.3.8 - '@types/fluent-ffmpeg': - specifier: ^2.1.28 - version: 2.1.28 - '@types/node': - specifier: ^25.0.1 - version: 25.0.1 - discord.js-selfbot-v13: - specifier: ^3.7.1 - version: 3.7.1 - pkg-pr-new: - specifier: ^0.0.62 - version: 0.0.62 - typescript: - specifier: ^5.9.3 - version: 5.9.3 - -packages: - - '@actions/core@1.11.1': - resolution: {integrity: sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==} - - '@actions/exec@1.1.1': - resolution: {integrity: sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==} - - '@actions/http-client@2.2.3': - resolution: {integrity: sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==} - - '@actions/io@1.1.3': - resolution: {integrity: sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==} - - '@babel/runtime@7.28.6': - resolution: {integrity: sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==} - engines: {node: '>=6.9.0'} - - '@biomejs/biome@2.3.8': - resolution: {integrity: sha512-Qjsgoe6FEBxWAUzwFGFrB+1+M8y/y5kwmg5CHac+GSVOdmOIqsAiXM5QMVGZJ1eCUCLlPZtq4aFAQ0eawEUuUA==} - engines: {node: '>=14.21.3'} - hasBin: true - - '@biomejs/cli-darwin-arm64@2.3.8': - resolution: {integrity: sha512-HM4Zg9CGQ3txTPflxD19n8MFPrmUAjaC7PQdLkugeeC0cQ+PiVrd7i09gaBS/11QKsTDBJhVg85CEIK9f50Qww==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [darwin] - - '@biomejs/cli-darwin-x64@2.3.8': - resolution: {integrity: sha512-lUDQ03D7y/qEao7RgdjWVGCu+BLYadhKTm40HkpJIi6kn8LSv5PAwRlew/DmwP4YZ9ke9XXoTIQDO1vAnbRZlA==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [darwin] - - '@biomejs/cli-linux-arm64-musl@2.3.8': - resolution: {integrity: sha512-PShR4mM0sjksUMyxbyPNMxoKFPVF48fU8Qe8Sfx6w6F42verbwRLbz+QiKNiDPRJwUoMG1nPM50OBL3aOnTevA==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [linux] - - '@biomejs/cli-linux-arm64@2.3.8': - resolution: {integrity: sha512-Uo1OJnIkJgSgF+USx970fsM/drtPcQ39I+JO+Fjsaa9ZdCN1oysQmy6oAGbyESlouz+rzEckLTF6DS7cWse95g==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [linux] - - '@biomejs/cli-linux-x64-musl@2.3.8': - resolution: {integrity: sha512-YGLkqU91r1276uwSjiUD/xaVikdxgV1QpsicT0bIA1TaieM6E5ibMZeSyjQ/izBn4tKQthUSsVZacmoJfa3pDA==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [linux] - - '@biomejs/cli-linux-x64@2.3.8': - resolution: {integrity: sha512-QDPMD5bQz6qOVb3kiBui0zKZXASLo0NIQ9JVJio5RveBEFgDgsvJFUvZIbMbUZT3T00M/1wdzwWXk4GIh0KaAw==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [linux] - - '@biomejs/cli-win32-arm64@2.3.8': - resolution: {integrity: sha512-H4IoCHvL1fXKDrTALeTKMiE7GGWFAraDwBYFquE/L/5r1927Te0mYIGseXi4F+lrrwhSWbSGt5qPFswNoBaCxg==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [win32] - - '@biomejs/cli-win32-x64@2.3.8': - resolution: {integrity: sha512-RguzimPoZWtBapfKhKjcWXBVI91tiSprqdBYu7tWhgN8pKRZhw24rFeNZTNf6UiBfjCYCi9eFQs/JzJZIhuK4w==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [win32] - - '@discordjs/builders@1.13.1': - resolution: {integrity: sha512-cOU0UDHc3lp/5nKByDxkmRiNZBpdp0kx55aarbiAfakfKJHlxv/yFW1zmIqCAmwH5CRlrH9iMFKJMpvW4DPB+w==} - engines: {node: '>=16.11.0'} - - '@discordjs/collection@2.1.1': - resolution: {integrity: sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg==} - engines: {node: '>=18'} - - '@discordjs/formatters@0.6.2': - resolution: {integrity: sha512-y4UPwWhH6vChKRkGdMB4odasUbHOUwy7KL+OVwF86PvT6QVOwElx+TiI1/6kcmcEe+g5YRXJFiXSXUdabqZOvQ==} - engines: {node: '>=16.11.0'} - - '@discordjs/util@1.2.0': - resolution: {integrity: sha512-3LKP7F2+atl9vJFhaBjn4nOaSWahZ/yWjOvA4e5pnXkt2qyXRCHLxoBQy81GFtLGCq7K9lPm9R517M1U+/90Qg==} - engines: {node: '>=18'} - - '@emnapi/core@1.7.1': - resolution: {integrity: sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg==} - - '@emnapi/runtime@1.7.1': - resolution: {integrity: sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==} - - '@emnapi/wasi-threads@1.1.0': - resolution: {integrity: sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==} - - '@fastify/busboy@2.1.1': - resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} - engines: {node: '>=14'} - - '@fidm/asn1@1.0.4': - resolution: {integrity: sha512-esd1jyNvRb2HVaQGq2Gg8Z0kbQPXzV9Tq5Z14KNIov6KfFD6PTaRIO8UpcsYiTNzOqJpmyzWgVTrUwFV3UF4TQ==} - engines: {node: '>= 8'} - - '@fidm/x509@1.2.1': - resolution: {integrity: sha512-nwc2iesjyc9hkuzcrMCBXQRn653XuAUKorfWM8PZyJawiy1QzLj4vahwzaI25+pfpwOLvMzbJ0uKpWLDNmo16w==} - engines: {node: '>= 8'} - - '@img/colour@1.0.0': - resolution: {integrity: sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==} - engines: {node: '>=18'} - - '@img/sharp-darwin-arm64@0.34.5': - resolution: {integrity: sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm64] - os: [darwin] - - '@img/sharp-darwin-x64@0.34.5': - resolution: {integrity: sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [x64] - os: [darwin] - - '@img/sharp-libvips-darwin-arm64@1.2.4': - resolution: {integrity: sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==} - cpu: [arm64] - os: [darwin] - - '@img/sharp-libvips-darwin-x64@1.2.4': - resolution: {integrity: sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==} - cpu: [x64] - os: [darwin] - - '@img/sharp-libvips-linux-arm64@1.2.4': - resolution: {integrity: sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==} - cpu: [arm64] - os: [linux] - - '@img/sharp-libvips-linux-arm@1.2.4': - resolution: {integrity: sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==} - cpu: [arm] - os: [linux] - - '@img/sharp-libvips-linux-ppc64@1.2.4': - resolution: {integrity: sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==} - cpu: [ppc64] - os: [linux] - - '@img/sharp-libvips-linux-riscv64@1.2.4': - resolution: {integrity: sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==} - cpu: [riscv64] - os: [linux] - - '@img/sharp-libvips-linux-s390x@1.2.4': - resolution: {integrity: sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==} - cpu: [s390x] - os: [linux] - - '@img/sharp-libvips-linux-x64@1.2.4': - resolution: {integrity: sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==} - cpu: [x64] - os: [linux] - - '@img/sharp-libvips-linuxmusl-arm64@1.2.4': - resolution: {integrity: sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==} - cpu: [arm64] - os: [linux] - - '@img/sharp-libvips-linuxmusl-x64@1.2.4': - resolution: {integrity: sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==} - cpu: [x64] - os: [linux] - - '@img/sharp-linux-arm64@0.34.5': - resolution: {integrity: sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm64] - os: [linux] - - '@img/sharp-linux-arm@0.34.5': - resolution: {integrity: sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm] - os: [linux] - - '@img/sharp-linux-ppc64@0.34.5': - resolution: {integrity: sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [ppc64] - os: [linux] - - '@img/sharp-linux-riscv64@0.34.5': - resolution: {integrity: sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [riscv64] - os: [linux] - - '@img/sharp-linux-s390x@0.34.5': - resolution: {integrity: sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [s390x] - os: [linux] - - '@img/sharp-linux-x64@0.34.5': - resolution: {integrity: sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [x64] - os: [linux] - - '@img/sharp-linuxmusl-arm64@0.34.5': - resolution: {integrity: sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm64] - os: [linux] - - '@img/sharp-linuxmusl-x64@0.34.5': - resolution: {integrity: sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [x64] - os: [linux] - - '@img/sharp-wasm32@0.34.5': - resolution: {integrity: sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [wasm32] - - '@img/sharp-win32-arm64@0.34.5': - resolution: {integrity: sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm64] - os: [win32] - - '@img/sharp-win32-ia32@0.34.5': - resolution: {integrity: sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [ia32] - os: [win32] - - '@img/sharp-win32-x64@0.34.5': - resolution: {integrity: sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [x64] - os: [win32] - - '@jsdevtools/ez-spawn@3.0.4': - resolution: {integrity: sha512-f5DRIOZf7wxogefH03RjMPMdBF7ADTWUMoOs9kaJo06EfwF+aFhMZMDZxHg/Xe12hptN9xoZjGso2fdjapBRIA==} - engines: {node: '>=10'} - - '@leichtgewicht/ip-codec@2.0.5': - resolution: {integrity: sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==} - - '@lng2004/node-datachannel@0.32.0-20260202': - resolution: {integrity: sha512-YLpIA5yYC4NRSaw3suitZcQUW/vdI3DHadsCZjPEgUOi2vuoPzPwq+L8Qtt4REuJs/Pw3BcypdVBQfeUVtw9sA==} - engines: {node: '>=18.20.0'} - - '@minhducsun2002/leb128@1.0.0': - resolution: {integrity: sha512-eFrYUPDVHeuwWHluTG1kwNQUEUcFjVKYwPkU8z9DR1JH3AW7JtJsG9cRVGmwz809kKtGfwGJj58juCZxEvnI/g==} - - '@napi-rs/wasm-runtime@1.1.0': - resolution: {integrity: sha512-Fq6DJW+Bb5jaWE69/qOE0D1TUN9+6uWhCeZpdnSBk14pjLcCWR7Q8n49PTSPHazM37JqrsdpEthXy2xn6jWWiA==} - - '@noble/curves@1.9.7': - resolution: {integrity: sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==} - engines: {node: ^14.21.3 || >=16} - - '@noble/hashes@1.8.0': - resolution: {integrity: sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==} - engines: {node: ^14.21.3 || >=16} - - '@octokit/action@6.1.0': - resolution: {integrity: sha512-lo+nHx8kAV86bxvOVOI3vFjX3gXPd/L7guAUbvs3pUvnR2KC+R7yjBkA1uACt4gYhs4LcWP3AXSGQzsbeN2XXw==} - engines: {node: '>= 18'} - - '@octokit/auth-action@4.1.0': - resolution: {integrity: sha512-m+3t7K46IYyMk7Bl6/lF4Rv09GqDZjYmNg8IWycJ2Fa3YE3DE7vQcV6G2hUPmR9NDqenefNJwVtlisMjzymPiQ==} - engines: {node: '>= 18'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.2': - resolution: {integrity: sha512-/g2d4sW9nUDJOMz3mabVQvOGhVa4e/BN/Um7yca9Bb2XTzPPnfTWHWQg+IsEYO7M3Vx+EXvaM/I2pJWIMun1bg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.6': - resolution: {integrity: sha512-H1fNTMA57HbkFESSt3Y9+FBICv+0jFceJFPWDePYlR/iMGrwM5ph+Dd4XRQs+8X+PUFURLQgX9ChPfhJ/1uNQw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.1': - resolution: {integrity: sha512-3mkDltSfcDUoa176nlGoA32RGjeWjl3K7F/BwHwRMJUW/IteSa4bnSV8p2ThNkcIcZU2umkZWxwETSSCJf2Q7g==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@20.0.0': - resolution: {integrity: sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==} - - '@octokit/openapi-types@24.2.0': - resolution: {integrity: sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==} - - '@octokit/plugin-paginate-rest@9.2.2': - resolution: {integrity: sha512-u3KYkGF7GcZnSD/3UP0S7K5XUFT2FkOQdcfXZGZQPGv3lm4F2Xbf71lvjldr8c1H3nNbF+33cLEkWYbokGWqiQ==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@10.4.1': - resolution: {integrity: sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/request-error@5.1.1': - resolution: {integrity: sha512-v9iyEQJH6ZntoENr9/yXxjuezh4My67CBSu9r6Ve/05Iu5gNgnisNWOsoJHTP6k0Rr0+HQIpnH+kyammu90q/g==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.1': - resolution: {integrity: sha512-qnB2+SY3hkCmBxZsR/MPCybNmbJe4KAlfWErXq+rBKkQJlbjdJeS85VI9r8UqeLYLvnAenU8Q1okM/0MBsAGXw==} - engines: {node: '>= 18'} - - '@octokit/types@12.6.0': - resolution: {integrity: sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==} - - '@octokit/types@13.10.0': - resolution: {integrity: sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==} - - '@otplib/core@12.0.1': - resolution: {integrity: sha512-4sGntwbA/AC+SbPhbsziRiD+jNDdIzsZ3JUyfZwjtKyc/wufl1pnSIaG4Uqx8ymPagujub0o92kgBnB89cuAMA==} - - '@otplib/plugin-crypto@12.0.1': - resolution: {integrity: sha512-qPuhN3QrT7ZZLcLCyKOSNhuijUi9G5guMRVrxq63r9YNOxxQjPm59gVxLM+7xGnHnM6cimY57tuKsjK7y9LM1g==} - - '@otplib/plugin-thirty-two@12.0.1': - resolution: {integrity: sha512-MtT+uqRso909UkbrrYpJ6XFjj9D+x2Py7KjTO9JDPhL0bJUYVu5kFP4TFZW4NFAywrAtFRxOVY261u0qwb93gA==} - - '@otplib/preset-default@12.0.1': - resolution: {integrity: sha512-xf1v9oOJRyXfluBhMdpOkr+bsE+Irt+0D5uHtvg6x1eosfmHCsCC6ej/m7FXiWqdo0+ZUI6xSKDhJwc8yfiOPQ==} - - '@otplib/preset-v11@12.0.1': - resolution: {integrity: sha512-9hSetMI7ECqbFiKICrNa4w70deTUfArtwXykPUvSHWOdzOlfa9ajglu7mNCntlvxycTiOAXkQGwjQCzzDEMRMg==} - - '@peculiar/asn1-cms@2.6.0': - resolution: {integrity: sha512-2uZqP+ggSncESeUF/9Su8rWqGclEfEiz1SyU02WX5fUONFfkjzS2Z/F1Li0ofSmf4JqYXIOdCAZqIXAIBAT1OA==} - - '@peculiar/asn1-csr@2.6.0': - resolution: {integrity: sha512-BeWIu5VpTIhfRysfEp73SGbwjjoLL/JWXhJ/9mo4vXnz3tRGm+NGm3KNcRzQ9VMVqwYS2RHlolz21svzRXIHPQ==} - - '@peculiar/asn1-ecc@2.6.0': - resolution: {integrity: sha512-FF3LMGq6SfAOwUG2sKpPXblibn6XnEIKa+SryvUl5Pik+WR9rmRA3OCiwz8R3lVXnYnyRkSZsSLdml8H3UiOcw==} - - '@peculiar/asn1-pfx@2.6.0': - resolution: {integrity: sha512-rtUvtf+tyKGgokHHmZzeUojRZJYPxoD/jaN1+VAB4kKR7tXrnDCA/RAWXAIhMJJC+7W27IIRGe9djvxKgsldCQ==} - - '@peculiar/asn1-pkcs8@2.6.0': - resolution: {integrity: sha512-KyQ4D8G/NrS7Fw3XCJrngxmjwO/3htnA0lL9gDICvEQ+GJ+EPFqldcJQTwPIdvx98Tua+WjkdKHSC0/Km7T+lA==} - - '@peculiar/asn1-pkcs9@2.6.0': - resolution: {integrity: sha512-b78OQ6OciW0aqZxdzliXGYHASeCvvw5caqidbpQRYW2mBtXIX2WhofNXTEe7NyxTb0P6J62kAAWLwn0HuMF1Fw==} - - '@peculiar/asn1-rsa@2.6.0': - resolution: {integrity: sha512-Nu4C19tsrTsCp9fDrH+sdcOKoVfdfoQQ7S3VqjJU6vedR7tY3RLkQ5oguOIB3zFW33USDUuYZnPEQYySlgha4w==} - - '@peculiar/asn1-schema@2.6.0': - resolution: {integrity: sha512-xNLYLBFTBKkCzEZIw842BxytQQATQv+lDTCEMZ8C196iJcJJMBUZxrhSTxLaohMyKK8QlzRNTRkUmanucnDSqg==} - - '@peculiar/asn1-x509-attr@2.6.0': - resolution: {integrity: sha512-MuIAXFX3/dc8gmoZBkwJWxUWOSvG4MMDntXhrOZpJVMkYX+MYc/rUAU2uJOved9iJEoiUx7//3D8oG83a78UJA==} - - '@peculiar/asn1-x509@2.6.0': - resolution: {integrity: sha512-uzYbPEpoQiBoTq0/+jZtpM6Gq6zADBx+JNFP3yqRgziWBxQ/Dt/HcuvRfm9zJTPdRcBqPNdaRHTVwpyiq6iNMA==} - - '@peculiar/x509@1.14.3': - resolution: {integrity: sha512-C2Xj8FZ0uHWeCXXqX5B4/gVFQmtSkiuOolzAgutjTfseNOHT3pUjljDZsTSxXFGgio54bCzVFqmEOUrIVk8RDA==} - engines: {node: '>=20.0.0'} - - '@sapphire/async-queue@1.5.5': - resolution: {integrity: sha512-cvGzxbba6sav2zZkH8GPf2oGk9yYoD5qrNWdu9fRehifgnFZJMV+nuy2nON2roRO4yQQ+v7MK/Pktl/HgfsUXg==} - engines: {node: '>=v14.0.0', npm: '>=7.0.0'} - - '@sapphire/shapeshift@4.0.0': - resolution: {integrity: sha512-d9dUmWVA7MMiKobL3VpLF8P2aeanRTu6ypG2OIaEv/ZHH/SUQ2iHOVyi5wAPjQ+HmnMuL0whK9ez8I/raWbtIg==} - engines: {node: '>=v16'} - - '@sec-ant/readable-stream@0.4.1': - resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==} - - '@seydx/node-av-darwin-arm64@5.2.2': - resolution: {integrity: sha512-uj8hKggmfckYqRldfRWLT/0wRMhxc31+GMKPeYlL+PeAAfW2UigR0iL06CS/c0qIQRgFC9yMHv5Uc3OrIqJfZw==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm64] - os: [darwin] - - '@seydx/node-av-darwin-x64@5.2.2': - resolution: {integrity: sha512-HMq6BSoplzvH/0IygOQNVSYeWR0YH3SczHp53xgzxtzGtsdQ+2oWFuMr6jwlGGIIE0MrfUIDm+yuzZO2Z1YqpA==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [x64] - os: [darwin] - - '@seydx/node-av-linux-arm64@5.2.2': - resolution: {integrity: sha512-AltBFfrGK29GvpvVkm3WgKy+RyrGVFZyISLm11mf+KUk/EhpNJauSPAPaPvVaTlISHAuKXW6AncZusjYUEGJ8A==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm64] - os: [linux] - - '@seydx/node-av-linux-x64@5.2.2': - resolution: {integrity: sha512-8H5nas3leiFcFT4yNMhuFlIGaYc5+jUFl3I3hFEww/wnLLd+WG3v/uX8lHot8am8P3eZqwX9PHXoVauxfji5lQ==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [x64] - os: [linux] - - '@seydx/node-av-win32-arm64-mingw@5.2.2': - resolution: {integrity: sha512-BSQvoyyJKKF2faw0w9YADs9IMYOYXiIEGz/slKfqkYFeAr1AhoPCQmVkIu8U1Knmxnm1XN2xq8ovIYRr7aiUvg==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm64] - os: [win32] - - '@seydx/node-av-win32-arm64-msvc@5.2.2': - resolution: {integrity: sha512-1dvoWam1m6u40ffVGGHjy6Giqh9GsGpooRlY5JLZQWftRRO2frDVIU+qaR2xqdE4xMZ2xoLzcVG1uZRtXvw7sQ==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm64] - os: [win32] - - '@seydx/node-av-win32-x64-mingw@5.2.2': - resolution: {integrity: sha512-mh/n3C/Vm44pDZ0Qn8enKM9Dp32d67tZ1h3s6yL8lbYu6bDyuBET68h+x+Lq+X+PifrNxKczs2gnI3cuKk93Dg==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [x64] - os: [win32] - - '@seydx/node-av-win32-x64-msvc@5.2.2': - resolution: {integrity: sha512-abfpaUNj0RK6/tWL2SoXnnhWxvP7HGfeNGZgmJYmVZwCIYQKs6kNcQVF+xPxJedJHYDJuJAI3rOj/2mBK7pPWA==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [x64] - os: [win32] - - '@shinyoshiaki/binary-data@0.6.1': - resolution: {integrity: sha512-7HDb/fQAop2bCmvDIzU5+69i+UJaFgIVp99h1VzK1mpg1JwSODOkjbqD7ilTYnqlnadF8C4XjpwpepxDsGY6+w==} - engines: {node: '>=6'} - - '@shinyoshiaki/jspack@0.0.6': - resolution: {integrity: sha512-SdsNhLjQh4onBlyPrn4ia1Pdx5bXT88G/LIEpOYAjx2u4xeY/m/HB5yHqlkJB1uQR3Zw4R3hBWLj46STRAN0rg==} - - '@sindresorhus/merge-streams@4.0.0': - resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} - engines: {node: '>=18'} - - '@snazzah/davey-android-arm-eabi@0.1.8': - resolution: {integrity: sha512-kRrrU2AldUEG8+Qqj+d5bofm1xzHEX2e657TFHOzKXObU7igqINFL61opcb30cMHcnMTGthV3bFFlh6ky0xrqw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@snazzah/davey-android-arm64@0.1.8': - resolution: {integrity: sha512-ttGznhY/vy0aUI+wwvt9Ati0U4gujKKjVwBOaOY6Ug+DKaPIc3Sah73XMXoX9QB9TyUBkH7lxvhpI+VneIcg4w==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@snazzah/davey-darwin-arm64@0.1.8': - resolution: {integrity: sha512-c75j0DuAWZ20XgaTVCXzks2Gl9L0+dC0ID1NSdvoOqBRCphjHBUSf1te2hdWJKI3Dq1uPaJ00JL6fYUkpb+Wxw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@snazzah/davey-darwin-x64@0.1.8': - resolution: {integrity: sha512-/SAvTmkEc73R4JSAfwVGMcVzwtjvmduaZHWnF49fCO1iFGR688U8k4W1obM9JkaNoLg4LPvU4HGMuDvfxh/gUA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@snazzah/davey-freebsd-x64@0.1.8': - resolution: {integrity: sha512-91gPSY0gcbq/o7yqpBfWyrck7yZ4nciH3LJlk55tpC+NExedWUtH2HvsqVqqoS8TmNu+1msT0+5nJsq65flWPQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@snazzah/davey-linux-arm-gnueabihf@0.1.8': - resolution: {integrity: sha512-nJQOsykF5XFngsxxv6zKQX0bPfqE2YotlcPajHKVR7COSbrYgFXZ+Cck+nILiDqpCU+4fk7ae+8Knx181qbWYg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@snazzah/davey-linux-arm64-gnu@0.1.8': - resolution: {integrity: sha512-IaALezD2F3Qt2n1GL5Wm2aQEjeiJI6gzSEhEHYiqyZUM/LygCyRXSDkoPAvHGuu3Xwy5m58Z20pfukxA49xbGQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@snazzah/davey-linux-arm64-musl@0.1.8': - resolution: {integrity: sha512-OhEwQmZ/ntiqHoSAxRe1qVfELdKMREqwlf52vhPMFVa4XNyT6jNYXGanTMjYX2+jhH9SlJ7cqsADm1VFvjRnGA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@snazzah/davey-linux-x64-gnu@0.1.8': - resolution: {integrity: sha512-yghgG7iXZUHy734Cq3PcgrbRnLhhB233JNTX5VPRxRqdwFAg2MzAJ2iSWpP12K6hSqKq9hw0sdt8CNpr0mEXjQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@snazzah/davey-linux-x64-musl@0.1.8': - resolution: {integrity: sha512-WwCiAge27ZOEu7NRx5NFjpCAkGcUGHGtoROBY4ElRYE0Tp3DfuzWU06qSu6JBQPlzhTTBN29X2/kGP8iRUwqnQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@snazzah/davey-wasm32-wasi@0.1.8': - resolution: {integrity: sha512-VAUY6eMhiS4HkHDh0SCjVbwf2SUR/cHs0IzS02p4lYwuUaqPFQnraxMNZ6R2MNOK8NmtPbCpWvi7kYMxMJuL2A==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@snazzah/davey-win32-arm64-msvc@0.1.8': - resolution: {integrity: sha512-4ZcEhyfuRH+ni4pHBrgm+2zumwgaac5+OGOKHEGezJmUd3omn/iKpcj9Z0+Y9qQ8UGslzBrgesW46ENXoOfv2Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@snazzah/davey-win32-ia32-msvc@0.1.8': - resolution: {integrity: sha512-znL43C+hxocxLgk/zbgCukOSNW14HYQE5G6fNeWtANHVCstkTN7hrJVbZfBnuKD+Jw1RbCs4gxLsYja1n1iZnA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@snazzah/davey-win32-x64-msvc@0.1.8': - resolution: {integrity: sha512-JKIco1miwtM4NgVwU/H9TJdUaSlJ+kdtydy3+tiV9cmJv0u1SM2NpwjV85H44xAQWW2zcRBHP0ZDriciHw09qQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@snazzah/davey@0.1.8': - resolution: {integrity: sha512-f4NkCtU/4r9DUohp636qkZkxCF19v8Xq6W/1m4IKY2emZm+M2IdhWIv4GQxog2bQBWLNRRLD4DNM/UXEUb8W/A==} - engines: {node: '>= 10'} - - '@tybys/wasm-util@0.10.1': - resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} - - '@types/fluent-ffmpeg@2.1.28': - resolution: {integrity: sha512-5ovxsDwBcPfJ+eYs1I/ZpcYCnkce7pvH9AHSvrZllAp1ZPpTRDZAFjF3TRFbukxSgIYTTNYePbS0rKUmaxVbXw==} - - '@types/node@25.0.1': - resolution: {integrity: sha512-czWPzKIAXucn9PtsttxmumiQ9N0ok9FrBwgRWrwmVLlp86BrMExzvXRLFYRJ+Ex3g6yqj+KuaxfX1JTgV2lpfg==} - - acorn@8.15.0: - resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} - engines: {node: '>=0.4.0'} - hasBin: true - - aes-js@3.1.2: - resolution: {integrity: sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - asn1js@3.0.7: - resolution: {integrity: sha512-uLvq6KJu04qoQM6gvBfKFjlh6Gl0vOKQuR5cJMDHQkmwfMOQeN3F3SHCv9SNYSL+CRoHvOGFfllDlVz03GQjvQ==} - engines: {node: '>=12.0.0'} - - asyncc@2.0.9: - resolution: {integrity: sha512-nTQfwHtnL+MSqPaUJhV22GWP3jThj0GnS4Nw1uJyBus6EQ40hQFnbBGUvWxC5P3m+1neSqH1p8asMXg/ypmsQw==} - engines: {node: '>=6.0.0'} - - atomic-sleep@1.0.0: - resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} - engines: {node: '>=8.0.0'} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - bluebird@3.7.2: - resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==} - - buffer-crc32@1.0.0: - resolution: {integrity: sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==} - engines: {node: '>=8.0.0'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - buffer@6.0.3: - resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} - - call-me-maybe@1.0.2: - resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} - - camelcase@5.3.1: - resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} - engines: {node: '>=6'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chownr@1.1.4: - resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} - - cliui@6.0.0: - resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} - - cmake-ts@1.0.2: - resolution: {integrity: sha512-5l++JHE7MxFuyV/OwJf3ek7ZZN1aGPFPM5oUz6AnK5inQAPe4TFXRMz5sA2qg2FRgByPWdqO+gSfIPo8GzoKNQ==} - hasBin: true - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - commander@12.1.0: - resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} - engines: {node: '>=18'} - - confbox@0.1.8: - resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} - - core-util-is@1.0.3: - resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} - - cross-spawn@7.0.6: - resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} - engines: {node: '>= 8'} - - date-fns@2.30.0: - resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} - engines: {node: '>=0.11'} - - debug-level@4.1.1: - resolution: {integrity: sha512-r/T+zzVbsy4FL91zdUrxc1I788DRXwU4mg65Yk8F5ACHNu9ucTXiWrb4JaKHbNtwuOUKKpE8oEnDg0fcBFmmBw==} - engines: {node: '>=18'} - - debug@4.4.0: - resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - debug@4.4.3: - resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - decamelize@1.2.0: - resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} - engines: {node: '>=0.10.0'} - - decode-uri-component@0.4.1: - resolution: {integrity: sha512-+8VxcR21HhTy8nOt6jf20w0c9CADrw1O8d+VZ/YzzCt4bJ3uBjw+D1q2osAB8RnpwwaeYBxy0HyKQxD5JBMuuQ==} - engines: {node: '>=14.16'} - - decompress-response@6.0.0: - resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} - engines: {node: '>=10'} - - deep-extend@0.6.0: - resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} - engines: {node: '>=4.0.0'} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.1.2: - resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} - engines: {node: '>=8'} - - dijkstrajs@1.0.3: - resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==} - - discord-api-types@0.38.37: - resolution: {integrity: sha512-Cv47jzY1jkGkh5sv0bfHYqGgKOWO1peOrGMkDFM4UmaGMOTgOW8QSexhvixa9sVOiz8MnVOBryWYyw/CEVhj7w==} - - discord.js-selfbot-v13@3.7.1: - resolution: {integrity: sha512-cq5AW/CVvNIUVTSBdZmhsob7v+wjxnkFjuNULcxBXvxutVBnSZqZupsT/9CDtdnT71iKUn9N8GGL6GPg9aZlGA==} - engines: {node: '>=20.18'} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. - - dns-packet@5.6.1: - resolution: {integrity: sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==} - engines: {node: '>=6'} - - duplexer2@0.1.4: - resolution: {integrity: sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - end-of-stream@1.4.5: - resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==} - - execa@9.6.1: - resolution: {integrity: sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA==} - engines: {node: ^18.19.0 || >=20.5.0} - - expand-template@2.0.3: - resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} - engines: {node: '>=6'} - - fast-deep-equal@3.1.3: - resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - - fast-safe-stringify@2.1.1: - resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} - - fdir@6.5.0: - resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} - engines: {node: '>=12.0.0'} - peerDependencies: - picomatch: ^3 || ^4 - peerDependenciesMeta: - picomatch: - optional: true - - fetch-cookie@3.1.0: - resolution: {integrity: sha512-s/XhhreJpqH0ftkGVcQt8JE9bqk+zRn4jF5mPJXWZeQMCI5odV9K+wEWYbnzFPHgQZlvPSMjS4n4yawWE8RINw==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - filter-obj@5.1.0: - resolution: {integrity: sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==} - engines: {node: '>=14.16'} - - find-process@2.0.0: - resolution: {integrity: sha512-YUBQnteWGASJoEVVsOXy6XtKAY2O1FCsWnnvQ8y0YwgY1rZiKeVptnFvMu6RSELZAJOGklqseTnUGGs5D0bKmg==} - hasBin: true - - find-up@4.1.0: - resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} - engines: {node: '>=8'} - - flatstr@1.0.12: - resolution: {integrity: sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw==} - - fluent-ffmpeg-simplified@0.1.0: - resolution: {integrity: sha512-u3McLUh6H6/hhXYxfZcSGwCJAAlN8wsCCPZjVpaK9HIIvmjOB3G584H3PAWZb/ZQTHVKUrzhjNEYMXZXZjOR+g==} - - fs-constants@1.0.0: - resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} - - fs-extra@11.3.3: - resolution: {integrity: sha512-VWSRii4t0AFm6ixFFmLLx1t7wS1gh+ckoa84aOeapGum0h+EZd1EhEumSB+ZdDLnEPuucsVB9oB7cxJHap6Afg==} - engines: {node: '>=14.14'} - - generate-function@2.3.1: - resolution: {integrity: sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==} - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-stream@9.0.1: - resolution: {integrity: sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==} - engines: {node: '>=18'} - - github-from-package@0.0.0: - resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - human-signals@8.0.1: - resolution: {integrity: sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ==} - engines: {node: '>=18.18.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore@5.3.2: - resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} - engines: {node: '>= 4'} - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - ini@1.3.8: - resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} - - int64-buffer@1.1.0: - resolution: {integrity: sha512-94smTCQOvigN4d/2R/YDjz8YVG0Sufvv2aAh8P5m42gwhCsDAJqnbNOrxJsrADuAFAA69Q/ptGzxvNcNuIJcvw==} - - ip@2.0.1: - resolution: {integrity: sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-plain-obj@4.1.0: - resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} - engines: {node: '>=12'} - - is-plain-object@2.0.4: - resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} - engines: {node: '>=0.10.0'} - - is-property@1.0.2: - resolution: {integrity: sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==} - - is-stream@4.0.1: - resolution: {integrity: sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==} - engines: {node: '>=18'} - - is-unicode-supported@2.1.0: - resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} - engines: {node: '>=18'} - - isarray@1.0.0: - resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} - - isbinaryfile@5.0.7: - resolution: {integrity: sha512-gnWD14Jh3FzS3CPhF0AxNOJ8CxqeblPTADzI38r0wt8ZyQl5edpy75myt08EG2oKvpyiqSqsx+Wkz9vtkbTqYQ==} - engines: {node: '>= 18.0.0'} - - isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - - isobject@3.0.1: - resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} - engines: {node: '>=0.10.0'} - - jsonfile@6.2.0: - resolution: {integrity: sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==} - - locate-path@5.0.0: - resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} - engines: {node: '>=8'} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - loglevel@1.9.2: - resolution: {integrity: sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==} - engines: {node: '>= 0.6.0'} - - map-lru@2.1.0: - resolution: {integrity: sha512-Fa9E3knqtjzLtgtz49B2LjEFUH1asuG4iX7nA4rrlRq6Ey75xvi3hqvHnhs6IAj06o8ldasoFLEQtTATGD/GgA==} - engines: {node: '>=12'} - - mimic-response@3.1.0: - resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} - engines: {node: '>=10'} - - minimist@1.2.8: - resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - - mkdirp-classic@0.5.3: - resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} - - mlly@1.8.0: - resolution: {integrity: sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==} - - mp4box@0.5.4: - resolution: {integrity: sha512-GcCH0fySxBurJtvr0dfhz0IxHZjc1RP+F+I8xw+LIwkU1a+7HJx8NCDiww1I5u4Hz6g4eR1JlGADEGJ9r4lSfA==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - multicast-dns@7.2.5: - resolution: {integrity: sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==} - hasBin: true - - napi-build-utils@2.0.0: - resolution: {integrity: sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==} - - node-abi@3.87.0: - resolution: {integrity: sha512-+CGM1L1CgmtheLcBuleyYOn7NWPVu0s0EJH2C4puxgEZb9h8QpR9G2dBfZJOAUhi7VQxuBPMd0hiISWcTyiYyQ==} - engines: {node: '>=10'} - - node-addon-api@8.5.0: - resolution: {integrity: sha512-/bRZty2mXUIFY/xU5HLvveNHlswNJej+RnxBjOMkidWfwZzgTbPG1E3K5TOxRLOR+5hX7bSofy8yf1hZevMS8A==} - engines: {node: ^18 || ^20 || >= 21} - - node-av@5.2.2: - resolution: {integrity: sha512-uon3CnM54pW2yiF0q8t1AKljNxXkUeafobXGyNIpOdGtRz/naqBz/uqX6j+d3IaTPyCHkJvq0SZPtA68XMlNRw==} - - node-int64@0.4.0: - resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} - - npm-run-path@6.0.0: - resolution: {integrity: sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==} - engines: {node: '>=18'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - otplib@12.0.1: - resolution: {integrity: sha512-xDGvUOQjop7RDgxTQ+o4pOol0/3xSZzawTiPKRrHnQWAy0WjhNs/5HdIDJCrqC4MBynmjXgULc6YfioaxZeFgg==} - - p-cancelable@2.1.1: - resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==} - engines: {node: '>=8'} - - p-debounce@5.1.0: - resolution: {integrity: sha512-3DNQmB7HPRMSuZ9P8JQFzEr7156s1S5Lqpi3mSrsZe5AHvl4ONfGrdB5azWqeOpNejQiemgQBkyU+IDKR5nwyg==} - engines: {node: '>=20'} - - p-limit@2.3.0: - resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} - engines: {node: '>=6'} - - p-locate@4.1.0: - resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} - engines: {node: '>=8'} - - p-try@2.2.0: - resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} - engines: {node: '>=6'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} - - path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} - - path-key@4.0.0: - resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} - engines: {node: '>=12'} - - pathe@2.0.3: - resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} - - picomatch@4.0.3: - resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} - engines: {node: '>=12'} - - pkg-pr-new@0.0.62: - resolution: {integrity: sha512-K2jtf1PLCJJFDimQIpasPXDdnRTZSYPy36Ldz+QhMpLz2YN1Wi0ZQkomVt5Wi3NdBZcYuYGXekyFWfJ6fAHYjg==} - hasBin: true - - pkg-types@1.3.1: - resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} - - pngjs@5.0.0: - resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==} - engines: {node: '>=10.13.0'} - - prebuild-install@7.1.3: - resolution: {integrity: sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==} - engines: {node: '>=10'} - hasBin: true - - pretty-ms@9.3.0: - resolution: {integrity: sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ==} - engines: {node: '>=18'} - - prism-media@1.3.5: - resolution: {integrity: sha512-IQdl0Q01m4LrkN1EGIE9lphov5Hy7WWlH6ulf5QdGePLlPas9p2mhgddTEHrlaXYjjFToM1/rWuwF37VF4taaA==} - peerDependencies: - '@discordjs/opus': '>=0.8.0 <1.0.0' - ffmpeg-static: ^5.0.2 || ^4.2.7 || ^3.0.0 || ^2.4.0 - node-opus: ^0.3.3 - opusscript: ^0.0.8 - peerDependenciesMeta: - '@discordjs/opus': - optional: true - ffmpeg-static: - optional: true - node-opus: - optional: true - opusscript: - optional: true - - process-nextick-args@2.0.1: - resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} - - pump@3.0.3: - resolution: {integrity: sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==} - - pvtsutils@1.3.6: - resolution: {integrity: sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg==} - - pvutils@1.1.5: - resolution: {integrity: sha512-KTqnxsgGiQ6ZAzZCVlJH5eOjSnvlyEgx1m8bkRJfOhmGRqfo5KLvmAlACQkrjEtOQ4B7wF9TdSLIs9O90MX9xA==} - engines: {node: '>=16.0.0'} - - qrcode@1.5.4: - resolution: {integrity: sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==} - engines: {node: '>=10.13.0'} - hasBin: true - - query-registry@3.0.1: - resolution: {integrity: sha512-M9RxRITi2mHMVPU5zysNjctUT8bAPx6ltEXo/ir9+qmiM47Y7f0Ir3+OxUO5OjYAWdicBQRew7RtHtqUXydqlg==} - engines: {node: '>=20'} - - query-string@9.3.1: - resolution: {integrity: sha512-5fBfMOcDi5SA9qj5jZhWAcTtDfKF5WFdd2uD9nVNlbxVv1baq65aALy6qofpNEGELHvisjjasxQp7BlM9gvMzw==} - engines: {node: '>=18'} - - quick-lru@7.3.0: - resolution: {integrity: sha512-k9lSsjl36EJdK7I06v7APZCbyGT2vMTsYSRX1Q2nbYmnkBqgUhRkAuzH08Ciotteu/PLJmIF2+tti7o3C/ts2g==} - engines: {node: '>=18'} - - rc@1.2.8: - resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} - hasBin: true - - readable-stream@2.3.8: - resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - reflect-metadata@0.2.2: - resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - require-main-filename@2.0.0: - resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} - - rx.mini@1.4.0: - resolution: {integrity: sha512-8w5cSc1mwNja7fl465DXOkVvIOkpvh2GW4jo31nAIvX4WTXCsRnKJGUfiDBzWtYRInEcHAUYIZfzusjIrea8gA==} - - safe-buffer@5.1.2: - resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} - - semver@7.7.3: - resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} - engines: {node: '>=10'} - hasBin: true - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-cookie-parser@2.7.2: - resolution: {integrity: sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==} - - sharp@0.34.5: - resolution: {integrity: sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - - shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} - - shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - simple-concat@1.0.1: - resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} - - simple-get@4.0.1: - resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==} - - sonic-boom@4.2.0: - resolution: {integrity: sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==} - - split-on-first@3.0.0: - resolution: {integrity: sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA==} - engines: {node: '>=12'} - - string-argv@0.3.2: - resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} - engines: {node: '>=0.6.19'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string_decoder@1.1.1: - resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-final-newline@4.0.0: - resolution: {integrity: sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==} - engines: {node: '>=18'} - - strip-json-comments@2.0.1: - resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} - engines: {node: '>=0.10.0'} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar-fs@2.1.4: - resolution: {integrity: sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==} - - tar-stream@2.2.0: - resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} - engines: {node: '>=6'} - - thirty-two@1.0.2: - resolution: {integrity: sha512-OEI0IWCe+Dw46019YLl6V10Us5bi574EvlJEOcAkB29IzQ/mYD1A6RyNHLjZPiHCmuodxvgF6U+vZO1L15lxVA==} - engines: {node: '>=0.2.6'} - - thunky@1.1.0: - resolution: {integrity: sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==} - - tinyglobby@0.2.15: - resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} - engines: {node: '>=12.0.0'} - - tldts-core@6.1.86: - resolution: {integrity: sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==} - - tldts@6.1.86: - resolution: {integrity: sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==} - hasBin: true - - tough-cookie@5.1.2: - resolution: {integrity: sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==} - engines: {node: '>=16'} - - tree-kill@1.2.2: - resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} - hasBin: true - - ts-mixer@6.0.4: - resolution: {integrity: sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA==} - - tslib@1.14.1: - resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} - - tslib@2.8.1: - resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - - tsyringe@4.10.0: - resolution: {integrity: sha512-axr3IdNuVIxnaK5XGEUFTu3YmAQ6lllgrvqfEoR16g/HGnYY/6We4oWENtAnzK6/LpJ2ur9PAb80RBt7/U4ugw==} - engines: {node: '>= 6.0.0'} - - tunnel-agent@0.6.0: - resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} - - tunnel@0.0.6: - resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} - engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} - - turbo-crc32@1.0.1: - resolution: {integrity: sha512-8yyRd1ZdNp+AQLGqi3lTaA2k81JjlIZOyFQEsi7GQWBgirnQOxjqVtDEbYHM2Z4yFdJ5AQw0fxBLLnDCl6RXoQ==} - engines: {node: '>=6'} - - tweetnacl@1.0.3: - resolution: {integrity: sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==} - - type-detect@4.1.0: - resolution: {integrity: sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==} - engines: {node: '>=4'} - - typescript@5.9.3: - resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} - engines: {node: '>=14.17'} - hasBin: true - - ufo@1.6.1: - resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==} - - undici-types@7.16.0: - resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} - - undici@5.29.0: - resolution: {integrity: sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==} - engines: {node: '>=14.0'} - - undici@6.22.0: - resolution: {integrity: sha512-hU/10obOIu62MGYjdskASR3CUAiYaFTtC9Pa6vHyf//mAipSvSQg6od2CnJswq7fvzNS3zJhxoRkgNVaHurWKw==} - engines: {node: '>=18.17'} - - undici@7.16.0: - resolution: {integrity: sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g==} - engines: {node: '>=20.18.1'} - - unicorn-magic@0.3.0: - resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - universalify@2.0.1: - resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} - engines: {node: '>= 10.0.0'} - - unzipper@0.12.3: - resolution: {integrity: sha512-PZ8hTS+AqcGxsaQntl3IRBw65QrBI6lxzqDEL7IAo/XCEqRTKGfOX56Vea5TH9SZczRVxuzk1re04z/YjuYCJA==} - - url-join@5.0.0: - resolution: {integrity: sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - validate-npm-package-name@5.0.1: - resolution: {integrity: sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - werift-common@0.0.3: - resolution: {integrity: sha512-ma3E4BqKTyZVLhrdfTVs2T1tg9seeUtKMRn5e64LwgrogWa62+3LAUoLBUSl1yPWhgSkXId7GmcHuWDen9IJeQ==} - engines: {node: '>=16'} - - werift-dtls@0.5.7: - resolution: {integrity: sha512-z2fjbP7fFUFmu/Ky4bCKXzdgPTtmSY1DYi0TUf3GG2zJT4jMQ3TQmGY8y7BSSNGetvL4h3pRZ5un0EcSOWpPog==} - engines: {node: '>=16'} - - werift-ice@0.2.2: - resolution: {integrity: sha512-td52pHp+JmFnUn5jfDr/SSNO0dMCbknhuPdN1tFp9cfRj5jaktN63qnAdUuZC20QCC3ETWdsOthcm+RalHpFCQ==} - - werift-rtp@0.8.8: - resolution: {integrity: sha512-GiYMSdvCyScQaw5bnEsraSoHUVZpjfokJAiLV4R1FsiB06t6XiebPYPpkqB9nYNNKiA8Z/cYWsym7wISq1sYSQ==} - engines: {node: '>=10'} - - werift-sctp@0.0.6: - resolution: {integrity: sha512-SaGrPvkXIPGHyY58Y8TV6vee3vpYHNyvMTWdu+c6SokG3ob8tfofHLKWdO1Zu3ypNV5pL9bxBuQMzOPM3N34fg==} - engines: {node: '>=10'} - - werift@0.22.4: - resolution: {integrity: sha512-N/Jgh82cjhxTusQSJzAmgQhrqPcUrytlybrh45VoggusHEsw7Q8S8uhPD+5nvgDM8FYyjJ0BcMGg5vbvalWi0A==} - engines: {node: '>=16'} - - which-module@2.0.1: - resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} - - which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - ws@8.18.3: - resolution: {integrity: sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - - y18n@4.0.3: - resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} - - yargs-parser@18.1.3: - resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} - engines: {node: '>=6'} - - yargs@15.4.1: - resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} - engines: {node: '>=8'} - - yoctocolors@2.1.2: - resolution: {integrity: sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==} - engines: {node: '>=18'} - - zeromq@6.5.0: - resolution: {integrity: sha512-vWOrt19lvcXTxu5tiHXfEGQuldSlU+qZn2TT+4EbRQzaciWGwNZ99QQTolQOmcwVgZLodv+1QfC6UZs2PX/6pQ==} - engines: {node: '>= 12'} - - zod-package-json@1.2.0: - resolution: {integrity: sha512-tamtgPM3MkP+obfO2dLr/G+nYoYkpJKmuHdYEy6IXRKfLybruoJ5NUj0lM0LxwOpC9PpoGLbll1ecoeyj43Wsg==} - engines: {node: '>=20'} - - zod@3.25.76: - resolution: {integrity: sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==} - -snapshots: - - '@actions/core@1.11.1': - dependencies: - '@actions/exec': 1.1.1 - '@actions/http-client': 2.2.3 - - '@actions/exec@1.1.1': - dependencies: - '@actions/io': 1.1.3 - - '@actions/http-client@2.2.3': - dependencies: - tunnel: 0.0.6 - undici: 5.29.0 - - '@actions/io@1.1.3': {} - - '@babel/runtime@7.28.6': {} - - '@biomejs/biome@2.3.8': - optionalDependencies: - '@biomejs/cli-darwin-arm64': 2.3.8 - '@biomejs/cli-darwin-x64': 2.3.8 - '@biomejs/cli-linux-arm64': 2.3.8 - '@biomejs/cli-linux-arm64-musl': 2.3.8 - '@biomejs/cli-linux-x64': 2.3.8 - '@biomejs/cli-linux-x64-musl': 2.3.8 - '@biomejs/cli-win32-arm64': 2.3.8 - '@biomejs/cli-win32-x64': 2.3.8 - - '@biomejs/cli-darwin-arm64@2.3.8': - optional: true - - '@biomejs/cli-darwin-x64@2.3.8': - optional: true - - '@biomejs/cli-linux-arm64-musl@2.3.8': - optional: true - - '@biomejs/cli-linux-arm64@2.3.8': - optional: true - - '@biomejs/cli-linux-x64-musl@2.3.8': - optional: true - - '@biomejs/cli-linux-x64@2.3.8': - optional: true - - '@biomejs/cli-win32-arm64@2.3.8': - optional: true - - '@biomejs/cli-win32-x64@2.3.8': - optional: true - - '@discordjs/builders@1.13.1': - dependencies: - '@discordjs/formatters': 0.6.2 - '@discordjs/util': 1.2.0 - '@sapphire/shapeshift': 4.0.0 - discord-api-types: 0.38.37 - fast-deep-equal: 3.1.3 - ts-mixer: 6.0.4 - tslib: 2.8.1 - - '@discordjs/collection@2.1.1': {} - - '@discordjs/formatters@0.6.2': - dependencies: - discord-api-types: 0.38.37 - - '@discordjs/util@1.2.0': - dependencies: - discord-api-types: 0.38.37 - - '@emnapi/core@1.7.1': - dependencies: - '@emnapi/wasi-threads': 1.1.0 - tslib: 2.8.1 - optional: true - - '@emnapi/runtime@1.7.1': - dependencies: - tslib: 2.8.1 - optional: true - - '@emnapi/wasi-threads@1.1.0': - dependencies: - tslib: 2.8.1 - optional: true - - '@fastify/busboy@2.1.1': {} - - '@fidm/asn1@1.0.4': {} - - '@fidm/x509@1.2.1': - dependencies: - '@fidm/asn1': 1.0.4 - tweetnacl: 1.0.3 - - '@img/colour@1.0.0': {} - - '@img/sharp-darwin-arm64@0.34.5': - optionalDependencies: - '@img/sharp-libvips-darwin-arm64': 1.2.4 - optional: true - - '@img/sharp-darwin-x64@0.34.5': - optionalDependencies: - '@img/sharp-libvips-darwin-x64': 1.2.4 - optional: true - - '@img/sharp-libvips-darwin-arm64@1.2.4': - optional: true - - '@img/sharp-libvips-darwin-x64@1.2.4': - optional: true - - '@img/sharp-libvips-linux-arm64@1.2.4': - optional: true - - '@img/sharp-libvips-linux-arm@1.2.4': - optional: true - - '@img/sharp-libvips-linux-ppc64@1.2.4': - optional: true - - '@img/sharp-libvips-linux-riscv64@1.2.4': - optional: true - - '@img/sharp-libvips-linux-s390x@1.2.4': - optional: true - - '@img/sharp-libvips-linux-x64@1.2.4': - optional: true - - '@img/sharp-libvips-linuxmusl-arm64@1.2.4': - optional: true - - '@img/sharp-libvips-linuxmusl-x64@1.2.4': - optional: true - - '@img/sharp-linux-arm64@0.34.5': - optionalDependencies: - '@img/sharp-libvips-linux-arm64': 1.2.4 - optional: true - - '@img/sharp-linux-arm@0.34.5': - optionalDependencies: - '@img/sharp-libvips-linux-arm': 1.2.4 - optional: true - - '@img/sharp-linux-ppc64@0.34.5': - optionalDependencies: - '@img/sharp-libvips-linux-ppc64': 1.2.4 - optional: true - - '@img/sharp-linux-riscv64@0.34.5': - optionalDependencies: - '@img/sharp-libvips-linux-riscv64': 1.2.4 - optional: true - - '@img/sharp-linux-s390x@0.34.5': - optionalDependencies: - '@img/sharp-libvips-linux-s390x': 1.2.4 - optional: true - - '@img/sharp-linux-x64@0.34.5': - optionalDependencies: - '@img/sharp-libvips-linux-x64': 1.2.4 - optional: true - - '@img/sharp-linuxmusl-arm64@0.34.5': - optionalDependencies: - '@img/sharp-libvips-linuxmusl-arm64': 1.2.4 - optional: true - - '@img/sharp-linuxmusl-x64@0.34.5': - optionalDependencies: - '@img/sharp-libvips-linuxmusl-x64': 1.2.4 - optional: true - - '@img/sharp-wasm32@0.34.5': - dependencies: - '@emnapi/runtime': 1.7.1 - optional: true - - '@img/sharp-win32-arm64@0.34.5': - optional: true - - '@img/sharp-win32-ia32@0.34.5': - optional: true - - '@img/sharp-win32-x64@0.34.5': - optional: true - - '@jsdevtools/ez-spawn@3.0.4': - dependencies: - call-me-maybe: 1.0.2 - cross-spawn: 7.0.6 - string-argv: 0.3.2 - type-detect: 4.1.0 - - '@leichtgewicht/ip-codec@2.0.5': {} - - '@lng2004/node-datachannel@0.32.0-20260202': - dependencies: - prebuild-install: 7.1.3 - - '@minhducsun2002/leb128@1.0.0': {} - - '@napi-rs/wasm-runtime@1.1.0': - dependencies: - '@emnapi/core': 1.7.1 - '@emnapi/runtime': 1.7.1 - '@tybys/wasm-util': 0.10.1 - optional: true - - '@noble/curves@1.9.7': - dependencies: - '@noble/hashes': 1.8.0 - - '@noble/hashes@1.8.0': {} - - '@octokit/action@6.1.0': - dependencies: - '@octokit/auth-action': 4.1.0 - '@octokit/core': 5.2.2 - '@octokit/plugin-paginate-rest': 9.2.2(@octokit/core@5.2.2) - '@octokit/plugin-rest-endpoint-methods': 10.4.1(@octokit/core@5.2.2) - '@octokit/types': 12.6.0 - undici: 6.22.0 - - '@octokit/auth-action@4.1.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/types': 13.10.0 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.2': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.1 - '@octokit/request': 8.4.1 - '@octokit/request-error': 5.1.1 - '@octokit/types': 13.10.0 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.6': - dependencies: - '@octokit/types': 13.10.0 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.1': - dependencies: - '@octokit/request': 8.4.1 - '@octokit/types': 13.10.0 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@20.0.0': {} - - '@octokit/openapi-types@24.2.0': {} - - '@octokit/plugin-paginate-rest@9.2.2(@octokit/core@5.2.2)': - dependencies: - '@octokit/core': 5.2.2 - '@octokit/types': 12.6.0 - - '@octokit/plugin-rest-endpoint-methods@10.4.1(@octokit/core@5.2.2)': - dependencies: - '@octokit/core': 5.2.2 - '@octokit/types': 12.6.0 - - '@octokit/request-error@5.1.1': - dependencies: - '@octokit/types': 13.10.0 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.1': - dependencies: - '@octokit/endpoint': 9.0.6 - '@octokit/request-error': 5.1.1 - '@octokit/types': 13.10.0 - universal-user-agent: 6.0.1 - - '@octokit/types@12.6.0': - dependencies: - '@octokit/openapi-types': 20.0.0 - - '@octokit/types@13.10.0': - dependencies: - '@octokit/openapi-types': 24.2.0 - - '@otplib/core@12.0.1': {} - - '@otplib/plugin-crypto@12.0.1': - dependencies: - '@otplib/core': 12.0.1 - - '@otplib/plugin-thirty-two@12.0.1': - dependencies: - '@otplib/core': 12.0.1 - thirty-two: 1.0.2 - - '@otplib/preset-default@12.0.1': - dependencies: - '@otplib/core': 12.0.1 - '@otplib/plugin-crypto': 12.0.1 - '@otplib/plugin-thirty-two': 12.0.1 - - '@otplib/preset-v11@12.0.1': - dependencies: - '@otplib/core': 12.0.1 - '@otplib/plugin-crypto': 12.0.1 - '@otplib/plugin-thirty-two': 12.0.1 - - '@peculiar/asn1-cms@2.6.0': - dependencies: - '@peculiar/asn1-schema': 2.6.0 - '@peculiar/asn1-x509': 2.6.0 - '@peculiar/asn1-x509-attr': 2.6.0 - asn1js: 3.0.7 - tslib: 2.8.1 - - '@peculiar/asn1-csr@2.6.0': - dependencies: - '@peculiar/asn1-schema': 2.6.0 - '@peculiar/asn1-x509': 2.6.0 - asn1js: 3.0.7 - tslib: 2.8.1 - - '@peculiar/asn1-ecc@2.6.0': - dependencies: - '@peculiar/asn1-schema': 2.6.0 - '@peculiar/asn1-x509': 2.6.0 - asn1js: 3.0.7 - tslib: 2.8.1 - - '@peculiar/asn1-pfx@2.6.0': - dependencies: - '@peculiar/asn1-cms': 2.6.0 - '@peculiar/asn1-pkcs8': 2.6.0 - '@peculiar/asn1-rsa': 2.6.0 - '@peculiar/asn1-schema': 2.6.0 - asn1js: 3.0.7 - tslib: 2.8.1 - - '@peculiar/asn1-pkcs8@2.6.0': - dependencies: - '@peculiar/asn1-schema': 2.6.0 - '@peculiar/asn1-x509': 2.6.0 - asn1js: 3.0.7 - tslib: 2.8.1 - - '@peculiar/asn1-pkcs9@2.6.0': - dependencies: - '@peculiar/asn1-cms': 2.6.0 - '@peculiar/asn1-pfx': 2.6.0 - '@peculiar/asn1-pkcs8': 2.6.0 - '@peculiar/asn1-schema': 2.6.0 - '@peculiar/asn1-x509': 2.6.0 - '@peculiar/asn1-x509-attr': 2.6.0 - asn1js: 3.0.7 - tslib: 2.8.1 - - '@peculiar/asn1-rsa@2.6.0': - dependencies: - '@peculiar/asn1-schema': 2.6.0 - '@peculiar/asn1-x509': 2.6.0 - asn1js: 3.0.7 - tslib: 2.8.1 - - '@peculiar/asn1-schema@2.6.0': - dependencies: - asn1js: 3.0.7 - pvtsutils: 1.3.6 - tslib: 2.8.1 - - '@peculiar/asn1-x509-attr@2.6.0': - dependencies: - '@peculiar/asn1-schema': 2.6.0 - '@peculiar/asn1-x509': 2.6.0 - asn1js: 3.0.7 - tslib: 2.8.1 - - '@peculiar/asn1-x509@2.6.0': - dependencies: - '@peculiar/asn1-schema': 2.6.0 - asn1js: 3.0.7 - pvtsutils: 1.3.6 - tslib: 2.8.1 - - '@peculiar/x509@1.14.3': - dependencies: - '@peculiar/asn1-cms': 2.6.0 - '@peculiar/asn1-csr': 2.6.0 - '@peculiar/asn1-ecc': 2.6.0 - '@peculiar/asn1-pkcs9': 2.6.0 - '@peculiar/asn1-rsa': 2.6.0 - '@peculiar/asn1-schema': 2.6.0 - '@peculiar/asn1-x509': 2.6.0 - pvtsutils: 1.3.6 - reflect-metadata: 0.2.2 - tslib: 2.8.1 - tsyringe: 4.10.0 - - '@sapphire/async-queue@1.5.5': {} - - '@sapphire/shapeshift@4.0.0': - dependencies: - fast-deep-equal: 3.1.3 - lodash: 4.17.21 - - '@sec-ant/readable-stream@0.4.1': {} - - '@seydx/node-av-darwin-arm64@5.2.2': - dependencies: - unzipper: 0.12.3 - optional: true - - '@seydx/node-av-darwin-x64@5.2.2': - dependencies: - unzipper: 0.12.3 - optional: true - - '@seydx/node-av-linux-arm64@5.2.2': - dependencies: - unzipper: 0.12.3 - optional: true - - '@seydx/node-av-linux-x64@5.2.2': - dependencies: - unzipper: 0.12.3 - optional: true - - '@seydx/node-av-win32-arm64-mingw@5.2.2': - dependencies: - unzipper: 0.12.3 - optional: true - - '@seydx/node-av-win32-arm64-msvc@5.2.2': - dependencies: - unzipper: 0.12.3 - optional: true - - '@seydx/node-av-win32-x64-mingw@5.2.2': - dependencies: - unzipper: 0.12.3 - optional: true - - '@seydx/node-av-win32-x64-msvc@5.2.2': - dependencies: - unzipper: 0.12.3 - optional: true - - '@shinyoshiaki/binary-data@0.6.1': - dependencies: - generate-function: 2.3.1 - is-plain-object: 2.0.4 - - '@shinyoshiaki/jspack@0.0.6': {} - - '@sindresorhus/merge-streams@4.0.0': {} - - '@snazzah/davey-android-arm-eabi@0.1.8': - optional: true - - '@snazzah/davey-android-arm64@0.1.8': - optional: true - - '@snazzah/davey-darwin-arm64@0.1.8': - optional: true - - '@snazzah/davey-darwin-x64@0.1.8': - optional: true - - '@snazzah/davey-freebsd-x64@0.1.8': - optional: true - - '@snazzah/davey-linux-arm-gnueabihf@0.1.8': - optional: true - - '@snazzah/davey-linux-arm64-gnu@0.1.8': - optional: true - - '@snazzah/davey-linux-arm64-musl@0.1.8': - optional: true - - '@snazzah/davey-linux-x64-gnu@0.1.8': - optional: true - - '@snazzah/davey-linux-x64-musl@0.1.8': - optional: true - - '@snazzah/davey-wasm32-wasi@0.1.8': - dependencies: - '@napi-rs/wasm-runtime': 1.1.0 - optional: true - - '@snazzah/davey-win32-arm64-msvc@0.1.8': - optional: true - - '@snazzah/davey-win32-ia32-msvc@0.1.8': - optional: true - - '@snazzah/davey-win32-x64-msvc@0.1.8': - optional: true - - '@snazzah/davey@0.1.8': - optionalDependencies: - '@snazzah/davey-android-arm-eabi': 0.1.8 - '@snazzah/davey-android-arm64': 0.1.8 - '@snazzah/davey-darwin-arm64': 0.1.8 - '@snazzah/davey-darwin-x64': 0.1.8 - '@snazzah/davey-freebsd-x64': 0.1.8 - '@snazzah/davey-linux-arm-gnueabihf': 0.1.8 - '@snazzah/davey-linux-arm64-gnu': 0.1.8 - '@snazzah/davey-linux-arm64-musl': 0.1.8 - '@snazzah/davey-linux-x64-gnu': 0.1.8 - '@snazzah/davey-linux-x64-musl': 0.1.8 - '@snazzah/davey-wasm32-wasi': 0.1.8 - '@snazzah/davey-win32-arm64-msvc': 0.1.8 - '@snazzah/davey-win32-ia32-msvc': 0.1.8 - '@snazzah/davey-win32-x64-msvc': 0.1.8 - - '@tybys/wasm-util@0.10.1': - dependencies: - tslib: 2.8.1 - optional: true - - '@types/fluent-ffmpeg@2.1.28': - dependencies: - '@types/node': 25.0.1 - - '@types/node@25.0.1': - dependencies: - undici-types: 7.16.0 - - acorn@8.15.0: {} - - aes-js@3.1.2: {} - - ansi-regex@5.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - asn1js@3.0.7: - dependencies: - pvtsutils: 1.3.6 - pvutils: 1.1.5 - tslib: 2.8.1 - - asyncc@2.0.9: {} - - atomic-sleep@1.0.0: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - bluebird@3.7.2: {} - - buffer-crc32@1.0.0: {} - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - buffer@6.0.3: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-me-maybe@1.0.2: {} - - camelcase@5.3.1: {} - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chownr@1.1.4: {} - - cliui@6.0.0: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - cmake-ts@1.0.2: {} - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - commander@12.1.0: {} - - confbox@0.1.8: {} - - core-util-is@1.0.3: {} - - cross-spawn@7.0.6: - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 - - date-fns@2.30.0: - dependencies: - '@babel/runtime': 7.28.6 - - debug-level@4.1.1: - dependencies: - asyncc: 2.0.9 - chalk: 4.1.2 - fast-safe-stringify: 2.1.1 - flatstr: 1.0.12 - map-lru: 2.1.0 - ms: 2.1.3 - sonic-boom: 4.2.0 - optionalDependencies: - debug: 4.4.3 - transitivePeerDependencies: - - supports-color - - debug@4.4.0: - dependencies: - ms: 2.1.3 - - debug@4.4.3: - dependencies: - ms: 2.1.3 - - decamelize@1.2.0: {} - - decode-uri-component@0.4.1: {} - - decompress-response@6.0.0: - dependencies: - mimic-response: 3.1.0 - - deep-extend@0.6.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.1.2: {} - - dijkstrajs@1.0.3: {} - - discord-api-types@0.38.37: {} - - discord.js-selfbot-v13@3.7.1: - dependencies: - '@discordjs/builders': 1.13.1 - '@discordjs/collection': 2.1.1 - '@sapphire/async-queue': 1.5.5 - '@sapphire/shapeshift': 4.0.0 - discord-api-types: 0.38.37 - fetch-cookie: 3.1.0 - find-process: 2.0.0 - otplib: 12.0.1 - prism-media: 1.3.5 - qrcode: 1.5.4 - tough-cookie: 5.1.2 - tree-kill: 1.2.2 - undici: 7.16.0 - werift-rtp: 0.8.8 - ws: 8.18.3 - transitivePeerDependencies: - - '@discordjs/opus' - - bufferutil - - ffmpeg-static - - node-opus - - opusscript - - utf-8-validate - - dns-packet@5.6.1: - dependencies: - '@leichtgewicht/ip-codec': 2.0.5 - - duplexer2@0.1.4: - dependencies: - readable-stream: 2.3.8 - - emoji-regex@8.0.0: {} - - end-of-stream@1.4.5: - dependencies: - once: 1.4.0 - - execa@9.6.1: - dependencies: - '@sindresorhus/merge-streams': 4.0.0 - cross-spawn: 7.0.6 - figures: 6.1.0 - get-stream: 9.0.1 - human-signals: 8.0.1 - is-plain-obj: 4.1.0 - is-stream: 4.0.1 - npm-run-path: 6.0.0 - pretty-ms: 9.3.0 - signal-exit: 4.1.0 - strip-final-newline: 4.0.0 - yoctocolors: 2.1.2 - - expand-template@2.0.3: {} - - fast-deep-equal@3.1.3: {} - - fast-safe-stringify@2.1.1: {} - - fdir@6.5.0(picomatch@4.0.3): - optionalDependencies: - picomatch: 4.0.3 - - fetch-cookie@3.1.0: - dependencies: - set-cookie-parser: 2.7.2 - tough-cookie: 5.1.2 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.1.0 - - filter-obj@5.1.0: {} - - find-process@2.0.0: - dependencies: - chalk: 4.1.2 - commander: 12.1.0 - loglevel: 1.9.2 - - find-up@4.1.0: - dependencies: - locate-path: 5.0.0 - path-exists: 4.0.0 - - flatstr@1.0.12: {} - - fluent-ffmpeg-simplified@0.1.0: - dependencies: - execa: 9.6.1 - string-argv: 0.3.2 - - fs-constants@1.0.0: {} - - fs-extra@11.3.3: - dependencies: - graceful-fs: 4.2.11 - jsonfile: 6.2.0 - universalify: 2.0.1 - - generate-function@2.3.1: - dependencies: - is-property: 1.0.2 - - get-caller-file@2.0.5: {} - - get-stream@9.0.1: - dependencies: - '@sec-ant/readable-stream': 0.4.1 - is-stream: 4.0.1 - - github-from-package@0.0.0: {} - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - human-signals@8.0.1: {} - - ieee754@1.2.1: {} - - ignore@5.3.2: {} - - inherits@2.0.4: {} - - ini@1.3.8: {} - - int64-buffer@1.1.0: {} - - ip@2.0.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-plain-obj@4.1.0: {} - - is-plain-object@2.0.4: - dependencies: - isobject: 3.0.1 - - is-property@1.0.2: {} - - is-stream@4.0.1: {} - - is-unicode-supported@2.1.0: {} - - isarray@1.0.0: {} - - isbinaryfile@5.0.7: {} - - isexe@2.0.0: {} - - isobject@3.0.1: {} - - jsonfile@6.2.0: - dependencies: - universalify: 2.0.1 - optionalDependencies: - graceful-fs: 4.2.11 - - locate-path@5.0.0: - dependencies: - p-locate: 4.1.0 - - lodash@4.17.21: {} - - loglevel@1.9.2: {} - - map-lru@2.1.0: {} - - mimic-response@3.1.0: {} - - minimist@1.2.8: {} - - mkdirp-classic@0.5.3: {} - - mlly@1.8.0: - dependencies: - acorn: 8.15.0 - pathe: 2.0.3 - pkg-types: 1.3.1 - ufo: 1.6.1 - - mp4box@0.5.4: {} - - ms@2.1.3: {} - - multicast-dns@7.2.5: - dependencies: - dns-packet: 5.6.1 - thunky: 1.1.0 - - napi-build-utils@2.0.0: {} - - node-abi@3.87.0: - dependencies: - semver: 7.7.3 - - node-addon-api@8.5.0: {} - - node-av@5.2.2: - dependencies: - unzipper: 0.12.3 - werift: 0.22.4 - optionalDependencies: - '@seydx/node-av-darwin-arm64': 5.2.2 - '@seydx/node-av-darwin-x64': 5.2.2 - '@seydx/node-av-linux-arm64': 5.2.2 - '@seydx/node-av-linux-x64': 5.2.2 - '@seydx/node-av-win32-arm64-mingw': 5.2.2 - '@seydx/node-av-win32-arm64-msvc': 5.2.2 - '@seydx/node-av-win32-x64-mingw': 5.2.2 - '@seydx/node-av-win32-x64-msvc': 5.2.2 - transitivePeerDependencies: - - supports-color - - node-int64@0.4.0: {} - - npm-run-path@6.0.0: - dependencies: - path-key: 4.0.0 - unicorn-magic: 0.3.0 - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - otplib@12.0.1: - dependencies: - '@otplib/core': 12.0.1 - '@otplib/preset-default': 12.0.1 - '@otplib/preset-v11': 12.0.1 - - p-cancelable@2.1.1: {} - - p-debounce@5.1.0: {} - - p-limit@2.3.0: - dependencies: - p-try: 2.2.0 - - p-locate@4.1.0: - dependencies: - p-limit: 2.3.0 - - p-try@2.2.0: {} - - parse-ms@4.0.0: {} - - path-exists@4.0.0: {} - - path-key@3.1.1: {} - - path-key@4.0.0: {} - - pathe@2.0.3: {} - - picomatch@4.0.3: {} - - pkg-pr-new@0.0.62: - dependencies: - '@actions/core': 1.11.1 - '@jsdevtools/ez-spawn': 3.0.4 - '@octokit/action': 6.1.0 - ignore: 5.3.2 - isbinaryfile: 5.0.7 - pkg-types: 1.3.1 - query-registry: 3.0.1 - tinyglobby: 0.2.15 - - pkg-types@1.3.1: - dependencies: - confbox: 0.1.8 - mlly: 1.8.0 - pathe: 2.0.3 - - pngjs@5.0.0: {} - - prebuild-install@7.1.3: - dependencies: - detect-libc: 2.1.2 - expand-template: 2.0.3 - github-from-package: 0.0.0 - minimist: 1.2.8 - mkdirp-classic: 0.5.3 - napi-build-utils: 2.0.0 - node-abi: 3.87.0 - pump: 3.0.3 - rc: 1.2.8 - simple-get: 4.0.1 - tar-fs: 2.1.4 - tunnel-agent: 0.6.0 - - pretty-ms@9.3.0: - dependencies: - parse-ms: 4.0.0 - - prism-media@1.3.5: {} - - process-nextick-args@2.0.1: {} - - pump@3.0.3: - dependencies: - end-of-stream: 1.4.5 - once: 1.4.0 - - pvtsutils@1.3.6: - dependencies: - tslib: 2.8.1 - - pvutils@1.1.5: {} - - qrcode@1.5.4: - dependencies: - dijkstrajs: 1.0.3 - pngjs: 5.0.0 - yargs: 15.4.1 - - query-registry@3.0.1: - dependencies: - query-string: 9.3.1 - quick-lru: 7.3.0 - url-join: 5.0.0 - validate-npm-package-name: 5.0.1 - zod: 3.25.76 - zod-package-json: 1.2.0 - - query-string@9.3.1: - dependencies: - decode-uri-component: 0.4.1 - filter-obj: 5.1.0 - split-on-first: 3.0.0 - - quick-lru@7.3.0: {} - - rc@1.2.8: - dependencies: - deep-extend: 0.6.0 - ini: 1.3.8 - minimist: 1.2.8 - strip-json-comments: 2.0.1 - - readable-stream@2.3.8: - dependencies: - core-util-is: 1.0.3 - inherits: 2.0.4 - isarray: 1.0.0 - process-nextick-args: 2.0.1 - safe-buffer: 5.1.2 - string_decoder: 1.1.1 - util-deprecate: 1.0.2 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.1.1 - util-deprecate: 1.0.2 - - reflect-metadata@0.2.2: {} - - require-directory@2.1.1: {} - - require-main-filename@2.0.0: {} - - rx.mini@1.4.0: {} - - safe-buffer@5.1.2: {} - - semver@7.7.3: {} - - set-blocking@2.0.0: {} - - set-cookie-parser@2.7.2: {} - - sharp@0.34.5: - dependencies: - '@img/colour': 1.0.0 - detect-libc: 2.1.2 - semver: 7.7.3 - optionalDependencies: - '@img/sharp-darwin-arm64': 0.34.5 - '@img/sharp-darwin-x64': 0.34.5 - '@img/sharp-libvips-darwin-arm64': 1.2.4 - '@img/sharp-libvips-darwin-x64': 1.2.4 - '@img/sharp-libvips-linux-arm': 1.2.4 - '@img/sharp-libvips-linux-arm64': 1.2.4 - '@img/sharp-libvips-linux-ppc64': 1.2.4 - '@img/sharp-libvips-linux-riscv64': 1.2.4 - '@img/sharp-libvips-linux-s390x': 1.2.4 - '@img/sharp-libvips-linux-x64': 1.2.4 - '@img/sharp-libvips-linuxmusl-arm64': 1.2.4 - '@img/sharp-libvips-linuxmusl-x64': 1.2.4 - '@img/sharp-linux-arm': 0.34.5 - '@img/sharp-linux-arm64': 0.34.5 - '@img/sharp-linux-ppc64': 0.34.5 - '@img/sharp-linux-riscv64': 0.34.5 - '@img/sharp-linux-s390x': 0.34.5 - '@img/sharp-linux-x64': 0.34.5 - '@img/sharp-linuxmusl-arm64': 0.34.5 - '@img/sharp-linuxmusl-x64': 0.34.5 - '@img/sharp-wasm32': 0.34.5 - '@img/sharp-win32-arm64': 0.34.5 - '@img/sharp-win32-ia32': 0.34.5 - '@img/sharp-win32-x64': 0.34.5 - - shebang-command@2.0.0: - dependencies: - shebang-regex: 3.0.0 - - shebang-regex@3.0.0: {} - - signal-exit@4.1.0: {} - - simple-concat@1.0.1: {} - - simple-get@4.0.1: - dependencies: - decompress-response: 6.0.0 - once: 1.4.0 - simple-concat: 1.0.1 - - sonic-boom@4.2.0: - dependencies: - atomic-sleep: 1.0.0 - - split-on-first@3.0.0: {} - - string-argv@0.3.2: {} - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string_decoder@1.1.1: - dependencies: - safe-buffer: 5.1.2 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-final-newline@4.0.0: {} - - strip-json-comments@2.0.1: {} - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar-fs@2.1.4: - dependencies: - chownr: 1.1.4 - mkdirp-classic: 0.5.3 - pump: 3.0.3 - tar-stream: 2.2.0 - - tar-stream@2.2.0: - dependencies: - bl: 4.1.0 - end-of-stream: 1.4.5 - fs-constants: 1.0.0 - inherits: 2.0.4 - readable-stream: 3.6.2 - - thirty-two@1.0.2: {} - - thunky@1.1.0: {} - - tinyglobby@0.2.15: - dependencies: - fdir: 6.5.0(picomatch@4.0.3) - picomatch: 4.0.3 - - tldts-core@6.1.86: {} - - tldts@6.1.86: - dependencies: - tldts-core: 6.1.86 - - tough-cookie@5.1.2: - dependencies: - tldts: 6.1.86 - - tree-kill@1.2.2: {} - - ts-mixer@6.0.4: {} - - tslib@1.14.1: {} - - tslib@2.8.1: {} - - tsyringe@4.10.0: - dependencies: - tslib: 1.14.1 - - tunnel-agent@0.6.0: - dependencies: - safe-buffer: 5.1.2 - - tunnel@0.0.6: {} - - turbo-crc32@1.0.1: {} - - tweetnacl@1.0.3: {} - - type-detect@4.1.0: {} - - typescript@5.9.3: {} - - ufo@1.6.1: {} - - undici-types@7.16.0: {} - - undici@5.29.0: - dependencies: - '@fastify/busboy': 2.1.1 - - undici@6.22.0: {} - - undici@7.16.0: {} - - unicorn-magic@0.3.0: {} - - universal-user-agent@6.0.1: {} - - universalify@2.0.1: {} - - unzipper@0.12.3: - dependencies: - bluebird: 3.7.2 - duplexer2: 0.1.4 - fs-extra: 11.3.3 - graceful-fs: 4.2.11 - node-int64: 0.4.0 - - url-join@5.0.0: {} - - util-deprecate@1.0.2: {} - - validate-npm-package-name@5.0.1: {} - - werift-common@0.0.3: - dependencies: - '@shinyoshiaki/jspack': 0.0.6 - debug: 4.4.3 - transitivePeerDependencies: - - supports-color - - werift-dtls@0.5.7: - dependencies: - '@fidm/x509': 1.2.1 - '@noble/curves': 1.9.7 - '@peculiar/x509': 1.14.3 - '@shinyoshiaki/binary-data': 0.6.1 - date-fns: 2.30.0 - lodash: 4.17.21 - rx.mini: 1.4.0 - tweetnacl: 1.0.3 - - werift-ice@0.2.2: - dependencies: - '@shinyoshiaki/jspack': 0.0.6 - buffer-crc32: 1.0.0 - debug: 4.4.3 - int64-buffer: 1.1.0 - ip: 2.0.1 - lodash: 4.17.21 - multicast-dns: 7.2.5 - p-cancelable: 2.1.1 - rx.mini: 1.4.0 - transitivePeerDependencies: - - supports-color - - werift-rtp@0.8.8: - dependencies: - '@minhducsun2002/leb128': 1.0.0 - '@shinyoshiaki/jspack': 0.0.6 - aes-js: 3.1.2 - buffer: 6.0.3 - mp4box: 0.5.4 - - werift-sctp@0.0.6: - dependencies: - '@shinyoshiaki/binary-data': 0.6.1 - '@shinyoshiaki/jspack': 0.0.6 - lodash: 4.17.21 - rx.mini: 1.4.0 - turbo-crc32: 1.0.1 - - werift@0.22.4: - dependencies: - '@fidm/x509': 1.2.1 - '@minhducsun2002/leb128': 1.0.0 - '@noble/curves': 1.9.7 - '@peculiar/x509': 1.14.3 - '@shinyoshiaki/binary-data': 0.6.1 - '@shinyoshiaki/jspack': 0.0.6 - aes-js: 3.1.2 - buffer: 6.0.3 - buffer-crc32: 1.0.0 - debug: 4.4.0 - fast-deep-equal: 3.1.3 - int64-buffer: 1.1.0 - ip: 2.0.1 - mp4box: 0.5.4 - multicast-dns: 7.2.5 - turbo-crc32: 1.0.1 - tweetnacl: 1.0.3 - werift-common: 0.0.3 - werift-dtls: 0.5.7 - werift-ice: 0.2.2 - werift-rtp: 0.8.8 - werift-sctp: 0.0.6 - transitivePeerDependencies: - - supports-color - - which-module@2.0.1: {} - - which@2.0.2: - dependencies: - isexe: 2.0.0 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - ws@8.18.3: {} - - y18n@4.0.3: {} - - yargs-parser@18.1.3: - dependencies: - camelcase: 5.3.1 - decamelize: 1.2.0 - - yargs@15.4.1: - dependencies: - cliui: 6.0.0 - decamelize: 1.2.0 - find-up: 4.1.0 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - require-main-filename: 2.0.0 - set-blocking: 2.0.0 - string-width: 4.2.3 - which-module: 2.0.1 - y18n: 4.0.3 - yargs-parser: 18.1.3 - - yoctocolors@2.1.2: {} - - zeromq@6.5.0: - dependencies: - cmake-ts: 1.0.2 - node-addon-api: 8.5.0 - - zod-package-json@1.2.0: - dependencies: - zod: 3.25.76 - - zod@3.25.76: {} diff --git a/vendor/discord-video-stream/src/client/GatewayEvents.ts b/vendor/discord-video-stream/src/client/GatewayEvents.ts deleted file mode 100644 index 102a22b..0000000 --- a/vendor/discord-video-stream/src/client/GatewayEvents.ts +++ /dev/null @@ -1,48 +0,0 @@ -type GatewayEventGeneric = { - t: Type; - d: Data; -}; - -export namespace GatewayEvent { - export type VoiceStateUpdate = GatewayEventGeneric< - "VOICE_STATE_UPDATE", - { - user_id: string; - session_id: string; - } - >; - export type VoiceServerUpdate = GatewayEventGeneric< - "VOICE_SERVER_UPDATE", - { - guild_id: string; - channel_id?: string; - endpoint: string; - token: string; - } - >; - export type StreamCreate = GatewayEventGeneric< - "STREAM_CREATE", - { - stream_key: string; - rtc_server_id: string; - } - >; - export type StreamServerUpdate = GatewayEventGeneric< - "STREAM_SERVER_UPDATE", - { - stream_key: string; - endpoint: string; - token: string; - } - >; -} - -export type GatewayEvent = - | GatewayEvent.VoiceStateUpdate - | GatewayEvent.VoiceServerUpdate - | GatewayEvent.StreamCreate - | GatewayEvent.StreamServerUpdate; - -export type GatewayEventMap = { - [E in GatewayEvent as E["t"]]: [E["d"]]; -}; diff --git a/vendor/discord-video-stream/src/client/GatewayOpCodes.ts b/vendor/discord-video-stream/src/client/GatewayOpCodes.ts deleted file mode 100644 index 2a83f15..0000000 --- a/vendor/discord-video-stream/src/client/GatewayOpCodes.ts +++ /dev/null @@ -1,40 +0,0 @@ -export enum GatewayOpCodes { - DISPATCH = 0, - HEARTBEAT = 1, - IDENTIFY = 2, - PRESENCE_UPDATE = 3, - VOICE_STATE_UPDATE = 4, - VOICE_SERVER_PING = 5, - RESUME = 6, - RECONNECT = 7, - REQUEST_GUILD_MEMBERS = 8, - INVALID_SESSION = 9, - HELLO = 10, - HEARTBEAT_ACK = 11, - CALL_CONNECT = 13, - GUILD_SUBSCRIPTIONS = 14, - LOBBY_CONNECT = 15, - LOBBY_DISCONNECT = 16, - LOBBY_VOICE_STATES_UPDATE = 17, - STREAM_CREATE = 18, - STREAM_DELETE = 19, - STREAM_WATCH = 20, - STREAM_PING = 21, - STREAM_SET_PAUSED = 22, - REQUEST_GUILD_APPLICATION_COMMANDS = 24, - EMBEDDED_ACTIVITY_LAUNCH = 25, - EMBEDDED_ACTIVITY_CLOSE = 26, - EMBEDDED_ACTIVITY_UPDATE = 27, - REQUEST_FORUM_UNREADS = 28, - REMOTE_COMMAND = 29, - GET_DELETED_ENTITY_IDS_NOT_MATCHING_HASH = 30, - REQUEST_SOUNDBOARD_SOUNDS = 31, - SPEED_TEST_CREATE = 32, - SPEED_TEST_DELETE = 33, - REQUEST_LAST_MESSAGES = 34, - SEARCH_RECENT_MEMBERS = 35, - REQUEST_CHANNEL_STATUSES = 36, - GUILD_SUBSCRIPTIONS_BULK = 37, - GUILD_CHANNELS_RESYNC = 38, - REQUEST_CHANNEL_MEMBER_COUNT = 39, -} diff --git a/vendor/discord-video-stream/src/client/Streamer.ts b/vendor/discord-video-stream/src/client/Streamer.ts deleted file mode 100644 index b3d2124..0000000 --- a/vendor/discord-video-stream/src/client/Streamer.ts +++ /dev/null @@ -1,259 +0,0 @@ -import { EventEmitter } from "node:events"; -import { VoiceConnection } from "./voice/VoiceConnection.js"; -import { StreamConnection } from "./voice/StreamConnection.js"; -import { GatewayOpCodes } from "./GatewayOpCodes.js"; -import type { - Client, - DMChannel, - GroupDMChannel, - VoiceBasedChannel, -} from "discord.js-selfbot-v13"; -import type { GatewayEvent, GatewayEventMap } from "./GatewayEvents.js"; -import type { WebRtcConnWrapper } from "./voice/WebRtcWrapper.js"; -import { generateStreamKey, parseStreamKey } from "../utils.js"; - -export class Streamer { - private _voiceConnection?: VoiceConnection; - private _client: Client; - private _gatewayEmitter = new EventEmitter(); - - constructor(client: Client) { - this._client = client; - - //listen for messages - this.client.on("raw", (packet: GatewayEvent) => { - // @ts-expect-error I don't know how to make this work with TypeScript, so whatever - this._gatewayEmitter.emit(packet.t, packet.d); - }); - } - - public get client(): Client { - return this._client; - } - - public get opts() { - return {}; - } - - public get voiceConnection(): VoiceConnection | undefined { - return this._voiceConnection; - } - - public sendOpcode(code: number, data: unknown): void { - this.client.ws.broadcast({ - op: code, - d: data, - }); - } - - public joinVoiceChannel( - channel: DMChannel | GroupDMChannel | VoiceBasedChannel, - ): Promise { - let guildId: string | null = null; - - if ( - channel.type === "GUILD_STAGE_VOICE" || - channel.type === "GUILD_VOICE" - ) { - guildId = channel.guildId; - } - - return this.joinVoice(guildId, channel.id); - } - - /** - * Joins a voice channel and returns a WebRtcConnWrapper object. - * @param guild_id the guild id of the voice channel. If null, it will join a DM voice channel. - * @param channel_id the channel id of the voice channel - * @returns the WebRtcConnWrapper object - * @throws Error if the client is not logged in - */ - public joinVoice( - guild_id: string | null, - channel_id: string, - ): Promise { - return new Promise((resolve, reject) => { - if (!this.client.user) { - reject("Client not logged in"); - return; - } - const user_id = this.client.user.id; - const voiceConn = new VoiceConnection( - this, - guild_id, - user_id, - channel_id, - (conn) => { - resolve(conn); - }, - ); - this._voiceConnection = voiceConn; - this._gatewayEmitter.on("VOICE_STATE_UPDATE", (d) => { - if (user_id !== d.user_id) return; - voiceConn.setSession(d.session_id); - }); - this._gatewayEmitter.on("VOICE_SERVER_UPDATE", (d) => { - if (guild_id !== d.guild_id) return; - - // channel_id is not set for guild voice calls - if (d.channel_id && channel_id !== d.channel_id) return; - - voiceConn.setTokens(d.endpoint, d.token); - }); - this.signalVideo(false); - }); - } - - public createStream(): Promise { - return new Promise((resolve, reject) => { - if (!this.client.user) { - reject("Client not logged in"); - return; - } - if (!this.voiceConnection) { - reject("cannot start stream without first joining voice channel"); - return; - } - - this.signalStream(); - const { - guildId: clientGuildId, - channelId: clientChannelId, - session_id, - } = this.voiceConnection; - const { id: clientUserId } = this.client.user; - - if (!session_id) throw new Error("Session doesn't exist yet"); - const streamConn = new StreamConnection( - this, - clientGuildId, - clientUserId, - clientChannelId, - (conn) => { - resolve(conn); - }, - ); - this.voiceConnection.streamConnection = streamConn; - this._gatewayEmitter.on("STREAM_CREATE", (d) => { - const { channelId, guildId, userId } = parseStreamKey(d.stream_key); - - if ( - clientGuildId !== guildId || - clientChannelId !== channelId || - clientUserId !== userId - ) - return; - - streamConn.serverId = d.rtc_server_id; - streamConn.streamKey = d.stream_key; - streamConn.setSession(session_id); - }); - this._gatewayEmitter.on("STREAM_SERVER_UPDATE", (d) => { - const { channelId, guildId, userId } = parseStreamKey(d.stream_key); - - if ( - clientGuildId !== guildId || - clientChannelId !== channelId || - clientUserId !== userId - ) - return; - - streamConn.setTokens(d.endpoint, d.token); - }); - }); - } - - public async setStreamPreview(image: Buffer): Promise { - if (!this.client.token) throw new Error("Please login :)"); - if (!this.voiceConnection?.streamConnection?.guildId) return; - const data = `data:image/jpeg;base64,${image.toString("base64")}`; - const { guildId } = this.voiceConnection.streamConnection; - const server = await this.client.guilds.fetch(guildId); - await server.members.me?.voice.postPreview(data); - } - - public stopStream(): void { - const stream = this.voiceConnection?.streamConnection; - - if (!stream) return; - - stream.stop(); - - this.signalStopStream(); - - this.voiceConnection.streamConnection = undefined; - this._gatewayEmitter.removeAllListeners("STREAM_CREATE"); - this._gatewayEmitter.removeAllListeners("STREAM_SERVER_UPDATE"); - } - - public leaveVoice(): void { - this.voiceConnection?.stop(); - - this.signalLeaveVoice(); - - this._voiceConnection = undefined; - this._gatewayEmitter.removeAllListeners("VOICE_STATE_UPDATE"); - this._gatewayEmitter.removeAllListeners("VOICE_SERVER_UPDATE"); - } - - public signalVideo(video_enabled: boolean): void { - if (!this.voiceConnection) return; - const { guildId: guild_id, channelId: channel_id } = this.voiceConnection; - this.sendOpcode(GatewayOpCodes.VOICE_STATE_UPDATE, { - guild_id: guild_id, - channel_id, - self_mute: false, - self_deaf: true, - self_video: video_enabled, - }); - } - - public signalStream(): void { - if (!this.voiceConnection) return; - const { - type, - guildId: guild_id, - channelId: channel_id, - botId: user_id, - } = this.voiceConnection; - - const streamKey = generateStreamKey(type, guild_id, channel_id, user_id); - - this.sendOpcode(GatewayOpCodes.STREAM_CREATE, { - type, - guild_id, - channel_id, - preferred_region: null, - }); - - this.sendOpcode(GatewayOpCodes.STREAM_SET_PAUSED, { - stream_key: streamKey, - paused: false, - }); - } - - public signalStopStream(): void { - if (!this.voiceConnection) return; - const { - type, - guildId: guild_id, - channelId: channel_id, - botId: user_id, - } = this.voiceConnection; - - const streamKey = generateStreamKey(type, guild_id, channel_id, user_id); - this.sendOpcode(GatewayOpCodes.STREAM_DELETE, { - stream_key: streamKey, - }); - } - - public signalLeaveVoice(): void { - this.sendOpcode(GatewayOpCodes.VOICE_STATE_UPDATE, { - guild_id: null, - channel_id: null, - self_mute: true, - self_deaf: false, - self_video: false, - }); - } -} diff --git a/vendor/discord-video-stream/src/client/index.ts b/vendor/discord-video-stream/src/client/index.ts deleted file mode 100644 index 4589dcf..0000000 --- a/vendor/discord-video-stream/src/client/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./voice/index.js"; -export * from "./GatewayOpCodes.js"; -export * from "./Streamer.js"; diff --git a/vendor/discord-video-stream/src/client/processing/AnnexBBitstreamReaderWriter.ts b/vendor/discord-video-stream/src/client/processing/AnnexBBitstreamReaderWriter.ts deleted file mode 100644 index 112c484..0000000 --- a/vendor/discord-video-stream/src/client/processing/AnnexBBitstreamReaderWriter.ts +++ /dev/null @@ -1,148 +0,0 @@ -export class AnnexBBitstreamReader { - private _buffer: Buffer; - private _byteOffset = 0; - private _bitOffset = 0; - - constructor(buffer: Buffer) { - this._buffer = buffer; - } - public readBits(count: number) { - if (count === 0) return 0; - let result = 0; - while (count > 0) { - if (this._byteOffset >= this._buffer.length) - throw new Error("Bad byte offset"); - if ( - this._bitOffset === 0 && - this._byteOffset >= 2 && - this._buffer[this._byteOffset - 2] === 0 && - this._buffer[this._byteOffset - 1] === 0 && - this._buffer[this._byteOffset] === 3 - ) { - // Skip over emulation prevention - this._byteOffset++; - } - if (this._bitOffset === 0 && count >= 8) { - // We're byte aligned, read whole bytes and push in - result = (result << 8) | this._buffer[this._byteOffset++]; - count -= 8; - } else { - // Read just enough to get us to the next byte - const numBitsToRead = Math.min(count, 8 - this._bitOffset); - const mask = (1 << numBitsToRead) - 1; - const newBits = - (this._buffer[this._byteOffset] >> - (8 - this._bitOffset - numBitsToRead)) & - mask; - result = (result << numBitsToRead) | newBits; - count -= numBitsToRead; - this._bitOffset += numBitsToRead; - if (this._bitOffset === 8) { - this._bitOffset = 0; - this._byteOffset++; - } - } - } - return result; - } - public readUnsigned(bits: number) { - return this.readBits(bits); - } - public readSigned(bits: number) { - const unsigned = this.readUnsigned(bits); - if (unsigned & (1 << (bits - 1))) return unsigned - (1 << bits); - return unsigned; - } - public readUnsignedExpGolomb() { - let leading0 = 0; - while (this.readBits(1) === 0) leading0++; - - return (1 << leading0) + this.readBits(leading0) - 1; - } - public readSignedExpGolomb() { - // Mapping: x <= 0 => -2x, x > 0 => 2x - 1 - const unsigned = this.readUnsignedExpGolomb(); - if (unsigned % 2 === 0) return unsigned / -2; - return (unsigned + 1) / 2; - } -} - -export class AnnexBBitstreamWriter { - private _arr: number[] = []; - private _pendingByte = 0; - private _bitOffset = 0; - - public toBuffer() { - return Buffer.from(this._arr); - } - public flush() { - // Write the pending byte into the array and reset, taking care of emulation prevention - if ( - this._pendingByte <= 3 && - this._arr.at(-1) === 0 && - this._arr.at(-2) === 0 - ) - this._arr.push(3); - this._arr.push(this._pendingByte); - this._pendingByte = 0; - this._bitOffset = 0; - } - public writeBits(bits: number, count: number) { - while (count > 0) { - if (this._bitOffset === 0) { - if (count >= 8) { - // We're byte aligned and has more than 1 byte left to write, write a whole byte - this._pendingByte = (bits >> (count - 8)) & 0xff; - count -= 8; - this.flush(); - } else { - // We have less than 1 byte, write the rest in - const mask = (1 << count) - 1; - this._pendingByte |= (bits & mask) << (8 - count); - this._bitOffset = count; - count = 0; - } - } else { - // Write the minimum number of bits to get us byte aligned again - const numBitsToWrite = Math.min(8 - this._bitOffset, count); - const bitsToWrite = - (bits >> (count - numBitsToWrite)) & ((1 << numBitsToWrite) - 1); - this._pendingByte |= - bitsToWrite << (8 - this._bitOffset - numBitsToWrite); - count -= numBitsToWrite; - this._bitOffset += numBitsToWrite; - if (this._bitOffset === 8) { - this._bitOffset = 0; - this.flush(); - } - } - } - } - public writeUnsigned(num: number, count: number) { - if (num < 0) throw new Error("Expected a non-negative number"); - this.writeBits(num, count); - } - public writeSigned(num: number, count: number) { - if (count <= 0) return; - if (count > 32) throw new Error("writeSigned supports up to 32 bits"); - - // Build mask for `count` bits. Handle 32-bit as a special case. - const mask = - count === 32 ? 0xffffffff >>> 0 : (((1 << count) >>> 0) - 1) >>> 0; - - // Convert to two's-complement unsigned representation and write - const unsigned = (num & mask) >>> 0; - this.writeBits(unsigned, count); - } - public writeUnsignedExpGolomb(num: number) { - if (num < 0) throw new Error("Expected a non-negative number"); - num++; - const bitCount = 32 - Math.clz32(num >>> 0); - this.writeBits(0, bitCount - 1); - this.writeBits(num, bitCount); - } - public writeSignedExpGolomb(num: number) { - if (num < 0) this.writeUnsignedExpGolomb(-2 * num); - else this.writeUnsignedExpGolomb(2 * num - 1); - } -} diff --git a/vendor/discord-video-stream/src/client/processing/AnnexBHelper.ts b/vendor/discord-video-stream/src/client/processing/AnnexBHelper.ts deleted file mode 100644 index 1a8fc17..0000000 --- a/vendor/discord-video-stream/src/client/processing/AnnexBHelper.ts +++ /dev/null @@ -1,134 +0,0 @@ -export enum H264NalUnitTypes { - Unspecified = 0, - CodedSliceNonIDR = 1, - CodedSlicePartitionA = 2, - CodedSlicePartitionB = 3, - CodedSlicePartitionC = 4, - CodedSliceIdr = 5, - SEI = 6, - SPS = 7, - PPS = 8, - AccessUnitDelimiter = 9, - EndOfSequence = 10, - EndOfStream = 11, - FillerData = 12, - SEIExtenstion = 13, - PrefixNalUnit = 14, - SubsetSPS = 15, -} - -export enum H265NalUnitTypes { - TRAIL_N = 0, - TRAIL_R = 1, - TSA_N = 2, - TSA_R = 3, - STSA_N = 4, - STSA_R = 5, - RADL_N = 6, - RADL_R = 7, - RASL_N = 8, - RASL_R = 9, - RSV_VCL_N10 = 10, - RSV_VCL_R11 = 11, - RSV_VCL_N12 = 12, - RSV_VCL_R13 = 13, - RSV_VCL_N14 = 14, - RSV_VCL_R15 = 15, - BLA_W_LP = 16, - BLA_W_RADL = 17, - BLA_N_LP = 18, - IDR_W_RADL = 19, - IDR_N_LP = 20, - CRA_NUT = 21, - RSV_IRAP_VCL22 = 22, - RSV_IRAP_VCL23 = 23, - RSV_VCL24 = 24, - RSV_VCL25 = 25, - RSV_VCL26 = 26, - RSV_VCL27 = 27, - RSV_VCL28 = 28, - RSV_VCL29 = 29, - RSV_VCL30 = 30, - RSV_VCL31 = 31, - VPS_NUT = 32, - SPS_NUT = 33, - PPS_NUT = 34, - AUD_NUT = 35, - EOS_NUT = 36, - EOB_NUT = 37, - FD_NUT = 38, - PREFIX_SEI_NUT = 39, - SUFFIX_SEI_NUT = 40, - RSV_NVCL41 = 41, - RSV_NVCL42 = 42, - RSV_NVCL43 = 43, - RSV_NVCL44 = 44, - RSV_NVCL45 = 45, - RSV_NVCL46 = 46, - RSV_NVCL47 = 47, - UNSPEC48 = 48, - UNSPEC49 = 49, - UNSPEC50 = 50, - UNSPEC51 = 51, - UNSPEC52 = 52, - UNSPEC53 = 53, - UNSPEC54 = 54, - UNSPEC55 = 55, - UNSPEC56 = 56, - UNSPEC57 = 57, - UNSPEC58 = 58, - UNSPEC59 = 59, - UNSPEC60 = 60, - UNSPEC61 = 61, - UNSPEC62 = 62, - UNSPEC63 = 63, -} - -export interface AnnexBHelpers { - getUnitType(frame: Buffer): number; - splitHeader(frame: Buffer): [Buffer, Buffer]; - isAUD(unitType: number): boolean; -} - -export const H264Helpers: AnnexBHelpers = { - getUnitType(frame) { - return frame[0] & 0x1f; - }, - splitHeader(frame) { - return [frame.subarray(0, 1), frame.subarray(1)]; - }, - isAUD(unitType) { - return unitType === H264NalUnitTypes.AccessUnitDelimiter; - }, -}; - -export const H265Helpers: AnnexBHelpers = { - getUnitType(frame) { - return (frame[0] >> 1) & 0x3f; - }, - splitHeader(frame) { - return [frame.subarray(0, 2), frame.subarray(2)]; - }, - isAUD(unitType) { - return unitType === H265NalUnitTypes.AUD_NUT; - }, -}; - -export const startCode3 = Buffer.from([0, 0, 1]); - -export function splitNalu(buf: Buffer) { - let temp: Buffer | null = buf; - const nalus: Buffer[] = []; - while (temp?.byteLength) { - let pos: number = temp.indexOf(startCode3); - let length = 3; - if (pos > 0 && temp[pos - 1] === 0) { - pos--; - length++; - } - const nalu = pos === -1 ? temp : temp.subarray(0, pos); - temp = pos === -1 ? null : temp.subarray(pos + length); - if (nalu.byteLength) nalus.push(nalu); - } - return nalus; -} diff --git a/vendor/discord-video-stream/src/client/processing/SPSVUIRewriter.ts b/vendor/discord-video-stream/src/client/processing/SPSVUIRewriter.ts deleted file mode 100644 index a1a3fb1..0000000 --- a/vendor/discord-video-stream/src/client/processing/SPSVUIRewriter.ts +++ /dev/null @@ -1,332 +0,0 @@ -import { - AnnexBBitstreamReader, - AnnexBBitstreamWriter, -} from "./AnnexBBitstreamReaderWriter.js"; - -export function rewriteSPSVUI(buffer: Buffer) { - const reader = new AnnexBBitstreamReader(buffer.subarray(1)); - const writer = new AnnexBBitstreamWriter(); - - const readBit = (n = 1) => reader.readBits(n); - const writeBit = (v: number, n = 1) => writer.writeBits(v, n); - const readU = (n: number) => reader.readUnsigned(n); - const writeU = (v: number, n: number) => writer.writeUnsigned(v, n); - const readUE = () => reader.readUnsignedExpGolomb(); - const writeUE = (v: number) => writer.writeUnsignedExpGolomb(v); - const readSE = () => reader.readSignedExpGolomb(); - const writeSE = (v: number) => writer.writeSignedExpGolomb(v); - - // Rewrite the NAL header - writeU(buffer[0], 8); - - const profile_idc = readU(8); - writeU(profile_idc, 8); - - const constraint_flags = readU(8); - writeU(constraint_flags, 8); - - const level_idc = readU(8); - writeU(level_idc, 8); - - const seq_parameter_set_id = readUE(); - writeUE(seq_parameter_set_id); - - // If profile in high profiles, additional fields - const highProfiles = new Set([ - 100, 110, 122, 244, 44, 83, 86, 118, 128, 138, 144, - ]); - if (highProfiles.has(profile_idc)) { - const chroma_format_idc = readUE(); - writeUE(chroma_format_idc); - - if (chroma_format_idc === 3) { - const separate_colour_plane_flag = readBit(1); - writeBit(separate_colour_plane_flag, 1); - } - - const bit_depth_luma_minus8 = readUE(); - writeUE(bit_depth_luma_minus8); - const bit_depth_chroma_minus8 = readUE(); - writeUE(bit_depth_chroma_minus8); - - const qpprime_y_zero_transform_bypass_flag = readBit(1); - writeBit(qpprime_y_zero_transform_bypass_flag, 1); - - const seq_scaling_matrix_present_flag = readBit(1); - writeBit(seq_scaling_matrix_present_flag, 1); - if (seq_scaling_matrix_present_flag) { - const scalingCount = chroma_format_idc !== 3 ? 8 : 12; - for (let i = 0; i < scalingCount; i++) { - const seq_scaling_list_present_flag = readBit(1); - writeBit(seq_scaling_list_present_flag, 1); - if (seq_scaling_list_present_flag) { - const size = i < 6 ? 16 : 64; - // scaling_list(size) - let lastScale = 8; - let nextScale = 8; - for (let j = 0; j < size; j++) { - const delta = readSE(); - writeSE(delta); - nextScale = (lastScale + delta + 256) % 256; - if (nextScale !== 0) lastScale = nextScale; - } - } - } - } - } - - const log2_max_frame_num_minus4 = readUE(); - writeUE(log2_max_frame_num_minus4); - - const pic_order_cnt_type = readUE(); - writeUE(pic_order_cnt_type); - if (pic_order_cnt_type === 0) { - const log2_max_pic_order_cnt_lsb_minus4 = readUE(); - writeUE(log2_max_pic_order_cnt_lsb_minus4); - } else if (pic_order_cnt_type === 1) { - const delta_pic_order_always_zero_flag = readBit(1); - writeBit(delta_pic_order_always_zero_flag, 1); - const offset_for_non_ref_pic = readSE(); - writeSE(offset_for_non_ref_pic); - const offset_for_top_to_bottom_field = readSE(); - writeSE(offset_for_top_to_bottom_field); - const num_ref_frames_in_pic_order_cnt_cycle = readUE(); - writeUE(num_ref_frames_in_pic_order_cnt_cycle); - for (let i = 0; i < num_ref_frames_in_pic_order_cnt_cycle; i++) { - const offset_for_ref_frame = readSE(); - writeSE(offset_for_ref_frame); - } - } - - const max_num_ref_frames = readUE(); - writeUE(max_num_ref_frames); - - const gaps_in_frame_num_value_allowed_flag = readBit(1); - writeBit(gaps_in_frame_num_value_allowed_flag, 1); - - const pic_width_in_mbs_minus1 = readUE(); - writeUE(pic_width_in_mbs_minus1); - - const pic_height_in_map_units_minus1 = readUE(); - writeUE(pic_height_in_map_units_minus1); - - const frame_mbs_only_flag = readBit(1); - writeBit(frame_mbs_only_flag, 1); - if (frame_mbs_only_flag === 0) { - const mb_adaptive_frame_field_flag = readBit(1); - writeBit(mb_adaptive_frame_field_flag, 1); - } - - const direct_8x8_inference_flag = readBit(1); - writeBit(direct_8x8_inference_flag, 1); - - const frame_cropping_flag = readBit(1); - writeBit(frame_cropping_flag, 1); - if (frame_cropping_flag) { - const frame_crop_left_offset = readUE(); - writeUE(frame_crop_left_offset); - const frame_crop_right_offset = readUE(); - writeUE(frame_crop_right_offset); - const frame_crop_top_offset = readUE(); - writeUE(frame_crop_top_offset); - const frame_crop_bottom_offset = readUE(); - writeUE(frame_crop_bottom_offset); - } - - // https://webrtc.googlesource.com/src/+/5f2c9278f35e47ff72eb191669d473b7400c9f3e/common_video/h264/sps_vui_rewriter.cc#283 - function addBitstreamRestriction() { - // motion_vectors_over_pic_boundaries_flag: u(1) - // Default is 1 when not present. - writeBit(1, 1); - // max_bytes_per_pic_denom: ue(v) - // Default is 2 when not present. - writeUE(2); - // max_bits_per_mb_denom: ue(v) - // Default is 1 when not present. - writeUE(1); - // log2_max_mv_length_horizontal: ue(v) - // log2_max_mv_length_vertical: ue(v) - // Both default to 16 when not present. - writeUE(16); - writeUE(16); - // ********* IMPORTANT! ********** - // max_num_reorder_frames: ue(v) - writeUE(0); - // max_dec_frame_buffering: ue(v) - writeUE(max_num_ref_frames); - } - - const vui_parameters_present_flag = readBit(1); - writeBit(1, 1); - // If no VUI exists, write one - if (!vui_parameters_present_flag) { - // aspect_ratio_info_present_flag, overscan_info_present_flag. Both u(1). - writeBit(0, 2); - - // video_signal_type_present_flag, u(1). - // Just write 0 here because I'm not gonna bother myself with color space and whatnot - writeBit(0, 1); - - // chroma_loc_info_present_flag, timing_info_present_flag, - // nal_hrd_parameters_present_flag, vcl_hrd_parameters_present_flag, - // pic_struct_present_flag, All u(1) - writeBit(0, 5); - - // bitstream_restriction_flag: u(1) - writeBit(1, 1); - - addBitstreamRestriction(); - } else { - // VUI parsing and copying - const aspect_ratio_info_present_flag = readBit(1); - writeBit(aspect_ratio_info_present_flag, 1); - if (aspect_ratio_info_present_flag) { - const aspect_ratio_idc = readU(8); - writeU(aspect_ratio_idc, 8); - if (aspect_ratio_idc === 255) { - // Extended_SAR - const sar_width = readU(16); - writeU(sar_width, 16); - const sar_height = readU(16); - writeU(sar_height, 16); - } - } - - const overscan_info_present_flag = readBit(1); - writeBit(overscan_info_present_flag, 1); - if (overscan_info_present_flag) { - const overscan_appropriate_flag = readBit(1); - writeBit(overscan_appropriate_flag, 1); - } - - // Read the video signal type, but don't copy it - const video_signal_type_present_flag = readBit(1); - writeBit(0, 1); - if (video_signal_type_present_flag) { - const _video_format = readBit(3); - // writeBit(video_format, 3); - const _video_full_range_flag = readBit(1); - // writeBit(video_full_range_flag, 1); - const colour_description_present_flag = readBit(1); - // writeBit(colour_description_present_flag, 1); - if (colour_description_present_flag) { - const _colour_primaries = readU(8); - // writeU(colour_primaries, 8); - const _transfer_characteristics = readU(8); - // writeU(transfer_characteristics, 8); - const _matrix_coeffs = readU(8); - // writeU(matrix_coeffs, 8); - } - } - - const chroma_loc_info_present_flag = readBit(1); - writeBit(chroma_loc_info_present_flag, 1); - if (chroma_loc_info_present_flag) { - const chroma_sample_loc_type_top_field = readUE(); - writeUE(chroma_sample_loc_type_top_field); - const chroma_sample_loc_type_bottom_field = readUE(); - writeUE(chroma_sample_loc_type_bottom_field); - } - - const timing_info_present_flag = readBit(1); - writeBit(timing_info_present_flag, 1); - if (timing_info_present_flag) { - const num_units_in_tick = readU(32); - writeU(num_units_in_tick, 32); - const time_scale = readU(32); - writeU(time_scale, 32); - const fixed_frame_rate_flag = readBit(1); - writeBit(fixed_frame_rate_flag, 1); - } - - const nal_hrd_parameters_present_flag = readBit(1); - writeBit(nal_hrd_parameters_present_flag, 1); - if (nal_hrd_parameters_present_flag) { - // hrd_parameters() - const cpb_cnt_minus1 = readUE(); - writeUE(cpb_cnt_minus1); - const bit_rate_scale = readBit(4); - writeBit(bit_rate_scale, 4); - const cpb_size_scale = readBit(4); - writeBit(cpb_size_scale, 4); - for (let i = 0; i <= cpb_cnt_minus1; i++) { - const bit_rate_value_minus1 = readUE(); - writeUE(bit_rate_value_minus1); - const cpb_size_value_minus1 = readUE(); - writeUE(cpb_size_value_minus1); - const cbr_flag = readBit(1); - writeBit(cbr_flag, 1); - } - const initial_cpb_removal_delay_length_minus1 = readBit(5); - writeBit(initial_cpb_removal_delay_length_minus1, 5); - const cpb_removal_delay_length_minus1 = readBit(5); - writeBit(cpb_removal_delay_length_minus1, 5); - const dpb_output_delay_length_minus1 = readBit(5); - writeBit(dpb_output_delay_length_minus1, 5); - const time_offset_length = readBit(5); - writeBit(time_offset_length, 5); - } - - const vcl_hrd_parameters_present_flag = readBit(1); - writeBit(vcl_hrd_parameters_present_flag, 1); - if (vcl_hrd_parameters_present_flag) { - // hrd_parameters() - const cpb_cnt_minus1 = readUE(); - writeUE(cpb_cnt_minus1); - const bit_rate_scale = readBit(4); - writeBit(bit_rate_scale, 4); - const cpb_size_scale = readBit(4); - writeBit(cpb_size_scale, 4); - for (let i = 0; i <= cpb_cnt_minus1; i++) { - const bit_rate_value_minus1 = readUE(); - writeUE(bit_rate_value_minus1); - const cpb_size_value_minus1 = readUE(); - writeUE(cpb_size_value_minus1); - const cbr_flag = readBit(1); - writeBit(cbr_flag, 1); - } - const initial_cpb_removal_delay_length_minus1 = readBit(5); - writeBit(initial_cpb_removal_delay_length_minus1, 5); - const cpb_removal_delay_length_minus1 = readBit(5); - writeBit(cpb_removal_delay_length_minus1, 5); - const dpb_output_delay_length_minus1 = readBit(5); - writeBit(dpb_output_delay_length_minus1, 5); - const time_offset_length = readBit(5); - writeBit(time_offset_length, 5); - } - - if (nal_hrd_parameters_present_flag || vcl_hrd_parameters_present_flag) { - const low_delay_hrd_flag = readBit(1); - writeBit(low_delay_hrd_flag, 1); - } - - const pic_struct_present_flag = readBit(1); - writeBit(pic_struct_present_flag, 1); - - const bitstream_restriction_flag = readBit(1); - writeBit(1, 1); - if (!bitstream_restriction_flag) { - addBitstreamRestriction(); - } else { - const motion_vectors_over_pic_boundaries_flag = readBit(1); - writeBit(motion_vectors_over_pic_boundaries_flag, 1); - const max_bytes_per_pic_denom = readUE(); - writeUE(max_bytes_per_pic_denom); - const max_bits_per_mb_denom = readUE(); - writeUE(max_bits_per_mb_denom); - const log2_max_mv_length_horizontal = readUE(); - writeUE(log2_max_mv_length_horizontal); - const log2_max_mv_length_vertical = readUE(); - writeUE(log2_max_mv_length_vertical); - const _num_reorder_frames = readUE(); - writeUE(0); - const _max_dec_frame_buffering = readUE(); - writeUE(max_num_ref_frames); - } - } - - writeBit(1, 1); // rbsp_stop_one_bit - writer.flush(); - // return the rewritten RBSP as a buffer - return writer.toBuffer(); -} diff --git a/vendor/discord-video-stream/src/client/voice/BaseMediaConnection.ts b/vendor/discord-video-stream/src/client/voice/BaseMediaConnection.ts deleted file mode 100644 index f36c2c0..0000000 --- a/vendor/discord-video-stream/src/client/voice/BaseMediaConnection.ts +++ /dev/null @@ -1,640 +0,0 @@ -import Davey from "@snazzah/davey"; -import EventEmitter from "node:events"; -import { Log } from "debug-level"; -import { randomUUID } from "node:crypto"; -import { CodecPayloadType } from "./CodecPayloadType.js"; -import { WebRtcConnWrapper } from "./WebRtcWrapper.js"; -import { VoiceOpCodes, VoiceOpCodesBinary } from "./VoiceOpCodes.js"; -import { - STREAMS_SIMULCAST, - type SupportedEncryptionModes, -} from "../../utils.js"; -import type { - Message, - GatewayRequest, - GatewayResponse, -} from "./VoiceMessageTypes.js"; -import type { Streamer } from "../Streamer.js"; - -type VoiceConnectionStatus = { - hasSession: boolean; - hasToken: boolean; - started: boolean; - resuming: boolean; -}; - -type WebRtcParameters = { - address: string; - port: number; - audioSsrc: number; - videoSsrc: number; - rtxSsrc: number; - supportedEncryptionModes: SupportedEncryptionModes[]; -}; - -type ValueOf = T extends (infer U)[] - ? U - : T extends Record - ? U - : never; - -export type VideoAttributes = { - width: number; - height: number; - fps: number; -}; - -export abstract class BaseMediaConnection extends EventEmitter { - private interval: NodeJS.Timeout | null = null; - public guildId: string | null = null; - public channelId: string; - public botId: string; - public ws: WebSocket | null = null; - public status: VoiceConnectionStatus; - public server: string | null = null; //websocket url - public token: string | null = null; - public session_id: string | null = null; - - private _webRtcWrapper; - private _webRtcParams: WebRtcParameters | null = null; - private _closed = false; - public ready: (conn: WebRtcConnWrapper) => void; - - private _streamer: Streamer; - private _sequenceNumber = -1; - - private _daveSession: Davey.DaveSession | undefined; - private _connectedUsers = new Set(); - private _daveProtocolVersion = 0; - private _davePendingTransitions = new Map(); - private _daveDowngraded = false; - - private _logger = new Log("conn"); - private _loggerDave = new Log("conn:dave"); - constructor( - streamer: Streamer, - guildId: string | null, - botId: string, - channelId: string, - callback: (conn: WebRtcConnWrapper) => void, - ) { - super(); - this._streamer = streamer; - this.status = { - hasSession: false, - hasToken: false, - started: false, - resuming: false, - }; - - this.guildId = guildId; - this.channelId = channelId; - this.botId = botId; - this.ready = callback; - this._webRtcWrapper = new WebRtcConnWrapper(this); - } - - public abstract get serverId(): string | null; - - public get type(): "guild" | "call" { - return this.guildId ? "guild" : "call"; - } - - public get webRtcConn() { - return this._webRtcWrapper; - } - - public get webRtcParams() { - return this._webRtcParams; - } - - public get streamer() { - return this._streamer; - } - - public abstract get daveChannelId(): string; - - stop(): void { - this._closed = true; - this._webRtcWrapper.close(); - this.ws?.close(); - } - - setSession(session_id: string): void { - this.session_id = session_id; - - this.status.hasSession = true; - this.start(); - } - - setTokens(server: string, token: string): void { - this.token = token; - this.server = server; - - this.status.hasToken = true; - this.start(); - } - - start(): void { - /* - ** Connection can only start once both - ** session description and tokens have been gathered - */ - if (this.status.hasSession && this.status.hasToken) { - if (this.status.started) return; - this.status.started = true; - - this.ws = new WebSocket(`wss://${this.server}/?v=8`); - this.ws.binaryType = "arraybuffer"; - this.ws.addEventListener("open", () => { - if (this.status.resuming) { - this.status.resuming = false; - this.resume(); - } else { - this.identify(); - } - }); - this.ws.addEventListener("error", (err) => { - console.error(err); - }); - this.ws.addEventListener("close", (e) => { - const wasStarted = this.status.started; - - this.interval && clearInterval(this.interval); - this.status.started = false; - const canResume = e.code === 4_015 || e.code < 4_000; - - if (canResume && wasStarted) { - this.status.resuming = true; - this.start(); - } else { - this._closed = true; - this._webRtcWrapper?.close(); - } - }); - this.setupEvents(); - } - } - - handleReady(d: Message.Ready): void { - // we hardcoded the STREAMS_SIMULCAST, which will always be array of 1 - const stream = d.streams[0]; - this._webRtcParams = { - address: d.ip, - port: d.port, - audioSsrc: d.ssrc, - videoSsrc: stream.ssrc, - rtxSsrc: stream.rtx_ssrc, - supportedEncryptionModes: d.modes, - }; - } - - async handleProtocolAck(d: Message.SelectProtocolAck) { - if (!("sdp" in d)) throw new Error("Only WebRTC connections are allowed"); - this._daveProtocolVersion = d.dave_protocol_version; - this.initDave(); - // Discord's SDP is absolute garbage...Generate one ourselves - let ip = "", - port = "", - iceUsername = "", - icePassword = "", - fingerprint = "", - candidate = ""; - for (const line of d.sdp.split("\n")) { - if (line.startsWith("c=")) ip = line; - else if (line.startsWith("a=rtcp")) port = line.split(":")[1]; - else if (line.startsWith("a=ice-ufrag")) iceUsername = line; - else if (line.startsWith("a=ice-pwd")) icePassword = line; - else if (line.startsWith("a=fingerprint")) fingerprint = line; - else if (line.startsWith("a=candidate")) candidate = line; - } - const audioPayloadType = CodecPayloadType.opus.payload_type; - const audioSection = ` -m=audio ${port} UDP/TLS/RTP/SAVPF ${audioPayloadType} -${ip} -a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level -a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 -a=setup:passive -a=mid:0 -a=maxptime:60 -a=inactive -${iceUsername} -${icePassword} -${fingerprint} -${candidate} -a=rtcp-mux -a=rtpmap:${audioPayloadType} opus/48000/2 -a=fmtp:${audioPayloadType} minptime=10;useinbandfec=1;usedtx=1 -a=rtcp-fb:${audioPayloadType} transport-cc -a=rtcp-fb:${audioPayloadType} nack -a=ice-lite -`.trim(); - const videoPayloads = Object.values(CodecPayloadType).filter( - (el) => el.type === "video", - ); - const videoPayloadTypes = videoPayloads.flatMap((el) => [ - el.payload_type, - el.rtx_payload_type, - ]); - const videoSection = ` -m=video ${port} UDP/TLS/RTP/SAVPF ${videoPayloadTypes.join(" ")} -${ip} -a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time -a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 -a=extmap:14 urn:ietf:params:rtp-hdrext:toffset -a=extmap:13 urn:3gpp:video-orientation -a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay -a=setup:passive -a=mid:1 -a=inactive -${iceUsername} -${icePassword} -${fingerprint} -${candidate} -a=rtcp-mux -a=ice-lite -`.trim(); - const videoRtpMap = videoPayloads - .flatMap((el) => [ - `a=rtpmap:${el.payload_type} ${el.name}/90000`, - `a=rtpmap:${el.rtx_payload_type} rtx/90000`, - `a=fmtp:${el.rtx_payload_type} apt=${el.payload_type}`, - `a=rtcp-fb:${el.payload_type} ccm fir`, - `a=rtcp-fb:${el.payload_type} nack`, - `a=rtcp-fb:${el.payload_type} nack pli`, - `a=rtcp-fb:${el.payload_type} goog-remb`, - `a=rtcp-fb:${el.payload_type} transport-cc`, - ]) - .join("\n"); - this._webRtcWrapper.webRtcConn?.setRemoteDescription( - [audioSection, videoSection, videoRtpMap].join("\n"), - "answer", - ); - this.emit("select_protocol_ack"); - } - - initDave() { - if (this._daveProtocolVersion) { - if (this._daveSession) { - this._daveSession.reinit( - this._daveProtocolVersion, - this.botId, - this.daveChannelId, - ); - this._loggerDave.debug(`Reinitialized DAVE`, { - user_id: this.botId, - channel_id: this.daveChannelId, - }); - } else { - this._daveSession = new Davey.DAVESession( - this._daveProtocolVersion, - this.botId, - this.daveChannelId, - ); - this._loggerDave.debug(`Initialized DAVE`, { - user_id: this.botId, - channel_id: this.daveChannelId, - }); - } - this.sendOpcodeBinary( - VoiceOpCodesBinary.MLS_KEY_PACKAGE, - this._daveSession.getSerializedKeyPackage(), - ); - } else if (this._daveSession) { - this._daveSession.reset(); - this._daveSession.setPassthroughMode(true, 10); - } - } - - processInvalidCommit(transitionId: number) { - this._loggerDave.debug("Invalid commit received, reinitializing DAVE", { - transitionId, - }); - this.sendOpcode(VoiceOpCodes.MLS_INVALID_COMMIT_WELCOME, { - transition_id: transitionId, - }); - this.initDave(); - } - - executePendingTransition(transitionId: number) { - const newVersion = this._davePendingTransitions.get(transitionId); - if (newVersion === undefined) { - this._loggerDave.error("Unrecognized transition ID", { transitionId }); - return; - } - const oldVersion = this._daveProtocolVersion; - this._daveProtocolVersion = newVersion; - - if (oldVersion !== newVersion && newVersion === 0) { - // Downgraded - this._daveDowngraded = true; - this._loggerDave.debug("Downgraded to non-E2E voice call"); - } else if (transitionId > 0 && this._daveDowngraded) { - this._daveDowngraded = false; - this._daveSession?.setPassthroughMode(true, 10); - this._loggerDave.debug("Upgraded to E2E voice call"); - } - - this._davePendingTransitions.delete(transitionId); - this._loggerDave.debug(`Pending transition ID ${transitionId} executed`, { - transitionId, - }); - } - - setupEvents(): void { - this.ws?.addEventListener("message", async (e) => { - if (e.data instanceof ArrayBuffer) { - this.handleBinaryMessages(Buffer.from(e.data)); - return; - } - const { op, d, seq } = JSON.parse(e.data as string) as GatewayResponse; - if (seq) this._sequenceNumber = seq; - - if (op === VoiceOpCodes.READY) { - // ready - this.handleReady(d); - this.setProtocols().then(() => this.ready(this._webRtcWrapper)); - this.setVideoAttributes(false); - } else if (op >= 4000) { - console.error(`Error ${this.constructor.name} connection`, d); - } else if (op === VoiceOpCodes.HELLO) { - this.setupHeartbeat(d.heartbeat_interval); - } else if (op === VoiceOpCodes.SELECT_PROTOCOL_ACK) { - // session description - this.handleProtocolAck(d); - } else if (op === VoiceOpCodes.SPEAKING) { - // ignore speaking updates - } else if (op === VoiceOpCodes.HEARTBEAT_ACK) { - // ignore heartbeat acknowledgements - } else if (op === VoiceOpCodes.RESUMED) { - this.status.started = true; - } else if (op === VoiceOpCodes.CLIENTS_CONNECT) { - d.user_ids.forEach((id) => { - this._connectedUsers.add(id); - }); - } else if (op === VoiceOpCodes.CLIENT_DISCONNECT) { - this._connectedUsers.delete(d.user_id); - } else if (op === VoiceOpCodes.DAVE_PREPARE_TRANSITION) { - this._loggerDave.debug("Preparing for DAVE transition", d); - this._davePendingTransitions.set(d.transition_id, d.protocol_version); - if (d.transition_id === 0) { - this.executePendingTransition(d.transition_id); - } else { - if (d.protocol_version === 0) - this._daveSession?.setPassthroughMode(true, 120); - this.sendOpcode(VoiceOpCodes.DAVE_TRANSITION_READY, { - transition_id: d.transition_id, - }); - } - } else if (op === VoiceOpCodes.DAVE_EXECUTE_TRANSITION) { - this.executePendingTransition(d.transition_id); - } else if (op === VoiceOpCodes.DAVE_PREPARE_EPOCH) { - this._loggerDave.debug("Preparing for DAVE epoch", d); - if (d.epoch === 1) { - this._daveProtocolVersion = d.protocol_version; - this.initDave(); - } - } else { - //console.log("unhandled voice event", {op, d}); - } - }); - } - - handleBinaryMessages(msg: Buffer) { - this._sequenceNumber = msg.readUint16BE(0); - const op = msg.readUint8(2); - this._logger.trace(`Handling binary message with op ${op}`, { op }); - switch (op) { - case VoiceOpCodesBinary.MLS_EXTERNAL_SENDER: { - this._daveSession?.setExternalSender(msg.subarray(3)); - this._loggerDave.debug("Set MLS external sender"); - break; - } - case VoiceOpCodesBinary.MLS_PROPOSALS: { - const optype = msg.readUint8(3); - const { commit, welcome } = this._daveSession!.processProposals( - optype, - msg.subarray(4), - [...this._connectedUsers], - ); - if (commit) { - this.sendOpcodeBinary( - VoiceOpCodesBinary.MLS_COMMIT_WELCOME, - welcome ? Buffer.concat([commit, welcome]) : commit, - ); - } - this._loggerDave.debug("Processed MLS proposal"); - break; - } - case VoiceOpCodesBinary.MLS_ANNOUNCE_COMMIT_TRANSITION: { - const transitionId = msg.readUInt16BE(3); - try { - this._daveSession?.processCommit(msg.subarray(5)); - if (transitionId) { - this._davePendingTransitions.set( - transitionId, - this._daveProtocolVersion, - ); - this.sendOpcode(VoiceOpCodes.DAVE_TRANSITION_READY, { - transition_id: transitionId, - }); - } - this._loggerDave.debug("MLS commit processed", { transitionId }); - } catch (e) { - this._loggerDave.debug("MLS commit errored", e); - this.processInvalidCommit(transitionId); - } - break; - } - case VoiceOpCodesBinary.MLS_WELCOME: { - const transitionId = msg.readUInt16BE(3); - try { - this._daveSession?.processWelcome(msg.subarray(5)); - if (transitionId) { - this._davePendingTransitions.set( - transitionId, - this._daveProtocolVersion, - ); - this.sendOpcode(VoiceOpCodes.DAVE_TRANSITION_READY, { - transition_id: transitionId, - }); - } - this._loggerDave.debug("MLS welcome processed", { transitionId }); - } catch (e) { - this._loggerDave.debug("MLS welcome errored", e); - this.processInvalidCommit(transitionId); - } - break; - } - } - } - - public get daveReady() { - return this._daveProtocolVersion && this._daveSession?.ready; - } - - public get daveSession() { - return this._daveSession; - } - - setupHeartbeat(interval: number): void { - if (this.interval) { - clearInterval(this.interval); - } - this.interval = setInterval(() => { - try { - this.sendOpcode(VoiceOpCodes.HEARTBEAT, { - t: Date.now(), - seq_ack: this._sequenceNumber, - }); - } catch {} - }, interval); - } - - sendOpcode(code: T["op"], data: T["d"]): void { - if (this.ws?.readyState !== WebSocket.OPEN) return; - this.ws.send( - JSON.stringify({ - op: code, - d: data, - }), - ); - } - sendOpcodeBinary(code: VoiceOpCodesBinary, data: Buffer) { - if (this.ws?.readyState !== WebSocket.OPEN) return; - const buf = Buffer.allocUnsafe(data.length + 1); - buf.writeUInt8(code); - data.copy(buf, 1); - this.ws.send(buf); - } - - /* - ** identifies with media server with credentials - */ - identify(): void { - if (!this.serverId) throw new Error("Server ID is null or empty"); - if (!this.session_id) throw new Error("Session ID is null or empty"); - if (!this.token) throw new Error("Token is null or empty"); - this.sendOpcode(VoiceOpCodes.IDENTIFY, { - server_id: this.serverId, - user_id: this.botId, - session_id: this.session_id, - token: this.token, - video: true, - streams: STREAMS_SIMULCAST, - max_dave_protocol_version: Davey.DAVE_PROTOCOL_VERSION ?? 0, - }); - } - - resume(): void { - if (!this.serverId) throw new Error("Server ID is null or empty"); - if (!this.session_id) throw new Error("Session ID is null or empty"); - if (!this.token) throw new Error("Token is null or empty"); - this.sendOpcode(VoiceOpCodes.RESUME, { - server_id: this.serverId, - session_id: this.session_id, - token: this.token, - seq_ack: this._sequenceNumber, - }); - } - - /* - ** Sets protocols and ip data used for video and audio. - ** Uses vp8 for video - ** Uses opus for audio - */ - public async setProtocols(): Promise { - if (!this._webRtcParams) throw new Error("WebRTC parameters not set"); - // if ( - // this._webRtcParams.supportedEncryptionModes.includes(SupportedEncryptionModes.AES256) && - // !this._streamer.opts.forceChacha20Encryption - // ) { - // encryptionMode = SupportedEncryptionModes.AES256 - // } else { - // encryptionMode = SupportedEncryptionModes.XCHACHA20 - // } - - const reconnect = () => { - const webRtcConn = this._webRtcWrapper.initWebRtc(); - webRtcConn.onStateChange((state) => { - if (state === "closed" && !this._closed) reconnect(); - }); - webRtcConn.onLocalDescription((sdp) => { - const rtc_connection_id = randomUUID(); - this.sendOpcode(VoiceOpCodes.SELECT_PROTOCOL, { - protocol: "webrtc", - codecs: Object.values(CodecPayloadType) as ValueOf< - typeof CodecPayloadType - >[], - data: sdp, - sdp: sdp, - rtc_connection_id, - }); - }); - webRtcConn.setLocalDescription(); - }; - reconnect(); - return new Promise((resolve) => { - this.once("select_protocol_ack", () => resolve()); - }); - } - - /* - * Sets video attributes (width, height, frame rate). - * enabled -> video on or off - * attr -> video attributes - * video and rtx sources are set to ssrc + 1 and ssrc + 2 - */ - public setVideoAttributes(enabled: false): void; - public setVideoAttributes(enabled: true, attr: VideoAttributes): void; - public setVideoAttributes(enabled: boolean, attr?: VideoAttributes): void { - if (!this._webRtcParams) throw new Error("WebRTC parameters not set"); - const { audioSsrc, videoSsrc, rtxSsrc } = this._webRtcParams; - if (!enabled) { - this.sendOpcode(VoiceOpCodes.VIDEO, { - audio_ssrc: audioSsrc, - video_ssrc: 0, - rtx_ssrc: 0, - streams: [], - }); - } else { - if (!attr) throw new Error("Need to specify video attributes"); - this.sendOpcode(VoiceOpCodes.VIDEO, { - audio_ssrc: audioSsrc, - video_ssrc: videoSsrc, - rtx_ssrc: rtxSsrc, - streams: [ - { - type: "video", - rid: "100", - ssrc: videoSsrc, - active: true, - quality: 100, - rtx_ssrc: rtxSsrc, - // hardcode the max bitrate because we don't really know anyway - max_bitrate: 10000 * 1000, - max_framerate: enabled ? attr.fps : 0, - max_resolution: { - type: "fixed", - width: attr.width, - height: attr.height, - }, - }, - ], - }); - } - } - - /* - ** Set speaking status - ** speaking -> speaking status on or off - */ - public setSpeaking(speaking: boolean): void { - if (!this._webRtcParams) throw new Error("WebRTC connection not ready"); - this.sendOpcode(VoiceOpCodes.SPEAKING, { - delay: 0, - speaking: speaking ? 1 : 0, - ssrc: this._webRtcParams.audioSsrc, - }); - } -} diff --git a/vendor/discord-video-stream/src/client/voice/CodecPayloadType.ts b/vendor/discord-video-stream/src/client/voice/CodecPayloadType.ts deleted file mode 100644 index 9844a21..0000000 --- a/vendor/discord-video-stream/src/client/voice/CodecPayloadType.ts +++ /dev/null @@ -1,59 +0,0 @@ -export const CodecPayloadType = { - opus: { - name: "opus", - type: "audio", - clockRate: 48000, - priority: 1000, - payload_type: 120, - }, - H264: { - name: "H264", - type: "video", - clockRate: 90000, - priority: 1000, - payload_type: 101, - rtx_payload_type: 102, - encode: true, - decode: true, - }, - H265: { - name: "H265", - type: "video", - clockRate: 90000, - priority: 1000, - payload_type: 103, - rtx_payload_type: 104, - encode: true, - decode: true, - }, - VP8: { - name: "VP8", - type: "video", - clockRate: 90000, - priority: 1000, - payload_type: 105, - rtx_payload_type: 106, - encode: true, - decode: true, - }, - VP9: { - name: "VP9", - type: "video", - clockRate: 90000, - priority: 1000, - payload_type: 107, - rtx_payload_type: 108, - encode: true, - decode: true, - }, - AV1: { - name: "AV1", - type: "video", - clockRate: 90000, - priority: 1000, - payload_type: 109, - rtx_payload_type: 110, - encode: true, - decode: true, - }, -} as const; diff --git a/vendor/discord-video-stream/src/client/voice/MediaUdp.ts.bak b/vendor/discord-video-stream/src/client/voice/MediaUdp.ts.bak deleted file mode 100644 index d5d66d6..0000000 --- a/vendor/discord-video-stream/src/client/voice/MediaUdp.ts.bak +++ /dev/null @@ -1,171 +0,0 @@ -import udpCon from 'node:dgram'; -import { isIP } from 'node:net'; -import { AudioPacketizer } from '../packet/AudioPacketizer.js'; -import { - VideoPacketizerH264, - VideoPacketizerH265 -} from '../packet/VideoPacketizerAnnexB.js'; -import { VideoPacketizerVP8 } from '../packet/VideoPacketizerVP8.js'; -import { normalizeVideoCodec } from '../../utils.js'; -import type { BaseMediaPacketizer } from '../packet/BaseMediaPacketizer.js'; -import type { BaseMediaConnection } from './BaseMediaConnection.js'; - -// credit to discord.js -function parseLocalPacket(message: Buffer) { - const packet = Buffer.from(message); - - const ip = packet.subarray(8, packet.indexOf(0, 8)).toString('utf8'); - - if (!isIP(ip)) { - throw new Error('Malformed IP address'); - } - - const port = packet.readUInt16BE(packet.length - 2); - - return { ip, port }; -} - -export class MediaUdp { - private _mediaConnection: BaseMediaConnection; - private _socket: udpCon.Socket | null = null; - private _ready = false; - private _audioPacketizer?: BaseMediaPacketizer; - private _videoPacketizer?: BaseMediaPacketizer; - private _ip?: string; - private _port?: number; - - constructor(voiceConnection: BaseMediaConnection) { - this._mediaConnection = voiceConnection; - } - - public get audioPacketizer(): BaseMediaPacketizer | undefined { - return this._audioPacketizer; - } - - public get videoPacketizer(): BaseMediaPacketizer | undefined { - // This will never be undefined anyway, so it's safe - return this._videoPacketizer; - } - - public get mediaConnection(): BaseMediaConnection { - return this._mediaConnection; - } - - public get ip() - { - return this._ip; - } - - public get port() - { - return this._port; - } - - public async sendAudioFrame(frame: Buffer, frametime: number): Promise { - if(!this.ready) return; - await this.audioPacketizer?.sendFrame(frame, frametime); - } - - public async sendVideoFrame(frame: Buffer, frametime: number): Promise { - if(!this.ready) return; - await this.videoPacketizer?.sendFrame(frame, frametime); - } - - public setPacketizer(videoCodec: string): void { - if (!this.mediaConnection.webRtcParams) - throw new Error("WebRTC connection not ready"); - const { audioSsrc, videoSsrc } = this.mediaConnection.webRtcParams; - this._audioPacketizer = new AudioPacketizer(this, audioSsrc); - switch (normalizeVideoCodec(videoCodec)) - { - case "H264": - this._videoPacketizer = new VideoPacketizerH264(this, videoSsrc); - break; - case "H265": - this._videoPacketizer = new VideoPacketizerH265(this, videoSsrc); - break; - case "VP8": - this._videoPacketizer = new VideoPacketizerVP8(this, videoSsrc); - break; - default: - throw new Error(`Packetizer not implemented for ${videoCodec}`) - } - } - - public sendPacket(packet: Buffer): Promise { - if (!this.mediaConnection.webRtcParams) - throw new Error("WebRTC connection not ready"); - const { address, port } = this.mediaConnection.webRtcParams; - return new Promise((resolve, reject) => { - try { - this._socket?.send(packet, 0, packet.length, port, address, (error, bytes) => { - if (error) { - console.log("ERROR", error); - reject(error); - } - resolve(); - }); - } catch(e) {reject(e)} - }); - } - - handleIncoming(buf: unknown): void { - //console.log("RECEIVED PACKET", buf); - } - - public get ready(): boolean { - return this._ready; - } - - public set ready(val: boolean) { - this._ready = val; - } - - public stop(): void { - try { - this.ready = false; - this._socket?.disconnect(); - }catch(e) {} - } - - public createUdp(): Promise { - if (!this.mediaConnection.webRtcParams) - throw new Error("WebRTC connection not ready"); - const { audioSsrc, address, port } = this.mediaConnection.webRtcParams; - return new Promise((resolve, reject) => { - this._socket = udpCon.createSocket('udp4'); - - this._socket.on('error', (error: Error) => { - console.error("Error connecting to media udp server", error); - reject(error); - }); - - this._socket.once('message', (message) => { - if (message.readUInt16BE(0) !== 2) { - reject('wrong handshake packet for udp') - } - try { - const packet = parseLocalPacket(message); - this._ip = packet.ip; - this._port = packet.port; - this._ready = true; - } catch(e) { reject(e) } - - resolve(); - this._socket?.on('message', this.handleIncoming); - }); - - const blank = Buffer.alloc(74); - - blank.writeUInt16BE(1, 0); - blank.writeUInt16BE(70, 2); - blank.writeUInt32BE(audioSsrc, 4); - - this._socket.send(blank, 0, blank.length, port, address, (error, bytes) => { - if (error) { - reject(error) - } - }); - }); - } -} diff --git a/vendor/discord-video-stream/src/client/voice/StreamConnection.ts b/vendor/discord-video-stream/src/client/voice/StreamConnection.ts deleted file mode 100644 index 4e354d9..0000000 --- a/vendor/discord-video-stream/src/client/voice/StreamConnection.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { VoiceOpCodes } from "../voice/VoiceOpCodes.js"; -import { BaseMediaConnection } from "./BaseMediaConnection.js"; - -export class StreamConnection extends BaseMediaConnection { - private _streamKey: string | null = null; - private _serverId: string | null = null; - - public override setSpeaking(speaking: boolean): void { - if (!this.webRtcParams) throw new Error("WebRTC connection not ready"); - this.sendOpcode(VoiceOpCodes.SPEAKING, { - delay: 0, - speaking: speaking ? 2 : 0, - ssrc: this.webRtcParams.audioSsrc, - }); - } - - public override get daveChannelId() { - if (this._serverId === null) - throw new Error("Server ID not set (this shouldn't happen)"); - const channelId = BigInt(this._serverId) - 1n; - return channelId.toString(); - } - - public override get serverId(): string | null { - return this._serverId; - } - - public set serverId(id: string) { - this._serverId = id; - } - - public get streamKey(): string | null { - return this._streamKey; - } - public set streamKey(value: string) { - this._streamKey = value; - } -} diff --git a/vendor/discord-video-stream/src/client/voice/VoiceConnection.ts b/vendor/discord-video-stream/src/client/voice/VoiceConnection.ts deleted file mode 100644 index 6ccb88d..0000000 --- a/vendor/discord-video-stream/src/client/voice/VoiceConnection.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { BaseMediaConnection } from "./BaseMediaConnection.js"; -import type { StreamConnection } from "./StreamConnection.js"; - -export class VoiceConnection extends BaseMediaConnection { - public streamConnection?: StreamConnection; - - public override get daveChannelId() { - return this.channelId; - } - - public override get serverId(): string { - return this.guildId ?? this.channelId; // for guild vc it is the guild id, for dm voice it is the channel id - } - - public override stop(): void { - super.stop(); - this.streamConnection?.stop(); - } -} diff --git a/vendor/discord-video-stream/src/client/voice/VoiceMessageTypes.ts b/vendor/discord-video-stream/src/client/voice/VoiceMessageTypes.ts deleted file mode 100644 index 30ad1f1..0000000 --- a/vendor/discord-video-stream/src/client/voice/VoiceMessageTypes.ts +++ /dev/null @@ -1,263 +0,0 @@ -import type { VoiceOpCodes } from "./VoiceOpCodes.js"; -import type { SupportedEncryptionModes } from "../../utils.js"; - -type StreamInfo = { - active: boolean; - quality: number; - rid: string; - ssrc: number; - rtx_ssrc: number; - /** - * always "video" from what I observed - */ - type: string; -}; - -type SimulcastInfo = { - type: string; - rid: string; - quality: number; -}; - -type CodecPayloadType = - | { - name: string; - type: "audio"; - priority: number; - payload_type: number; - } - | { - name: string; - type: "video"; - priority: number; - payload_type: number; - rtx_payload_type: number; - encode: boolean; - decode: boolean; - }; - -export namespace Message { - // Request messages - export type Identify = { - server_id: string; - user_id: string; - session_id: string; - token: string; - video: boolean; - streams: SimulcastInfo[]; - max_dave_protocol_version?: number; - }; - - export type Resume = { - server_id: string; - session_id: string; - token: string; - seq_ack: number; - }; - - export type Heartbeat = { - t: number; - seq_ack?: number; - }; - - export type SelectProtocol = - | { - protocol: "udp"; - codecs: CodecPayloadType[]; - data: { - address: string; - port: number; - mode: SupportedEncryptionModes; - }; - } - | { - protocol: "webrtc"; - codecs: CodecPayloadType[]; - data: string; - sdp: string; - rtc_connection_id: string; - }; - - export type Video = { - audio_ssrc: number; - video_ssrc: number; - rtx_ssrc: number; - streams: { - type: "video"; - rid: string; - ssrc: number; - active: boolean; - quality: number; - rtx_ssrc: number; - max_bitrate: number; - max_framerate: number; - max_resolution: { - type: "fixed"; - width: number; - height: number; - }; - }[]; - }; - - // Response messages - export type Hello = { - heartbeat_interval: number; - }; - - export type Ready = { - ssrc: number; - ip: string; - port: number; - modes: SupportedEncryptionModes[]; - experiments: string[]; - streams: StreamInfo[]; - }; - - export type Speaking = { - speaking: 0 | 1 | 2; - delay: number; - ssrc: number; - }; - - export type SelectProtocolAck = { - audio_codec: string; - video_codec: string; - dave_protocol_version: number; - } & ( - | { - secret_key: number[]; - mode: string; - } - | { - media_session_id: number; - sdp: string; - } - ); - - export type HeartbeatAck = { - t: number; - }; - - export type ClientsConnect = { - user_ids: string[]; - }; - - export type ClientDisconnect = { - user_id: string; - }; - - export type DavePrepareTransition = { - transition_id: number; - protocol_version: number; - }; - - export type DaveExecuteTransition = { - transition_id: number; - }; - - export type DaveTransitionReady = { - transition_id: number; - }; - - export type DavePrepareEpoch = { - epoch: number; - protocol_version: number; - }; - - export type MlsInvalidCommitWelcome = { - transition_id: number; - }; -} - -export namespace GatewayResponse { - type Generic< - Op extends VoiceOpCodes, - T extends Record | null, - > = { - op: Op; - d: T; - seq?: number; - }; - export type Hello = Generic; - export type Ready = Generic; - export type Resumed = Generic; - export type Speaking = Generic; - export type SelectProtocolAck = Generic< - VoiceOpCodes.SELECT_PROTOCOL_ACK, - Message.SelectProtocolAck - >; - export type HeartbeatAck = Generic< - VoiceOpCodes.HEARTBEAT_ACK, - Message.HeartbeatAck - >; - export type ClientsConnect = Generic< - VoiceOpCodes.CLIENTS_CONNECT, - Message.ClientsConnect - >; - export type ClientDisconnect = Generic< - VoiceOpCodes.CLIENT_DISCONNECT, - Message.ClientDisconnect - >; - export type DavePrepareTransition = Generic< - VoiceOpCodes.DAVE_PREPARE_TRANSITION, - Message.DavePrepareTransition - >; - export type DaveExecuteTransition = Generic< - VoiceOpCodes.DAVE_EXECUTE_TRANSITION, - Message.DaveExecuteTransition - >; - export type DavePrepareEpoch = Generic< - VoiceOpCodes.DAVE_PREPARE_EPOCH, - Message.DavePrepareEpoch - >; -} - -export type GatewayResponse = - | GatewayResponse.Hello - | GatewayResponse.Ready - | GatewayResponse.Resumed - | GatewayResponse.Speaking - | GatewayResponse.SelectProtocolAck - | GatewayResponse.HeartbeatAck - | GatewayResponse.ClientsConnect - | GatewayResponse.ClientDisconnect - | GatewayResponse.DavePrepareTransition - | GatewayResponse.DaveExecuteTransition - | GatewayResponse.DavePrepareEpoch; - -export namespace GatewayRequest { - type Generic< - Op extends VoiceOpCodes, - T extends Record | null, - > = { - op: Op; - d: T; - }; - export type Identify = Generic; - export type Resume = Generic; - export type Heartbeat = Generic; - export type SelectProtocol = Generic< - VoiceOpCodes.SELECT_PROTOCOL, - Message.SelectProtocol - >; - export type Video = Generic; - export type Speaking = Generic; - export type DaveTransitionReady = Generic< - VoiceOpCodes.DAVE_TRANSITION_READY, - Message.DaveTransitionReady - >; - export type MlsInvalidCommitWelcome = Generic< - VoiceOpCodes.MLS_INVALID_COMMIT_WELCOME, - Message.MlsInvalidCommitWelcome - >; -} - -export type GatewayRequest = - | GatewayRequest.Identify - | GatewayRequest.Resume - | GatewayRequest.Heartbeat - | GatewayRequest.SelectProtocol - | GatewayRequest.Video - | GatewayRequest.Speaking - | GatewayRequest.DaveTransitionReady - | GatewayRequest.MlsInvalidCommitWelcome; diff --git a/vendor/discord-video-stream/src/client/voice/VoiceOpCodes.ts b/vendor/discord-video-stream/src/client/voice/VoiceOpCodes.ts deleted file mode 100644 index 5e5f2e3..0000000 --- a/vendor/discord-video-stream/src/client/voice/VoiceOpCodes.ts +++ /dev/null @@ -1,36 +0,0 @@ -export enum VoiceOpCodes { - IDENTIFY = 0, - SELECT_PROTOCOL = 1, - READY = 2, - HEARTBEAT = 3, - SELECT_PROTOCOL_ACK = 4, - SPEAKING = 5, - HEARTBEAT_ACK = 6, - RESUME = 7, - HELLO = 8, - RESUMED = 9, - CLIENTS_CONNECT = 11, - VIDEO = 12, - CLIENT_DISCONNECT = 13, - SESSION_UPDATE = 14, - MEDIA_SINK_WANTS = 15, - VOICE_BACKEND_VERSION = 16, - CHANNEL_OPTIONS_UPDATE = 17, - FLAGS = 18, - SPEED_TEST = 19, - PLATFORM = 20, - DAVE_PREPARE_TRANSITION = 21, - DAVE_EXECUTE_TRANSITION = 22, - DAVE_TRANSITION_READY = 23, - DAVE_PREPARE_EPOCH = 24, - MLS_INVALID_COMMIT_WELCOME = 31, -} - -export enum VoiceOpCodesBinary { - MLS_EXTERNAL_SENDER = 25, - MLS_KEY_PACKAGE = 26, - MLS_PROPOSALS = 27, - MLS_COMMIT_WELCOME = 28, - MLS_ANNOUNCE_COMMIT_TRANSITION = 29, - MLS_WELCOME = 30, -} diff --git a/vendor/discord-video-stream/src/client/voice/WebRtcWrapper.ts b/vendor/discord-video-stream/src/client/voice/WebRtcWrapper.ts deleted file mode 100644 index 9285211..0000000 --- a/vendor/discord-video-stream/src/client/voice/WebRtcWrapper.ts +++ /dev/null @@ -1,213 +0,0 @@ -import { - PeerConnection, - Audio, - Video, - PacingHandler, - RtpPacketizer, - H264RtpPacketizer, - H265RtpPacketizer, - AV1RtpPacketizer, - RtpPacketizationConfig, - RtcpNackResponder, - RtcpSrReporter, - type Track, -} from "@lng2004/node-datachannel"; -import { Codec, MediaType } from "@snazzah/davey"; -import { CodecPayloadType } from "./CodecPayloadType.js"; -import { normalizeVideoCodec, type SupportedVideoCodec } from "../../utils.js"; -import { - splitNalu, - H264Helpers, - H264NalUnitTypes, - startCode3, -} from "../processing/AnnexBHelper.js"; -import { rewriteSPSVUI } from "../processing/SPSVUIRewriter.js"; -import type { BaseMediaConnection } from "./BaseMediaConnection.js"; - -export class WebRtcConnWrapper { - private _mediaConn: BaseMediaConnection; - - private _webRtcConn?: PeerConnection; - private _audioDef: Audio; - private _videoDef: Video; - private _audioTrack?: Track; - private _videoTrack?: Track; - private _audioPacketizer?: RtpPacketizer; - private _videoPacketizer?: RtpPacketizer; - private _videoCodec?: SupportedVideoCodec; - - constructor(mediaConn: BaseMediaConnection) { - this._mediaConn = mediaConn; - this._audioDef = new Audio("0", "SendRecv"); - this._videoDef = new Video("1", "SendRecv"); - this._audioDef.addOpusCodec(CodecPayloadType.opus.payload_type); - for (const { - name, - payload_type, - rtx_payload_type, - clockRate, - } of Object.values(CodecPayloadType).filter((el) => el.type === "video")) { - switch (name) { - case "H264": - this._videoDef.addH264Codec(payload_type); - break; - case "H265": - this._videoDef.addH265Codec(payload_type); - break; - case "VP8": - this._videoDef.addVP8Codec(payload_type); - break; - case "VP9": - this._videoDef.addVP9Codec(payload_type); - break; - case "AV1": - this._videoDef.addAV1Codec(payload_type); - break; - } - this._videoDef.addRTXCodec(rtx_payload_type, payload_type, clockRate); - } - } - - public initWebRtc() { - this._webRtcConn = new PeerConnection("", { - iceServers: ["stun:stun.l.google.com:19302"], - }); - this._audioTrack = this._webRtcConn.addTrack(this._audioDef); - this._videoTrack = this._webRtcConn.addTrack(this._videoDef); - this._setMediaHandler(); - return this._webRtcConn; - } - - private _setMediaHandler() { - if (this._audioPacketizer) - this._audioTrack?.setMediaHandler(this._audioPacketizer); - if (this._videoPacketizer) - this._videoTrack?.setMediaHandler(this._videoPacketizer); - } - - public close() { - this._webRtcConn?.close(); - } - - public get webRtcConn() { - return this._webRtcConn; - } - - public get ready() { - return this._webRtcConn?.state() === "connected"; - } - - public get mediaConnection() { - return this._mediaConn; - } - - public sendAudioFrame(frame: Buffer, frametime: number) { - if (!this.ready) return; - if (!this._audioPacketizer) return; - const { rtpConfig } = this._audioPacketizer; - const { clockRate } = rtpConfig; - if (this.mediaConnection.daveReady) - frame = this.mediaConnection.daveSession!.encryptOpus(frame); - this._audioTrack?.sendMessageBinary(frame); - rtpConfig.timestamp += Math.round((frametime * clockRate) / 1000); - } - - public sendVideoFrame(frame: Buffer, frametime: number) { - if (!this.ready) return; - if (!this._videoPacketizer) return; - const { rtpConfig } = this._videoPacketizer; - const { clockRate } = rtpConfig; - if (this._videoCodec === "H264") { - let spsRewritten = false; - const nalus = splitNalu(frame).map((el) => { - if (H264Helpers.getUnitType(el) === H264NalUnitTypes.SPS) { - spsRewritten = true; - return rewriteSPSVUI(el); - } - return el; - }); - if (spsRewritten) - frame = Buffer.concat(nalus.flatMap((el) => [startCode3, el])); - } - if (this.mediaConnection.daveReady) { - let daveCodec = Codec.UNKNOWN; - switch (this._videoCodec) { - case "H264": - daveCodec = Codec.H264; - break; - case "H265": - daveCodec = Codec.H265; - break; - case "VP8": - daveCodec = Codec.VP8; - break; - case "VP9": - daveCodec = Codec.VP9; - break; - case "AV1": - daveCodec = Codec.AV1; - break; - } - frame = this.mediaConnection.daveSession!.encrypt( - MediaType.VIDEO, - daveCodec, - frame, - ); - } - this._videoTrack?.sendMessageBinary(frame); - rtpConfig.timestamp += Math.round((frametime * clockRate) / 1000); - } - - public setPacketizer(videoCodec: string): void { - if (!this.mediaConnection.webRtcParams) - throw new Error("WebRTC connection not ready"); - const { audioSsrc, videoSsrc } = this.mediaConnection.webRtcParams; - const rtpConfigAudio = new RtpPacketizationConfig( - audioSsrc, - "", - CodecPayloadType.opus.payload_type, - CodecPayloadType.opus.clockRate, - ); - rtpConfigAudio.playoutDelayId = 5; - rtpConfigAudio.playoutDelayMin = 0; - rtpConfigAudio.playoutDelayMax = 1; - this._audioPacketizer = new RtpPacketizer(rtpConfigAudio); - this._audioPacketizer.addToChain(new RtcpSrReporter(rtpConfigAudio)); - this._audioPacketizer.addToChain(new RtcpNackResponder()); - - this._videoCodec = normalizeVideoCodec(videoCodec); - const rtpConfigVideo = new RtpPacketizationConfig( - videoSsrc, - "", - CodecPayloadType[this._videoCodec].payload_type, - CodecPayloadType[this._videoCodec].clockRate, - ); - rtpConfigVideo.playoutDelayId = 5; - rtpConfigVideo.playoutDelayMin = 0; - rtpConfigVideo.playoutDelayMax = 10; - switch (this._videoCodec) { - case "H264": - this._videoPacketizer = new H264RtpPacketizer( - "StartSequence", - rtpConfigVideo, - ); - break; - case "H265": - this._videoPacketizer = new H265RtpPacketizer( - "StartSequence", - rtpConfigVideo, - ); - break; - case "AV1": - this._videoPacketizer = new AV1RtpPacketizer("Obu", rtpConfigVideo); - break; - default: - throw new Error(`Packetizer not implemented for ${this._videoCodec}`); - } - this._videoPacketizer.addToChain(new RtcpSrReporter(rtpConfigVideo)); - this._videoPacketizer.addToChain(new RtcpNackResponder()); - this._videoPacketizer.addToChain(new PacingHandler(25 * 1000 * 1000, 1)); - - this._setMediaHandler(); - } -} diff --git a/vendor/discord-video-stream/src/client/voice/index.ts b/vendor/discord-video-stream/src/client/voice/index.ts deleted file mode 100644 index 5e3282d..0000000 --- a/vendor/discord-video-stream/src/client/voice/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./VoiceConnection.js"; -export * from "./VoiceOpCodes.js"; -// export * from './MediaUdp.js'; -export * from "./StreamConnection.js"; -export * from "./BaseMediaConnection.js"; diff --git a/vendor/discord-video-stream/src/index.ts b/vendor/discord-video-stream/src/index.ts deleted file mode 100644 index 3240fe2..0000000 --- a/vendor/discord-video-stream/src/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./client/index.js"; -export * from "./media/index.js"; -export * as Utils from "./utils.js"; diff --git a/vendor/discord-video-stream/src/media/AudioStream.ts b/vendor/discord-video-stream/src/media/AudioStream.ts deleted file mode 100644 index 2503030..0000000 --- a/vendor/discord-video-stream/src/media/AudioStream.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { BaseMediaStream } from "./BaseMediaStream.js"; -import type { WebRtcConnWrapper } from "../client/voice/WebRtcWrapper.js"; - -export class AudioStream extends BaseMediaStream { - private _conn: WebRtcConnWrapper; - - constructor(conn: WebRtcConnWrapper, noSleep = false) { - super("audio", noSleep); - this._conn = conn; - } - - protected override async _sendFrame( - frame: Buffer, - frametime: number, - ): Promise { - this._conn.sendAudioFrame(frame, frametime); - } -} diff --git a/vendor/discord-video-stream/src/media/BaseMediaStream.ts b/vendor/discord-video-stream/src/media/BaseMediaStream.ts deleted file mode 100644 index 56291b3..0000000 --- a/vendor/discord-video-stream/src/media/BaseMediaStream.ts +++ /dev/null @@ -1,198 +0,0 @@ -import { Log } from "debug-level"; -import { setTimeout } from "node:timers/promises"; -import { Writable } from "node:stream"; -import type { Packet } from "node-av"; - -export class BaseMediaStream extends Writable { - private _pts?: number; - private _syncTolerance = 20; - private _loggerSend: Log; - private _loggerSync: Log; - private _loggerSleep: Log; - - private _noSleep: boolean; - private _startTime?: number; - private _startPts?: number; - private _sync = true; - private _syncStream?: BaseMediaStream; - - constructor(type: string, noSleep = false) { - super({ objectMode: true, highWaterMark: 0 }); - this._loggerSend = new Log(`stream:${type}:send`); - this._loggerSync = new Log(`stream:${type}:sync`); - this._loggerSleep = new Log(`stream:${type}:sleep`); - this._noSleep = noSleep; - } - - get sync(): boolean { - return this._sync; - } - set sync(val: boolean) { - this._sync = val; - if (val) this._loggerSync.debug("Sync enabled"); - else this._loggerSync.debug("Sync disabled"); - } - get syncStream() { - return this._syncStream; - } - set syncStream(stream: BaseMediaStream | undefined) { - if (stream !== undefined && this === stream.syncStream) - throw new Error("Cannot sync 2 streams with eachother"); - this._syncStream = stream; - } - get noSleep(): boolean { - return this._noSleep; - } - set noSleep(val: boolean) { - this._noSleep = val; - if (!val) this.resetTimingCompensation(); - } - get pts(): number | undefined { - return this._pts; - } - get syncTolerance() { - return this._syncTolerance; - } - set syncTolerance(n: number) { - if (n < 0) return; - this._syncTolerance = n; - } - protected async _sendFrame( - _frame: Buffer, - _frametime: number, - ): Promise { - throw new Error("Not implemented"); - } - private ptsDelta() { - if (this.pts !== undefined && this.syncStream?.pts !== undefined) - return this.pts - this.syncStream.pts; - return undefined; - } - private isAhead() { - const delta = this.ptsDelta(); - return ( - this.syncStream?.writableEnded === false && - delta !== undefined && - delta > this.syncTolerance - ); - } - private isBehind() { - const delta = this.ptsDelta(); - return ( - this.syncStream?.writableEnded === false && - delta !== undefined && - delta < -this.syncTolerance - ); - } - private resetTimingCompensation() { - this._startTime = this._startPts = undefined; - } - async _write( - frame: Packet, - _: BufferEncoding, - callback: (error?: Error | null) => void, - ) { - const { data, pts, duration, timeBase } = frame; - if (!data) { - frame.free(); - callback(); - return; - } - - const frametime = (Number(duration) / timeBase.den) * timeBase.num * 1000; - - const start_sendFrame = performance.now(); - await this._sendFrame(Buffer.from(data), frametime); - const end_sendFrame = performance.now(); - - this._pts = (Number(pts) / timeBase.den) * timeBase.num * 1000; - this.emit("pts", this._pts); - - const sendTime = end_sendFrame - start_sendFrame; - const ratio = sendTime / frametime; - this._loggerSend.debug( - { - stats: { - pts: this._pts, - frame_size: data.length, - duration: sendTime, - frametime, - }, - }, - `Frame sent in ${sendTime.toFixed(2)}ms (${(ratio * 100).toFixed(2)}% frametime)`, - ); - if (ratio > 1) { - this._loggerSend.warn( - { - frame_size: data.length, - duration: sendTime, - frametime, - }, - `Frame takes too long to send (${(ratio * 100).toFixed(2)}% frametime)`, - ); - } - - this._startTime ??= start_sendFrame; - this._startPts ??= this._pts; - const sleep = Math.max( - 0, - this._pts - - this._startPts + - frametime - - (end_sendFrame - this._startTime), - ); - if (this._noSleep || sleep === 0) { - callback(null); - } else if (this.sync && this.isBehind()) { - this._loggerSync.debug( - { - stats: { - pts: this.pts, - pts_other: this.syncStream?.pts, - }, - }, - "Stream is behind. Not sleeping for this frame", - ); - this.resetTimingCompensation(); - callback(null); - } else if (this.sync && this.isAhead()) { - do { - this._loggerSync.debug( - { - stats: { - pts: this.pts, - pts_other: this.syncStream?.pts, - frametime, - }, - }, - `Stream is ahead. Waiting for ${frametime}ms`, - ); - await setTimeout(frametime); - } while (this.sync && this.isAhead()); - this.resetTimingCompensation(); - callback(null); - } else { - this._loggerSleep.debug( - { - stats: { - pts: this._pts, - startPts: this._startPts, - time: end_sendFrame, - startTime: this._startTime, - frametime, - }, - }, - `Sleeping for ${sleep}ms`, - ); - setTimeout(sleep).then(() => callback(null)); - } - frame.free(); - } - _destroy( - error: Error | null, - callback: (error?: Error | null) => void, - ): void { - super._destroy(error, callback); - this.syncStream = undefined; - } -} diff --git a/vendor/discord-video-stream/src/media/LibavCodecId.ts b/vendor/discord-video-stream/src/media/LibavCodecId.ts deleted file mode 100644 index a5f023b..0000000 --- a/vendor/discord-video-stream/src/media/LibavCodecId.ts +++ /dev/null @@ -1,564 +0,0 @@ -// https://ffmpeg.org/doxygen/7.0/codec__id_8h_source.html - -export enum AVCodecID { - AV_CODEC_ID_NONE, - - /* video codecs */ - AV_CODEC_ID_MPEG1VIDEO, - AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding - AV_CODEC_ID_H261, - AV_CODEC_ID_H263, - AV_CODEC_ID_RV10, - AV_CODEC_ID_RV20, - AV_CODEC_ID_MJPEG, - AV_CODEC_ID_MJPEGB, - AV_CODEC_ID_LJPEG, - AV_CODEC_ID_SP5X, - AV_CODEC_ID_JPEGLS, - AV_CODEC_ID_MPEG4, - AV_CODEC_ID_RAWVIDEO, - AV_CODEC_ID_MSMPEG4V1, - AV_CODEC_ID_MSMPEG4V2, - AV_CODEC_ID_MSMPEG4V3, - AV_CODEC_ID_WMV1, - AV_CODEC_ID_WMV2, - AV_CODEC_ID_H263P, - AV_CODEC_ID_H263I, - AV_CODEC_ID_FLV1, - AV_CODEC_ID_SVQ1, - AV_CODEC_ID_SVQ3, - AV_CODEC_ID_DVVIDEO, - AV_CODEC_ID_HUFFYUV, - AV_CODEC_ID_CYUV, - AV_CODEC_ID_H264, - AV_CODEC_ID_INDEO3, - AV_CODEC_ID_VP3, - AV_CODEC_ID_THEORA, - AV_CODEC_ID_ASV1, - AV_CODEC_ID_ASV2, - AV_CODEC_ID_FFV1, - AV_CODEC_ID_4XM, - AV_CODEC_ID_VCR1, - AV_CODEC_ID_CLJR, - AV_CODEC_ID_MDEC, - AV_CODEC_ID_ROQ, - AV_CODEC_ID_INTERPLAY_VIDEO, - AV_CODEC_ID_XAN_WC3, - AV_CODEC_ID_XAN_WC4, - AV_CODEC_ID_RPZA, - AV_CODEC_ID_CINEPAK, - AV_CODEC_ID_WS_VQA, - AV_CODEC_ID_MSRLE, - AV_CODEC_ID_MSVIDEO1, - AV_CODEC_ID_IDCIN, - AV_CODEC_ID_8BPS, - AV_CODEC_ID_SMC, - AV_CODEC_ID_FLIC, - AV_CODEC_ID_TRUEMOTION1, - AV_CODEC_ID_VMDVIDEO, - AV_CODEC_ID_MSZH, - AV_CODEC_ID_ZLIB, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_TSCC, - AV_CODEC_ID_ULTI, - AV_CODEC_ID_QDRAW, - AV_CODEC_ID_VIXL, - AV_CODEC_ID_QPEG, - AV_CODEC_ID_PNG, - AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, - AV_CODEC_ID_PGM, - AV_CODEC_ID_PGMYUV, - AV_CODEC_ID_PAM, - AV_CODEC_ID_FFVHUFF, - AV_CODEC_ID_RV30, - AV_CODEC_ID_RV40, - AV_CODEC_ID_VC1, - AV_CODEC_ID_WMV3, - AV_CODEC_ID_LOCO, - AV_CODEC_ID_WNV1, - AV_CODEC_ID_AASC, - AV_CODEC_ID_INDEO2, - AV_CODEC_ID_FRAPS, - AV_CODEC_ID_TRUEMOTION2, - AV_CODEC_ID_BMP, - AV_CODEC_ID_CSCD, - AV_CODEC_ID_MMVIDEO, - AV_CODEC_ID_ZMBV, - AV_CODEC_ID_AVS, - AV_CODEC_ID_SMACKVIDEO, - AV_CODEC_ID_NUV, - AV_CODEC_ID_KMVC, - AV_CODEC_ID_FLASHSV, - AV_CODEC_ID_CAVS, - AV_CODEC_ID_JPEG2000, - AV_CODEC_ID_VMNC, - AV_CODEC_ID_VP5, - AV_CODEC_ID_VP6, - AV_CODEC_ID_VP6F, - AV_CODEC_ID_TARGA, - AV_CODEC_ID_DSICINVIDEO, - AV_CODEC_ID_TIERTEXSEQVIDEO, - AV_CODEC_ID_TIFF, - AV_CODEC_ID_GIF, - AV_CODEC_ID_DXA, - AV_CODEC_ID_DNXHD, - AV_CODEC_ID_THP, - AV_CODEC_ID_SGI, - AV_CODEC_ID_C93, - AV_CODEC_ID_BETHSOFTVID, - AV_CODEC_ID_PTX, - AV_CODEC_ID_TXD, - AV_CODEC_ID_VP6A, - AV_CODEC_ID_AMV, - AV_CODEC_ID_VB, - AV_CODEC_ID_PCX, - AV_CODEC_ID_SUNRAST, - AV_CODEC_ID_INDEO4, - AV_CODEC_ID_INDEO5, - AV_CODEC_ID_MIMIC, - AV_CODEC_ID_RL2, - AV_CODEC_ID_ESCAPE124, - AV_CODEC_ID_DIRAC, - AV_CODEC_ID_BFI, - AV_CODEC_ID_CMV, - AV_CODEC_ID_MOTIONPIXELS, - AV_CODEC_ID_TGV, - AV_CODEC_ID_TGQ, - AV_CODEC_ID_TQI, - AV_CODEC_ID_AURA, - AV_CODEC_ID_AURA2, - AV_CODEC_ID_V210X, - AV_CODEC_ID_TMV, - AV_CODEC_ID_V210, - AV_CODEC_ID_DPX, - AV_CODEC_ID_MAD, - AV_CODEC_ID_FRWU, - AV_CODEC_ID_FLASHSV2, - AV_CODEC_ID_CDGRAPHICS, - AV_CODEC_ID_R210, - AV_CODEC_ID_ANM, - AV_CODEC_ID_BINKVIDEO, - AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_IFF_BYTERUN1 = AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_KGV1, - AV_CODEC_ID_YOP, - AV_CODEC_ID_VP8, - AV_CODEC_ID_PICTOR, - AV_CODEC_ID_ANSI, - AV_CODEC_ID_A64_MULTI, - AV_CODEC_ID_A64_MULTI5, - AV_CODEC_ID_R10K, - AV_CODEC_ID_MXPEG, - AV_CODEC_ID_LAGARITH, - AV_CODEC_ID_PRORES, - AV_CODEC_ID_JV, - AV_CODEC_ID_DFA, - AV_CODEC_ID_WMV3IMAGE, - AV_CODEC_ID_VC1IMAGE, - AV_CODEC_ID_UTVIDEO, - AV_CODEC_ID_BMV_VIDEO, - AV_CODEC_ID_VBLE, - AV_CODEC_ID_DXTORY, - AV_CODEC_ID_V410, - AV_CODEC_ID_XWD, - AV_CODEC_ID_CDXL, - AV_CODEC_ID_XBM, - AV_CODEC_ID_ZEROCODEC, - AV_CODEC_ID_MSS1, - AV_CODEC_ID_MSA1, - AV_CODEC_ID_TSCC2, - AV_CODEC_ID_MTS2, - AV_CODEC_ID_CLLC, - AV_CODEC_ID_MSS2, - AV_CODEC_ID_VP9, - AV_CODEC_ID_AIC, - AV_CODEC_ID_ESCAPE130, - AV_CODEC_ID_G2M, - AV_CODEC_ID_WEBP, - AV_CODEC_ID_HNM4_VIDEO, - AV_CODEC_ID_HEVC, - AV_CODEC_ID_H265 = AV_CODEC_ID_HEVC, - AV_CODEC_ID_FIC, - AV_CODEC_ID_ALIAS_PIX, - AV_CODEC_ID_BRENDER_PIX, - AV_CODEC_ID_PAF_VIDEO, - AV_CODEC_ID_EXR, - AV_CODEC_ID_VP7, - AV_CODEC_ID_SANM, - AV_CODEC_ID_SGIRLE, - AV_CODEC_ID_MVC1, - AV_CODEC_ID_MVC2, - AV_CODEC_ID_HQX, - AV_CODEC_ID_TDSC, - AV_CODEC_ID_HQ_HQA, - AV_CODEC_ID_HAP, - AV_CODEC_ID_DDS, - AV_CODEC_ID_DXV, - AV_CODEC_ID_SCREENPRESSO, - AV_CODEC_ID_RSCC, - AV_CODEC_ID_AVS2, - AV_CODEC_ID_PGX, - AV_CODEC_ID_AVS3, - AV_CODEC_ID_MSP2, - AV_CODEC_ID_VVC, - AV_CODEC_ID_H266 = AV_CODEC_ID_VVC, - AV_CODEC_ID_Y41P, - AV_CODEC_ID_AVRP, - AV_CODEC_ID_012V, - AV_CODEC_ID_AVUI, - AV_CODEC_ID_TARGA_Y216, - AV_CODEC_ID_V308, - AV_CODEC_ID_V408, - AV_CODEC_ID_YUV4, - AV_CODEC_ID_AVRN, - AV_CODEC_ID_CPIA, - AV_CODEC_ID_XFACE, - AV_CODEC_ID_SNOW, - AV_CODEC_ID_SMVJPEG, - AV_CODEC_ID_APNG, - AV_CODEC_ID_DAALA, - AV_CODEC_ID_CFHD, - AV_CODEC_ID_TRUEMOTION2RT, - AV_CODEC_ID_M101, - AV_CODEC_ID_MAGICYUV, - AV_CODEC_ID_SHEERVIDEO, - AV_CODEC_ID_YLC, - AV_CODEC_ID_PSD, - AV_CODEC_ID_PIXLET, - AV_CODEC_ID_SPEEDHQ, - AV_CODEC_ID_FMVC, - AV_CODEC_ID_SCPR, - AV_CODEC_ID_CLEARVIDEO, - AV_CODEC_ID_XPM, - AV_CODEC_ID_AV1, - AV_CODEC_ID_BITPACKED, - AV_CODEC_ID_MSCC, - AV_CODEC_ID_SRGC, - AV_CODEC_ID_SVG, - AV_CODEC_ID_GDV, - AV_CODEC_ID_FITS, - AV_CODEC_ID_IMM4, - AV_CODEC_ID_PROSUMER, - AV_CODEC_ID_MWSC, - AV_CODEC_ID_WCMV, - AV_CODEC_ID_RASC, - AV_CODEC_ID_HYMT, - AV_CODEC_ID_ARBC, - AV_CODEC_ID_AGM, - AV_CODEC_ID_LSCR, - AV_CODEC_ID_VP4, - AV_CODEC_ID_IMM5, - AV_CODEC_ID_MVDV, - AV_CODEC_ID_MVHA, - AV_CODEC_ID_CDTOONS, - AV_CODEC_ID_MV30, - AV_CODEC_ID_NOTCHLC, - AV_CODEC_ID_PFM, - AV_CODEC_ID_MOBICLIP, - AV_CODEC_ID_PHOTOCD, - AV_CODEC_ID_IPU, - AV_CODEC_ID_ARGO, - AV_CODEC_ID_CRI, - AV_CODEC_ID_SIMBIOSIS_IMX, - AV_CODEC_ID_SGA_VIDEO, - AV_CODEC_ID_GEM, - AV_CODEC_ID_VBN, - AV_CODEC_ID_JPEGXL, - AV_CODEC_ID_QOI, - AV_CODEC_ID_PHM, - AV_CODEC_ID_RADIANCE_HDR, - AV_CODEC_ID_WBMP, - AV_CODEC_ID_MEDIA100, - AV_CODEC_ID_VQC, - AV_CODEC_ID_PDV, - AV_CODEC_ID_EVC, - AV_CODEC_ID_RTV1, - AV_CODEC_ID_VMIX, - AV_CODEC_ID_LEAD, - - /* various PCM "codecs" */ - AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs - AV_CODEC_ID_PCM_S16LE = 0x10000, - AV_CODEC_ID_PCM_S16BE, - AV_CODEC_ID_PCM_U16LE, - AV_CODEC_ID_PCM_U16BE, - AV_CODEC_ID_PCM_S8, - AV_CODEC_ID_PCM_U8, - AV_CODEC_ID_PCM_MULAW, - AV_CODEC_ID_PCM_ALAW, - AV_CODEC_ID_PCM_S32LE, - AV_CODEC_ID_PCM_S32BE, - AV_CODEC_ID_PCM_U32LE, - AV_CODEC_ID_PCM_U32BE, - AV_CODEC_ID_PCM_S24LE, - AV_CODEC_ID_PCM_S24BE, - AV_CODEC_ID_PCM_U24LE, - AV_CODEC_ID_PCM_U24BE, - AV_CODEC_ID_PCM_S24DAUD, - AV_CODEC_ID_PCM_ZORK, - AV_CODEC_ID_PCM_S16LE_PLANAR, - AV_CODEC_ID_PCM_DVD, - AV_CODEC_ID_PCM_F32BE, - AV_CODEC_ID_PCM_F32LE, - AV_CODEC_ID_PCM_F64BE, - AV_CODEC_ID_PCM_F64LE, - AV_CODEC_ID_PCM_BLURAY, - AV_CODEC_ID_PCM_LXF, - AV_CODEC_ID_S302M, - AV_CODEC_ID_PCM_S8_PLANAR, - AV_CODEC_ID_PCM_S24LE_PLANAR, - AV_CODEC_ID_PCM_S32LE_PLANAR, - AV_CODEC_ID_PCM_S16BE_PLANAR, - AV_CODEC_ID_PCM_S64LE, - AV_CODEC_ID_PCM_S64BE, - AV_CODEC_ID_PCM_F16LE, - AV_CODEC_ID_PCM_F24LE, - AV_CODEC_ID_PCM_VIDC, - AV_CODEC_ID_PCM_SGA, - - /* various ADPCM codecs */ - AV_CODEC_ID_ADPCM_IMA_QT = 0x11000, - AV_CODEC_ID_ADPCM_IMA_WAV, - AV_CODEC_ID_ADPCM_IMA_DK3, - AV_CODEC_ID_ADPCM_IMA_DK4, - AV_CODEC_ID_ADPCM_IMA_WS, - AV_CODEC_ID_ADPCM_IMA_SMJPEG, - AV_CODEC_ID_ADPCM_MS, - AV_CODEC_ID_ADPCM_4XM, - AV_CODEC_ID_ADPCM_XA, - AV_CODEC_ID_ADPCM_ADX, - AV_CODEC_ID_ADPCM_EA, - AV_CODEC_ID_ADPCM_G726, - AV_CODEC_ID_ADPCM_CT, - AV_CODEC_ID_ADPCM_SWF, - AV_CODEC_ID_ADPCM_YAMAHA, - AV_CODEC_ID_ADPCM_SBPRO_4, - AV_CODEC_ID_ADPCM_SBPRO_3, - AV_CODEC_ID_ADPCM_SBPRO_2, - AV_CODEC_ID_ADPCM_THP, - AV_CODEC_ID_ADPCM_IMA_AMV, - AV_CODEC_ID_ADPCM_EA_R1, - AV_CODEC_ID_ADPCM_EA_R3, - AV_CODEC_ID_ADPCM_EA_R2, - AV_CODEC_ID_ADPCM_IMA_EA_SEAD, - AV_CODEC_ID_ADPCM_IMA_EA_EACS, - AV_CODEC_ID_ADPCM_EA_XAS, - AV_CODEC_ID_ADPCM_EA_MAXIS_XA, - AV_CODEC_ID_ADPCM_IMA_ISS, - AV_CODEC_ID_ADPCM_G722, - AV_CODEC_ID_ADPCM_IMA_APC, - AV_CODEC_ID_ADPCM_VIMA, - AV_CODEC_ID_ADPCM_AFC, - AV_CODEC_ID_ADPCM_IMA_OKI, - AV_CODEC_ID_ADPCM_DTK, - AV_CODEC_ID_ADPCM_IMA_RAD, - AV_CODEC_ID_ADPCM_G726LE, - AV_CODEC_ID_ADPCM_THP_LE, - AV_CODEC_ID_ADPCM_PSX, - AV_CODEC_ID_ADPCM_AICA, - AV_CODEC_ID_ADPCM_IMA_DAT4, - AV_CODEC_ID_ADPCM_MTAF, - AV_CODEC_ID_ADPCM_AGM, - AV_CODEC_ID_ADPCM_ARGO, - AV_CODEC_ID_ADPCM_IMA_SSI, - AV_CODEC_ID_ADPCM_ZORK, - AV_CODEC_ID_ADPCM_IMA_APM, - AV_CODEC_ID_ADPCM_IMA_ALP, - AV_CODEC_ID_ADPCM_IMA_MTF, - AV_CODEC_ID_ADPCM_IMA_CUNNING, - AV_CODEC_ID_ADPCM_IMA_MOFLEX, - AV_CODEC_ID_ADPCM_IMA_ACORN, - AV_CODEC_ID_ADPCM_XMD, - - /* AMR */ - AV_CODEC_ID_AMR_NB = 0x12000, - AV_CODEC_ID_AMR_WB, - - /* RealAudio codecs*/ - AV_CODEC_ID_RA_144 = 0x13000, - AV_CODEC_ID_RA_288, - - /* various DPCM codecs */ - AV_CODEC_ID_ROQ_DPCM = 0x14000, - AV_CODEC_ID_INTERPLAY_DPCM, - AV_CODEC_ID_XAN_DPCM, - AV_CODEC_ID_SOL_DPCM, - AV_CODEC_ID_SDX2_DPCM, - AV_CODEC_ID_GREMLIN_DPCM, - AV_CODEC_ID_DERF_DPCM, - AV_CODEC_ID_WADY_DPCM, - AV_CODEC_ID_CBD2_DPCM, - - /* audio codecs */ - AV_CODEC_ID_MP2 = 0x15000, - AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - AV_CODEC_ID_AAC, - AV_CODEC_ID_AC3, - AV_CODEC_ID_DTS, - AV_CODEC_ID_VORBIS, - AV_CODEC_ID_DVAUDIO, - AV_CODEC_ID_WMAV1, - AV_CODEC_ID_WMAV2, - AV_CODEC_ID_MACE3, - AV_CODEC_ID_MACE6, - AV_CODEC_ID_VMDAUDIO, - AV_CODEC_ID_FLAC, - AV_CODEC_ID_MP3ADU, - AV_CODEC_ID_MP3ON4, - AV_CODEC_ID_SHORTEN, - AV_CODEC_ID_ALAC, - AV_CODEC_ID_WESTWOOD_SND1, - AV_CODEC_ID_GSM, ///< as in Berlin toast format - AV_CODEC_ID_QDM2, - AV_CODEC_ID_COOK, - AV_CODEC_ID_TRUESPEECH, - AV_CODEC_ID_TTA, - AV_CODEC_ID_SMACKAUDIO, - AV_CODEC_ID_QCELP, - AV_CODEC_ID_WAVPACK, - AV_CODEC_ID_DSICINAUDIO, - AV_CODEC_ID_IMC, - AV_CODEC_ID_MUSEPACK7, - AV_CODEC_ID_MLP, - AV_CODEC_ID_GSM_MS /* as found in WAV */, - AV_CODEC_ID_ATRAC3, - AV_CODEC_ID_APE, - AV_CODEC_ID_NELLYMOSER, - AV_CODEC_ID_MUSEPACK8, - AV_CODEC_ID_SPEEX, - AV_CODEC_ID_WMAVOICE, - AV_CODEC_ID_WMAPRO, - AV_CODEC_ID_WMALOSSLESS, - AV_CODEC_ID_ATRAC3P, - AV_CODEC_ID_EAC3, - AV_CODEC_ID_SIPR, - AV_CODEC_ID_MP1, - AV_CODEC_ID_TWINVQ, - AV_CODEC_ID_TRUEHD, - AV_CODEC_ID_MP4ALS, - AV_CODEC_ID_ATRAC1, - AV_CODEC_ID_BINKAUDIO_RDFT, - AV_CODEC_ID_BINKAUDIO_DCT, - AV_CODEC_ID_AAC_LATM, - AV_CODEC_ID_QDMC, - AV_CODEC_ID_CELT, - AV_CODEC_ID_G723_1, - AV_CODEC_ID_G729, - AV_CODEC_ID_8SVX_EXP, - AV_CODEC_ID_8SVX_FIB, - AV_CODEC_ID_BMV_AUDIO, - AV_CODEC_ID_RALF, - AV_CODEC_ID_IAC, - AV_CODEC_ID_ILBC, - AV_CODEC_ID_OPUS, - AV_CODEC_ID_COMFORT_NOISE, - AV_CODEC_ID_TAK, - AV_CODEC_ID_METASOUND, - AV_CODEC_ID_PAF_AUDIO, - AV_CODEC_ID_ON2AVC, - AV_CODEC_ID_DSS_SP, - AV_CODEC_ID_CODEC2, - AV_CODEC_ID_FFWAVESYNTH, - AV_CODEC_ID_SONIC, - AV_CODEC_ID_SONIC_LS, - AV_CODEC_ID_EVRC, - AV_CODEC_ID_SMV, - AV_CODEC_ID_DSD_LSBF, - AV_CODEC_ID_DSD_MSBF, - AV_CODEC_ID_DSD_LSBF_PLANAR, - AV_CODEC_ID_DSD_MSBF_PLANAR, - AV_CODEC_ID_4GV, - AV_CODEC_ID_INTERPLAY_ACM, - AV_CODEC_ID_XMA1, - AV_CODEC_ID_XMA2, - AV_CODEC_ID_DST, - AV_CODEC_ID_ATRAC3AL, - AV_CODEC_ID_ATRAC3PAL, - AV_CODEC_ID_DOLBY_E, - AV_CODEC_ID_APTX, - AV_CODEC_ID_APTX_HD, - AV_CODEC_ID_SBC, - AV_CODEC_ID_ATRAC9, - AV_CODEC_ID_HCOM, - AV_CODEC_ID_ACELP_KELVIN, - AV_CODEC_ID_MPEGH_3D_AUDIO, - AV_CODEC_ID_SIREN, - AV_CODEC_ID_HCA, - AV_CODEC_ID_FASTAUDIO, - AV_CODEC_ID_MSNSIREN, - AV_CODEC_ID_DFPWM, - AV_CODEC_ID_BONK, - AV_CODEC_ID_MISC4, - AV_CODEC_ID_APAC, - AV_CODEC_ID_FTR, - AV_CODEC_ID_WAVARC, - AV_CODEC_ID_RKA, - AV_CODEC_ID_AC4, - AV_CODEC_ID_OSQ, - AV_CODEC_ID_QOA, - - /* subtitle codecs */ - AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. - AV_CODEC_ID_DVD_SUBTITLE = 0x17000, - AV_CODEC_ID_DVB_SUBTITLE, - AV_CODEC_ID_TEXT, ///< raw UTF-8 text - AV_CODEC_ID_XSUB, - AV_CODEC_ID_SSA, - AV_CODEC_ID_MOV_TEXT, - AV_CODEC_ID_HDMV_PGS_SUBTITLE, - AV_CODEC_ID_DVB_TELETEXT, - AV_CODEC_ID_SRT, - AV_CODEC_ID_MICRODVD, - AV_CODEC_ID_EIA_608, - AV_CODEC_ID_JACOSUB, - AV_CODEC_ID_SAMI, - AV_CODEC_ID_REALTEXT, - AV_CODEC_ID_STL, - AV_CODEC_ID_SUBVIEWER1, - AV_CODEC_ID_SUBVIEWER, - AV_CODEC_ID_SUBRIP, - AV_CODEC_ID_WEBVTT, - AV_CODEC_ID_MPL2, - AV_CODEC_ID_VPLAYER, - AV_CODEC_ID_PJS, - AV_CODEC_ID_ASS, - AV_CODEC_ID_HDMV_TEXT_SUBTITLE, - AV_CODEC_ID_TTML, - AV_CODEC_ID_ARIB_CAPTION, - - /* other specific kind of codecs (generally used for attachments) */ - AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. - AV_CODEC_ID_TTF = 0x18000, - - AV_CODEC_ID_SCTE_35, ///< Contain timestamp estimated through PCR of program stream. - AV_CODEC_ID_EPG, - AV_CODEC_ID_BINTEXT, - AV_CODEC_ID_XBIN, - AV_CODEC_ID_IDF, - AV_CODEC_ID_OTF, - AV_CODEC_ID_SMPTE_KLV, - AV_CODEC_ID_DVD_NAV, - AV_CODEC_ID_TIMED_ID3, - AV_CODEC_ID_BIN_DATA, - AV_CODEC_ID_SMPTE_2038, - - AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it - - AV_CODEC_ID_MPEG2TS = 0x20000 /**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) */, - AV_CODEC_ID_MPEG4SYSTEMS = 0x20001 /**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) */, - AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information. - AV_CODEC_ID_WRAPPED_AVFRAME = 0x21001, ///< Passthrough codec, AVFrames wrapped in AVPacket - /** - * Dummy null video codec, useful mainly for development and debugging. - * Null encoder/decoder discard all input and never return any output. - */ - AV_CODEC_ID_VNULL, - /** - * Dummy null audio codec, useful mainly for development and debugging. - * Null encoder/decoder discard all input and never return any output. - */ - AV_CODEC_ID_ANULL, -} diff --git a/vendor/discord-video-stream/src/media/LibavDecoder.ts b/vendor/discord-video-stream/src/media/LibavDecoder.ts deleted file mode 100644 index a1896a6..0000000 --- a/vendor/discord-video-stream/src/media/LibavDecoder.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { - Decoder, - FilterAPI, - type Frame, - type Packet, - type Stream, -} from "node-av"; - -export async function createDecoder(stream: Stream) { - const decoder = await Decoder.create(stream); - let freed = false; - let serializer: Promise | null = null; - const serialize = (f: () => Promise) => { - let p: Promise; - if (serializer) { - p = serializer.catch(() => {}).then(() => f()); - } else { - p = f(); - } - serializer = p = p.finally(() => { - if (serializer === p) serializer = null; - }); - return p; - }; - const filter = FilterAPI.create("format=pix_fmts=rgba"); - return { - decode: async (packets: Packet) => { - if (freed) return []; - - return serialize(async () => { - const frames = await decoder.decodeAll(packets); - let filtered: Frame[] = []; - for (const frame of frames) { - filtered = [...filtered, ...(await filter.processAll(frame))]; - } - return filtered; - }); - }, - free: () => { - freed = true; - return serialize(async () => { - decoder.close(); - filter.close(); - }); - }, - }; -} diff --git a/vendor/discord-video-stream/src/media/LibavDemuxer.ts b/vendor/discord-video-stream/src/media/LibavDemuxer.ts deleted file mode 100644 index f5d9c1c..0000000 --- a/vendor/discord-video-stream/src/media/LibavDemuxer.ts +++ /dev/null @@ -1,291 +0,0 @@ -import pDebounce from "p-debounce"; -import { - BitStreamFilterAPI, - Demuxer, - avGetCodecName, - type Stream, -} from "node-av"; -import { Log } from "debug-level"; -import { randomUUID } from "node:crypto"; -import { AVCodecID } from "./LibavCodecId.js"; -import { PassThrough } from "node:stream"; -import type { CodecParameters, Packet } from "node-av"; -import type { Readable } from "node:stream"; - -type MediaStreamInfoCommon = { - index: number; - codec: AVCodecID; - codecpar: CodecParameters; - avStream: Stream; -}; - -export type VideoStreamInfo = MediaStreamInfoCommon & { - width: number; - height: number; - framerate_num: number; - framerate_den: number; -}; -export type AudioStreamInfo = MediaStreamInfoCommon & { - sample_rate: number; -}; - -const allowedVideoCodec = new Set([ - AVCodecID.AV_CODEC_ID_H264, - AVCodecID.AV_CODEC_ID_H265, - AVCodecID.AV_CODEC_ID_VP8, - AVCodecID.AV_CODEC_ID_VP9, - AVCodecID.AV_CODEC_ID_AV1, -]); - -const allowedAudioCodec = new Set([AVCodecID.AV_CODEC_ID_OPUS]); - -function parseOpusPacketDuration(frame: Uint8Array) { - // https://datatracker.ietf.org/doc/html/rfc6716#section-3.1 - const frameSizes = [ - // SILK only, narrow band - 10, 20, 40, 60, - - // SILK only, medium band - 10, 20, 40, 60, - - // SILK only, wide band - 10, 20, 40, 60, - - // Hybrid, super wide band - 10, 20, - - // Hybrid, full band - 10, 20, - - // CELT only, narrow band - 2.5, 5, 10, 20, - - // CELT only, wide band - 2.5, 5, 10, 20, - - // CELT only, super wide band - 2.5, 5, 10, 20, - - // CELT only, full band - 2.5, 5, 10, 20, - ]; - - const frameSize = (48000 / 1000) * frameSizes[frame[0] >> 3]; - - let frameCount = 0; - const c = frame[0] & 0b11; - switch (c) { - case 0: - frameCount = 1; - break; - - case 1: - case 2: - frameCount = 2; - break; - - case 3: - frameCount = frame[1] & 0b111111; - break; - } - - return frameSize * frameCount; -} - -type DemuxerOptions = { - format: "matroska" | "nut"; -}; - -export async function demux(input: Readable, { format }: DemuxerOptions) { - const loggerFormat = new Log("demux:format"); - const loggerFrameCommon = new Log("demux:frame:common"); - const loggerFrameVideo = new Log("demux:frame:video"); - const loggerFrameAudio = new Log("demux:frame:audio"); - - const filename = randomUUID(); - const demuxer = await Demuxer.open(input, { - options: { - fflags: "nobuffer", - }, - format, - bufferSize: 8192, - }); - - const cleanup = () => { - input.destroy(); - demuxer.close(); - vPipe.off("drain", readFrame); - aPipe.off("drain", readFrame); - vPipe.end(); - aPipe.end(); - vbsf.forEach((e) => { - e.close(); - }); - }; - - const vStream = demuxer.video(); - const aStream = demuxer.audio(); - - let vInfo: VideoStreamInfo | undefined; - let aInfo: AudioStreamInfo | undefined; - const vPipe = new PassThrough({ - objectMode: true, - writableHighWaterMark: 128, - }); - const aPipe = new PassThrough({ - objectMode: true, - writableHighWaterMark: 128, - }); - - const vbsf: BitStreamFilterAPI[] = []; - if (vStream) { - const codecId = vStream.codecpar.codecId; - if (!allowedVideoCodec.has(codecId)) { - const codecName = avGetCodecName(codecId); - cleanup(); - throw new Error(`Video codec ${codecName} is not allowed`); - } - try { - switch (codecId) { - case AVCodecID.AV_CODEC_ID_H264: - vbsf.push(BitStreamFilterAPI.create("h264_mp4toannexb", vStream)); - vbsf.push( - BitStreamFilterAPI.create("h264_metadata", vStream, { - options: { - aud: "remove", - }, - }), - ); - vbsf.push(BitStreamFilterAPI.create("dump_extra", vStream)); - break; - case AVCodecID.AV_CODEC_ID_HEVC: - vbsf.push(BitStreamFilterAPI.create("hevc_mp4toannexb", vStream)); - vbsf.push( - BitStreamFilterAPI.create("hevc_metadata", vStream, { - options: { - aud: "remove", - }, - }), - ); - vbsf.push(BitStreamFilterAPI.create("dump_extra", vStream)); - break; - default: - vbsf.push(BitStreamFilterAPI.create("null", vStream)); - break; - } - } catch (e) { - cleanup(); - throw new Error(`Failed to construct bitstream filterchain`, { - cause: (e as Error).cause, - }); - } - - const codecpar = vbsf.at(-1)?.outputCodecParameters ?? vStream.codecpar; - vInfo = { - index: vStream.index, - codec: codecId, - codecpar, - width: codecpar.width ?? 0, - height: codecpar.height ?? 0, - framerate_num: codecpar.frameRate.num, - framerate_den: codecpar.frameRate.den, - avStream: vStream, - }; - loggerFormat.info( - { - info: vInfo, - }, - `Found video stream in input ${filename}`, - ); - } - if (aStream) { - const codecId = aStream.codecpar.codecId; - if (!allowedAudioCodec.has(codecId)) { - const codecName = avGetCodecName(codecId); - cleanup(); - throw new Error(`Audio codec ${codecName} is not allowed`); - } - aInfo = { - index: aStream.index, - codec: codecId, - codecpar: aStream.codecpar, - sample_rate: aStream.codecpar.sampleRate || 0, - avStream: aStream, - }; - loggerFormat.info( - { - info: aInfo, - }, - `Found audio stream in input ${filename}`, - ); - } - - const packetIterator = demuxer.packets(); - const applyBitStreamFilters = async ( - input: Packet | null, - filters: BitStreamFilterAPI[], - ) => { - let packets = [input]; - for (const filter of filters) { - let newPackets: (Packet | null)[] = []; - for (const packet of packets) { - newPackets = [...newPackets, ...(await filter.filterAll(packet))]; - packet?.free(); - } - if (!input) newPackets.push(null); - packets = newPackets; - } - return packets; - }; - const readFrame = pDebounce.promise(async () => { - let resume = true; - while (resume) { - try { - const { value: inPacket, done } = await packetIterator.next(); - if (done) { - loggerFrameCommon.info("Reached end of stream. Stopping"); - const packets = await applyBitStreamFilters(null, vbsf); - for (const packet of packets) { - if (packet) vPipe.write(packet); - } - cleanup(); - return; - } else if (inPacket) { - const streamIndex = inPacket.streamIndex; - if (vInfo && vInfo.index === streamIndex) { - loggerFrameVideo.trace("Received a video packet"); - const packets = await applyBitStreamFilters(inPacket.clone(), vbsf); - for (const packet of packets) { - if (packet) resume &&= vPipe.write(packet); - } - } else if (aInfo && aInfo.index === streamIndex) { - const packet = inPacket.clone()!; - packet.duration ||= BigInt(parseOpusPacketDuration(packet.data!)); - resume &&= aPipe.write(packet); - } - inPacket.free(); - } - } catch (e) { - loggerFrameCommon.info( - { error: e }, - "Received an error during frame extraction. Stopping", - ); - cleanup(); - return; - } - } - }); - vPipe.on("drain", () => { - loggerFrameVideo.trace("Video pipe drained"); - readFrame(); - }); - aPipe.on("drain", () => { - loggerFrameAudio.trace("Audio pipe drained"); - readFrame(); - }); - readFrame(); - return { - video: vInfo ? { ...vInfo, stream: vPipe as Readable } : undefined, - audio: aInfo ? { ...aInfo, stream: aPipe as Readable } : undefined, - }; -} diff --git a/vendor/discord-video-stream/src/media/VideoStream.ts b/vendor/discord-video-stream/src/media/VideoStream.ts deleted file mode 100644 index 140ace7..0000000 --- a/vendor/discord-video-stream/src/media/VideoStream.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { BaseMediaStream } from "./BaseMediaStream.js"; -import type { WebRtcConnWrapper } from "../client/voice/WebRtcWrapper.js"; - -export class VideoStream extends BaseMediaStream { - private _conn: WebRtcConnWrapper; - constructor(conn: WebRtcConnWrapper, noSleep = false) { - super("video", noSleep); - this._conn = conn; - } - - protected override async _sendFrame( - frame: Buffer, - frametime: number, - ): Promise { - this._conn.sendVideoFrame(frame, frametime); - } -} diff --git a/vendor/discord-video-stream/src/media/encoders/index.ts b/vendor/discord-video-stream/src/media/encoders/index.ts deleted file mode 100644 index 373036e..0000000 --- a/vendor/discord-video-stream/src/media/encoders/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { SupportedVideoCodec } from "../../utils.js"; - -export type EncoderSettings = { - name: string; - options: string[]; - globalOptions?: string[]; - outFilters?: string[]; -}; - -export type EncoderSettingsGetter = ( - bitrate: number, - bitrateMax: number, -) => Partial>; - -import { software } from "./software.js"; -import { nvenc } from "./nvenc.js"; -import { vaapi } from "./vaapi.js"; -import { merge } from "./merge.js"; - -const Encoders = { - software, - nvenc, - vaapi, - merge, -}; - -export { Encoders }; diff --git a/vendor/discord-video-stream/src/media/encoders/merge.ts b/vendor/discord-video-stream/src/media/encoders/merge.ts deleted file mode 100644 index b48ff8b..0000000 --- a/vendor/discord-video-stream/src/media/encoders/merge.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { EncoderSettingsGetter } from "./index.js"; -import type { SupportedVideoCodec } from "../../utils.js"; - -export const merge = ( - encoder: Partial>, -) => { - return ((bitrate, bitrateMax) => ({ - H264: encoder.H264?.(bitrate, bitrateMax), - H265: encoder.H265?.(bitrate, bitrateMax), - VP8: encoder.VP8?.(bitrate, bitrateMax), - VP9: encoder.VP9?.(bitrate, bitrateMax), - AV1: encoder.AV1?.(bitrate, bitrateMax), - })) as EncoderSettingsGetter; -}; diff --git a/vendor/discord-video-stream/src/media/encoders/nvenc.ts b/vendor/discord-video-stream/src/media/encoders/nvenc.ts deleted file mode 100644 index 629fd59..0000000 --- a/vendor/discord-video-stream/src/media/encoders/nvenc.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { EncoderSettingsGetter } from "./index.js"; - -type NvencPreset = "p1" | "p2" | "p3" | "p4" | "p5" | "p6" | "p7"; - -type NvencSettings = { - preset: NvencPreset; - spatialAq: boolean; - temporalAq: boolean; - gpu: number; -}; - -export function nvenc({ - preset = "p4", - spatialAq = false, - temporalAq = false, - gpu, -}: Partial = {}) { - const options = [ - `-preset ${preset}`, - `-spatial-aq ${spatialAq}`, - `-temporal-aq ${temporalAq}`, - ...(gpu !== undefined ? [`-gpu ${gpu}`] : []), - ]; - return (() => ({ - H264: { - name: "h264_nvenc", - options, - }, - H265: { - name: "hevc_nvenc", - options, - }, - AV1: { - name: "av1_nvenc", - options, - }, - })) as EncoderSettingsGetter; -} diff --git a/vendor/discord-video-stream/src/media/encoders/software.ts b/vendor/discord-video-stream/src/media/encoders/software.ts deleted file mode 100644 index ee3e97c..0000000 --- a/vendor/discord-video-stream/src/media/encoders/software.ts +++ /dev/null @@ -1,76 +0,0 @@ -import type { EncoderSettingsGetter } from "./index.js"; - -type DeepPartial = T extends unknown[] - ? T - : { [P in keyof T]?: DeepPartial }; -type x26xPreset = - | "ultrafast" - | "superfast" - | "veryfast" - | "faster" - | "fast" - | "medium" - | "slow" - | "slower" - | "veryslow" - | "placebo"; - -export type SoftwareEncoderSettings = { - x264: { - preset: x26xPreset; - tune: - | "film" - | "animation" - | "grain" - | "stillimage" - | "fastdecode" - | "zerolatency" - | "psnr" - | "ssim"; - }; - x265: { - preset: x26xPreset; - tune: - | "psnr" - | "ssim" - | "grain" - | "fastdecode" - | "zerolatency" - | "animation"; - }; -}; - -export const software = ({ - x264, - x265, -}: DeepPartial = {}) => { - const { preset: x264Preset = "superfast", tune: x264Tune = "film" } = - x264 ?? {}; - const { preset: x265Preset = "superfast", tune: x265Tune } = x265 ?? {}; - return (() => ({ - H264: { - name: "libx264", - options: ["-forced-idr 1", `-tune ${x264Tune}`, `-preset ${x264Preset}`], - }, - H265: { - name: "libx265", - options: [ - "-forced-idr 1", - ...(x265Tune ? [`-tune ${x265Tune}`] : []), - `-preset ${x265Preset}`, - ], - }, - VP8: { - name: "libvpx", - options: ["-deadline 20000"], - }, - VP9: { - name: "libvpx-vp9", - options: ["-deadline 20000"], - }, - AV1: { - name: "libsvtav1", - options: [], - }, - })) as EncoderSettingsGetter; -}; diff --git a/vendor/discord-video-stream/src/media/encoders/vaapi.ts b/vendor/discord-video-stream/src/media/encoders/vaapi.ts deleted file mode 100644 index 72d7efb..0000000 --- a/vendor/discord-video-stream/src/media/encoders/vaapi.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { EncoderSettingsGetter } from "./index.js"; - -type VaapiSettings = { - device?: string; -}; - -export function vaapi({ - device = "/dev/dri/renderD128", -}: Partial = {}) { - const props = { - options: [], - globalOptions: ["-vaapi_device", device], - outFilters: ["format=nv12|vaapi", "hwupload"], - }; - return (() => ({ - H264: { - name: "h264_vaapi", - ...props, - }, - H265: { - name: "hevc_vaapi", - ...props, - }, - AV1: { - name: "av1_vaapi", - ...props, - }, - })) as EncoderSettingsGetter; -} diff --git a/vendor/discord-video-stream/src/media/index.ts b/vendor/discord-video-stream/src/media/index.ts deleted file mode 100644 index 52e45db..0000000 --- a/vendor/discord-video-stream/src/media/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./LibavDemuxer.js"; -export * from "./newApi.js"; -export * as NewApi from "./newApi.js"; -export * from "./encoders/index.js"; diff --git a/vendor/discord-video-stream/src/media/newApi.ts b/vendor/discord-video-stream/src/media/newApi.ts deleted file mode 100644 index e9fae8d..0000000 --- a/vendor/discord-video-stream/src/media/newApi.ts +++ /dev/null @@ -1,653 +0,0 @@ -import pDebounce from "p-debounce"; -import sharp from "sharp"; -import Log from "debug-level"; -import { FFmpegCommand } from "fluent-ffmpeg-simplified"; -import { type Packet, AV_PKT_FLAG_KEY } from "node-av"; -import { PassThrough, type Readable } from "node:stream"; -import { demux } from "./LibavDemuxer.js"; -import { VideoStream } from "./VideoStream.js"; -import { AudioStream } from "./AudioStream.js"; -import { isBun, isDeno, isFiniteNonZero } from "../utils.js"; -import { AVCodecID } from "./LibavCodecId.js"; -import { createDecoder } from "./LibavDecoder.js"; -import { Encoders } from "./encoders/index.js"; - -import type { Request } from "zeromq"; -import type { SupportedVideoCodec } from "../utils.js"; -import type { Streamer } from "../client/index.js"; -import type { EncoderSettingsGetter } from "./encoders/index.js"; -import type { VideoStreamInfo } from "./LibavDemuxer.js"; -import type { WebRtcConnWrapper } from "../client/voice/WebRtcWrapper.js"; - -export type PrepareStreamOptions = { - /** - * Disable video transcoding - * If enabled, all video related settings have no effects, and the input - * video stream is used as-is. - * - * You need to ensure that the video stream has the right properties - * (keyframe every 1s, B-frames disabled). Failure to do so will result in - * a glitchy stream, or degraded performance - */ - noTranscoding: boolean; - - /** - * Video width - */ - width: number; - - /** - * Video height - */ - height: number; - - /** - * Video frame rate - */ - frameRate?: number; - - /** - * Video codec - */ - videoCodec: SupportedVideoCodec; - - /** - * Video average bitrate in kbps - */ - bitrateVideo: number; - - /** - * Video max bitrate in kbps - */ - bitrateVideoMax: number; - - /** - * Audio bitrate in kbps - */ - bitrateAudio: number; - - /** - * Enable audio output - */ - includeAudio: boolean; - - /** - * Functions to get encoder settings - * This function will receive the average and max bitrate as the input, and - * returns an object containing encoder settings for the supported codecs - */ - encoder: EncoderSettingsGetter; - - /** - * Enable hardware accelerated decoding - */ - hardwareAcceleratedDecoding: boolean; - - /** - * Add some options to minimize latency - */ - minimizeLatency: boolean; - - /** - * Custom headers for HTTP requests - */ - customHeaders: Record; - - /** - * Custom input options to pass directly to ffmpeg - * These will be added to the command before other options - */ - customInputOptions: string[]; - - /** - * Custom ffmpeg flags/options to pass directly to ffmpeg - * These will be added to the command after other options - */ - customFfmpegFlags: string[]; - - /** - * FFmpeg log level - */ - logLevel: - | "quiet" - | "panic" - | "fatal" - | "error" - | "warning" - | "info" - | "verbose" - | "debug" - | "trace"; -}; - -export type Controller = { - volume: number; - setVolume(newVolume: number): Promise; -}; - -export function prepareStream( - input: string | Readable, - options: Partial = {}, - cancelSignal?: AbortSignal, -) { - cancelSignal?.throwIfAborted(); - - const logger = new Log("prepareStream"); - const loggerFFmpeg = new Log("prepareStream:ffmpeg"); - const defaultOptions = { - noTranscoding: false, - // negative values = resize by aspect ratio, see https://trac.ffmpeg.org/wiki/Scaling - width: -2, - height: -2, - frameRate: undefined, - videoCodec: "H264", - bitrateVideo: 5000, - bitrateVideoMax: 7000, - bitrateAudio: 128, - includeAudio: true, - encoder: Encoders.software(), - hardwareAcceleratedDecoding: false, - minimizeLatency: false, - customHeaders: { - "User-Agent": - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.3", - Connection: "keep-alive", - }, - customInputOptions: [], - customFfmpegFlags: [], - logLevel: "verbose", - } satisfies PrepareStreamOptions; - - function mergeOptions(opts: Partial) { - return { - noTranscoding: opts.noTranscoding ?? defaultOptions.noTranscoding, - - width: isFiniteNonZero(opts.width) - ? Math.round(opts.width) - : defaultOptions.width, - - height: isFiniteNonZero(opts.height) - ? Math.round(opts.height) - : defaultOptions.height, - - frameRate: - isFiniteNonZero(opts.frameRate) && opts.frameRate > 0 - ? opts.frameRate - : defaultOptions.frameRate, - - videoCodec: opts.videoCodec ?? defaultOptions.videoCodec, - - bitrateVideo: - isFiniteNonZero(opts.bitrateVideo) && opts.bitrateVideo > 0 - ? Math.round(opts.bitrateVideo) - : defaultOptions.bitrateVideo, - - bitrateVideoMax: - isFiniteNonZero(opts.bitrateVideoMax) && opts.bitrateVideoMax > 0 - ? Math.round(opts.bitrateVideoMax) - : defaultOptions.bitrateVideoMax, - - bitrateAudio: - isFiniteNonZero(opts.bitrateAudio) && opts.bitrateAudio > 0 - ? Math.round(opts.bitrateAudio) - : defaultOptions.bitrateAudio, - - encoder: opts.encoder ?? defaultOptions.encoder, - - includeAudio: opts.includeAudio ?? defaultOptions.includeAudio, - - hardwareAcceleratedDecoding: - opts.hardwareAcceleratedDecoding ?? - defaultOptions.hardwareAcceleratedDecoding, - - minimizeLatency: opts.minimizeLatency ?? defaultOptions.minimizeLatency, - - customHeaders: { - ...defaultOptions.customHeaders, - ...opts.customHeaders, - }, - - customInputOptions: - opts.customInputOptions ?? defaultOptions.customInputOptions, - - customFfmpegFlags: - opts.customFfmpegFlags ?? defaultOptions.customFfmpegFlags, - - logLevel: opts.logLevel ?? defaultOptions.logLevel, - } satisfies PrepareStreamOptions; - } - - const mergedOptions = mergeOptions(options); - - let isHttpUrl = false; - let isHls = false; - let isSrt = false; - - if (typeof input === "string") { - isHttpUrl = input.startsWith("http") || input.startsWith("https"); - isHls = input.includes("m3u"); - isSrt = input.startsWith("srt://"); - } - - const output = new PassThrough(); - - // command creation - const command = new FFmpegCommand(); - command.on("stderr", (line) => { - loggerFFmpeg.debug(line); - }); - command.input(input); - command.inputOptions("-y", "-loglevel", mergedOptions.logLevel, "-nostats"); - - // input options - if ( - mergedOptions.customInputOptions && - mergedOptions.customInputOptions.length > 0 - ) { - command.inputOptions(mergedOptions.customInputOptions); - } - - const { hardwareAcceleratedDecoding, minimizeLatency, customHeaders } = - mergedOptions; - if (hardwareAcceleratedDecoding) command.inputOptions("-hwaccel", "auto"); - - if (minimizeLatency) { - command.inputOptions( - "-fflags nobuffer", - "-flags lowdelay", - "-flush_packets 1", - "-max_delay 100000", - ); - } - - if (isHttpUrl) { - const headersString = Object.entries(customHeaders) - .map(([k, v]) => `${k}: ${v}`) - .join("\r\n"); - command.inputOptions(`-headers "${headersString}"`); - if (!isHls) { - command.inputOptions([ - "-reconnect 1", - "-reconnect_at_eof 1", - "-reconnect_streamed 1", - "-reconnect_delay_max 4294", - ]); - } - } - - if (isSrt) { - command.inputOptions("-scan_all_pmts 0"); - } - - // general output options - command.output(output).format("nut"); - - // video setup - const { - noTranscoding, - width, - height, - frameRate, - bitrateVideo, - bitrateVideoMax, - videoCodec, - encoder, - } = mergedOptions; - command.outputOptions("-map 0:v"); - - if (noTranscoding) { - command.videoCodec("copy"); - } else { - command.videoFilters(`scale=${width}:${height}`); - - if (frameRate) command.fps(frameRate); - - command.outputOptions([ - "-b:v", - `${bitrateVideo}k`, - "-maxrate:v", - `${bitrateVideoMax}k`, - "-bufsize:v", - `${Math.round(bitrateVideo / 2)}k`, - "-bf", - "0", - "-pix_fmt", - "yuv420p", - "-force_key_frames", - "expr:gte(t,n_forced*1)", - ]); - - const encoderSettings = encoder(bitrateVideo, bitrateVideoMax)[videoCodec]; - if (!encoderSettings) - throw new Error(`Encoder settings not specified for ${videoCodec}`); - command - .videoCodec(encoderSettings.name) - .videoFilters(encoderSettings.outFilters ?? []) - .outputOptions(encoderSettings.options) - .outputOptions(encoderSettings.globalOptions ?? []); - } - - // audio setup - const { includeAudio, bitrateAudio } = mergedOptions; - if (includeAudio) - command - .outputOptions("-map 0:a:0?") - .audioChannels(2) - /* - * I don't have much surround sound material to test this with, - * if you do and you have better settings for this, feel free to - * contribute! - */ - .outputOptions("-lfe_mix_level 1") - .audioFrequency(48000) - .audioCodec("libopus") - .audioBitrate(`${bitrateAudio}k`) - .audioFilters("volume@internal_lib=1.0"); - - // Add custom ffmpeg flags - if ( - mergedOptions.customFfmpegFlags && - mergedOptions.customFfmpegFlags.length > 0 - ) { - command.outputOptions(mergedOptions.customFfmpegFlags); - } - - // realtime control mechanism - let currentVolume = 1; - let zmqClientPromise: Promise | undefined; - if (includeAudio && !isBun() && !isDeno()) { - function randomInclusive(start: number, end: number) { - return Math.floor(Math.random() * (end - start + 1)) + start; - } - // Last octet is from 2 to 254 to avoid WSL2 shenanigans - const loopbackIp = [ - 127, - randomInclusive(0, 255), - randomInclusive(0, 255), - randomInclusive(2, 254), - ].join("."); - const zmqEndpoint = `tcp://${loopbackIp}:42069`; - command.audioFilters(`azmq=b=${zmqEndpoint.replaceAll(":", "\\\\:")}`); - zmqClientPromise = import("zeromq").then((zmq) => { - const client = new zmq.Request({ - sendTimeout: 5000, - receiveTimeout: 5000, - }); - client.connect(zmqEndpoint); - promise.catch(() => {}).finally(() => client.disconnect(zmqEndpoint)); - return client; - }); - } - - command.once("start", (cmdline) => { - logger.debug(`Starting ffmpeg: ${cmdline}`); - }); - const promise = command.run(cancelSignal); - - return { - command, - output, - promise: promise as Promise, - controller: { - get volume() { - return currentVolume; - }, - async setVolume(newVolume: number) { - if (newVolume < 0) return false; - try { - if (!zmqClientPromise) return false; - const client = await zmqClientPromise; - await client.send(`volume@internal_lib volume ${newVolume}`); - const [res] = await client.receive(); - if (res.toString("utf-8").split(" ")[0] !== "0") return false; - currentVolume = newVolume; - return true; - } catch { - return false; - } - }, - } satisfies Controller, - }; -} - -export type PlayStreamOptions = { - /** - * Set stream type as "Go Live" or camera stream - */ - type: "go-live" | "camera"; - - /** - * Set format of the stream - */ - format: "matroska" | "nut"; - - /** - * Override video width sent to Discord. - * - * DO NOT SPECIFY UNLESS YOU KNOW WHAT YOU'RE DOING! - */ - width: number | ((v: VideoStreamInfo) => number); - - /** - * Override video height sent to Discord. - * - * DO NOT SPECIFY UNLESS YOU KNOW WHAT YOU'RE DOING! - */ - height: number | ((v: VideoStreamInfo) => number); - - /** - * Override video frame rate sent to Discord. - * - * DO NOT SPECIFY UNLESS YOU KNOW WHAT YOU'RE DOING! - */ - frameRate: number | ((v: VideoStreamInfo) => number); - - /** - * Same as ffmpeg's `readrate_initial_burst` command line flag - * - * See https://ffmpeg.org/ffmpeg.html#:~:text=%2Dreadrate_initial_burst - */ - readrateInitialBurst: number | undefined; - - /** - * Enable stream preview from input stream (experimental) - */ - streamPreview: boolean; -}; - -export async function playStream( - input: Readable, - streamer: Streamer, - options: Partial = {}, - cancelSignal?: AbortSignal, -) { - const logger = new Log("playStream"); - cancelSignal?.throwIfAborted(); - if (!streamer.voiceConnection) - throw new Error("Bot is not connected to a voice channel"); - - const defaultOptions = { - type: "go-live", - format: "nut", - width: (video) => video.width, - height: (video) => video.height, - frameRate: (video) => video.framerate_num / video.framerate_den, - readrateInitialBurst: undefined, - streamPreview: false, - } satisfies PlayStreamOptions; - - function mergeOptions(opts: Partial) { - return { - type: opts.type ?? defaultOptions.type, - - format: opts.format ?? defaultOptions.format, - - width: - typeof opts.width === "function" || - (isFiniteNonZero(opts.width) && opts.width > 0) - ? opts.width - : defaultOptions.width, - - height: - typeof opts.height === "function" || - (isFiniteNonZero(opts.height) && opts.height > 0) - ? opts.height - : defaultOptions.height, - - frameRate: - typeof opts.frameRate === "function" || - (isFiniteNonZero(opts.frameRate) && opts.frameRate > 0) - ? opts.frameRate - : defaultOptions.frameRate, - - readrateInitialBurst: - isFiniteNonZero(opts.readrateInitialBurst) && - opts.readrateInitialBurst > 0 - ? opts.readrateInitialBurst - : defaultOptions.readrateInitialBurst, - - streamPreview: opts.streamPreview ?? defaultOptions.streamPreview, - } satisfies PlayStreamOptions; - } - - const mergedOptions = mergeOptions(options); - logger.debug({ options: mergedOptions }, "Merged options"); - - logger.debug("Initializing demuxer"); - const { video, audio } = await demux(input, { - format: mergedOptions.format, - }); - cancelSignal?.throwIfAborted(); - - if (!video) throw new Error("No video stream in media"); - - const cleanupFuncs: (() => unknown)[] = []; - const videoCodecMap: Record = { - [AVCodecID.AV_CODEC_ID_H264]: "H264", - [AVCodecID.AV_CODEC_ID_H265]: "H265", - [AVCodecID.AV_CODEC_ID_VP8]: "VP8", - [AVCodecID.AV_CODEC_ID_VP9]: "VP9", - [AVCodecID.AV_CODEC_ID_AV1]: "AV1", - }; - - let conn: WebRtcConnWrapper; - let stopStream: () => unknown; - if (mergedOptions.type === "go-live") { - conn = await streamer.createStream(); - stopStream = () => streamer.stopStream(); - } else { - conn = streamer.voiceConnection.webRtcConn; - streamer.signalVideo(true); - stopStream = () => streamer.signalVideo(false); - } - conn.setPacketizer(videoCodecMap[video.codec]); - conn.mediaConnection.setSpeaking(true); - const { width, height, frameRate } = mergedOptions; - conn.mediaConnection.setVideoAttributes(true, { - width: Math.round(typeof width === "function" ? width(video) : width), - height: Math.round(typeof height === "function" ? height(video) : height), - fps: Math.round( - typeof frameRate === "function" ? frameRate(video) : frameRate, - ), - }); - - const vStream = new VideoStream(conn); - video.stream.pipe(vStream); - if (audio) { - const aStream = new AudioStream(conn); - audio.stream.pipe(aStream); - vStream.syncStream = aStream; - - const burstTime = mergedOptions.readrateInitialBurst; - if (typeof burstTime === "number") { - vStream.sync = false; - vStream.noSleep = aStream.noSleep = true; - const stopBurst = (pts: number) => { - if (pts < burstTime * 1000) return; - vStream.sync = true; - vStream.noSleep = aStream.noSleep = false; - vStream.off("pts", stopBurst); - }; - vStream.on("pts", stopBurst); - } - } - if (mergedOptions.streamPreview && mergedOptions.type === "go-live") { - (async () => { - const logger = new Log("playStream:preview"); - logger.debug("Initializing decoder for stream preview"); - const decoder = await createDecoder(video.avStream); - if (!decoder) { - logger.warn( - "Failed to initialize decoder. Stream preview will be disabled", - ); - return; - } - cleanupFuncs.push(() => { - logger.debug("Freeing decoder"); - decoder.free(); - }); - const updatePreview = pDebounce.promise(async (packet: Packet) => { - if (!(packet.flags !== undefined && packet.flags & AV_PKT_FLAG_KEY)) - return; - const decodeStart = performance.now(); - const frames = await decoder.decode(packet).catch((e) => { - logger.error(e, "Failed to decode the frame"); - return []; - }); - if (!frames.length) return; - - const decodeEnd = performance.now(); - logger.debug(`Decoding a frame took ${decodeEnd - decodeStart}ms`); - const frame = frames[0]; - - return sharp(frame.toBuffer(), { - raw: { - width: frame.width ?? 0, - height: frame.height ?? 0, - channels: 4, - }, - }) - .resize(1024, 576, { fit: "inside" }) - .jpeg() - .toBuffer() - .then((image) => streamer.setStreamPreview(image)) - .catch(() => {}) - .finally(() => { - frames.forEach((frame) => { - frame.free(); - }); - }); - }); - video.stream.on("data", updatePreview); - cleanupFuncs.push(() => video.stream.off("data", updatePreview)); - })(); - } - const promise = new Promise((resolve, reject) => { - cleanupFuncs.push(() => { - stopStream(); - conn.mediaConnection.setSpeaking(false); - conn.mediaConnection.setVideoAttributes(false); - }); - let cleanedUp = false; - const cleanup = () => { - if (cleanedUp) return; - cleanedUp = true; - for (const f of cleanupFuncs) f(); - }; - cancelSignal?.addEventListener( - "abort", - () => { - cleanup(); - reject(cancelSignal.reason); - }, - { once: true }, - ); - vStream.once("finish", () => { - if (cancelSignal?.aborted) return; - cleanup(); - resolve(); - }); - }); - promise.catch(() => {}); - return promise; -} diff --git a/vendor/discord-video-stream/src/utils.ts b/vendor/discord-video-stream/src/utils.ts deleted file mode 100644 index 949b975..0000000 --- a/vendor/discord-video-stream/src/utils.ts +++ /dev/null @@ -1,101 +0,0 @@ -import type { - AnyChannel, - DMChannel, - GroupDMChannel, - VoiceBasedChannel, -} from "discord.js-selfbot-v13"; - -export function normalizeVideoCodec( - codec: string, -): "H264" | "H265" | "VP8" | "VP9" | "AV1" { - if (/H\.?264|AVC/i.test(codec)) return "H264"; - if (/H\.?265|HEVC/i.test(codec)) return "H265"; - if (/VP(8|9)/i.test(codec)) return codec.toUpperCase() as "VP8" | "VP9"; - if (/AV1/i.test(codec)) return "AV1"; - throw new Error(`Unknown codec: ${codec}`); -} - -// The available video streams are sent by client on connection to voice gateway using OpCode Identify (0) -// The server then replies with the ssrc and rtxssrc for each available stream using OpCode Ready (2) -// RID is used specifically to distinguish between different simulcast streams of the same video source, -// but we don't really care about sending multiple quality streams, so we hardcode a single one -export const STREAMS_SIMULCAST = [{ type: "screen", rid: "100", quality: 100 }]; - -export enum SupportedEncryptionModes { - AES256 = "aead_aes256_gcm_rtpsize", - XCHACHA20 = "aead_xchacha20_poly1305_rtpsize", -} - -export type SupportedVideoCodec = "H264" | "H265" | "VP8" | "VP9" | "AV1"; - -export const max_int16bit = 2 ** 16; -export const max_int32bit = 2 ** 32; - -export function isFiniteNonZero(n: unknown): n is number { - return !!n && Number.isFinite(n); -} - -export function parseStreamKey(streamKey: string): { - type: "guild" | "call"; - channelId: string; - guildId: string | null; - userId: string; -} { - const streamKeyArray = streamKey.split(":"); - - const type = streamKeyArray.shift(); - - if (type !== "guild" && type !== "call") { - throw new Error(`Invalid stream key type: ${type}`); - } - - if ( - (type === "guild" && streamKeyArray.length < 3) || - (type === "call" && streamKey.length < 2) - ) - throw new Error(`Invalid stream key: ${streamKey}`); // invalid stream key - - let guildId: string | null = null; - if (type === "guild") { - guildId = streamKeyArray.shift() ?? null; - } - const channelId = streamKeyArray.shift(); - const userId = streamKeyArray.shift(); - - if (!channelId || !userId) { - throw new Error(`Invalid stream key: ${streamKey}`); - } - return { type, channelId, guildId, userId }; -} - -export function generateStreamKey( - type: "guild" | "call", - guildId: string | null, - channelId: string, - userId: string, -): string { - const streamKey = `${type}${type === "guild" ? `:${guildId}` : ""}:${channelId}:${userId}`; - - return streamKey; -} - -export function isVoiceChannel( - channel: AnyChannel, -): channel is DMChannel | GroupDMChannel | VoiceBasedChannel { - return ( - channel.type === "DM" || - channel.type === "GROUP_DM" || - channel.type === "GUILD_STAGE_VOICE" || - channel.type === "GUILD_VOICE" - ); -} - -export function isDeno() { - // @ts-expect-error - return typeof Deno !== "undefined"; -} - -export function isBun() { - // @ts-expect-error - return typeof Bun !== "undefined"; -} diff --git a/vendor/discord-video-stream/tsconfig.json b/vendor/discord-video-stream/tsconfig.json deleted file mode 100644 index 0b19c6c..0000000 --- a/vendor/discord-video-stream/tsconfig.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "Node16", /* Specify what module code is generated. */ - // "rootDir": "./", /* Specify the root folder within your source files. */ - "moduleResolution": "Node16", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - "resolveJsonModule": true, /* Enable importing .json files. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./dist", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - - /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ - "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - }, - "include": [ - "src/**/*" - ] -} \ No newline at end of file diff --git a/vendor/discord.js-selfbot-v13 b/vendor/discord.js-selfbot-v13 new file mode 160000 index 0000000..78a089b --- /dev/null +++ b/vendor/discord.js-selfbot-v13 @@ -0,0 +1 @@ +Subproject commit 78a089bd06b2fd7c57ef1cb6bc7301bafdee5dd3 diff --git a/vendor/discord.js-selfbot-v13/.eslintignore b/vendor/discord.js-selfbot-v13/.eslintignore deleted file mode 100644 index 3886241..0000000 --- a/vendor/discord.js-selfbot-v13/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ignorePatterns": ["node_modules/*"] -} diff --git a/vendor/discord.js-selfbot-v13/.gitattributes b/vendor/discord.js-selfbot-v13/.gitattributes deleted file mode 100644 index dfe0770..0000000 --- a/vendor/discord.js-selfbot-v13/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto diff --git a/vendor/discord.js-selfbot-v13/.github/FUNDING.yml b/vendor/discord.js-selfbot-v13/.github/FUNDING.yml deleted file mode 100644 index 7452b47..0000000 --- a/vendor/discord.js-selfbot-v13/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: [aiko-chan-ai] \ No newline at end of file diff --git a/vendor/discord.js-selfbot-v13/.github/ISSUE_TEMPLATE/bug_report.yml b/vendor/discord.js-selfbot-v13/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index 23127ae..0000000 --- a/vendor/discord.js-selfbot-v13/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Bug report -description: Report incorrect or unexpected behavior of a package -labels: [bug, need repro] -body: - - type: dropdown - id: package - attributes: - label: Which package has the bugs? - options: - - The core library - - The documentation - - WebEmbed x Shorten API - validations: - required: true - - type: textarea - id: description - attributes: - label: Issue description - description: | - Describe the issue in as much detail as possible. - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files into it. - placeholder: | - Steps to reproduce with below code sample: - 1. do thing - 2. do thing in Discord client - 3. observe behavior - 4. see error logs below - validations: - required: true - - type: textarea - id: codesample - attributes: - label: Code sample - description: Include a reproducible, minimal code sample. This will be automatically formatted into code, so no need for backticks. - render: typescript - placeholder: | - Your code sample should be... - ... Minimal - Use as little code as possible that still produces the same problem (and is understandable) - ... Complete - Provide all parts someone else needs to reproduce your problem - ... Reproducible - Test the code you're about to provide to make sure it reproduces the problem - - type: input - id: djs-version - attributes: - label: Package version - description: Which version of are you using? Run `npm list ` in your project directory and paste the output. - placeholder: Older versions are not supported. - validations: - required: true - - type: input - id: node-version - attributes: - label: Node.js version - description: | - Which version of Node.js are you using? Run `node --version` in your project directory and paste the output. - If you are using TypeScript, please include its version (`npm list typescript`) as well. - placeholder: Node.js version 16.9+ is required for version 14.0.0+ - validations: - required: true - - type: input - id: os - attributes: - label: Operating system - description: Which OS does your application run on? - - type: dropdown - id: priority - attributes: - label: Priority this issue should have - description: Please be realistic. If you need to elaborate on your reasoning, please use the Issue description field above. - options: - - Low (slightly annoying) - - Medium (should be fixed soon) - - High (immediate attention needed) - validations: - required: true - - type: checkboxes - attributes: - label: Checklist - description: > - Let's make sure this issue is valid! - options: - - label: I have searched the open issues for duplicates. - required: true - - label: I have shared the entire traceback. - required: true - - label: I am using a user token (and it isn't visible in the code). - required: true - - type: textarea - attributes: - label: Additional Information - description: Put any extra context, weird configurations, or other important info here. \ No newline at end of file diff --git a/vendor/discord.js-selfbot-v13/.github/ISSUE_TEMPLATE/config.yml b/vendor/discord.js-selfbot-v13/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index f18fee9..0000000 --- a/vendor/discord.js-selfbot-v13/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Discord.js Repo - url: https://github.com/discordjs/discord.js - about: A powerful JavaScript library for interacting with the Discord API [Bot]. \ No newline at end of file diff --git a/vendor/discord.js-selfbot-v13/.github/ISSUE_TEMPLATE/feature_request.yml b/vendor/discord.js-selfbot-v13/.github/ISSUE_TEMPLATE/feature_request.yml deleted file mode 100644 index 0de1917..0000000 --- a/vendor/discord.js-selfbot-v13/.github/ISSUE_TEMPLATE/feature_request.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Feature request -description: Request a new feature -labels: [Feature] -body: - - type: markdown - attributes: - value: | - We can only implement features that Discord publishes, documents and merges into the Discord API documentation. - For unreleased API features, you need more documents (Unofficial Discord API) or things you know. - - type: dropdown - id: package - attributes: - label: Which package is the feature request for? - options: - - The core library - - The documentation - - WebEmbed x Shorten API - validations: - required: true - - type: textarea - id: description - attributes: - label: Feature - description: A clear and concise description of what the problem is, or what feature you want to be implemented. - placeholder: I'm always frustrated when..., Discord has recently released..., A good addition would be... - validations: - required: true - - type: textarea - id: solution - attributes: - label: Ideal solution or implementation - description: A clear and concise description of what you want to happen. - validations: - required: true - - type: textarea - id: alternatives - attributes: - label: Alternative solutions or implementations - description: A clear and concise description of any alternative solutions or features you have considered. - - type: textarea - id: additional-context - attributes: - label: Other context - description: Any other context, screenshots, or file uploads that help us understand your feature request. \ No newline at end of file diff --git a/vendor/discord.js-selfbot-v13/.github/dependabot.yml b/vendor/discord.js-selfbot-v13/.github/dependabot.yml deleted file mode 100644 index 084f44b..0000000 --- a/vendor/discord.js-selfbot-v13/.github/dependabot.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: 2 -updates: -- package-ecosystem: npm - directory: "/" - schedule: - interval: daily - time: "12:00" - open-pull-requests-limit: 15 \ No newline at end of file diff --git a/vendor/discord.js-selfbot-v13/.github/workflows/lint.yml b/vendor/discord.js-selfbot-v13/.github/workflows/lint.yml deleted file mode 100644 index 4f29140..0000000 --- a/vendor/discord.js-selfbot-v13/.github/workflows/lint.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Lint -on: - push: - branches: - - '*' - pull_request: - branches: - - '*' -jobs: - eslint: - name: ESLint - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install Node.js v24 - uses: actions/setup-node@v4 - with: - node-version: 24 - - run: npm install --verbose - - run: npx patch-package - - run: npm run test diff --git a/vendor/discord.js-selfbot-v13/.github/workflows/release.yml b/vendor/discord.js-selfbot-v13/.github/workflows/release.yml deleted file mode 100644 index 1d4bc60..0000000 --- a/vendor/discord.js-selfbot-v13/.github/workflows/release.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Release - -on: - push: - tags: - - '3*' # Trigger on version 3.x.x tags - workflow_dispatch: - -permissions: - id-token: write - contents: read - -jobs: - release: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install Node.js v22 - uses: actions/setup-node@v4 - with: - node-version: 22 - - - name: Configure npm for publishing - run: | - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - - - name: Get current published version (if any) - id: current_version - run: | - version=$(npm view discord.js-selfbot-v13 version || echo "none") - echo "version=$version" >> $GITHUB_OUTPUT - - - name: Deprecate previous version - if: steps.current_version.outputs.version != 'none' - run: | - echo "Deprecating version ${{ steps.current_version.outputs.version }}" - npm deprecate discord.js-selfbot-v13@${{ steps.current_version.outputs.version }} "Deprecated: Please use the latest version." - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Publish to NPM - run: npm publish --provenance --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/vendor/discord.js-selfbot-v13/.gitignore b/vendor/discord.js-selfbot-v13/.gitignore deleted file mode 100644 index 6a92432..0000000 --- a/vendor/discord.js-selfbot-v13/.gitignore +++ /dev/null @@ -1,85 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Packages -node_modules/ -djs/ - -# Log files -logs/ -*.log -npm-debug.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Env -.env -test/auth.json -test/auth.js -docs/deploy/deploy_key -docs/deploy/deploy_key.pub -deploy/deploy_key -deploy/deploy_key.pub - -# Dist -dist/ -docs/docs.json - -# Next.js build output -.next - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and *not* Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Env -.env -test/ -docs/deploy/deploy_key -docs/deploy/deploy_key.pub -deploy/deploy_key -deploy/deploy_key.pub - -# Miscellaneous -.tmp/ -.idea/ -.DS_Store - -# Custom -data/ -update.mjs -yarn.lock -package-lock.json diff --git a/vendor/discord.js-selfbot-v13/LICENSE b/vendor/discord.js-selfbot-v13/LICENSE deleted file mode 100644 index 16a0271..0000000 --- a/vendor/discord.js-selfbot-v13/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ -GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2022 aiko-chan-ai and discordjs - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/vendor/discord.js-selfbot-v13/README.md b/vendor/discord.js-selfbot-v13/README.md deleted file mode 100644 index 1355d07..0000000 --- a/vendor/discord.js-selfbot-v13/README.md +++ /dev/null @@ -1,124 +0,0 @@ -> [!IMPORTANT] -> ## Project Archival -> -> **This project is no longer actively maintained and this repository has been archived.** -> -> You can read the full announcement [here](https://github.com/aiko-chan-ai/discord.js-selfbot-v13/discussions/1743) - -
-
-

- discord.js -

-
- -> [!CAUTION] -> **The use of this module under a different name on NPM (or another source besides this Github) is not associated with this library.** -> **When using these libraries, you accept the risk of exposing your Discord Token.** - -## About - -Welcome to `discord.js-selfbot-v13@v3.7`, based on `discord.js@13.17` and backport `discord.js@14.21.0` - -- discord.js-selfbot-v13 is a [Node.js](https://nodejs.org) module that allows user accounts to interact with the Discord API v9. - - -
-

- npm version - npm downloads - Tests status -

-
- -> [!WARNING] -> **I don't take any responsibility for blocked Discord accounts that used this module.** - -> [!CAUTION] -> **Using this on a user account is prohibited by the [Discord TOS](https://discord.com/terms) and can lead to the account block.** - -### [Document Website](https://discordjs-self-v13.netlify.app/) - -### [Example Code](https://github.com/aiko-chan-ai/discord.js-selfbot-v13/tree/main/examples) - -## Features (User) -- [x] Message -- [x] ClientUser: Status, Activity, RemoteAuth, etc. -- [X] Guild: Fetch Members, Join / Leave, Top emojis, etc. -- [X] Interactions: Slash Commands, Buttons, Menu, Modal. -- [X] Captcha & TOTP Handler -- [X] Documentation -- [x] Voice & Video -- [ ] Everything - -## Installation - -> [!NOTE] -> **Node.js 20.18.0 or newer is required** - -```sh-session -npm install discord.js-selfbot-v13@latest -``` - -## Example - -```js -const { Client } = require('discord.js-selfbot-v13'); -const client = new Client(); - -client.on('ready', async () => { - console.log(`${client.user.username} is ready!`); -}) - -client.login('token'); -``` - -## Get Token ? - -- Based: [findByProps](https://discord.com/channels/603970300668805120/1085682686607249478/1085682686607249478) - -Run code (Discord Console - [Ctrl + Shift + I]) - -```js -window.webpackChunkdiscord_app.push([ - [Symbol()], - {}, - req => { - if (!req.c) return; - for (let m of Object.values(req.c)) { - try { - if (!m.exports || m.exports === window) continue; - if (m.exports?.getToken) return copy(m.exports.getToken()); - for (let ex in m.exports) { - if (m.exports?.[ex]?.getToken && m.exports[ex][Symbol.toStringTag] !== 'IntlMessagesProxy') return copy(m.exports[ex].getToken()); - } - } catch {} - } - }, -]); - -window.webpackChunkdiscord_app.pop(); -console.log('%cWorked!', 'font-size: 50px'); -console.log(`%cYou now have your token in the clipboard!`, 'font-size: 16px'); -``` - -## Contributing - -- Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the -[documentation](https://discordjs-self-v13.netlify.app/). -- See [the contribution guide](https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md) if you'd like to submit a PR. - -## Need help? -Github Discussion: [Here](https://github.com/aiko-chan-ai/discord.js-selfbot-v13/discussions) - -## Credits -- [Discord.js](https://github.com/discordjs/discord.js) - -## Other project(s) - -- 📘 [***aiko-chan-ai/DiscordBotClient***](https://github.com/aiko-chan-ai/DiscordBotClient)
- A patched version of discord, with bot login support - -## Star History - -[![Star History Chart](https://api.star-history.com/svg?repos=aiko-chan-ai/discord.js-selfbot-v13&type=Date)](https://star-history.com/#aiko-chan-ai/discord.js-selfbot-v13&Date) diff --git a/vendor/discord.js-selfbot-v13/biome.json b/vendor/discord.js-selfbot-v13/biome.json deleted file mode 100644 index 75cad86..0000000 --- a/vendor/discord.js-selfbot-v13/biome.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/2.3.8/schema.json", - "files": { - "includes": ["src/**/*.js", "typings/**/*.ts", "*.json"] - }, - "formatter": { - "enabled": true, - "indentStyle": "space", - "indentWidth": 2 - }, - "javascript": { - "formatter": { - "quoteStyle": "single", - "semicolons": "always" - } - }, - "linter": { - "enabled": true, - "rules": { - "recommended": false, - "style": { - "useNodejsImportProtocol": "warn" - }, - "suspicious": { - "noExplicitAny": "warn" - } - } - } -} diff --git a/vendor/discord.js-selfbot-v13/docs/index.yml b/vendor/discord.js-selfbot-v13/docs/index.yml deleted file mode 100644 index 0aea5a7..0000000 --- a/vendor/discord.js-selfbot-v13/docs/index.yml +++ /dev/null @@ -1,5 +0,0 @@ -- name: General - files: - - name: Welcome - id: welcome - path: ../../README.md \ No newline at end of file diff --git a/vendor/discord.js-selfbot-v13/docs/logo.svg b/vendor/discord.js-selfbot-v13/docs/logo.svg deleted file mode 100644 index 81feb17..0000000 --- a/vendor/discord.js-selfbot-v13/docs/logo.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/vendor/discord.js-selfbot-v13/docs/main.json b/vendor/discord.js-selfbot-v13/docs/main.json deleted file mode 100644 index a8e871e..0000000 --- a/vendor/discord.js-selfbot-v13/docs/main.json +++ /dev/null @@ -1 +0,0 @@ -{"meta":{"generator":"0.11.1","format":20,"date":1760178765772},"custom":{"general":{"name":"General","files":{"welcome":{"name":"Welcome","type":"md","content":"
\r\n
\r\n

\r\n \"discord.js\"\r\n

\r\n
\r\n\r\n> [!CAUTION]\r\n> **The use of this module under a different name on NPM (or another source besides this Github) is not associated with this library.**\r\n> **When using these libraries, you accept the risk of exposing your Discord Token.**\r\n\r\n## About\r\n\r\nWelcome to `discord.js-selfbot-v13@v3.7`, based on `discord.js@13.17` and backport `discord.js@14.21.0`\r\n\r\n- discord.js-selfbot-v13 is a [Node.js](https://nodejs.org) module that allows user accounts to interact with the Discord API v9.\r\n\r\n\r\n
\r\n

\r\n \"npm\r\n \"npm\r\n \"Tests\r\n

\r\n
\r\n\r\n> [!WARNING]\r\n> **I don't take any responsibility for blocked Discord accounts that used this module.**\r\n\r\n> [!CAUTION]\r\n> **Using this on a user account is prohibited by the [Discord TOS](https://discord.com/terms) and can lead to the account block.**\r\n\r\n## Project Status\r\n\r\n> [!IMPORTANT]\r\n> `discord.js-selfbot-v13` is currently in maintenance mode. New features are not actively being added but existing features and new versions of discord are supported as possible. There are some major architectural changes which need to be added to improve the stability and security of the project. I don't have as much spare time as I did when I started this project, so there is not currently any plan for these improvements.\r\n\r\n### [Document Website](https://discordjs-self-v13.netlify.app/)\r\n\r\n### [Example Code](https://github.com/aiko-chan-ai/discord.js-selfbot-v13/tree/main/examples)\r\n\r\n## Features (User)\r\n- [x] Message\r\n- [x] ClientUser: Status, Activity, RemoteAuth, etc.\r\n- [X] Guild: Fetch Members, Join / Leave, Top emojis, etc.\r\n- [X] Interactions: Slash Commands, Buttons, Menu, Modal.\r\n- [X] Captcha & TOTP Handler\r\n- [X] Documentation\r\n- [x] Voice & Video\r\n- [ ] Everything\r\n\r\n## Installation\r\n\r\n> [!NOTE]\r\n> **Node.js 20.18.0 or newer is required**\r\n\r\n```sh-session\r\nnpm install discord.js-selfbot-v13@latest\r\n```\r\n\r\n## Example\r\n\r\n```js\r\nconst { Client } = require('discord.js-selfbot-v13');\r\nconst client = new Client();\r\n\r\nclient.on('ready', async () => {\r\n console.log(`${client.user.username} is ready!`);\r\n})\r\n\r\nclient.login('token');\r\n```\r\n\r\n## Get Token ?\r\n\r\n- Based: [findByProps](https://discord.com/channels/603970300668805120/1085682686607249478/1085682686607249478)\r\n\r\nRun code (Discord Console - [Ctrl + Shift + I])\r\n\r\n```js\r\nwindow.webpackChunkdiscord_app.push([\r\n\t[Symbol()],\r\n\t{},\r\n\treq => {\r\n\t\tif (!req.c) return;\r\n\t\tfor (let m of Object.values(req.c)) {\r\n\t\t\ttry {\r\n\t\t\t\tif (!m.exports || m.exports === window) continue;\r\n\t\t\t\tif (m.exports?.getToken) return copy(m.exports.getToken());\r\n\t\t\t\tfor (let ex in m.exports) {\r\n\t\t\t\t\tif (m.exports?.[ex]?.getToken && m.exports[ex][Symbol.toStringTag] !== 'IntlMessagesProxy') return copy(m.exports[ex].getToken());\r\n\t\t\t\t}\r\n\t\t\t} catch {}\r\n\t\t}\r\n\t},\r\n]);\r\n\r\nwindow.webpackChunkdiscord_app.pop();\r\nconsole.log('%cWorked!', 'font-size: 50px');\r\nconsole.log(`%cYou now have your token in the clipboard!`, 'font-size: 16px');\r\n```\r\n\r\n## Contributing\r\n\r\n- Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the\r\n[documentation](https://discordjs-self-v13.netlify.app/). \r\n- See [the contribution guide](https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md) if you'd like to submit a PR.\r\n\r\n## Need help?\r\nGithub Discussion: [Here](https://github.com/aiko-chan-ai/discord.js-selfbot-v13/discussions)\r\n\r\n## Credits\r\n- [Discord.js](https://github.com/discordjs/discord.js)\r\n\r\n## Other project(s)\r\n\r\n- 📘 [***aiko-chan-ai/DiscordBotClient***](https://github.com/aiko-chan-ai/DiscordBotClient)
\r\n A patched version of discord, with bot login support\r\n\r\n## Star History\r\n\r\n[![Star History Chart](https://api.star-history.com/svg?repos=aiko-chan-ai/discord.js-selfbot-v13&type=Date)](https://star-history.com/#aiko-chan-ai/discord.js-selfbot-v13&Date)\r\n","path":"README.md"}}}},"classes":[{"name":"BaseClient","description":"The base class for all clients.","extends":[[["EventEmitter"]]],"props":[{"name":"options","description":"The options the client was instantiated with","type":[[["ClientOptions"]]],"meta":{"line":25,"file":"BaseClient.js","path":"src/client"}},{"name":"rest","description":"The REST manager of the client","access":"private","type":[[["RESTManager"]]],"meta":{"line":32,"file":"BaseClient.js","path":"src/client"}},{"name":"api","description":"API shortcut","access":"private","readonly":true,"type":[[["Object"]]],"meta":{"line":41,"file":"BaseClient.js","path":"src/client"}}],"methods":[{"name":"destroy","description":"Destroys all assets used by the base client.","returns":[[["void"]]],"meta":{"line":49,"file":"BaseClient.js","path":"src/client"}},{"name":"incrementMaxListeners","description":"Increments max listeners by one, if they are not zero.","access":"private","meta":{"line":57,"file":"BaseClient.js","path":"src/client"}},{"name":"decrementMaxListeners","description":"Decrements max listeners by one, if they are not zero.","access":"private","meta":{"line":68,"file":"BaseClient.js","path":"src/client"}}],"events":[{"name":"debug","description":"Emitted for general debugging information.","params":[{"name":"info","description":"The debug information","type":[[["string"]]]}],"meta":{"line":82,"file":"BaseClient.js","path":"src/client"}},{"name":"rateLimit","description":"Emitted when the client hits a rate limit while making a request","params":[{"name":"rateLimitData","description":"Object containing the rate limit info","type":[[["RateLimitData"]]]}],"meta":{"line":138,"file":"RequestHandler.js","path":"src/rest"}},{"name":"apiRequest","description":"Emitted before every API request.\nThis event can emit several times for the same request, e.g. when hitting a rate limit.\nThis is an informational event that is emitted quite frequently,\nit is highly recommended to check `request.path` to filter the data.","params":[{"name":"request","description":"The request that is about to be sent","type":[[["APIRequest"]]]}],"meta":{"line":189,"file":"RequestHandler.js","path":"src/rest"}},{"name":"apiResponse","description":"Emitted after every API request has received a response.\nThis event does not necessarily correlate to completion of the request, e.g. when hitting a rate limit.\nThis is an informational event that is emitted quite frequently,\nit is highly recommended to check `request.path` to filter the data.","params":[{"name":"request","description":"The request that triggered this response","type":[[["APIRequest"]]]},{"name":"response","description":"The response received from the Discord API","type":[[["Response"]]]}],"meta":{"line":221,"file":"RequestHandler.js","path":"src/rest"}},{"name":"invalidRequestWarning","description":"Emitted periodically when the process sends invalid requests to let users avoid the\n10k invalid requests in 10 minutes threshold that causes a ban","params":[{"name":"invalidRequestWarningData","description":"Object containing the invalid request info","type":[[["InvalidRequestWarningData"]]]}],"meta":{"line":298,"file":"RequestHandler.js","path":"src/rest"}}],"meta":{"line":13,"file":"BaseClient.js","path":"src/client"}},{"name":"Client","description":"The main hub for interacting with the Discord API, and the starting point for any bot.","extends":[[["BaseClient"]]],"construct":{"name":"Client","params":[{"name":"options","description":"Options for the client","optional":true,"type":[[["ClientOptions"]]]}]},"props":[{"name":"_cleanups","description":"Functions called when a cache is garbage collected or the Client is destroyed","access":"private","type":[[["Set","<"],["function","()>"]]],"meta":{"line":60,"file":"Client.js","path":"src/client"}},{"name":"_finalizers","description":"The finalizers used to cleanup items.","access":"private","type":[[["FinalizationRegistry"]]],"meta":{"line":67,"file":"Client.js","path":"src/client"}},{"name":"ws","description":"The WebSocket manager of the client","type":[[["WebSocketManager"]]],"meta":{"line":73,"file":"Client.js","path":"src/client"}},{"name":"actions","description":"The action manager of the client","access":"private","type":[[["ActionsManager"]]],"meta":{"line":80,"file":"Client.js","path":"src/client"}},{"name":"voice","description":"The voice manager of the client","type":[[["ClientVoiceManager"]]],"meta":{"line":86,"file":"Client.js","path":"src/client"}},{"name":"voiceStates","description":"A manager of the voice states of this client (Support DM / Group DM)","type":[[["VoiceStateManager"]]],"meta":{"line":92,"file":"Client.js","path":"src/client"}},{"name":"shard","description":"Shard helpers for the client (only if the process was spawned from a {@link ShardingManager})","nullable":true,"type":[[["ShardClientUtil"]]],"meta":{"line":98,"file":"Client.js","path":"src/client"}},{"name":"users","description":"The user manager of this client","type":[[["UserManager"]]],"meta":{"line":106,"file":"Client.js","path":"src/client"}},{"name":"guilds","description":"A manager of all the guilds the client is currently handling -\nas long as sharding isn't being used, this will be *every* guild the bot is a member of","type":[[["GuildManager"]]],"meta":{"line":113,"file":"Client.js","path":"src/client"}},{"name":"channels","description":"All of the {@link Channel}s that the client is currently handling -\nas long as sharding isn't being used, this will be *every* channel in *every* guild the bot\nis a member of. Note that DM channels will not be initially cached, and thus not be present\nin the Manager without their explicit fetching or use.","type":[[["ChannelManager"]]],"meta":{"line":122,"file":"Client.js","path":"src/client"}},{"name":"sweepers","description":"The sweeping functions and their intervals used to periodically sweep caches","type":[[["Sweepers"]]],"meta":{"line":128,"file":"Client.js","path":"src/client"}},{"name":"presence","description":"The presence of the Client","access":"private","type":[[["ClientPresence"]]],"meta":{"line":135,"file":"Client.js","path":"src/client"}},{"name":"presences","description":"A manager of the presences belonging to this client","type":[[["PresenceManager"]]],"meta":{"line":141,"file":"Client.js","path":"src/client"}},{"name":"notes","description":"All of the note that have been cached at any point, mapped by their ids","type":[[["UserManager"]]],"meta":{"line":147,"file":"Client.js","path":"src/client"}},{"name":"relationships","description":"All of the relationships {@link User}","type":[[["RelationshipManager"]]],"meta":{"line":153,"file":"Client.js","path":"src/client"}},{"name":"billing","description":"Manages the API methods","type":[[["BillingManager"]]],"meta":{"line":159,"file":"Client.js","path":"src/client"}},{"name":"sessions","description":"All of the sessions of the client","type":[[["SessionManager"]]],"meta":{"line":165,"file":"Client.js","path":"src/client"}},{"name":"settings","description":"All of the settings {@link Object}","type":[[["ClientUserSettingManager"]]],"meta":{"line":171,"file":"Client.js","path":"src/client"}},{"name":"token","description":"Authorization token for the logged in bot.\nIf present, this defaults to `process.env.DISCORD_TOKEN` when instantiating the client\nThis should be kept private at all times.","nullable":true,"type":[[["string"]]],"meta":{"line":181,"file":"Client.js","path":"src/client"}},{"name":"user","description":"User that the client is logged in as","nullable":true,"type":[[["ClientUser"]]],"meta":{"line":190,"file":"Client.js","path":"src/client"}},{"name":"readyAt","description":"Time at which the client was last regarded as being in the `READY` state\n(each time the client disconnects and successfully reconnects, this will be overwritten)","nullable":true,"type":[[["Date"]]],"meta":{"line":197,"file":"Client.js","path":"src/client"}},{"name":"authenticator","description":"The authenticator used for TOTP","type":[[["Object"]]],"meta":{"line":203,"file":"Client.js","path":"src/client"}},{"name":"emojis","description":"A manager of all the custom emojis that the client has access to","readonly":true,"type":[[["BaseGuildEmojiManager"]]],"meta":{"line":228,"file":"Client.js","path":"src/client"}},{"name":"readyTimestamp","description":"Timestamp of the time the client was last `READY` at","readonly":true,"nullable":true,"type":[[["number"]]],"meta":{"line":241,"file":"Client.js","path":"src/client"}},{"name":"uptime","description":"How long it has been since the client last entered the `READY` state in milliseconds","readonly":true,"nullable":true,"type":[[["number"]]],"meta":{"line":250,"file":"Client.js","path":"src/client"}},{"name":"sessionId","description":"The current session id of the shard","nullable":true,"type":[[["string"]]],"meta":{"line":599,"file":"Client.js","path":"src/client"}},{"name":"options","description":"The options the client was instantiated with","type":[[["ClientOptions"]]],"meta":{"line":25,"file":"BaseClient.js","path":"src/client"}},{"name":"rest","description":"The REST manager of the client","access":"private","type":[[["RESTManager"]]],"meta":{"line":32,"file":"BaseClient.js","path":"src/client"}},{"name":"api","description":"API shortcut","access":"private","readonly":true,"type":[[["Object"]]],"meta":{"line":41,"file":"BaseClient.js","path":"src/client"}}],"methods":[{"name":"login","description":"Logs the client in, establishing a WebSocket connection to Discord.","examples":["client.login('my token');"],"params":[{"name":"token","description":"Token of the account to log in with","optional":true,"default":"this.token","type":[[["string"]]]}],"async":true,"returns":{"types":[[["Promise","<"],["string",">"]]],"description":"Token of the account used"},"meta":{"line":261,"file":"Client.js","path":"src/client"}},{"name":"passLogin","description":"Logs the client in, establishing a WebSocket connection to Discord.","examples":["client.passLogin(\"test@gmail.com\", \"SuperSecretPa$$word\", 1234)"],"deprecated":"This method will not be updated until I find the most convenient way to implement MFA.","params":[{"name":"email","description":"The email associated with the account","type":[[["string"]]]},{"name":"password","description":"The password assicated with the account","type":[[["string"]]]}],"async":true,"returns":{"types":[[["string"]],[["null"]]],"description":"Token of the account used"},"meta":{"line":311,"file":"Client.js","path":"src/client"}},{"name":"isReady","description":"Returns whether the client has logged in, indicative of being able to access\nproperties such as `user` and `application`.","returns":[[["boolean"]]],"meta":{"line":341,"file":"Client.js","path":"src/client"}},{"name":"destroy","description":"Logs out, terminates the connection to Discord, and destroys the client.","returns":[[["void"]]],"meta":{"line":349,"file":"Client.js","path":"src/client"}},{"name":"logout","description":"Logs out, terminates the connection to Discord, destroys the client and destroys the token.","async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":366,"file":"Client.js","path":"src/client"}},{"name":"fetchInvite","description":"Obtains an invite from Discord.","examples":["client.fetchInvite('https://discord.gg/djs')\n .then(invite => console.log(`Obtained invite with code: ${invite.code}`))\n .catch(console.error);"],"params":[{"name":"invite","description":"Invite code or URL","type":[[["InviteResolvable"]]]},{"name":"options","description":"Options for fetching the invite","optional":true,"type":[[["ClientFetchInviteOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Invite",">"]]],"meta":{"line":393,"file":"Client.js","path":"src/client"}},{"name":"fetchGuildTemplate","description":"Obtains a template from Discord.","examples":["client.fetchGuildTemplate('https://discord.new/FKvmczH2HyUf')\n .then(template => console.log(`Obtained template with code: ${template.code}`))\n .catch(console.error);"],"params":[{"name":"template","description":"Template code or URL","type":[[["GuildTemplateResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["GuildTemplate",">"]]],"meta":{"line":410,"file":"Client.js","path":"src/client"}},{"name":"fetchWebhook","description":"Obtains a webhook from Discord.","examples":["client.fetchWebhook('id', 'token')\n .then(webhook => console.log(`Obtained webhook with name: ${webhook.name}`))\n .catch(console.error);"],"params":[{"name":"id","description":"The webhook's id","type":[[["Snowflake"]]]},{"name":"token","description":"Token for the webhook","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Webhook",">"]]],"meta":{"line":426,"file":"Client.js","path":"src/client"}},{"name":"fetchVoiceRegions","description":"Obtains the available voice regions from Discord.","examples":["client.fetchVoiceRegions()\n .then(regions => console.log(`Available regions are: ${regions.map(region => region.name).join(', ')}`))\n .catch(console.error);"],"async":true,"returns":[[["Promise","<"],["Collection","<"],["string",", "],["VoiceRegion",">>"]]],"meta":{"line":439,"file":"Client.js","path":"src/client"}},{"name":"fetchSticker","description":"Obtains a sticker from Discord.","examples":["client.fetchSticker('id')\n .then(sticker => console.log(`Obtained sticker with name: ${sticker.name}`))\n .catch(console.error);"],"params":[{"name":"id","description":"The sticker's id","type":[[["Snowflake"]]]}],"async":true,"returns":[[["Promise","<"],["Sticker",">"]]],"meta":{"line":455,"file":"Client.js","path":"src/client"}},{"name":"fetchPremiumStickerPacks","description":"Obtains the list of sticker packs available to Nitro subscribers from Discord.","examples":["client.fetchPremiumStickerPacks()\n .then(packs => console.log(`Available sticker packs are: ${packs.map(pack => pack.name).join(', ')}`))\n .catch(console.error);"],"async":true,"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["StickerPack",">>"]]],"meta":{"line":468,"file":"Client.js","path":"src/client"}},{"name":"_finalize","description":"A last ditch cleanup function for garbage collection.","access":"private","params":[{"name":"options.cleanup","description":"The function called to GC","type":[[["function"]]]},{"name":"options.message","description":"The message to send after a successful GC","optional":true,"type":[[["string"]]]},{"name":"options.name","description":"The name of the item being GCed","optional":true,"type":[[["string"]]]}],"meta":{"line":479,"file":"Client.js","path":"src/client"}},{"name":"sweepMessages","description":"Sweeps all text-based channels' messages and removes the ones older than the max message lifetime.\nIf the message has been edited, the time of the edit is used rather than the time of the original message.","examples":["// Remove all messages older than 1800 seconds from the messages cache\nconst amount = client.sweepMessages(1800);\nconsole.log(`Successfully removed ${amount} messages from the cache.`);"],"params":[{"name":"lifetime","description":"Messages that are older than this (in seconds)\nwill be removed from the caches. The default is based on {@link ClientOptions#messageCacheLifetime}","optional":true,"default":"this.options.messageCacheLifetime","type":[[["number"]]]}],"returns":{"types":[[["number"]]],"description":"Amount of messages that were removed from the caches,\nor -1 if the message cache lifetime is unlimited"},"meta":{"line":503,"file":"Client.js","path":"src/client"}},{"name":"fetchGuildPreview","description":"Obtains a guild preview from Discord, available for all guilds the bot is in and all Discoverable guilds.","params":[{"name":"guild","description":"The guild to fetch the preview for","type":[[["GuildResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["GuildPreview",">"]]],"meta":{"line":522,"file":"Client.js","path":"src/client"}},{"name":"fetchGuildWidget","description":"Obtains the widget data of a guild from Discord, available for guilds with the widget enabled.","params":[{"name":"guild","description":"The guild to fetch the widget data for","type":[[["GuildResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["Widget",">"]]],"meta":{"line":534,"file":"Client.js","path":"src/client"}},{"name":"refreshAttachmentURL","description":"Refresh the Discord CDN links with hashes so they can be usable.","params":[{"name":"urls","description":"Discord CDN URLs","variable":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Array","<{"],["original",": "],["string",", "],["refreshed",": "],["string","}>>"]]],"meta":{"line":546,"file":"Client.js","path":"src/client"}},{"name":"sleep","description":"The sleep function in JavaScript returns a promise that resolves after a specified timeout.","params":[{"name":"timeout","description":"The timeout parameter is the amount of time, in milliseconds, that the sleep\nfunction will wait before resolving the promise and continuing execution.","type":[[["number"]]]}],"returns":{"types":[[["void"]]],"description":"The `sleep` function is returning a Promise."},"meta":{"line":585,"file":"Client.js","path":"src/client"}},{"name":"acceptInvite","description":"Join this Guild / GroupDMChannel using this invite","examples":["await client.acceptInvite('https://discord.gg/genshinimpact', { bypassOnboarding: true, bypassVerify: true })"],"params":[{"name":"invite","description":"Invite code or URL","type":[[["InviteResolvable"]]]},{"name":"options","description":"Options","optional":true,"type":[[["AcceptInviteOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Guild","|"],["DMChannel","|"],["GroupDMChannel",")>"]]],"meta":{"line":618,"file":"Client.js","path":"src/client"}},{"name":"redeemNitro","description":"Redeem nitro from code or url.","params":[{"name":"nitro","description":"Nitro url or code","type":[[["string"]]]},{"name":"channel","description":"Channel that the code was sent in","optional":true,"type":[[["TextChannelResolvable"]]]},{"name":"paymentSourceId","description":"Payment source id","optional":true,"type":[[["Snowflake"]]]}],"returns":[[["Promise","<"],["any",">"]]],"meta":{"line":706,"file":"Client.js","path":"src/client"}},{"name":"authorizeURL","description":"Authorize an application.","examples":["client.authorizeURL(`https://discord.com/api/oauth2/authorize?client_id=botID&permissions=8&scope=applications.commands%20bot`, {\n guild_id: \"guildID\",\n })"],"params":[{"name":"urlOAuth2","description":"Discord Auth URL","type":[[["string"]]]},{"name":"options","description":"Oauth2 options","optional":true,"type":[[["OAuth2AuthorizeOptions"]]]}],"returns":[[["Promise","<{"],["location",": "],["string","}>"]]],"meta":{"line":739,"file":"Client.js","path":"src/client"}},{"name":"installUserApps","description":"Install User Apps","params":[{"name":"applicationId","description":"Discord Application id","type":[[["Snowflake"]]]}],"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":773,"file":"Client.js","path":"src/client"}},{"name":"deauthorize","description":"Deauthorizes an application or token.","params":[{"name":"id","description":"The ID of the Discord Application or Token.","type":[[["Snowflake"]]]},{"name":"type","description":"The type of the ID provided. Defaults to 'application'.","optional":true,"default":"'application'","type":[[["application","'"]],[["token","'"]]]}],"returns":{"types":[[["Promise","<"],["void",">"]]],"description":"A promise that resolves when the deauthorization is complete."},"meta":{"line":807,"file":"Client.js","path":"src/client"}},{"name":"authorizedApplications","description":"Retrieves the list of authorized applications (OAuth2 tokens).","returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["AuthorizedApplicationData",">>"]]],"meta":{"line":830,"file":"Client.js","path":"src/client"}},{"name":"_eval","description":"Calls {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval} on a script\nwith the client as `this`.","access":"private","params":[{"name":"script","description":"Script to eval","type":[[["string"]]]}],"returns":[["*"]],"meta":{"line":854,"file":"Client.js","path":"src/client"}},{"name":"_validateOptions","description":"Validates the client options.","access":"private","params":[{"name":"options","description":"Options to validate","optional":true,"default":"this.options","type":[[["ClientOptions"]]]}],"meta":{"line":863,"file":"Client.js","path":"src/client"}},{"name":"incrementMaxListeners","description":"Increments max listeners by one, if they are not zero.","access":"private","inherits":"BaseClient#incrementMaxListeners","inherited":true,"meta":{"line":57,"file":"BaseClient.js","path":"src/client"}},{"name":"decrementMaxListeners","description":"Decrements max listeners by one, if they are not zero.","access":"private","inherits":"BaseClient#decrementMaxListeners","inherited":true,"meta":{"line":68,"file":"BaseClient.js","path":"src/client"}}],"events":[{"name":"applicationCommandPermissionsUpdate","description":"Emitted whenever permissions for an application command in a guild were updated.\nThis includes permission updates for other applications in addition to the logged in client,\ncheck `data.applicationId` to verify which application the update is for","params":[{"name":"data","description":"The updated permissions","type":[[["ApplicationCommandPermissionsUpdateData"]]]}],"meta":{"line":18,"file":"ApplicationCommandPermissionsUpdate.js","path":"src/client/actions"}},{"name":"autoModerationActionExecution","description":"Emitted whenever an auto moderation rule is triggered.\nThis event requires the {@link Permissions.FLAGS.MANAGE_GUILD} permission.","deprecated":"This event is not received by user accounts.","params":[{"name":"autoModerationActionExecution","description":"The data of the execution","type":[[["AutoModerationActionExecution"]]]}],"meta":{"line":13,"file":"AutoModerationActionExecution.js","path":"src/client/actions"}},{"name":"autoModerationRuleCreate","description":"Emitted whenever an auto moderation rule is created.\nThis event requires the {@link Permissions.FLAGS.MANAGE_GUILD} permission.","deprecated":"This event is not received by user accounts.","params":[{"name":"autoModerationRule","description":"The created auto moderation rule","type":[[["AutoModerationRule"]]]}],"meta":{"line":14,"file":"AutoModerationRuleCreate.js","path":"src/client/actions"}},{"name":"autoModerationRuleDelete","description":"Emitted whenever an auto moderation rule is deleted.\nThis event requires the {@link Permissions.FLAGS.MANAGE_GUILD} permission.","deprecated":"This event is not received by user accounts.","params":[{"name":"autoModerationRule","description":"The deleted auto moderation rule","type":[[["AutoModerationRule"]]]}],"meta":{"line":17,"file":"AutoModerationRuleDelete.js","path":"src/client/actions"}},{"name":"autoModerationRuleUpdate","description":"Emitted whenever an auto moderation rule gets updated.\nThis event requires the {@link Permissions.FLAGS.MANAGE_GUILD} permission.","deprecated":"This event is not received by user accounts.","params":[{"name":"oldAutoModerationRule","description":"The auto moderation rule before the update","nullable":true,"type":[[["AutoModerationRule"]]]},{"name":"newAutoModerationRule","description":"The auto moderation rule after the update","type":[[["AutoModerationRule"]]]}],"meta":{"line":15,"file":"AutoModerationRuleUpdate.js","path":"src/client/actions"}},{"name":"channelCreate","description":"Emitted whenever a guild channel is created.","params":[{"name":"channel","description":"The channel that was created","type":[[["GuildChannel"]]]}],"meta":{"line":12,"file":"ChannelCreate.js","path":"src/client/actions"}},{"name":"channelDelete","description":"Emitted whenever a channel is deleted.","params":[{"name":"channel","description":"The channel that was deleted","type":[[["DMChannel"]],[["GuildChannel"]]]}],"meta":{"line":27,"file":"ChannelDelete.js","path":"src/client/actions"}},{"name":"guildAuditLogEntryCreate","description":"Emitted whenever a guild audit log entry is created.","params":[{"name":"auditLogEntry","description":"The entry that was created","type":[[["GuildAuditLogsEntry"]]]},{"name":"guild","description":"The guild where the entry was created","type":[[["Guild"]]]}],"meta":{"line":16,"file":"GuildAuditLogEntryCreate.js","path":"src/client/actions"}},{"name":"guildBanAdd","description":"Emitted whenever a member is banned from a guild.","params":[{"name":"ban","description":"The ban that occurred","type":[[["GuildBan"]]]}],"meta":{"line":11,"file":"GuildBanAdd.js","path":"src/client/actions"}},{"name":"guildBanRemove","description":"Emitted whenever a member is unbanned from a guild.","params":[{"name":"ban","description":"The ban that was removed","type":[[["GuildBan"]]]}],"meta":{"line":12,"file":"GuildBanRemove.js","path":"src/client/actions"}},{"name":"guildUnavailable","description":"Emitted whenever a guild becomes unavailable, likely due to a server outage.","params":[{"name":"guild","description":"The guild that has become unavailable","type":[[["Guild"]]]}],"meta":{"line":23,"file":"GuildDelete.js","path":"src/client/actions"}},{"name":"guildDelete","description":"Emitted whenever a guild kicks the client or the guild is deleted/left.","params":[{"name":"guild","description":"The guild that was deleted","type":[[["Guild"]]]}],"meta":{"line":44,"file":"GuildDelete.js","path":"src/client/actions"}},{"name":"emojiCreate","description":"Emitted whenever a custom emoji is created in a guild.","params":[{"name":"emoji","description":"The emoji that was created","type":[[["GuildEmoji"]]]}],"meta":{"line":10,"file":"GuildEmojiCreate.js","path":"src/client/actions"}},{"name":"emojiDelete","description":"Emitted whenever a custom emoji is deleted in a guild.","params":[{"name":"emoji","description":"The emoji that was deleted","type":[[["GuildEmoji"]]]}],"meta":{"line":11,"file":"GuildEmojiDelete.js","path":"src/client/actions"}},{"name":"emojiUpdate","description":"Emitted whenever a custom emoji is updated in a guild.","params":[{"name":"oldEmoji","description":"The old emoji","type":[[["GuildEmoji"]]]},{"name":"newEmoji","description":"The new emoji","type":[[["GuildEmoji"]]]}],"meta":{"line":9,"file":"GuildEmojiUpdate.js","path":"src/client/actions"}},{"name":"guildIntegrationsUpdate","description":"Emitted whenever a guild integration is updated","params":[{"name":"guild","description":"The guild whose integrations were updated","type":[[["Guild"]]]}],"meta":{"line":10,"file":"GuildIntegrationsUpdate.js","path":"src/client/actions"}},{"name":"guildMemberRemove","description":"Emitted whenever a member leaves a guild, or is kicked.","deprecated":"See {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/issues/197 this issue} for more information.","params":[{"name":"member","description":"The member that has left/been kicked from the guild","type":[[["GuildMember"]]]}],"meta":{"line":18,"file":"GuildMemberRemove.js","path":"src/client/actions"}},{"name":"guildMemberUpdate","description":"Emitted whenever a guild member changes - i.e. new role, removed role, nickname.","deprecated":"See {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/issues/197 this issue} for more information.","params":[{"name":"oldMember","description":"The member before the update","type":[[["GuildMember"]]]},{"name":"newMember","description":"The member after the update","type":[[["GuildMember"]]]}],"meta":{"line":23,"file":"GuildMemberUpdate.js","path":"src/client/actions"}},{"name":"guildMemberAvailable","description":"Emitted whenever a member becomes available.","params":[{"name":"member","description":"The member that became available","type":[[["GuildMember"]]]}],"meta":{"line":33,"file":"GuildMemberUpdate.js","path":"src/client/actions"}},{"name":"roleCreate","description":"Emitted whenever a role is created.","params":[{"name":"role","description":"The role that was created","type":[[["Role"]]]}],"meta":{"line":14,"file":"GuildRoleCreate.js","path":"src/client/actions"}},{"name":"roleDelete","description":"Emitted whenever a guild role is deleted.","params":[{"name":"role","description":"The role that was deleted","type":[[["Role"]]]}],"meta":{"line":18,"file":"GuildRoleDelete.js","path":"src/client/actions"}},{"name":"roleUpdate","description":"Emitted whenever a guild role is updated.","params":[{"name":"oldRole","description":"The role before the update","type":[[["Role"]]]},{"name":"newRole","description":"The role after the update","type":[[["Role"]]]}],"meta":{"line":17,"file":"GuildRoleUpdate.js","path":"src/client/actions"}},{"name":"guildScheduledEventCreate","description":"Emitted whenever a guild scheduled event is created.","params":[{"name":"guildScheduledEvent","description":"The created guild scheduled event","type":[[["GuildScheduledEvent"]]]}],"meta":{"line":13,"file":"GuildScheduledEventCreate.js","path":"src/client/actions"}},{"name":"guildScheduledEventDelete","description":"Emitted whenever a guild scheduled event is deleted.","params":[{"name":"guildScheduledEvent","description":"The deleted guild scheduled event","type":[[["GuildScheduledEvent"]]]}],"meta":{"line":16,"file":"GuildScheduledEventDelete.js","path":"src/client/actions"}},{"name":"guildScheduledEventUpdate","description":"Emitted whenever a guild scheduled event gets updated.","params":[{"name":"oldGuildScheduledEvent","description":"The guild scheduled event object before the update","nullable":true,"type":[[["GuildScheduledEvent"]]]},{"name":"newGuildScheduledEvent","description":"The guild scheduled event object after the update","type":[[["GuildScheduledEvent"]]]}],"meta":{"line":15,"file":"GuildScheduledEventUpdate.js","path":"src/client/actions"}},{"name":"guildScheduledEventUserAdd","description":"Emitted whenever a user subscribes to a guild scheduled event","params":[{"name":"guildScheduledEvent","description":"The guild scheduled event","type":[[["GuildScheduledEvent"]]]},{"name":"user","description":"The user who subscribed","type":[[["User"]]]}],"meta":{"line":16,"file":"GuildScheduledEventUserAdd.js","path":"src/client/actions"}},{"name":"guildScheduledEventUserRemove","description":"Emitted whenever a user unsubscribes from a guild scheduled event","params":[{"name":"guildScheduledEvent","description":"The guild scheduled event","type":[[["GuildScheduledEvent"]]]},{"name":"user","description":"The user who unsubscribed","type":[[["User"]]]}],"meta":{"line":16,"file":"GuildScheduledEventUserRemove.js","path":"src/client/actions"}},{"name":"stickerCreate","description":"Emitted whenever a custom sticker is created in a guild.","params":[{"name":"sticker","description":"The sticker that was created","type":[[["Sticker"]]]}],"meta":{"line":10,"file":"GuildStickerCreate.js","path":"src/client/actions"}},{"name":"stickerDelete","description":"Emitted whenever a custom sticker is deleted in a guild.","params":[{"name":"sticker","description":"The sticker that was deleted","type":[[["Sticker"]]]}],"meta":{"line":11,"file":"GuildStickerDelete.js","path":"src/client/actions"}},{"name":"stickerUpdate","description":"Emitted whenever a custom sticker is updated in a guild.","params":[{"name":"oldSticker","description":"The old sticker","type":[[["Sticker"]]]},{"name":"newSticker","description":"The new sticker","type":[[["Sticker"]]]}],"meta":{"line":9,"file":"GuildStickerUpdate.js","path":"src/client/actions"}},{"name":"guildUpdate","description":"Emitted whenever a guild is updated - e.g. name change.","params":[{"name":"oldGuild","description":"The guild before the update","type":[[["Guild"]]]},{"name":"newGuild","description":"The guild after the update","type":[[["Guild"]]]}],"meta":{"line":13,"file":"GuildUpdate.js","path":"src/client/actions"}},{"name":"inviteCreate","description":"Emitted when an invite is created.\n This event only triggers if the client has `MANAGE_GUILD` permissions for the guild,\nor `MANAGE_CHANNELS` permissions for the channel.","params":[{"name":"invite","description":"The invite that was created","type":[[["Invite"]]]}],"meta":{"line":16,"file":"InviteCreate.js","path":"src/client/actions"}},{"name":"inviteDelete","description":"Emitted when an invite is deleted.\n This event only triggers if the client has `MANAGE_GUILD` permissions for the guild,\nor `MANAGE_CHANNELS` permissions for the channel.","params":[{"name":"invite","description":"The invite that was deleted","type":[[["Invite"]]]}],"meta":{"line":18,"file":"InviteDelete.js","path":"src/client/actions"}},{"name":"messageCreate","description":"Emitted whenever a message is created.","params":[{"name":"message","description":"The created message","type":[[["Message"]]]}],"meta":{"line":25,"file":"MessageCreate.js","path":"src/client/actions"}},{"name":"message","description":"Emitted whenever a message is created.","deprecated":"Use {@link Client#event:messageCreate} instead","params":[{"name":"message","description":"The created message","type":[[["Message"]]]}],"meta":{"line":32,"file":"MessageCreate.js","path":"src/client/actions"}},{"name":"messageDelete","description":"Emitted whenever a message is deleted.","params":[{"name":"message","description":"The deleted message","type":[[["Message"]]]}],"meta":{"line":19,"file":"MessageDelete.js","path":"src/client/actions"}},{"name":"messageDeleteBulk","description":"Emitted whenever messages are deleted in bulk.","params":[{"name":"messages","description":"The deleted messages, mapped by their id","type":[[["Collection","<"],["Snowflake",", "],["Message",">"]]]}],"meta":{"line":34,"file":"MessageDeleteBulk.js","path":"src/client/actions"}},{"name":"messagePollVoteAdd","description":"Emitted whenever a user votes in a poll.","params":[{"name":"pollAnswer","description":"The answer that was voted on","type":[[["PollAnswer"]]]},{"name":"userId","description":"The id of the user that voted","type":[[["Snowflake"]]]}],"meta":{"line":21,"file":"MessagePollVoteAdd.js","path":"src/client/actions"}},{"name":"messagePollVoteRemove","description":"Emitted whenever a user removes their vote in a poll.","params":[{"name":"pollAnswer","description":"The answer where the vote was removed","type":[[["PollAnswer"]]]},{"name":"userId","description":"The id of the user that removed their vote","type":[[["Snowflake"]]]}],"meta":{"line":21,"file":"MessagePollVoteRemove.js","path":"src/client/actions"}},{"name":"messageReactionAdd","description":"Emitted whenever a reaction is added to a cached message.","params":[{"name":"messageReaction","description":"The reaction object","type":[[["MessageReaction"]]]},{"name":"user","description":"The user that applied the guild or reaction emoji","type":[[["User"]]]},{"name":"details","description":"Details of adding the reaction","type":[[["MessageReactionEventDetails"]]]}],"meta":{"line":55,"file":"MessageReactionAdd.js","path":"src/client/actions"}},{"name":"messageReactionRemove","description":"Emitted whenever a reaction is removed from a cached message.","params":[{"name":"messageReaction","description":"The reaction object","type":[[["MessageReaction"]]]},{"name":"user","description":"The user whose emoji or reaction emoji was removed","type":[[["User"]]]},{"name":"details","description":"Details of removing the reaction","type":[[["MessageReactionEventDetails"]]]}],"meta":{"line":37,"file":"MessageReactionRemove.js","path":"src/client/actions"}},{"name":"messageReactionRemoveAll","description":"Emitted whenever all reactions are removed from a cached message.","params":[{"name":"message","description":"The message the reactions were removed from","type":[[["Message"]]]},{"name":"reactions","description":"The cached message reactions that were removed.","type":[[["Collection","<("],["string","|"],["Snowflake","), "],["MessageReaction",">"]]]}],"meta":{"line":26,"file":"MessageReactionRemoveAll.js","path":"src/client/actions"}},{"name":"messageReactionRemoveEmoji","description":"Emitted when a bot removes an emoji reaction from a cached message.","params":[{"name":"reaction","description":"The reaction that was removed","type":[[["MessageReaction"]]]}],"meta":{"line":18,"file":"MessageReactionRemoveEmoji.js","path":"src/client/actions"}},{"name":"presenceUpdate","description":"Emitted whenever a guild member's presence (e.g. status, activity) is changed.","params":[{"name":"oldPresence","description":"The presence before the update, if one at all","nullable":true,"type":[[["Presence"]]]},{"name":"newPresence","description":"The presence after the update","type":[[["Presence"]]]}],"meta":{"line":39,"file":"PresenceUpdate.js","path":"src/client/actions"}},{"name":"stageInstanceCreate","description":"Emitted whenever a stage instance is created.","params":[{"name":"stageInstance","description":"The created stage instance","type":[[["StageInstance"]]]}],"meta":{"line":14,"file":"StageInstanceCreate.js","path":"src/client/actions"}},{"name":"stageInstanceDelete","description":"Emitted whenever a stage instance is deleted.","params":[{"name":"stageInstance","description":"The deleted stage instance","type":[[["StageInstance"]]]}],"meta":{"line":18,"file":"StageInstanceDelete.js","path":"src/client/actions"}},{"name":"stageInstanceUpdate","description":"Emitted whenever a stage instance gets updated - e.g. change in topic or privacy level","params":[{"name":"oldStageInstance","description":"The stage instance before the update","nullable":true,"type":[[["StageInstance"]]]},{"name":"newStageInstance","description":"The stage instance after the update","type":[[["StageInstance"]]]}],"meta":{"line":15,"file":"StageInstanceUpdate.js","path":"src/client/actions"}},{"name":"threadCreate","description":"Emitted whenever a thread is created or when the client user is added to a thread.","params":[{"name":"thread","description":"The thread that was created","type":[[["ThreadChannel"]]]},{"name":"newlyCreated","description":"Whether the thread was newly created","type":[[["boolean"]]]}],"meta":{"line":12,"file":"ThreadCreate.js","path":"src/client/actions"}},{"name":"threadDelete","description":"Emitted whenever a thread is deleted.","params":[{"name":"thread","description":"The thread that was deleted","type":[[["ThreadChannel"]]]}],"meta":{"line":20,"file":"ThreadDelete.js","path":"src/client/actions"}},{"name":"threadListSync","description":"Emitted whenever the client user gains access to a text or news channel that contains threads","params":[{"name":"threads","description":"The threads that were synced","type":[[["Collection","<"],["Snowflake",", "],["ThreadChannel",">"]]]}],"meta":{"line":38,"file":"ThreadListSync.js","path":"src/client/actions"}},{"name":"threadMembersUpdate","description":"Emitted whenever members are added or removed from a thread. Requires `GUILD_MEMBERS` privileged intent","params":[{"name":"oldMembers","description":"The members before the update","type":[[["Collection","<"],["Snowflake",", "],["ThreadMember",">"]]]},{"name":"newMembers","description":"The members after the update","type":[[["Collection","<"],["Snowflake",", "],["ThreadMember",">"]]]}],"meta":{"line":22,"file":"ThreadMembersUpdate.js","path":"src/client/actions"}},{"name":"threadMemberUpdate","description":"Emitted whenever the client user's thread member is updated.","params":[{"name":"oldMember","description":"The member before the update","type":[[["ThreadMember"]]]},{"name":"newMember","description":"The member after the update","type":[[["ThreadMember"]]]}],"meta":{"line":18,"file":"ThreadMemberUpdate.js","path":"src/client/actions"}},{"name":"typingStart","description":"Emitted whenever a user starts typing in a channel.","params":[{"name":"typing","description":"The typing state","type":[[["Typing"]]]}],"meta":{"line":19,"file":"TypingStart.js","path":"src/client/actions"}},{"name":"userUpdate","description":"Emitted whenever a user's details (e.g. username) are changed.\nTriggered by the Discord gateway events USER_UPDATE, GUILD_MEMBER_UPDATE, and PRESENCE_UPDATE.","params":[{"name":"oldUser","description":"The user before the update","type":[[["User"]]]},{"name":"newUser","description":"The user after the update","type":[[["User"]]]}],"meta":{"line":14,"file":"UserUpdate.js","path":"src/client/actions"}},{"name":"voiceStateUpdate","description":"Emitted whenever a member changes voice state - e.g. joins/leaves a channel, mutes/unmutes.","params":[{"name":"oldState","description":"The voice state before the update","type":[[["VoiceState"]]]},{"name":"newState","description":"The voice state after the update","type":[[["VoiceState"]]]}],"meta":{"line":26,"file":"VoiceStateUpdate.js","path":"src/client/actions"}},{"name":"webhookUpdate","description":"Emitted whenever a channel has its webhooks changed.","params":[{"name":"channel","description":"The channel that had a webhook update","type":[[["TextChannel"]],[["NewsChannel"]],[["VoiceChannel"]],[["StageChannel"]],[["ForumChannel"]],[["MediaChannel"]]]}],"meta":{"line":10,"file":"WebhooksUpdate.js","path":"src/client/actions"}},{"name":"warn","description":"Emitted for general warnings.","params":[{"name":"info","description":"The warning","type":[[["string"]]]}],"meta":{"line":925,"file":"Client.js","path":"src/client"}},{"name":"guildMemberSpeaking","description":"Emitted once a guild member changes speaking state.","params":[{"name":"member","description":"The member that started/stopped speaking","type":[[["GuildMember"]]]},{"name":"speaking","description":"The speaking state of the member","type":[[["Readonly","<"],["Speaking",">"]]]}],"meta":{"line":657,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"applicationCommandCreate","description":"Emitted when a guild application command is created.","deprecated":"See {@link https://github.com/discord/discord-api-docs/issues/3690 this issue} for more information.","params":[{"name":"command","description":"The command which was created","type":[[["ApplicationCommand"]]]}],"meta":{"line":11,"file":"APPLICATION_COMMAND_CREATE.js","path":"src/client/websocket/handlers"}},{"name":"applicationCommandDelete","description":"Emitted when a guild application command is deleted.","deprecated":"See {@link https://github.com/discord/discord-api-docs/issues/3690 this issue} for more information.","params":[{"name":"command","description":"The command which was deleted","type":[[["ApplicationCommand"]]]}],"meta":{"line":13,"file":"APPLICATION_COMMAND_DELETE.js","path":"src/client/websocket/handlers"}},{"name":"applicationCommandUpdate","description":"Emitted when a guild application command is updated.","deprecated":"See {@link https://github.com/discord/discord-api-docs/issues/3690 this issue} for more information.","params":[{"name":"oldCommand","description":"The command before the update","nullable":true,"type":[[["ApplicationCommand"]]]},{"name":"newCommand","description":"The command after the update","type":[[["ApplicationCommand"]]]}],"meta":{"line":12,"file":"APPLICATION_COMMAND_UPDATE.js","path":"src/client/websocket/handlers"}},{"name":"callCreate","description":"Emitted whenever received a call","params":[{"name":"call","description":"Call","type":[[["CallState"]]]}],"meta":{"line":8,"file":"CALL_CREATE.js","path":"src/client/websocket/handlers"}},{"name":"callDelete","description":"Emitted whenever delete a call","params":[{"name":"call","description":"Call","type":[[["Call"]]]}],"meta":{"line":5,"file":"CALL_DELETE.js","path":"src/client/websocket/handlers"}},{"name":"callUpdate","description":"Emitted whenever update a call","params":[{"name":"call","description":"Call","type":[[["Call"]]]}],"meta":{"line":5,"file":"CALL_UPDATE.js","path":"src/client/websocket/handlers"}},{"name":"channelPinsUpdate","description":"Emitted whenever the pins of a channel are updated. Due to the nature of the WebSocket event,\nnot much information can be provided easily here - you need to manually check the pins yourself.","params":[{"name":"channel","description":"The channel that the pins update occurred in","type":[[["TextBasedChannels"]]]},{"name":"time","description":"The time of the pins update","type":[[["Date"]]]}],"meta":{"line":13,"file":"CHANNEL_PINS_UPDATE.js","path":"src/client/websocket/handlers"}},{"name":"channelRecipientAdd","description":"Emitted whenever a recipient is added from a group DM.","params":[{"name":"channel","description":"Group DM channel","type":[[["GroupDMChannel"]]]},{"name":"user","description":"User","type":[[["User"]]]}],"meta":{"line":10,"file":"CHANNEL_RECIPIENT_ADD.js","path":"src/client/websocket/handlers"}},{"name":"channelRecipientRemove","description":"Emitted whenever a recipient is removed from a group DM.","params":[{"name":"channel","description":"Group DM channel","type":[[["GroupDMChannel"]]]},{"name":"user","description":"User","type":[[["User"]]]}],"meta":{"line":8,"file":"CHANNEL_RECIPIENT_REMOVE.js","path":"src/client/websocket/handlers"}},{"name":"channelUpdate","description":"Emitted whenever a channel is updated - e.g. name change, topic change, channel type change.","params":[{"name":"oldChannel","description":"The channel before the update","type":[[["DMChannel"]],[["GuildChannel"]]]},{"name":"newChannel","description":"The channel after the update","type":[[["DMChannel"]],[["GuildChannel"]]]}],"meta":{"line":8,"file":"CHANNEL_UPDATE.js","path":"src/client/websocket/handlers"}},{"name":"guildAvailable","description":"Emitted whenever a guild becomes available.","params":[{"name":"guild","description":"The guild that became available","type":[[["Guild"]]]}],"meta":{"line":31,"file":"GUILD_CREATE.js","path":"src/client/websocket/handlers"}},{"name":"guildCreate","description":"Emitted whenever the client joins a guild.","params":[{"name":"guild","description":"The created guild","type":[[["Guild"]]]}],"meta":{"line":43,"file":"GUILD_CREATE.js","path":"src/client/websocket/handlers"}},{"name":"guildMemberAdd","description":"Emitted whenever a user joins a guild.","deprecated":"See {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/issues/197 this issue} for more information.","params":[{"name":"member","description":"The member that has joined a guild","type":[[["GuildMember"]]]}],"meta":{"line":11,"file":"GUILD_MEMBER_ADD.js","path":"src/client/websocket/handlers"}},{"name":"guildMembersChunk","description":"Emitted whenever a chunk of guild members is received (all members come from the same guild).","params":[{"name":"members","description":"The members in the chunk","type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]]},{"name":"guild","description":"The guild related to the member chunk","type":[[["Guild"]]]},{"name":"chunk","description":"Properties of the received chunk","type":[[["GuildMembersChunk"]]]}],"meta":{"line":26,"file":"GUILD_MEMBERS_CHUNK.js","path":"src/client/websocket/handlers"}},{"name":"interactionModalCreate","description":"Emitted whenever client user receive interaction.showModal()","params":[{"name":"modal","description":"The modal (extended)","type":[[["Modal"]]]}],"meta":{"line":6,"file":"INTERACTION_MODAL_CREATE.js","path":"src/client/websocket/handlers"}},{"name":"messageUpdate","description":"Emitted whenever a message is updated - e.g. embed or content change.","params":[{"name":"oldMessage","description":"The message before the update","type":[[["Message"]]]},{"name":"newMessage","description":"The message after the update","type":[[["Message"]]]}],"meta":{"line":8,"file":"MESSAGE_UPDATE.js","path":"src/client/websocket/handlers"}},{"name":"relationshipAdd","description":"Emitted when a relationship is created, relevant to the current user.","params":[{"name":"user","description":"Target userId","type":[[["Snowflake"]]]},{"name":"shouldNotify","description":"Whether the client should notify the user of this relationship's creation","type":[[["boolean"]]]}],"meta":{"line":12,"file":"RELATIONSHIP_ADD.js","path":"src/client/websocket/handlers"}},{"name":"relationshipRemove","description":"Emitted when a relationship is removed, relevant to the current user.","params":[{"name":"user","description":"The userID that was updated","type":[[["Snowflake"]]]},{"name":"type","description":"The type of the old relationship","type":[[["RelationshipType"]]]},{"name":"nickname","description":"The nickname of the user in this relationship (1-32 characters)","type":[[["string"]],[["null"]]]}],"meta":{"line":9,"file":"RELATIONSHIP_REMOVE.js","path":"src/client/websocket/handlers"}},{"name":"relationshipUpdate","description":"Emitted when a relationship is updated, relevant to the current user (e.g. friend nickname changed).\nThis is not sent when the type of a relationship changes; see {@link Client#relationshipAdd} and {@link Client#relationshipRemove} for that.","params":[{"name":"user","description":"The userID that was updated","type":[[["Snowflake"]]]},{"name":"oldData","description":"Old data","type":[[["RelationshipUpdateObject"]]]},{"name":"newData","description":"New data","type":[[["RelationshipUpdateObject"]]]}],"meta":{"line":12,"file":"RELATIONSHIP_UPDATE.js","path":"src/client/websocket/handlers"}},{"name":"shardResume","description":"Emitted when a shard resumes successfully.","params":[{"name":"id","description":"The shard id that resumed","type":[[["number"]]]},{"name":"replayedEvents","description":"The amount of replayed events","type":[[["number"]]]}],"meta":{"line":7,"file":"RESUMED.js","path":"src/client/websocket/handlers"}},{"name":"threadUpdate","description":"Emitted whenever a thread is updated - e.g. name change, archive state change, locked state change.","params":[{"name":"oldThread","description":"The thread before the update","type":[[["ThreadChannel"]]]},{"name":"newThread","description":"The thread after the update","type":[[["ThreadChannel"]]]}],"meta":{"line":8,"file":"THREAD_UPDATE.js","path":"src/client/websocket/handlers"}},{"name":"voiceChannelEffectSend","description":"Emmited when someone sends an effect, such as an emoji reaction, in a voice channel the client is connected to.","params":[{"name":"voiceChannelEffect","description":"The sent voice channel effect","type":[[["VoiceChannelEffect"]]]}],"meta":{"line":10,"file":"VOICE_CHANNEL_EFFECT_SEND.js","path":"src/client/websocket/handlers"}},{"name":"shardReady","description":"Emitted when a shard turns ready.","params":[{"name":"id","description":"The shard id that turned ready","type":[[["number"]]]},{"name":"unavailableGuilds","description":"Set of unavailable guild ids, if any","nullable":true,"type":[[["Set","<"],["Snowflake",">"]]]}],"meta":{"line":179,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"shardDisconnect","description":"Emitted when a shard's WebSocket disconnects and will no longer reconnect.","params":[{"name":"event","description":"The WebSocket close event","type":[[["CloseEvent"]]]},{"name":"id","description":"The shard id that disconnected","type":[[["number"]]]}],"meta":{"line":193,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"shardReconnecting","description":"Emitted when a shard is attempting to reconnect or re-identify.","params":[{"name":"id","description":"The shard id that is attempting to reconnect","type":[[["number"]]]}],"meta":{"line":209,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"invalidated","description":"Emitted when the client's session becomes invalidated.\nYou are expected to handle closing the process gracefully and preventing a boot loop\nif you are listening to this event.","meta":{"line":283,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"unhandledPacket","description":"Emitted whenever a packet isn't handled.","params":[{"name":"packet","description":"The packet (t: EVENT_NAME, d: any)","type":[[["Object"]]]},{"name":"shard","description":"The shard that received the packet (Shard 0)","type":[[["Number"]]]}],"meta":{"line":347,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"ready","description":"Emitted when the client becomes ready to start working.","params":[{"name":"client","description":"The client","type":[[["Client"]]]}],"meta":{"line":381,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"shardError","description":"Emitted whenever a shard's WebSocket encounters a connection error.","params":[{"name":"error","description":"The encountered error","type":[[["Error"]]]},{"name":"shardId","description":"The shard that encountered this error","type":[[["number"]]]}],"meta":{"line":344,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"error","description":"Emitted when the client encounters an error.\nErrors thrown within this event do not have a catch handler, it is\nrecommended to not use async functions as `error` event handlers. See the\n[Node.js docs](https://nodejs.org/api/events.html#capture-rejections-of-promises) for details.","params":[{"name":"error","description":"The error encountered","type":[[["Error"]]]}],"meta":{"line":212,"file":"ShardClientUtil.js","path":"src/sharding"}},{"name":"debug","description":"Emitted for general debugging information.","params":[{"name":"info","description":"The debug information","type":[[["string"]]]}],"meta":{"line":82,"file":"BaseClient.js","path":"src/client"}},{"name":"rateLimit","description":"Emitted when the client hits a rate limit while making a request","params":[{"name":"rateLimitData","description":"Object containing the rate limit info","type":[[["RateLimitData"]]]}],"meta":{"line":138,"file":"RequestHandler.js","path":"src/rest"}},{"name":"apiRequest","description":"Emitted before every API request.\nThis event can emit several times for the same request, e.g. when hitting a rate limit.\nThis is an informational event that is emitted quite frequently,\nit is highly recommended to check `request.path` to filter the data.","params":[{"name":"request","description":"The request that is about to be sent","type":[[["APIRequest"]]]}],"meta":{"line":189,"file":"RequestHandler.js","path":"src/rest"}},{"name":"apiResponse","description":"Emitted after every API request has received a response.\nThis event does not necessarily correlate to completion of the request, e.g. when hitting a rate limit.\nThis is an informational event that is emitted quite frequently,\nit is highly recommended to check `request.path` to filter the data.","params":[{"name":"request","description":"The request that triggered this response","type":[[["APIRequest"]]]},{"name":"response","description":"The response received from the Discord API","type":[[["Response"]]]}],"meta":{"line":221,"file":"RequestHandler.js","path":"src/rest"}},{"name":"invalidRequestWarning","description":"Emitted periodically when the process sends invalid requests to let users avoid the\n10k invalid requests in 10 minutes threshold that causes a ban","params":[{"name":"invalidRequestWarningData","description":"Object containing the invalid request info","type":[[["InvalidRequestWarningData"]]]}],"meta":{"line":298,"file":"RequestHandler.js","path":"src/rest"}}],"meta":{"line":46,"file":"Client.js","path":"src/client"}},{"name":"ClientVoiceManager","description":"Manages voice connections for the client\nFeat: Support both lib & djs/voice","props":[{"name":"client","description":"The client that instantiated this voice manager","readonly":true,"type":[[["Client"]]],"meta":{"line":13,"file":"ClientVoiceManager.js","path":"src/client/voice"}},{"name":"connection","description":"A current connection objects","nullable":true,"type":[[["VoiceConnection"]]],"meta":{"line":25,"file":"ClientVoiceManager.js","path":"src/client/voice"}},{"name":"adapters","description":"Maps guild ids to voice adapters created for use with @discordjs/voice.","type":[[["Map","<"],["Snowflake",", "],["Object",">"]]],"meta":{"line":31,"file":"ClientVoiceManager.js","path":"src/client/voice"}}],"methods":[{"name":"joinChannel","description":"Sets up a request to join a voice channel.","params":[{"name":"channel","description":"The voice channel to join","type":[[["VoiceChannel"]],[["StageChannel"]],[["DMChannel"]],[["GroupDMChannel"]],[["Snowflake"]]]},{"name":"config","description":"Config to join voice channel","type":[[["JoinChannelConfig"]]]}],"returns":[[["Promise","<"],["VoiceConnection",">"]]],"meta":{"line":102,"file":"ClientVoiceManager.js","path":"src/client/voice"}}],"meta":{"line":11,"file":"ClientVoiceManager.js","path":"src/client/voice"}},{"name":"AudioDispatcher","description":"The class that sends voice packet data to the voice connection.\n```js\n// Obtained using:\nclient.voice.joinChannel(channel).then(connection => {\n // You can play a file or a stream here:\n const dispatcher = connection.playAudio('/home/hydrabolt/audio.mp3');\n});\n```","extends":[[["BaseDispatcher"]]],"implements":[[["VolumeInterface"]]],"props":[{"name":"bitrateEditable","description":"Whether or not the Opus bitrate of this stream is editable","readonly":true,"type":[[["boolean"]]],"meta":{"line":102,"file":"AudioDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"volumeEditable","description":"Whether or not the volume of this stream is editable","readonly":true,"type":[[["boolean"]]],"meta":{"line":21,"file":"VolumeInterface.js","path":"src/client/voice/util"}},{"name":"volume","description":"The current volume of the stream","readonly":true,"type":[[["number"]]],"meta":{"line":30,"file":"VolumeInterface.js","path":"src/client/voice/util"}},{"name":"volumeDecibels","description":"The current volume of the stream in decibels","readonly":true,"type":[[["number"]]],"meta":{"line":39,"file":"VolumeInterface.js","path":"src/client/voice/util"}},{"name":"volumeLogarithmic","description":"The current volume of the stream from a logarithmic scale","readonly":true,"type":[[["number"]]],"meta":{"line":48,"file":"VolumeInterface.js","path":"src/client/voice/util"}},{"name":"player","description":"The Player that controls this dispatcher","type":[[["MediaPlayer"]]],"meta":{"line":32,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"pausedSince","description":"The time that the stream was paused at (null if not paused)","nullable":true,"type":[[["number"]]],"meta":{"line":43,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"paused","description":"Whether or not playback is paused","readonly":true,"type":[[["boolean"]]],"meta":{"line":172,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"pausedTime","description":"Total time that this dispatcher has been paused in milliseconds","readonly":true,"type":[[["number"]]],"meta":{"line":181,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"totalStreamTime","description":"The time (in milliseconds) that the dispatcher has been playing audio for, taking into account skips and pauses","readonly":true,"type":[[["number"]]],"meta":{"line":211,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}}],"methods":[{"name":"getTypeDispatcher","description":"Get the type of the dispatcher","returns":[[["audio","'"]]],"meta":{"line":54,"file":"AudioDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"setBitrate","description":"Set the bitrate of the current Opus encoder if using a compatible Opus stream.","params":[{"name":"value","description":"New bitrate, in kbps\nIf set to 'auto', the voice channel's bitrate will be used","type":[[["number"]]]}],"returns":{"types":[[["boolean"]]],"description":"true if the bitrate has been successfully changed."},"meta":{"line":64,"file":"AudioDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"setPLP","description":"Sets the expected packet loss percentage if using a compatible Opus stream.","params":[{"name":"value","description":"between 0 and 1","type":[[["number"]]]}],"returns":{"types":[[["boolean"]]],"description":"Returns true if it was successfully set."},"meta":{"line":76,"file":"AudioDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"setFEC","description":"Enables or disables forward error correction if using a compatible Opus stream.","params":[{"name":"enabled","description":"true to enable","type":[[["boolean"]]]}],"returns":{"types":[[["boolean"]]],"description":"Returns true if it was successfully set."},"meta":{"line":87,"file":"AudioDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"setSyncVideoDispatcher","description":"Sync with another video dispatcher to ensure that the audio and video are played at the same time.","params":[{"name":"otherDispatcher","description":"The video dispatcher to sync with","type":[[["VideoDispatcher"]]]}],"meta":{"line":128,"file":"AudioDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"setVolume","description":"Sets the volume relative to the input stream - i.e. 1 is normal, 0.5 is half, 2 is double.","implements":["VolumeInterface#setVolume"],"params":[{"name":"volume","description":"The volume that you want to set","type":[[["number"]]]}],"meta":{"line":70,"file":"VolumeInterface.js","path":"src/client/voice/util"}},{"name":"setVolumeDecibels","description":"Sets the volume in decibels.","implements":["VolumeInterface#setVolumeDecibels"],"params":[{"name":"db","description":"The decibels","type":[[["number"]]]}],"meta":{"line":85,"file":"VolumeInterface.js","path":"src/client/voice/util"}},{"name":"setVolumeLogarithmic","description":"Sets the volume so that a perceived value of 0.5 is half the perceived volume etc.","implements":["VolumeInterface#setVolumeLogarithmic"],"params":[{"name":"value","description":"The value for the volume","type":[[["number"]]]}],"meta":{"line":93,"file":"VolumeInterface.js","path":"src/client/voice/util"}},{"name":"pause","description":"Pauses playback","inherits":"BaseDispatcher#pause","inherited":true,"params":[{"name":"silence","description":"Whether to play silence while paused to prevent audio glitches","optional":true,"default":false,"type":[[["boolean"]]]}],"meta":{"line":149,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"resume","description":"Resumes playback","inherits":"BaseDispatcher#resume","inherited":true,"meta":{"line":188,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"createHeaderExtension","description":"Creates a one-byte extension header\nhttps://www.rfc-editor.org/rfc/rfc5285#section-4.2","inherits":"BaseDispatcher#createHeaderExtension","inherited":true,"returns":{"types":[[["Buffer"]]],"description":""},"meta":{"line":251,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"createPayloadExtension","description":"Creates a one-byte extension header & a single extension of type playout-delay","see":["https://docs.discord.food/topics/voice-connections#sending-and-receiving-voice\nDiscord expects a playout delay RTP extension header on every video packet.","https://webrtc.googlesource.com/src/+/refs/heads/main/docs/native-code/rtp-hdrext/playout-delay"],"inherits":"BaseDispatcher#createPayloadExtension","inherited":true,"returns":{"types":[[["Buffer"]]],"description":"playout-delay extension "},"meta":{"line":273,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}}],"events":[{"name":"volumeChange","description":"Emitted when the volume of this dispatcher changes.","params":[{"name":"oldVolume","description":"The old volume of this dispatcher","type":[[["number"]]]},{"name":"newVolume","description":"The new volume of this dispatcher","type":[[["number"]]]}],"meta":{"line":113,"file":"AudioDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"speaking","description":"Emitted when the dispatcher starts/stops speaking.","params":[{"name":"value","description":"Whether or not the dispatcher is speaking","type":[[["boolean"]]]}],"meta":{"line":426,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"error","description":"Emitted when the dispatcher encounters an error.","meta":{"line":54,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"start","description":"Emitted once the stream has started to play.","meta":{"line":99,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"debug","description":"Emitted whenever the dispatcher has debug information.","params":[{"name":"info","description":"The debug info","type":[[["string"]]]}],"meta":{"line":396,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}}],"meta":{"line":27,"file":"AudioDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"BaseDispatcher","extends":[[["Writable"]]],"props":[{"name":"player","description":"The Player that controls this dispatcher","type":[[["MediaPlayer"]]],"meta":{"line":32,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"pausedSince","description":"The time that the stream was paused at (null if not paused)","nullable":true,"type":[[["number"]]],"meta":{"line":43,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"paused","description":"Whether or not playback is paused","readonly":true,"type":[[["boolean"]]],"meta":{"line":172,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"pausedTime","description":"Total time that this dispatcher has been paused in milliseconds","readonly":true,"type":[[["number"]]],"meta":{"line":181,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"totalStreamTime","description":"The time (in milliseconds) that the dispatcher has been playing audio for, taking into account skips and pauses","readonly":true,"type":[[["number"]]],"meta":{"line":211,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}}],"methods":[{"name":"pause","description":"Pauses playback","params":[{"name":"silence","description":"Whether to play silence while paused to prevent audio glitches","optional":true,"default":false,"type":[[["boolean"]]]}],"meta":{"line":149,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"resume","description":"Resumes playback","meta":{"line":188,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"createHeaderExtension","description":"Creates a one-byte extension header\nhttps://www.rfc-editor.org/rfc/rfc5285#section-4.2","returns":{"types":[[["Buffer"]]],"description":""},"meta":{"line":251,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"createPayloadExtension","description":"Creates a one-byte extension header & a single extension of type playout-delay","see":["https://docs.discord.food/topics/voice-connections#sending-and-receiving-voice\nDiscord expects a playout delay RTP extension header on every video packet.","https://webrtc.googlesource.com/src/+/refs/heads/main/docs/native-code/rtp-hdrext/playout-delay"],"returns":{"types":[[["Buffer"]]],"description":"playout-delay extension "},"meta":{"line":273,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}}],"events":[{"name":"error","description":"Emitted when the dispatcher encounters an error.","meta":{"line":54,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"start","description":"Emitted once the stream has started to play.","meta":{"line":99,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"debug","description":"Emitted whenever the dispatcher has debug information.","params":[{"name":"info","description":"The debug info","type":[[["string"]]]}],"meta":{"line":396,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}}],"meta":{"line":22,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"VideoDispatcher","description":"The class that sends video packet data to the voice connection.\n```js\n// Obtained using:\nclient.voice.joinChannel(channel).then(connection => {\n // You can play a file or a stream here:\n const dispatcher = connection.playVideo('/home/hydrabolt/video.mp4', { fps: 60, preset: 'ultrafast' });\n});\n```","extends":[[["BaseDispatcher"]]],"props":[{"name":"fps","description":"Video FPS","type":[[["number"]]],"meta":{"line":23,"file":"VideoDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"player","description":"The Player that controls this dispatcher","type":[[["MediaPlayer"]]],"meta":{"line":32,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"pausedSince","description":"The time that the stream was paused at (null if not paused)","nullable":true,"type":[[["number"]]],"meta":{"line":43,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"paused","description":"Whether or not playback is paused","readonly":true,"type":[[["boolean"]]],"meta":{"line":172,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"pausedTime","description":"Total time that this dispatcher has been paused in milliseconds","readonly":true,"type":[[["number"]]],"meta":{"line":181,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"totalStreamTime","description":"The time (in milliseconds) that the dispatcher has been playing audio for, taking into account skips and pauses","readonly":true,"type":[[["number"]]],"meta":{"line":211,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}}],"methods":[{"name":"getTypeDispatcher","description":"Get the type of the dispatcher","returns":[[["video","'"]]],"meta":{"line":40,"file":"VideoDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"setFPSSource","description":"Set FPS","params":[{"name":"value","description":"fps","type":[[["number"]]]}],"meta":{"line":59,"file":"VideoDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"pause","description":"Pauses playback","inherits":"BaseDispatcher#pause","inherited":true,"params":[{"name":"silence","description":"Whether to play silence while paused to prevent audio glitches","optional":true,"default":false,"type":[[["boolean"]]]}],"meta":{"line":149,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"resume","description":"Resumes playback","inherits":"BaseDispatcher#resume","inherited":true,"meta":{"line":188,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"createHeaderExtension","description":"Creates a one-byte extension header\nhttps://www.rfc-editor.org/rfc/rfc5285#section-4.2","inherits":"BaseDispatcher#createHeaderExtension","inherited":true,"returns":{"types":[[["Buffer"]]],"description":""},"meta":{"line":251,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"createPayloadExtension","description":"Creates a one-byte extension header & a single extension of type playout-delay","see":["https://docs.discord.food/topics/voice-connections#sending-and-receiving-voice\nDiscord expects a playout delay RTP extension header on every video packet.","https://webrtc.googlesource.com/src/+/refs/heads/main/docs/native-code/rtp-hdrext/playout-delay"],"inherits":"BaseDispatcher#createPayloadExtension","inherited":true,"returns":{"types":[[["Buffer"]]],"description":"playout-delay extension "},"meta":{"line":273,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}}],"events":[{"name":"videoStatus","description":"Emitted when the dispatcher starts/stops video.","params":[{"name":"value","description":"Whether or not the dispatcher is enable video","type":[[["boolean"]]]}],"meta":{"line":438,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"streamStatus","description":"Emitted when the dispatcher starts/stops video.","params":[{"name":"isPaused","description":"Whether or not the dispatcher is pause video","type":[[["boolean"]]]}],"meta":{"line":450,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"error","description":"Emitted when the dispatcher encounters an error.","meta":{"line":54,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"start","description":"Emitted once the stream has started to play.","meta":{"line":99,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"debug","description":"Emitted whenever the dispatcher has debug information.","params":[{"name":"info","description":"The debug info","type":[[["string"]]]}],"meta":{"line":396,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}}],"meta":{"line":16,"file":"VideoDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"VoiceConnectionUDPClient","description":"Represents a UDP client for a Voice Connection.","extends":[[["EventEmitter"]]],"access":"private","props":[{"name":"voiceConnection","description":"The voice connection that this UDP client serves","type":[[["VoiceConnection"]]],"meta":{"line":24,"file":"VoiceUDPClient.js","path":"src/client/voice/networking"}},{"name":"socket","description":"The UDP socket","nullable":true,"type":[[["Socket"]]],"meta":{"line":30,"file":"VoiceUDPClient.js","path":"src/client/voice/networking"}},{"name":"discordAddress","description":"The address of the Discord voice server","nullable":true,"type":[[["string"]]],"meta":{"line":36,"file":"VoiceUDPClient.js","path":"src/client/voice/networking"}},{"name":"localAddress","description":"The local IP address","nullable":true,"type":[[["string"]]],"meta":{"line":42,"file":"VoiceUDPClient.js","path":"src/client/voice/networking"}},{"name":"localPort","description":"The local port","nullable":true,"type":[[["string"]]],"meta":{"line":48,"file":"VoiceUDPClient.js","path":"src/client/voice/networking"}},{"name":"discordPort","description":"The port of the Discord voice server","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"VoiceUDPClient.js","path":"src/client/voice/networking"}}],"methods":[{"name":"send","description":"Send a packet to the UDP client.","params":[{"name":"packet","description":"The packet to send","type":[[["Object"]]]}],"returns":[[["Promise","<"],["Object",">"]]],"meta":{"line":79,"file":"VoiceUDPClient.js","path":"src/client/voice/networking"}}],"meta":{"line":16,"file":"VoiceUDPClient.js","path":"src/client/voice/networking"}},{"name":"VoiceWebSocket","description":"Represents a Voice Connection's WebSocket.","extends":[[["EventEmitter"]]],"access":"private","props":[{"name":"connection","description":"The Voice Connection that this WebSocket serves","type":[[["VoiceConnection"]]],"meta":{"line":21,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"attempts","description":"How many connection attempts have been made","type":[[["number"]]],"meta":{"line":27,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"client","description":"The client of this voice WebSocket","readonly":true,"type":[[["Client"]]],"meta":{"line":40,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"ws","description":"The actual WebSocket used to connect to the Voice WebSocket Server.","type":[[["WebSocket"]]],"meta":{"line":80,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}}],"methods":[{"name":"reset","description":"Resets the current WebSocket.","meta":{"line":53,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"connect","description":"Starts connecting to the Voice WebSocket Server.","meta":{"line":65,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"send","description":"Sends data to the WebSocket if it is open.","params":[{"name":"data","description":"The data to send to the WebSocket","type":[[["string"]]]}],"returns":[[["Promise","<"],["string",">"]]],"meta":{"line":93,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"sendPacket","description":"JSON.stringify's a packet and then sends it to the WebSocket Server.","params":[{"name":"packet","description":"The packet to send","type":[[["Object"]]]}],"async":true,"returns":[[["Promise","<"],["string",">"]]],"meta":{"line":109,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"onOpen","description":"Called whenever the WebSocket opens.","meta":{"line":117,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"onMessage","description":"Called whenever a message is received from the WebSocket.","params":[{"name":"event","description":"The message event that was received","type":[[["MessageEvent"]]]}],"returns":[[["void"]]],"meta":{"line":139,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"onClose","description":"Called whenever the connection to the WebSocket server is lost.","params":[{"name":"event","description":"The WebSocket close event","type":[[["CloseEvent"]]]}],"meta":{"line":151,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"onError","description":"Called whenever an error occurs with the WebSocket.","params":[{"name":"error","description":"The error that occurred","type":[[["Error"]]]}],"meta":{"line":160,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"onPacket","description":"Called whenever a valid packet is received from the WebSocket.","params":[{"name":"packet","description":"The received packet","type":[[["Object"]]]}],"meta":{"line":169,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"setHeartbeat","description":"Sets an interval at which to send a heartbeat packet to the WebSocket.","params":[{"name":"interval","description":"The interval at which to send a heartbeat packet","type":[[["number"]]]}],"meta":{"line":240,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"clearHeartbeat","description":"Clears a heartbeat interval, if one exists.","meta":{"line":260,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"sendHeartbeat","description":"Sends a heartbeat packet.","meta":{"line":272,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}}],"events":[{"name":"ready","description":"Emitted once the voice WebSocket receives the ready packet.","params":[{"name":"packet","description":"The received packet","type":[[["Object"]]]}],"meta":{"line":177,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"sessionDescription","description":"Emitted once the Voice Websocket receives a description of this voice session.","params":[{"name":"packet","description":"The received packet","type":[[["Object"]]]}],"meta":{"line":188,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"startSpeaking","description":"Emitted whenever a speaking packet is received.","params":[{"name":"data","type":[[["Object"]]]}],"meta":{"line":210,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"startStreaming","description":"Emitted whenever a streaming packet is received.","params":[{"name":"data","type":[[["Object"]]]}],"meta":{"line":218,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"unknownPacket","description":"Emitted when an unhandled packet is received.","params":[{"name":"packet","type":[[["Object"]]]}],"meta":{"line":226,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"warn","description":"Emitted whenever the voice WebSocket encounters a non-fatal error.","params":[{"name":"warn","description":"The warning","type":[[["string"]]]}],"meta":{"line":246,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}}],"meta":{"line":14,"file":"VoiceWebSocket.js","path":"src/client/voice/networking"}},{"name":"MediaPlayer","description":"Player for a Voice Connection.","extends":[[["EventEmitter"]]],"access":"private","props":[{"name":"voiceConnection","description":"The voice connection that the player serves","type":[[["VoiceConnection"]]],"meta":{"line":94,"file":"MediaPlayer.js","path":"src/client/voice/player"}}],"methods":[{"name":"createVideoDispatcher","description":"Create","access":"private","params":[{"name":"options","description":"any","type":[[["Object"]]]},{"name":"streams","description":"any","type":[[["Object"]]]}],"returns":[[["VideoDispatcher"]]],"meta":{"line":293,"file":"MediaPlayer.js","path":"src/client/voice/player"}}],"meta":{"line":83,"file":"MediaPlayer.js","path":"src/client/voice/player"}},{"name":"VoiceReceiver","description":"Receives audio packets from a voice connection.","methods":[{"name":"createStream","description":"Creates a new audio receiving stream. If a stream already exists for a user, then that stream will be returned\nrather than generating a new one.","params":[{"name":"user","description":"The user to start listening to.","type":[[["UserResolvable"]]]},{"name":"options","description":"Options.","type":[[["ReceiveStreamOptions"]]]}],"returns":[[["ReadableStream"]]],"meta":{"line":48,"file":"Receiver.js","path":"src/client/voice/receiver"}},{"name":"createVideoStream","description":"Creates a new video receiving stream. If a stream already exists for a user, then that stream will be returned\nrather than generating a new one.\nProof of concept - Requires a very good internet connection","params":[{"name":"user","description":"The user to start listening to.","type":[[["UserResolvable"]]]},{"name":"output","description":"Output stream or file path to write the video stream to.","type":[[["WritableStream"]],[["string"]]]}],"returns":{"types":[[["Recorder"]]],"description":"The video stream for the specified user."},"meta":{"line":81,"file":"Receiver.js","path":"src/client/voice/receiver"}}],"events":[{"name":"debug","description":"Emitted whenever there is a warning","params":[{"name":"error","description":"The error or message to debug","type":[[["Error"]],[["string"]]]}],"meta":{"line":21,"file":"Receiver.js","path":"src/client/voice/receiver"}}],"meta":{"line":16,"file":"Receiver.js","path":"src/client/voice/receiver"}},{"name":"Recorder","description":"Represents a FFmpeg handler","extends":[[["EventEmitter"]]],"props":[{"name":"userId","description":"The user ID","type":[[["Snowflake"]]],"meta":{"line":29,"file":"Recorder.js","path":"src/client/voice/receiver"}},{"name":"output","description":"The output of the stream","type":[[["string"]],[["Readable"]]],"meta":{"line":49,"file":"Recorder.js","path":"src/client/voice/receiver"}},{"name":"ready","description":"The FFmpeg process is ready or not","type":[[["boolean"]]],"meta":{"line":55,"file":"Recorder.js","path":"src/client/voice/receiver"}},{"name":"stream","description":"The FFmpeg process","type":[[["ChildProcessWithoutNullStreams"]]],"meta":{"line":109,"file":"Recorder.js","path":"src/client/voice/receiver"}}],"methods":[{"name":"feed","description":"Send a payload to FFmpeg via UDP","params":[{"name":"payload","description":"The payload","type":[[["RtpPacket"]],[["string"]],[["Buffer"]]]},{"name":"callback","description":"Callback","type":[["*"]]}],"meta":{"line":123,"file":"Recorder.js","path":"src/client/voice/receiver"}}],"meta":{"line":19,"file":"Recorder.js","path":"src/client/voice/receiver"}},{"name":"PlayInterface","description":"An interface class to allow you to play audio over VoiceConnections.","methods":[{"name":"playAudio","description":"Play an audio resource.","examples":["// Play a local audio file\nconnection.playAudio('/home/hydrabolt/audio.mp3', { volume: 0.5 });","// Play a ReadableStream\nconnection.playAudio(ytdl('https://www.youtube.com/watch?v=ZlAU_w7-Xp8', { quality: 'highestaudio' }));","// Using different protocols: https://ffmpeg.org/ffmpeg-protocols.html\nconnection.playAudio('http://www.sample-videos.com/audio/mp3/wave.mp3');"],"params":[{"name":"resource","description":"The resource to play.","type":[[["ReadableStream"]],[["string"]]]},{"name":"options","description":"The options to play.","optional":true,"type":[[["StreamOptions"]]]}],"returns":[[["AudioDispatcher"]]],"meta":{"line":57,"file":"PlayInterface.js","path":"src/client/voice/util"}},{"name":"playVideo","description":"Play a video resource.","examples":["// Play a local video file\nconnection.playVideo('/home/hydrabolt/video.mp4');","// Using different protocols: https://ffmpeg.org/ffmpeg-protocols.html\nconnection.playVideo('http://www.sample-videos.com/video/mp4/wave.mp4');"],"params":[{"name":"resource","description":"The resource to play.","type":[[["ReadableStream"]],[["string"]]]},{"name":"options","description":"The options to play.","optional":true,"type":[[["VideoOptions"]]]}],"returns":[[["VideoDispatcher"]]],"meta":{"line":108,"file":"PlayInterface.js","path":"src/client/voice/util"}}],"meta":{"line":37,"file":"PlayInterface.js","path":"src/client/voice/util"}},{"name":"VolumeInterface","description":"An interface class for volume transformation.","extends":[[["EventEmitter"]]],"props":[{"name":"volumeEditable","description":"Whether or not the volume of this stream is editable","readonly":true,"type":[[["boolean"]]],"meta":{"line":21,"file":"VolumeInterface.js","path":"src/client/voice/util"}},{"name":"volume","description":"The current volume of the stream","readonly":true,"type":[[["number"]]],"meta":{"line":30,"file":"VolumeInterface.js","path":"src/client/voice/util"}},{"name":"volumeDecibels","description":"The current volume of the stream in decibels","readonly":true,"type":[[["number"]]],"meta":{"line":39,"file":"VolumeInterface.js","path":"src/client/voice/util"}},{"name":"volumeLogarithmic","description":"The current volume of the stream from a logarithmic scale","readonly":true,"type":[[["number"]]],"meta":{"line":48,"file":"VolumeInterface.js","path":"src/client/voice/util"}}],"methods":[{"name":"setVolume","description":"Sets the volume relative to the input stream - i.e. 1 is normal, 0.5 is half, 2 is double.","params":[{"name":"volume","description":"The volume that you want to set","type":[[["number"]]]}],"meta":{"line":70,"file":"VolumeInterface.js","path":"src/client/voice/util"}},{"name":"setVolumeDecibels","description":"Sets the volume in decibels.","params":[{"name":"db","description":"The decibels","type":[[["number"]]]}],"meta":{"line":85,"file":"VolumeInterface.js","path":"src/client/voice/util"}},{"name":"setVolumeLogarithmic","description":"Sets the volume so that a perceived value of 0.5 is half the perceived volume etc.","params":[{"name":"value","description":"The value for the volume","type":[[["number"]]]}],"meta":{"line":93,"file":"VolumeInterface.js","path":"src/client/voice/util"}}],"events":[{"name":"volumeChange","description":"Emitted when the volume of this interface changes.","params":[{"name":"oldVolume","description":"The old volume of this interface","type":[[["number"]]]},{"name":"newVolume","description":"The new volume of this interface","type":[[["number"]]]}],"meta":{"line":71,"file":"VolumeInterface.js","path":"src/client/voice/util"}}],"meta":{"line":10,"file":"VolumeInterface.js","path":"src/client/voice/util"}},{"name":"VoiceConnection","description":"Represents a connection to a guild's voice server.\n```js\n// Obtained using:\nclient.voice.joinChannel(channel)\n .then(connection => {\n\n });\n```","extends":[[["EventEmitter"]]],"implements":[[["PlayInterface"]]],"props":[{"name":"voiceManager","description":"The voice manager that instantiated this connection","type":[[["ClientVoiceManager"]]],"meta":{"line":56,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"channel","description":"The voice channel this connection is currently serving","type":[[["VoiceChannel"]]],"meta":{"line":62,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"status","description":"The current status of the voice connection","type":[[["VoiceStatus"]]],"meta":{"line":68,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"speaking","description":"Our current speaking state","type":[[["Readonly","<"],["Speaking",">"]]],"meta":{"line":74,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"videoStatus","description":"Our current video state","type":[[["boolean"]],[["null"]]],"meta":{"line":80,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"authentication","description":"The authentication data needed to connect to the voice server","access":"private","type":[[["Object"]]],"meta":{"line":87,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"player","description":"The audio player for this voice connection","type":[[["MediaPlayer"]]],"meta":{"line":93,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"ssrcMap","description":"Map SSRC values to user IDs","access":"private","type":[[["Map","<"],["number",", {"],["userId",": "],["Snowflake",", "],["speaking",": "],["boolean",", "],["hasVideo",": "],["boolean","}>"]]],"meta":{"line":120,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"_speaking","description":"Tracks which users are talking","access":"private","type":[[["Map","<"],["Snowflake",", "],["Readonly","<"],["Speaking",">>"]]],"meta":{"line":127,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"sockets","description":"Object that wraps contains the `ws` and `udp` sockets of this voice connection","access":"private","type":[[["Object"]]],"meta":{"line":134,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"receiver","description":"The voice receiver of this connection","type":[[["VoiceReceiver"]]],"meta":{"line":140,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"videoCodec","description":"Video codec (encoded) of this connection","type":[[["VideoCodec"]]],"meta":{"line":156,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"streamConnection","description":"Create a stream connection ?","nullable":true,"type":[[["StreamConnection"]]],"meta":{"line":162,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"streamWatchConnection","description":"All stream watch connection","type":[[["Collection","<"],["Snowflake",", "],["StreamConnectionReadonly",">"]]],"meta":{"line":168,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"client","description":"The client that instantiated this connection","readonly":true,"type":[[["Client"]]],"meta":{"line":176,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"dispatcher","description":"The current audio dispatcher (if any)","readonly":true,"nullable":true,"type":[[["AudioDispatcher"]]],"meta":{"line":185,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"videoDispatcher","description":"The current video dispatcher (if any)","readonly":true,"nullable":true,"type":[[["VideoDispatcher"]]],"meta":{"line":194,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"voice","description":"The voice state of this connection","nullable":true,"type":[[["VoiceState"]]],"meta":{"line":290,"file":"VoiceConnection.js","path":"src/client/voice"}}],"methods":[{"name":"setSpeaking","description":"Sets whether the voice connection should display as \"speaking\", \"soundshare\" or \"none\".","params":[{"name":"value","description":"The new speaking state","type":[[["BitFieldResolvable"]]]}],"meta":{"line":202,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"setVideoCodec","description":"Set video codec before select protocol","params":[{"name":"value","description":"Codec","type":[[["VideoCodec"]]]}],"returns":[[["VoiceConnection"]]],"meta":{"line":225,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"setVideoStatus","description":"Sets video status","params":[{"name":"value","description":"Video on or off","type":[[["boolean"]]]}],"meta":{"line":235,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"sendVoiceStateUpdate","description":"Sends a request to the main gateway to join a voice channel.","access":"private","params":[{"name":"options","description":"The options to provide","optional":true,"type":[[["Object"]]]}],"returns":[[["Promise","<"],["Shard",">"]]],"meta":{"line":300,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"setTokenAndEndpoint","description":"Set the token and endpoint required to connect to the voice servers.","access":"private","params":[{"name":"token","description":"The voice token","type":[[["string"]]]},{"name":"endpoint","description":"The voice endpoint","type":[[["string"]]]}],"returns":[[["void"]]],"meta":{"line":328,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"setSessionId","description":"Sets the Session ID for the connection.","access":"private","params":[{"name":"sessionId","description":"The voice session ID","type":[[["string"]]]}],"meta":{"line":362,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"checkAuthenticated","description":"Checks whether the voice connection is authenticated.","access":"private","meta":{"line":387,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"authenticateFailed","description":"Invoked when we fail to initiate a voice connection.","access":"private","params":[{"name":"reason","description":"The reason for failure","type":[[["string"]]]}],"meta":{"line":406,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"updateChannel","description":"Move to a different voice channel in the same guild.","access":"private","params":[{"name":"channel","description":"The channel to move to","type":[[["VoiceChannel"]]]}],"meta":{"line":432,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"authenticate","description":"Attempts to authenticate to the voice server.","access":"private","params":[{"name":"options","description":"Join config","type":[[["Object"]]]}],"meta":{"line":442,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"reconnect","description":"Attempts to reconnect to the voice server (typically after a region change).","access":"private","params":[{"name":"token","description":"The voice token","type":[[["string"]]]},{"name":"endpoint","description":"The voice endpoint","type":[[["string"]]]}],"meta":{"line":453,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"disconnect","description":"Disconnects the voice connection, causing a disconnect and closing event to be emitted.","meta":{"line":470,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"_disconnect","description":"Internally disconnects (doesn't send disconnect packet).","access":"private","meta":{"line":486,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"cleanup","description":"Cleans up after disconnect.","access":"private","meta":{"line":500,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"connect","description":"Connect the voice connection.","access":"private","meta":{"line":525,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"onReady","description":"Invoked when the voice websocket is ready.","access":"private","params":[{"name":"data","description":"The received data","type":[[["Object"]]]}],"meta":{"line":557,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"onSessionDescription","description":"Invoked when a session description is received.","access":"private","params":[{"name":"data","description":"The received data","type":[[["Object"]]]}],"meta":{"line":574,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"onSpeaking","description":"Invoked when a speaking event is received.","access":"private","params":[{"name":"data","description":"The received data","type":[[["Object"]]]}],"meta":{"line":635,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"createStreamConnection","description":"Create new connection to screenshare stream","returns":[[["Promise","<"],["StreamConnection",">"]]],"meta":{"line":675,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"joinStreamConnection","description":"Watch user stream","params":[{"name":"user","description":"Discord user","type":[[["UserResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["StreamConnectionReadonly",">"]]],"meta":{"line":779,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"playAudio","description":"Play an audio resource.","implements":["PlayInterface#playAudio"],"examples":["// Play a local audio file\nconnection.playAudio('/home/hydrabolt/audio.mp3', { volume: 0.5 });","// Play a ReadableStream\nconnection.playAudio(ytdl('https://www.youtube.com/watch?v=ZlAU_w7-Xp8', { quality: 'highestaudio' }));","// Using different protocols: https://ffmpeg.org/ffmpeg-protocols.html\nconnection.playAudio('http://www.sample-videos.com/audio/mp3/wave.mp3');"],"params":[{"name":"resource","description":"The resource to play.","type":[[["ReadableStream"]],[["string"]]]},{"name":"options","description":"The options to play.","optional":true,"type":[[["StreamOptions"]]]}],"returns":[[["AudioDispatcher"]]],"meta":{"line":57,"file":"PlayInterface.js","path":"src/client/voice/util"}},{"name":"playVideo","description":"Play a video resource.","implements":["PlayInterface#playVideo"],"examples":["// Play a local video file\nconnection.playVideo('/home/hydrabolt/video.mp4');","// Using different protocols: https://ffmpeg.org/ffmpeg-protocols.html\nconnection.playVideo('http://www.sample-videos.com/video/mp4/wave.mp4');"],"params":[{"name":"resource","description":"The resource to play.","type":[[["ReadableStream"]],[["string"]]]},{"name":"options","description":"The options to play.","optional":true,"type":[[["VideoOptions"]]]}],"returns":[[["VideoDispatcher"]]],"meta":{"line":108,"file":"PlayInterface.js","path":"src/client/voice/util"}}],"events":[{"name":"debug","description":"Debug info from the connection.","params":[{"name":"message","description":"The debug message","type":[[["string"]]]}],"meta":{"line":96,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"warn","description":"Warning info from the connection.","params":[{"name":"warning","description":"The warning","type":[[["string"]],[["Error"]]]}],"meta":{"line":105,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"newSession","description":"Emitted when a new session ID is received.","meta":{"line":374,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"authenticated","description":"Emitted when we successfully initiate a voice connection.","meta":{"line":392,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"failed","description":"Emitted when we fail to initiate a voice connection.","params":[{"name":"error","description":"The encountered error","type":[[["Error"]]]}],"meta":{"line":410,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"error","description":"Emitted whenever the connection encounters an error.","params":[{"name":"error","description":"The encountered error","type":[[["Error"]]]}],"meta":{"line":417,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"reconnecting","description":"Emitted when the voice connection is reconnecting (typically after a region change).","meta":{"line":459,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"disconnect","description":"Emitted when the voice connection disconnects.","meta":{"line":489,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"ready","description":"Emitted once the connection is ready, when a promise to join a voice channel resolves,\nthe connection will already be ready.","meta":{"line":580,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"speaking","description":"Emitted whenever a user changes speaking state.","params":[{"name":"user","description":"The user that has changed speaking state","type":[[["User"]]]},{"name":"speaking","description":"The speaking state of the user","type":[[["Readonly","<"],["Speaking",">"]]]}],"meta":{"line":641,"file":"VoiceConnection.js","path":"src/client/voice"}}],"meta":{"line":48,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"StreamConnection","description":"Represents a connection to a guild's voice server.\n```js\n// Obtained using:\nclient.voice.joinChannel(channel)\n .then(connection => connection.createStreamConnection())\n .then(connection => {\n\n });\n```","extends":[[["VoiceConnection"]]],"construct":{"name":"StreamConnection","params":[{"name":"voiceManager","description":"Voice manager","type":[[["ClientVoiceManager"]]]},{"name":"channel","description":"any channel (joinable)","type":[[["Channel"]]]},{"name":"voiceConnection","description":"parent","type":[[["VoiceConnection"]]]}]},"props":[{"name":"voiceConnection","description":"Current voice connection","type":[[["VoiceConnection"]]],"meta":{"line":930,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"serverId","description":"Server Id","type":[[["string"]],[["null"]]],"meta":{"line":941,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"isPaused","description":"Stream state","type":[[["boolean"]],[["null"]]],"meta":{"line":947,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"viewerIds","description":"Viewer IDs","type":[[["Array","<"],["Snowflake",">"]]],"meta":{"line":953,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"region","description":"Voice region name","type":[[["string"]],[["null"]]],"meta":{"line":959,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"streamKey","description":"Current stream key","type":[[["string"]]],"meta":{"line":1081,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"voiceManager","description":"The voice manager that instantiated this connection","type":[[["ClientVoiceManager"]]],"meta":{"line":56,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"channel","description":"The voice channel this connection is currently serving","type":[[["VoiceChannel"]]],"meta":{"line":62,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"status","description":"The current status of the voice connection","type":[[["VoiceStatus"]]],"meta":{"line":68,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"speaking","description":"Our current speaking state","type":[[["Readonly","<"],["Speaking",">"]]],"meta":{"line":74,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"videoStatus","description":"Our current video state","type":[[["boolean"]],[["null"]]],"meta":{"line":80,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"authentication","description":"The authentication data needed to connect to the voice server","access":"private","type":[[["Object"]]],"meta":{"line":87,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"player","description":"The audio player for this voice connection","type":[[["MediaPlayer"]]],"meta":{"line":93,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"ssrcMap","description":"Map SSRC values to user IDs","access":"private","type":[[["Map","<"],["number",", {"],["userId",": "],["Snowflake",", "],["speaking",": "],["boolean",", "],["hasVideo",": "],["boolean","}>"]]],"meta":{"line":120,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"_speaking","description":"Tracks which users are talking","access":"private","type":[[["Map","<"],["Snowflake",", "],["Readonly","<"],["Speaking",">>"]]],"meta":{"line":127,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"sockets","description":"Object that wraps contains the `ws` and `udp` sockets of this voice connection","access":"private","type":[[["Object"]]],"meta":{"line":134,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"receiver","description":"The voice receiver of this connection","type":[[["VoiceReceiver"]]],"meta":{"line":140,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"videoCodec","description":"Video codec (encoded) of this connection","type":[[["VideoCodec"]]],"meta":{"line":156,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"streamConnection","description":"Create a stream connection ?","nullable":true,"type":[[["StreamConnection"]]],"meta":{"line":162,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"streamWatchConnection","description":"All stream watch connection","type":[[["Collection","<"],["Snowflake",", "],["StreamConnectionReadonly",">"]]],"meta":{"line":168,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"client","description":"The client that instantiated this connection","readonly":true,"type":[[["Client"]]],"meta":{"line":176,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"dispatcher","description":"The current audio dispatcher (if any)","readonly":true,"nullable":true,"type":[[["AudioDispatcher"]]],"meta":{"line":185,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"videoDispatcher","description":"The current video dispatcher (if any)","readonly":true,"nullable":true,"type":[[["VideoDispatcher"]]],"meta":{"line":194,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"voice","description":"The voice state of this connection","nullable":true,"type":[[["VoiceState"]]],"meta":{"line":290,"file":"VoiceConnection.js","path":"src/client/voice"}}],"methods":[{"name":"sendSignalScreenshare","description":"Create new stream connection (WS packet)","returns":[[["void"]]],"meta":{"line":1000,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"sendScreenshareState","description":"Send screenshare state... (WS)","params":[{"name":"isPaused","description":"screenshare paused ?","default":false,"type":[[["boolean"]]]}],"returns":[[["void"]]],"meta":{"line":1019,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"sendStopScreenshare","description":"Stop screenshare, delete this connection (WS)","access":"private","returns":[[["void"]]],"meta":{"line":1049,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"setSpeaking","description":"Sets whether the voice connection should display as \"speaking\", \"soundshare\" or \"none\".","inherits":"VoiceConnection#setSpeaking","inherited":true,"params":[{"name":"value","description":"The new speaking state","type":[[["BitFieldResolvable"]]]}],"meta":{"line":202,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"setVideoCodec","description":"Set video codec before select protocol","inherits":"VoiceConnection#setVideoCodec","inherited":true,"params":[{"name":"value","description":"Codec","type":[[["VideoCodec"]]]}],"returns":[[["VoiceConnection"]]],"meta":{"line":225,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"setVideoStatus","description":"Sets video status","inherits":"VoiceConnection#setVideoStatus","inherited":true,"params":[{"name":"value","description":"Video on or off","type":[[["boolean"]]]}],"meta":{"line":235,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"sendVoiceStateUpdate","description":"Sends a request to the main gateway to join a voice channel.","access":"private","inherits":"VoiceConnection#sendVoiceStateUpdate","inherited":true,"params":[{"name":"options","description":"The options to provide","optional":true,"type":[[["Object"]]]}],"returns":[[["Promise","<"],["Shard",">"]]],"meta":{"line":300,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"setTokenAndEndpoint","description":"Set the token and endpoint required to connect to the voice servers.","access":"private","inherits":"VoiceConnection#setTokenAndEndpoint","inherited":true,"params":[{"name":"token","description":"The voice token","type":[[["string"]]]},{"name":"endpoint","description":"The voice endpoint","type":[[["string"]]]}],"returns":[[["void"]]],"meta":{"line":328,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"setSessionId","description":"Sets the Session ID for the connection.","access":"private","inherits":"VoiceConnection#setSessionId","inherited":true,"params":[{"name":"sessionId","description":"The voice session ID","type":[[["string"]]]}],"meta":{"line":362,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"checkAuthenticated","description":"Checks whether the voice connection is authenticated.","access":"private","inherits":"VoiceConnection#checkAuthenticated","inherited":true,"meta":{"line":387,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"authenticateFailed","description":"Invoked when we fail to initiate a voice connection.","access":"private","inherits":"VoiceConnection#authenticateFailed","inherited":true,"params":[{"name":"reason","description":"The reason for failure","type":[[["string"]]]}],"meta":{"line":406,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"updateChannel","description":"Move to a different voice channel in the same guild.","access":"private","inherits":"VoiceConnection#updateChannel","inherited":true,"params":[{"name":"channel","description":"The channel to move to","type":[[["VoiceChannel"]]]}],"meta":{"line":432,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"authenticate","description":"Attempts to authenticate to the voice server.","access":"private","inherits":"VoiceConnection#authenticate","inherited":true,"params":[{"name":"options","description":"Join config","type":[[["Object"]]]}],"meta":{"line":442,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"reconnect","description":"Attempts to reconnect to the voice server (typically after a region change).","access":"private","inherits":"VoiceConnection#reconnect","inherited":true,"params":[{"name":"token","description":"The voice token","type":[[["string"]]]},{"name":"endpoint","description":"The voice endpoint","type":[[["string"]]]}],"meta":{"line":453,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"disconnect","description":"Disconnects the voice connection, causing a disconnect and closing event to be emitted.","inherits":"VoiceConnection#disconnect","inherited":true,"meta":{"line":470,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"_disconnect","description":"Internally disconnects (doesn't send disconnect packet).","access":"private","inherits":"VoiceConnection#_disconnect","inherited":true,"meta":{"line":486,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"cleanup","description":"Cleans up after disconnect.","access":"private","inherits":"VoiceConnection#cleanup","inherited":true,"meta":{"line":500,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"connect","description":"Connect the voice connection.","access":"private","inherits":"VoiceConnection#connect","inherited":true,"meta":{"line":525,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"onReady","description":"Invoked when the voice websocket is ready.","access":"private","inherits":"VoiceConnection#onReady","inherited":true,"params":[{"name":"data","description":"The received data","type":[[["Object"]]]}],"meta":{"line":557,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"onSessionDescription","description":"Invoked when a session description is received.","access":"private","inherits":"VoiceConnection#onSessionDescription","inherited":true,"params":[{"name":"data","description":"The received data","type":[[["Object"]]]}],"meta":{"line":574,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"onSpeaking","description":"Invoked when a speaking event is received.","access":"private","inherits":"VoiceConnection#onSpeaking","inherited":true,"params":[{"name":"data","description":"The received data","type":[[["Object"]]]}],"meta":{"line":635,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"createStreamConnection","description":"Create new connection to screenshare stream","inherits":"VoiceConnection#createStreamConnection","inherited":true,"returns":[[["Promise","<"],["StreamConnection",">"]]],"meta":{"line":675,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"joinStreamConnection","description":"Watch user stream","inherits":"VoiceConnection#joinStreamConnection","inherited":true,"params":[{"name":"user","description":"Discord user","type":[[["UserResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["StreamConnectionReadonly",">"]]],"meta":{"line":779,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"playAudio","description":"Play an audio resource.","inherits":"VoiceConnection#playAudio","inherited":true,"implements":["PlayInterface#playAudio"],"examples":["// Play a local audio file\nconnection.playAudio('/home/hydrabolt/audio.mp3', { volume: 0.5 });","// Play a ReadableStream\nconnection.playAudio(ytdl('https://www.youtube.com/watch?v=ZlAU_w7-Xp8', { quality: 'highestaudio' }));","// Using different protocols: https://ffmpeg.org/ffmpeg-protocols.html\nconnection.playAudio('http://www.sample-videos.com/audio/mp3/wave.mp3');"],"params":[{"name":"resource","description":"The resource to play.","type":[[["ReadableStream"]],[["string"]]]},{"name":"options","description":"The options to play.","optional":true,"type":[[["StreamOptions"]]]}],"returns":[[["AudioDispatcher"]]],"meta":{"line":57,"file":"PlayInterface.js","path":"src/client/voice/util"}},{"name":"playVideo","description":"Play a video resource.","inherits":"VoiceConnection#playVideo","inherited":true,"implements":["PlayInterface#playVideo"],"examples":["// Play a local video file\nconnection.playVideo('/home/hydrabolt/video.mp4');","// Using different protocols: https://ffmpeg.org/ffmpeg-protocols.html\nconnection.playVideo('http://www.sample-videos.com/video/mp4/wave.mp4');"],"params":[{"name":"resource","description":"The resource to play.","type":[[["ReadableStream"]],[["string"]]]},{"name":"options","description":"The options to play.","optional":true,"type":[[["VideoOptions"]]]}],"returns":[[["VideoDispatcher"]]],"meta":{"line":108,"file":"PlayInterface.js","path":"src/client/voice/util"}}],"events":[{"name":"debug","description":"Debug info from the connection.","params":[{"name":"message","description":"The debug message","type":[[["string"]]]}],"meta":{"line":96,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"warn","description":"Warning info from the connection.","params":[{"name":"warning","description":"The warning","type":[[["string"]],[["Error"]]]}],"meta":{"line":105,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"newSession","description":"Emitted when a new session ID is received.","meta":{"line":374,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"authenticated","description":"Emitted when we successfully initiate a voice connection.","meta":{"line":392,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"failed","description":"Emitted when we fail to initiate a voice connection.","params":[{"name":"error","description":"The encountered error","type":[[["Error"]]]}],"meta":{"line":410,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"error","description":"Emitted whenever the connection encounters an error.","params":[{"name":"error","description":"The encountered error","type":[[["Error"]]]}],"meta":{"line":417,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"reconnecting","description":"Emitted when the voice connection is reconnecting (typically after a region change).","meta":{"line":459,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"disconnect","description":"Emitted when the voice connection disconnects.","meta":{"line":489,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"ready","description":"Emitted once the connection is ready, when a promise to join a voice channel resolves,\nthe connection will already be ready.","meta":{"line":580,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"speaking","description":"Emitted whenever a user changes speaking state.","params":[{"name":"user","description":"The user that has changed speaking state","type":[[["User"]]]},{"name":"speaking","description":"The speaking state of the user","type":[[["Readonly","<"],["Speaking",">"]]]}],"meta":{"line":641,"file":"VoiceConnection.js","path":"src/client/voice"}}],"meta":{"line":916,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"StreamConnectionReadonly","description":"Represents a connection to a guild's voice server.\n```js\n// Obtained using:\nclient.voice.joinChannel(channel)\n .then(connection => connection.createStreamConnection())\n .then(connection => {\n\n });\n```","extends":[[["VoiceConnection"]]],"construct":{"name":"StreamConnectionReadonly","params":[{"name":"voiceManager","description":"Voice manager","type":[[["ClientVoiceManager"]]]},{"name":"channel","description":"any channel (joinable)","type":[[["Channel"]]]},{"name":"voiceConnection","description":"parent","type":[[["VoiceConnection"]]]},{"name":"userId","description":"User ID","type":[[["Snowflake"]]]}]},"props":[{"name":"voiceConnection","description":"Current voice connection","type":[[["VoiceConnection"]]],"meta":{"line":1115,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"userId","description":"User ID (who started the stream)","type":[[["Snowflake"]]],"meta":{"line":1121,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"serverId","description":"Server Id","type":[[["string"]],[["null"]]],"meta":{"line":1132,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"isPaused","description":"Stream state","type":[[["boolean"]]],"meta":{"line":1138,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"viewerIds","description":"Viewer IDs","type":[[["Array","<"],["Snowflake",">"]]],"meta":{"line":1144,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"region","description":"Voice region name","type":[[["string"]],[["null"]]],"meta":{"line":1150,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"streamKey","description":"Current stream key","type":[[["string"]]],"meta":{"line":1239,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"voiceManager","description":"The voice manager that instantiated this connection","type":[[["ClientVoiceManager"]]],"meta":{"line":56,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"channel","description":"The voice channel this connection is currently serving","type":[[["VoiceChannel"]]],"meta":{"line":62,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"status","description":"The current status of the voice connection","type":[[["VoiceStatus"]]],"meta":{"line":68,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"speaking","description":"Our current speaking state","type":[[["Readonly","<"],["Speaking",">"]]],"meta":{"line":74,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"videoStatus","description":"Our current video state","type":[[["boolean"]],[["null"]]],"meta":{"line":80,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"authentication","description":"The authentication data needed to connect to the voice server","access":"private","type":[[["Object"]]],"meta":{"line":87,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"player","description":"The audio player for this voice connection","type":[[["MediaPlayer"]]],"meta":{"line":93,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"ssrcMap","description":"Map SSRC values to user IDs","access":"private","type":[[["Map","<"],["number",", {"],["userId",": "],["Snowflake",", "],["speaking",": "],["boolean",", "],["hasVideo",": "],["boolean","}>"]]],"meta":{"line":120,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"_speaking","description":"Tracks which users are talking","access":"private","type":[[["Map","<"],["Snowflake",", "],["Readonly","<"],["Speaking",">>"]]],"meta":{"line":127,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"sockets","description":"Object that wraps contains the `ws` and `udp` sockets of this voice connection","access":"private","type":[[["Object"]]],"meta":{"line":134,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"receiver","description":"The voice receiver of this connection","type":[[["VoiceReceiver"]]],"meta":{"line":140,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"videoCodec","description":"Video codec (encoded) of this connection","type":[[["VideoCodec"]]],"meta":{"line":156,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"streamConnection","description":"Create a stream connection ?","nullable":true,"type":[[["StreamConnection"]]],"meta":{"line":162,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"streamWatchConnection","description":"All stream watch connection","type":[[["Collection","<"],["Snowflake",", "],["StreamConnectionReadonly",">"]]],"meta":{"line":168,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"client","description":"The client that instantiated this connection","readonly":true,"type":[[["Client"]]],"meta":{"line":176,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"dispatcher","description":"The current audio dispatcher (if any)","readonly":true,"nullable":true,"type":[[["AudioDispatcher"]]],"meta":{"line":185,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"videoDispatcher","description":"The current video dispatcher (if any)","readonly":true,"nullable":true,"type":[[["VideoDispatcher"]]],"meta":{"line":194,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"voice","description":"The voice state of this connection","nullable":true,"type":[[["VoiceState"]]],"meta":{"line":290,"file":"VoiceConnection.js","path":"src/client/voice"}}],"methods":[{"name":"sendSignalScreenshare","description":"Create new stream connection (WS packet)","returns":[[["void"]]],"meta":{"line":1191,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"sendStopScreenshare","description":"Stop screenshare, delete this connection (WS)","access":"private","returns":[[["void"]]],"meta":{"line":1206,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"setSpeaking","description":"Sets whether the voice connection should display as \"speaking\", \"soundshare\" or \"none\".","inherits":"VoiceConnection#setSpeaking","inherited":true,"params":[{"name":"value","description":"The new speaking state","type":[[["BitFieldResolvable"]]]}],"meta":{"line":202,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"setVideoCodec","description":"Set video codec before select protocol","inherits":"VoiceConnection#setVideoCodec","inherited":true,"params":[{"name":"value","description":"Codec","type":[[["VideoCodec"]]]}],"returns":[[["VoiceConnection"]]],"meta":{"line":225,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"setVideoStatus","description":"Sets video status","inherits":"VoiceConnection#setVideoStatus","inherited":true,"params":[{"name":"value","description":"Video on or off","type":[[["boolean"]]]}],"meta":{"line":235,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"sendVoiceStateUpdate","description":"Sends a request to the main gateway to join a voice channel.","access":"private","inherits":"VoiceConnection#sendVoiceStateUpdate","inherited":true,"params":[{"name":"options","description":"The options to provide","optional":true,"type":[[["Object"]]]}],"returns":[[["Promise","<"],["Shard",">"]]],"meta":{"line":300,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"setTokenAndEndpoint","description":"Set the token and endpoint required to connect to the voice servers.","access":"private","inherits":"VoiceConnection#setTokenAndEndpoint","inherited":true,"params":[{"name":"token","description":"The voice token","type":[[["string"]]]},{"name":"endpoint","description":"The voice endpoint","type":[[["string"]]]}],"returns":[[["void"]]],"meta":{"line":328,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"setSessionId","description":"Sets the Session ID for the connection.","access":"private","inherits":"VoiceConnection#setSessionId","inherited":true,"params":[{"name":"sessionId","description":"The voice session ID","type":[[["string"]]]}],"meta":{"line":362,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"checkAuthenticated","description":"Checks whether the voice connection is authenticated.","access":"private","inherits":"VoiceConnection#checkAuthenticated","inherited":true,"meta":{"line":387,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"authenticateFailed","description":"Invoked when we fail to initiate a voice connection.","access":"private","inherits":"VoiceConnection#authenticateFailed","inherited":true,"params":[{"name":"reason","description":"The reason for failure","type":[[["string"]]]}],"meta":{"line":406,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"updateChannel","description":"Move to a different voice channel in the same guild.","access":"private","inherits":"VoiceConnection#updateChannel","inherited":true,"params":[{"name":"channel","description":"The channel to move to","type":[[["VoiceChannel"]]]}],"meta":{"line":432,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"authenticate","description":"Attempts to authenticate to the voice server.","access":"private","inherits":"VoiceConnection#authenticate","inherited":true,"params":[{"name":"options","description":"Join config","type":[[["Object"]]]}],"meta":{"line":442,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"reconnect","description":"Attempts to reconnect to the voice server (typically after a region change).","access":"private","inherits":"VoiceConnection#reconnect","inherited":true,"params":[{"name":"token","description":"The voice token","type":[[["string"]]]},{"name":"endpoint","description":"The voice endpoint","type":[[["string"]]]}],"meta":{"line":453,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"disconnect","description":"Disconnects the voice connection, causing a disconnect and closing event to be emitted.","inherits":"VoiceConnection#disconnect","inherited":true,"meta":{"line":470,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"_disconnect","description":"Internally disconnects (doesn't send disconnect packet).","access":"private","inherits":"VoiceConnection#_disconnect","inherited":true,"meta":{"line":486,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"cleanup","description":"Cleans up after disconnect.","access":"private","inherits":"VoiceConnection#cleanup","inherited":true,"meta":{"line":500,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"connect","description":"Connect the voice connection.","access":"private","inherits":"VoiceConnection#connect","inherited":true,"meta":{"line":525,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"onReady","description":"Invoked when the voice websocket is ready.","access":"private","inherits":"VoiceConnection#onReady","inherited":true,"params":[{"name":"data","description":"The received data","type":[[["Object"]]]}],"meta":{"line":557,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"onSessionDescription","description":"Invoked when a session description is received.","access":"private","inherits":"VoiceConnection#onSessionDescription","inherited":true,"params":[{"name":"data","description":"The received data","type":[[["Object"]]]}],"meta":{"line":574,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"onSpeaking","description":"Invoked when a speaking event is received.","access":"private","inherits":"VoiceConnection#onSpeaking","inherited":true,"params":[{"name":"data","description":"The received data","type":[[["Object"]]]}],"meta":{"line":635,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"createStreamConnection","description":"Create new connection to screenshare stream","inherits":"VoiceConnection#createStreamConnection","inherited":true,"returns":[[["Promise","<"],["StreamConnection",">"]]],"meta":{"line":675,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"joinStreamConnection","description":"Watch user stream","inherits":"VoiceConnection#joinStreamConnection","inherited":true,"params":[{"name":"user","description":"Discord user","type":[[["UserResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["StreamConnectionReadonly",">"]]],"meta":{"line":779,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"playAudio","description":"Play an audio resource.","inherits":"VoiceConnection#playAudio","inherited":true,"implements":["PlayInterface#playAudio"],"examples":["// Play a local audio file\nconnection.playAudio('/home/hydrabolt/audio.mp3', { volume: 0.5 });","// Play a ReadableStream\nconnection.playAudio(ytdl('https://www.youtube.com/watch?v=ZlAU_w7-Xp8', { quality: 'highestaudio' }));","// Using different protocols: https://ffmpeg.org/ffmpeg-protocols.html\nconnection.playAudio('http://www.sample-videos.com/audio/mp3/wave.mp3');"],"params":[{"name":"resource","description":"The resource to play.","type":[[["ReadableStream"]],[["string"]]]},{"name":"options","description":"The options to play.","optional":true,"type":[[["StreamOptions"]]]}],"returns":[[["AudioDispatcher"]]],"meta":{"line":57,"file":"PlayInterface.js","path":"src/client/voice/util"}},{"name":"playVideo","description":"Play a video resource.","inherits":"VoiceConnection#playVideo","inherited":true,"implements":["PlayInterface#playVideo"],"examples":["// Play a local video file\nconnection.playVideo('/home/hydrabolt/video.mp4');","// Using different protocols: https://ffmpeg.org/ffmpeg-protocols.html\nconnection.playVideo('http://www.sample-videos.com/video/mp4/wave.mp4');"],"params":[{"name":"resource","description":"The resource to play.","type":[[["ReadableStream"]],[["string"]]]},{"name":"options","description":"The options to play.","optional":true,"type":[[["VideoOptions"]]]}],"returns":[[["VideoDispatcher"]]],"meta":{"line":108,"file":"PlayInterface.js","path":"src/client/voice/util"}}],"events":[{"name":"debug","description":"Debug info from the connection.","params":[{"name":"message","description":"The debug message","type":[[["string"]]]}],"meta":{"line":96,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"warn","description":"Warning info from the connection.","params":[{"name":"warning","description":"The warning","type":[[["string"]],[["Error"]]]}],"meta":{"line":105,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"newSession","description":"Emitted when a new session ID is received.","meta":{"line":374,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"authenticated","description":"Emitted when we successfully initiate a voice connection.","meta":{"line":392,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"failed","description":"Emitted when we fail to initiate a voice connection.","params":[{"name":"error","description":"The encountered error","type":[[["Error"]]]}],"meta":{"line":410,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"error","description":"Emitted whenever the connection encounters an error.","params":[{"name":"error","description":"The encountered error","type":[[["Error"]]]}],"meta":{"line":417,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"reconnecting","description":"Emitted when the voice connection is reconnecting (typically after a region change).","meta":{"line":459,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"disconnect","description":"Emitted when the voice connection disconnects.","meta":{"line":489,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"ready","description":"Emitted once the connection is ready, when a promise to join a voice channel resolves,\nthe connection will already be ready.","meta":{"line":580,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"speaking","description":"Emitted whenever a user changes speaking state.","params":[{"name":"user","description":"The user that has changed speaking state","type":[[["User"]]]},{"name":"speaking","description":"The speaking state of the user","type":[[["Readonly","<"],["Speaking",">"]]]}],"meta":{"line":641,"file":"VoiceConnection.js","path":"src/client/voice"}}],"meta":{"line":1100,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"WebhookClient","description":"The webhook client.","extends":[[["BaseClient"]]],"implements":[[["Webhook"]]],"construct":{"name":"WebhookClient","params":[{"name":"data","description":"The data of the webhook","type":[[["WebhookClientData"]]]},{"name":"options","description":"Options for the client","optional":true,"type":[[["ClientOptions"]]]}]},"props":[{"name":"id","description":"The webhook's id","type":[[["Snowflake"]]],"meta":{"line":55,"file":"Webhook.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the webhook was created at","readonly":true,"type":[[["number"]]],"meta":{"line":411,"file":"Webhook.js","path":"src/structures"}},{"name":"createdAt","description":"The time the webhook was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":420,"file":"Webhook.js","path":"src/structures"}},{"name":"url","description":"The URL of this webhook","readonly":true,"type":[[["string"]]],"meta":{"line":429,"file":"Webhook.js","path":"src/structures"}},{"name":"options","description":"The options the client was instantiated with","type":[[["ClientOptions"]]],"meta":{"line":25,"file":"BaseClient.js","path":"src/client"}},{"name":"rest","description":"The REST manager of the client","access":"private","type":[[["RESTManager"]]],"meta":{"line":32,"file":"BaseClient.js","path":"src/client"}},{"name":"api","description":"API shortcut","access":"private","readonly":true,"type":[[["Object"]]],"meta":{"line":41,"file":"BaseClient.js","path":"src/client"}}],"methods":[{"name":"send","description":"Sends a message with this webhook.","implements":["Webhook#send"],"examples":["// Send a basic message\nwebhook.send('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.error);","// Send a basic message in a thread\nwebhook.send({ content: 'hello!', threadId: '836856309672348295' })\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.error);","// Send a remote file\nwebhook.send({\n files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']\n})\n .then(console.log)\n .catch(console.error);","// Send a local file\nwebhook.send({\n files: [{\n attachment: 'entire/path/to/file.jpg',\n name: 'file.jpg'\n }]\n})\n .then(console.log)\n .catch(console.error);","// Send an embed with a local image inside\nwebhook.send({\n content: 'This is an embed',\n embeds: [{\n thumbnail: {\n url: 'attachment://file.jpg'\n }\n }],\n files: [{\n attachment: 'entire/path/to/file.jpg',\n name: 'file.jpg'\n }]\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["WebhookMessageOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":191,"file":"Webhook.js","path":"src/structures"}},{"name":"sendSlackMessage","description":"Sends a raw slack message with this webhook.","see":["{@link https://api.slack.com/messaging/webhooks}"],"implements":["Webhook#sendSlackMessage"],"examples":["// Send a slack message\nwebhook.sendSlackMessage({\n 'username': 'Wumpus',\n 'attachments': [{\n 'pretext': 'this looks pretty cool',\n 'color': '#F0F',\n 'footer_icon': 'http://snek.s3.amazonaws.com/topSnek.png',\n 'footer': 'Powered by sneks',\n 'ts': Date.now() / 1_000\n }]\n}).catch(console.error);"],"params":[{"name":"body","description":"The raw body to send","type":[[["Object"]]]}],"async":true,"returns":[[["Promise","<"],["boolean",">"]]],"meta":{"line":235,"file":"Webhook.js","path":"src/structures"}},{"name":"edit","description":"Edits this webhook.","implements":["Webhook#edit"],"params":[{"name":"options","description":"Options for editing the webhook","type":[[["WebhookEditData"]]]},{"name":"reason","description":"Reason for editing the webhook","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Webhook",">"]]],"meta":{"line":262,"file":"Webhook.js","path":"src/structures"}},{"name":"fetchMessage","description":"Gets a message that was sent by this webhook.","implements":["Webhook#fetchMessage"],"params":[{"name":"message","description":"The id of the message to fetch","type":[[["Snowflake"]],[["original","'"]]]},{"name":"cacheOrOptions","description":"The options to provide to fetch the message.\nA **deprecated** boolean may be passed instead to specify whether to cache the message.","optional":true,"default":"{}","type":[[["WebhookFetchMessageOptions"]],[["boolean"]]]}],"async":true,"returns":{"types":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"description":"Returns the raw message data if the webhook was instantiated as a\n{@link WebhookClient} or if the channel is uncached, otherwise a {@link Message} will be returned"},"meta":{"line":296,"file":"Webhook.js","path":"src/structures"}},{"name":"editMessage","description":"Edits a message that was sent by this webhook.","implements":["Webhook#editMessage"],"params":[{"name":"message","description":"The message to edit","type":[[["MessageResolvable"]],[["original","'"]]]},{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["WebhookEditMessageOptions"]]]}],"async":true,"returns":{"types":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"description":"Returns the raw message data if the webhook was instantiated as a\n{@link WebhookClient} or if the channel is uncached, otherwise a {@link Message} will be returned"},"meta":{"line":332,"file":"Webhook.js","path":"src/structures"}},{"name":"delete","description":"Deletes the webhook.","implements":["Webhook#delete"],"params":[{"name":"reason","description":"Reason for deleting this webhook","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":372,"file":"Webhook.js","path":"src/structures"}},{"name":"deleteMessage","description":"Delete a message that was sent by this webhook.","implements":["Webhook#deleteMessage"],"params":[{"name":"message","description":"The message to delete","type":[[["MessageResolvable"]],[["original","'"]]]},{"name":"threadId","description":"The id of the thread this message belongs to","optional":true,"type":[[["Snowflake"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":382,"file":"Webhook.js","path":"src/structures"}},{"name":"destroy","description":"Destroys all assets used by the base client.","inherits":"BaseClient#destroy","inherited":true,"returns":[[["void"]]],"meta":{"line":49,"file":"BaseClient.js","path":"src/client"}},{"name":"incrementMaxListeners","description":"Increments max listeners by one, if they are not zero.","access":"private","inherits":"BaseClient#incrementMaxListeners","inherited":true,"meta":{"line":57,"file":"BaseClient.js","path":"src/client"}},{"name":"decrementMaxListeners","description":"Decrements max listeners by one, if they are not zero.","access":"private","inherits":"BaseClient#decrementMaxListeners","inherited":true,"meta":{"line":68,"file":"BaseClient.js","path":"src/client"}}],"events":[{"name":"debug","description":"Emitted for general debugging information.","params":[{"name":"info","description":"The debug information","type":[[["string"]]]}],"meta":{"line":82,"file":"BaseClient.js","path":"src/client"}},{"name":"rateLimit","description":"Emitted when the client hits a rate limit while making a request","params":[{"name":"rateLimitData","description":"Object containing the rate limit info","type":[[["RateLimitData"]]]}],"meta":{"line":138,"file":"RequestHandler.js","path":"src/rest"}},{"name":"apiRequest","description":"Emitted before every API request.\nThis event can emit several times for the same request, e.g. when hitting a rate limit.\nThis is an informational event that is emitted quite frequently,\nit is highly recommended to check `request.path` to filter the data.","params":[{"name":"request","description":"The request that is about to be sent","type":[[["APIRequest"]]]}],"meta":{"line":189,"file":"RequestHandler.js","path":"src/rest"}},{"name":"apiResponse","description":"Emitted after every API request has received a response.\nThis event does not necessarily correlate to completion of the request, e.g. when hitting a rate limit.\nThis is an informational event that is emitted quite frequently,\nit is highly recommended to check `request.path` to filter the data.","params":[{"name":"request","description":"The request that triggered this response","type":[[["APIRequest"]]]},{"name":"response","description":"The response received from the Discord API","type":[[["Response"]]]}],"meta":{"line":221,"file":"RequestHandler.js","path":"src/rest"}},{"name":"invalidRequestWarning","description":"Emitted periodically when the process sends invalid requests to let users avoid the\n10k invalid requests in 10 minutes threshold that causes a ban","params":[{"name":"invalidRequestWarningData","description":"Object containing the invalid request info","type":[[["InvalidRequestWarningData"]]]}],"meta":{"line":298,"file":"RequestHandler.js","path":"src/rest"}}],"meta":{"line":12,"file":"WebhookClient.js","path":"src/client"}},{"name":"WebSocketManager","description":"The WebSocket manager for this client.\nThis class forwards raw dispatch events,\nread more about it here {@link https://discord.com/developers/docs/topics/gateway}","extends":[[["EventEmitter"]]],"props":[{"name":"client","description":"The client that instantiated this WebSocketManager","readonly":true,"type":[[["Client"]]],"meta":{"line":40,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"gateway","description":"The gateway this manager uses","nullable":true,"type":[[["string"]]],"meta":{"line":52,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"totalShards","description":"The amount of shards this manager handles","access":"private","type":[[["number"]]],"meta":{"line":59,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"shards","description":"A collection of all shards this manager handles","type":[[["Collection","<"],["number",", "],["WebSocketShard",">"]]],"meta":{"line":65,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"shardQueue","description":"An array of shards to be connected or that need to reconnect","access":"private","type":[[["Set","<"],["WebSocketShard",">"]]],"meta":{"line":67,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"packetQueue","description":"An array of queued events before this WebSocketManager became ready","access":"private","type":[[["Array","<"],["Object",">"]]],"meta":{"line":75,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"status","description":"The current status of this WebSocketManager","type":[[["Status"]]],"meta":{"line":87,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"destroyed","description":"If this manager was destroyed. It will prevent shards from reconnecting","access":"private","type":[[["boolean"]]],"meta":{"line":94,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"reconnecting","description":"If this manager is currently reconnecting one or multiple shards","access":"private","type":[[["boolean"]]],"meta":{"line":101,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"ping","description":"The average ping of all WebSocketShards","readonly":true,"type":[[["number"]]],"meta":{"line":109,"file":"WebSocketManager.js","path":"src/client/websocket"}}],"methods":[{"name":"debug","description":"Emits a debug message.","access":"private","params":[{"name":"message","description":"The debug message","type":[[["string"]]]},{"name":"shard","description":"The shard that emitted this message, if any","optional":true,"nullable":true,"type":[[["WebSocketShard"]]]}],"meta":{"line":120,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"connect","description":"Connects this manager to the gateway.","access":"private","async":true,"meta":{"line":128,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"createShards","description":"Handles the creation of a shard.","access":"private","async":true,"returns":[[["Promise","<"],["boolean",">"]]],"meta":{"line":169,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"reconnect","description":"Handles reconnects for this manager.","access":"private","async":true,"returns":[[["Promise","<"],["boolean",">"]]],"meta":{"line":268,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"broadcast","description":"Broadcasts a packet to every shard this manager handles.","access":"private","params":[{"name":"packet","description":"The packet to send","type":[[["Object"]]]}],"meta":{"line":306,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"destroy","description":"Destroys this manager and all its shards.","access":"private","meta":{"line":314,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"handlePacket","description":"Processes a packet and queues it if this WebSocketManager is not ready.","access":"private","params":[{"name":"packet","description":"The packet to be handled","optional":true,"type":[[["Object"]]]},{"name":"shard","description":"The shard that will handle this packet","optional":true,"type":[[["WebSocketShard"]]]}],"returns":[[["boolean"]]],"meta":{"line":329,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"checkShardsReady","description":"Checks whether the client is ready to be marked as ready.","access":"private","meta":{"line":363,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"triggerClientReady","description":"Causes the client to be marked as ready and emits the ready event.","access":"private","meta":{"line":376,"file":"WebSocketManager.js","path":"src/client/websocket"}}],"meta":{"line":36,"file":"WebSocketManager.js","path":"src/client/websocket"}},{"name":"WebSocketShard","description":"Represents a Shard's WebSocket connection","extends":[[["EventEmitter"]]],"props":[{"name":"manager","description":"The WebSocketManager of the shard","type":[[["WebSocketManager"]]],"meta":{"line":31,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"id","description":"The shard's id","type":[[["number"]]],"meta":{"line":37,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"resumeURL","description":"The resume URL for this shard","access":"private","nullable":true,"type":[[["string"]]],"meta":{"line":44,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"status","description":"The current status of the shard","type":[[["Status"]]],"meta":{"line":50,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"sequence","description":"The current sequence of the shard","access":"private","type":[[["number"]]],"meta":{"line":57,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"closeSequence","description":"The sequence of the shard after close","access":"private","type":[[["number"]]],"meta":{"line":64,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"sessionId","description":"The current session id of the shard","access":"private","nullable":true,"type":[[["string"]]],"meta":{"line":71,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"ping","description":"The previous heartbeat ping of the shard","type":[[["number"]]],"meta":{"line":77,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"lastPingTimestamp","description":"The last time a ping was sent (a timestamp)","access":"private","type":[[["number"]]],"meta":{"line":84,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"lastHeartbeatAcked","description":"If we received a heartbeat ack back. Used to identify zombie connections","access":"private","type":[[["boolean"]]],"meta":{"line":91,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"closeEmitted","description":"Used to prevent calling {@link WebSocketShard#event:close} twice while closing or terminating the WebSocket.","access":"private","type":[[["boolean"]]],"meta":{"line":98,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"ratelimit","description":"Contains the rate limit queue and metadata","access":"private","type":[[["Object"]]],"meta":{"line":100,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"connection","description":"The WebSocket connection for the current shard","access":"private","nullable":true,"type":[[["WebSocket"]]],"meta":{"line":116,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"inflate","description":"The compression to use","access":"private","nullable":true,"type":[[["Inflate"]]],"meta":{"line":129,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"helloTimeout","description":"The HELLO timeout","access":"private","nullable":true,"type":[[["NodeJSTimeout"]]],"meta":{"line":137,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"wsCloseTimeout","description":"The WebSocket timeout.","access":"private","nullable":true,"type":[[["NodeJSTimeout"]]],"meta":{"line":145,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"eventsAttached","description":"If the manager attached its event handlers on the shard","access":"private","type":[[["boolean"]]],"meta":{"line":153,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"expectedGuilds","description":"A set of guild ids this shard expects to receive","access":"private","nullable":true,"type":[[["Set","<"],["string",">"]]],"meta":{"line":161,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"readyTimeout","description":"The ready timeout","access":"private","nullable":true,"type":[[["NodeJSTimeout"]]],"meta":{"line":169,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"connectedAt","description":"Time when the WebSocket connection was opened","access":"private","type":[[["number"]]],"meta":{"line":177,"file":"WebSocketShard.js","path":"src/client/websocket"}}],"methods":[{"name":"debug","description":"Emits a debug event.","access":"private","params":[{"name":"message","description":"The debug message","type":[[["string"]]]}],"meta":{"line":191,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"connect","description":"Connects the shard to the gateway.","access":"private","returns":{"types":[[["Promise","<"],["void",">"]]],"description":"A promise that will resolve if the shard turns ready successfully,\nor reject if we couldn't connect"},"meta":{"line":201,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"onOpen","description":"Called whenever a connection is opened to the gateway.","access":"private","meta":{"line":299,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"onMessage","description":"Called whenever a message is received.","access":"private","params":[{"name":"event","description":"Event received","type":[[["MessageEvent"]]]}],"meta":{"line":309,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"onError","description":"Called whenever an error occurs with the WebSocket.","access":"private","params":[{"name":"event","description":"The error that occurred","type":[[["ErrorEvent"]]]}],"meta":{"line":340,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"onClose","description":"Called whenever a connection to the gateway is closed.","access":"private","params":[{"name":"event","description":"Close event that was received","type":[[["CloseEvent"]]]}],"meta":{"line":373,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"emitClose","description":"This method is responsible to emit close event for this shard.\nThis method helps the shard reconnect.","params":[{"name":"event","description":"Close event that was received","optional":true,"type":[[["CloseEvent"]]]}],"meta":{"line":396,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"onPacket","description":"Called whenever a packet is received.","access":"private","params":[{"name":"packet","description":"The received packet","type":[[["Object"]]]}],"meta":{"line":421,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"checkReady","description":"Checks if the shard can be marked as ready","access":"private","meta":{"line":510,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"setHelloTimeout","description":"Sets the HELLO packet timeout.","access":"private","params":[{"name":"time","description":"If set to -1, it will clear the hello timeout","optional":true,"type":[[["number"]]]}],"meta":{"line":564,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"setWsCloseTimeout","description":"Sets the WebSocket Close timeout.\nThis method is responsible for detecting any zombie connections if the WebSocket fails to close properly.","access":"private","params":[{"name":"time","description":"If set to -1, it will clear the timeout","optional":true,"type":[[["number"]]]}],"meta":{"line":586,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"setHeartbeatTimer","description":"Sets the heartbeat timer for this shard.","access":"private","params":[{"name":"time","description":"If -1, clears the interval, any other number sets an interval","type":[[["number"]]]}],"meta":{"line":626,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"sendHeartbeat","description":"Sends a heartbeat to the WebSocket.\nIf this shard didn't receive a heartbeat last time, it will destroy it and reconnect","access":"private","params":[{"name":"tag","description":"What caused this heartbeat to be sent","optional":true,"default":"'HeartbeatTimer'","type":[[["string"]]]},{"name":"ignoreHeartbeatAck","description":"If we should send the heartbeat forcefully.","optional":true,"type":[[["boolean"]]]}],"meta":{"line":648,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"ackHeartbeat","description":"Acknowledges a heartbeat.","access":"private","meta":{"line":675,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"identify","description":"Identifies the client on the connection.","access":"private","returns":[[["void"]]],"meta":{"line":687,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"identifyNew","description":"Identifies as a new connection on the gateway.","access":"private","meta":{"line":695,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"identifyResume","description":"Resumes a session on the gateway.","access":"private","meta":{"line":729,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"send","description":"Adds a packet to the queue to be sent to the gateway.\nIf you use this method, make sure you understand that you need to provide\na full [Payload](https://discord.com/developers/docs/topics/gateway-events#payload-structure).\nDo not use this method if you don't know what you're doing.","params":[{"name":"data","description":"The full packet to send","type":[[["Object"]]]},{"name":"important","description":"If this packet should be added first in queue","optional":true,"default":false,"type":[[["boolean"]]]}],"meta":{"line":757,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"_send","description":"Sends data, bypassing the queue.","access":"private","params":[{"name":"data","description":"Packet to send","type":[[["Object"]]]}],"returns":[[["void"]]],"meta":{"line":768,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"processQueue","description":"Processes the current WebSocket queue.","access":"private","returns":[[["void"]]],"meta":{"line":786,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"destroy","description":"Destroys this shard and closes its WebSocket connection.","access":"private","params":[{"name":"options","description":"Options for destroying the shard","optional":true,"default":"{ closeCode: 1000, reset: false, emit: true, log: true }","type":[[["Object"]]]}],"meta":{"line":808,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"_cleanupConnection","description":"Cleans up the WebSocket connection listeners.","access":"private","meta":{"line":888,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"_emitDestroyed","description":"Emits the DESTROYED event on the shard","access":"private","meta":{"line":897,"file":"WebSocketShard.js","path":"src/client/websocket"}}],"events":[{"name":"close","description":"Emitted when a shard's WebSocket closes.","params":[{"name":"event","description":"The received event","type":[[["CloseEvent"]]]}],"meta":{"line":407,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"ready","description":"Emitted when the shard receives the READY payload and is now waiting for guilds","meta":{"line":429,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"resumed","description":"Emitted when the shard resumes successfully","meta":{"line":444,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"invalidSession","description":"Emitted when the session has been invalidated.","meta":{"line":485,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"allReady","description":"Emitted when the shard is fully ready.\nThis event is emitted if:\n* all guilds were received by this shard\n* the ready timeout expired, and some guilds are unavailable","params":[{"name":"unavailableGuilds","description":"Set of unavailable guilds, if any","nullable":true,"type":[[["Set","<"],["string",">"]]]}],"meta":{"line":521,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"destroyed","description":"Emitted when a shard is destroyed, but no WebSocket connection was present.","meta":{"line":898,"file":"WebSocketShard.js","path":"src/client/websocket"}}],"meta":{"line":23,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"ApplicationCommandManager","description":"Manages API methods for application commands and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"permissions","description":"The manager for permissions of arbitrary commands on arbitrary guilds","type":[[["ApplicationCommandPermissionsManager"]]],"meta":{"line":24,"file":"ApplicationCommandManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of this manager","type":[[["Collection","<"],["Snowflake",", "],["ApplicationCommand",">"]]],"meta":{"line":27,"file":"ApplicationCommandManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"commandPath","description":"The APIRouter path to the commands","access":"private","params":[{"name":"options.id","description":"The application command's id","optional":true,"type":[[["Snowflake"]]]},{"name":"options.guildId","description":"The guild's id to use in the path,\nignored when using a {@link GuildApplicationCommandManager}","optional":true,"type":[[["Snowflake"]]]}],"returns":[[["Object"]]],"meta":{"line":45,"file":"ApplicationCommandManager.js","path":"src/managers"}},{"name":"fetch","description":"Obtains one or multiple application commands from Discord, or the cache if it's already available.","examples":["// Fetch a single command\nclient.application.commands.fetch('123456789012345678')\n .then(command => console.log(`Fetched command ${command.name}`))\n .catch(console.error);","// Fetch all commands\nguild.commands.fetch()\n .then(commands => console.log(`Fetched ${commands.size} commands`))\n .catch(console.error);"],"params":[{"name":"id","description":"The application command's id","optional":true,"type":[[["Snowflake"]]]},{"name":"options","description":"Additional options for this fetch","optional":true,"type":[[["FetchApplicationCommandOptions"]]]}],"async":true,"returns":[[["Promise","<("],["ApplicationCommand","|"],["Collection","<"],["Snowflake",", "],["ApplicationCommand",">)>"]]],"meta":{"line":96,"file":"ApplicationCommandManager.js","path":"src/managers"}},{"name":"create","description":"Creates an application command.","examples":["// Create a new command\nclient.application.commands.create({\n name: 'test',\n description: 'A test command',\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"command","description":"The command","type":[[["ApplicationCommandDataResolvable"]]]},{"name":"guildId","description":"The guild's id to create this command in,\nignored when using a {@link GuildApplicationCommandManager}","optional":true,"type":[[["Snowflake"]]]}],"async":true,"returns":[[["Promise","<"],["ApplicationCommand",">"]]],"meta":{"line":132,"file":"ApplicationCommandManager.js","path":"src/managers"}},{"name":"set","description":"Sets all the commands for this application or guild.","examples":["// Set all commands to just this one\nclient.application.commands.set([\n {\n name: 'test',\n description: 'A test command',\n },\n])\n .then(console.log)\n .catch(console.error);","// Remove all commands\nguild.commands.set([])\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"commands","description":"The commands","type":[[["Array","<"],["ApplicationCommandDataResolvable",">"]]]},{"name":"guildId","description":"The guild's id to create the commands in,\nignored when using a {@link GuildApplicationCommandManager}","optional":true,"type":[[["Snowflake"]]]}],"async":true,"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["ApplicationCommand",">>"]]],"meta":{"line":161,"file":"ApplicationCommandManager.js","path":"src/managers"}},{"name":"edit","description":"Edits an application command.","examples":["// Edit an existing command\nclient.application.commands.edit('123456789012345678', {\n description: 'New description',\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"command","description":"The command to edit","type":[[["ApplicationCommandResolvable"]]]},{"name":"data","description":"The data to update the command with","type":[[["Partial","<"],["ApplicationCommandDataResolvable",">"]]]},{"name":"guildId","description":"The guild's id where the command registered,\nignored when using a {@link GuildApplicationCommandManager}","optional":true,"type":[[["Snowflake"]]]}],"async":true,"returns":[[["Promise","<"],["ApplicationCommand",">"]]],"meta":{"line":183,"file":"ApplicationCommandManager.js","path":"src/managers"}},{"name":"delete","description":"Deletes an application command.","examples":["// Delete a command\nguild.commands.delete('123456789012345678')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"command","description":"The command to delete","type":[[["ApplicationCommandResolvable"]]]},{"name":"guildId","description":"The guild's id where the command is registered,\nignored when using a {@link GuildApplicationCommandManager}","optional":true,"type":[[["Snowflake"]]]}],"async":true,"returns":[[["Promise",""]]],"meta":{"line":205,"file":"ApplicationCommandManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a data entry to a data Object.","inherits":"DataManager#resolve","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Object"]]],"description":"An instance from this Manager","nullable":true},"meta":{"line":39,"file":"DataManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a data entry to an instance id.","inherits":"DataManager#resolveId","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":50,"file":"DataManager.js","path":"src/managers"}},{"name":"transformCommand","description":"Transforms an {@link ApplicationCommandData} object into something that can be used with the API.","scope":"static","access":"private","params":[{"name":"command","description":"The command to transform","type":[[["ApplicationCommandDataResolvable"]]]}],"returns":[[["APIApplicationCommand"]]],"meta":{"line":222,"file":"ApplicationCommandManager.js","path":"src/managers"}}],"meta":{"line":16,"file":"ApplicationCommandManager.js","path":"src/managers"}},{"name":"ApplicationCommandPermissionsManager","description":"Manages API methods for permissions of Application Commands.","extends":[[["BaseManager"]]],"props":[{"name":"manager","description":"The manager or command that this manager belongs to","access":"private","type":[[["ApplicationCommandManager"]],[["ApplicationCommand"]]],"meta":{"line":21,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"guild","description":"The guild that this manager acts on","nullable":true,"type":[[["Guild"]]],"meta":{"line":27,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"guildId","description":"The id of the guild that this manager acts on","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":33,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"commandId","description":"The id of the command this manager acts on","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":39,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"permissionsPath","description":"The APIRouter path to the commands","access":"private","params":[{"name":"guildId","description":"The guild's id to use in the path,","type":[[["Snowflake"]]]},{"name":"commandId","description":"The application command's id","optional":true,"type":[[["Snowflake"]]]}],"returns":[[["Object"]]],"meta":{"line":49,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"fetch","description":"Fetches the permissions for one or multiple commands.","examples":["// Fetch permissions for one command\nguild.commands.permissions.fetch({ command: '123456789012345678' })\n .then(perms => console.log(`Fetched permissions for ${perms.length} users`))\n .catch(console.error);","// Fetch permissions for all commands in a guild\nclient.application.commands.permissions.fetch({ guild: '123456789012345678' })\n .then(perms => console.log(`Fetched permissions for ${perms.size} commands`))\n .catch(console.error);"],"params":[{"name":"options","description":"Options used to fetch permissions","optional":true,"type":[[["BaseApplicationCommandPermissionsOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Array","<"],["ApplicationCommandPermissions",">|"],["Collection","<"],["Snowflake",", "],["Array","<"],["ApplicationCommandPermissions",">>)>"]]],"meta":{"line":95,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"set","description":"Sets the permissions for one or more commands.","examples":["// Set the permissions for one command\nclient.application.commands.permissions.set({ guild: '892455839386304532', command: '123456789012345678',\n permissions: [\n {\n id: '876543210987654321',\n type: 'USER',\n permission: false,\n },\n]})\n .then(console.log)\n .catch(console.error);","// Set the permissions for all commands\nguild.commands.permissions.set({ fullPermissions: [\n {\n id: '123456789012345678',\n permissions: [{\n id: '876543210987654321',\n type: 'USER',\n permission: false,\n }],\n },\n]})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options used to set permissions","type":[[["SetApplicationCommandPermissionsOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Array","<"],["ApplicationCommandPermissions",">|"],["Collection","<"],["Snowflake",", "],["Array","<"],["ApplicationCommandPermissions",">>)>"]]],"meta":{"line":161,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"add","description":"Add permissions to a command.","examples":["// Block a role from the command permissions\nguild.commands.permissions.add({ command: '123456789012345678', permissions: [\n {\n id: '876543211234567890',\n type: 'ROLE',\n permission: false\n },\n]})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options used to add permissions","type":[[["AddApplicationCommandPermissionsOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Array","<"],["ApplicationCommandPermissions",">>"]]],"meta":{"line":222,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"remove","description":"Remove permissions from a command.","examples":["// Remove a user permission from this command\nguild.commands.permissions.remove({ command: '123456789012345678', users: '876543210123456789' })\n .then(console.log)\n .catch(console.error);","// Remove multiple roles from this command\nguild.commands.permissions.remove({\n command: '123456789012345678', roles: ['876543210123456789', '765432101234567890']\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options used to remove permissions","type":[[["RemoveApplicationCommandPermissionsOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Array","<"],["ApplicationCommandPermissions",">>"]]],"meta":{"line":273,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"has","description":"Check whether a permission exists for a user or role","examples":["// Check whether a user has permission to use a command\nguild.commands.permissions.has({ command: '123456789012345678', permissionId: '876543210123456789' })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options used to check permissions","type":[[["AddApplicationCommandPermissionsOptions"]]]}],"async":true,"returns":[[["Promise","<"],["boolean",">"]]],"meta":{"line":348,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"transformPermissions","description":"Transforms an {@link ApplicationCommandPermissionData} object into something that can be used with the API.","scope":"static","access":"private","params":[{"name":"permissions","description":"The permissions to transform","type":[[["ApplicationCommandPermissionData"]]]},{"name":"received","description":"Whether these permissions have been received from Discord","optional":true,"type":[[["boolean"]]]}],"returns":[[["APIApplicationCommandPermissions"]]],"meta":{"line":399,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}}],"meta":{"line":12,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"AutoModerationRuleManager","description":"Manages API methods for auto moderation rules and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"guild","description":"The guild this manager belongs to.","type":[[["Guild"]]],"meta":{"line":25,"file":"AutoModerationRuleManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of items for this manager.","abstract":true,"type":[[["Collection"]]],"meta":{"line":49,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"resolve","description":"Resolves an {@link AutoModerationRuleResolvable} to an {@link AutoModerationRule} object.","params":[{"name":"autoModerationRule","description":"The AutoModerationRule resolvable to resolve","type":[[["AutoModerationRuleResolvable"]]]}],"returns":{"types":[[["AutoModerationRule"]]],"nullable":true},"meta":{"line":28,"file":"AutoModerationRuleManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves an {@link AutoModerationRuleResolvable} to a {@link AutoModerationRule} id.","params":[{"name":"autoModerationRule","description":"The AutoModerationRule resolvable to resolve","type":[[["AutoModerationRuleResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":37,"file":"AutoModerationRuleManager.js","path":"src/managers"}},{"name":"create","description":"Creates a new auto moderation rule.","params":[{"name":"options","description":"Options for creating the auto moderation rule","type":[[["AutoModerationRuleCreateOptions"]]]}],"async":true,"returns":[[["Promise","<"],["AutoModerationRule",">"]]],"meta":{"line":108,"file":"AutoModerationRuleManager.js","path":"src/managers"}},{"name":"edit","description":"Edits an auto moderation rule.","params":[{"name":"autoModerationRule","description":"The auto moderation rule to edit","type":[[["AutoModerationRuleResolvable"]]]},{"name":"options","description":"Options for editing the auto moderation rule","type":[[["AutoModerationRuleEditOptions"]]]}],"async":true,"returns":[[["Promise","<"],["AutoModerationRule",">"]]],"meta":{"line":174,"file":"AutoModerationRuleManager.js","path":"src/managers"}},{"name":"fetch","description":"Fetches auto moderation rules from Discord.","examples":["// Fetch all auto moderation rules from a guild without caching\nguild.autoModerationRules.fetch({ cache: false })\n .then(console.log)\n .catch(console.error);","// Fetch a single auto moderation rule\nguild.autoModerationRules.fetch('979083472868098119')\n .then(console.log)\n .catch(console.error);","// Fetch a single auto moderation rule without checking cache and without caching\nguild.autoModerationRules.fetch({ autoModerationRule: '979083472868098119', cache: false, force: true })\n .then(console.log)\n .catch(console.error)"],"params":[{"name":"options","description":"Options for fetching auto moderation rule(s)","optional":true,"type":[[["AutoModerationRuleResolvable"]],[["FetchAutoModerationRuleOptions"]],[["FetchAutoModerationRulesOptions"]]]}],"returns":[[["Promise","<("],["AutoModerationRule","|"],["Collection","<"],["Snowflake",", "],["AutoModerationRule",">)>"]]],"meta":{"line":255,"file":"AutoModerationRuleManager.js","path":"src/managers"}},{"name":"delete","description":"Deletes an auto moderation rule.","params":[{"name":"autoModerationRule","description":"The auto moderation rule to delete","type":[[["AutoModerationRuleResolvable"]]]},{"name":"reason","description":"The reason for deleting the auto moderation rule","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":290,"file":"AutoModerationRuleManager.js","path":"src/managers"}}],"meta":{"line":17,"file":"AutoModerationRuleManager.js","path":"src/managers"}},{"name":"BaseGuildEmojiManager","description":"Holds methods to resolve GuildEmojis and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"cache","description":"The cache of GuildEmojis","type":[[["Collection","<"],["Snowflake",", "],["GuildEmoji",">"]]],"meta":{"line":17,"file":"BaseGuildEmojiManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"resolve","description":"Resolves an EmojiResolvable to an Emoji object.","params":[{"name":"emoji","description":"The Emoji resolvable to identify","type":[[["EmojiResolvable"]]]}],"returns":{"types":[[["GuildEmoji"]]],"nullable":true},"meta":{"line":36,"file":"BaseGuildEmojiManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves an EmojiResolvable to an Emoji id string.","params":[{"name":"emoji","description":"The Emoji resolvable to identify","type":[[["EmojiResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":46,"file":"BaseGuildEmojiManager.js","path":"src/managers"}},{"name":"resolveIdentifier","description":"Resolves an EmojiResolvable to an emoji identifier.","params":[{"name":"emoji","description":"The emoji resolvable to resolve","type":[[["EmojiIdentifierResolvable"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":64,"file":"BaseGuildEmojiManager.js","path":"src/managers"}}],"meta":{"line":12,"file":"BaseGuildEmojiManager.js","path":"src/managers"}},{"name":"BaseManager","description":"Manages the API methods of a data model.","abstract":true,"props":[{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"meta":{"line":7,"file":"BaseManager.js","path":"src/managers"}},{"name":"BillingManager","description":"Manages the API methods of a data model.","extends":[[["CachedManager"]]],"props":[{"name":"paymentSources","description":"All the payment sources of the client","type":[[["Collection","<"],["Snowflake",", "],["Object",">"]]],"meta":{"line":18,"file":"BillingManager.js","path":"src/managers"}},{"name":"guildBoosts","description":"All the guild boosts of the client","type":[[["Collection","<"],["Snowflake",", "],["GuildBoost",">"]]],"meta":{"line":23,"file":"BillingManager.js","path":"src/managers"}},{"name":"currentSubscription","description":"The current subscription of the client","type":[[["Collection","<"],["Snowflake",", "],["Object",">"]]],"meta":{"line":28,"file":"BillingManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of items for this manager.","abstract":true,"type":[[["Collection"]]],"meta":{"line":49,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"fetchPaymentSources","description":"Fetches all the payment sources of the client","async":true,"returns":[[["Collection","<"],["Snowflake",", "],["Object",">"]]],"meta":{"line":35,"file":"BillingManager.js","path":"src/managers"}},{"name":"fetchGuildBoosts","description":"Fetches all the guild boosts of the client","async":true,"returns":[[["Collection","<"],["Snowflake",", "],["GuildBoost",">"]]],"meta":{"line":47,"file":"BillingManager.js","path":"src/managers"}},{"name":"fetchCurrentSubscription","description":"Fetches the current subscription of the client","async":true,"returns":[[["Collection","<"],["Snowflake",", "],["Object",">"]]],"meta":{"line":58,"file":"BillingManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a data entry to a data Object.","inherits":"DataManager#resolve","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Object"]]],"description":"An instance from this Manager","nullable":true},"meta":{"line":39,"file":"DataManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a data entry to an instance id.","inherits":"DataManager#resolveId","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":50,"file":"DataManager.js","path":"src/managers"}}],"meta":{"line":11,"file":"BillingManager.js","path":"src/managers"}},{"name":"CachedManager","description":"Manages the API methods of a data model with a mutable cache of instances.","extends":[[["DataManager"]]],"abstract":true,"props":[{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of items for this manager.","abstract":true,"type":[[["Collection"]]],"meta":{"line":49,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"resolve","description":"Resolves a data entry to a data Object.","inherits":"DataManager#resolve","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Object"]]],"description":"An instance from this Manager","nullable":true},"meta":{"line":39,"file":"DataManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a data entry to an instance id.","inherits":"DataManager#resolveId","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":50,"file":"DataManager.js","path":"src/managers"}}],"meta":{"line":11,"file":"CachedManager.js","path":"src/managers"}},{"name":"ChannelManager","description":"A manager of channels belonging to a client","extends":[[["CachedManager"]]],"props":[{"name":"cache","description":"The cache of Channels","type":[[["Collection","<"],["Snowflake",", "],["Channel",">"]]],"meta":{"line":30,"file":"ChannelManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"resolve","description":"Resolves a ChannelResolvable to a Channel object.","params":[{"name":"channel","description":"The channel resolvable to resolve","type":[[["ChannelResolvable"]]]}],"returns":{"types":[[["Channel"]]],"nullable":true},"meta":{"line":82,"file":"ChannelManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a ChannelResolvable to a channel id string.","params":[{"name":"channel","description":"The channel resolvable to resolve","type":[[["ChannelResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":91,"file":"ChannelManager.js","path":"src/managers"}},{"name":"fetch","description":"Obtains a channel from Discord, or the channel cache if it's already available.","examples":["// Fetch a channel by its id\nclient.channels.fetch('222109930545610754')\n .then(channel => console.log(channel.name))\n .catch(console.error);"],"params":[{"name":"id","description":"The channel's id","type":[[["Snowflake"]]]},{"name":"options","description":"Additional options for this fetch","optional":true,"type":[[["FetchChannelOptions"]]]}],"async":true,"returns":[[["Promise",""]]],"meta":{"line":118,"file":"ChannelManager.js","path":"src/managers"}},{"name":"createGroupDM","description":"Create Group DM","examples":["client.channels.createGroupDM();"],"params":[{"name":"recipients","description":"Array of recipients","optional":true,"default":"[]","type":[[["Array","<"],["UserResolvable",">"]]]}],"async":true,"returns":{"types":[[["Promise","<"],["GroupDMChannel",">"]]],"description":"Channel"},"meta":{"line":135,"file":"ChannelManager.js","path":"src/managers"}}],"meta":{"line":14,"file":"ChannelManager.js","path":"src/managers"}},{"name":"ClientUserSettingManager","description":"Manages API methods for users and stores their cache.","see":["{@link https://luna.gitlab.io/discord-unofficial-docs/user_settings.html}"],"extends":[[["BaseManager"]]],"props":[{"name":"addFriendFrom","description":"WHO CAN ADD YOU AS A FRIEND ?","see":["{@link https://luna.gitlab.io/discord-unofficial-docs/user_settings.html#friend-source-flags-structure}"],"nullable":true,"type":[[["object"]]],"meta":{"line":23,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"locale","description":"The user's chosen language option","see":["{@link https://discord.com/developers/docs/reference#locales}"],"nullable":true,"type":[[["string"]]],"meta":{"line":44,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"activityDisplay","description":"Show playing status for detected/added games\nSetting => ACTIVITY SETTINGS => Activity Status => Display current activity as a status message","nullable":true,"type":[[["boolean"]]],"meta":{"line":52,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"allowDMsFromGuild","description":"Allow DMs from guild members by default on guild join","nullable":true,"type":[[["boolean"]]],"meta":{"line":59,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"displayImage","description":"Display images and video when uploaded directly","nullable":true,"type":[[["boolean"]]],"meta":{"line":66,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"linkedImageDisplay","description":"Display images and video when linked","nullable":true,"type":[[["boolean"]]],"meta":{"line":73,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"autoplayGIF","description":"Play GIFs without hovering over them\nSetting => APP SETTINGS => Accessibility => Automatically play GIFs when Discord is focused.","nullable":true,"type":[[["boolean"]]],"meta":{"line":81,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"previewLink","description":"Show embeds and preview website links pasted into chat","nullable":true,"type":[[["boolean"]]],"meta":{"line":88,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"animatedEmoji","description":"Play animated emoji without hovering over them\nSetting => APP SETTINGS => Accessibility => Play Animated Emojis","nullable":true,"type":[[["boolean"]]],"meta":{"line":96,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"allowTTS","description":"Enable /tts command and playback\nSetting => APP SETTINGS => Accessibility => Text-to-speech => Allow playback","nullable":true,"type":[[["boolean"]]],"meta":{"line":104,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"compactMode","description":"Use compact mode\nSetting => APP SETTINGS => Appearance => Message Display => Compact Mode","nullable":true,"type":[[["boolean"]]],"meta":{"line":112,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"convertEmoticons","description":"Convert \"old fashioned\" emoticons to emojis\nSetting => APP SETTINGS => Text & Images => Emoji => Convert Emoticons","nullable":true,"type":[[["boolean"]]],"meta":{"line":120,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"DMScanLevel","description":"Content filter level\n\n* `0`: Off\n* `1`: Friends excluded\n* `2`: Scan everyone\n","nullable":true,"type":[[["number"]]],"meta":{"line":132,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"theme","description":"Client theme\nSetting => APP SETTINGS => Appearance => Theme\n* `dark`\n* `light`\n","nullable":true,"type":[[["string"]]],"meta":{"line":143,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"developerMode","description":"Show the option to copy ids in right click menus","nullable":true,"type":[[["boolean"]]],"meta":{"line":150,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"afkTimeout","description":"How many seconds being idle before the user is marked as \"AFK\"; this handles when push notifications are sent","nullable":true,"type":[[["number"]]],"meta":{"line":157,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"stickerAnimationMode","description":"When stickers animate\n\n* `0`: Always\n* `1`: On hover/focus\n* `2`: Never\n","nullable":true,"type":[[["number"]]],"meta":{"line":169,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"showEmojiReactions","description":"Display reactions\nSetting => APP SETTINGS => Text & Images => Emoji => Show emoji reactions","nullable":true,"type":[[["boolean"]]],"meta":{"line":177,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"disableDMfromGuilds","description":"Disable Direct Message from servers","type":[[["Collection","<"],["Snowflake",", "],["Guild",">"]]],"meta":{"line":214,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"raw","description":"Raw data","type":[[["Object"]]],"meta":{"line":224,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"_patch","description":"Patch data file\nhttps://luna.gitlab.io/discord-unofficial-docs/docs/user_settings","access":"private","params":[{"name":"data","description":"Raw Data to patch","type":[[["Object"]]]}],"meta":{"line":35,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"edit","description":"Edit data","params":[{"name":"data","description":"Data to edit","type":[[["any"]]]}],"async":true,"meta":{"line":238,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"toggleCompactMode","description":"Toggle compact mode","returns":[[["Promise","<"],["this",">"]]],"meta":{"line":248,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"setTheme","description":"Discord Theme","params":[{"name":"value","description":"Theme to set (dark | light)","type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":256,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"setCustomStatus","description":"Set custom status","params":[{"name":"options","description":"CustomStatus","type":[[["CustomStatus"]],[["CustomStatusOption"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":278,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"restrictedGuilds","description":"Restricted guilds setting","params":[{"name":"status","description":"Restricted status","type":[[["boolean"]]]}],"returns":[[["Promise"]]],"meta":{"line":337,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"addRestrictedGuild","description":"Add a guild to the list of restricted guilds.","params":[{"name":"guildId","description":"The guild to add","type":[[["GuildIDResolve"]]]}],"returns":[[["Promise"]]],"meta":{"line":351,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"removeRestrictedGuild","description":"Remove a guild from the list of restricted guilds.","params":[{"name":"guildId","description":"The guild to remove","type":[[["GuildIDResolve"]]]}],"returns":[[["Promise"]]],"meta":{"line":366,"file":"ClientUserSettingManager.js","path":"src/managers"}}],"meta":{"line":14,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"DataManager","description":"Manages the API methods of a data model along with a collection of instances.","extends":[[["BaseManager"]]],"abstract":true,"props":[{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of items for this manager.","abstract":true,"type":[[["Collection"]]],"meta":{"line":30,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"resolve","description":"Resolves a data entry to a data Object.","params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Object"]]],"description":"An instance from this Manager","nullable":true},"meta":{"line":39,"file":"DataManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a data entry to an instance id.","params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":50,"file":"DataManager.js","path":"src/managers"}}],"meta":{"line":11,"file":"DataManager.js","path":"src/managers"}},{"name":"GuildBanManager","description":"Manages API methods for GuildBans and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"guild","description":"The guild this Manager belongs to","type":[[["Guild"]]],"meta":{"line":24,"file":"GuildBanManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of this Manager","type":[[["Collection","<"],["Snowflake",", "],["GuildBan",">"]]],"meta":{"line":27,"file":"GuildBanManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"resolve","description":"Resolves a GuildBanResolvable to a GuildBan object.","params":[{"name":"ban","description":"The ban that is in the guild","type":[[["GuildBanResolvable"]]]}],"returns":{"types":[[["GuildBan"]]],"nullable":true},"meta":{"line":49,"file":"GuildBanManager.js","path":"src/managers"}},{"name":"fetch","description":"Fetches ban(s) from Discord.","examples":["// Fetch multiple bans from a guild\nguild.bans.fetch()\n .then(console.log)\n .catch(console.error);","// Fetch a maximum of 5 bans from a guild without caching\nguild.bans.fetch({ limit: 5, cache: false })\n .then(console.log)\n .catch(console.error);","// Fetch a single ban\nguild.bans.fetch('351871113346809860')\n .then(console.log)\n .catch(console.error);","// Fetch a single ban without checking cache\nguild.bans.fetch({ user, force: true })\n .then(console.log)\n .catch(console.error)","// Fetch a single ban without caching\nguild.bans.fetch({ user, cache: false })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for fetching guild ban(s)","optional":true,"type":[[["UserResolvable"]],[["FetchBanOptions"]],[["FetchBansOptions"]]]}],"async":true,"returns":[[["Promise","<("],["GuildBan","|"],["Collection","<"],["Snowflake",", "],["GuildBan",">)>"]]],"meta":{"line":98,"file":"GuildBanManager.js","path":"src/managers"}},{"name":"create","description":"Bans a user from the guild.","examples":["// Ban a user by id (or with a user/guild member object)\nguild.bans.create('84484653687267328')\n .then(banInfo => console.log(`Banned ${banInfo.user?.tag ?? banInfo.tag ?? banInfo}`))\n .catch(console.error);"],"params":[{"name":"user","description":"The user to ban","type":[[["UserResolvable"]]]},{"name":"options","description":"Options for the ban","optional":true,"type":[[["BanOptions"]]]}],"async":true,"returns":{"types":[[["Promise","<("],["GuildMember","|"],["User","|"],["Snowflake",")>"]]],"description":"Result object will be resolved as specifically as possible.\nIf the GuildMember cannot be resolved, the User will instead be attempted to be resolved. If that also cannot\nbe resolved, the user id will be the result."},"meta":{"line":151,"file":"GuildBanManager.js","path":"src/managers"}},{"name":"remove","description":"Unbans a user from the guild.","examples":["// Unban a user by id (or with a user/guild member object)\nguild.bans.remove('84484653687267328')\n .then(user => console.log(`Unbanned ${user.username} from ${guild.name}`))\n .catch(console.error);"],"params":[{"name":"user","description":"The user to unban","type":[[["UserResolvable"]]]},{"name":"reason","description":"Reason for unbanning user","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise",""]]],"meta":{"line":196,"file":"GuildBanManager.js","path":"src/managers"}},{"name":"bulkCreate","description":"Bulk ban users from a guild, and optionally delete previous messages sent by them.","examples":["// Bulk ban users by ids (or with user/guild member objects) and delete all their messages from the past 7 days\nguild.bans.bulkCreate(['84484653687267328'], { deleteMessageSeconds: 7 * 24 * 60 * 60 })\n .then(result => {\n console.log(`Banned ${result.bannedUsers.length} users, failed to ban ${result.failedUsers.length} users.`)\n })\n .catch(console.error);"],"deprecated":"This method will not be usable until an effective MFA implementation is in place.","params":[{"name":"users","description":"The users to ban","type":[[["Collection","<"],["Snowflake",", "],["UserResolvable",">"]],[["Array","<"],["UserResolvable",">"]]]},{"name":"options","description":"The options for bulk banning users","optional":true,"type":[[["BulkBanOptions"]]]}],"async":true,"returns":{"types":[[["Promise","<"],["BulkBanResult",">"]]],"description":"Returns an object with `bannedUsers` key containing the IDs of the banned users\nand the key `failedUsers` with the IDs that could not be banned or were already banned."},"meta":{"line":233,"file":"GuildBanManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a data entry to an instance id.","inherits":"DataManager#resolveId","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":50,"file":"DataManager.js","path":"src/managers"}}],"meta":{"line":16,"file":"GuildBanManager.js","path":"src/managers"}},{"name":"GuildChannelManager","description":"Manages API methods for GuildChannels and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"guild","description":"The guild this Manager belongs to","type":[[["Guild"]]],"meta":{"line":49,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"channelCountWithoutThreads","description":"The number of channels in this managers cache excluding thread channels\nthat do not count towards a guild's maximum channels restriction.","readonly":true,"type":[[["number"]]],"meta":{"line":58,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of this Manager","type":[[["Collection","<"],["Snowflake",", ("],["GuildChannel","|"],["ThreadChannel",")>"]]],"meta":{"line":65,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"resolve","description":"Resolves a GuildChannelResolvable to a Channel object.","params":[{"name":"channel","description":"The GuildChannel resolvable to resolve","type":[[["GuildChannelResolvable"]]]}],"returns":{"types":[[["GuildChannel"]],[["ThreadChannel"]]],"nullable":true},"meta":{"line":91,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a GuildChannelResolvable to a channel id.","params":[{"name":"channel","description":"The GuildChannel resolvable to resolve","type":[[["GuildChannelResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":101,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"create","description":"Creates a new channel in the guild.","examples":["// Create a new text channel\nguild.channels.create('new-general', { reason: 'Needed a cool new channel' })\n .then(console.log)\n .catch(console.error);","// Create a new channel with permission overwrites\nguild.channels.create('new-voice', {\n type: 'GUILD_VOICE',\n permissionOverwrites: [\n {\n id: message.author.id,\n deny: [Permissions.FLAGS.VIEW_CHANNEL],\n },\n ],\n})"],"params":[{"name":"name","description":"The name of the new channel","type":[[["string"]]]},{"name":"options","description":"Options for creating the new channel","optional":true,"default":"{}","type":[[["GuildChannelCreateOptions"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":134,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"createWebhook","description":"Creates a webhook for the channel.","examples":["// Create a webhook for the current channel\nguild.channels.createWebhook('222197033908436994', 'Snek', {\n avatar: 'https://i.imgur.com/mI8XcpG.jpg',\n reason: 'Needed a cool new Webhook'\n})\n .then(console.log)\n .catch(console.error)"],"params":[{"name":"channel","description":"The channel to create the webhook for","type":[[["GuildChannelResolvable"]]]},{"name":"name","description":"The name of the webhook","type":[[["string"]]]},{"name":"options","description":"Options for creating the webhook","optional":true,"type":[[["ChannelWebhookCreateOptions"]]]}],"async":true,"returns":{"types":[[["Promise","<"],["Webhook",">"]]],"description":"Returns the created Webhook"},"meta":{"line":216,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"addFollower","description":"Adds the target channel to a channel's followers.","params":[{"name":"channel","description":"The channel to follow","type":[[["NewsChannel"]],[["Snowflake"]]]},{"name":"targetChannel","description":"The channel where published announcements will be posted at","type":[[["TextChannelResolvable"]]]},{"name":"reason","description":"Reason for creating the webhook","optional":true,"type":[[["string"]]]}],"async":true,"returns":{"types":[[["Promise","<"],["Snowflake",">"]]],"description":"Returns created target webhook id."},"meta":{"line":239,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"edit","description":"Edits the channel.","examples":["// Edit a channel\nguild.channels.edit('222197033908436994', { name: 'new-channel' })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"channel","description":"The channel to edit","type":[[["GuildChannelResolvable"]]]},{"name":"data","description":"The new data for the channel","type":[[["ChannelData"]]]},{"name":"reason","description":"Reason for editing this channel","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":289,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"setPosition","description":"Sets a new position for the guild channel.","examples":["// Set a new channel position\nguild.channels.setPosition('222078374472843266', 2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.error);"],"params":[{"name":"channel","description":"The channel to set the position for","type":[[["GuildChannelResolvable"]]]},{"name":"position","description":"The new position for the guild channel","type":[[["number"]]]},{"name":"options","description":"Options for setting position","optional":true,"type":[[["SetChannelPositionOptions"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":358,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"fetch","description":"Obtains one or more guild channels from Discord, or the channel cache if they're already available.","examples":["// Fetch all channels from the guild (excluding threads)\nmessage.guild.channels.fetch()\n .then(channels => console.log(`There are ${channels.size} channels.`))\n .catch(console.error);","// Fetch a single channel\nmessage.guild.channels.fetch('222197033908436994')\n .then(channel => console.log(`The channel name is: ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"id","description":"The channel's id","optional":true,"type":[[["Snowflake"]]]},{"name":"options","description":"Additional options for this fetch","optional":true,"type":[[["BaseFetchOptions"]]]}],"async":true,"returns":[[["Promise","<(?"],["GuildChannel","|"],["ThreadChannel","|"],["Collection","<"],["Snowflake",", ?"],["GuildChannel",">)>"]]],"meta":{"line":393,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"fetchWebhooks","description":"Fetches all webhooks for the channel.","examples":["// Fetch webhooks\nguild.channels.fetchWebhooks('769862166131245066')\n .then(hooks => console.log(`This channel has ${hooks.size} hooks`))\n .catch(console.error);"],"params":[{"name":"channel","description":"The channel to fetch webhooks for","type":[[["GuildChannelResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Webhook",">>"]]],"meta":{"line":422,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"setPositions","description":"Batch-updates the guild's channels' positions.\nOnly one channel's parent can be changed at a time","examples":["guild.channels.setPositions([{ channel: channelId, position: newChannelIndex }])\n .then(guild => console.log(`Updated channel positions for ${guild}`))\n .catch(console.error);"],"params":[{"name":"channelPositions","description":"Channel positions to update","type":[[["Array","<"],["ChannelPosition",">"]]]}],"async":true,"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":455,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"delete","description":"Deletes the channel.","examples":["// Delete the channel\nguild.channels.delete('858850993013260338', 'making room for new channels')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"channel","description":"The channel to delete","type":[[["GuildChannelResolvable"]]]},{"name":"reason","description":"Reason for deleting this channel","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":481,"file":"GuildChannelManager.js","path":"src/managers"}}],"meta":{"line":30,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"GuildEmojiManager","description":"Manages API methods for GuildEmojis and stores their cache.","extends":[[["BaseGuildEmojiManager"]]],"props":[{"name":"guild","description":"The guild this manager belongs to","type":[[["Guild"]]],"meta":{"line":21,"file":"GuildEmojiManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of GuildEmojis","type":[[["Collection","<"],["Snowflake",", "],["GuildEmoji",">"]]],"meta":{"line":17,"file":"BaseGuildEmojiManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"create","description":"Creates a new custom emoji in the guild.","examples":["// Create a new emoji from a URL\nguild.emojis.create('https://i.imgur.com/w3duR07.png', 'rip')\n .then(emoji => console.log(`Created new emoji with name ${emoji.name}!`))\n .catch(console.error);","// Create a new emoji from a file on your computer\nguild.emojis.create('./memes/banana.png', 'banana')\n .then(emoji => console.log(`Created new emoji with name ${emoji.name}!`))\n .catch(console.error);"],"params":[{"name":"attachment","description":"The image for the emoji","type":[[["BufferResolvable"]],[["Base64Resolvable"]]]},{"name":"name","description":"The name for the emoji","type":[[["string"]]]},{"name":"options","description":"Options for creating the emoji","optional":true,"type":[[["GuildEmojiCreateOptions"]]]}],"async":true,"returns":{"types":[[["Promise","<"],["Emoji",">"]]],"description":"The created emoji"},"meta":{"line":52,"file":"GuildEmojiManager.js","path":"src/managers"}},{"name":"fetch","description":"Obtains one or more emojis from Discord, or the emoji cache if they're already available.","examples":["// Fetch all emojis from the guild\nmessage.guild.emojis.fetch()\n .then(emojis => console.log(`There are ${emojis.size} emojis.`))\n .catch(console.error);","// Fetch a single emoji\nmessage.guild.emojis.fetch('222078108977594368')\n .then(emoji => console.log(`The emoji name is: ${emoji.name}`))\n .catch(console.error);"],"params":[{"name":"id","description":"The emoji's id","optional":true,"type":[[["Snowflake"]]]},{"name":"options","description":"Additional options for this fetch","optional":true,"type":[[["BaseFetchOptions"]]]}],"async":true,"returns":[[["Promise","<("],["GuildEmoji","|"],["Collection","<"],["Snowflake",", "],["GuildEmoji",">)>"]]],"meta":{"line":89,"file":"GuildEmojiManager.js","path":"src/managers"}},{"name":"delete","description":"Deletes an emoji.","params":[{"name":"emoji","description":"The Emoji resolvable to delete","type":[[["EmojiResolvable"]]]},{"name":"reason","description":"Reason for deleting the emoji","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":111,"file":"GuildEmojiManager.js","path":"src/managers"}},{"name":"edit","description":"Edits an emoji.","params":[{"name":"emoji","description":"The Emoji resolvable to edit","type":[[["EmojiResolvable"]]]},{"name":"data","description":"The new data for the emoji","type":[[["GuildEmojiEditData"]]]},{"name":"reason","description":"Reason for editing this emoji","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildEmoji",">"]]],"meta":{"line":124,"file":"GuildEmojiManager.js","path":"src/managers"}},{"name":"fetchAuthor","description":"Fetches the author for this emoji","params":[{"name":"emoji","description":"The emoji to fetch the author of","type":[[["EmojiResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["User",">"]]],"meta":{"line":152,"file":"GuildEmojiManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves an EmojiResolvable to an Emoji object.","inherits":"BaseGuildEmojiManager#resolve","inherited":true,"params":[{"name":"emoji","description":"The Emoji resolvable to identify","type":[[["EmojiResolvable"]]]}],"returns":{"types":[[["GuildEmoji"]]],"nullable":true},"meta":{"line":36,"file":"BaseGuildEmojiManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves an EmojiResolvable to an Emoji id string.","inherits":"BaseGuildEmojiManager#resolveId","inherited":true,"params":[{"name":"emoji","description":"The Emoji resolvable to identify","type":[[["EmojiResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":46,"file":"BaseGuildEmojiManager.js","path":"src/managers"}},{"name":"resolveIdentifier","description":"Resolves an EmojiResolvable to an emoji identifier.","inherits":"BaseGuildEmojiManager#resolveIdentifier","inherited":true,"params":[{"name":"emoji","description":"The emoji resolvable to resolve","type":[[["EmojiIdentifierResolvable"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":64,"file":"BaseGuildEmojiManager.js","path":"src/managers"}}],"meta":{"line":13,"file":"GuildEmojiManager.js","path":"src/managers"}},{"name":"GuildEmojiRoleManager","description":"Manages API methods for roles belonging to emojis and stores their cache.","extends":[[["DataManager"]]],"props":[{"name":"emoji","description":"The emoji belonging to this manager","type":[[["GuildEmoji"]]],"meta":{"line":20,"file":"GuildEmojiRoleManager.js","path":"src/managers"}},{"name":"guild","description":"The guild belonging to this manager","type":[[["Guild"]]],"meta":{"line":25,"file":"GuildEmojiRoleManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of roles belonging to this emoji","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["Role",">"]]],"meta":{"line":33,"file":"GuildEmojiRoleManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"add","description":"Adds a role (or multiple roles) to the list of roles that can use this emoji.","params":[{"name":"roleOrRoles","description":"The role or roles to add","type":[[["RoleResolvable"]],[["Array","<"],["RoleResolvable",">"]],[["Collection","<"],["Snowflake",", "],["Role",">"]]]}],"async":true,"returns":[[["Promise","<"],["GuildEmoji",">"]]],"meta":{"line":42,"file":"GuildEmojiRoleManager.js","path":"src/managers"}},{"name":"remove","description":"Removes a role (or multiple roles) from the list of roles that can use this emoji.","params":[{"name":"roleOrRoles","description":"The role or roles to remove","type":[[["RoleResolvable"]],[["Array","<"],["RoleResolvable",">"]],[["Collection","<"],["Snowflake",", "],["Role",">"]]]}],"async":true,"returns":[[["Promise","<"],["GuildEmoji",">"]]],"meta":{"line":63,"file":"GuildEmojiRoleManager.js","path":"src/managers"}},{"name":"set","description":"Sets the role(s) that can use this emoji.","examples":["// Set the emoji's roles to a single role\nguildEmoji.roles.set(['391156570408615936'])\n .then(console.log)\n .catch(console.error);","// Remove all roles from an emoji\nguildEmoji.roles.set([])\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"roles","description":"The roles or role ids to apply","type":[[["Collection","<"],["Snowflake",", "],["Role",">"]],[["Array","<"],["RoleResolvable",">"]]]}],"returns":[[["Promise","<"],["GuildEmoji",">"]]],"meta":{"line":94,"file":"GuildEmojiRoleManager.js","path":"src/managers"}},{"name":"_patch","description":"Patches the roles for this manager's cache","access":"private","params":[{"name":"roles","description":"The new roles","type":[[["Array","<"],["Snowflake",">"]]]}],"meta":{"line":109,"file":"GuildEmojiRoleManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a data entry to a data Object.","inherits":"DataManager#resolve","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Object"]]],"description":"An instance from this Manager","nullable":true},"meta":{"line":39,"file":"DataManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a data entry to an instance id.","inherits":"DataManager#resolveId","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":50,"file":"DataManager.js","path":"src/managers"}}],"meta":{"line":12,"file":"GuildEmojiRoleManager.js","path":"src/managers"}},{"name":"GuildForumThreadManager","description":"Manages API methods for threads in forum channels and stores their cache.","extends":[[["ThreadManager"]]],"props":[{"name":"channel","description":"The channel this Manager belongs to","type":[[["ForumChannel"]],[["MediaChannel"]]],"meta":{"line":13,"file":"GuildForumThreadManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of this Manager","type":[[["Collection","<"],["Snowflake",", "],["ThreadChannel",">"]]],"meta":{"line":22,"file":"ThreadManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"create","description":"Creates a new thread in the channel.","examples":["// Create a new forum post\nforum.threads\n .create({\n name: 'Food Talk',\n autoArchiveDuration: 60,\n message: {\n content: 'Discuss your favorite food!',\n },\n reason: 'Needed a separate thread for food',\n })\n .then(threadChannel => console.log(threadChannel))\n .catch(console.error);"],"params":[{"name":"options","description":"Options to create a new thread","optional":true,"type":[[["GuildForumThreadCreateOptions"]]]}],"async":true,"returns":[[["Promise","<"],["ThreadChannel",">"]]],"meta":{"line":51,"file":"GuildForumThreadManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a {@link ThreadChannelResolvable} to a {@link ThreadChannel} object.","inherits":"ThreadManager#resolve","inherited":true,"params":[{"name":"thread","description":"The ThreadChannel resolvable to resolve","type":[[["ThreadChannelResolvable"]]]}],"returns":{"types":[[["ThreadChannel"]]],"nullable":true},"meta":{"line":42,"file":"ThreadManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a {@link ThreadChannelResolvable} to a {@link ThreadChannel} id.","inherits":"ThreadManager#resolveId","inherited":true,"params":[{"name":"thread","description":"The ThreadChannel resolvable to resolve","type":[[["ThreadChannelResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":51,"file":"ThreadManager.js","path":"src/managers"}},{"name":"fetch","description":"Obtains a thread from Discord, or the channel cache if it's already available.","inherits":"ThreadManager#fetch","inherited":true,"examples":["// Fetch a thread by its id\nchannel.threads.fetch('831955138126104859')\n .then(channel => console.log(channel.name))\n .catch(console.error);"],"params":[{"name":"options","description":"The options to fetch threads. If it is a\nThreadChannelResolvable then the specified thread will be fetched. Fetches all active threads if `undefined`","optional":true,"type":[[["ThreadChannelResolvable"]],[["FetchChannelThreadsOptions"]],[["FetchThreadsOptions"]]]},{"name":"cacheOptions","description":"Additional options for this fetch. The `force` field gets ignored\nif `options` is not a {@link ThreadChannelResolvable}","optional":true,"type":[[["BaseFetchOptions"]]]}],"returns":[[["Promise",""]]],"meta":{"line":79,"file":"ThreadManager.js","path":"src/managers"}},{"name":"fetchArchived","description":"Obtains a set of archived threads from Discord, requires `READ_MESSAGE_HISTORY` in the parent channel.","inherits":"ThreadManager#fetchArchived","inherited":true,"params":[{"name":"options","description":"The options to fetch archived threads","optional":true,"type":[[["FetchChannelThreadsOptions"]]]},{"name":"cache","description":"Whether to cache the new thread objects if they aren't already","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["FetchedThreads",">"]]],"meta":{"line":121,"file":"ThreadManager.js","path":"src/managers"}},{"name":"fetchActive","description":"Obtains the accessible active threads from Discord, requires `READ_MESSAGE_HISTORY` in the parent channel.","inherits":"ThreadManager#fetchActive","inherited":true,"params":[{"name":"cache","description":"Whether to cache the new thread objects if they aren't already","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"options","description":"Options for self-bots where advanced users can specify further options","optional":true,"type":[[["FetchChannelThreadsOptions"]]]}],"async":true,"returns":[[["Promise","<"],["FetchedThreads",">"]]],"meta":{"line":141,"file":"ThreadManager.js","path":"src/managers"}}],"meta":{"line":12,"file":"GuildForumThreadManager.js","path":"src/managers"}},{"name":"GuildInviteManager","description":"Manages API methods for GuildInvites and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"guild","description":"The guild this Manager belongs to","type":[[["Guild"]]],"meta":{"line":21,"file":"GuildInviteManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of this Manager","type":[[["Collection","<"],["string",", "],["Invite",">"]]],"meta":{"line":24,"file":"GuildInviteManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"resolve","description":"Resolves an InviteResolvable to an Invite object.","params":[{"name":"invite","description":"The invite resolvable to resolve","type":[[["InviteResolvable"]]]}],"returns":{"types":[[["Invite"]]],"nullable":true},"meta":{"line":53,"file":"GuildInviteManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves an InviteResolvable to an invite code string.","params":[{"name":"invite","description":"The invite resolvable to resolve","type":[[["InviteResolvable"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":62,"file":"GuildInviteManager.js","path":"src/managers"}},{"name":"fetch","description":"Fetches invite(s) from Discord.","examples":["// Fetch all invites from a guild\nguild.invites.fetch()\n .then(console.log)\n .catch(console.error);","// Fetch all invites from a guild without caching\nguild.invites.fetch({ cache: false })\n .then(console.log)\n .catch(console.error);","// Fetch all invites from a channel\nguild.invites.fetch({ channelId: '222197033908436994' })\n .then(console.log)\n .catch(console.error);","// Fetch a single invite\nguild.invites.fetch('bRCvFy9')\n .then(console.log)\n .catch(console.error);","// Fetch a single invite without checking cache\nguild.invites.fetch({ code: 'bRCvFy9', force: true })\n .then(console.log)\n .catch(console.error)","// Fetch a single invite without caching\nguild.invites.fetch({ code: 'bRCvFy9', cache: false })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for fetching guild invite(s)","optional":true,"type":[[["InviteResolvable"]],[["FetchInviteOptions"]],[["FetchInvitesOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Invite","|"],["Collection","<"],["string",", "],["Invite",">)>"]]],"meta":{"line":122,"file":"GuildInviteManager.js","path":"src/managers"}},{"name":"create","description":"Create an invite to the guild from the provided channel.","examples":["// Create an invite to a selected channel\nguild.invites.create('599942732013764608')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"channel","description":"The options for creating the invite from a channel.","type":[[["GuildInvitableChannelResolvable"]]]},{"name":"options","description":"The options for creating the invite from a channel.","optional":true,"default":"{}","type":[[["CreateInviteOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Invite",">"]]],"meta":{"line":178,"file":"GuildInviteManager.js","path":"src/managers"}},{"name":"delete","description":"Deletes an invite.","params":[{"name":"invite","description":"The invite to delete","type":[[["InviteResolvable"]]]},{"name":"reason","description":"Reason for deleting the invite","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":206,"file":"GuildInviteManager.js","path":"src/managers"}}],"meta":{"line":13,"file":"GuildInviteManager.js","path":"src/managers"}},{"name":"GuildManager","description":"Manages API methods for Guilds and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"cache","description":"The cache of this Manager","type":[[["Collection","<"],["Snowflake",", "],["Guild",">"]]],"meta":{"line":47,"file":"GuildManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"resolve","description":"Resolves a GuildResolvable to a Guild object.","params":[{"name":"guild","description":"The guild resolvable to identify","type":[[["GuildResolvable"]]]}],"returns":{"types":[[["Guild"]]],"nullable":true},"meta":{"line":105,"file":"GuildManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a {@link GuildResolvable} to a {@link Guild} id string.","params":[{"name":"guild","description":"The guild resolvable to identify","type":[[["GuildResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":126,"file":"GuildManager.js","path":"src/managers"}},{"name":"create","description":"Creates a guild.","params":[{"name":"name","description":"The name of the guild","type":[[["string"]]]},{"name":"options","description":"Options for creating the guild","optional":true,"type":[[["GuildCreateOptions"]]]}],"async":true,"returns":{"types":[[["Promise","<"],["Guild",">"]]],"description":"The guild that was created"},"meta":{"line":170,"file":"GuildManager.js","path":"src/managers"}},{"name":"fetch","description":"Obtains one or multiple guilds from Discord, or the guild cache if it's already available.","params":[{"name":"options","description":"The guild's id or options","optional":true,"type":[[["GuildResolvable"]],[["FetchGuildOptions"]],[["FetchGuildsOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Guild","|"],["Collection","<"],["Snowflake",", "],["OAuth2Guild",">)>"]]],"meta":{"line":287,"file":"GuildManager.js","path":"src/managers"}},{"name":"setIncidentActions","description":"Sets the incident actions for a guild.","params":[{"name":"guild","description":"The guild","type":[[["GuildResolvable"]]]},{"name":"incidentActions","description":"The incident actions to set","type":[[["IncidentActionsEditOptions"]]]}],"async":true,"returns":[[["Promise","<"],["IncidentActions",">"]]],"meta":{"line":317,"file":"GuildManager.js","path":"src/managers"}}],"meta":{"line":35,"file":"GuildManager.js","path":"src/managers"}},{"name":"GuildMemberManager","description":"Manages API methods for GuildMembers and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"guild","description":"The guild this manager belongs to","type":[[["Guild"]]],"meta":{"line":30,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of this Manager","type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":33,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"me","description":"The client user as a GuildMember of this guild","readonly":true,"nullable":true,"type":[[["GuildMember"]]],"meta":{"line":130,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"resolve","description":"Resolves a {@link GuildMemberResolvable} to a {@link GuildMember} object.","params":[{"name":"member","description":"The user that is part of the guild","type":[[["GuildMemberResolvable"]]]}],"returns":{"types":[[["GuildMember"]]],"nullable":true},"meta":{"line":55,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a {@link GuildMemberResolvable} to a member id.","params":[{"name":"member","description":"The user that is part of the guild","type":[[["GuildMemberResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":68,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"add","description":"Adds a user to the guild using OAuth2. Requires the `CREATE_INSTANT_INVITE` permission.","params":[{"name":"user","description":"The user to add to the guild","type":[[["UserResolvable"]]]},{"name":"options","description":"Options for adding the user to the guild","type":[[["AddGuildMemberOptions"]]]}],"async":true,"returns":[[["Promise","<("],["GuildMember","|"],["null",")>"]]],"meta":{"line":95,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"fetch","description":"Fetches member(s) from Discord, even if they're offline.","examples":["// Fetch all members from a guild\nguild.members.fetch()\n .then(console.log)\n .catch(console.error);","// Fetch a single member\nguild.members.fetch('66564597481480192')\n .then(console.log)\n .catch(console.error);","// Fetch a single member without checking cache\nguild.members.fetch({ user, force: true })\n .then(console.log)\n .catch(console.error)","// Fetch a single member without caching\nguild.members.fetch({ user, cache: false })\n .then(console.log)\n .catch(console.error);","// Fetch by an array of users including their presences\nguild.members.fetch({ user: ['66564597481480192', '191615925336670208'], withPresences: true })\n .then(console.log)\n .catch(console.error);","// Fetch by query\nguild.members.fetch({ query: 'hydra', limit: 1 })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"If a UserResolvable, the user to fetch.\nIf undefined, fetches all members.\nIf a query, it limits the results to users with similar usernames.","optional":true,"type":[[["UserResolvable"]],[["FetchMemberOptions"]],[["FetchMembersOptions"]]]}],"returns":[[["Promise","<("],["GuildMember","|"],["Collection","<"],["Snowflake",", "],["GuildMember",">)>"]]],"meta":{"line":194,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"fetchMe","description":"Fetches the client user as a GuildMember of the guild.","params":[{"name":"options","description":"The options for fetching the member","optional":true,"type":[[["BaseFetchOptions"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":225,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"search","description":"Searches for members in the guild based on a query.","params":[{"name":"options","description":"Options for searching members","type":[[["GuildSearchMembersOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["GuildMember",">>"]]],"meta":{"line":242,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"edit","description":"Edits a member of the guild.\nThe user must be a member of the guild","params":[{"name":"user","description":"The member to edit","type":[[["UserResolvable"]]]},{"name":"data","description":"The data to edit the member with","type":[[["GuildMemberEditData"]]]},{"name":"reason","description":"Reason for editing this user","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":272,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"prune","description":"Prunes members from the guild based on how long they have been inactive.","examples":["// See how many members will be pruned\nguild.members.prune({ dry: true })\n .then(pruned => console.log(`This will prune ${pruned} people!`))\n .catch(console.error);","// Actually prune the members\nguild.members.prune({ days: 1, reason: 'too many people!' })\n .then(pruned => console.log(`I just pruned ${pruned} people!`))\n .catch(console.error);","// Include members with a specified role\nguild.members.prune({ days: 7, roles: ['657259391652855808'] })\n .then(pruned => console.log(`I just pruned ${pruned} people!`))\n .catch(console.error);"],"params":[{"name":"options","description":"Options for pruning","optional":true,"type":[[["GuildPruneMembersOptions"]]]}],"async":true,"returns":{"types":[[["Promise","<("],["number","|"],["null",")>"]]],"description":"The number of members that were/will be kicked"},"meta":{"line":354,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"kick","description":"Kicks a user from the guild.\nThe user must be a member of the guild","examples":["// Kick a user by id (or with a user/guild member object)\nguild.members.kick('84484653687267328')\n .then(kickInfo => console.log(`Kicked ${kickInfo.user?.tag ?? kickInfo.tag ?? kickInfo}`))\n .catch(console.error);"],"params":[{"name":"user","description":"The member to kick","type":[[["UserResolvable"]]]},{"name":"reason","description":"Reason for kicking","optional":true,"type":[[["string"]]]}],"async":true,"returns":{"types":[[["Promise","<("],["GuildMember","|"],["User","|"],["Snowflake",")>"]]],"description":"Result object will be resolved as specifically as possible.\nIf the GuildMember cannot be resolved, the User will instead be attempted to be resolved. If that also cannot\nbe resolved, the user's id will be the result."},"meta":{"line":395,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"ban","description":"Bans a user from the guild.","examples":["// Ban a user by id (or with a user/guild member object)\nguild.members.ban('84484653687267328')\n .then(banInfo => console.log(`Banned ${banInfo.user?.tag ?? banInfo.tag ?? banInfo}`))\n .catch(console.error);"],"params":[{"name":"user","description":"The user to ban","type":[[["UserResolvable"]]]},{"name":"options","description":"Options for the ban","optional":true,"type":[[["BanOptions"]]]}],"returns":{"types":[[["Promise","<("],["GuildMember","|"],["User","|"],["Snowflake",")>"]]],"description":"Result object will be resolved as specifically as possible.\nIf the GuildMember cannot be resolved, the User will instead be attempted to be resolved. If that also cannot\nbe resolved, the user id will be the result.\nInternally calls the GuildBanManager#create method."},"meta":{"line":418,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"unban","description":"Unbans a user from the guild. Internally calls the {@link GuildBanManager#remove} method.","examples":["// Unban a user by id (or with a user/guild member object)\nguild.members.unban('84484653687267328')\n .then(user => console.log(`Unbanned ${user.username} from ${guild.name}`))\n .catch(console.error);"],"params":[{"name":"user","description":"The user to unban","type":[[["UserResolvable"]]]},{"name":"reason","description":"Reason for unbanning user","optional":true,"type":[[["string"]]]}],"returns":{"types":[[["Promise",""]]],"description":"The user that was unbanned"},"meta":{"line":433,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"addRole","description":"Adds a role to a member.","params":[{"name":"user","description":"The user to add the role from","type":[[["GuildMemberResolvable"]]]},{"name":"role","description":"The role to add","type":[[["RoleResolvable"]]]},{"name":"reason","description":"Reason for adding the role","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<("],["GuildMember","|"],["User","|"],["Snowflake",")>"]]],"meta":{"line":454,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"removeRole","description":"Removes a role from a member.","params":[{"name":"user","description":"The user to remove the role from","type":[[["UserResolvable"]]]},{"name":"role","description":"The role to remove","type":[[["RoleResolvable"]]]},{"name":"reason","description":"Reason for removing the role","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<("],["GuildMember","|"],["User","|"],["Snowflake",")>"]]],"meta":{"line":470,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"fetchByMemberSafety","description":"Experimental method to fetch members from the guild.\nLists up to 10000 members of the guild.","params":[{"name":"timeout","description":"Timeout for receipt of members in ms","optional":true,"default":"15_000","type":[[["number"]]]}],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["GuildMember",">>"]]],"meta":{"line":485,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"bulkBan","description":"Bulk ban users from a guild, and optionally delete previous messages sent by them.","examples":["// Bulk ban users by ids (or with user/guild member objects) and delete all their messages from the past 7 days\nguild.members.bulkBan(['84484653687267328'], { deleteMessageSeconds: 7 * 24 * 60 * 60 })\n .then(result => {\n console.log(`Banned ${result.bannedUsers.length} users, failed to ban ${result.failedUsers.length} users.`)\n })\n .catch(console.error);"],"deprecated":"This method will not be usable until an effective MFA implementation is in place.","params":[{"name":"users","description":"The users to ban","type":[[["Collection","<"],["Snowflake",", "],["UserResolvable",">"]],[["Array","<"],["UserResolvable",">"]]]},{"name":"options","description":"The options for bulk banning users","optional":true,"type":[[["BulkBanOptions"]]]}],"returns":{"types":[[["Promise","<"],["BulkBanResult",">"]]],"description":"Returns an object with `bannedUsers` key containing the IDs of the banned users\nand the key `failedUsers` with the IDs that could not be banned or were already banned.\nInternally calls the GuildBanManager#bulkCreate method."},"meta":{"line":594,"file":"GuildMemberManager.js","path":"src/managers"}}],"meta":{"line":22,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"GuildMemberRoleManager","description":"Manages API methods for roles of a GuildMember and stores their cache.","extends":[[["DataManager"]]],"props":[{"name":"member","description":"The GuildMember this manager belongs to","type":[[["GuildMember"]]],"meta":{"line":20,"file":"GuildMemberRoleManager.js","path":"src/managers"}},{"name":"guild","description":"The Guild this manager belongs to","type":[[["Guild"]]],"meta":{"line":26,"file":"GuildMemberRoleManager.js","path":"src/managers"}},{"name":"cache","description":"The roles of this member","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["Role",">"]]],"meta":{"line":34,"file":"GuildMemberRoleManager.js","path":"src/managers"}},{"name":"hoist","description":"The role of the member used to hoist them in a separate category in the users list","readonly":true,"nullable":true,"type":[[["Role"]]],"meta":{"line":44,"file":"GuildMemberRoleManager.js","path":"src/managers"}},{"name":"icon","description":"The role of the member used to set their role icon","readonly":true,"nullable":true,"type":[[["Role"]]],"meta":{"line":55,"file":"GuildMemberRoleManager.js","path":"src/managers"}},{"name":"color","description":"The role of the member used to set their color","readonly":true,"nullable":true,"type":[[["Role"]]],"meta":{"line":66,"file":"GuildMemberRoleManager.js","path":"src/managers"}},{"name":"highest","description":"The role of the member with the highest position","readonly":true,"type":[[["Role"]]],"meta":{"line":77,"file":"GuildMemberRoleManager.js","path":"src/managers"}},{"name":"premiumSubscriberRole","description":"The premium subscriber role of the guild, if present on the member","readonly":true,"nullable":true,"type":[[["Role"]]],"meta":{"line":86,"file":"GuildMemberRoleManager.js","path":"src/managers"}},{"name":"botRole","description":"The managed role this member created when joining the guild, if any\nOnly ever available on bots","readonly":true,"nullable":true,"type":[[["Role"]]],"meta":{"line":96,"file":"GuildMemberRoleManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"add","description":"Adds a role (or multiple roles) to the member.\n\nUses the idempotent PUT route for singular roles, otherwise PATCHes the underlying guild member","params":[{"name":"roleOrRoles","description":"The role or roles to add","type":[[["RoleResolvable"]],[["Array","<"],["RoleResolvable",">"]],[["Collection","<"],["Snowflake",", "],["Role",">"]]]},{"name":"reason","description":"Reason for adding the role(s)","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":109,"file":"GuildMemberRoleManager.js","path":"src/managers"}},{"name":"remove","description":"Removes a role (or multiple roles) from the member.\n\nUses the idempotent DELETE route for singular roles, otherwise PATCHes the underlying guild member","params":[{"name":"roleOrRoles","description":"The role or roles to remove","type":[[["RoleResolvable"]],[["Array","<"],["RoleResolvable",">"]],[["Collection","<"],["Snowflake",", "],["Role",">"]]]},{"name":"reason","description":"Reason for removing the role(s)","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":142,"file":"GuildMemberRoleManager.js","path":"src/managers"}},{"name":"set","description":"Sets the roles applied to the member.","examples":["// Set the member's roles to a single role\nguildMember.roles.set(['391156570408615936'])\n .then(console.log)\n .catch(console.error);","// Remove all the roles from a member\nguildMember.roles.set([])\n .then(member => console.log(`Member roles is now of ${member.roles.cache.size} size`))\n .catch(console.error);"],"params":[{"name":"roles","description":"The roles or role ids to apply","type":[[["Collection","<"],["Snowflake",", "],["Role",">"]],[["Array","<"],["RoleResolvable",">"]]]},{"name":"reason","description":"Reason for applying the roles","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":184,"file":"GuildMemberRoleManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a data entry to a data Object.","inherits":"DataManager#resolve","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Object"]]],"description":"An instance from this Manager","nullable":true},"meta":{"line":39,"file":"DataManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a data entry to an instance id.","inherits":"DataManager#resolveId","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":50,"file":"DataManager.js","path":"src/managers"}}],"meta":{"line":12,"file":"GuildMemberRoleManager.js","path":"src/managers"}},{"name":"GuildScheduledEventManager","description":"Manages API methods for GuildScheduledEvents and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"guild","description":"The guild this manager belongs to","type":[[["Guild"]]],"meta":{"line":23,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of this manager","type":[[["Collection","<"],["Snowflake",", "],["GuildScheduledEvent",">"]]],"meta":{"line":26,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"create","description":"Creates a new guild scheduled event.","params":[{"name":"options","description":"Options for creating the guild scheduled event","type":[[["GuildScheduledEventCreateOptions"]]]}],"async":true,"returns":[[["Promise","<"],["GuildScheduledEvent",">"]]],"meta":{"line":84,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"fetch","description":"Obtains one or more guild scheduled events from Discord, or the guild cache if it's already available.","params":[{"name":"options","description":"The id of the guild scheduled event or options","optional":true,"type":[[["GuildScheduledEventResolvable"]],[["FetchGuildScheduledEventOptions"]],[["FetchGuildScheduledEventsOptions"]]]}],"async":true,"returns":[[["Promise","<("],["GuildScheduledEvent","|"],["Collection","<"],["Snowflake",", "],["GuildScheduledEvent",">)>"]]],"meta":{"line":153,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"edit","description":"Edits a guild scheduled event.","params":[{"name":"guildScheduledEvent","description":"The guild scheduled event to edit","type":[[["GuildScheduledEventResolvable"]]]},{"name":"options","description":"Options to edit the guild scheduled event","type":[[["GuildScheduledEventEditOptions"]]]}],"async":true,"returns":[[["Promise","<"],["GuildScheduledEvent",">"]]],"meta":{"line":205,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"delete","description":"Deletes a guild scheduled event.","params":[{"name":"guildScheduledEvent","description":"The guild scheduled event to delete","type":[[["GuildScheduledEventResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":261,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"fetchSubscribers","description":"Fetches subscribers of a guild scheduled event.","params":[{"name":"guildScheduledEvent","description":"The guild scheduled event to fetch subscribers of","type":[[["GuildScheduledEventResolvable"]]]},{"name":"options","description":"Options for fetching the subscribers","optional":true,"default":"{}","type":[[["FetchGuildScheduledEventSubscribersOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["GuildScheduledEventUser",">>"]]],"meta":{"line":292,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a data entry to a data Object.","inherits":"DataManager#resolve","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Object"]]],"description":"An instance from this Manager","nullable":true},"meta":{"line":39,"file":"DataManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a data entry to an instance id.","inherits":"DataManager#resolveId","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":50,"file":"DataManager.js","path":"src/managers"}}],"meta":{"line":15,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"GuildSettingManager","description":"Manages API methods for users and stores their cache.","see":["{@link https://luna.gitlab.io/discord-unofficial-docs/user_settings.html}"],"extends":[[["BaseManager"]]],"props":[{"name":"guildId","description":"Guild Id","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":17,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"raw","description":"Raw data","type":[[["Object"]]],"meta":{"line":24,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"guild","description":"Get the guild","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":33,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"suppressEveryone","description":"Notification setting > Suppress `@everyone` and `@here`","nullable":true,"type":[[["boolean"]]],"meta":{"line":50,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"suppressRoles","description":"Notification setting > Suppress all role `@mention`","nullable":true,"type":[[["boolean"]]],"meta":{"line":57,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"muteScheduledEvents","description":"Notification setting > Mute new events","nullable":true,"type":[[["boolean"]]],"meta":{"line":64,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"messageNotifications","description":"Notification setting > Message notifications\n* `0`: All messages\n* `1`: Only @mentions\n* `2`: Nothing","nullable":true,"type":[[["number"]]],"meta":{"line":74,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"flags","description":"Flags (unknown)","nullable":true,"type":[[["number"]]],"meta":{"line":81,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"mobilePush","description":"Notification setting > Mobile push notifications","nullable":true,"type":[[["boolean"]]],"meta":{"line":88,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"muted","description":"Mute server","nullable":true,"type":[[["boolean"]]],"meta":{"line":95,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"muteConfig","description":"Mute config (muted = true)\n* `muteConfig.endTime`: End time (Date)\n* `muteConfig.selectedTimeWindow`: Selected time window (seconds) (number)","nullable":true,"type":[[["Object"]]],"meta":{"line":104,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"hideMutedChannels","description":"Hide muted channels","nullable":true,"type":[[["boolean"]]],"meta":{"line":116,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"channelOverrides","description":"Channel overrides (unknown)","nullable":true,"type":[[["Array"]]],"meta":{"line":123,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"notifyHighlights","description":"Notification setting > Suppress highlights\n* `0`: ??? (unknown)\n* `1`: Enable\n* `2`: Disable","nullable":true,"type":[[["number"]]],"meta":{"line":133,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"version","description":"Version (unknown)","nullable":true,"type":[[["number"]]],"meta":{"line":140,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"_patch","description":"Patch data file","access":"private","params":[{"name":"data","description":"Raw Data to patch","type":[[["Object"]]]}],"meta":{"line":42,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"edit","description":"Edit guild settings","params":[{"name":"data","description":"Data to edit","type":[[["Object"]]]}],"async":true,"returns":[[["Promise","<"],["GuildSettingManager",">"]]],"meta":{"line":148,"file":"GuildSettingManager.js","path":"src/managers"}}],"meta":{"line":9,"file":"GuildSettingManager.js","path":"src/managers"}},{"name":"GuildStickerManager","description":"Manages API methods for Guild Stickers and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"guild","description":"The guild this manager belongs to","type":[[["Guild"]]],"meta":{"line":21,"file":"GuildStickerManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of Guild Stickers","type":[[["Collection","<"],["Snowflake",", "],["Sticker",">"]]],"meta":{"line":24,"file":"GuildStickerManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"create","description":"Creates a new custom sticker in the guild.","examples":["// Create a new sticker from a URL\nguild.stickers.create('https://i.imgur.com/w3duR07.png', 'rip', 'headstone')\n .then(sticker => console.log(`Created new sticker with name ${sticker.name}!`))\n .catch(console.error);","// Create a new sticker from a file on your computer\nguild.stickers.create('./memes/banana.png', 'banana', 'banana')\n .then(sticker => console.log(`Created new sticker with name ${sticker.name}!`))\n .catch(console.error);"],"params":[{"name":"file","description":"The file for the sticker","type":[[["BufferResolvable"]],[["Stream"]],[["FileOptions"]],[["MessageAttachment"]]]},{"name":"name","description":"The name for the sticker","type":[[["string"]]]},{"name":"tags","description":"The Discord name of a unicode emoji representing the sticker's expression","type":[[["string"]]]},{"name":"options","description":"Options","optional":true,"type":[[["GuildStickerCreateOptions"]]]}],"async":true,"returns":{"types":[[["Promise","<"],["Sticker",">"]]],"description":"The created sticker"},"meta":{"line":59,"file":"GuildStickerManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a StickerResolvable to a Sticker object.","params":[{"name":"sticker","description":"The Sticker resolvable to identify","type":[[["StickerResolvable"]]]}],"returns":{"types":[[["Sticker"]]],"nullable":true},"meta":{"line":79,"file":"GuildStickerManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a StickerResolvable to a Sticker id string.","params":[{"name":"sticker","description":"The Sticker resolvable to identify","type":[[["StickerResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":88,"file":"GuildStickerManager.js","path":"src/managers"}},{"name":"edit","description":"Edits a sticker.","params":[{"name":"sticker","description":"The sticker to edit","type":[[["StickerResolvable"]]]},{"name":"data","description":"The new data for the sticker","optional":true,"type":[[["GuildStickerEditData"]]]},{"name":"reason","description":"Reason for editing this sticker","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Sticker",">"]]],"meta":{"line":104,"file":"GuildStickerManager.js","path":"src/managers"}},{"name":"delete","description":"Deletes a sticker.","params":[{"name":"sticker","description":"The sticker to delete","type":[[["StickerResolvable"]]]},{"name":"reason","description":"Reason for deleting this sticker","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":128,"file":"GuildStickerManager.js","path":"src/managers"}},{"name":"fetch","description":"Obtains one or more stickers from Discord, or the sticker cache if they're already available.","examples":["// Fetch all stickers from the guild\nmessage.guild.stickers.fetch()\n .then(stickers => console.log(`There are ${stickers.size} stickers.`))\n .catch(console.error);","// Fetch a single sticker\nmessage.guild.stickers.fetch('222078108977594368')\n .then(sticker => console.log(`The sticker name is: ${sticker.name}`))\n .catch(console.error);"],"params":[{"name":"id","description":"The Sticker's id","optional":true,"type":[[["Snowflake"]]]},{"name":"options","description":"Additional options for this fetch","optional":true,"type":[[["BaseFetchOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Sticker","|"],["Collection","<"],["Snowflake",", "],["Sticker",">)>"]]],"meta":{"line":151,"file":"GuildStickerManager.js","path":"src/managers"}},{"name":"fetchUser","description":"Fetches the user who uploaded this sticker, if this is a guild sticker.","params":[{"name":"sticker","description":"The sticker to fetch the user for","type":[[["StickerResolvable"]]]}],"async":true,"returns":[[["Promise",""]]],"meta":{"line":170,"file":"GuildStickerManager.js","path":"src/managers"}}],"meta":{"line":13,"file":"GuildStickerManager.js","path":"src/managers"}},{"name":"GuildTextThreadManager","description":"Manages API methods for {@link ThreadChannel} objects and stores their cache.","extends":[[["ThreadManager"]]],"props":[{"name":"channel","description":"The channel this Manager belongs to","type":[[["TextChannel"]],[["NewsChannel"]]],"meta":{"line":13,"file":"GuildTextThreadManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of this Manager","type":[[["Collection","<"],["Snowflake",", "],["ThreadChannel",">"]]],"meta":{"line":22,"file":"ThreadManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"create","description":"Creates a new thread in the channel.","examples":["// Create a new public thread\nchannel.threads\n .create({\n name: 'food-talk',\n autoArchiveDuration: 60,\n reason: 'Needed a separate thread for food',\n })\n .then(threadChannel => console.log(threadChannel))\n .catch(console.error);","// Create a new private thread\nchannel.threads\n .create({\n name: 'mod-talk',\n autoArchiveDuration: 60,\n type: 'GUILD_PRIVATE_THREAD',\n reason: 'Needed a separate thread for moderation',\n })\n .then(threadChannel => console.log(threadChannel))\n .catch(console.error);"],"params":[{"name":"options","description":"Options to create a new thread","optional":true,"type":[[["GuildTextThreadCreateOptions"]]]}],"async":true,"returns":[[["Promise","<"],["ThreadChannel",">"]]],"meta":{"line":58,"file":"GuildTextThreadManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a {@link ThreadChannelResolvable} to a {@link ThreadChannel} object.","inherits":"ThreadManager#resolve","inherited":true,"params":[{"name":"thread","description":"The ThreadChannel resolvable to resolve","type":[[["ThreadChannelResolvable"]]]}],"returns":{"types":[[["ThreadChannel"]]],"nullable":true},"meta":{"line":42,"file":"ThreadManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a {@link ThreadChannelResolvable} to a {@link ThreadChannel} id.","inherits":"ThreadManager#resolveId","inherited":true,"params":[{"name":"thread","description":"The ThreadChannel resolvable to resolve","type":[[["ThreadChannelResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":51,"file":"ThreadManager.js","path":"src/managers"}},{"name":"fetch","description":"Obtains a thread from Discord, or the channel cache if it's already available.","inherits":"ThreadManager#fetch","inherited":true,"examples":["// Fetch a thread by its id\nchannel.threads.fetch('831955138126104859')\n .then(channel => console.log(channel.name))\n .catch(console.error);"],"params":[{"name":"options","description":"The options to fetch threads. If it is a\nThreadChannelResolvable then the specified thread will be fetched. Fetches all active threads if `undefined`","optional":true,"type":[[["ThreadChannelResolvable"]],[["FetchChannelThreadsOptions"]],[["FetchThreadsOptions"]]]},{"name":"cacheOptions","description":"Additional options for this fetch. The `force` field gets ignored\nif `options` is not a {@link ThreadChannelResolvable}","optional":true,"type":[[["BaseFetchOptions"]]]}],"returns":[[["Promise",""]]],"meta":{"line":79,"file":"ThreadManager.js","path":"src/managers"}},{"name":"fetchArchived","description":"Obtains a set of archived threads from Discord, requires `READ_MESSAGE_HISTORY` in the parent channel.","inherits":"ThreadManager#fetchArchived","inherited":true,"params":[{"name":"options","description":"The options to fetch archived threads","optional":true,"type":[[["FetchChannelThreadsOptions"]]]},{"name":"cache","description":"Whether to cache the new thread objects if they aren't already","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["FetchedThreads",">"]]],"meta":{"line":121,"file":"ThreadManager.js","path":"src/managers"}},{"name":"fetchActive","description":"Obtains the accessible active threads from Discord, requires `READ_MESSAGE_HISTORY` in the parent channel.","inherits":"ThreadManager#fetchActive","inherited":true,"params":[{"name":"cache","description":"Whether to cache the new thread objects if they aren't already","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"options","description":"Options for self-bots where advanced users can specify further options","optional":true,"type":[[["FetchChannelThreadsOptions"]]]}],"async":true,"returns":[[["Promise","<"],["FetchedThreads",">"]]],"meta":{"line":141,"file":"ThreadManager.js","path":"src/managers"}}],"meta":{"line":12,"file":"GuildTextThreadManager.js","path":"src/managers"}},{"name":"InteractionManager","description":"Manages API methods for InteractionResponse and holds their cache.","extends":[[["CachedManager"]]],"props":[{"name":"channel","description":"The channel that the messages belong to","type":[[["TextBasedChannels"]]],"meta":{"line":18,"file":"InteractionManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of InteractionResponse","type":[[["Collection","<"],["Snowflake",", "],["InteractionResponse",">"]]],"meta":{"line":21,"file":"InteractionManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"resolve","description":"Resolves a data entry to a data Object.","inherits":"DataManager#resolve","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Object"]]],"description":"An instance from this Manager","nullable":true},"meta":{"line":39,"file":"DataManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a data entry to an instance id.","inherits":"DataManager#resolveId","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":50,"file":"DataManager.js","path":"src/managers"}}],"meta":{"line":10,"file":"InteractionManager.js","path":"src/managers"}},{"name":"MessageManager","description":"Manages API methods for Messages and holds their cache.","extends":[[["CachedManager"]]],"props":[{"name":"channel","description":"The channel that the messages belong to","type":[[["TextBasedChannels"]]],"meta":{"line":22,"file":"MessageManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of Messages","type":[[["Collection","<"],["Snowflake",", "],["Message",">"]]],"meta":{"line":25,"file":"MessageManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"fetch","description":"Gets a message, or messages, from this channel.\nThe returned Collection does not contain reaction users of the messages if they were not cached.\nThose need to be fetched separately in such a case.","examples":["// Get message\nchannel.messages.fetch('99539446449315840')\n .then(message => console.log(message.content))\n .catch(console.error);","// Get messages\nchannel.messages.fetch({ limit: 10 })\n .then(messages => console.log(`Received ${messages.size} messages`))\n .catch(console.error);","// Get messages and filter by user id\nchannel.messages.fetch()\n .then(messages => console.log(`${messages.filter(m => m.author.id === '84484653687267328').size} messages`))\n .catch(console.error);"],"params":[{"name":"message","description":"The id of the message to fetch, or query parameters.","optional":true,"type":[[["Snowflake"]],[["ChannelLogsQueryOptions"]]]},{"name":"options","description":"Additional options for this fetch","optional":true,"type":[[["BaseFetchOptions"]]]}],"returns":[[["Promise","<("],["Message","|"],["Collection","<"],["Snowflake",", "],["Message",">)>"]]],"meta":{"line":68,"file":"MessageManager.js","path":"src/managers"}},{"name":"fetchPinned","description":"Fetches the pinned messages of this channel and returns a collection of them.\nThe returned Collection does not contain any reaction data of the messages.\nThose need to be fetched separately.","examples":["// Get pinned messages\nchannel.messages.fetchPinned()\n .then(messages => console.log(`Received ${messages.size} messages`))\n .catch(console.error);"],"params":[{"name":"cache","description":"Whether to cache the message(s)","optional":true,"default":true,"type":[[["boolean"]]]}],"async":true,"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Message",">>"]]],"meta":{"line":84,"file":"MessageManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a {@link MessageResolvable} to a {@link Message} object.","params":[{"name":"message","description":"The message resolvable to resolve","type":[[["MessageResolvable"]]]}],"returns":{"types":[[["Message"]]],"nullable":true},"meta":{"line":100,"file":"MessageManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a {@link MessageResolvable} to a {@link Message} id.","params":[{"name":"message","description":"The message resolvable to resolve","type":[[["MessageResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":109,"file":"MessageManager.js","path":"src/managers"}},{"name":"edit","description":"Edits a message, even if it's not cached.","params":[{"name":"message","description":"The message to edit","type":[[["MessageResolvable"]]]},{"name":"options","description":"The options to edit the message","type":[[["string"]],[["MessageEditOptions"]],[["MessagePayload"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":124,"file":"MessageManager.js","path":"src/managers"}},{"name":"crosspost","description":"Publishes a message in an announcement channel to all channels following it, even if it's not cached.","params":[{"name":"message","description":"The message to publish","type":[[["MessageResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":169,"file":"MessageManager.js","path":"src/managers"}},{"name":"pin","description":"Pins a message to the channel's pinned messages, even if it's not cached.","params":[{"name":"message","description":"The message to pin","type":[[["MessageResolvable"]]]},{"name":"reason","description":"Reason for pinning","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":183,"file":"MessageManager.js","path":"src/managers"}},{"name":"unpin","description":"Unpins a message from the channel's pinned messages, even if it's not cached.","params":[{"name":"message","description":"The message to unpin","type":[[["MessageResolvable"]]]},{"name":"reason","description":"Reason for unpinning","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":196,"file":"MessageManager.js","path":"src/managers"}},{"name":"react","description":"Adds a reaction to a message, even if it's not cached.","params":[{"name":"message","description":"The message to react to","type":[[["MessageResolvable"]]]},{"name":"emoji","description":"The emoji to react with","type":[[["EmojiIdentifierResolvable"]]]},{"name":"burst","description":"Super Reactions (Discord Nitro only)","optional":true,"default":false,"type":[[["boolean"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":210,"file":"MessageManager.js","path":"src/managers"}},{"name":"delete","description":"Deletes a message, even if it's not cached.","params":[{"name":"message","description":"The message to delete","type":[[["MessageResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":238,"file":"MessageManager.js","path":"src/managers"}},{"name":"search","description":"Search Messages in the channel.","params":[{"name":"options","description":"Performs a search within the channel.","type":[[["MessageSearchOptions"]]]}],"async":true,"returns":[[["MessageSearchResult"]]],"meta":{"line":297,"file":"MessageManager.js","path":"src/managers"}},{"name":"endPoll","description":"Ends a poll.","params":[{"name":"messageId","description":"The id of the message","type":[[["Snowflake"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":397,"file":"MessageManager.js","path":"src/managers"}},{"name":"fetchPollAnswerVoters","description":"Fetches the users that voted for a poll answer.","params":[{"name":"options","description":"The options for fetching the poll answer voters","type":[[["FetchPollAnswerVotersOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["User",">>"]]],"meta":{"line":414,"file":"MessageManager.js","path":"src/managers"}}],"meta":{"line":14,"file":"MessageManager.js","path":"src/managers"}},{"name":"PermissionOverwriteManager","description":"Manages API methods for guild channel permission overwrites and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"channel","description":"The channel of the permission overwrite this manager belongs to","type":[[["GuildChannel"]]],"meta":{"line":32,"file":"PermissionOverwriteManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of this Manager","type":[[["Collection","<"],["Snowflake",", "],["PermissionOverwrites",">"]]],"meta":{"line":41,"file":"PermissionOverwriteManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"set","description":"Replaces the permission overwrites in this channel.","examples":["message.channel.permissionOverwrites.set([\n {\n id: message.author.id,\n deny: [Permissions.FLAGS.VIEW_CHANNEL],\n },\n], 'Needed to change permissions');"],"params":[{"name":"overwrites","description":"Permission overwrites the channel gets updated with","type":[[["Array","<"],["OverwriteResolvable",">"]],[["Collection","<"],["Snowflake",", "],["OverwriteResolvable",">"]]]},{"name":"reason","description":"Reason for updating the channel overwrites","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":65,"file":"PermissionOverwriteManager.js","path":"src/managers"}},{"name":"upsert","description":"Creates or edits permission overwrites for a user or role in this channel.","access":"private","params":[{"name":"userOrRole","description":"The user or role to update","type":[[["RoleResolvable"]],[["UserResolvable"]]]},{"name":"options","description":"The options for the update","type":[[["PermissionOverwriteOptions"]]]},{"name":"overwriteOptions","description":"The extra information for the update","optional":true,"type":[[["GuildChannelOverwriteOptions"]]]},{"name":"existing","description":"The existing overwrites to merge with this update","optional":true,"type":[[["PermissionOverwrites"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":89,"file":"PermissionOverwriteManager.js","path":"src/managers"}},{"name":"create","description":"Creates permission overwrites for a user or role in this channel, or replaces them if already present.","examples":["// Create or Replace permission overwrites for a message author\nmessage.channel.permissionOverwrites.create(message.author, {\n SEND_MESSAGES: false\n})\n .then(channel => console.log(channel.permissionOverwrites.cache.get(message.author.id)))\n .catch(console.error);"],"params":[{"name":"userOrRole","description":"The user or role to update","type":[[["RoleResolvable"]],[["UserResolvable"]]]},{"name":"options","description":"The options for the update","type":[[["PermissionOverwriteOptions"]]]},{"name":"overwriteOptions","description":"The extra information for the update","optional":true,"type":[[["GuildChannelOverwriteOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":124,"file":"PermissionOverwriteManager.js","path":"src/managers"}},{"name":"edit","description":"Edits permission overwrites for a user or role in this channel, or creates an entry if not already present.","examples":["// Edit or Create permission overwrites for a message author\nmessage.channel.permissionOverwrites.edit(message.author, {\n SEND_MESSAGES: false\n})\n .then(channel => console.log(channel.permissionOverwrites.cache.get(message.author.id)))\n .catch(console.error);"],"params":[{"name":"userOrRole","description":"The user or role to update","type":[[["RoleResolvable"]],[["UserResolvable"]]]},{"name":"options","description":"The options for the update","type":[[["PermissionOverwriteOptions"]]]},{"name":"overwriteOptions","description":"The extra information for the update","optional":true,"type":[[["GuildChannelOverwriteOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":142,"file":"PermissionOverwriteManager.js","path":"src/managers"}},{"name":"delete","description":"Deletes permission overwrites for a user or role in this channel.","params":[{"name":"userOrRole","description":"The user or role to delete","type":[[["UserResolvable"]],[["RoleResolvable"]]]},{"name":"reason","description":"The reason for deleting the overwrite","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":155,"file":"PermissionOverwriteManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a data entry to a data Object.","inherits":"DataManager#resolve","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Object"]]],"description":"An instance from this Manager","nullable":true},"meta":{"line":39,"file":"DataManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a data entry to an instance id.","inherits":"DataManager#resolveId","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":50,"file":"DataManager.js","path":"src/managers"}}],"meta":{"line":17,"file":"PermissionOverwriteManager.js","path":"src/managers"}},{"name":"PresenceManager","description":"Manages API methods for Presences and holds their cache.","extends":[[["CachedManager"]]],"props":[{"name":"cache","description":"The cache of Presences","type":[[["Collection","<"],["Snowflake",", "],["Presence",">"]]],"meta":{"line":15,"file":"PresenceManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"resolve","description":"Resolves a {@link PresenceResolvable} to a {@link Presence} object.","params":[{"name":"presence","description":"The presence resolvable to resolve","type":[[["PresenceResolvable"]]]}],"returns":{"types":[[["Presence"]]],"nullable":true},"meta":{"line":38,"file":"PresenceManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a {@link PresenceResolvable} to a {@link Presence} id.","params":[{"name":"presence","description":"The presence resolvable to resolve","type":[[["PresenceResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":50,"file":"PresenceManager.js","path":"src/managers"}},{"name":"fetch","description":"Fetches the overall user presence for all of the user's non-offline friends and implicit relationships.","async":true,"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Presence",">>"]]],"meta":{"line":61,"file":"PresenceManager.js","path":"src/managers"}}],"meta":{"line":10,"file":"PresenceManager.js","path":"src/managers"}},{"name":"ReactionManager","description":"Manages API methods for reactions and holds their cache.","extends":[[["CachedManager"]]],"props":[{"name":"message","description":"The message that this manager belongs to","type":[[["Message"]]],"meta":{"line":18,"file":"ReactionManager.js","path":"src/managers"}},{"name":"cache","description":"The reaction cache of this manager","type":[[["Collection","<("],["string","|"],["Snowflake","), "],["MessageReaction",">"]]],"meta":{"line":25,"file":"ReactionManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"resolve","description":"Resolves a {@link MessageReactionResolvable} to a {@link MessageReaction} object.","params":[{"name":"reaction","description":"The MessageReaction to resolve","type":[[["MessageReactionResolvable"]]]}],"returns":{"types":[[["MessageReaction"]]],"nullable":true},"meta":{"line":39,"file":"ReactionManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a {@link MessageReactionResolvable} to a {@link MessageReaction} id.","params":[{"name":"reaction","description":"The MessageReaction to resolve","type":[[["MessageReactionResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":48,"file":"ReactionManager.js","path":"src/managers"}},{"name":"removeAll","description":"Removes all reactions from a message.","async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":61,"file":"ReactionManager.js","path":"src/managers"}}],"meta":{"line":10,"file":"ReactionManager.js","path":"src/managers"}},{"name":"ReactionUserManager","description":"Manages API methods for users who reacted to a reaction and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"reaction","description":"The reaction that this manager belongs to","type":[[["MessageReaction"]]],"meta":{"line":21,"file":"ReactionUserManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of this manager","type":[[["Collection","<"],["Snowflake",", "],["User",">"]]],"meta":{"line":24,"file":"ReactionUserManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"fetch","description":"Fetches all the users that gave this reaction. Resolves with a collection of users, mapped by their ids.","params":[{"name":"options","description":"Options for fetching the users","optional":true,"type":[[["FetchReactionUsersOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["User",">>"]]],"meta":{"line":43,"file":"ReactionUserManager.js","path":"src/managers"}},{"name":"remove","description":"Removes a user from this reaction.","params":[{"name":"user","description":"The user to remove the reaction of","optional":true,"default":"this.client.user","type":[[["UserResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["MessageReaction",">"]]],"meta":{"line":62,"file":"ReactionUserManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a data entry to a data Object.","inherits":"DataManager#resolve","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Object"]]],"description":"An instance from this Manager","nullable":true},"meta":{"line":39,"file":"DataManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a data entry to an instance id.","inherits":"DataManager#resolveId","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":50,"file":"DataManager.js","path":"src/managers"}}],"meta":{"line":13,"file":"ReactionUserManager.js","path":"src/managers"}},{"name":"RelationshipManager","description":"Manages API methods for Relationships and stores their cache.","props":[{"name":"cache","description":"A collection of users this manager is caching. (Type: Number)","type":[[["Collection","<"],["Snowflake",", "],["RelationshipType",">"]]],"meta":{"line":21,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"friendNicknames","type":[[["Collection","<"],["Snowflake",", "],["string",">"]]],"meta":{"line":25,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"sinceCache","type":[[["Collection","<"],["Snowflake",", "],["Date",">"]]],"meta":{"line":29,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"friendCache","description":"Get all friends","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["User",">"]]],"meta":{"line":38,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"blockedCache","description":"Get all blocked users","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["User",">"]]],"meta":{"line":50,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"incomingCache","description":"Get all incoming friend requests","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["User",">"]]],"meta":{"line":62,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"outgoingCache","description":"Get all outgoing friend requests","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["User",">"]]],"meta":{"line":74,"file":"RelationshipManager.js","path":"src/managers"}}],"methods":[{"name":"toJSON","description":"Return array of cache","returns":[[["Array","<"],["RelationshipJSONData",">"]]],"meta":{"line":93,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"_setup","access":"private","params":[{"name":"users","description":"An array of users to add to the cache","type":[[["Array","<"],["User",">"]]]}],"returns":[[["void"]]],"meta":{"line":107,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a {@link UserResolvable} to a {@link User} id.","params":[{"name":"user","description":"The UserResolvable to identify","type":[[["UserResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":121,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"resolveUsername","description":"Resolves a {@link UserResolvable} to a {@link User} username.","params":[{"name":"user","description":"The UserResolvable to identify","type":[[["UserResolvable"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":134,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"fetch","description":"Obtains a user from Discord, or the user cache if it's already available.","params":[{"name":"user","description":"The user to fetch","optional":true,"type":[[["UserResolvable"]]]},{"name":"options","description":"Additional options for this fetch","optional":true,"type":[[["BaseFetchOptions"]]]}],"async":true,"returns":[[["Promise","<("],["RelationshipType","|"],["RelationshipManager",")>"]]],"meta":{"line":148,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"deleteRelationship","description":"Deletes a friend / blocked relationship with a client user or cancels a friend request.","params":[{"name":"user","description":"Target","type":[[["UserResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["boolean",">"]]],"meta":{"line":170,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"sendFriendRequest","description":"Sends a friend request.","params":[{"name":"options","description":"Target (User Object, Username, User Id)","type":[[["UserResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["boolean",">"]]],"meta":{"line":192,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"addFriend","description":"Accepts a friend request.","params":[{"name":"user","description":"The user to add as a friend","type":[[["UserResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["boolean",">"]]],"meta":{"line":220,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"setNickname","description":"Changes the nickname of a friend.","params":[{"name":"user","description":"The user to change the nickname","type":[[["UserResolvable"]]]},{"name":"nickname","description":"New nickname","default":null,"nullable":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["boolean",">"]]],"meta":{"line":241,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"addBlocked","description":"Blocks a user.","params":[{"name":"user","description":"User to block","type":[[["UserResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["boolean",">"]]],"meta":{"line":262,"file":"RelationshipManager.js","path":"src/managers"}}],"meta":{"line":14,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"RoleManager","description":"Manages API methods for roles and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"guild","description":"The guild belonging to this manager","type":[[["Guild"]]],"meta":{"line":36,"file":"RoleManager.js","path":"src/managers"}},{"name":"cache","description":"The role cache of this manager","type":[[["Collection","<"],["Snowflake",", "],["Role",">"]]],"meta":{"line":39,"file":"RoleManager.js","path":"src/managers"}},{"name":"everyone","description":"The `@everyone` role of the guild","readonly":true,"type":[[["Role"]]],"meta":{"line":425,"file":"RoleManager.js","path":"src/managers"}},{"name":"premiumSubscriberRole","description":"The premium subscriber role of the guild, if any","readonly":true,"nullable":true,"type":[[["Role"]]],"meta":{"line":434,"file":"RoleManager.js","path":"src/managers"}},{"name":"highest","description":"The role with the highest position in the cache","readonly":true,"type":[[["Role"]]],"meta":{"line":443,"file":"RoleManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"fetch","description":"Obtains a role from Discord, or the role cache if they're already available.","examples":["// Fetch all roles from the guild\nmessage.guild.roles.fetch()\n .then(roles => console.log(`There are ${roles.size} roles.`))\n .catch(console.error);","// Fetch a single role\nmessage.guild.roles.fetch('222078108977594368')\n .then(role => console.log(`The role color is: ${role.colors.primaryColor}`))\n .catch(console.error);"],"params":[{"name":"id","description":"The role's id","optional":true,"type":[[["Snowflake"]]]},{"name":"options","description":"Additional options for this fetch","optional":true,"type":[[["BaseFetchOptions"]]]}],"async":true,"returns":[[["Promise","<(?"],["Role","|"],["Collection","<"],["Snowflake",", "],["Role",">)>"]]],"meta":{"line":65,"file":"RoleManager.js","path":"src/managers"}},{"name":"fetchMemberCounts","description":"Fetches the member counts for each role in the guild.","async":true,"returns":[[["Promise","<"],["Record","<"],["Snowflake",", "],["number",">>"]]],"meta":{"line":82,"file":"RoleManager.js","path":"src/managers"}},{"name":"fetchMemberIds","description":"Fetches the member ids for a role in the guild.\nThis only returns 100 member ids","params":[{"name":"role","description":"The role to fetch member ids for","type":[[["RoleResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["Array","<"],["Snowflake",">>"]]],"meta":{"line":94,"file":"RoleManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a {@link RoleResolvable} to a {@link Role} object.","params":[{"name":"role","description":"The role resolvable to resolve","type":[[["RoleResolvable"]]]}],"returns":{"types":[[["Role"]]],"nullable":true},"meta":{"line":110,"file":"RoleManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a {@link RoleResolvable} to a {@link Role} id.","params":[{"name":"role","description":"The role resolvable to resolve","type":[[["RoleResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":119,"file":"RoleManager.js","path":"src/managers"}},{"name":"create","description":"Creates a new role in the guild with given information.\nThe position will silently reset to 1 if an invalid one is provided, or none.","examples":["// Create a new role\nguild.roles.create()\n .then(console.log)\n .catch(console.error);","// Create a new role with data and a reason\nguild.roles.create({\n name: 'Super Cool Blue People',\n colors: {\n primaryColor: 'BLUE',\n },\n reason: 'we needed a role for Super Cool People',\n})\n .then(console.log)\n .catch(console.error);","// Create a role with holographic colors\nguild.roles.create({\n name: 'Holographic Role',\n reason: 'Creating a role with holographic effect',\n colors: {\n primaryColor: Constants.HolographicStyles.PRIMARY,\n secondaryColor: Constants.HolographicStyles.SECONDARY,\n tertiaryColor: Constants.HolographicStyles.TERTIARY,\n },\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for creating the new role","optional":true,"type":[[["CreateRoleOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Role",">"]]],"meta":{"line":192,"file":"RoleManager.js","path":"src/managers"}},{"name":"edit","description":"Edits a role of the guild.","examples":["// Edit a role\nguild.roles.edit('222079219327434752', { name: 'buddies' })\n .then(updated => console.log(`Edited role name to ${updated.name}`))\n .catch(console.error);"],"params":[{"name":"role","description":"The role to edit","type":[[["RoleResolvable"]]]},{"name":"data","description":"The new data for the role","type":[[["RoleData"]]]},{"name":"reason","description":"Reason for editing this role","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Role",">"]]],"meta":{"line":255,"file":"RoleManager.js","path":"src/managers"}},{"name":"delete","description":"Deletes a role.","examples":["// Delete a role\nguild.roles.delete('222079219327434752', 'The role needed to go')\n .then(() => console.log('Deleted the role.'))\n .catch(console.error);"],"params":[{"name":"role","description":"The role to delete","type":[[["RoleResolvable"]]]},{"name":"reason","description":"Reason for deleting the role","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":316,"file":"RoleManager.js","path":"src/managers"}},{"name":"setPosition","description":"Sets the new position of the role.","examples":["// Set the position of the role\nguild.roles.setPosition('222197033908436994', 1)\n .then(updated => console.log(`Role position: ${updated.position}`))\n .catch(console.error);"],"params":[{"name":"role","description":"The role to change the position of","type":[[["RoleResolvable"]]]},{"name":"position","description":"The new position for the role","type":[[["number"]]]},{"name":"options","description":"Options for setting the position","optional":true,"type":[[["SetRolePositionOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Role",">"]]],"meta":{"line":334,"file":"RoleManager.js","path":"src/managers"}},{"name":"setPositions","description":"Batch-updates the guild's role positions","examples":["guild.roles.setPositions([{ role: roleId, position: updatedRoleIndex }])\n .then(guild => console.log(`Role positions updated for ${guild}`))\n .catch(console.error);"],"params":[{"name":"rolePositions","description":"Role positions to update","type":[[["Array","<"],["GuildRolePosition",">"]]]}],"async":true,"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":369,"file":"RoleManager.js","path":"src/managers"}},{"name":"comparePositions","description":"Compares the positions of two roles.","params":[{"name":"role1","description":"First role to compare","type":[[["RoleResolvable"]]]},{"name":"role2","description":"Second role to compare","type":[[["RoleResolvable"]]]}],"returns":{"types":[[["number"]]],"description":"Negative number if the first role's position is lower (second role's is higher),\npositive number if the first's is higher (second's is lower), 0 if equal"},"meta":{"line":393,"file":"RoleManager.js","path":"src/managers"}},{"name":"botRoleFor","description":"Gets the managed role a user created when joining the guild, if any\nOnly ever available for bots","params":[{"name":"user","description":"The user to access the bot role for","type":[[["UserResolvable"]]]}],"returns":{"types":[[["Role"]]],"nullable":true},"meta":{"line":414,"file":"RoleManager.js","path":"src/managers"}}],"meta":{"line":21,"file":"RoleManager.js","path":"src/managers"}},{"name":"SessionManager","description":"Manages API methods for users and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"currentSessionIdHash","description":"The current session ID hash of the client.","type":[[["string"]]],"meta":{"line":18,"file":"SessionManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of Sessions","type":[[["Collection","<"],["string",", "],["Session",">"]]],"meta":{"line":20,"file":"SessionManager.js","path":"src/managers"}},{"name":"currentSession","description":"Get the current session of the client.\nYou must call `fetch()` first to populate the cache.","nullable":true,"type":[[["Session"]]],"meta":{"line":58,"file":"SessionManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"fetch","description":"Fetch all sessions of the client.","returns":[[["Promise","<"],["Collection","<"],["string",", "],["Session",">>"]]],"meta":{"line":30,"file":"SessionManager.js","path":"src/managers"}},{"name":"logoutAllDevices","description":"Logout all client (remote).","returns":[[["Promise","<"],["void",">"]]],"meta":{"line":45,"file":"SessionManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a data entry to a data Object.","inherits":"DataManager#resolve","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Object"]]],"description":"An instance from this Manager","nullable":true},"meta":{"line":39,"file":"DataManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a data entry to an instance id.","inherits":"DataManager#resolveId","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":50,"file":"DataManager.js","path":"src/managers"}}],"meta":{"line":10,"file":"SessionManager.js","path":"src/managers"}},{"name":"StageInstanceManager","description":"Manages API methods for {@link StageInstance} objects and holds their cache.","extends":[[["CachedManager"]]],"props":[{"name":"guild","description":"The guild this manager belongs to","type":[[["Guild"]]],"meta":{"line":20,"file":"StageInstanceManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of this Manager","type":[[["Collection","<"],["Snowflake",", "],["StageInstance",">"]]],"meta":{"line":23,"file":"StageInstanceManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"create","description":"Creates a new stage instance.","examples":["// Create a stage instance\nguild.stageInstances.create('1234567890123456789', {\n topic: 'A very creative topic',\n privacyLevel: 'GUILD_ONLY'\n})\n .then(stageInstance => console.log(stageInstance))\n .catch(console.error);"],"params":[{"name":"channel","description":"The stage channel to associate the created stage instance to","type":[[["StageChannelResolvable"]]]},{"name":"options","description":"The options to create the stage instance","type":[[["StageInstanceCreateOptions"]]]}],"async":true,"returns":[[["Promise","<"],["StageInstance",">"]]],"meta":{"line":60,"file":"StageInstanceManager.js","path":"src/managers"}},{"name":"fetch","description":"Fetches the stage instance associated with a stage channel, if it exists.","examples":["// Fetch a stage instance\nguild.stageInstances.fetch('1234567890123456789')\n .then(stageInstance => console.log(stageInstance))\n .catch(console.error);"],"params":[{"name":"channel","description":"The stage channel whose associated stage instance is to be fetched","type":[[["StageChannelResolvable"]]]},{"name":"options","description":"Additional options for this fetch","optional":true,"type":[[["BaseFetchOptions"]]]}],"async":true,"returns":[[["Promise","<"],["StageInstance",">"]]],"meta":{"line":93,"file":"StageInstanceManager.js","path":"src/managers"}},{"name":"edit","description":"Edits an existing stage instance.","examples":["// Edit a stage instance\nguild.stageInstances.edit('1234567890123456789', { topic: 'new topic' })\n .then(stageInstance => console.log(stageInstance))\n .catch(console.error);"],"params":[{"name":"channel","description":"The stage channel whose associated stage instance is to be edited","type":[[["StageChannelResolvable"]]]},{"name":"options","description":"The options to edit the stage instance","type":[[["StageInstanceEditOptions"]]]}],"async":true,"returns":[[["Promise","<"],["StageInstance",">"]]],"meta":{"line":124,"file":"StageInstanceManager.js","path":"src/managers"}},{"name":"delete","description":"Deletes an existing stage instance.","params":[{"name":"channel","description":"The stage channel whose associated stage instance is to be deleted","type":[[["StageChannelResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":154,"file":"StageInstanceManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a data entry to a data Object.","inherits":"DataManager#resolve","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Object"]]],"description":"An instance from this Manager","nullable":true},"meta":{"line":39,"file":"DataManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a data entry to an instance id.","inherits":"DataManager#resolveId","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":50,"file":"DataManager.js","path":"src/managers"}}],"meta":{"line":12,"file":"StageInstanceManager.js","path":"src/managers"}},{"name":"ThreadManager","description":"Manages API methods for {@link ThreadChannel} objects and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"channel","description":"The channel this Manager belongs to","type":[[["NewsChannel"]],[["TextChannel"]]],"meta":{"line":19,"file":"ThreadManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of this Manager","type":[[["Collection","<"],["Snowflake",", "],["ThreadChannel",">"]]],"meta":{"line":22,"file":"ThreadManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"resolve","description":"Resolves a {@link ThreadChannelResolvable} to a {@link ThreadChannel} object.","params":[{"name":"thread","description":"The ThreadChannel resolvable to resolve","type":[[["ThreadChannelResolvable"]]]}],"returns":{"types":[[["ThreadChannel"]]],"nullable":true},"meta":{"line":42,"file":"ThreadManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a {@link ThreadChannelResolvable} to a {@link ThreadChannel} id.","params":[{"name":"thread","description":"The ThreadChannel resolvable to resolve","type":[[["ThreadChannelResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":51,"file":"ThreadManager.js","path":"src/managers"}},{"name":"fetch","description":"Obtains a thread from Discord, or the channel cache if it's already available.","examples":["// Fetch a thread by its id\nchannel.threads.fetch('831955138126104859')\n .then(channel => console.log(channel.name))\n .catch(console.error);"],"params":[{"name":"options","description":"The options to fetch threads. If it is a\nThreadChannelResolvable then the specified thread will be fetched. Fetches all active threads if `undefined`","optional":true,"type":[[["ThreadChannelResolvable"]],[["FetchChannelThreadsOptions"]],[["FetchThreadsOptions"]]]},{"name":"cacheOptions","description":"Additional options for this fetch. The `force` field gets ignored\nif `options` is not a {@link ThreadChannelResolvable}","optional":true,"type":[[["BaseFetchOptions"]]]}],"returns":[[["Promise",""]]],"meta":{"line":79,"file":"ThreadManager.js","path":"src/managers"}},{"name":"fetchArchived","description":"Obtains a set of archived threads from Discord, requires `READ_MESSAGE_HISTORY` in the parent channel.","params":[{"name":"options","description":"The options to fetch archived threads","optional":true,"type":[[["FetchChannelThreadsOptions"]]]},{"name":"cache","description":"Whether to cache the new thread objects if they aren't already","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["FetchedThreads",">"]]],"meta":{"line":121,"file":"ThreadManager.js","path":"src/managers"}},{"name":"fetchActive","description":"Obtains the accessible active threads from Discord, requires `READ_MESSAGE_HISTORY` in the parent channel.","params":[{"name":"cache","description":"Whether to cache the new thread objects if they aren't already","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"options","description":"Options for self-bots where advanced users can specify further options","optional":true,"type":[[["FetchChannelThreadsOptions"]]]}],"async":true,"returns":[[["Promise","<"],["FetchedThreads",">"]]],"meta":{"line":141,"file":"ThreadManager.js","path":"src/managers"}}],"meta":{"line":11,"file":"ThreadManager.js","path":"src/managers"}},{"name":"ThreadMemberManager","description":"Manages API methods for GuildMembers and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"thread","description":"The thread this manager belongs to","type":[[["ThreadChannel"]]],"meta":{"line":23,"file":"ThreadMemberManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of this Manager","type":[[["Collection","<"],["Snowflake",", "],["ThreadMember",">"]]],"meta":{"line":26,"file":"ThreadMemberManager.js","path":"src/managers"}},{"name":"me","description":"The client user as a ThreadMember of this ThreadChannel","readonly":true,"nullable":true,"type":[[["ThreadMember"]]],"meta":{"line":56,"file":"ThreadMemberManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"fetchMe","description":"Fetches the client user as a ThreadMember of the thread.","params":[{"name":"options","description":"The options for fetching the member","optional":true,"type":[[["BaseFetchOptions"]]]}],"returns":[[["Promise","<"],["ThreadMember",">"]]],"meta":{"line":47,"file":"ThreadMemberManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a {@link ThreadMemberResolvable} to a {@link ThreadMember} object.","params":[{"name":"member","description":"The user that is part of the thread","type":[[["ThreadMemberResolvable"]]]}],"returns":{"types":[[["GuildMember"]]],"nullable":true},"meta":{"line":72,"file":"ThreadMemberManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a {@link ThreadMemberResolvable} to a {@link ThreadMember} id string.","params":[{"name":"member","description":"The user that is part of the guild","type":[[["ThreadMemberResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":85,"file":"ThreadMemberManager.js","path":"src/managers"}},{"name":"add","description":"Adds a member to the thread.","params":[{"name":"member","description":"The member to add","type":[[["UserResolvable"]],[["me","'"]]]},{"name":"reason","description":"The reason for adding this member","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Snowflake",">"]]],"meta":{"line":98,"file":"ThreadMemberManager.js","path":"src/managers"}},{"name":"remove","description":"Remove a user from the thread.","params":[{"name":"id","description":"The id of the member to remove","type":[[["Snowflake"]],[["me","'"]]]},{"name":"reason","description":"The reason for removing this member from the thread","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Snowflake",">"]]],"meta":{"line":111,"file":"ThreadMemberManager.js","path":"src/managers"}},{"name":"fetch","description":"Fetches member(s) for the thread from Discord.","params":[{"name":"member","description":"The member to fetch. If `undefined`, all members\nin the thread are fetched, and will be cached based on `options.cache`.","optional":true,"type":[[["UserResolvable"]],[["FetchThreadMembersOptions"]],[["boolean"]]]},{"name":"options","description":"Additional options for this fetch","optional":true,"type":[[["FetchThreadMemberOptions"]],[["FetchThreadMembersOptions"]]]}],"returns":[[["Promise","<("],["ThreadMember","|"],["Collection","<"],["Snowflake",", "],["ThreadMember",">)>"]]],"meta":{"line":171,"file":"ThreadMemberManager.js","path":"src/managers"}}],"meta":{"line":15,"file":"ThreadMemberManager.js","path":"src/managers"}},{"name":"UserManager","description":"Manages API methods for users and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"cache","description":"The cache of this manager","type":[[["Collection","<"],["Snowflake",", "],["User",">"]]],"meta":{"line":19,"file":"UserManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"dmChannel","description":"The DM between the client's user and a user","access":"private","params":[{"name":"userId","description":"The user id","type":[[["Snowflake"]]]}],"returns":{"types":[[["DMChannel"]]],"nullable":true},"meta":{"line":41,"file":"UserManager.js","path":"src/managers"}},{"name":"createDM","description":"Creates a {@link DMChannel} between the client and a user.","params":[{"name":"user","description":"The UserResolvable to identify","type":[[["UserResolvable"]]]},{"name":"options","description":"Additional options for this fetch","optional":true,"type":[[["BaseFetchOptions"]]]}],"async":true,"returns":[[["Promise","<"],["DMChannel",">"]]],"meta":{"line":51,"file":"UserManager.js","path":"src/managers"}},{"name":"deleteDM","description":"Deletes a {@link DMChannel} (if one exists) between the client and a user. Resolves with the channel if successful.","params":[{"name":"user","description":"The UserResolvable to identify","type":[[["UserResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["DMChannel",">"]]],"meta":{"line":76,"file":"UserManager.js","path":"src/managers"}},{"name":"fetch","description":"Obtains a user from Discord, or the user cache if it's already available.","params":[{"name":"user","description":"The user to fetch","type":[[["UserResolvable"]]]},{"name":"options","description":"Additional options for this fetch","optional":true,"type":[[["BaseFetchOptions"]]]}],"async":true,"returns":[[["Promise","<"],["User",">"]]],"meta":{"line":91,"file":"UserManager.js","path":"src/managers"}},{"name":"send","description":"Sends a message to a user.","params":[{"name":"user","description":"The UserResolvable to identify","type":[[["UserResolvable"]]]},{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["MessageOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":108,"file":"UserManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a {@link UserResolvable} to a {@link User} object.","params":[{"name":"user","description":"The UserResolvable to identify","type":[[["UserResolvable"]]]}],"returns":{"types":[[["User"]]],"nullable":true},"meta":{"line":117,"file":"UserManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a {@link UserResolvable} to a {@link User} id.","params":[{"name":"user","description":"The UserResolvable to identify","type":[[["UserResolvable"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":128,"file":"UserManager.js","path":"src/managers"}}],"meta":{"line":14,"file":"UserManager.js","path":"src/managers"}},{"name":"UserNoteManager","description":"Manages API methods for Client and stores their cache.","extends":[[["BaseManager"]]],"props":[{"name":"cache","description":"Cache User Note","type":[[["Collection","<"],["Snowflake",", "],["string",">"]]],"meta":{"line":17,"file":"UserNoteManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"fetch","description":"Obtains a user from Discord, or the user cache if it's already available.","params":[{"name":"user","description":"The user to fetch","type":[[["UserResolvable"]]]},{"name":"options","description":"Additional options for this fetch","optional":true,"type":[[["BaseFetchOptions"]]]}],"async":true,"returns":[[["Promise","<"],["string",">"]]],"meta":{"line":38,"file":"UserNoteManager.js","path":"src/managers"}}],"meta":{"line":10,"file":"UserNoteManager.js","path":"src/managers"}},{"name":"VoiceStateManager","description":"Manages API methods for VoiceStates and stores their cache.","extends":[[["CachedManager"]]],"props":[{"name":"guild","description":"The guild this manager belongs to","type":[[["Guild"]]],"meta":{"line":18,"file":"VoiceStateManager.js","path":"src/managers"}},{"name":"cache","description":"The cache of this manager","type":[[["Collection","<"],["Snowflake",", "],["VoiceState",">"]]],"meta":{"line":21,"file":"VoiceStateManager.js","path":"src/managers"}},{"name":"_cache","description":"The private cache of items for this manager.","access":"private","readonly":true,"type":[[["Collection"]]],"meta":{"line":15,"file":"CachedManager.js","path":"src/managers"}},{"name":"holds","description":"The data structure belonging to this manager.","access":"private","readonly":true,"type":[[["function"]]],"meta":{"line":15,"file":"DataManager.js","path":"src/managers"}},{"name":"client","description":"The client that instantiated this Manager","readonly":true,"type":[[["Client"]]],"meta":{"line":9,"file":"BaseManager.js","path":"src/managers"}}],"methods":[{"name":"fetch","description":"Obtains a user's voice state from discord or from the cache if it's already available.","examples":["// Fetch a member's voice state\nguild.voiceStates.fetch(\"66564597481480192\")\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"member","description":"The member whose voice state is to be fetched","type":[[["GuildMemberResolvable"]],[["me","'"]]]},{"name":"options","description":"Additional options for this fetch","optional":true,"type":[[["BaseFetchOptions"]]]}],"async":true,"returns":[[["Promise","<"],["VoiceState",">"]]],"meta":{"line":47,"file":"VoiceStateManager.js","path":"src/managers"}},{"name":"resolve","description":"Resolves a data entry to a data Object.","inherits":"DataManager#resolve","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Object"]]],"description":"An instance from this Manager","nullable":true},"meta":{"line":39,"file":"DataManager.js","path":"src/managers"}},{"name":"resolveId","description":"Resolves a data entry to an instance id.","inherits":"DataManager#resolveId","inherited":true,"params":[{"name":"idOrInstance","description":"The id or instance of something in this Manager","type":[[["string"]],[["Object"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":50,"file":"DataManager.js","path":"src/managers"}}],"meta":{"line":10,"file":"VoiceStateManager.js","path":"src/managers"}},{"name":"DiscordAPIError","description":"Represents an error from the Discord API.","extends":[[["Error"]]],"props":[{"name":"method","description":"The HTTP method used for the request","type":[[["string"]]],"meta":{"line":18,"file":"DiscordAPIError.js","path":"src/rest"}},{"name":"path","description":"The path of the request relative to the HTTP endpoint","type":[[["string"]]],"meta":{"line":24,"file":"DiscordAPIError.js","path":"src/rest"}},{"name":"code","description":"HTTP error code returned by Discord","type":[[["number"]]],"meta":{"line":30,"file":"DiscordAPIError.js","path":"src/rest"}},{"name":"httpStatus","description":"The HTTP status code","type":[[["number"]]],"meta":{"line":36,"file":"DiscordAPIError.js","path":"src/rest"}},{"name":"requestData","description":"The data associated with the request that caused this error","type":[[["HTTPErrorData"]]],"meta":{"line":42,"file":"DiscordAPIError.js","path":"src/rest"}},{"name":"retries","description":"The number of times this request has been retried","type":[[["number"]]],"meta":{"line":52,"file":"DiscordAPIError.js","path":"src/rest"}},{"name":"captcha","description":"Captcha response data if the request requires a captcha","type":[[["Captcha"]],[["null"]]],"meta":{"line":67,"file":"DiscordAPIError.js","path":"src/rest"}},{"name":"isBlockedByCloudflare","description":"A special `40333` JSON error code is returned if your request is blocked by Cloudflare.\nThis may be due to a malformed request or improper user agent.\nThe response resembles a normal error structure:","type":[[["boolean"]]],"meta":{"line":81,"file":"DiscordAPIError.js","path":"src/rest"}}],"methods":[{"name":"flattenErrors","description":"Flattens an errors object returned from the API into an array.","scope":"static","access":"private","params":[{"name":"obj","description":"Discord errors object","type":[[["APIError"]]]},{"name":"key","description":"Used internally to determine key names of nested fields","optional":true,"type":[[["string"]]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":92,"file":"DiscordAPIError.js","path":"src/rest"}}],"meta":{"line":7,"file":"DiscordAPIError.js","path":"src/rest"}},{"name":"HTTPError","description":"Represents an HTTP error from a request.","extends":[[["Error"]]],"props":[{"name":"name","description":"The name of the error","type":[[["string"]]],"meta":{"line":15,"file":"HTTPError.js","path":"src/rest"}},{"name":"code","description":"HTTP error code returned from the request","type":[[["number"]]],"meta":{"line":21,"file":"HTTPError.js","path":"src/rest"}},{"name":"method","description":"The HTTP method used for the request","type":[[["string"]]],"meta":{"line":27,"file":"HTTPError.js","path":"src/rest"}},{"name":"path","description":"The path of the request relative to the HTTP endpoint","type":[[["string"]]],"meta":{"line":33,"file":"HTTPError.js","path":"src/rest"}},{"name":"requestData","description":"The data associated with the request that caused this error","type":[[["HTTPErrorData"]]],"meta":{"line":54,"file":"HTTPError.js","path":"src/rest"}}],"meta":{"line":7,"file":"HTTPError.js","path":"src/rest"}},{"name":"RateLimitError","description":"Represents a RateLimit error from a request.","extends":[[["Error"]]],"props":[{"name":"name","description":"The name of the error","type":[[["string"]]],"meta":{"line":15,"file":"RateLimitError.js","path":"src/rest"}},{"name":"timeout","description":"Time until this rate limit ends, in milliseconds","type":[[["number"]]],"meta":{"line":21,"file":"RateLimitError.js","path":"src/rest"}},{"name":"method","description":"The HTTP method used for the request","type":[[["string"]]],"meta":{"line":27,"file":"RateLimitError.js","path":"src/rest"}},{"name":"path","description":"The path of the request relative to the HTTP endpoint","type":[[["string"]]],"meta":{"line":33,"file":"RateLimitError.js","path":"src/rest"}},{"name":"route","description":"The route of the request relative to the HTTP endpoint","type":[[["string"]]],"meta":{"line":39,"file":"RateLimitError.js","path":"src/rest"}},{"name":"global","description":"Whether this rate limit is global","type":[[["boolean"]]],"meta":{"line":45,"file":"RateLimitError.js","path":"src/rest"}},{"name":"limit","description":"The maximum amount of requests of this endpoint","type":[[["number"]]],"meta":{"line":51,"file":"RateLimitError.js","path":"src/rest"}}],"meta":{"line":7,"file":"RateLimitError.js","path":"src/rest"}},{"name":"Shard","description":"A self-contained shard created by the {@link ShardingManager}. Each one has a {@link ChildProcess} that contains\nan instance of the bot and its {@link Client}. When its child process/worker exits for any reason, the shard will\nspawn a new one to replace it as necessary.","extends":[[["EventEmitter"]]],"deprecated":true,"props":[{"name":"manager","description":"Manager that created the shard","type":[[["ShardingManager"]]],"meta":{"line":31,"file":"Shard.js","path":"src/sharding"}},{"name":"id","description":"The shard's id in the manager","type":[[["number"]]],"meta":{"line":37,"file":"Shard.js","path":"src/sharding"}},{"name":"args","description":"Arguments for the shard's process (only when {@link ShardingManager#mode} is `process`)","type":[[["Array","<"],["string",">"]]],"meta":{"line":43,"file":"Shard.js","path":"src/sharding"}},{"name":"execArgv","description":"Arguments for the shard's process executable (only when {@link ShardingManager#mode} is `process`)","type":[[["Array","<"],["string",">"]]],"meta":{"line":49,"file":"Shard.js","path":"src/sharding"}},{"name":"env","description":"Environment variables for the shard's process, or workerData for the shard's worker","type":[[["Object"]]],"meta":{"line":55,"file":"Shard.js","path":"src/sharding"}},{"name":"ready","description":"Whether the shard's {@link Client} is ready","type":[[["boolean"]]],"meta":{"line":66,"file":"Shard.js","path":"src/sharding"}},{"name":"process","description":"Process of the shard (if {@link ShardingManager#mode} is `process`)","nullable":true,"type":[[["ChildProcess"]]],"meta":{"line":72,"file":"Shard.js","path":"src/sharding"}},{"name":"worker","description":"Worker of the shard (if {@link ShardingManager#mode} is `worker`)","nullable":true,"type":[[["Worker"]]],"meta":{"line":78,"file":"Shard.js","path":"src/sharding"}},{"name":"_evals","description":"Ongoing promises for calls to {@link Shard#eval}, mapped by the `script` they were called with","access":"private","type":[[["Map","<"],["string",", "],["Promise",">"]]],"meta":{"line":85,"file":"Shard.js","path":"src/sharding"}},{"name":"_fetches","description":"Ongoing promises for calls to {@link Shard#fetchClientValue}, mapped by the `prop` they were called with","access":"private","type":[[["Map","<"],["string",", "],["Promise",">"]]],"meta":{"line":92,"file":"Shard.js","path":"src/sharding"}},{"name":"_exitListener","description":"Listener function for the {@link ChildProcess}' `exit` event","access":"private","type":[[["function"]]],"meta":{"line":99,"file":"Shard.js","path":"src/sharding"}}],"methods":[{"name":"spawn","description":"Forks a child process or creates a worker thread for the shard.\nYou should not need to call this manually.","params":[{"name":"timeout","description":"The amount in milliseconds to wait until the {@link Client} has become ready\nbefore resolving (`-1` or `Infinity` for no wait)","optional":true,"default":30000,"type":[[["number"]]]}],"returns":[[["Promise","<"],["ChildProcess",">"]]],"meta":{"line":109,"file":"Shard.js","path":"src/sharding"}},{"name":"kill","description":"Immediately kills the shard's process/worker and does not restart it.","meta":{"line":180,"file":"Shard.js","path":"src/sharding"}},{"name":"respawn","description":"Kills and restarts the shard's process/worker.","params":[{"name":"options","description":"Options for respawning the shard","optional":true,"type":[[["ShardRespawnOptions"]]]}],"async":true,"returns":[[["Promise","<"],["ChildProcess",">"]]],"meta":{"line":206,"file":"Shard.js","path":"src/sharding"}},{"name":"send","description":"Sends a message to the shard's process/worker.","params":[{"name":"message","description":"Message to send to the shard","type":[["*"]]}],"returns":[[["Promise","<"],["Shard",">"]]],"meta":{"line":217,"file":"Shard.js","path":"src/sharding"}},{"name":"fetchClientValue","description":"Fetches a client property value of the shard.","examples":["shard.fetchClientValue('guilds.cache.size')\n .then(count => console.log(`${count} guilds in shard ${shard.id}`))\n .catch(console.error);"],"params":[{"name":"prop","description":"Name of the client property to get, using periods for nesting","type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["*",">"]]],"meta":{"line":240,"file":"Shard.js","path":"src/sharding"}},{"name":"eval","description":"Evaluates a script or function on the shard, in the context of the {@link Client}.","params":[{"name":"script","description":"JavaScript to run on the shard","type":[[["string"]],[["function"]]]},{"name":"context","description":"The context for the eval","optional":true,"type":[["*"]]}],"async":true,"returns":{"types":[[["Promise","<"],["*",">"]]],"description":"Result of the script execution"},"meta":{"line":280,"file":"Shard.js","path":"src/sharding"}},{"name":"_handleMessage","description":"Handles a message received from the child process/worker.","access":"private","params":[{"name":"message","description":"Message received","type":[["*"]]}],"meta":{"line":322,"file":"Shard.js","path":"src/sharding"}},{"name":"_handleExit","description":"Handles the shard's process/worker exiting.","access":"private","params":[{"name":"respawn","description":"Whether to spawn the shard again","optional":true,"default":"this.manager.respawn","type":[[["boolean"]]]},{"name":"timeout","description":"The amount in milliseconds to wait until the {@link Client}\nhas become ready (`-1` or `Infinity` for no wait)","optional":true,"type":[[["number"]]]}],"meta":{"line":402,"file":"Shard.js","path":"src/sharding"}},{"name":"incrementMaxListeners","description":"Increments max listeners by one for a given emitter, if they are not zero.","access":"private","params":[{"name":"emitter","description":"The emitter that emits the events.","type":[[["EventEmitter"]],[["process"]]]}],"meta":{"line":424,"file":"Shard.js","path":"src/sharding"}},{"name":"decrementMaxListeners","description":"Decrements max listeners by one for a given emitter, if they are not zero.","access":"private","params":[{"name":"emitter","description":"The emitter that emits the events.","type":[[["EventEmitter"]],[["process"]]]}],"meta":{"line":436,"file":"Shard.js","path":"src/sharding"}}],"events":[{"name":"spawn","description":"Emitted upon the creation of the shard's child process/worker.","params":[{"name":"process","description":"Child process/worker that was created","type":[[["ChildProcess"]],[["Worker"]]]}],"meta":{"line":134,"file":"Shard.js","path":"src/sharding"}},{"name":"ready","description":"Emitted upon the shard's {@link Client#event:shardReady} event.","meta":{"line":327,"file":"Shard.js","path":"src/sharding"}},{"name":"disconnect","description":"Emitted upon the shard's {@link Client#event:shardDisconnect} event.","meta":{"line":338,"file":"Shard.js","path":"src/sharding"}},{"name":"reconnecting","description":"Emitted upon the shard's {@link Client#event:shardReconnecting} event.","meta":{"line":349,"file":"Shard.js","path":"src/sharding"}},{"name":"message","description":"Emitted upon receiving a message from the child process/worker.","params":[{"name":"message","description":"Message that was received","type":[["*"]]}],"meta":{"line":387,"file":"Shard.js","path":"src/sharding"}},{"name":"death","description":"Emitted upon the shard's child process/worker exiting.","params":[{"name":"process","description":"Child process/worker that exited","type":[[["ChildProcess"]],[["Worker"]]]}],"meta":{"line":403,"file":"Shard.js","path":"src/sharding"}}],"meta":{"line":20,"file":"Shard.js","path":"src/sharding"}},{"name":"ShardClientUtil","description":"Helper class for sharded clients spawned as a child process/worker, such as from a {@link ShardingManager}.\nUtilizes IPC to send and receive data to/from the master process and other shards.","deprecated":true,"props":[{"name":"client","description":"Client for the shard","type":[[["Client"]]],"meta":{"line":19,"file":"ShardClientUtil.js","path":"src/sharding"}},{"name":"mode","description":"Mode the shard was spawned with","type":[[["ShardingManagerMode"]]],"meta":{"line":25,"file":"ShardClientUtil.js","path":"src/sharding"}},{"name":"parentPort","description":"Message port for the master process (only when {@link ShardClientUtil#mode} is `worker`)","nullable":true,"type":[[["MessagePort"]]],"meta":{"line":31,"file":"ShardClientUtil.js","path":"src/sharding"}},{"name":"ids","description":"Array of shard ids of this client","readonly":true,"type":[[["Array","<"],["number",">"]]],"meta":{"line":64,"file":"ShardClientUtil.js","path":"src/sharding"}},{"name":"count","description":"Total number of shards","readonly":true,"type":[[["number"]]],"meta":{"line":73,"file":"ShardClientUtil.js","path":"src/sharding"}}],"methods":[{"name":"send","description":"Sends a message to the master process.","emits":["Shard#event:message"],"params":[{"name":"message","description":"Message to send","type":[["*"]]}],"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":83,"file":"ShardClientUtil.js","path":"src/sharding"}},{"name":"fetchClientValues","description":"Fetches a client property value of each shard, or a given shard.","see":["{@link ShardingManager#fetchClientValues}"],"examples":["client.shard.fetchClientValues('guilds.cache.size')\n .then(results => console.log(`${results.reduce((prev, val) => prev + val, 0)} total guilds`))\n .catch(console.error);"],"params":[{"name":"prop","description":"Name of the client property to get, using periods for nesting","type":[[["string"]]]},{"name":"shard","description":"Shard to fetch property from, all if undefined","optional":true,"type":[[["number"]]]}],"returns":[[["Promise","<("],["*","|"],["Array","<"],["*",">)>"]]],"meta":{"line":108,"file":"ShardClientUtil.js","path":"src/sharding"}},{"name":"broadcastEval","description":"Evaluates a script or function on all shards, or a given shard, in the context of the {@link Client}s.","see":["{@link ShardingManager#broadcastEval}"],"examples":["client.shard.broadcastEval(client => client.guilds.cache.size)\n .then(results => console.log(`${results.reduce((prev, val) => prev + val, 0)} total guilds`))\n .catch(console.error);"],"params":[{"name":"script","description":"JavaScript to run on each shard","type":[[["function"]]]},{"name":"options","description":"The options for the broadcast","optional":true,"default":"{}","type":[[["BroadcastEvalOptions"]]]}],"returns":{"types":[[["Promise","<("],["*","|"],["Array","<"],["*",">)>"]]],"description":"Results of the script execution"},"meta":{"line":141,"file":"ShardClientUtil.js","path":"src/sharding"}},{"name":"respawnAll","description":"Requests a respawn of all shards.","see":["{@link ShardingManager#respawnAll}"],"params":[{"name":"options","description":"Options for respawning shards","optional":true,"type":[[["MultipleShardRespawnOptions"]]]}],"returns":{"types":[[["Promise","<"],["void",">"]]],"description":"Resolves upon the message being sent"},"meta":{"line":173,"file":"ShardClientUtil.js","path":"src/sharding"}},{"name":"_handleMessage","description":"Handles an IPC message.","access":"private","params":[{"name":"message","description":"Message received","type":[["*"]]}],"async":true,"meta":{"line":182,"file":"ShardClientUtil.js","path":"src/sharding"}},{"name":"_respond","description":"Sends a message to the master process, emitting an error from the client upon failure.","access":"private","params":[{"name":"type","description":"Type of response to send","type":[[["string"]]]},{"name":"message","description":"Message to send","type":[["*"]]}],"meta":{"line":208,"file":"ShardClientUtil.js","path":"src/sharding"}},{"name":"incrementMaxListeners","description":"Increments max listeners by one for a given emitter, if they are not zero.","access":"private","params":[{"name":"emitter","description":"The emitter that emits the events.","type":[[["EventEmitter"]],[["process"]]]}],"meta":{"line":259,"file":"ShardClientUtil.js","path":"src/sharding"}},{"name":"decrementMaxListeners","description":"Decrements max listeners by one for a given emitter, if they are not zero.","access":"private","params":[{"name":"emitter","description":"The emitter that emits the events.","type":[[["EventEmitter"]],[["process"]]]}],"meta":{"line":271,"file":"ShardClientUtil.js","path":"src/sharding"}},{"name":"singleton","description":"Creates/gets the singleton of this class.","scope":"static","params":[{"name":"client","description":"The client to use","type":[[["Client"]]]},{"name":"mode","description":"Mode the shard was spawned with","type":[[["ShardingManagerMode"]]]}],"returns":[[["ShardClientUtil"]]],"meta":{"line":230,"file":"ShardClientUtil.js","path":"src/sharding"}},{"name":"shardIdForGuildId","description":"Get the shard id for a given guild id.","scope":"static","params":[{"name":"guildId","description":"Snowflake guild id to get shard id for","type":[[["Snowflake"]]]},{"name":"shardCount","description":"Number of shards","type":[[["number"]]]}],"returns":[[["number"]]],"meta":{"line":248,"file":"ShardClientUtil.js","path":"src/sharding"}}],"meta":{"line":13,"file":"ShardClientUtil.js","path":"src/sharding"}},{"name":"ShardingManager","description":"This is a utility class that makes multi-process sharding of a bot an easy and painless experience.\nIt works by spawning a self-contained {@link ChildProcess} or {@link Worker} for each individual shard, each\ncontaining its own instance of your bot's {@link Client}. They all have a line of communication with the master\nprocess, and there are several useful methods that utilize it in order to simplify tasks that are normally difficult\nwith sharding. It can spawn a specific number of shards or the amount that Discord suggests for the bot, and takes a\npath to your main bot script to launch for each one.","extends":[[["EventEmitter"]]],"deprecated":true,"construct":{"name":"ShardingManager","params":[{"name":"file","description":"Path to your shard script file","type":[[["string"]]]},{"name":"options","description":"Options for the sharding manager","optional":true,"type":[[["ShardingManagerOptions"]]]}]},"props":[{"name":"file","description":"Path to the shard script file","type":[[["string"]]],"meta":{"line":67,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"shardList","description":"List of shards this sharding manager spawns","type":[[["string"]],[["Array","<"],["number",">"]]],"meta":{"line":77,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"totalShards","description":"Amount of shards that all sharding managers spawn in total","type":[[["number"]]],"meta":{"line":97,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"mode","description":"Mode for shards to spawn with","type":[[["ShardingManagerMode"]]],"meta":{"line":112,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"respawn","description":"Whether shards should automatically respawn upon exiting","type":[[["boolean"]]],"meta":{"line":121,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"shardArgs","description":"An array of arguments to pass to shards (only when {@link ShardingManager#mode} is `process`)","type":[[["Array","<"],["string",">"]]],"meta":{"line":127,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"execArgv","description":"An array of arguments to pass to the executable (only when {@link ShardingManager#mode} is `process`)","type":[[["Array","<"],["string",">"]]],"meta":{"line":133,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"token","description":"Token to use for obtaining the automatic shard count, and passing to shards","nullable":true,"type":[[["string"]]],"meta":{"line":139,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"shards","description":"A collection of shards that this manager has spawned","type":[[["Collection","<"],["number",", "],["Shard",">"]]],"meta":{"line":145,"file":"ShardingManager.js","path":"src/sharding"}}],"methods":[{"name":"createShard","description":"Creates a single shard.\nUsing this method is usually not necessary if you use the spawn method.","params":[{"name":"id","description":"Id of the shard to create\nThis is usually not necessary to manually specify.","optional":true,"default":"this.shards.size","type":[[["number"]]]}],"returns":{"types":[[["Shard"]]],"description":"Note that the created shard needs to be explicitly spawned using its spawn method."},"meta":{"line":159,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"spawn","description":"Spawns multiple shards.","params":[{"name":"options","description":"Options for spawning shards","optional":true,"type":[[["MultipleShardSpawnOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Collection","<"],["number",", "],["Shard",">>"]]],"meta":{"line":184,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"broadcast","description":"Sends a message to all shards.","params":[{"name":"message","description":"Message to be sent to the shards","type":[["*"]]}],"returns":[[["Promise","<"],["Array","<"],["Shard",">>"]]],"meta":{"line":232,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"broadcastEval","description":"Evaluates a script on all shards, or a given shard, in the context of the {@link Client}s.","params":[{"name":"script","description":"JavaScript to run on each shard","type":[[["function"]]]},{"name":"options","description":"The options for the broadcast","optional":true,"default":"{}","type":[[["BroadcastEvalOptions"]]]}],"async":true,"returns":{"types":[[["Promise","<("],["*","|"],["Array","<"],["*",">)>"]]],"description":"Results of the script execution"},"meta":{"line":251,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"fetchClientValues","description":"Fetches a client property value of each shard, or a given shard.","examples":["manager.fetchClientValues('guilds.cache.size')\n .then(results => console.log(`${results.reduce((prev, val) => prev + val, 0)} total guilds`))\n .catch(console.error);"],"params":[{"name":"prop","description":"Name of the client property to get, using periods for nesting","type":[[["string"]]]},{"name":"shard","description":"Shard to fetch property from, all if undefined","optional":true,"type":[[["number"]]]}],"returns":[[["Promise","<("],["*","|"],["Array","<"],["*",">)>"]]],"meta":{"line":266,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"_performOnShards","description":"Runs a method with given arguments on all shards, or a given shard.","access":"private","params":[{"name":"method","description":"Method name to run on each shard","type":[[["string"]]]},{"name":"args","description":"Arguments to pass through to the method call","type":[[["Array","<"],["*",">"]]]},{"name":"shard","description":"Shard to run on, all if undefined","optional":true,"type":[[["number"]]]}],"async":true,"returns":{"types":[[["Promise","<("],["*","|"],["Array","<"],["*",">)>"]]],"description":"Results of the method execution"},"meta":{"line":278,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"respawnAll","description":"Kills all running shards and respawns them.","params":[{"name":"options","description":"Options for respawning shards","optional":true,"type":[[["MultipleShardRespawnOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Collection","<"],["number",", "],["Shard",">>"]]],"meta":{"line":308,"file":"ShardingManager.js","path":"src/sharding"}}],"events":[{"name":"shardCreate","description":"Emitted upon creating a shard.","params":[{"name":"shard","description":"Shard that was created","type":[[["Shard"]]]}],"meta":{"line":162,"file":"ShardingManager.js","path":"src/sharding"}}],"meta":{"line":23,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"AnonymousGuild","description":"Bundles common attributes and methods between {@link Guild} and {@link InviteGuild}","extends":[[["BaseGuild"]]],"abstract":true,"props":[{"name":"splash","description":"The hash of the guild invite splash image","nullable":true,"type":[[["string"]]],"meta":{"line":25,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"banner","description":"The hash of the guild banner","nullable":true,"type":[[["string"]]],"meta":{"line":33,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"description","description":"The description of the guild, if any","nullable":true,"type":[[["string"]]],"meta":{"line":41,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"verificationLevel","description":"The verification level of the guild","type":[[["VerificationLevel"]]],"meta":{"line":49,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"vanityURLCode","description":"The vanity invite code of the guild, if any","nullable":true,"type":[[["string"]]],"meta":{"line":57,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"nsfwLevel","description":"The NSFW level of this guild","type":[[["NSFWLevel"]]],"meta":{"line":65,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"premiumSubscriptionCount","description":"The total number of boosts for this server","nullable":true,"type":[[["number"]]],"meta":{"line":73,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"id","description":"The guild's id","type":[[["Snowflake"]]],"meta":{"line":19,"file":"BaseGuild.js","path":"src/structures"}},{"name":"name","description":"The name of this guild","type":[[["string"]]],"meta":{"line":25,"file":"BaseGuild.js","path":"src/structures"}},{"name":"icon","description":"The icon hash of this guild","nullable":true,"type":[[["string"]]],"meta":{"line":31,"file":"BaseGuild.js","path":"src/structures"}},{"name":"features","description":"An array of features available to this guild","type":[[["Array","<"],["Features",">"]]],"meta":{"line":37,"file":"BaseGuild.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp this guild was created at","readonly":true,"type":[[["number"]]],"meta":{"line":45,"file":"BaseGuild.js","path":"src/structures"}},{"name":"createdAt","description":"The time this guild was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":54,"file":"BaseGuild.js","path":"src/structures"}},{"name":"nameAcronym","description":"The acronym that shows up in place of a guild icon","readonly":true,"type":[[["string"]]],"meta":{"line":63,"file":"BaseGuild.js","path":"src/structures"}},{"name":"partnered","description":"Whether this guild is partnered","readonly":true,"type":[[["boolean"]]],"meta":{"line":75,"file":"BaseGuild.js","path":"src/structures"}},{"name":"verified","description":"Whether this guild is verified","readonly":true,"type":[[["boolean"]]],"meta":{"line":84,"file":"BaseGuild.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"bannerURL","description":"The URL to this guild's banner.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":84,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"splashURL","description":"The URL to this guild's invite splash image.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":93,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"iconURL","description":"The URL to this guild's icon.","inherits":"BaseGuild#iconURL","inherited":true,"params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["ImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":93,"file":"BaseGuild.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this guild.","inherits":"BaseGuild#fetch","inherited":true,"async":true,"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":102,"file":"BaseGuild.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the guild's name instead of the Guild object.","inherits":"BaseGuild#toString","inherited":true,"returns":[[["string"]]],"meta":{"line":111,"file":"BaseGuild.js","path":"src/structures"}}],"meta":{"line":11,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"ApplicationCommand","description":"Represents an application command.","extends":[[["Base"]]],"props":[{"name":"id","description":"The command's id","type":[[["Snowflake"]]],"meta":{"line":21,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"applicationId","description":"The parent application's id","type":[[["Snowflake"]]],"meta":{"line":27,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"guild","description":"The guild this command is part of","nullable":true,"type":[[["Guild"]]],"meta":{"line":33,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"guildId","description":"The guild's id this command is part of, this may be non-null when `guild` is `null` if the command\nwas fetched from the `ApplicationCommandManager`","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":40,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"permissions","description":"The manager for permissions of this command on its guild or arbitrary guilds when the command is global","type":[[["ApplicationCommandPermissionsManager"]]],"meta":{"line":46,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"type","description":"The type of this application command","type":[[["ApplicationCommandType"]]],"meta":{"line":52,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"name","description":"The name of this command","type":[[["string"]]],"meta":{"line":63,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"nameLocalizations","description":"The name localizations for this command","nullable":true,"type":[[["Object","<"],["Locale",", "],["string",">"]]],"meta":{"line":71,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"nameLocalized","description":"The localized name for this command","nullable":true,"type":[[["string"]]],"meta":{"line":81,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"description","description":"The description of this command","type":[[["string"]]],"meta":{"line":91,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"descriptionLocalizations","description":"The description localizations for this command","nullable":true,"type":[[["Object","<"],["Locale",", "],["string",">"]]],"meta":{"line":99,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"descriptionLocalized","description":"The localized description for this command","nullable":true,"type":[[["string"]]],"meta":{"line":109,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"options","description":"The options of this command","type":[[["Array","<"],["ApplicationCommandOption",">"]]],"meta":{"line":119,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"defaultPermission","description":"Whether the command is enabled by default when the app is added to a guild","deprecated":"Use {@link ApplicationCommand.defaultMemberPermissions} and {@link ApplicationCommand.dmPermission} instead.","type":[[["boolean"]]],"meta":{"line":131,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"defaultMemberPermissions","description":"The default bitfield used to determine whether this command be used in a guild","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":140,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"dmPermission","description":"Whether the command can be used in DMs\nThis property is always `null` on guild commands","nullable":true,"type":[[["boolean"]]],"meta":{"line":153,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"version","description":"Autoincrementing version identifier updated during substantial record changes","type":[[["Snowflake"]]],"meta":{"line":163,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the command was created at","readonly":true,"type":[[["number"]]],"meta":{"line":172,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"createdAt","description":"The time the command was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":181,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"manager","description":"The manager that this command belongs to","readonly":true,"type":[[["ApplicationCommandManager"]]],"meta":{"line":190,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"edit","description":"Edits this application command.","examples":["// Edit the description of this command\ncommand.edit({\n description: 'New description',\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"data","description":"The data to update the command with","type":[[["Partial","<"],["ApplicationCommandData",">"]]]}],"returns":[[["Promise","<"],["ApplicationCommand",">"]]],"meta":{"line":254,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"setName","description":"Edits the name of this ApplicationCommand","params":[{"name":"name","description":"The new name of the command","type":[[["string"]]]}],"returns":[[["Promise","<"],["ApplicationCommand",">"]]],"meta":{"line":263,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"setNameLocalizations","description":"Edits the localized names of this ApplicationCommand","examples":["// Edit the name localizations of this command\ncommand.setLocalizedNames({\n 'en-GB': 'test',\n 'pt-BR': 'teste',\n})\n .then(console.log)\n .catch(console.error)"],"params":[{"name":"nameLocalizations","description":"The new localized names for the command","type":[[["Object","<"],["Locale",", "],["string",">"]]]}],"returns":[[["Promise","<"],["ApplicationCommand",">"]]],"meta":{"line":280,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"setDescription","description":"Edits the description of this ApplicationCommand","params":[{"name":"description","description":"The new description of the command","type":[[["string"]]]}],"returns":[[["Promise","<"],["ApplicationCommand",">"]]],"meta":{"line":289,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"setDescriptionLocalizations","description":"Edits the localized descriptions of this ApplicationCommand","examples":["// Edit the description localizations of this command\ncommand.setLocalizedDescriptions({\n 'en-GB': 'A test command',\n 'pt-BR': 'Um comando de teste',\n})\n .then(console.log)\n .catch(console.error)"],"params":[{"name":"descriptionLocalizations","description":"The new localized descriptions for the command","type":[[["Object","<"],["Locale",", "],["string",">"]]]}],"returns":[[["Promise","<"],["ApplicationCommand",">"]]],"meta":{"line":306,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"setDefaultPermission","description":"Edits the default permission of this ApplicationCommand","deprecated":"Use {@link ApplicationCommand#setDefaultMemberPermissions} and {@link ApplicationCommand#setDMPermission} instead.","params":[{"name":"defaultPermission","description":"The default permission for this command","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["ApplicationCommand",">"]]],"meta":{"line":317,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"setDefaultMemberPermissions","description":"Edits the default member permissions of this ApplicationCommand","params":[{"name":"defaultMemberPermissions","description":"The default member permissions required to run this command","nullable":true,"type":[[["PermissionResolvable"]]]}],"returns":[[["Promise","<"],["ApplicationCommand",">"]]],"meta":{"line":327,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"setDMPermission","description":"Edits the DM permission of this ApplicationCommand","params":[{"name":"dmPermission","description":"Whether the command can be used in DMs","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["ApplicationCommand",">"]]],"meta":{"line":336,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"setOptions","description":"Edits the options of this ApplicationCommand","params":[{"name":"options","description":"The options to set for this command","type":[[["Array","<"],["ApplicationCommandOptionData",">"]]]}],"returns":[[["Promise","<"],["ApplicationCommand",">"]]],"meta":{"line":345,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"delete","description":"Deletes this command.","examples":["// Delete this command\ncommand.delete()\n .then(console.log)\n .catch(console.error);"],"returns":[[["Promise","<"],["ApplicationCommand",">"]]],"meta":{"line":358,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"equals","description":"Whether this command equals another command. It compares all properties, so for most operations\nit is advisable to just compare `command.id === command2.id` as it is much faster and is often\nwhat most users need.","params":[{"name":"command","description":"The command to compare with","type":[[["ApplicationCommand"]],[["ApplicationCommandData"]],[["APIApplicationCommand"]]]},{"name":"enforceOptionOrder","description":"Whether to strictly check that options and choices are in the same\norder in the array The client may not always respect this ordering!","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":[[["boolean"]]],"meta":{"line":371,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"optionsEqual","description":"Recursively checks that all options for an {@link ApplicationCommand} are equal to the provided options.\nIn most cases it is better to compare using {@link ApplicationCommand#equals}","scope":"static","params":[{"name":"existing","description":"The options on the existing command,\nshould be {@link ApplicationCommand#options}","type":[[["Array","<"],["ApplicationCommandOptionData",">"]]]},{"name":"options","description":"The options to compare against","type":[[["Array","<"],["ApplicationCommandOptionData",">"]],[["Array","<"],["APIApplicationCommandOption",">"]]]},{"name":"enforceOptionOrder","description":"Whether to strictly check that options and choices are in the same\norder in the array The client may not always respect this ordering!","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":[[["boolean"]]],"meta":{"line":423,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"_optionEquals","description":"Checks that an option for an {@link ApplicationCommand} is equal to the provided option\nIn most cases it is better to compare using {@link ApplicationCommand#equals}","scope":"static","access":"private","params":[{"name":"existing","description":"The option on the existing command,\nshould be from {@link ApplicationCommand#options}","type":[[["ApplicationCommandOptionData"]]]},{"name":"option","description":"The option to compare against","type":[[["ApplicationCommandOptionData"]],[["APIApplicationCommandOption"]]]},{"name":"enforceOptionOrder","description":"Whether to strictly check that options or choices are in the same\norder in their array The client may not always respect this ordering!","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":[[["boolean"]]],"meta":{"line":447,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"transformOption","description":"Transforms an {@link ApplicationCommandOptionData} object into something that can be used with the API.","scope":"static","access":"private","params":[{"name":"option","description":"The option to transform","type":[[["ApplicationCommandOptionData"]],[["ApplicationCommandOption"]]]},{"name":"received","description":"Whether this option has been received from Discord","optional":true,"type":[[["boolean"]]]}],"returns":[[["APIApplicationCommandOption"]]],"meta":{"line":540,"file":"ApplicationCommand.js","path":"src/structures"}}],"meta":{"line":13,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"ApplicationRoleConnectionMetadata","description":"Role connection metadata object for an application.","props":[{"name":"name","description":"The name of this metadata field","type":[[["string"]]],"meta":{"line":14,"file":"ApplicationRoleConnectionMetadata.js","path":"src/structures"}},{"name":"nameLocalizations","description":"The name localizations for this metadata field","nullable":true,"type":[[["Object","<"],["Locale",", "],["string",">"]]],"meta":{"line":20,"file":"ApplicationRoleConnectionMetadata.js","path":"src/structures"}},{"name":"description","description":"The description of this metadata field","type":[[["string"]]],"meta":{"line":26,"file":"ApplicationRoleConnectionMetadata.js","path":"src/structures"}},{"name":"descriptionLocalizations","description":"The description localizations for this metadata field","nullable":true,"type":[[["Object","<"],["Locale",", "],["string",">"]]],"meta":{"line":32,"file":"ApplicationRoleConnectionMetadata.js","path":"src/structures"}},{"name":"key","description":"The dictionary key for this metadata field","type":[[["string"]]],"meta":{"line":38,"file":"ApplicationRoleConnectionMetadata.js","path":"src/structures"}},{"name":"type","description":"The type of this metadata field","type":[[["ApplicationRoleConnectionMetadataType"]]],"meta":{"line":44,"file":"ApplicationRoleConnectionMetadata.js","path":"src/structures"}}],"meta":{"line":8,"file":"ApplicationRoleConnectionMetadata.js","path":"src/structures"}},{"name":"AutocompleteInteraction","description":"Represents an autocomplete interaction.","extends":[[["Interaction"]]],"props":[{"name":"channelId","description":"The id of the channel this interaction was sent in","type":[[["Snowflake"]]],"meta":{"line":16,"file":"AutocompleteInteraction.js","path":"src/structures"}},{"name":"commandId","description":"The invoked application command's id","type":[[["Snowflake"]]],"meta":{"line":26,"file":"AutocompleteInteraction.js","path":"src/structures"}},{"name":"commandName","description":"The invoked application command's name","type":[[["string"]]],"meta":{"line":32,"file":"AutocompleteInteraction.js","path":"src/structures"}},{"name":"responded","description":"Whether this interaction has already received a response","type":[[["boolean"]]],"meta":{"line":38,"file":"AutocompleteInteraction.js","path":"src/structures"}},{"name":"options","description":"The options passed to the command","type":[[["CommandInteractionOptionResolver"]]],"meta":{"line":44,"file":"AutocompleteInteraction.js","path":"src/structures"}},{"name":"command","description":"The invoked application command, if it was fetched before","nullable":true,"type":[[["ApplicationCommand"]]],"meta":{"line":54,"file":"AutocompleteInteraction.js","path":"src/structures"}},{"name":"type","description":"The interaction's type","type":[[["InteractionType"]]],"meta":{"line":20,"file":"Interaction.js","path":"src/structures"}},{"name":"id","description":"The interaction's id","type":[[["Snowflake"]]],"meta":{"line":26,"file":"Interaction.js","path":"src/structures"}},{"name":"token","description":"The interaction's token","readonly":true,"type":[[["string"]]],"meta":{"line":28,"file":"Interaction.js","path":"src/structures"}},{"name":"applicationId","description":"The application's id","type":[[["Snowflake"]]],"meta":{"line":40,"file":"Interaction.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild this interaction was sent in","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":52,"file":"Interaction.js","path":"src/structures"}},{"name":"user","description":"The user which sent this interaction","type":[[["User"]]],"meta":{"line":58,"file":"Interaction.js","path":"src/structures"}},{"name":"member","description":"If this interaction was sent in a guild, the member which sent it","nullable":true,"type":[[["GuildMember"]],[["APIGuildMember"]]],"meta":{"line":64,"file":"Interaction.js","path":"src/structures"}},{"name":"version","description":"The version","type":[[["number"]]],"meta":{"line":70,"file":"Interaction.js","path":"src/structures"}},{"name":"appPermissions","description":"Set of permissions the application or bot has within the channel the interaction was sent from","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":76,"file":"Interaction.js","path":"src/structures"}},{"name":"memberPermissions","description":"The permissions of the member, if one exists, in the channel this interaction was executed in","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":82,"file":"Interaction.js","path":"src/structures"}},{"name":"locale","description":"The locale of the user who invoked this interaction","type":[[["Locale"]]],"meta":{"line":124,"file":"Interaction.js","path":"src/structures"}},{"name":"guildLocale","description":"The preferred locale from the guild this interaction was sent in","nullable":true,"type":[[["Locale"]]],"meta":{"line":130,"file":"Interaction.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the interaction was created at","readonly":true,"type":[[["number"]]],"meta":{"line":138,"file":"Interaction.js","path":"src/structures"}},{"name":"createdAt","description":"The time the interaction was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":147,"file":"Interaction.js","path":"src/structures"}},{"name":"channel","description":"The channel this interaction was sent in","readonly":true,"nullable":true,"type":[[["TextBasedChannels"]]],"meta":{"line":156,"file":"Interaction.js","path":"src/structures"}},{"name":"guild","description":"The guild this interaction was sent in","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":165,"file":"Interaction.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"transformOption","description":"Transforms an option received from the API.","access":"private","params":[{"name":"option","description":"The received option","type":[[["APIApplicationCommandOption"]]]}],"returns":[[["CommandInteractionOption"]]],"meta":{"line":65,"file":"AutocompleteInteraction.js","path":"src/structures"}},{"name":"respond","description":"Sends results for the autocomplete of this interaction.","examples":["// respond to autocomplete interaction\ninteraction.respond([\n {\n name: 'Option 1',\n value: 'option1',\n },\n])\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the autocomplete","type":[[["Array","<"],["ApplicationCommandOptionChoiceData",">"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":93,"file":"AutocompleteInteraction.js","path":"src/structures"}},{"name":"inGuild","description":"Indicates whether this interaction is received from a guild.","inherits":"Interaction#inGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":173,"file":"Interaction.js","path":"src/structures"}},{"name":"inCachedGuild","description":"Indicates whether or not this interaction is both cached and received from a guild.","inherits":"Interaction#inCachedGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":181,"file":"Interaction.js","path":"src/structures"}},{"name":"inRawGuild","description":"Indicates whether or not this interaction is received from an uncached guild.","inherits":"Interaction#inRawGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":189,"file":"Interaction.js","path":"src/structures"}},{"name":"isApplicationCommand","description":"Indicates whether this interaction is a {@link BaseCommandInteraction}.","inherits":"Interaction#isApplicationCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":197,"file":"Interaction.js","path":"src/structures"}},{"name":"isCommand","description":"Indicates whether this interaction is a {@link CommandInteraction}.","inherits":"Interaction#isCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":205,"file":"Interaction.js","path":"src/structures"}},{"name":"isContextMenu","description":"Indicates whether this interaction is a {@link ContextMenuInteraction}","inherits":"Interaction#isContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":213,"file":"Interaction.js","path":"src/structures"}},{"name":"isModalSubmit","description":"Indicates whether this interaction is a {@link ModalSubmitInteraction}","inherits":"Interaction#isModalSubmit","inherited":true,"returns":[[["boolean"]]],"meta":{"line":221,"file":"Interaction.js","path":"src/structures"}},{"name":"isUserContextMenu","description":"Indicates whether this interaction is a {@link UserContextMenuInteraction}","inherits":"Interaction#isUserContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":229,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageContextMenu","description":"Indicates whether this interaction is a {@link MessageContextMenuInteraction}","inherits":"Interaction#isMessageContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":237,"file":"Interaction.js","path":"src/structures"}},{"name":"isAutocomplete","description":"Indicates whether this interaction is an {@link AutocompleteInteraction}","inherits":"Interaction#isAutocomplete","inherited":true,"returns":[[["boolean"]]],"meta":{"line":245,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageComponent","description":"Indicates whether this interaction is a {@link MessageComponentInteraction}.","inherits":"Interaction#isMessageComponent","inherited":true,"returns":[[["boolean"]]],"meta":{"line":253,"file":"Interaction.js","path":"src/structures"}},{"name":"isButton","description":"Indicates whether this interaction is a {@link ButtonInteraction}.","inherits":"Interaction#isButton","inherited":true,"returns":[[["boolean"]]],"meta":{"line":261,"file":"Interaction.js","path":"src/structures"}},{"name":"isSelectMenu","description":"Indicates whether this interaction is a {@link SelectMenuInteraction}.","inherits":"Interaction#isSelectMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":272,"file":"Interaction.js","path":"src/structures"}},{"name":"isRepliable","description":"Indicates whether this interaction can be replied to.","inherits":"Interaction#isRepliable","inherited":true,"returns":[[["boolean"]]],"meta":{"line":283,"file":"Interaction.js","path":"src/structures"}}],"meta":{"line":12,"file":"AutocompleteInteraction.js","path":"src/structures"}},{"name":"AutoModerationActionExecution","description":"Represents the structure of an executed action when an {@link AutoModerationRule} is triggered.","props":[{"name":"guild","description":"The guild where this action was executed from.","type":[[["Guild"]]],"meta":{"line":14,"file":"AutoModerationActionExecution.js","path":"src/structures"}},{"name":"action","description":"The action that was executed.","type":[[["AutoModerationAction"]]],"meta":{"line":20,"file":"AutoModerationActionExecution.js","path":"src/structures"}},{"name":"ruleId","description":"The id of the auto moderation rule this action belongs to.","type":[[["Snowflake"]]],"meta":{"line":26,"file":"AutoModerationActionExecution.js","path":"src/structures"}},{"name":"ruleTriggerType","description":"The trigger type of the auto moderation rule which was triggered.","type":[[["AutoModerationRuleTriggerType"]]],"meta":{"line":32,"file":"AutoModerationActionExecution.js","path":"src/structures"}},{"name":"userId","description":"The id of the user that triggered this action.","type":[[["Snowflake"]]],"meta":{"line":38,"file":"AutoModerationActionExecution.js","path":"src/structures"}},{"name":"channelId","description":"The id of the channel where this action was triggered from.","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":44,"file":"AutoModerationActionExecution.js","path":"src/structures"}},{"name":"messageId","description":"The id of the message that triggered this action.","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":51,"file":"AutoModerationActionExecution.js","path":"src/structures"}},{"name":"alertSystemMessageId","description":"The id of any system auto moderation messages posted as a result of this action.","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":57,"file":"AutoModerationActionExecution.js","path":"src/structures"}},{"name":"content","description":"The content that triggered this action.\nThis property requires the {@link Intents.FLAGS.MESSAGE_CONTENT} privileged gateway intent.","type":[[["string"]]],"meta":{"line":64,"file":"AutoModerationActionExecution.js","path":"src/structures"}},{"name":"matchedKeyword","description":"The word or phrase configured in the rule that triggered this action.","nullable":true,"type":[[["string"]]],"meta":{"line":70,"file":"AutoModerationActionExecution.js","path":"src/structures"}},{"name":"matchedContent","description":"The substring in content that triggered this action.","nullable":true,"type":[[["string"]]],"meta":{"line":76,"file":"AutoModerationActionExecution.js","path":"src/structures"}},{"name":"autoModerationRule","description":"The auto moderation rule this action belongs to.","readonly":true,"nullable":true,"type":[[["AutoModerationRule"]]],"meta":{"line":84,"file":"AutoModerationActionExecution.js","path":"src/structures"}}],"meta":{"line":8,"file":"AutoModerationActionExecution.js","path":"src/structures"}},{"name":"AutoModerationRule","description":"Represents an auto moderation rule.","extends":[[["Base"]]],"props":[{"name":"id","description":"The id of this auto moderation rule.","type":[[["Snowflake"]]],"meta":{"line":24,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"guild","description":"The guild this auto moderation rule is for.","type":[[["Guild"]]],"meta":{"line":30,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"creatorId","description":"The user that created this auto moderation rule.","type":[[["Snowflake"]]],"meta":{"line":36,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"triggerType","description":"The trigger type of this auto moderation rule.","type":[[["AutoModerationRuleTriggerType"]]],"meta":{"line":42,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"name","description":"The name of this auto moderation rule.","type":[[["string"]]],"meta":{"line":53,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"eventType","description":"The event type of this auto moderation rule.","type":[[["AutoModerationRuleEventType"]]],"meta":{"line":61,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"triggerMetadata","description":"The trigger metadata of the rule.","type":[[["AutoModerationTriggerMetadata"]]],"meta":{"line":83,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"actions","description":"The actions of this auto moderation rule.","type":[[["Array","<"],["AutoModerationAction",">"]]],"meta":{"line":113,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"enabled","description":"Whether this auto moderation rule is enabled.","type":[[["boolean"]]],"meta":{"line":128,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"exemptRoles","description":"The roles exempt by this auto moderation rule.","type":[[["Collection","<"],["Snowflake",", "],["Role",">"]]],"meta":{"line":136,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"exemptChannels","description":"The channels exempt by this auto moderation rule.","type":[[["Collection","<"],["Snowflake",", ("],["GuildChannel","|"],["ThreadChannel",")>"]]],"meta":{"line":146,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"edit","description":"Edits this auto moderation rule.","params":[{"name":"options","description":"Options for editing this auto moderation rule","type":[[["AutoModerationRuleEditOptions"]]]}],"returns":[[["Promise","<"],["AutoModerationRule",">"]]],"meta":{"line":157,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"delete","description":"Deletes this auto moderation rule.","params":[{"name":"reason","description":"The reason for deleting this auto moderation rule","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":166,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"setName","description":"Sets the name for this auto moderation rule.","params":[{"name":"name","description":"The name of this auto moderation rule","type":[[["string"]]]},{"name":"reason","description":"The reason for changing the name of this auto moderation rule","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["AutoModerationRule",">"]]],"meta":{"line":176,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"setEventType","description":"Sets the event type for this auto moderation rule.","params":[{"name":"eventType","description":"The event type of this auto moderation rule","type":[[["AutoModerationRuleEventType"]]]},{"name":"reason","description":"The reason for changing the event type of this auto moderation rule","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["AutoModerationRule",">"]]],"meta":{"line":186,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"setKeywordFilter","description":"Sets the keyword filter for this auto moderation rule.","params":[{"name":"keywordFilter","description":"The keyword filter of this auto moderation rule","type":[[["Array","<"],["string",">"]]]},{"name":"reason","description":"The reason for changing the keyword filter of this auto moderation rule","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["AutoModerationRule",">"]]],"meta":{"line":196,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"setRegexPatterns","description":"Sets the regular expression patterns for this auto moderation rule.","params":[{"name":"regexPatterns","description":"The regular expression patterns of this auto moderation rule\nOnly Rust-flavored regular expressions are supported.","type":[[["Array","<"],["string",">"]]]},{"name":"reason","description":"The reason for changing the regular expression patterns of this auto moderation rule","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["AutoModerationRule",">"]]],"meta":{"line":207,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"setPresets","description":"Sets the presets for this auto moderation rule.","params":[{"name":"presets","description":"The presets of this auto moderation rule","type":[[["Array","<"],["AutoModerationRuleKeywordPresetType",">"]]]},{"name":"reason","description":"The reason for changing the presets of this auto moderation rule","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["AutoModerationRule",">"]]],"meta":{"line":217,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"setAllowList","description":"Sets the allow list for this auto moderation rule.","params":[{"name":"allowList","description":"The allow list of this auto moderation rule","type":[[["Array","<"],["string",">"]]]},{"name":"reason","description":"The reason for changing the allow list of this auto moderation rule","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["AutoModerationRule",">"]]],"meta":{"line":227,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"setMentionTotalLimit","description":"Sets the mention total limit for this auto moderation rule.","params":[{"name":"mentionTotalLimit","description":"The mention total limit of this auto moderation rule","type":[[["number"]]]},{"name":"reason","description":"The reason for changing the mention total limit of this auto moderation rule","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["AutoModerationRule",">"]]],"meta":{"line":237,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"setMentionRaidProtectionEnabled","description":"Sets whether to enable mention raid protection for this auto moderation rule.","params":[{"name":"mentionRaidProtectionEnabled","description":"Whether to enable mention raid protection for this auto moderation rule","type":[[["boolean"]]]},{"name":"reason","description":"The reason for changing the mention raid protection of this auto moderation rule","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["AutoModerationRule",">"]]],"meta":{"line":248,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"setActions","description":"Sets the actions for this auto moderation rule.","params":[{"name":"actions","description":"The actions of this auto moderation rule","type":[[["Array","<"],["AutoModerationActionOptions",">"]]]},{"name":"reason","description":"The reason for changing the actions of this auto moderation rule","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["AutoModerationRule",">"]]],"meta":{"line":258,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"setEnabled","description":"Sets whether this auto moderation rule should be enabled.","params":[{"name":"enabled","description":"Whether to enable this auto moderation rule","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"The reason for enabling or disabling this auto moderation rule","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["AutoModerationRule",">"]]],"meta":{"line":268,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"setExemptRoles","description":"Sets the exempt roles for this auto moderation rule.","params":[{"name":"exemptRoles","description":"The exempt roles of this auto moderation rule","optional":true,"type":[[["Collection","<"],["Snowflake",", "],["Role",">"]],[["Array","<"],["RoleResolvable",">"]]]},{"name":"reason","description":"The reason for changing the exempt roles of this auto moderation rule","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["AutoModerationRule",">"]]],"meta":{"line":278,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"setExemptChannels","description":"Sets the exempt channels for this auto moderation rule.","params":[{"name":"exemptChannels","description":"The exempt channels of this auto moderation rule","optional":true,"type":[[["Collection","<"],["Snowflake",", ("],["GuildChannel","|"],["ThreadChannel",")>"]],[["Array","<"],["GuildChannelResolvable",">"]]]},{"name":"reason","description":"The reason for changing the exempt channels of this auto moderation rule","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["AutoModerationRule",">"]]],"meta":{"line":289,"file":"AutoModerationRule.js","path":"src/structures"}}],"meta":{"line":16,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"Base","description":"Represents a data model that is identifiable by a Snowflake (i.e. Discord API data models).","abstract":true,"props":[{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"meta":{"line":9,"file":"Base.js","path":"src/structures"}},{"name":"BaseCommandInteraction","description":"Represents a command interaction.","extends":[[["Interaction"]]],"implements":[[["InteractionResponses"]]],"abstract":true,"props":[{"name":"channelId","description":"The id of the channel this interaction was sent in","type":[[["Snowflake"]]],"meta":{"line":20,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"commandId","description":"The invoked application command's id","type":[[["Snowflake"]]],"meta":{"line":30,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"commandName","description":"The invoked application command's name","type":[[["string"]]],"meta":{"line":36,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"deferred","description":"Whether the reply to this interaction has been deferred","type":[[["boolean"]]],"meta":{"line":42,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"replied","description":"Whether this interaction has already been replied to","type":[[["boolean"]]],"meta":{"line":48,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"ephemeral","description":"Whether the reply to this interaction is ephemeral","nullable":true,"type":[[["boolean"]]],"meta":{"line":54,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"webhook","description":"An associated interaction webhook, can be used to further interact with this interaction","type":[[["InteractionWebhook"]]],"meta":{"line":60,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"command","description":"The invoked application command, if it was fetched before","nullable":true,"type":[[["ApplicationCommand"]]],"meta":{"line":67,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"type","description":"The interaction's type","type":[[["InteractionType"]]],"meta":{"line":20,"file":"Interaction.js","path":"src/structures"}},{"name":"id","description":"The interaction's id","type":[[["Snowflake"]]],"meta":{"line":26,"file":"Interaction.js","path":"src/structures"}},{"name":"token","description":"The interaction's token","readonly":true,"type":[[["string"]]],"meta":{"line":28,"file":"Interaction.js","path":"src/structures"}},{"name":"applicationId","description":"The application's id","type":[[["Snowflake"]]],"meta":{"line":40,"file":"Interaction.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild this interaction was sent in","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":52,"file":"Interaction.js","path":"src/structures"}},{"name":"user","description":"The user which sent this interaction","type":[[["User"]]],"meta":{"line":58,"file":"Interaction.js","path":"src/structures"}},{"name":"member","description":"If this interaction was sent in a guild, the member which sent it","nullable":true,"type":[[["GuildMember"]],[["APIGuildMember"]]],"meta":{"line":64,"file":"Interaction.js","path":"src/structures"}},{"name":"version","description":"The version","type":[[["number"]]],"meta":{"line":70,"file":"Interaction.js","path":"src/structures"}},{"name":"appPermissions","description":"Set of permissions the application or bot has within the channel the interaction was sent from","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":76,"file":"Interaction.js","path":"src/structures"}},{"name":"memberPermissions","description":"The permissions of the member, if one exists, in the channel this interaction was executed in","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":82,"file":"Interaction.js","path":"src/structures"}},{"name":"locale","description":"The locale of the user who invoked this interaction","type":[[["Locale"]]],"meta":{"line":124,"file":"Interaction.js","path":"src/structures"}},{"name":"guildLocale","description":"The preferred locale from the guild this interaction was sent in","nullable":true,"type":[[["Locale"]]],"meta":{"line":130,"file":"Interaction.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the interaction was created at","readonly":true,"type":[[["number"]]],"meta":{"line":138,"file":"Interaction.js","path":"src/structures"}},{"name":"createdAt","description":"The time the interaction was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":147,"file":"Interaction.js","path":"src/structures"}},{"name":"channel","description":"The channel this interaction was sent in","readonly":true,"nullable":true,"type":[[["TextBasedChannels"]]],"meta":{"line":156,"file":"Interaction.js","path":"src/structures"}},{"name":"guild","description":"The guild this interaction was sent in","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":165,"file":"Interaction.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"transformResolved","description":"Transforms the resolved received from the API.","access":"private","params":[{"name":"resolved","description":"The received resolved objects","type":[[["APIInteractionDataResolved"]]]}],"returns":[[["CommandInteractionResolvedData"]]],"meta":{"line":89,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"transformOption","description":"Transforms an option received from the API.","access":"private","params":[{"name":"option","description":"The received option","type":[[["APIApplicationCommandOption"]]]},{"name":"resolved","description":"The resolved interaction data","type":[[["APIInteractionDataResolved"]]]}],"returns":[[["CommandInteractionOption"]]],"meta":{"line":162,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"deferReply","description":"Defers the reply to this interaction.","implements":["InteractionResponses#deferReply"],"examples":["// Defer the reply to this interaction\ninteraction.deferReply()\n .then(console.log)\n .catch(console.error)","// Defer to send an ephemeral reply later\ninteraction.deferReply({ ephemeral: true })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for deferring the reply to this interaction","optional":true,"type":[[["InteractionDeferReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":58,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"reply","description":"Creates a reply to this interaction.\nUse the `fetchReply` option to get the bot's reply message.","implements":["InteractionResponses#reply"],"examples":["// Reply to the interaction and fetch the response\ninteraction.reply({ content: 'Pong!', fetchReply: true })\n .then((message) => console.log(`Reply sent with content ${message.content}`))\n .catch(console.error);","// Create an ephemeral reply with an embed\nconst embed = new MessageEmbed().setDescription('Pong!');\n\ninteraction.reply({ embeds: [embed], ephemeral: true })\n .then(() => console.log('Reply sent.'))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":93,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"fetchReply","description":"Fetches a reply to this interaction.","see":["Webhook#fetchMessage"],"implements":["InteractionResponses#fetchReply"],"examples":["// Fetch the initial reply to this interaction\ninteraction.fetchReply()\n .then(reply => console.log(`Replied with ${reply.content}`))\n .catch(console.error);"],"params":[{"name":"message","description":"The response to fetch","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":127,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"editReply","description":"Edits a reply to this interaction.","see":["Webhook#editMessage"],"implements":["InteractionResponses#editReply"],"examples":["// Edit the initial reply to this interaction\ninteraction.editReply('New content')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The new options for the message","type":[[["string"]],[["MessagePayload"]],[["InteractionEditReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":148,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"deleteReply","description":"Deletes a reply to this interaction.","see":["Webhook#deleteMessage"],"implements":["InteractionResponses#deleteReply"],"examples":["// Delete the initial reply to this interaction\ninteraction.deleteReply()\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"message","description":"The response to delete","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":166,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"followUp","description":"Send a follow-up message to this interaction.","implements":["InteractionResponses#followUp"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":175,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"showModal","description":"Shows a modal component","implements":["InteractionResponses#showModal"],"params":[{"name":"modal","description":"The modal to show","type":[[["Modal"]],[["ModalOptions"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":243,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"awaitModalSubmit","description":"Collects a single modal submit interaction that passes the filter.\nThe Promise will reject if the time expires.","implements":["InteractionResponses#awaitModalSubmit"],"examples":["// Collect a modal submit interaction\nconst filter = (interaction) => interaction.customId === 'modal';\ninteraction.awaitModalSubmit({ filter, time: 15_000 })\n .then(interaction => console.log(`${interaction.customId} was submitted!`))\n .catch(console.error);"],"params":[{"name":"options","description":"Options to pass to the internal collector","type":[[["AwaitModalSubmitOptions"]]]}],"returns":[[["Promise","<"],["ModalSubmitInteraction",">"]]],"meta":{"line":275,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"inGuild","description":"Indicates whether this interaction is received from a guild.","inherits":"Interaction#inGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":173,"file":"Interaction.js","path":"src/structures"}},{"name":"inCachedGuild","description":"Indicates whether or not this interaction is both cached and received from a guild.","inherits":"Interaction#inCachedGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":181,"file":"Interaction.js","path":"src/structures"}},{"name":"inRawGuild","description":"Indicates whether or not this interaction is received from an uncached guild.","inherits":"Interaction#inRawGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":189,"file":"Interaction.js","path":"src/structures"}},{"name":"isApplicationCommand","description":"Indicates whether this interaction is a {@link BaseCommandInteraction}.","inherits":"Interaction#isApplicationCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":197,"file":"Interaction.js","path":"src/structures"}},{"name":"isCommand","description":"Indicates whether this interaction is a {@link CommandInteraction}.","inherits":"Interaction#isCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":205,"file":"Interaction.js","path":"src/structures"}},{"name":"isContextMenu","description":"Indicates whether this interaction is a {@link ContextMenuInteraction}","inherits":"Interaction#isContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":213,"file":"Interaction.js","path":"src/structures"}},{"name":"isModalSubmit","description":"Indicates whether this interaction is a {@link ModalSubmitInteraction}","inherits":"Interaction#isModalSubmit","inherited":true,"returns":[[["boolean"]]],"meta":{"line":221,"file":"Interaction.js","path":"src/structures"}},{"name":"isUserContextMenu","description":"Indicates whether this interaction is a {@link UserContextMenuInteraction}","inherits":"Interaction#isUserContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":229,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageContextMenu","description":"Indicates whether this interaction is a {@link MessageContextMenuInteraction}","inherits":"Interaction#isMessageContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":237,"file":"Interaction.js","path":"src/structures"}},{"name":"isAutocomplete","description":"Indicates whether this interaction is an {@link AutocompleteInteraction}","inherits":"Interaction#isAutocomplete","inherited":true,"returns":[[["boolean"]]],"meta":{"line":245,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageComponent","description":"Indicates whether this interaction is a {@link MessageComponentInteraction}.","inherits":"Interaction#isMessageComponent","inherited":true,"returns":[[["boolean"]]],"meta":{"line":253,"file":"Interaction.js","path":"src/structures"}},{"name":"isButton","description":"Indicates whether this interaction is a {@link ButtonInteraction}.","inherits":"Interaction#isButton","inherited":true,"returns":[[["boolean"]]],"meta":{"line":261,"file":"Interaction.js","path":"src/structures"}},{"name":"isSelectMenu","description":"Indicates whether this interaction is a {@link SelectMenuInteraction}.","inherits":"Interaction#isSelectMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":272,"file":"Interaction.js","path":"src/structures"}},{"name":"isRepliable","description":"Indicates whether this interaction can be replied to.","inherits":"Interaction#isRepliable","inherited":true,"returns":[[["boolean"]]],"meta":{"line":283,"file":"Interaction.js","path":"src/structures"}}],"meta":{"line":16,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"BaseGuild","description":"The base class for {@link Guild}, {@link OAuth2Guild} and {@link InviteGuild}.","extends":[[["Base"]]],"abstract":true,"props":[{"name":"id","description":"The guild's id","type":[[["Snowflake"]]],"meta":{"line":19,"file":"BaseGuild.js","path":"src/structures"}},{"name":"name","description":"The name of this guild","type":[[["string"]]],"meta":{"line":25,"file":"BaseGuild.js","path":"src/structures"}},{"name":"icon","description":"The icon hash of this guild","nullable":true,"type":[[["string"]]],"meta":{"line":31,"file":"BaseGuild.js","path":"src/structures"}},{"name":"features","description":"An array of features available to this guild","type":[[["Array","<"],["Features",">"]]],"meta":{"line":37,"file":"BaseGuild.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp this guild was created at","readonly":true,"type":[[["number"]]],"meta":{"line":45,"file":"BaseGuild.js","path":"src/structures"}},{"name":"createdAt","description":"The time this guild was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":54,"file":"BaseGuild.js","path":"src/structures"}},{"name":"nameAcronym","description":"The acronym that shows up in place of a guild icon","readonly":true,"type":[[["string"]]],"meta":{"line":63,"file":"BaseGuild.js","path":"src/structures"}},{"name":"partnered","description":"Whether this guild is partnered","readonly":true,"type":[[["boolean"]]],"meta":{"line":75,"file":"BaseGuild.js","path":"src/structures"}},{"name":"verified","description":"Whether this guild is verified","readonly":true,"type":[[["boolean"]]],"meta":{"line":84,"file":"BaseGuild.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"iconURL","description":"The URL to this guild's icon.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["ImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":93,"file":"BaseGuild.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this guild.","async":true,"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":102,"file":"BaseGuild.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the guild's name instead of the Guild object.","returns":[[["string"]]],"meta":{"line":111,"file":"BaseGuild.js","path":"src/structures"}}],"meta":{"line":11,"file":"BaseGuild.js","path":"src/structures"}},{"name":"BaseGuildEmoji","description":"Parent class for {@link GuildEmoji} and {@link GuildPreviewEmoji}.","extends":[[["Emoji"]]],"abstract":true,"props":[{"name":"guild","description":"The guild this emoji is a part of","type":[[["Guild"]],[["GuildPreview"]]],"meta":{"line":18,"file":"BaseGuildEmoji.js","path":"src/structures"}},{"name":"requiresColons","description":"Whether or not this emoji requires colons surrounding it","nullable":true,"type":[[["boolean"]]],"meta":{"line":35,"file":"BaseGuildEmoji.js","path":"src/structures"}},{"name":"managed","description":"Whether this emoji is managed by an external service","nullable":true,"type":[[["boolean"]]],"meta":{"line":43,"file":"BaseGuildEmoji.js","path":"src/structures"}},{"name":"available","description":"Whether this emoji is available","nullable":true,"type":[[["boolean"]]],"meta":{"line":51,"file":"BaseGuildEmoji.js","path":"src/structures"}},{"name":"animated","description":"Whether or not the emoji is animated","nullable":true,"type":[[["boolean"]]],"meta":{"line":34,"file":"Emoji.js","path":"src/structures"}},{"name":"name","description":"The emoji's name","nullable":true,"type":[[["string"]]],"meta":{"line":40,"file":"Emoji.js","path":"src/structures"}},{"name":"id","description":"The emoji's id","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":46,"file":"Emoji.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":54,"file":"Emoji.js","path":"src/structures"}},{"name":"identifier","description":"The identifier of this emoji, used for message reactions","readonly":true,"type":[[["string"]]],"meta":{"line":84,"file":"Emoji.js","path":"src/structures"}},{"name":"url","description":"The URL to the emoji file if it's a custom emoji","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":94,"file":"Emoji.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the emoji was created at, or null if unicode","readonly":true,"nullable":true,"type":[[["number"]]],"meta":{"line":103,"file":"Emoji.js","path":"src/structures"}},{"name":"createdAt","description":"The time the emoji was created at, or null if unicode","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":112,"file":"Emoji.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"toString","description":"When concatenated with a string, this automatically returns the text required to form a graphical emoji on Discord\ninstead of the Emoji object.","inherits":"Emoji#toString","inherited":true,"examples":["// Send a custom emoji from a guild:\nconst emoji = guild.emojis.cache.first();\nmsg.channel.send(`Hello! ${emoji}`);","// Send the emoji used in a reaction to the channel the reaction is part of\nreaction.message.channel.send(`The emoji used was: ${reaction.emoji}`);"],"returns":[[["string"]]],"meta":{"line":128,"file":"Emoji.js","path":"src/structures"}}],"meta":{"line":10,"file":"BaseGuildEmoji.js","path":"src/structures"}},{"name":"BaseGuildTextChannel","description":"Represents a text-based guild channel on Discord.","extends":[[["GuildChannel"]]],"implements":[[["TextBasedChannel"]]],"props":[{"name":"messages","description":"A manager of the messages sent to this channel","type":[[["MessageManager"]]],"meta":{"line":21,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"threads","description":"A manager of the threads belonging to this channel","type":[[["GuildTextThreadManager"]]],"meta":{"line":27,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"nsfw","description":"If the guild considers this channel NSFW","type":[[["boolean"]]],"meta":{"line":33,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"topic","description":"The topic of the text channel","nullable":true,"type":[[["string"]]],"meta":{"line":46,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"lastMessageId","description":"The last message id sent in the channel, if one was sent","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":58,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"lastPinTimestamp","description":"The timestamp when the last pinned message was pinned, if there was one","nullable":true,"type":[[["number"]]],"meta":{"line":66,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"defaultAutoArchiveDuration","description":"The default auto archive duration for newly created threads in this channel","nullable":true,"type":[[["number"]]],"meta":{"line":74,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"defaultThreadRateLimitPerUser","description":"The initial rate limit per user (slowmode) to set on newly created threads in a channel.","nullable":true,"type":[[["number"]]],"meta":{"line":82,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"lastMessage","description":"The Message object of the last message in the channel, if one was sent","readonly":true,"nullable":true,"type":[[["Message"]]],"meta":{"line":51,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"lastPinAt","description":"The date when the last pinned message was pinned, if there was one","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":60,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"guild","description":"The guild the channel is in","type":[[["Guild"]]],"meta":{"line":31,"file":"GuildChannel.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild the channel is in","type":[[["Snowflake"]]],"meta":{"line":37,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionOverwrites","description":"A manager of permission overwrites that belong to this channel","type":[[["PermissionOverwriteManager"]]],"meta":{"line":44,"file":"GuildChannel.js","path":"src/structures"}},{"name":"name","description":"The name of the guild channel","type":[[["string"]]],"meta":{"line":57,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rawPosition","description":"The raw position of the channel from Discord","type":[[["number"]]],"meta":{"line":65,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parentId","description":"The id of the category parent of this channel","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":77,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parent","description":"The category parent of this channel","readonly":true,"nullable":true,"type":[[["CategoryChannel"]]],"meta":{"line":99,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionsLocked","description":"If the permissionOverwrites match the parent channel, null if no parent","readonly":true,"nullable":true,"type":[[["boolean"]]],"meta":{"line":108,"file":"GuildChannel.js","path":"src/structures"}},{"name":"position","description":"The position of the channel","readonly":true,"type":[[["number"]]],"meta":{"line":149,"file":"GuildChannel.js","path":"src/structures"}},{"name":"members","description":"A collection of cached members of this channel, mapped by their ids.\nMembers that can view this channel, if the channel is text-based.\nMembers in the channel, if the channel is voice-based.","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":276,"file":"GuildChannel.js","path":"src/structures"}},{"name":"deletable","description":"Whether the channel is deletable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":418,"file":"GuildChannel.js","path":"src/structures"}},{"name":"manageable","description":"Whether the channel is manageable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":427,"file":"GuildChannel.js","path":"src/structures"}},{"name":"viewable","description":"Whether the channel is viewable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":447,"file":"GuildChannel.js","path":"src/structures"}},{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the channel was created at","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"Channel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the channel was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":79,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"partial","description":"Whether this Channel is a partial\nThis is always false outside of DM channels.","readonly":true,"type":[[["boolean"]]],"meta":{"line":119,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"setDefaultAutoArchiveDuration","description":"Sets the default auto archive duration for all newly created threads in this channel.","params":[{"name":"defaultAutoArchiveDuration","description":"The new default auto archive duration","type":[[["ThreadAutoArchiveDuration"]]]},{"name":"reason","description":"Reason for changing the channel's default auto archive duration","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["TextChannel",">"]]],"meta":{"line":98,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"setType","description":"Sets the type of this channel (only conversion between text and news is supported)","params":[{"name":"type","description":"The new channel type","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the channel's type","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":108,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"setTopic","description":"Sets a new topic for the guild channel.","examples":["// Set a new channel topic\nchannel.setTopic('needs more rate limiting')\n .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))\n .catch(console.error);"],"params":[{"name":"topic","description":"The new topic for the guild channel","nullable":true,"type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's topic","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":123,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"createInvite","description":"Creates an invite to this guild channel.","examples":["// Create an invite to a channel\nchannel.createInvite()\n .then(invite => console.log(`Created an invite with a code of ${invite.code}`))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for creating the invite","optional":true,"default":"{}","type":[[["CreateInviteOptions"]]]}],"returns":[[["Promise","<"],["Invite",">"]]],"meta":{"line":161,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"fetchInvites","description":"Fetches a collection of invites to this guild channel.\nResolves with a collection mapping invites by their codes.","params":[{"name":"cache","description":"Whether or not to cache the fetched invites","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Collection","<"],["string",", "],["Invite",">>"]]],"meta":{"line":171,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"send","description":"Sends a message to this channel.","implements":["TextBasedChannel#send"],"examples":["// Send a basic message\nchannel.send('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.error);","// Send a remote file\nchannel.send({\n files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']\n})\n .then(console.log)\n .catch(console.error);","// Send a local file\nchannel.send({\n files: [{\n attachment: 'entire/path/to/file.jpg',\n name: 'file.jpg',\n description: 'A description of the file'\n }]\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["MessageOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":181,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"sendTyping","description":"Sends a typing indicator in the channel.","implements":["TextBasedChannel#sendTyping"],"examples":["// Start typing in a channel\nchannel.sendTyping();"],"returns":{"types":[[["Promise","<({"],["message_send_cooldown_ms",": "],["number",", "],["thread_create_cooldown_ms",": "],["number","}|"],["void",")>"]]],"description":"Resolves upon the typing status being sent"},"meta":{"line":395,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createMessageCollector","description":"Creates a Message Collector.","implements":["TextBasedChannel#createMessageCollector"],"examples":["// Create a message collector\nconst filter = m => m.content.includes('discord');\nconst collector = channel.createMessageCollector({ filter, time: 15_000 });\ncollector.on('collect', m => console.log(`Collected ${m.content}`));\ncollector.on('end', collected => console.log(`Collected ${collected.size} items`));"],"params":[{"name":"options","description":"The options to pass to the collector","optional":true,"default":"{}","type":[[["MessageCollectorOptions"]]]}],"returns":[[["MessageCollector"]]],"meta":{"line":410,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"awaitMessages","description":"Similar to createMessageCollector but in promise form.\nResolves with a collection of messages that pass the specified filter.","implements":["TextBasedChannel#awaitMessages"],"examples":["// Await !vote messages\nconst filter = m => m.content.startsWith('!vote');\n// Errors: ['time'] treats ending because of the time limit as an error\nchannel.awaitMessages({ filter, max: 4, time: 60_000, errors: ['time'] })\n .then(collected => console.log(collected.size))\n .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));"],"params":[{"name":"options","description":"Optional options to pass to the internal collector","optional":true,"default":"{}","type":[[["AwaitMessagesOptions"]]]}],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Message",">>"]]],"meta":{"line":433,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"fetchWebhooks","description":"Fetches all webhooks for the channel.","implements":["TextBasedChannel#fetchWebhooks"],"examples":["// Fetch webhooks\nchannel.fetchWebhooks()\n .then(hooks => console.log(`This channel has ${hooks.size} hooks`))\n .catch(console.error);"],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Webhook",">>"]]],"meta":{"line":455,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createWebhook","description":"Creates a webhook for the channel.","implements":["TextBasedChannel#createWebhook"],"examples":["// Create a webhook for the current channel\nchannel.createWebhook('Snek', {\n avatar: 'https://i.imgur.com/mI8XcpG.jpg',\n reason: 'Needed a cool new Webhook'\n})\n .then(console.log)\n .catch(console.error)"],"params":[{"name":"name","description":"The name of the webhook","type":[[["string"]]]},{"name":"options","description":"Options for creating the webhook","optional":true,"type":[[["ChannelWebhookCreateOptions"]]]}],"returns":{"types":[[["Promise","<"],["Webhook",">"]]],"description":"Returns the created Webhook"},"meta":{"line":480,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setRateLimitPerUser","description":"Sets the rate limit per user (slowmode) for this channel.","implements":["TextBasedChannel#setRateLimitPerUser"],"params":[{"name":"rateLimitPerUser","description":"The new rate limit in seconds","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the channel's rate limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":490,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setNSFW","description":"Sets whether this channel is flagged as NSFW.","implements":["TextBasedChannel#setNSFW"],"params":[{"name":"nsfw","description":"Whether the channel should be considered NSFW","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for changing the channel's NSFW flag","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":500,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"permissionsFor","description":"Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.","inherits":"GuildChannel#permissionsFor","inherited":true,"params":[{"name":"memberOrRole","description":"The member or role to obtain the overall permissions for","type":[[["GuildMemberResolvable"]],[["RoleResolvable"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":{"types":[[["Readonly","<"],["Permissions",">"]]],"nullable":true},"meta":{"line":173,"file":"GuildChannel.js","path":"src/structures"}},{"name":"memberPermissions","description":"Gets the overall set of permissions for a member in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#memberPermissions","inherited":true,"params":[{"name":"member","description":"The member to obtain the overall permissions for","type":[[["GuildMember"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","default":true,"type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":213,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rolePermissions","description":"Gets the overall set of permissions for a role in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#rolePermissions","inherited":true,"params":[{"name":"role","description":"The role to obtain the overall permissions for","type":[[["Role"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":242,"file":"GuildChannel.js","path":"src/structures"}},{"name":"lockPermissions","description":"Locks in the permission overwrites from the parent channel.","inherits":"GuildChannel#lockPermissions","inherited":true,"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":263,"file":"GuildChannel.js","path":"src/structures"}},{"name":"edit","description":"Edits the channel.","inherits":"GuildChannel#edit","inherited":true,"examples":["// Edit a channel\nchannel.edit({ name: 'new-channel' })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"data","description":"The new data for the channel","type":[[["ChannelData"]]]},{"name":"reason","description":"Reason for editing this channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":291,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setName","description":"Sets a new name for the guild channel.","inherits":"GuildChannel#setName","inherited":true,"examples":["// Set a new channel name\nchannel.setName('not_general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.error);"],"params":[{"name":"name","description":"The new name for the guild channel","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":306,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setParent","description":"Sets the parent of this channel.","inherits":"GuildChannel#setParent","inherited":true,"examples":["// Add a parent to a channel\nmessage.channel.setParent('355908108431917066', { lockPermissions: false })\n .then(channel => console.log(`New parent of ${message.channel.name}: ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"channel","description":"The category channel to set as the parent","nullable":true,"type":[[["CategoryChannelResolvable"]]]},{"name":"options","description":"The options for setting the parent","optional":true,"default":"{}","type":[[["SetParentOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":328,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setPosition","description":"Sets a new position for the guild channel.","inherits":"GuildChannel#setPosition","inherited":true,"examples":["// Set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.error);"],"params":[{"name":"position","description":"The new position for the guild channel","type":[[["number"]]]},{"name":"options","description":"Options for setting position","optional":true,"type":[[["SetChannelPositionOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":356,"file":"GuildChannel.js","path":"src/structures"}},{"name":"clone","description":"Clones this channel.","inherits":"GuildChannel#clone","inherited":true,"params":[{"name":"options","description":"The options for cloning this channel","optional":true,"type":[[["GuildChannelCloneOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":371,"file":"GuildChannel.js","path":"src/structures"}},{"name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites, and id as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","inherits":"GuildChannel#equals","inherited":true,"params":[{"name":"channel","description":"Channel to compare with","type":[[["GuildChannel"]]]}],"returns":[[["boolean"]]],"meta":{"line":393,"file":"GuildChannel.js","path":"src/structures"}},{"name":"delete","description":"Deletes this channel.","inherits":"GuildChannel#delete","inherited":true,"examples":["// Delete the channel\nchannel.delete('making room for new channels')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"reason","description":"Reason for deleting this channel","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":464,"file":"GuildChannel.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.","inherits":"Channel#toString","inherited":true,"examples":["// Logs: Hello from <#123456789012345678>!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":130,"file":"Channel.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this channel.","inherits":"Channel#fetch","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":153,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","inherits":"Channel#isText","inherited":true,"returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","inherits":"Channel#isVoice","inherited":true,"returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","inherits":"Channel#isThread","inherited":true,"returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","inherits":"Channel#isThreadOnly","inherited":true,"returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","inherits":"Channel#isDirectory","inherited":true,"returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":13,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"BaseGuildVoiceChannel","description":"Represents a voice-based guild channel on Discord.","extends":[[["GuildChannel"]]],"implements":[[["TextBasedChannel"]]],"props":[{"name":"messages","description":"A manager of the messages sent to this channel","type":[[["MessageManager"]]],"meta":{"line":22,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"nsfw","description":"If the guild considers this channel NSFW","type":[[["boolean"]]],"meta":{"line":28,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"bitrate","description":"The bitrate of this voice-based channel","type":[[["number"]]],"meta":{"line":41,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"rtcRegion","description":"The RTC region for this voice-based channel. This region is automatically selected if `null`.","nullable":true,"type":[[["string"]]],"meta":{"line":49,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"userLimit","description":"The maximum amount of users allowed in this channel.","type":[[["number"]]],"meta":{"line":57,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"videoQualityMode","description":"The camera video quality mode of the channel.","nullable":true,"type":[[["VideoQualityMode"]]],"meta":{"line":65,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"lastMessageId","description":"The last message id sent in the channel, if one was sent","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":75,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"rateLimitPerUser","description":"The rate limit per user (slowmode) for this channel in seconds","type":[[["number"]]],"meta":{"line":87,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"status","description":"The status of the voice channel (max 500 characters)","nullable":true,"type":[[["string"]]],"meta":{"line":99,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"members","description":"The members in this voice-based channel","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":108,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"full","description":"Checks if the voice-based channel is full","readonly":true,"type":[[["boolean"]]],"meta":{"line":123,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"joinable","description":"Whether the channel is joinable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":132,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"lastMessage","description":"The Message object of the last message in the channel, if one was sent","readonly":true,"nullable":true,"type":[[["Message"]]],"meta":{"line":51,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"guild","description":"The guild the channel is in","type":[[["Guild"]]],"meta":{"line":31,"file":"GuildChannel.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild the channel is in","type":[[["Snowflake"]]],"meta":{"line":37,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionOverwrites","description":"A manager of permission overwrites that belong to this channel","type":[[["PermissionOverwriteManager"]]],"meta":{"line":44,"file":"GuildChannel.js","path":"src/structures"}},{"name":"name","description":"The name of the guild channel","type":[[["string"]]],"meta":{"line":57,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rawPosition","description":"The raw position of the channel from Discord","type":[[["number"]]],"meta":{"line":65,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parentId","description":"The id of the category parent of this channel","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":77,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parent","description":"The category parent of this channel","readonly":true,"nullable":true,"type":[[["CategoryChannel"]]],"meta":{"line":99,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionsLocked","description":"If the permissionOverwrites match the parent channel, null if no parent","readonly":true,"nullable":true,"type":[[["boolean"]]],"meta":{"line":108,"file":"GuildChannel.js","path":"src/structures"}},{"name":"position","description":"The position of the channel","readonly":true,"type":[[["number"]]],"meta":{"line":149,"file":"GuildChannel.js","path":"src/structures"}},{"name":"deletable","description":"Whether the channel is deletable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":418,"file":"GuildChannel.js","path":"src/structures"}},{"name":"manageable","description":"Whether the channel is manageable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":427,"file":"GuildChannel.js","path":"src/structures"}},{"name":"viewable","description":"Whether the channel is viewable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":447,"file":"GuildChannel.js","path":"src/structures"}},{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the channel was created at","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"Channel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the channel was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":79,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"partial","description":"Whether this Channel is a partial\nThis is always false outside of DM channels.","readonly":true,"type":[[["boolean"]]],"meta":{"line":119,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"createInvite","description":"Creates an invite to this guild channel.","examples":["// Create an invite to a channel\nchannel.createInvite()\n .then(invite => console.log(`Created an invite with a code of ${invite.code}`))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for creating the invite","optional":true,"default":"{}","type":[[["CreateInviteOptions"]]]}],"returns":[[["Promise","<"],["Invite",">"]]],"meta":{"line":156,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"fetchInvites","description":"Fetches a collection of invites to this guild channel.\nResolves with a collection mapping invites by their codes.","params":[{"name":"cache","description":"Whether or not to cache the fetched invites","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Collection","<"],["string",", "],["Invite",">>"]]],"meta":{"line":166,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"setBitrate","description":"Sets the bitrate of the channel.","examples":["// Set the bitrate of a voice channel\nchannel.setBitrate(48_000)\n .then(channel => console.log(`Set bitrate to ${channel.bitrate}bps for ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"bitrate","description":"The new bitrate","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the channel's bitrate","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["BaseGuildVoiceChannel",">"]]],"meta":{"line":181,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"setRTCRegion","description":"Sets the RTC region of the channel.","examples":["// Set the RTC region to sydney\nchannel.setRTCRegion('sydney');","// Remove a fixed region for this channel - let Discord decide automatically\nchannel.setRTCRegion(null, 'We want to let Discord decide.');"],"params":[{"name":"rtcRegion","description":"The new region of the channel. Set to `null` to remove a specific region for the channel","nullable":true,"type":[[["string"]]]},{"name":"reason","description":"The reason for modifying this region.","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["BaseGuildVoiceChannel",">"]]],"meta":{"line":197,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"setUserLimit","description":"Sets the user limit of the channel.","examples":["// Set the user limit of a voice channel\nchannel.setUserLimit(42)\n .then(channel => console.log(`Set user limit to ${channel.userLimit} for ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"userLimit","description":"The new user limit","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the user limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["BaseGuildVoiceChannel",">"]]],"meta":{"line":212,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"setVideoQualityMode","description":"Sets the camera video quality mode of the channel.","params":[{"name":"videoQualityMode","description":"The new camera video quality mode.","type":[[["VideoQualityMode"]],[["number"]]]},{"name":"reason","description":"Reason for changing the camera video quality mode.","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["BaseGuildVoiceChannel",">"]]],"meta":{"line":222,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"send","description":"Sends a message to this channel.","implements":["TextBasedChannel#send"],"examples":["// Send a basic message\nchannel.send('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.error);","// Send a remote file\nchannel.send({\n files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']\n})\n .then(console.log)\n .catch(console.error);","// Send a local file\nchannel.send({\n files: [{\n attachment: 'entire/path/to/file.jpg',\n name: 'file.jpg',\n description: 'A description of the file'\n }]\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["MessageOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":181,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"sendTyping","description":"Sends a typing indicator in the channel.","implements":["TextBasedChannel#sendTyping"],"examples":["// Start typing in a channel\nchannel.sendTyping();"],"returns":{"types":[[["Promise","<({"],["message_send_cooldown_ms",": "],["number",", "],["thread_create_cooldown_ms",": "],["number","}|"],["void",")>"]]],"description":"Resolves upon the typing status being sent"},"meta":{"line":395,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createMessageCollector","description":"Creates a Message Collector.","implements":["TextBasedChannel#createMessageCollector"],"examples":["// Create a message collector\nconst filter = m => m.content.includes('discord');\nconst collector = channel.createMessageCollector({ filter, time: 15_000 });\ncollector.on('collect', m => console.log(`Collected ${m.content}`));\ncollector.on('end', collected => console.log(`Collected ${collected.size} items`));"],"params":[{"name":"options","description":"The options to pass to the collector","optional":true,"default":"{}","type":[[["MessageCollectorOptions"]]]}],"returns":[[["MessageCollector"]]],"meta":{"line":410,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"awaitMessages","description":"Similar to createMessageCollector but in promise form.\nResolves with a collection of messages that pass the specified filter.","implements":["TextBasedChannel#awaitMessages"],"examples":["// Await !vote messages\nconst filter = m => m.content.startsWith('!vote');\n// Errors: ['time'] treats ending because of the time limit as an error\nchannel.awaitMessages({ filter, max: 4, time: 60_000, errors: ['time'] })\n .then(collected => console.log(collected.size))\n .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));"],"params":[{"name":"options","description":"Optional options to pass to the internal collector","optional":true,"default":"{}","type":[[["AwaitMessagesOptions"]]]}],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Message",">>"]]],"meta":{"line":433,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"fetchWebhooks","description":"Fetches all webhooks for the channel.","implements":["TextBasedChannel#fetchWebhooks"],"examples":["// Fetch webhooks\nchannel.fetchWebhooks()\n .then(hooks => console.log(`This channel has ${hooks.size} hooks`))\n .catch(console.error);"],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Webhook",">>"]]],"meta":{"line":455,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createWebhook","description":"Creates a webhook for the channel.","implements":["TextBasedChannel#createWebhook"],"examples":["// Create a webhook for the current channel\nchannel.createWebhook('Snek', {\n avatar: 'https://i.imgur.com/mI8XcpG.jpg',\n reason: 'Needed a cool new Webhook'\n})\n .then(console.log)\n .catch(console.error)"],"params":[{"name":"name","description":"The name of the webhook","type":[[["string"]]]},{"name":"options","description":"Options for creating the webhook","optional":true,"type":[[["ChannelWebhookCreateOptions"]]]}],"returns":{"types":[[["Promise","<"],["Webhook",">"]]],"description":"Returns the created Webhook"},"meta":{"line":480,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setRateLimitPerUser","description":"Sets the rate limit per user (slowmode) for this channel.","implements":["TextBasedChannel#setRateLimitPerUser"],"params":[{"name":"rateLimitPerUser","description":"The new rate limit in seconds","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the channel's rate limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":490,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setNSFW","description":"Sets whether this channel is flagged as NSFW.","implements":["TextBasedChannel#setNSFW"],"params":[{"name":"nsfw","description":"Whether the channel should be considered NSFW","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for changing the channel's NSFW flag","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":500,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"permissionsFor","description":"Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.","inherits":"GuildChannel#permissionsFor","inherited":true,"params":[{"name":"memberOrRole","description":"The member or role to obtain the overall permissions for","type":[[["GuildMemberResolvable"]],[["RoleResolvable"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":{"types":[[["Readonly","<"],["Permissions",">"]]],"nullable":true},"meta":{"line":173,"file":"GuildChannel.js","path":"src/structures"}},{"name":"memberPermissions","description":"Gets the overall set of permissions for a member in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#memberPermissions","inherited":true,"params":[{"name":"member","description":"The member to obtain the overall permissions for","type":[[["GuildMember"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","default":true,"type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":213,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rolePermissions","description":"Gets the overall set of permissions for a role in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#rolePermissions","inherited":true,"params":[{"name":"role","description":"The role to obtain the overall permissions for","type":[[["Role"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":242,"file":"GuildChannel.js","path":"src/structures"}},{"name":"lockPermissions","description":"Locks in the permission overwrites from the parent channel.","inherits":"GuildChannel#lockPermissions","inherited":true,"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":263,"file":"GuildChannel.js","path":"src/structures"}},{"name":"edit","description":"Edits the channel.","inherits":"GuildChannel#edit","inherited":true,"examples":["// Edit a channel\nchannel.edit({ name: 'new-channel' })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"data","description":"The new data for the channel","type":[[["ChannelData"]]]},{"name":"reason","description":"Reason for editing this channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":291,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setName","description":"Sets a new name for the guild channel.","inherits":"GuildChannel#setName","inherited":true,"examples":["// Set a new channel name\nchannel.setName('not_general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.error);"],"params":[{"name":"name","description":"The new name for the guild channel","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":306,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setParent","description":"Sets the parent of this channel.","inherits":"GuildChannel#setParent","inherited":true,"examples":["// Add a parent to a channel\nmessage.channel.setParent('355908108431917066', { lockPermissions: false })\n .then(channel => console.log(`New parent of ${message.channel.name}: ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"channel","description":"The category channel to set as the parent","nullable":true,"type":[[["CategoryChannelResolvable"]]]},{"name":"options","description":"The options for setting the parent","optional":true,"default":"{}","type":[[["SetParentOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":328,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setPosition","description":"Sets a new position for the guild channel.","inherits":"GuildChannel#setPosition","inherited":true,"examples":["// Set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.error);"],"params":[{"name":"position","description":"The new position for the guild channel","type":[[["number"]]]},{"name":"options","description":"Options for setting position","optional":true,"type":[[["SetChannelPositionOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":356,"file":"GuildChannel.js","path":"src/structures"}},{"name":"clone","description":"Clones this channel.","inherits":"GuildChannel#clone","inherited":true,"params":[{"name":"options","description":"The options for cloning this channel","optional":true,"type":[[["GuildChannelCloneOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":371,"file":"GuildChannel.js","path":"src/structures"}},{"name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites, and id as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","inherits":"GuildChannel#equals","inherited":true,"params":[{"name":"channel","description":"Channel to compare with","type":[[["GuildChannel"]]]}],"returns":[[["boolean"]]],"meta":{"line":393,"file":"GuildChannel.js","path":"src/structures"}},{"name":"delete","description":"Deletes this channel.","inherits":"GuildChannel#delete","inherited":true,"examples":["// Delete the channel\nchannel.delete('making room for new channels')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"reason","description":"Reason for deleting this channel","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":464,"file":"GuildChannel.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.","inherits":"Channel#toString","inherited":true,"examples":["// Logs: Hello from <#123456789012345678>!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":130,"file":"Channel.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this channel.","inherits":"Channel#fetch","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":153,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","inherits":"Channel#isText","inherited":true,"returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","inherits":"Channel#isVoice","inherited":true,"returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","inherits":"Channel#isThread","inherited":true,"returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","inherits":"Channel#isThreadOnly","inherited":true,"returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","inherits":"Channel#isDirectory","inherited":true,"returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":15,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"BaseMessageComponent","description":"Represents an interactive component of a Message or Modal. It should not be necessary to construct this directly.\nSee {@link MessageComponent}","construct":{"name":"BaseMessageComponent","params":[{"name":"data","description":"The options for this component","optional":true,"default":"{}","type":[[["BaseMessageComponent"]],[["BaseMessageComponentOptions"]]]}]},"props":[{"name":"type","description":"The type of this component","nullable":true,"type":[[["MessageComponentType"]]],"meta":{"line":52,"file":"BaseMessageComponent.js","path":"src/structures"}},{"name":"data","description":"The data for this component","type":[[["MessageComponentOptions"]]],"meta":{"line":60,"file":"BaseMessageComponent.js","path":"src/structures"}},{"name":"id","description":"The id of this component","readonly":true,"type":[[["number"]]],"meta":{"line":68,"file":"BaseMessageComponent.js","path":"src/structures"}}],"methods":[{"name":"create","description":"Constructs a component based on the type of the incoming data","scope":"static","access":"private","params":[{"name":"data","description":"Data for a MessageComponent","type":[[["MessageComponentOptions"]]]},{"name":"client","description":"Client constructing this component","optional":true,"type":[[["Client"]],[["WebhookClient"]]]}],"returns":{"types":[[["MessageComponent"]],[["ModalComponent"]]],"nullable":true},"meta":{"line":79,"file":"BaseMessageComponent.js","path":"src/structures"}},{"name":"resolveType","description":"Resolves the type of a component","scope":"static","access":"private","params":[{"name":"type","description":"The type to resolve","type":[[["MessageComponentTypeResolvable"]]]}],"returns":[[["MessageComponentType"]]],"meta":{"line":161,"file":"BaseMessageComponent.js","path":"src/structures"}}],"meta":{"line":10,"file":"BaseMessageComponent.js","path":"src/structures"}},{"name":"ButtonInteraction","description":"Represents a button interaction.","extends":[[["MessageComponentInteraction"]]],"props":[{"name":"channelId","description":"The id of the channel this interaction was sent in","type":[[["Snowflake"]]],"meta":{"line":17,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"message","description":"The message to which the component was attached","type":[[["Message"]],[["APIMessage"]]],"meta":{"line":27,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"customId","description":"The custom id of the component which was interacted with","type":[[["string"]]],"meta":{"line":33,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"componentType","description":"The type of component which was interacted with","type":[[["string"]]],"meta":{"line":39,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"deferred","description":"Whether the reply to this interaction has been deferred","type":[[["boolean"]]],"meta":{"line":45,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"ephemeral","description":"Whether the reply to this interaction is ephemeral","nullable":true,"type":[[["boolean"]]],"meta":{"line":51,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"replied","description":"Whether this interaction has already been replied to","type":[[["boolean"]]],"meta":{"line":57,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"webhook","description":"An associated interaction webhook, can be used to further interact with this interaction","type":[[["InteractionWebhook"]]],"meta":{"line":63,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"component","description":"The component which was interacted with","readonly":true,"type":[[["MessageActionRowComponent"]],[["APIMessageActionRowComponent"]]],"meta":{"line":78,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"type","description":"The interaction's type","type":[[["InteractionType"]]],"meta":{"line":20,"file":"Interaction.js","path":"src/structures"}},{"name":"id","description":"The interaction's id","type":[[["Snowflake"]]],"meta":{"line":26,"file":"Interaction.js","path":"src/structures"}},{"name":"token","description":"The interaction's token","readonly":true,"type":[[["string"]]],"meta":{"line":28,"file":"Interaction.js","path":"src/structures"}},{"name":"applicationId","description":"The application's id","type":[[["Snowflake"]]],"meta":{"line":40,"file":"Interaction.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild this interaction was sent in","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":52,"file":"Interaction.js","path":"src/structures"}},{"name":"user","description":"The user which sent this interaction","type":[[["User"]]],"meta":{"line":58,"file":"Interaction.js","path":"src/structures"}},{"name":"member","description":"If this interaction was sent in a guild, the member which sent it","nullable":true,"type":[[["GuildMember"]],[["APIGuildMember"]]],"meta":{"line":64,"file":"Interaction.js","path":"src/structures"}},{"name":"version","description":"The version","type":[[["number"]]],"meta":{"line":70,"file":"Interaction.js","path":"src/structures"}},{"name":"appPermissions","description":"Set of permissions the application or bot has within the channel the interaction was sent from","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":76,"file":"Interaction.js","path":"src/structures"}},{"name":"memberPermissions","description":"The permissions of the member, if one exists, in the channel this interaction was executed in","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":82,"file":"Interaction.js","path":"src/structures"}},{"name":"locale","description":"The locale of the user who invoked this interaction","type":[[["Locale"]]],"meta":{"line":124,"file":"Interaction.js","path":"src/structures"}},{"name":"guildLocale","description":"The preferred locale from the guild this interaction was sent in","nullable":true,"type":[[["Locale"]]],"meta":{"line":130,"file":"Interaction.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the interaction was created at","readonly":true,"type":[[["number"]]],"meta":{"line":138,"file":"Interaction.js","path":"src/structures"}},{"name":"createdAt","description":"The time the interaction was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":147,"file":"Interaction.js","path":"src/structures"}},{"name":"channel","description":"The channel this interaction was sent in","readonly":true,"nullable":true,"type":[[["TextBasedChannels"]]],"meta":{"line":156,"file":"Interaction.js","path":"src/structures"}},{"name":"guild","description":"The guild this interaction was sent in","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":165,"file":"Interaction.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"deferReply","description":"Defers the reply to this interaction.","inherits":"MessageComponentInteraction#deferReply","inherited":true,"implements":["InteractionResponses#deferReply"],"examples":["// Defer the reply to this interaction\ninteraction.deferReply()\n .then(console.log)\n .catch(console.error)","// Defer to send an ephemeral reply later\ninteraction.deferReply({ ephemeral: true })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for deferring the reply to this interaction","optional":true,"type":[[["InteractionDeferReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":58,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"reply","description":"Creates a reply to this interaction.\nUse the `fetchReply` option to get the bot's reply message.","inherits":"MessageComponentInteraction#reply","inherited":true,"implements":["InteractionResponses#reply"],"examples":["// Reply to the interaction and fetch the response\ninteraction.reply({ content: 'Pong!', fetchReply: true })\n .then((message) => console.log(`Reply sent with content ${message.content}`))\n .catch(console.error);","// Create an ephemeral reply with an embed\nconst embed = new MessageEmbed().setDescription('Pong!');\n\ninteraction.reply({ embeds: [embed], ephemeral: true })\n .then(() => console.log('Reply sent.'))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":93,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"fetchReply","description":"Fetches a reply to this interaction.","see":["Webhook#fetchMessage"],"inherits":"MessageComponentInteraction#fetchReply","inherited":true,"implements":["InteractionResponses#fetchReply"],"examples":["// Fetch the initial reply to this interaction\ninteraction.fetchReply()\n .then(reply => console.log(`Replied with ${reply.content}`))\n .catch(console.error);"],"params":[{"name":"message","description":"The response to fetch","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":127,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"editReply","description":"Edits a reply to this interaction.","see":["Webhook#editMessage"],"inherits":"MessageComponentInteraction#editReply","inherited":true,"implements":["InteractionResponses#editReply"],"examples":["// Edit the initial reply to this interaction\ninteraction.editReply('New content')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The new options for the message","type":[[["string"]],[["MessagePayload"]],[["InteractionEditReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":148,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"deleteReply","description":"Deletes a reply to this interaction.","see":["Webhook#deleteMessage"],"inherits":"MessageComponentInteraction#deleteReply","inherited":true,"implements":["InteractionResponses#deleteReply"],"examples":["// Delete the initial reply to this interaction\ninteraction.deleteReply()\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"message","description":"The response to delete","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":166,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"followUp","description":"Send a follow-up message to this interaction.","inherits":"MessageComponentInteraction#followUp","inherited":true,"implements":["InteractionResponses#followUp"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":175,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"deferUpdate","description":"Defers an update to the message to which the component was attached.","inherits":"MessageComponentInteraction#deferUpdate","inherited":true,"implements":["InteractionResponses#deferUpdate"],"examples":["// Defer updating and reset the component's loading state\ninteraction.deferUpdate()\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for deferring the update to this interaction","optional":true,"type":[[["InteractionDeferUpdateOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":190,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"update","description":"Updates the original message of the component on which the interaction was received on.","inherits":"MessageComponentInteraction#update","inherited":true,"implements":["InteractionResponses#update"],"examples":["// Remove the components from the message\ninteraction.update({\n content: \"A component interaction was received\",\n components: []\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the updated message","type":[[["string"]],[["MessagePayload"]],[["InteractionUpdateOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":216,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"showModal","description":"Shows a modal component","inherits":"MessageComponentInteraction#showModal","inherited":true,"implements":["InteractionResponses#showModal"],"params":[{"name":"modal","description":"The modal to show","type":[[["Modal"]],[["ModalOptions"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":243,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"awaitModalSubmit","description":"Collects a single modal submit interaction that passes the filter.\nThe Promise will reject if the time expires.","inherits":"MessageComponentInteraction#awaitModalSubmit","inherited":true,"implements":["InteractionResponses#awaitModalSubmit"],"examples":["// Collect a modal submit interaction\nconst filter = (interaction) => interaction.customId === 'modal';\ninteraction.awaitModalSubmit({ filter, time: 15_000 })\n .then(interaction => console.log(`${interaction.customId} was submitted!`))\n .catch(console.error);"],"params":[{"name":"options","description":"Options to pass to the internal collector","type":[[["AwaitModalSubmitOptions"]]]}],"returns":[[["Promise","<"],["ModalSubmitInteraction",">"]]],"meta":{"line":275,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"inGuild","description":"Indicates whether this interaction is received from a guild.","inherits":"Interaction#inGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":173,"file":"Interaction.js","path":"src/structures"}},{"name":"inCachedGuild","description":"Indicates whether or not this interaction is both cached and received from a guild.","inherits":"Interaction#inCachedGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":181,"file":"Interaction.js","path":"src/structures"}},{"name":"inRawGuild","description":"Indicates whether or not this interaction is received from an uncached guild.","inherits":"Interaction#inRawGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":189,"file":"Interaction.js","path":"src/structures"}},{"name":"isApplicationCommand","description":"Indicates whether this interaction is a {@link BaseCommandInteraction}.","inherits":"Interaction#isApplicationCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":197,"file":"Interaction.js","path":"src/structures"}},{"name":"isCommand","description":"Indicates whether this interaction is a {@link CommandInteraction}.","inherits":"Interaction#isCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":205,"file":"Interaction.js","path":"src/structures"}},{"name":"isContextMenu","description":"Indicates whether this interaction is a {@link ContextMenuInteraction}","inherits":"Interaction#isContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":213,"file":"Interaction.js","path":"src/structures"}},{"name":"isModalSubmit","description":"Indicates whether this interaction is a {@link ModalSubmitInteraction}","inherits":"Interaction#isModalSubmit","inherited":true,"returns":[[["boolean"]]],"meta":{"line":221,"file":"Interaction.js","path":"src/structures"}},{"name":"isUserContextMenu","description":"Indicates whether this interaction is a {@link UserContextMenuInteraction}","inherits":"Interaction#isUserContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":229,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageContextMenu","description":"Indicates whether this interaction is a {@link MessageContextMenuInteraction}","inherits":"Interaction#isMessageContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":237,"file":"Interaction.js","path":"src/structures"}},{"name":"isAutocomplete","description":"Indicates whether this interaction is an {@link AutocompleteInteraction}","inherits":"Interaction#isAutocomplete","inherited":true,"returns":[[["boolean"]]],"meta":{"line":245,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageComponent","description":"Indicates whether this interaction is a {@link MessageComponentInteraction}.","inherits":"Interaction#isMessageComponent","inherited":true,"returns":[[["boolean"]]],"meta":{"line":253,"file":"Interaction.js","path":"src/structures"}},{"name":"isButton","description":"Indicates whether this interaction is a {@link ButtonInteraction}.","inherits":"Interaction#isButton","inherited":true,"returns":[[["boolean"]]],"meta":{"line":261,"file":"Interaction.js","path":"src/structures"}},{"name":"isSelectMenu","description":"Indicates whether this interaction is a {@link SelectMenuInteraction}.","inherits":"Interaction#isSelectMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":272,"file":"Interaction.js","path":"src/structures"}},{"name":"isRepliable","description":"Indicates whether this interaction can be replied to.","inherits":"Interaction#isRepliable","inherited":true,"returns":[[["boolean"]]],"meta":{"line":283,"file":"Interaction.js","path":"src/structures"}}],"meta":{"line":9,"file":"ButtonInteraction.js","path":"src/structures"}},{"name":"CallState","description":"Represents a call","extends":[[["Base"]]],"props":[{"name":"channelId","description":"The channel ID of the call","type":[[["Snowflake"]]],"meta":{"line":17,"file":"CallState.js","path":"src/structures"}},{"name":"region","description":"The region of the call","type":[[["string"]]],"meta":{"line":30,"file":"CallState.js","path":"src/structures"}},{"name":"channel","description":"The channel of the call","type":[[["DMChannel"]],[["GroupDMChannel"]]],"meta":{"line":41,"file":"CallState.js","path":"src/structures"}},{"name":"ringing","description":"The list of user ID who is ringing","type":[[["Collection","<"],["Snowflake",", "],["User",">"]]],"meta":{"line":58,"file":"CallState.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"setRTCRegion","description":"Sets the voice region of the call","params":[{"name":"region","description":"Region of the call","type":[[["string"]]]}],"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":50,"file":"CallState.js","path":"src/structures"}}],"meta":{"line":10,"file":"CallState.js","path":"src/structures"}},{"name":"CategoryChannel","description":"Represents a guild category channel on Discord.","extends":[[["GuildChannel"]]],"props":[{"name":"parentId","description":"The id of the parent of this channel.","type":[[["null"]]],"meta":{"line":10,"file":"CategoryChannel.js","path":"src/structures"}},{"name":"parent","description":"The parent of this channel.","readonly":true,"type":[[["null"]]],"meta":{"line":16,"file":"CategoryChannel.js","path":"src/structures"}},{"name":"children","description":"Channels that are a part of this category","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildChannel",">"]]],"meta":{"line":28,"file":"CategoryChannel.js","path":"src/structures"}},{"name":"guild","description":"The guild the channel is in","type":[[["Guild"]]],"meta":{"line":31,"file":"GuildChannel.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild the channel is in","type":[[["Snowflake"]]],"meta":{"line":37,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionOverwrites","description":"A manager of permission overwrites that belong to this channel","type":[[["PermissionOverwriteManager"]]],"meta":{"line":44,"file":"GuildChannel.js","path":"src/structures"}},{"name":"name","description":"The name of the guild channel","type":[[["string"]]],"meta":{"line":57,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rawPosition","description":"The raw position of the channel from Discord","type":[[["number"]]],"meta":{"line":65,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionsLocked","description":"If the permissionOverwrites match the parent channel, null if no parent","readonly":true,"nullable":true,"type":[[["boolean"]]],"meta":{"line":108,"file":"GuildChannel.js","path":"src/structures"}},{"name":"position","description":"The position of the channel","readonly":true,"type":[[["number"]]],"meta":{"line":149,"file":"GuildChannel.js","path":"src/structures"}},{"name":"members","description":"A collection of cached members of this channel, mapped by their ids.\nMembers that can view this channel, if the channel is text-based.\nMembers in the channel, if the channel is voice-based.","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":276,"file":"GuildChannel.js","path":"src/structures"}},{"name":"deletable","description":"Whether the channel is deletable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":418,"file":"GuildChannel.js","path":"src/structures"}},{"name":"manageable","description":"Whether the channel is manageable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":427,"file":"GuildChannel.js","path":"src/structures"}},{"name":"viewable","description":"Whether the channel is viewable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":447,"file":"GuildChannel.js","path":"src/structures"}},{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the channel was created at","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"Channel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the channel was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":79,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"partial","description":"Whether this Channel is a partial\nThis is always false outside of DM channels.","readonly":true,"type":[[["boolean"]]],"meta":{"line":119,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"setParent","description":"Sets the category parent of this channel.\nIt is not possible to set the parent of a CategoryChannel.","params":[{"name":"channel","description":"The channel to set as parent","nullable":true,"type":[[["CategoryChannelResolvable"]]]},{"name":"options","description":"The options for setting the parent","optional":true,"default":"{}","type":[[["SetParentOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":32,"file":"CategoryChannel.js","path":"src/structures"}},{"name":"createChannel","description":"Creates a new channel within this category.\nYou cannot create a channel of type `GUILD_CATEGORY` inside a CategoryChannel.","params":[{"name":"name","description":"The name of the new channel","type":[[["string"]]]},{"name":"options","description":"Options for creating the new channel","type":[[["CategoryCreateChannelOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":77,"file":"CategoryChannel.js","path":"src/structures"}},{"name":"permissionsFor","description":"Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.","inherits":"GuildChannel#permissionsFor","inherited":true,"params":[{"name":"memberOrRole","description":"The member or role to obtain the overall permissions for","type":[[["GuildMemberResolvable"]],[["RoleResolvable"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":{"types":[[["Readonly","<"],["Permissions",">"]]],"nullable":true},"meta":{"line":173,"file":"GuildChannel.js","path":"src/structures"}},{"name":"memberPermissions","description":"Gets the overall set of permissions for a member in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#memberPermissions","inherited":true,"params":[{"name":"member","description":"The member to obtain the overall permissions for","type":[[["GuildMember"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","default":true,"type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":213,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rolePermissions","description":"Gets the overall set of permissions for a role in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#rolePermissions","inherited":true,"params":[{"name":"role","description":"The role to obtain the overall permissions for","type":[[["Role"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":242,"file":"GuildChannel.js","path":"src/structures"}},{"name":"lockPermissions","description":"Locks in the permission overwrites from the parent channel.","inherits":"GuildChannel#lockPermissions","inherited":true,"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":263,"file":"GuildChannel.js","path":"src/structures"}},{"name":"edit","description":"Edits the channel.","inherits":"GuildChannel#edit","inherited":true,"examples":["// Edit a channel\nchannel.edit({ name: 'new-channel' })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"data","description":"The new data for the channel","type":[[["ChannelData"]]]},{"name":"reason","description":"Reason for editing this channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":291,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setName","description":"Sets a new name for the guild channel.","inherits":"GuildChannel#setName","inherited":true,"examples":["// Set a new channel name\nchannel.setName('not_general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.error);"],"params":[{"name":"name","description":"The new name for the guild channel","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":306,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setPosition","description":"Sets a new position for the guild channel.","inherits":"GuildChannel#setPosition","inherited":true,"examples":["// Set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.error);"],"params":[{"name":"position","description":"The new position for the guild channel","type":[[["number"]]]},{"name":"options","description":"Options for setting position","optional":true,"type":[[["SetChannelPositionOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":356,"file":"GuildChannel.js","path":"src/structures"}},{"name":"clone","description":"Clones this channel.","inherits":"GuildChannel#clone","inherited":true,"params":[{"name":"options","description":"The options for cloning this channel","optional":true,"type":[[["GuildChannelCloneOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":371,"file":"GuildChannel.js","path":"src/structures"}},{"name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites, and id as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","inherits":"GuildChannel#equals","inherited":true,"params":[{"name":"channel","description":"Channel to compare with","type":[[["GuildChannel"]]]}],"returns":[[["boolean"]]],"meta":{"line":393,"file":"GuildChannel.js","path":"src/structures"}},{"name":"delete","description":"Deletes this channel.","inherits":"GuildChannel#delete","inherited":true,"examples":["// Delete the channel\nchannel.delete('making room for new channels')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"reason","description":"Reason for deleting this channel","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":464,"file":"GuildChannel.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.","inherits":"Channel#toString","inherited":true,"examples":["// Logs: Hello from <#123456789012345678>!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":130,"file":"Channel.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this channel.","inherits":"Channel#fetch","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":153,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","inherits":"Channel#isText","inherited":true,"returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","inherits":"Channel#isVoice","inherited":true,"returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","inherits":"Channel#isThread","inherited":true,"returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","inherits":"Channel#isThreadOnly","inherited":true,"returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","inherits":"Channel#isDirectory","inherited":true,"returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":9,"file":"CategoryChannel.js","path":"src/structures"}},{"name":"Channel","description":"Represents any channel on Discord.","extends":[[["Base"]]],"abstract":true,"props":[{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the channel was created at","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"Channel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the channel was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":79,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"partial","description":"Whether this Channel is a partial\nThis is always false outside of DM channels.","readonly":true,"type":[[["boolean"]]],"meta":{"line":119,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"toString","description":"When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.","examples":["// Logs: Hello from <#123456789012345678>!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":130,"file":"Channel.js","path":"src/structures"}},{"name":"delete","description":"Deletes this channel.","examples":["// Delete the channel\nchannel.delete()\n .then(console.log)\n .catch(console.error);"],"async":true,"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":143,"file":"Channel.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this channel.","params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":153,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":33,"file":"Channel.js","path":"src/structures"}},{"name":"ClientPresence","description":"Represents the client's presence.","extends":[[["Presence"]]],"props":[{"name":"userId","description":"The presence's user id","type":[[["Snowflake"]]],"meta":{"line":45,"file":"Presence.js","path":"src/structures"}},{"name":"guild","description":"The guild this presence is in","nullable":true,"type":[[["Guild"]]],"meta":{"line":51,"file":"Presence.js","path":"src/structures"}},{"name":"user","description":"The user of this presence","readonly":true,"nullable":true,"type":[[["User"]]],"meta":{"line":61,"file":"Presence.js","path":"src/structures"}},{"name":"member","description":"The member of this presence","readonly":true,"nullable":true,"type":[[["GuildMember"]]],"meta":{"line":70,"file":"Presence.js","path":"src/structures"}},{"name":"status","description":"The status of this presence","type":[[["PresenceStatus"]]],"meta":{"line":80,"file":"Presence.js","path":"src/structures"}},{"name":"activities","description":"The activities of this presence (Always `Activity[]` if not ClientUser)","type":[[["Array","<"],["CustomStatus",">"]],[["Array","<"],["RichPresence",">"]],[["Array","<"],["SpotifyRPC",">"]],[["Array","<"],["Activity",">"]]],"meta":{"line":90,"file":"Presence.js","path":"src/structures"}},{"name":"clientStatus","description":"The devices this presence is on","nullable":true,"type":[[["Object"]]],"props":[{"name":"web","description":"The current presence in the web application","nullable":true,"type":[[["ClientPresenceStatus"]]]},{"name":"mobile","description":"The current presence in the mobile application","nullable":true,"type":[[["ClientPresenceStatus"]]]},{"name":"desktop","description":"The current presence in the desktop application","nullable":true,"type":[[["ClientPresenceStatus"]]]}],"meta":{"line":115,"file":"Presence.js","path":"src/structures"}},{"name":"lastModified","description":"The timestamp this presence was last updated","type":[[["number"]]],"meta":{"line":125,"file":"Presence.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"set","description":"Sets the client's presence","params":[{"name":"presence","description":"The data to set the presence to","type":[[["PresenceData"]]]}],"returns":[[["ClientPresence"]]],"meta":{"line":23,"file":"ClientPresence.js","path":"src/structures"}},{"name":"_parse","description":"Parses presence data into a packet ready to be sent to Discord","access":"private","params":[{"name":"presence","description":"The data to parse","type":[[["PresenceData"]]]}],"returns":[[["APIPresence"]]],"meta":{"line":37,"file":"ClientPresence.js","path":"src/structures"}},{"name":"equals","description":"Whether this presence is equal to another.","inherits":"Presence#equals","inherited":true,"params":[{"name":"presence","description":"The presence to compare with","type":[[["Presence"]]]}],"returns":[[["boolean"]]],"meta":{"line":154,"file":"Presence.js","path":"src/structures"}}],"meta":{"line":13,"file":"ClientPresence.js","path":"src/structures"}},{"name":"ClientUser","description":"Represents the logged in client's Discord user.","extends":[[["User"]]],"props":[{"name":"verified","description":"Whether or not this account has been verified","type":[[["boolean"]]],"meta":{"line":32,"file":"ClientUser.js","path":"src/structures"}},{"name":"mfaEnabled","description":"If the bot's {@link Application#owner Owner} has MFA enabled on their account","nullable":true,"type":[[["boolean"]]],"meta":{"line":40,"file":"ClientUser.js","path":"src/structures"}},{"name":"purchasedFlags","description":"Purchased state of the client user.","type":[[["Readonly","<"],["PurchasedFlags",">"]]],"meta":{"line":52,"file":"ClientUser.js","path":"src/structures"}},{"name":"premiumUsageFlags","description":"Premium usage state of the client user.","type":[[["Readonly","<"],["PremiumUsageFlags",">"]]],"meta":{"line":62,"file":"ClientUser.js","path":"src/structures"}},{"name":"phone","description":"Phone number of the client user.","nullable":true,"type":[[["string"]]],"meta":{"line":72,"file":"ClientUser.js","path":"src/structures"}},{"name":"nsfwAllowed","description":"Whether or not the client user is allowed to send NSFW messages [iOS device].","nullable":true,"type":[[["boolean"]]],"meta":{"line":80,"file":"ClientUser.js","path":"src/structures"}},{"name":"email","description":"Email address of the client user.","nullable":true,"type":[[["string"]]],"meta":{"line":88,"file":"ClientUser.js","path":"src/structures"}},{"name":"bio","description":"About me (User)\nThe user must be force fetched for this property to be present or be updated","nullable":true,"type":[[["string"]]],"meta":{"line":97,"file":"ClientUser.js","path":"src/structures"}},{"name":"pronouns","description":"Pronouns (User)\nThe user must be force fetched for this property to be present or be updated","nullable":true,"type":[[["string"]]],"meta":{"line":106,"file":"ClientUser.js","path":"src/structures"}},{"name":"premiumType","description":"Premium types denote the level of premium a user has.","see":["{@link https://discord-userdoccers.vercel.app/resources/user#premium-type}"],"type":[[["number"]]],"meta":{"line":115,"file":"ClientUser.js","path":"src/structures"}},{"name":"presence","description":"Represents the client user's presence","readonly":true,"type":[[["ClientPresence"]]],"meta":{"line":124,"file":"ClientUser.js","path":"src/structures"}},{"name":"id","description":"The user's id","type":[[["Snowflake"]]],"meta":{"line":25,"file":"User.js","path":"src/structures"}},{"name":"username","description":"The username of the user","nullable":true,"type":[[["string"]]],"meta":{"line":42,"file":"User.js","path":"src/structures"}},{"name":"globalName","description":"The global name of this user","nullable":true,"type":[[["string"]]],"meta":{"line":52,"file":"User.js","path":"src/structures"}},{"name":"bot","description":"Whether or not the user is a bot","nullable":true,"type":[[["boolean"]]],"meta":{"line":62,"file":"User.js","path":"src/structures"}},{"name":"discriminator","description":"The discriminator of this user\n`'0'`, or a 4-digit stringified number if they're using the legacy username system","nullable":true,"type":[[["string"]]],"meta":{"line":73,"file":"User.js","path":"src/structures"}},{"name":"avatar","description":"The user avatar's hash","nullable":true,"type":[[["string"]]],"meta":{"line":83,"file":"User.js","path":"src/structures"}},{"name":"banner","description":"The user banner's hash\nThe user must be force fetched for this property to be present or be updated","nullable":true,"type":[[["string"]]],"meta":{"line":94,"file":"User.js","path":"src/structures"}},{"name":"bannerColor","description":"The user banner's hex\nThe user must be force fetched for this property to be present or be updated","nullable":true,"type":[[["string"]]],"meta":{"line":105,"file":"User.js","path":"src/structures"}},{"name":"accentColor","description":"The base 10 accent color of the user's banner\nThe user must be force fetched for this property to be present or be updated","nullable":true,"type":[[["number"]]],"meta":{"line":116,"file":"User.js","path":"src/structures"}},{"name":"system","description":"Whether the user is an Official Discord System user (part of the urgent message system)","nullable":true,"type":[[["boolean"]]],"meta":{"line":126,"file":"User.js","path":"src/structures"}},{"name":"flags","description":"The flags for this user","nullable":true,"type":[[["UserFlags"]]],"meta":{"line":136,"file":"User.js","path":"src/structures"}},{"name":"avatarDecorationData","description":"The user avatar decoration's data","nullable":true,"type":[[["AvatarDecorationData"]]],"meta":{"line":151,"file":"User.js","path":"src/structures"}},{"name":"primaryGuild","description":"The primary guild of the user","nullable":true,"type":[[["UserPrimaryGuild"]]],"meta":{"line":176,"file":"User.js","path":"src/structures"}},{"name":"collectibles","description":"The user's collectibles","nullable":true,"type":[[["Collectibles"]]],"meta":{"line":208,"file":"User.js","path":"src/structures"}},{"name":"clan","description":"The primary clan the user is in","nullable":true,"deprecated":"Use `primaryGuild` instead","type":[[["PrimaryGuild"]]],"meta":{"line":229,"file":"User.js","path":"src/structures"}},{"name":"avatarDecoration","description":"The user avatar decoration's hash","nullable":true,"deprecated":"Use `avatarDecorationData` instead\nRemoved in v4","type":[[["string"]]],"meta":{"line":239,"file":"User.js","path":"src/structures"}},{"name":"partial","description":"Whether this User is a partial","readonly":true,"type":[[["boolean"]]],"meta":{"line":248,"file":"User.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the user was created at","readonly":true,"type":[[["number"]]],"meta":{"line":257,"file":"User.js","path":"src/structures"}},{"name":"createdAt","description":"The time the user was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":266,"file":"User.js","path":"src/structures"}},{"name":"defaultAvatarURL","description":"A link to the user's default avatar","readonly":true,"type":[[["string"]]],"meta":{"line":312,"file":"User.js","path":"src/structures"}},{"name":"hexAccentColor","description":"The hexadecimal version of the user accent color, with a leading hash\nThe user must be force fetched for this property to be present","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":336,"file":"User.js","path":"src/structures"}},{"name":"tag","description":"The tag of this user\nThis user's username, or their legacy tag (e.g. `hydrabolt#0001`)\nif they're using the legacy username system","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":361,"file":"User.js","path":"src/structures"}},{"name":"displayName","description":"The global name of this user, or their username if they don't have one","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":374,"file":"User.js","path":"src/structures"}},{"name":"dmChannel","description":"The DM between the client's user and this user","readonly":true,"nullable":true,"type":[[["DMChannel"]]],"meta":{"line":383,"file":"User.js","path":"src/structures"}},{"name":"note","description":"The function returns the note associated with a specific client ID from a cache.","nullable":true,"type":[[["string"]]],"meta":{"line":546,"file":"User.js","path":"src/structures"}},{"name":"voice","description":"The voice state of this member","readonly":true,"type":[[["VoiceState"]]],"meta":{"line":555,"file":"User.js","path":"src/structures"}},{"name":"relationship","description":"Check relationship status (Client -> User)","readonly":true,"type":[[["RelationshipType"]]],"meta":{"line":586,"file":"User.js","path":"src/structures"}},{"name":"friendNickname","description":"Get friend nickname","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":596,"file":"User.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"edit","description":"Edits the logged in client.","params":[{"name":"options","description":"The new data","type":[[["ClientUserEditData"]]]}],"async":true,"returns":[[["Promise","<"],["ClientUser",">"]]],"meta":{"line":142,"file":"ClientUser.js","path":"src/structures"}},{"name":"setUsername","description":"Sets the username of the logged in client.\nChanging usernames in Discord is heavily rate limited, with only 2 requests\nevery hour. Use this sparingly!","examples":["// Set username\nclient.user.setUsername('discordjs', 'passw@rd')\n .then(user => console.log(`My new username is ${user.username}`))\n .catch(console.error);"],"params":[{"name":"username","description":"The new username","type":[[["string"]]]},{"name":"password","description":"Current Password","type":[[["string"]]]}],"returns":[[["Promise","<"],["ClientUser",">"]]],"meta":{"line":161,"file":"ClientUser.js","path":"src/structures"}},{"name":"setAvatar","description":"Sets the avatar of the logged in client.","examples":["// Set avatar\nclient.user.setAvatar('./avatar.png')\n .then(user => console.log(`New avatar set!`))\n .catch(console.error);"],"params":[{"name":"avatar","description":"The new avatar","nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]}],"async":true,"returns":[[["Promise","<"],["ClientUser",">"]]],"meta":{"line":175,"file":"ClientUser.js","path":"src/structures"}},{"name":"setPresence","description":"Sets the full presence of the client user.","see":["{@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Document/RichPresence.md}"],"examples":["// Set the client user's presence\nclient.user.setPresence({ activities: [{ name: 'with discord.js' }], status: 'idle' });"],"params":[{"name":"data","description":"Data for the presence","type":[[["PresenceData"]]]}],"returns":[[["ClientPresence"]]],"meta":{"line":207,"file":"ClientUser.js","path":"src/structures"}},{"name":"setStatus","description":"Sets the status of the client user.","examples":["// Set the client user's status\nclient.user.setStatus('idle');"],"params":[{"name":"status","description":"Status to change to","type":[[["PresenceStatusData"]]]},{"name":"shardId","description":"Shard id(s) to have the activity set on","optional":true,"type":[[["number"]],[["Array","<"],["number",">"]]]}],"returns":[[["ClientPresence"]]],"meta":{"line":229,"file":"ClientUser.js","path":"src/structures"}},{"name":"setActivity","description":"Sets the activity the client user is playing.","see":["{@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Document/RichPresence.md}"],"examples":["// Set the client user's activity\nclient.user.setActivity('discord.js', { type: 'WATCHING' });"],"params":[{"name":"name","description":"Activity being played, or options for setting the activity","type":[[["string"]],[["ActivityOptions"]]]},{"name":"options","description":"Options for setting the activity","optional":true,"type":[[["ActivityOptions"]]]}],"returns":[[["ClientPresence"]]],"meta":{"line":252,"file":"ClientUser.js","path":"src/structures"}},{"name":"setAFK","description":"Sets/removes the AFK flag for the client user.","params":[{"name":"afk","description":"Whether or not the user is AFK","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"shardId","description":"Shard Id(s) to have the AFK flag set on","optional":true,"type":[[["number"]],[["Array","<"],["number",">"]]]}],"returns":[[["ClientPresence"]]],"meta":{"line":265,"file":"ClientUser.js","path":"src/structures"}},{"name":"setBanner","description":"Sets the banner of the logged in client.","examples":["// Set banner\nclient.user.setBanner('./banner.png')\n .then(user => console.log(`New banner set!`))\n .catch(console.error);"],"params":[{"name":"banner","description":"The new banner","nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]}],"async":true,"returns":[[["Promise","<"],["ClientUser",">"]]],"meta":{"line":279,"file":"ClientUser.js","path":"src/structures"}},{"name":"setHypeSquad","description":"Set HyperSquad House","examples":["// Set HyperSquad HOUSE_BRAVERY\nclient.user.setHypeSquad(1); || client.user.setHypeSquad('HOUSE_BRAVERY');\n// Leave\nclient.user.setHypeSquad(0);"],"params":[{"name":"type","description":"* `LEAVE`: 0\n* `HOUSE_BRAVERY`: 1\n* `HOUSE_BRILLIANCE`: 2\n* `HOUSE_BALANCE`: 3","type":[[["string"]],[["number"]]]}],"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":298,"file":"ClientUser.js","path":"src/structures"}},{"name":"setAccentColor","description":"Set Accent color","params":[{"name":"color","description":"Color to set","default":null,"type":[[["ColorResolvable"]]]}],"returns":[[["Promise","<"],["ClientUser",">"]]],"meta":{"line":331,"file":"ClientUser.js","path":"src/structures"}},{"name":"setAboutMe","description":"Set About me","params":[{"name":"bio","description":"Bio to set","optional":true,"default":null,"type":[[["string"]]]}],"returns":[[["Promise","<"],["ClientUser",">"]]],"meta":{"line":340,"file":"ClientUser.js","path":"src/structures"}},{"name":"createFriendInvite","description":"Create an invite [Friend Invites]\nmaxAge: 604800 | maxUses: 1","see":["{@link https://github.com/13-05/hidden-disc-docs#js-snippet-for-creating-friend-invites}"],"examples":["// Options not working\nclient.user.createFriendInvite();\n .then(console.log)\n .catch(console.error);"],"async":true,"returns":[[["Promise","<"],["Invite",">"]]],"meta":{"line":355,"file":"ClientUser.js","path":"src/structures"}},{"name":"getAllFriendInvites","description":"Get all friend invites","async":true,"returns":[[["Promise","<"],["Collection","<"],["string",", "],["Invite",">>"]]],"meta":{"line":366,"file":"ClientUser.js","path":"src/structures"}},{"name":"revokeAllFriendInvites","description":"Revoke all friend invites","returns":[[["Promise","<"],["void",">"]]],"meta":{"line":379,"file":"ClientUser.js","path":"src/structures"}},{"name":"setSamsungActivity","description":"Sets Discord Playing status to \"Playing on Samsung Galaxy\". Only selected gamss from discords database works","examples":["// Set the client user's status\nclient.user.setSamsungActivity('com.YostarJP.BlueArchive', 'START');\n// Update\nclient.user.setSamsungActivity('com.miHoYo.bh3oversea', 'UPDATE');\n// Stop\nclient.user.setSamsungActivity('com.miHoYo.GenshinImpact', 'STOP');"],"params":[{"name":"packageName","description":"Android package name","type":[[["string"]]]},{"name":"type","description":"Must be START, UPDATE, or STOP","default":"START","nullable":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["ClientUser",">"]]],"meta":{"line":396,"file":"ClientUser.js","path":"src/structures"}},{"name":"stopRinging","description":"Stop ringing","params":[{"name":"channel","description":"DMChannel | GroupDMChannel","type":[[["ChannelResolvable"]]]}],"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":416,"file":"ClientUser.js","path":"src/structures"}},{"name":"fetchBurstCredit","description":"Super Reactions","returns":[[["Promise","<"],["number",">"]]],"meta":{"line":426,"file":"ClientUser.js","path":"src/structures"}},{"name":"setGlobalName","description":"Set global display name","params":[{"name":"globalName","description":"The new display name","type":[[["string"]]]}],"returns":[[["Promise","<"],["ClientUser",">"]]],"meta":{"line":435,"file":"ClientUser.js","path":"src/structures"}},{"name":"setPronouns","description":"Set pronouns","params":[{"name":"pronouns","description":"Your pronouns","nullable":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["ClientUser",">"]]],"meta":{"line":444,"file":"ClientUser.js","path":"src/structures"}},{"name":"avatarURL","description":"A link to the user's avatar.","inherits":"User#avatarURL","inherited":true,"params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["ImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":275,"file":"User.js","path":"src/structures"}},{"name":"avatarDecorationURL","description":"A link to the user's avatar decoration.","inherits":"User#avatarDecorationURL","inherited":true,"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":284,"file":"User.js","path":"src/structures"}},{"name":"clanBadgeURL","description":"A link to the user's guild tag badge.","inherits":"User#clanBadgeURL","inherited":true,"deprecated":true,"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":294,"file":"User.js","path":"src/structures"}},{"name":"guildTagBadgeURL","description":"A link to the user's guild tag badge.","inherits":"User#guildTagBadgeURL","inherited":true,"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":302,"file":"User.js","path":"src/structures"}},{"name":"displayAvatarURL","description":"A link to the user's avatar if they have one.\nOtherwise a link to their default avatar will be returned.","inherits":"User#displayAvatarURL","inherited":true,"params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["ImageURLOptions"]]]}],"returns":[[["string"]]],"meta":{"line":326,"file":"User.js","path":"src/structures"}},{"name":"bannerURL","description":"A link to the user's banner.\nThis method will throw an error if called before the user is force fetched.\nSee {@link User#banner} for more info","inherits":"User#bannerURL","inherited":true,"params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["ImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":348,"file":"User.js","path":"src/structures"}},{"name":"createDM","description":"Creates a DM channel between the client and the user.","inherits":"User#createDM","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["DMChannel",">"]]],"meta":{"line":392,"file":"User.js","path":"src/structures"}},{"name":"deleteDM","description":"Deletes a DM channel (if one exists) between the client and the user. Resolves with the channel if successful.","inherits":"User#deleteDM","inherited":true,"returns":[[["Promise","<"],["DMChannel",">"]]],"meta":{"line":400,"file":"User.js","path":"src/structures"}},{"name":"equals","description":"Checks if the user is equal to another.\nIt compares id, username, discriminator, avatar, banner, accent color, and bot flags.\nIt is recommended to compare equality by using `user.id === user2.id` unless you want to compare all properties.","inherits":"User#equals","inherited":true,"params":[{"name":"user","description":"User to compare with","type":[[["User"]]]}],"returns":[[["boolean"]]],"meta":{"line":411,"file":"User.js","path":"src/structures"}},{"name":"_equals","description":"Compares the user with an API user object","access":"private","inherits":"User#_equals","inherited":true,"params":[{"name":"user","description":"The API user object to compare","type":[[["APIUser"]]]}],"returns":[[["boolean"]]],"meta":{"line":441,"file":"User.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this user.","inherits":"User#fetch","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["User",">"]]],"meta":{"line":476,"file":"User.js","path":"src/structures"}},{"name":"getProfile","description":"Returns a user profile object for a given user ID.\nThis endpoint requires one of the following:\n- The user is a bot\n- The user shares a mutual guild with the current user\n- The user is a friend of the current user\n- The user is a friend suggestion of the current user\n- The user has an outgoing friend request to the current user","see":["{@link https://discord-userdoccers.vercel.app/resources/user#response-body}"],"inherits":"User#getProfile","inherited":true,"params":[{"name":"guildId","description":"The guild ID to get the user's member profile in","optional":true,"type":[[["Snowflake"]]]}],"returns":[[["Promise","<"],["Object",">"]]],"meta":{"line":492,"file":"User.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the user's mention instead of the User object.","inherits":"User#toString","inherited":true,"examples":["// Logs: Hello from <@123456789012345678>!\nconsole.log(`Hello from ${user}!`);"],"returns":[[["string"]]],"meta":{"line":510,"file":"User.js","path":"src/structures"}},{"name":"setNote","description":"The function updates the note of a user and returns the updated user.","inherits":"User#setNote","inherited":true,"params":[{"name":"note","description":"The `note` parameter is the new value that you want to set for the note of the\nuser. It is an optional parameter and its default value is `null`.","optional":true,"default":null,"type":[[["string"]],[["null"]],[["undefined"]]]}],"async":true,"returns":{"types":[[["Promise","<"],["User",">"]]],"description":"The `setNote` method is returning the `User` object."},"meta":{"line":537,"file":"User.js","path":"src/structures"}},{"name":"sendFriendRequest","description":"Send Friend Request to the user","inherits":"User#sendFriendRequest","inherited":true,"returns":[[["Promise","<"],["boolean",">"]]],"meta":{"line":568,"file":"User.js","path":"src/structures"}},{"name":"deleteRelationship","description":"Unblock / Unfriend / Cancels a friend request","inherits":"User#deleteRelationship","inherited":true,"returns":[[["Promise","<"],["boolean",">"]]],"meta":{"line":577,"file":"User.js","path":"src/structures"}},{"name":"send","description":"Sends a message to this user.","inherits":"User#send","inherited":true,"implements":["TextBasedChannel#send"],"examples":["// Send a direct message\nuser.send('Hello!')\n .then(message => console.log(`Sent message: ${message.content} to ${user.tag}`))\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["MessageOptions"]]]}],"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":601,"file":"User.js","path":"src/structures"}}],"meta":{"line":16,"file":"ClientUser.js","path":"src/structures"}},{"name":"CommandInteraction","description":"Represents a command interaction.","extends":[[["BaseCommandInteraction"]]],"props":[{"name":"options","description":"The options passed to the command.","type":[[["CommandInteractionOptionResolver"]]],"meta":{"line":18,"file":"CommandInteraction.js","path":"src/structures"}},{"name":"channelId","description":"The id of the channel this interaction was sent in","type":[[["Snowflake"]]],"meta":{"line":20,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"commandId","description":"The invoked application command's id","type":[[["Snowflake"]]],"meta":{"line":30,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"commandName","description":"The invoked application command's name","type":[[["string"]]],"meta":{"line":36,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"deferred","description":"Whether the reply to this interaction has been deferred","type":[[["boolean"]]],"meta":{"line":42,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"replied","description":"Whether this interaction has already been replied to","type":[[["boolean"]]],"meta":{"line":48,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"ephemeral","description":"Whether the reply to this interaction is ephemeral","nullable":true,"type":[[["boolean"]]],"meta":{"line":54,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"webhook","description":"An associated interaction webhook, can be used to further interact with this interaction","type":[[["InteractionWebhook"]]],"meta":{"line":60,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"command","description":"The invoked application command, if it was fetched before","nullable":true,"type":[[["ApplicationCommand"]]],"meta":{"line":67,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"type","description":"The interaction's type","type":[[["InteractionType"]]],"meta":{"line":20,"file":"Interaction.js","path":"src/structures"}},{"name":"id","description":"The interaction's id","type":[[["Snowflake"]]],"meta":{"line":26,"file":"Interaction.js","path":"src/structures"}},{"name":"token","description":"The interaction's token","readonly":true,"type":[[["string"]]],"meta":{"line":28,"file":"Interaction.js","path":"src/structures"}},{"name":"applicationId","description":"The application's id","type":[[["Snowflake"]]],"meta":{"line":40,"file":"Interaction.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild this interaction was sent in","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":52,"file":"Interaction.js","path":"src/structures"}},{"name":"user","description":"The user which sent this interaction","type":[[["User"]]],"meta":{"line":58,"file":"Interaction.js","path":"src/structures"}},{"name":"member","description":"If this interaction was sent in a guild, the member which sent it","nullable":true,"type":[[["GuildMember"]],[["APIGuildMember"]]],"meta":{"line":64,"file":"Interaction.js","path":"src/structures"}},{"name":"version","description":"The version","type":[[["number"]]],"meta":{"line":70,"file":"Interaction.js","path":"src/structures"}},{"name":"appPermissions","description":"Set of permissions the application or bot has within the channel the interaction was sent from","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":76,"file":"Interaction.js","path":"src/structures"}},{"name":"memberPermissions","description":"The permissions of the member, if one exists, in the channel this interaction was executed in","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":82,"file":"Interaction.js","path":"src/structures"}},{"name":"locale","description":"The locale of the user who invoked this interaction","type":[[["Locale"]]],"meta":{"line":124,"file":"Interaction.js","path":"src/structures"}},{"name":"guildLocale","description":"The preferred locale from the guild this interaction was sent in","nullable":true,"type":[[["Locale"]]],"meta":{"line":130,"file":"Interaction.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the interaction was created at","readonly":true,"type":[[["number"]]],"meta":{"line":138,"file":"Interaction.js","path":"src/structures"}},{"name":"createdAt","description":"The time the interaction was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":147,"file":"Interaction.js","path":"src/structures"}},{"name":"channel","description":"The channel this interaction was sent in","readonly":true,"nullable":true,"type":[[["TextBasedChannels"]]],"meta":{"line":156,"file":"Interaction.js","path":"src/structures"}},{"name":"guild","description":"The guild this interaction was sent in","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":165,"file":"Interaction.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"toString","description":"Returns a string representation of the command interaction.\nThis can then be copied by a user and executed again in a new command while keeping the option order.","returns":[[["string"]]],"meta":{"line":30,"file":"CommandInteraction.js","path":"src/structures"}},{"name":"transformResolved","description":"Transforms the resolved received from the API.","access":"private","inherits":"BaseCommandInteraction#transformResolved","inherited":true,"params":[{"name":"resolved","description":"The received resolved objects","type":[[["APIInteractionDataResolved"]]]}],"returns":[[["CommandInteractionResolvedData"]]],"meta":{"line":89,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"transformOption","description":"Transforms an option received from the API.","access":"private","inherits":"BaseCommandInteraction#transformOption","inherited":true,"params":[{"name":"option","description":"The received option","type":[[["APIApplicationCommandOption"]]]},{"name":"resolved","description":"The resolved interaction data","type":[[["APIInteractionDataResolved"]]]}],"returns":[[["CommandInteractionOption"]]],"meta":{"line":162,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"deferReply","description":"Defers the reply to this interaction.","inherits":"BaseCommandInteraction#deferReply","inherited":true,"implements":["InteractionResponses#deferReply"],"examples":["// Defer the reply to this interaction\ninteraction.deferReply()\n .then(console.log)\n .catch(console.error)","// Defer to send an ephemeral reply later\ninteraction.deferReply({ ephemeral: true })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for deferring the reply to this interaction","optional":true,"type":[[["InteractionDeferReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":58,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"reply","description":"Creates a reply to this interaction.\nUse the `fetchReply` option to get the bot's reply message.","inherits":"BaseCommandInteraction#reply","inherited":true,"implements":["InteractionResponses#reply"],"examples":["// Reply to the interaction and fetch the response\ninteraction.reply({ content: 'Pong!', fetchReply: true })\n .then((message) => console.log(`Reply sent with content ${message.content}`))\n .catch(console.error);","// Create an ephemeral reply with an embed\nconst embed = new MessageEmbed().setDescription('Pong!');\n\ninteraction.reply({ embeds: [embed], ephemeral: true })\n .then(() => console.log('Reply sent.'))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":93,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"fetchReply","description":"Fetches a reply to this interaction.","see":["Webhook#fetchMessage"],"inherits":"BaseCommandInteraction#fetchReply","inherited":true,"implements":["InteractionResponses#fetchReply"],"examples":["// Fetch the initial reply to this interaction\ninteraction.fetchReply()\n .then(reply => console.log(`Replied with ${reply.content}`))\n .catch(console.error);"],"params":[{"name":"message","description":"The response to fetch","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":127,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"editReply","description":"Edits a reply to this interaction.","see":["Webhook#editMessage"],"inherits":"BaseCommandInteraction#editReply","inherited":true,"implements":["InteractionResponses#editReply"],"examples":["// Edit the initial reply to this interaction\ninteraction.editReply('New content')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The new options for the message","type":[[["string"]],[["MessagePayload"]],[["InteractionEditReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":148,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"deleteReply","description":"Deletes a reply to this interaction.","see":["Webhook#deleteMessage"],"inherits":"BaseCommandInteraction#deleteReply","inherited":true,"implements":["InteractionResponses#deleteReply"],"examples":["// Delete the initial reply to this interaction\ninteraction.deleteReply()\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"message","description":"The response to delete","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":166,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"followUp","description":"Send a follow-up message to this interaction.","inherits":"BaseCommandInteraction#followUp","inherited":true,"implements":["InteractionResponses#followUp"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":175,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"showModal","description":"Shows a modal component","inherits":"BaseCommandInteraction#showModal","inherited":true,"implements":["InteractionResponses#showModal"],"params":[{"name":"modal","description":"The modal to show","type":[[["Modal"]],[["ModalOptions"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":243,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"awaitModalSubmit","description":"Collects a single modal submit interaction that passes the filter.\nThe Promise will reject if the time expires.","inherits":"BaseCommandInteraction#awaitModalSubmit","inherited":true,"implements":["InteractionResponses#awaitModalSubmit"],"examples":["// Collect a modal submit interaction\nconst filter = (interaction) => interaction.customId === 'modal';\ninteraction.awaitModalSubmit({ filter, time: 15_000 })\n .then(interaction => console.log(`${interaction.customId} was submitted!`))\n .catch(console.error);"],"params":[{"name":"options","description":"Options to pass to the internal collector","type":[[["AwaitModalSubmitOptions"]]]}],"returns":[[["Promise","<"],["ModalSubmitInteraction",">"]]],"meta":{"line":275,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"inGuild","description":"Indicates whether this interaction is received from a guild.","inherits":"Interaction#inGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":173,"file":"Interaction.js","path":"src/structures"}},{"name":"inCachedGuild","description":"Indicates whether or not this interaction is both cached and received from a guild.","inherits":"Interaction#inCachedGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":181,"file":"Interaction.js","path":"src/structures"}},{"name":"inRawGuild","description":"Indicates whether or not this interaction is received from an uncached guild.","inherits":"Interaction#inRawGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":189,"file":"Interaction.js","path":"src/structures"}},{"name":"isApplicationCommand","description":"Indicates whether this interaction is a {@link BaseCommandInteraction}.","inherits":"Interaction#isApplicationCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":197,"file":"Interaction.js","path":"src/structures"}},{"name":"isCommand","description":"Indicates whether this interaction is a {@link CommandInteraction}.","inherits":"Interaction#isCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":205,"file":"Interaction.js","path":"src/structures"}},{"name":"isContextMenu","description":"Indicates whether this interaction is a {@link ContextMenuInteraction}","inherits":"Interaction#isContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":213,"file":"Interaction.js","path":"src/structures"}},{"name":"isModalSubmit","description":"Indicates whether this interaction is a {@link ModalSubmitInteraction}","inherits":"Interaction#isModalSubmit","inherited":true,"returns":[[["boolean"]]],"meta":{"line":221,"file":"Interaction.js","path":"src/structures"}},{"name":"isUserContextMenu","description":"Indicates whether this interaction is a {@link UserContextMenuInteraction}","inherits":"Interaction#isUserContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":229,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageContextMenu","description":"Indicates whether this interaction is a {@link MessageContextMenuInteraction}","inherits":"Interaction#isMessageContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":237,"file":"Interaction.js","path":"src/structures"}},{"name":"isAutocomplete","description":"Indicates whether this interaction is an {@link AutocompleteInteraction}","inherits":"Interaction#isAutocomplete","inherited":true,"returns":[[["boolean"]]],"meta":{"line":245,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageComponent","description":"Indicates whether this interaction is a {@link MessageComponentInteraction}.","inherits":"Interaction#isMessageComponent","inherited":true,"returns":[[["boolean"]]],"meta":{"line":253,"file":"Interaction.js","path":"src/structures"}},{"name":"isButton","description":"Indicates whether this interaction is a {@link ButtonInteraction}.","inherits":"Interaction#isButton","inherited":true,"returns":[[["boolean"]]],"meta":{"line":261,"file":"Interaction.js","path":"src/structures"}},{"name":"isSelectMenu","description":"Indicates whether this interaction is a {@link SelectMenuInteraction}.","inherits":"Interaction#isSelectMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":272,"file":"Interaction.js","path":"src/structures"}},{"name":"isRepliable","description":"Indicates whether this interaction can be replied to.","inherits":"Interaction#isRepliable","inherited":true,"returns":[[["boolean"]]],"meta":{"line":283,"file":"Interaction.js","path":"src/structures"}}],"meta":{"line":10,"file":"CommandInteraction.js","path":"src/structures"}},{"name":"CommandInteractionOptionResolver","description":"A resolver for command interaction options.","props":[{"name":"client","description":"The client that instantiated this.","readonly":true,"type":[[["Client"]]],"meta":{"line":10,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"_group","description":"The name of the subcommand group.","access":"private","nullable":true,"type":[[["string"]]],"meta":{"line":23,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"_subcommand","description":"The name of the subcommand.","access":"private","nullable":true,"type":[[["string"]]],"meta":{"line":30,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"_hoistedOptions","description":"The bottom-level options for the interaction.\nIf there is a subcommand (or subcommand and group), this is the options for the subcommand.","access":"private","type":[[["Array","<"],["CommandInteractionOption",">"]]],"meta":{"line":38,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"data","description":"The interaction options array.","readonly":true,"type":[[["ReadonlyArray","<"],["CommandInteractionOption",">"]]],"meta":{"line":51,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"resolved","description":"The interaction resolved data","type":[[["Readonly","<"],["CommandInteractionResolvedData",">"]]],"meta":{"line":59,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}}],"methods":[{"name":"get","description":"Gets an option by its name.","params":[{"name":"name","description":"The name of the option.","type":[[["string"]]]},{"name":"required","description":"Whether to throw an error if the option is not found.","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":{"types":[[["CommandInteractionOption"]]],"description":"The option, if found.","nullable":true},"meta":{"line":73,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"_getTypedOption","description":"Gets an option by name and property and checks its type.","access":"private","params":[{"name":"name","description":"The name of the option.","type":[[["string"]]]},{"name":"type","description":"The type of the option.","type":[[["ApplicationCommandOptionType"]]]},{"name":"properties","description":"The properties to check for for `required`.","type":[[["Array","<"],["string",">"]]]},{"name":"required","description":"Whether to throw an error if the option is not found.","type":[[["boolean"]]]}],"returns":{"types":[[["CommandInteractionOption"]]],"description":"The option, if found.","nullable":true},"meta":{"line":93,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"getSubcommand","description":"Gets the selected subcommand.","params":[{"name":"required","description":"Whether to throw an error if there is no subcommand.","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":{"types":[[["string"]]],"description":"The name of the selected subcommand, or null if not set and not required.","nullable":true},"meta":{"line":110,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"getSubcommandGroup","description":"Gets the selected subcommand group.","params":[{"name":"required","description":"Whether to throw an error if there is no subcommand group.","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":{"types":[[["string"]]],"description":"The name of the selected subcommand group, or null if not set and not required.","nullable":true},"meta":{"line":122,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"getBoolean","description":"Gets a boolean option.","params":[{"name":"name","description":"The name of the option.","type":[[["string"]]]},{"name":"required","description":"Whether to throw an error if the option is not found.","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":{"types":[[["boolean"]]],"description":"The value of the option, or null if not set and not required.","nullable":true},"meta":{"line":135,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"getChannel","description":"Gets a channel option.","params":[{"name":"name","description":"The name of the option.","type":[[["string"]]]},{"name":"required","description":"Whether to throw an error if the option is not found.","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":{"types":[[["GuildChannel"]],[["ThreadChannel"]],[["APIChannel"]]],"description":"The value of the option, or null if not set and not required.","nullable":true},"meta":{"line":147,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"getString","description":"Gets a string option.","params":[{"name":"name","description":"The name of the option.","type":[[["string"]]]},{"name":"required","description":"Whether to throw an error if the option is not found.","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":{"types":[[["string"]]],"description":"The value of the option, or null if not set and not required.","nullable":true},"meta":{"line":158,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"getInteger","description":"Gets an integer option.","params":[{"name":"name","description":"The name of the option.","type":[[["string"]]]},{"name":"required","description":"Whether to throw an error if the option is not found.","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":{"types":[[["number"]]],"description":"The value of the option, or null if not set and not required.","nullable":true},"meta":{"line":169,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"getNumber","description":"Gets a number option.","params":[{"name":"name","description":"The name of the option.","type":[[["string"]]]},{"name":"required","description":"Whether to throw an error if the option is not found.","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":{"types":[[["number"]]],"description":"The value of the option, or null if not set and not required.","nullable":true},"meta":{"line":180,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"getUser","description":"Gets a user option.","params":[{"name":"name","description":"The name of the option.","type":[[["string"]]]},{"name":"required","description":"Whether to throw an error if the option is not found.","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":{"types":[[["User"]]],"description":"The value of the option, or null if not set and not required.","nullable":true},"meta":{"line":191,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"getMember","description":"Gets a member option.","params":[{"name":"name","description":"The name of the option.","type":[[["string"]]]},{"name":"required","description":"Whether to throw an error if the option is not found.","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":{"types":[[["GuildMember"]],[["APIGuildMember"]]],"description":"The value of the option, or null if not set and not required.","nullable":true},"meta":{"line":203,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"getRole","description":"Gets a role option.","params":[{"name":"name","description":"The name of the option.","type":[[["string"]]]},{"name":"required","description":"Whether to throw an error if the option is not found.","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":{"types":[[["Role"]],[["APIRole"]]],"description":"The value of the option, or null if not set and not required.","nullable":true},"meta":{"line":214,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"getMentionable","description":"Gets a mentionable option.","params":[{"name":"name","description":"The name of the option.","type":[[["string"]]]},{"name":"required","description":"Whether to throw an error if the option is not found.","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":{"types":[[["User"]],[["GuildMember"]],[["APIGuildMember"]],[["Role"]],[["APIRole"]]],"description":"The value of the option, or null if not set and not required.","nullable":true},"meta":{"line":226,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"getMessage","description":"Gets a message option.","params":[{"name":"name","description":"The name of the option.","type":[[["string"]]]},{"name":"required","description":"Whether to throw an error if the option is not found.","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":{"types":[[["Message"]],[["APIMessage"]]],"description":"The value of the option, or null if not set and not required.","nullable":true},"meta":{"line":238,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"getFocused","description":"Gets the focused option.","params":[{"name":"getFull","description":"Whether to get the full option object","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":{"types":[[["string"]],[["AutocompleteFocusedOption"]]],"description":"The value of the option, or the whole option if getFull is true"},"meta":{"line":258,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"getAttachment","description":"Gets an attachment option.","params":[{"name":"name","description":"The name of the option.","type":[[["string"]]]},{"name":"required","description":"Whether to throw an error if the option is not found.","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":{"types":[[["MessageAttachment"]]],"description":"The value of the option, or null if not set and not required.","nullable":true},"meta":{"line":270,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}}],"meta":{"line":8,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"ContainerComponent","construct":{"name":"ContainerComponent","params":[{"name":"data","description":"The data","optional":true,"default":"{}","type":[[["ContainerComponent"]],[["APIContainerComponent"]]]}]},"props":[{"name":"components","description":"Components of the type action row, text display, section, media gallery, separator, or file","type":[[["Array","<"],["ContainerComponents",">"]]],"meta":{"line":29,"file":"ContainerComponent.js","path":"src/structures"}},{"name":"accentColor","description":"Color for the accent on the container as RGB from 0x000000 to 0xFFFFFF","type":[[["Number"]]],"meta":{"line":35,"file":"ContainerComponent.js","path":"src/structures"}},{"name":"spoiler","description":"Whether the container should be a spoiler (or blurred out). Defaults to false.","type":[[["Boolean"]]],"meta":{"line":41,"file":"ContainerComponent.js","path":"src/structures"}},{"name":"hexAccentColor","description":"The hex accent color of this container","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":49,"file":"ContainerComponent.js","path":"src/structures"}}],"methods":[{"name":"toJSON","returns":[[["APIContainerComponent"]]],"meta":{"line":58,"file":"ContainerComponent.js","path":"src/structures"}}],"meta":{"line":17,"file":"ContainerComponent.js","path":"src/structures"}},{"name":"ContextMenuInteraction","description":"Represents a context menu interaction.","extends":[[["BaseCommandInteraction"]]],"props":[{"name":"options","description":"The target of the interaction, parsed into options","type":[[["CommandInteractionOptionResolver"]]],"meta":{"line":18,"file":"ContextMenuInteraction.js","path":"src/structures"}},{"name":"targetId","description":"The id of the target of this interaction","type":[[["Snowflake"]]],"meta":{"line":28,"file":"ContextMenuInteraction.js","path":"src/structures"}},{"name":"targetType","description":"The type of the target of the interaction; either USER or MESSAGE","type":[[["ApplicationCommandType"]]],"meta":{"line":34,"file":"ContextMenuInteraction.js","path":"src/structures"}},{"name":"channelId","description":"The id of the channel this interaction was sent in","type":[[["Snowflake"]]],"meta":{"line":20,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"commandId","description":"The invoked application command's id","type":[[["Snowflake"]]],"meta":{"line":30,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"commandName","description":"The invoked application command's name","type":[[["string"]]],"meta":{"line":36,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"deferred","description":"Whether the reply to this interaction has been deferred","type":[[["boolean"]]],"meta":{"line":42,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"replied","description":"Whether this interaction has already been replied to","type":[[["boolean"]]],"meta":{"line":48,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"ephemeral","description":"Whether the reply to this interaction is ephemeral","nullable":true,"type":[[["boolean"]]],"meta":{"line":54,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"webhook","description":"An associated interaction webhook, can be used to further interact with this interaction","type":[[["InteractionWebhook"]]],"meta":{"line":60,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"command","description":"The invoked application command, if it was fetched before","nullable":true,"type":[[["ApplicationCommand"]]],"meta":{"line":67,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"type","description":"The interaction's type","type":[[["InteractionType"]]],"meta":{"line":20,"file":"Interaction.js","path":"src/structures"}},{"name":"id","description":"The interaction's id","type":[[["Snowflake"]]],"meta":{"line":26,"file":"Interaction.js","path":"src/structures"}},{"name":"token","description":"The interaction's token","readonly":true,"type":[[["string"]]],"meta":{"line":28,"file":"Interaction.js","path":"src/structures"}},{"name":"applicationId","description":"The application's id","type":[[["Snowflake"]]],"meta":{"line":40,"file":"Interaction.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild this interaction was sent in","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":52,"file":"Interaction.js","path":"src/structures"}},{"name":"user","description":"The user which sent this interaction","type":[[["User"]]],"meta":{"line":58,"file":"Interaction.js","path":"src/structures"}},{"name":"member","description":"If this interaction was sent in a guild, the member which sent it","nullable":true,"type":[[["GuildMember"]],[["APIGuildMember"]]],"meta":{"line":64,"file":"Interaction.js","path":"src/structures"}},{"name":"version","description":"The version","type":[[["number"]]],"meta":{"line":70,"file":"Interaction.js","path":"src/structures"}},{"name":"appPermissions","description":"Set of permissions the application or bot has within the channel the interaction was sent from","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":76,"file":"Interaction.js","path":"src/structures"}},{"name":"memberPermissions","description":"The permissions of the member, if one exists, in the channel this interaction was executed in","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":82,"file":"Interaction.js","path":"src/structures"}},{"name":"locale","description":"The locale of the user who invoked this interaction","type":[[["Locale"]]],"meta":{"line":124,"file":"Interaction.js","path":"src/structures"}},{"name":"guildLocale","description":"The preferred locale from the guild this interaction was sent in","nullable":true,"type":[[["Locale"]]],"meta":{"line":130,"file":"Interaction.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the interaction was created at","readonly":true,"type":[[["number"]]],"meta":{"line":138,"file":"Interaction.js","path":"src/structures"}},{"name":"createdAt","description":"The time the interaction was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":147,"file":"Interaction.js","path":"src/structures"}},{"name":"channel","description":"The channel this interaction was sent in","readonly":true,"nullable":true,"type":[[["TextBasedChannels"]]],"meta":{"line":156,"file":"Interaction.js","path":"src/structures"}},{"name":"guild","description":"The guild this interaction was sent in","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":165,"file":"Interaction.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"resolveContextMenuOptions","description":"Resolves and transforms options received from the API for a context menu interaction.","access":"private","params":[{"name":"data","description":"The interaction data","type":[[["APIApplicationCommandInteractionData"]]]}],"returns":[[["Array","<"],["CommandInteractionOption",">"]]],"meta":{"line":43,"file":"ContextMenuInteraction.js","path":"src/structures"}},{"name":"transformResolved","description":"Transforms the resolved received from the API.","access":"private","inherits":"BaseCommandInteraction#transformResolved","inherited":true,"params":[{"name":"resolved","description":"The received resolved objects","type":[[["APIInteractionDataResolved"]]]}],"returns":[[["CommandInteractionResolvedData"]]],"meta":{"line":89,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"transformOption","description":"Transforms an option received from the API.","access":"private","inherits":"BaseCommandInteraction#transformOption","inherited":true,"params":[{"name":"option","description":"The received option","type":[[["APIApplicationCommandOption"]]]},{"name":"resolved","description":"The resolved interaction data","type":[[["APIInteractionDataResolved"]]]}],"returns":[[["CommandInteractionOption"]]],"meta":{"line":162,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"deferReply","description":"Defers the reply to this interaction.","inherits":"BaseCommandInteraction#deferReply","inherited":true,"implements":["InteractionResponses#deferReply"],"examples":["// Defer the reply to this interaction\ninteraction.deferReply()\n .then(console.log)\n .catch(console.error)","// Defer to send an ephemeral reply later\ninteraction.deferReply({ ephemeral: true })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for deferring the reply to this interaction","optional":true,"type":[[["InteractionDeferReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":58,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"reply","description":"Creates a reply to this interaction.\nUse the `fetchReply` option to get the bot's reply message.","inherits":"BaseCommandInteraction#reply","inherited":true,"implements":["InteractionResponses#reply"],"examples":["// Reply to the interaction and fetch the response\ninteraction.reply({ content: 'Pong!', fetchReply: true })\n .then((message) => console.log(`Reply sent with content ${message.content}`))\n .catch(console.error);","// Create an ephemeral reply with an embed\nconst embed = new MessageEmbed().setDescription('Pong!');\n\ninteraction.reply({ embeds: [embed], ephemeral: true })\n .then(() => console.log('Reply sent.'))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":93,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"fetchReply","description":"Fetches a reply to this interaction.","see":["Webhook#fetchMessage"],"inherits":"BaseCommandInteraction#fetchReply","inherited":true,"implements":["InteractionResponses#fetchReply"],"examples":["// Fetch the initial reply to this interaction\ninteraction.fetchReply()\n .then(reply => console.log(`Replied with ${reply.content}`))\n .catch(console.error);"],"params":[{"name":"message","description":"The response to fetch","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":127,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"editReply","description":"Edits a reply to this interaction.","see":["Webhook#editMessage"],"inherits":"BaseCommandInteraction#editReply","inherited":true,"implements":["InteractionResponses#editReply"],"examples":["// Edit the initial reply to this interaction\ninteraction.editReply('New content')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The new options for the message","type":[[["string"]],[["MessagePayload"]],[["InteractionEditReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":148,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"deleteReply","description":"Deletes a reply to this interaction.","see":["Webhook#deleteMessage"],"inherits":"BaseCommandInteraction#deleteReply","inherited":true,"implements":["InteractionResponses#deleteReply"],"examples":["// Delete the initial reply to this interaction\ninteraction.deleteReply()\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"message","description":"The response to delete","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":166,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"followUp","description":"Send a follow-up message to this interaction.","inherits":"BaseCommandInteraction#followUp","inherited":true,"implements":["InteractionResponses#followUp"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":175,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"showModal","description":"Shows a modal component","inherits":"BaseCommandInteraction#showModal","inherited":true,"implements":["InteractionResponses#showModal"],"params":[{"name":"modal","description":"The modal to show","type":[[["Modal"]],[["ModalOptions"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":243,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"awaitModalSubmit","description":"Collects a single modal submit interaction that passes the filter.\nThe Promise will reject if the time expires.","inherits":"BaseCommandInteraction#awaitModalSubmit","inherited":true,"implements":["InteractionResponses#awaitModalSubmit"],"examples":["// Collect a modal submit interaction\nconst filter = (interaction) => interaction.customId === 'modal';\ninteraction.awaitModalSubmit({ filter, time: 15_000 })\n .then(interaction => console.log(`${interaction.customId} was submitted!`))\n .catch(console.error);"],"params":[{"name":"options","description":"Options to pass to the internal collector","type":[[["AwaitModalSubmitOptions"]]]}],"returns":[[["Promise","<"],["ModalSubmitInteraction",">"]]],"meta":{"line":275,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"inGuild","description":"Indicates whether this interaction is received from a guild.","inherits":"Interaction#inGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":173,"file":"Interaction.js","path":"src/structures"}},{"name":"inCachedGuild","description":"Indicates whether or not this interaction is both cached and received from a guild.","inherits":"Interaction#inCachedGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":181,"file":"Interaction.js","path":"src/structures"}},{"name":"inRawGuild","description":"Indicates whether or not this interaction is received from an uncached guild.","inherits":"Interaction#inRawGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":189,"file":"Interaction.js","path":"src/structures"}},{"name":"isApplicationCommand","description":"Indicates whether this interaction is a {@link BaseCommandInteraction}.","inherits":"Interaction#isApplicationCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":197,"file":"Interaction.js","path":"src/structures"}},{"name":"isCommand","description":"Indicates whether this interaction is a {@link CommandInteraction}.","inherits":"Interaction#isCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":205,"file":"Interaction.js","path":"src/structures"}},{"name":"isContextMenu","description":"Indicates whether this interaction is a {@link ContextMenuInteraction}","inherits":"Interaction#isContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":213,"file":"Interaction.js","path":"src/structures"}},{"name":"isModalSubmit","description":"Indicates whether this interaction is a {@link ModalSubmitInteraction}","inherits":"Interaction#isModalSubmit","inherited":true,"returns":[[["boolean"]]],"meta":{"line":221,"file":"Interaction.js","path":"src/structures"}},{"name":"isUserContextMenu","description":"Indicates whether this interaction is a {@link UserContextMenuInteraction}","inherits":"Interaction#isUserContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":229,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageContextMenu","description":"Indicates whether this interaction is a {@link MessageContextMenuInteraction}","inherits":"Interaction#isMessageContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":237,"file":"Interaction.js","path":"src/structures"}},{"name":"isAutocomplete","description":"Indicates whether this interaction is an {@link AutocompleteInteraction}","inherits":"Interaction#isAutocomplete","inherited":true,"returns":[[["boolean"]]],"meta":{"line":245,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageComponent","description":"Indicates whether this interaction is a {@link MessageComponentInteraction}.","inherits":"Interaction#isMessageComponent","inherited":true,"returns":[[["boolean"]]],"meta":{"line":253,"file":"Interaction.js","path":"src/structures"}},{"name":"isButton","description":"Indicates whether this interaction is a {@link ButtonInteraction}.","inherits":"Interaction#isButton","inherited":true,"returns":[[["boolean"]]],"meta":{"line":261,"file":"Interaction.js","path":"src/structures"}},{"name":"isSelectMenu","description":"Indicates whether this interaction is a {@link SelectMenuInteraction}.","inherits":"Interaction#isSelectMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":272,"file":"Interaction.js","path":"src/structures"}},{"name":"isRepliable","description":"Indicates whether this interaction can be replied to.","inherits":"Interaction#isRepliable","inherited":true,"returns":[[["boolean"]]],"meta":{"line":283,"file":"Interaction.js","path":"src/structures"}}],"meta":{"line":11,"file":"ContextMenuInteraction.js","path":"src/structures"}},{"name":"DirectoryChannel","description":"Represents a channel that displays a directory of guilds.","extends":[[["Channel"]]],"props":[{"name":"name","description":"The channel's name","type":[[["string"]]],"meta":{"line":16,"file":"DirectoryChannel.js","path":"src/structures"}},{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the channel was created at","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"Channel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the channel was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":79,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"partial","description":"Whether this Channel is a partial\nThis is always false outside of DM channels.","readonly":true,"type":[[["boolean"]]],"meta":{"line":119,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"toString","description":"When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.","inherits":"Channel#toString","inherited":true,"examples":["// Logs: Hello from <#123456789012345678>!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":130,"file":"Channel.js","path":"src/structures"}},{"name":"delete","description":"Deletes this channel.","inherits":"Channel#delete","inherited":true,"examples":["// Delete the channel\nchannel.delete()\n .then(console.log)\n .catch(console.error);"],"async":true,"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":143,"file":"Channel.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this channel.","inherits":"Channel#fetch","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":153,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","inherits":"Channel#isText","inherited":true,"returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","inherits":"Channel#isVoice","inherited":true,"returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","inherits":"Channel#isThread","inherited":true,"returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","inherits":"Channel#isThreadOnly","inherited":true,"returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","inherits":"Channel#isDirectory","inherited":true,"returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":9,"file":"DirectoryChannel.js","path":"src/structures"}},{"name":"DMChannel","description":"Represents a direct message channel between two users.","extends":[[["Channel"]]],"implements":[[["TextBasedChannel"]]],"props":[{"name":"messages","description":"A manager of the messages belonging to this channel","type":[[["MessageManager"]]],"meta":{"line":25,"file":"DMChannel.js","path":"src/structures"}},{"name":"recipient","description":"The recipient on the other end of the DM","type":[[["User"]]],"meta":{"line":36,"file":"DMChannel.js","path":"src/structures"}},{"name":"lastMessageId","description":"The channel's last message id, if one was sent","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":44,"file":"DMChannel.js","path":"src/structures"}},{"name":"lastPinTimestamp","description":"The timestamp when the last pinned message was pinned, if there was one","nullable":true,"type":[[["number"]]],"meta":{"line":52,"file":"DMChannel.js","path":"src/structures"}},{"name":"messageRequest","description":"Whether the channel is a message request","nullable":true,"type":[[["boolean"]]],"meta":{"line":62,"file":"DMChannel.js","path":"src/structures"}},{"name":"messageRequestTimestamp","description":"The timestamp when the message request was created","nullable":true,"type":[[["number"]]],"meta":{"line":70,"file":"DMChannel.js","path":"src/structures"}},{"name":"partial","description":"Whether this DMChannel is a partial","readonly":true,"type":[[["boolean"]]],"meta":{"line":110,"file":"DMChannel.js","path":"src/structures"}},{"name":"voiceUsers","description":"The user in this voice-based channel","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["User",">"]]],"meta":{"line":165,"file":"DMChannel.js","path":"src/structures"}},{"name":"shard","description":"Get current shard","readonly":true,"type":[[["WebSocketShard"]]],"meta":{"line":180,"file":"DMChannel.js","path":"src/structures"}},{"name":"voiceAdapterCreator","description":"The voice state adapter for this client that can be used with @discordjs/voice to play audio in DM / Group DM channels.","readonly":true,"nullable":true,"type":[[["function"]]],"meta":{"line":189,"file":"DMChannel.js","path":"src/structures"}},{"name":"lastMessage","description":"The Message object of the last message in the channel, if one was sent","readonly":true,"nullable":true,"type":[[["Message"]]],"meta":{"line":51,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"lastPinAt","description":"The date when the last pinned message was pinned, if there was one","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":60,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the channel was created at","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"Channel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the channel was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":79,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"acceptMessageRequest","description":"Accept this DMChannel.","async":true,"returns":[[["Promise","<"],["DMChannel",">"]]],"meta":{"line":80,"file":"DMChannel.js","path":"src/structures"}},{"name":"cancelMessageRequest","description":"Cancel this DMChannel.","async":true,"returns":[[["Promise","<"],["DMChannel",">"]]],"meta":{"line":97,"file":"DMChannel.js","path":"src/structures"}},{"name":"fetch","description":"Fetch this DMChannel.","params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["DMChannel",">"]]],"meta":{"line":119,"file":"DMChannel.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the recipient's mention instead of the\nDMChannel object.","examples":["// Logs: Hello from <@123456789012345678>!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":131,"file":"DMChannel.js","path":"src/structures"}},{"name":"sync","description":"Sync VoiceState of this DMChannel.","returns":[[["undefined"]]],"meta":{"line":139,"file":"DMChannel.js","path":"src/structures"}},{"name":"ring","description":"Ring the user's phone / PC (call)","returns":[[["Promise","<"],["void",">"]]],"meta":{"line":152,"file":"DMChannel.js","path":"src/structures"}},{"name":"send","description":"Sends a message to this channel.","implements":["TextBasedChannel#send"],"examples":["// Send a basic message\nchannel.send('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.error);","// Send a remote file\nchannel.send({\n files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']\n})\n .then(console.log)\n .catch(console.error);","// Send a local file\nchannel.send({\n files: [{\n attachment: 'entire/path/to/file.jpg',\n name: 'file.jpg',\n description: 'A description of the file'\n }]\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["MessageOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":181,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"sendTyping","description":"Sends a typing indicator in the channel.","implements":["TextBasedChannel#sendTyping"],"examples":["// Start typing in a channel\nchannel.sendTyping();"],"returns":{"types":[[["Promise","<({"],["message_send_cooldown_ms",": "],["number",", "],["thread_create_cooldown_ms",": "],["number","}|"],["void",")>"]]],"description":"Resolves upon the typing status being sent"},"meta":{"line":395,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createMessageCollector","description":"Creates a Message Collector.","implements":["TextBasedChannel#createMessageCollector"],"examples":["// Create a message collector\nconst filter = m => m.content.includes('discord');\nconst collector = channel.createMessageCollector({ filter, time: 15_000 });\ncollector.on('collect', m => console.log(`Collected ${m.content}`));\ncollector.on('end', collected => console.log(`Collected ${collected.size} items`));"],"params":[{"name":"options","description":"The options to pass to the collector","optional":true,"default":"{}","type":[[["MessageCollectorOptions"]]]}],"returns":[[["MessageCollector"]]],"meta":{"line":410,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"awaitMessages","description":"Similar to createMessageCollector but in promise form.\nResolves with a collection of messages that pass the specified filter.","implements":["TextBasedChannel#awaitMessages"],"examples":["// Await !vote messages\nconst filter = m => m.content.startsWith('!vote');\n// Errors: ['time'] treats ending because of the time limit as an error\nchannel.awaitMessages({ filter, max: 4, time: 60_000, errors: ['time'] })\n .then(collected => console.log(collected.size))\n .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));"],"params":[{"name":"options","description":"Optional options to pass to the internal collector","optional":true,"default":"{}","type":[[["AwaitMessagesOptions"]]]}],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Message",">>"]]],"meta":{"line":433,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"delete","description":"Deletes this channel.","inherits":"Channel#delete","inherited":true,"examples":["// Delete the channel\nchannel.delete()\n .then(console.log)\n .catch(console.error);"],"async":true,"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":143,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","inherits":"Channel#isText","inherited":true,"returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","inherits":"Channel#isVoice","inherited":true,"returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","inherits":"Channel#isThread","inherited":true,"returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","inherits":"Channel#isThreadOnly","inherited":true,"returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","inherits":"Channel#isDirectory","inherited":true,"returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":14,"file":"DMChannel.js","path":"src/structures"}},{"name":"Emoji","description":"Represents an emoji, see {@link GuildEmoji} and {@link ReactionEmoji}.","extends":[[["Base"]]],"props":[{"name":"animated","description":"Whether or not the emoji is animated","nullable":true,"type":[[["boolean"]]],"meta":{"line":34,"file":"Emoji.js","path":"src/structures"}},{"name":"name","description":"The emoji's name","nullable":true,"type":[[["string"]]],"meta":{"line":40,"file":"Emoji.js","path":"src/structures"}},{"name":"id","description":"The emoji's id","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":46,"file":"Emoji.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":54,"file":"Emoji.js","path":"src/structures"}},{"name":"identifier","description":"The identifier of this emoji, used for message reactions","readonly":true,"type":[[["string"]]],"meta":{"line":84,"file":"Emoji.js","path":"src/structures"}},{"name":"url","description":"The URL to the emoji file if it's a custom emoji","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":94,"file":"Emoji.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the emoji was created at, or null if unicode","readonly":true,"nullable":true,"type":[[["number"]]],"meta":{"line":103,"file":"Emoji.js","path":"src/structures"}},{"name":"createdAt","description":"The time the emoji was created at, or null if unicode","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":112,"file":"Emoji.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"toString","description":"When concatenated with a string, this automatically returns the text required to form a graphical emoji on Discord\ninstead of the Emoji object.","examples":["// Send a custom emoji from a guild:\nconst emoji = guild.emojis.cache.first();\nmsg.channel.send(`Hello! ${emoji}`);","// Send the emoji used in a reaction to the channel the reaction is part of\nreaction.message.channel.send(`The emoji used was: ${reaction.emoji}`);"],"returns":[[["string"]]],"meta":{"line":128,"file":"Emoji.js","path":"src/structures"}}],"meta":{"line":27,"file":"Emoji.js","path":"src/structures"}},{"name":"FileComponent","construct":{"name":"FileComponent","params":[{"name":"data","description":"The data","optional":true,"default":"{}","type":[[["FileComponent"]],[["APIFileComponent"]]]}]},"props":[{"name":"file","description":"This unfurled media item is unique in that it only supports attachment references using the attachment:// syntax","type":[[["UnfurledMediaItem"]]],"meta":{"line":28,"file":"FileComponent.js","path":"src/structures"}},{"name":"spoiler","description":"Whether the container should be a spoiler (or blurred out). Defaults to false.","type":[[["Boolean"]]],"meta":{"line":34,"file":"FileComponent.js","path":"src/structures"}}],"methods":[{"name":"toJSON","returns":[[["APIFileComponent"]]],"meta":{"line":40,"file":"FileComponent.js","path":"src/structures"}}],"meta":{"line":16,"file":"FileComponent.js","path":"src/structures"}},{"name":"ForumChannel","description":"Represents a forum channel.","extends":[[["ThreadOnlyChannel"]]],"props":[{"name":"defaultForumLayout","description":"The default layout type used to display posts","type":[[["ForumLayoutType"]]],"meta":{"line":17,"file":"ForumChannel.js","path":"src/structures"}},{"name":"threads","description":"A manager of the threads belonging to this channel","type":[[["GuildForumThreadManager"]]],"meta":{"line":53,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"availableTags","description":"The set of tags that can be used in this channel.","type":[[["Array","<"],["GuildForumTag",">"]]],"meta":{"line":65,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"defaultReactionEmoji","description":"The emoji to show in the add reaction button on a thread in a guild forum channel","nullable":true,"type":[[["DefaultReactionEmoji"]]],"meta":{"line":75,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"defaultThreadRateLimitPerUser","description":"The initial rate limit per user (slowmode) to set on newly created threads in a channel.","nullable":true,"type":[[["number"]]],"meta":{"line":86,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"rateLimitPerUser","description":"The rate limit per user (slowmode) for this channel.","nullable":true,"type":[[["number"]]],"meta":{"line":96,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"defaultAutoArchiveDuration","description":"The default auto archive duration for newly created threads in this channel.","nullable":true,"type":[[["ThreadAutoArchiveDuration"]]],"meta":{"line":106,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"nsfw","description":"If this channel is considered NSFW.","type":[[["boolean"]]],"meta":{"line":116,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"topic","description":"The topic of this channel.","nullable":true,"type":[[["string"]]],"meta":{"line":126,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"defaultSortOrder","description":"The default sort order mode used to order posts","nullable":true,"type":[[["SortOrderType"]]],"meta":{"line":134,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"guild","description":"The guild the channel is in","type":[[["Guild"]]],"meta":{"line":31,"file":"GuildChannel.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild the channel is in","type":[[["Snowflake"]]],"meta":{"line":37,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionOverwrites","description":"A manager of permission overwrites that belong to this channel","type":[[["PermissionOverwriteManager"]]],"meta":{"line":44,"file":"GuildChannel.js","path":"src/structures"}},{"name":"name","description":"The name of the guild channel","type":[[["string"]]],"meta":{"line":57,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rawPosition","description":"The raw position of the channel from Discord","type":[[["number"]]],"meta":{"line":65,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parentId","description":"The id of the category parent of this channel","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":77,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parent","description":"The category parent of this channel","readonly":true,"nullable":true,"type":[[["CategoryChannel"]]],"meta":{"line":99,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionsLocked","description":"If the permissionOverwrites match the parent channel, null if no parent","readonly":true,"nullable":true,"type":[[["boolean"]]],"meta":{"line":108,"file":"GuildChannel.js","path":"src/structures"}},{"name":"position","description":"The position of the channel","readonly":true,"type":[[["number"]]],"meta":{"line":149,"file":"GuildChannel.js","path":"src/structures"}},{"name":"members","description":"A collection of cached members of this channel, mapped by their ids.\nMembers that can view this channel, if the channel is text-based.\nMembers in the channel, if the channel is voice-based.","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":276,"file":"GuildChannel.js","path":"src/structures"}},{"name":"deletable","description":"Whether the channel is deletable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":418,"file":"GuildChannel.js","path":"src/structures"}},{"name":"manageable","description":"Whether the channel is manageable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":427,"file":"GuildChannel.js","path":"src/structures"}},{"name":"viewable","description":"Whether the channel is viewable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":447,"file":"GuildChannel.js","path":"src/structures"}},{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the channel was created at","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"Channel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the channel was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":79,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"partial","description":"Whether this Channel is a partial\nThis is always false outside of DM channels.","readonly":true,"type":[[["boolean"]]],"meta":{"line":119,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"setDefaultForumLayout","description":"Sets the default forum layout type used to display posts","params":[{"name":"defaultForumLayout","description":"The default forum layout type to set on this channel","type":[[["ForumLayoutType"]]]},{"name":"reason","description":"Reason for changing the default forum layout","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["ForumChannel",">"]]],"meta":{"line":26,"file":"ForumChannel.js","path":"src/structures"}},{"name":"setAvailableTags","description":"Sets the available tags for this forum channel","inherits":"ThreadOnlyChannel#setAvailableTags","inherited":true,"params":[{"name":"availableTags","description":"The tags to set as available in this channel","type":[[["Array","<"],["GuildForumTagData",">"]]]},{"name":"reason","description":"Reason for changing the available tags","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":146,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"setDefaultReactionEmoji","description":"Sets the default reaction emoji for this channel","inherits":"ThreadOnlyChannel#setDefaultReactionEmoji","inherited":true,"params":[{"name":"defaultReactionEmoji","description":"The emoji to set as the default reaction emoji","nullable":true,"type":[[["DefaultReactionEmoji"]]]},{"name":"reason","description":"Reason for changing the default reaction emoji","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":156,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"setDefaultThreadRateLimitPerUser","description":"Sets the default rate limit per user (slowmode) for new threads in this channel","inherits":"ThreadOnlyChannel#setDefaultThreadRateLimitPerUser","inherited":true,"params":[{"name":"defaultThreadRateLimitPerUser","description":"The rate limit to set on newly created threads in this channel","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the default rate limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":166,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"setDefaultSortOrder","description":"Sets the default sort order mode used to order posts","inherits":"ThreadOnlyChannel#setDefaultSortOrder","inherited":true,"params":[{"name":"defaultSortOrder","description":"The default sort order mode to set on this channel","nullable":true,"type":[[["SortOrderType"]]]},{"name":"reason","description":"Reason for changing the default sort order","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":176,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"createInvite","description":"Creates an invite to this guild channel.","inherits":"ThreadOnlyChannel#createInvite","inherited":true,"examples":["// Create an invite to a channel\nchannel.createInvite()\n .then(invite => console.log(`Created an invite with a code of ${invite.code}`))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for creating the invite","optional":true,"default":"{}","type":[[["CreateInviteOptions"]]]}],"returns":[[["Promise","<"],["Invite",">"]]],"meta":{"line":190,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"fetchInvites","description":"Fetches a collection of invites to this guild channel.\nResolves with a collection mapping invites by their codes.","inherits":"ThreadOnlyChannel#fetchInvites","inherited":true,"params":[{"name":"cache","description":"Whether or not to cache the fetched invites","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Collection","<"],["string",", "],["Invite",">>"]]],"meta":{"line":200,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"setDefaultAutoArchiveDuration","description":"Sets the default auto archive duration for all newly created threads in this channel.","inherits":"ThreadOnlyChannel#setDefaultAutoArchiveDuration","inherited":true,"params":[{"name":"defaultAutoArchiveDuration","description":"The new default auto archive duration","type":[[["ThreadAutoArchiveDuration"]]]},{"name":"reason","description":"Reason for changing the channel's default auto archive duration","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":210,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"setTopic","description":"Sets a new topic for the guild channel.","inherits":"ThreadOnlyChannel#setTopic","inherited":true,"examples":["// Set a new channel topic\nchannel.setTopic('needs more rate limiting')\n .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))\n .catch(console.error);"],"params":[{"name":"topic","description":"The new topic for the guild channel","nullable":true,"type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's topic","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":225,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"fetchWebhooks","description":"Fetches all webhooks for the channel.","inherits":"ThreadOnlyChannel#fetchWebhooks","inherited":true,"implements":["TextBasedChannel#fetchWebhooks"],"examples":["// Fetch webhooks\nchannel.fetchWebhooks()\n .then(hooks => console.log(`This channel has ${hooks.size} hooks`))\n .catch(console.error);"],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Webhook",">>"]]],"meta":{"line":455,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createWebhook","description":"Creates a webhook for the channel.","inherits":"ThreadOnlyChannel#createWebhook","inherited":true,"implements":["TextBasedChannel#createWebhook"],"examples":["// Create a webhook for the current channel\nchannel.createWebhook('Snek', {\n avatar: 'https://i.imgur.com/mI8XcpG.jpg',\n reason: 'Needed a cool new Webhook'\n})\n .then(console.log)\n .catch(console.error)"],"params":[{"name":"name","description":"The name of the webhook","type":[[["string"]]]},{"name":"options","description":"Options for creating the webhook","optional":true,"type":[[["ChannelWebhookCreateOptions"]]]}],"returns":{"types":[[["Promise","<"],["Webhook",">"]]],"description":"Returns the created Webhook"},"meta":{"line":480,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setRateLimitPerUser","description":"Sets the rate limit per user (slowmode) for this channel.","inherits":"ThreadOnlyChannel#setRateLimitPerUser","inherited":true,"implements":["TextBasedChannel#setRateLimitPerUser"],"params":[{"name":"rateLimitPerUser","description":"The new rate limit in seconds","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the channel's rate limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":490,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setNSFW","description":"Sets whether this channel is flagged as NSFW.","inherits":"ThreadOnlyChannel#setNSFW","inherited":true,"implements":["TextBasedChannel#setNSFW"],"params":[{"name":"nsfw","description":"Whether the channel should be considered NSFW","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for changing the channel's NSFW flag","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":500,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"permissionsFor","description":"Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.","inherits":"GuildChannel#permissionsFor","inherited":true,"params":[{"name":"memberOrRole","description":"The member or role to obtain the overall permissions for","type":[[["GuildMemberResolvable"]],[["RoleResolvable"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":{"types":[[["Readonly","<"],["Permissions",">"]]],"nullable":true},"meta":{"line":173,"file":"GuildChannel.js","path":"src/structures"}},{"name":"memberPermissions","description":"Gets the overall set of permissions for a member in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#memberPermissions","inherited":true,"params":[{"name":"member","description":"The member to obtain the overall permissions for","type":[[["GuildMember"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","default":true,"type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":213,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rolePermissions","description":"Gets the overall set of permissions for a role in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#rolePermissions","inherited":true,"params":[{"name":"role","description":"The role to obtain the overall permissions for","type":[[["Role"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":242,"file":"GuildChannel.js","path":"src/structures"}},{"name":"lockPermissions","description":"Locks in the permission overwrites from the parent channel.","inherits":"GuildChannel#lockPermissions","inherited":true,"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":263,"file":"GuildChannel.js","path":"src/structures"}},{"name":"edit","description":"Edits the channel.","inherits":"GuildChannel#edit","inherited":true,"examples":["// Edit a channel\nchannel.edit({ name: 'new-channel' })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"data","description":"The new data for the channel","type":[[["ChannelData"]]]},{"name":"reason","description":"Reason for editing this channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":291,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setName","description":"Sets a new name for the guild channel.","inherits":"GuildChannel#setName","inherited":true,"examples":["// Set a new channel name\nchannel.setName('not_general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.error);"],"params":[{"name":"name","description":"The new name for the guild channel","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":306,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setParent","description":"Sets the parent of this channel.","inherits":"GuildChannel#setParent","inherited":true,"examples":["// Add a parent to a channel\nmessage.channel.setParent('355908108431917066', { lockPermissions: false })\n .then(channel => console.log(`New parent of ${message.channel.name}: ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"channel","description":"The category channel to set as the parent","nullable":true,"type":[[["CategoryChannelResolvable"]]]},{"name":"options","description":"The options for setting the parent","optional":true,"default":"{}","type":[[["SetParentOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":328,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setPosition","description":"Sets a new position for the guild channel.","inherits":"GuildChannel#setPosition","inherited":true,"examples":["// Set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.error);"],"params":[{"name":"position","description":"The new position for the guild channel","type":[[["number"]]]},{"name":"options","description":"Options for setting position","optional":true,"type":[[["SetChannelPositionOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":356,"file":"GuildChannel.js","path":"src/structures"}},{"name":"clone","description":"Clones this channel.","inherits":"GuildChannel#clone","inherited":true,"params":[{"name":"options","description":"The options for cloning this channel","optional":true,"type":[[["GuildChannelCloneOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":371,"file":"GuildChannel.js","path":"src/structures"}},{"name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites, and id as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","inherits":"GuildChannel#equals","inherited":true,"params":[{"name":"channel","description":"Channel to compare with","type":[[["GuildChannel"]]]}],"returns":[[["boolean"]]],"meta":{"line":393,"file":"GuildChannel.js","path":"src/structures"}},{"name":"delete","description":"Deletes this channel.","inherits":"GuildChannel#delete","inherited":true,"examples":["// Delete the channel\nchannel.delete('making room for new channels')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"reason","description":"Reason for deleting this channel","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":464,"file":"GuildChannel.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.","inherits":"Channel#toString","inherited":true,"examples":["// Logs: Hello from <#123456789012345678>!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":130,"file":"Channel.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this channel.","inherits":"Channel#fetch","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":153,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","inherits":"Channel#isText","inherited":true,"returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","inherits":"Channel#isVoice","inherited":true,"returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","inherits":"Channel#isThread","inherited":true,"returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","inherits":"Channel#isThreadOnly","inherited":true,"returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","inherits":"Channel#isDirectory","inherited":true,"returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":10,"file":"ForumChannel.js","path":"src/structures"}},{"name":"GroupDMChannel","description":"Represents a Group DM Channel on Discord.","extends":[[["Channel"]]],"implements":[[["TextBasedChannel"]]],"props":[{"name":"messages","description":"A manager of the messages belonging to this channel","type":[[["MessageManager"]]],"meta":{"line":26,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"ownerId","description":"The user id of the owner of this Group DM Channel","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":44,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"lastMessageId","description":"The channel's last message id, if one was sent","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":54,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"lastPinTimestamp","description":"The timestamp when the last pinned message was pinned, if there was one","nullable":true,"type":[[["number"]]],"meta":{"line":64,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"name","description":"The name of this Group DM Channel","nullable":true,"type":[[["string"]]],"meta":{"line":74,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"icon","description":"The hash of the channel icon","nullable":true,"type":[[["string"]]],"meta":{"line":82,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"recipients","description":"The recipients of this Group DM Channel.","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["User",">"]]],"meta":{"line":100,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"owner","description":"The owner of this Group DM Channel","readonly":true,"nullable":true,"type":[[["User"]]],"meta":{"line":112,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"partial","description":"Whether this DMChannel is a partial","readonly":true,"type":[[["boolean"]]],"meta":{"line":121,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"voiceUsers","description":"The user in this voice-based channel","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["User",">"]]],"meta":{"line":335,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"shard","description":"Get current shard","readonly":true,"type":[[["WebSocketShard"]]],"meta":{"line":350,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"voiceAdapterCreator","description":"The voice state adapter for this client that can be used with @discordjs/voice to play audio in DM / Group DM channels.","readonly":true,"nullable":true,"type":[[["function"]]],"meta":{"line":359,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"lastMessage","description":"The Message object of the last message in the channel, if one was sent","readonly":true,"nullable":true,"type":[[["Message"]]],"meta":{"line":51,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"lastPinAt","description":"The date when the last pinned message was pinned, if there was one","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":60,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the channel was created at","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"Channel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the channel was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":79,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"iconURL","description":"The URL to this channel's icon.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":91,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"delete","description":"Leave this Group DM Channel.","examples":["// Delete the channel\nchannel.delete()\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"slient","description":"Leave without notifying other members","default":false,"nullable":true,"type":[[["boolean"]]]}],"async":true,"returns":[[["Promise","<"],["GroupDMChannel",">"]]],"meta":{"line":135,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the recipient's mention instead of the\nGroupDMChannel object.","examples":["// Logs: Hello from Group Test!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":156,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"edit","description":"Edit channel data","examples":["// Set the channel name\nchannel.edit({\n name: 'Group Test',\n})\n .then(updated => console.log(`New channel name ${updated}`))\n .catch(console.error);"],"params":[{"name":"data","description":"Data","type":[[["GroupDMChannelEditData"]]]}],"async":true,"returns":[[["Promise","<"],["GroupDMChannel",">"]]],"meta":{"line":194,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"setName","description":"Renames this Group DM Channel.","params":[{"name":"name","description":"Name of the channel","nullable":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GroupDMChannel",">"]]],"meta":{"line":215,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"setIcon","description":"Sets the icon of this Group DM Channel.","params":[{"name":"icon","description":"Icon of the channel","nullable":true,"type":[[["Base64Resolvable"]],[["BufferResolvable"]]]}],"returns":[[["Promise","<"],["GroupDMChannel",">"]]],"meta":{"line":224,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"setOwner","description":"Changes the owner of this Group DM Channel.","params":[{"name":"user","description":"User to transfer ownership to","type":[[["UserResolvable"]]]}],"returns":[[["Promise","<"],["GroupDMChannel",">"]]],"meta":{"line":233,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"addUser","description":"Adds a user to this Group DM Channel.","params":[{"name":"user","description":"User to add to the group","type":[[["UserResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["GroupDMChannel",">"]]],"meta":{"line":246,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"removeUser","description":"Removes a user from this Group DM Channel.","params":[{"name":"user","description":"User to remove from the group","type":[[["UserResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["GroupDMChannel",">"]]],"meta":{"line":257,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"getInvite","description":"Gets the invite for this Group DM Channel.","async":true,"returns":[[["Promise","<"],["Invite",">"]]],"meta":{"line":267,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"fetchAllInvite","description":"Get all the invites for this Group DM Channel.","async":true,"returns":[[["Promise","<"],["Collection","<"],["string",", "],["Invite",">>"]]],"meta":{"line":280,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"removeInvite","description":"Delete invites from this Group DM Channel.","params":[{"name":"invite","description":"Invite to add to the channel","type":[[["InviteResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["GroupDMChannel",">"]]],"meta":{"line":290,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"ring","description":"Ring the user's phone / PC (call)","params":[{"name":"recipients","description":"Array of recipients","optional":true,"type":[[["Array","<"],["UserResolvable",">"]]]}],"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":304,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"sync","description":"Sync VoiceState of this Group DMChannel.","returns":[[["undefined"]]],"meta":{"line":321,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"send","description":"Sends a message to this channel.","implements":["TextBasedChannel#send"],"examples":["// Send a basic message\nchannel.send('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.error);","// Send a remote file\nchannel.send({\n files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']\n})\n .then(console.log)\n .catch(console.error);","// Send a local file\nchannel.send({\n files: [{\n attachment: 'entire/path/to/file.jpg',\n name: 'file.jpg',\n description: 'A description of the file'\n }]\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["MessageOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":181,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"sendTyping","description":"Sends a typing indicator in the channel.","implements":["TextBasedChannel#sendTyping"],"examples":["// Start typing in a channel\nchannel.sendTyping();"],"returns":{"types":[[["Promise","<({"],["message_send_cooldown_ms",": "],["number",", "],["thread_create_cooldown_ms",": "],["number","}|"],["void",")>"]]],"description":"Resolves upon the typing status being sent"},"meta":{"line":395,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createMessageCollector","description":"Creates a Message Collector.","implements":["TextBasedChannel#createMessageCollector"],"examples":["// Create a message collector\nconst filter = m => m.content.includes('discord');\nconst collector = channel.createMessageCollector({ filter, time: 15_000 });\ncollector.on('collect', m => console.log(`Collected ${m.content}`));\ncollector.on('end', collected => console.log(`Collected ${collected.size} items`));"],"params":[{"name":"options","description":"The options to pass to the collector","optional":true,"default":"{}","type":[[["MessageCollectorOptions"]]]}],"returns":[[["MessageCollector"]]],"meta":{"line":410,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"awaitMessages","description":"Similar to createMessageCollector but in promise form.\nResolves with a collection of messages that pass the specified filter.","implements":["TextBasedChannel#awaitMessages"],"examples":["// Await !vote messages\nconst filter = m => m.content.startsWith('!vote');\n// Errors: ['time'] treats ending because of the time limit as an error\nchannel.awaitMessages({ filter, max: 4, time: 60_000, errors: ['time'] })\n .then(collected => console.log(collected.size))\n .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));"],"params":[{"name":"options","description":"Optional options to pass to the internal collector","optional":true,"default":"{}","type":[[["AwaitMessagesOptions"]]]}],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Message",">>"]]],"meta":{"line":433,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"fetch","description":"Fetches this channel.","inherits":"Channel#fetch","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":153,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","inherits":"Channel#isText","inherited":true,"returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","inherits":"Channel#isVoice","inherited":true,"returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","inherits":"Channel#isThread","inherited":true,"returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","inherits":"Channel#isThreadOnly","inherited":true,"returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","inherits":"Channel#isDirectory","inherited":true,"returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":16,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"Guild","description":"Represents a guild (or a server) on Discord.\nIt's recommended to see if a guild is available before performing operations or reading data from it. You can\ncheck this with {@link Guild#available}.","extends":[[["AnonymousGuild"]]],"props":[{"name":"members","description":"A manager of the members belonging to this guild","type":[[["GuildMemberManager"]]],"meta":{"line":65,"file":"Guild.js","path":"src/structures"}},{"name":"channels","description":"A manager of the channels belonging to this guild","type":[[["GuildChannelManager"]]],"meta":{"line":71,"file":"Guild.js","path":"src/structures"}},{"name":"bans","description":"A manager of the bans belonging to this guild","type":[[["GuildBanManager"]]],"meta":{"line":77,"file":"Guild.js","path":"src/structures"}},{"name":"roles","description":"A manager of the roles belonging to this guild","type":[[["RoleManager"]]],"meta":{"line":83,"file":"Guild.js","path":"src/structures"}},{"name":"presences","description":"A manager of the presences belonging to this guild","type":[[["PresenceManager"]]],"meta":{"line":89,"file":"Guild.js","path":"src/structures"}},{"name":"voiceStates","description":"A manager of the voice states of this guild","type":[[["VoiceStateManager"]]],"meta":{"line":95,"file":"Guild.js","path":"src/structures"}},{"name":"stageInstances","description":"A manager of the stage instances of this guild","type":[[["StageInstanceManager"]]],"meta":{"line":101,"file":"Guild.js","path":"src/structures"}},{"name":"invites","description":"A manager of the invites of this guild","type":[[["GuildInviteManager"]]],"meta":{"line":107,"file":"Guild.js","path":"src/structures"}},{"name":"scheduledEvents","description":"A manager of the scheduled events of this guild","type":[[["GuildScheduledEventManager"]]],"meta":{"line":113,"file":"Guild.js","path":"src/structures"}},{"name":"autoModerationRules","description":"A manager of the auto moderation rules of this guild.","type":[[["AutoModerationRuleManager"]]],"meta":{"line":119,"file":"Guild.js","path":"src/structures"}},{"name":"settings","description":"All of the settings {@link Object}","type":[[["GuildSettingManager"]]],"meta":{"line":125,"file":"Guild.js","path":"src/structures"}},{"name":"available","description":"Whether the guild is available to access. If it is not available, it indicates a server outage","type":[[["boolean"]]],"meta":{"line":133,"file":"Guild.js","path":"src/structures"}},{"name":"shardId","description":"The id of the shard this Guild belongs to.","type":[[["number"]]],"meta":{"line":143,"file":"Guild.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":151,"file":"Guild.js","path":"src/structures"}},{"name":"shard","description":"The Shard this Guild belongs to.","readonly":true,"type":[[["WebSocketShard"]]],"meta":{"line":181,"file":"Guild.js","path":"src/structures"}},{"name":"discoverySplash","description":"The hash of the guild discovery splash image","nullable":true,"type":[[["string"]]],"meta":{"line":201,"file":"Guild.js","path":"src/structures"}},{"name":"memberCount","description":"The full amount of members in this guild","type":[[["number"]]],"meta":{"line":209,"file":"Guild.js","path":"src/structures"}},{"name":"large","description":"Whether the guild is \"large\" (has more than {@link WebsocketOptions large_threshold} members, 50 by default)","type":[[["boolean"]]],"meta":{"line":217,"file":"Guild.js","path":"src/structures"}},{"name":"premiumProgressBarEnabled","description":"Whether this guild has its premium (boost) progress bar enabled","type":[[["boolean"]]],"meta":{"line":225,"file":"Guild.js","path":"src/structures"}},{"name":"applicationId","description":"The id of the application that created this guild (if applicable)","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":270,"file":"Guild.js","path":"src/structures"}},{"name":"afkTimeout","description":"The time in seconds before a user is counted as \"away from keyboard\"","nullable":true,"type":[[["number"]]],"meta":{"line":278,"file":"Guild.js","path":"src/structures"}},{"name":"afkChannelId","description":"The id of the voice channel where AFK members are moved","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":286,"file":"Guild.js","path":"src/structures"}},{"name":"systemChannelId","description":"The system channel's id","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":294,"file":"Guild.js","path":"src/structures"}},{"name":"premiumTier","description":"The premium tier of this guild","type":[[["PremiumTier"]]],"meta":{"line":302,"file":"Guild.js","path":"src/structures"}},{"name":"widgetEnabled","description":"Whether widget images are enabled on this guild","nullable":true,"type":[[["boolean"]]],"meta":{"line":310,"file":"Guild.js","path":"src/structures"}},{"name":"widgetChannelId","description":"The widget channel's id, if enabled","nullable":true,"type":[[["string"]]],"meta":{"line":318,"file":"Guild.js","path":"src/structures"}},{"name":"explicitContentFilter","description":"The explicit content filter level of the guild","type":[[["ExplicitContentFilterLevel"]]],"meta":{"line":326,"file":"Guild.js","path":"src/structures"}},{"name":"mfaLevel","description":"The required MFA level for this guild","type":[[["MFALevel"]]],"meta":{"line":334,"file":"Guild.js","path":"src/structures"}},{"name":"joinedTimestamp","description":"The timestamp the client user joined the guild at","type":[[["number"]]],"meta":{"line":342,"file":"Guild.js","path":"src/structures"}},{"name":"defaultMessageNotifications","description":"The default message notification level of the guild","type":[[["DefaultMessageNotificationLevel"]]],"meta":{"line":350,"file":"Guild.js","path":"src/structures"}},{"name":"systemChannelFlags","description":"The value set for the guild's system channel flags","type":[[["Readonly","<"],["SystemChannelFlags",">"]]],"meta":{"line":358,"file":"Guild.js","path":"src/structures"}},{"name":"maximumMembers","description":"The maximum amount of members the guild can have","nullable":true,"type":[[["number"]]],"meta":{"line":366,"file":"Guild.js","path":"src/structures"}},{"name":"maximumPresences","description":"The maximum amount of presences the guild can have\nYou will need to fetch the guild using {@link Guild#fetch} if you want to receive this parameter","nullable":true,"type":[[["number"]]],"meta":{"line":377,"file":"Guild.js","path":"src/structures"}},{"name":"maxVideoChannelUsers","description":"The maximum amount of users allowed in a video channel.","nullable":true,"type":[[["number"]]],"meta":{"line":387,"file":"Guild.js","path":"src/structures"}},{"name":"maxStageVideoChannelUsers","description":"The maximum amount of users allowed in a stage video channel.","nullable":true,"type":[[["number"]]],"meta":{"line":397,"file":"Guild.js","path":"src/structures"}},{"name":"approximateMemberCount","description":"The approximate amount of members the guild has\nYou will need to fetch the guild using {@link Guild#fetch} if you want to receive this parameter","nullable":true,"type":[[["number"]]],"meta":{"line":408,"file":"Guild.js","path":"src/structures"}},{"name":"approximatePresenceCount","description":"The approximate amount of presences the guild has\nYou will need to fetch the guild using {@link Guild#fetch} if you want to receive this parameter","nullable":true,"type":[[["number"]]],"meta":{"line":419,"file":"Guild.js","path":"src/structures"}},{"name":"vanityURLUses","description":"The use count of the vanity URL code of the guild, if any\nYou will need to fetch this parameter using {@link Guild#fetchVanityData} if you want to receive it","nullable":true,"type":[[["number"]]],"meta":{"line":429,"file":"Guild.js","path":"src/structures"}},{"name":"rulesChannelId","description":"The rules channel's id for the guild","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":436,"file":"Guild.js","path":"src/structures"}},{"name":"publicUpdatesChannelId","description":"The community updates channel's id for the guild","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":444,"file":"Guild.js","path":"src/structures"}},{"name":"preferredLocale","description":"The preferred locale of the guild, defaults to `en-US`","see":["{@link https://discord.com/developers/docs/reference#locales}"],"type":[[["Locale"]]],"meta":{"line":453,"file":"Guild.js","path":"src/structures"}},{"name":"safetyAlertsChannelId","description":"The safety alerts channel's id for the guild","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":461,"file":"Guild.js","path":"src/structures"}},{"name":"ownerId","description":"The user id of this guild's owner","type":[[["Snowflake"]]],"meta":{"line":494,"file":"Guild.js","path":"src/structures"}},{"name":"emojis","description":"A manager of the emojis belonging to this guild","type":[[["GuildEmojiManager"]]],"meta":{"line":529,"file":"Guild.js","path":"src/structures"}},{"name":"stickers","description":"A manager of the stickers belonging to this guild","type":[[["GuildStickerManager"]]],"meta":{"line":543,"file":"Guild.js","path":"src/structures"}},{"name":"incidentsData","description":"The incidents data of this guild.\nYou will need to fetch the guild using {@link BaseGuild#fetch} if you want to receive\nthis property.","nullable":true,"type":[[["IncidentActions"]]],"meta":{"line":568,"file":"Guild.js","path":"src/structures"}},{"name":"joinedAt","description":"The time the client user joined the guild","readonly":true,"type":[[["Date"]]],"meta":{"line":579,"file":"Guild.js","path":"src/structures"}},{"name":"afkChannel","description":"AFK voice channel for this guild","readonly":true,"nullable":true,"type":[[["VoiceChannel"]]],"meta":{"line":607,"file":"Guild.js","path":"src/structures"}},{"name":"systemChannel","description":"System channel for this guild","readonly":true,"nullable":true,"type":[[["TextChannel"]]],"meta":{"line":616,"file":"Guild.js","path":"src/structures"}},{"name":"safetyAlertsChannel","description":"Safety alerts channel for this guild","readonly":true,"nullable":true,"type":[[["TextChannel"]]],"meta":{"line":625,"file":"Guild.js","path":"src/structures"}},{"name":"widgetChannel","description":"Widget channel for this guild","readonly":true,"nullable":true,"type":[[["TextChannel"]],[["NewsChannel"]],[["VoiceChannel"]],[["StageChannel"]],[["ForumChannel"]],[["MediaChannel"]]],"meta":{"line":634,"file":"Guild.js","path":"src/structures"}},{"name":"rulesChannel","description":"Rules channel for this guild","readonly":true,"nullable":true,"type":[[["TextChannel"]]],"meta":{"line":643,"file":"Guild.js","path":"src/structures"}},{"name":"publicUpdatesChannel","description":"Public updates channel for this guild","readonly":true,"nullable":true,"type":[[["TextChannel"]]],"meta":{"line":652,"file":"Guild.js","path":"src/structures"}},{"name":"me","description":"The client user as a GuildMember of this guild","readonly":true,"nullable":true,"deprecated":"Use {@link GuildMemberManager#me} instead.","type":[[["GuildMember"]]],"meta":{"line":662,"file":"Guild.js","path":"src/structures"}},{"name":"maximumBitrate","description":"The maximum bitrate available for this guild","readonly":true,"type":[[["number"]]],"meta":{"line":676,"file":"Guild.js","path":"src/structures"}},{"name":"voiceAdapterCreator","description":"The voice state adapter for this guild that can be used with @discordjs/voice to play audio in voice\nand stage channels.","readonly":true,"type":[[["function"]]],"meta":{"line":1587,"file":"Guild.js","path":"src/structures"}},{"name":"splash","description":"The hash of the guild invite splash image","nullable":true,"type":[[["string"]]],"meta":{"line":25,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"banner","description":"The hash of the guild banner","nullable":true,"type":[[["string"]]],"meta":{"line":33,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"description","description":"The description of the guild, if any","nullable":true,"type":[[["string"]]],"meta":{"line":41,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"verificationLevel","description":"The verification level of the guild","type":[[["VerificationLevel"]]],"meta":{"line":49,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"vanityURLCode","description":"The vanity invite code of the guild, if any","nullable":true,"type":[[["string"]]],"meta":{"line":57,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"nsfwLevel","description":"The NSFW level of this guild","type":[[["NSFWLevel"]]],"meta":{"line":65,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"premiumSubscriptionCount","description":"The total number of boosts for this server","nullable":true,"type":[[["number"]]],"meta":{"line":73,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"id","description":"The guild's id","type":[[["Snowflake"]]],"meta":{"line":19,"file":"BaseGuild.js","path":"src/structures"}},{"name":"name","description":"The name of this guild","type":[[["string"]]],"meta":{"line":25,"file":"BaseGuild.js","path":"src/structures"}},{"name":"icon","description":"The icon hash of this guild","nullable":true,"type":[[["string"]]],"meta":{"line":31,"file":"BaseGuild.js","path":"src/structures"}},{"name":"features","description":"An array of features available to this guild","type":[[["Array","<"],["Features",">"]]],"meta":{"line":37,"file":"BaseGuild.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp this guild was created at","readonly":true,"type":[[["number"]]],"meta":{"line":45,"file":"BaseGuild.js","path":"src/structures"}},{"name":"createdAt","description":"The time this guild was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":54,"file":"BaseGuild.js","path":"src/structures"}},{"name":"nameAcronym","description":"The acronym that shows up in place of a guild icon","readonly":true,"type":[[["string"]]],"meta":{"line":63,"file":"BaseGuild.js","path":"src/structures"}},{"name":"partnered","description":"Whether this guild is partnered","readonly":true,"type":[[["boolean"]]],"meta":{"line":75,"file":"BaseGuild.js","path":"src/structures"}},{"name":"verified","description":"Whether this guild is verified","readonly":true,"type":[[["boolean"]]],"meta":{"line":84,"file":"BaseGuild.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"discoverySplashURL","description":"The URL to this guild's discovery splash image.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":588,"file":"Guild.js","path":"src/structures"}},{"name":"fetchOwner","description":"Fetches the owner of the guild.\nIf the member object isn't needed, use {@link Guild#ownerId} instead.","params":[{"name":"options","description":"The options for fetching the member","optional":true,"type":[[["BaseFetchOptions"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":598,"file":"Guild.js","path":"src/structures"}},{"name":"fetchIntegrations","description":"Fetches a collection of integrations to this guild.\nResolves with a collection mapping integrations by their ids.","examples":["// Fetch integrations\nguild.fetchIntegrations()\n .then(integrations => console.log(`Fetched ${integrations.size} integrations`))\n .catch(console.error);"],"async":true,"returns":[[["Promise","<"],["Collection","<("],["Snowflake","|"],["string","), "],["Integration",">>"]]],"meta":{"line":703,"file":"Guild.js","path":"src/structures"}},{"name":"fetchTemplates","description":"Fetches a collection of templates from this guild.\nResolves with a collection mapping templates by their codes.","async":true,"returns":[[["Promise","<"],["Collection","<"],["string",", "],["GuildTemplate",">>"]]],"meta":{"line":716,"file":"Guild.js","path":"src/structures"}},{"name":"fetchWelcomeScreen","description":"Fetches the welcome screen for this guild.","async":true,"returns":[[["Promise","<"],["WelcomeScreen",">"]]],"meta":{"line":725,"file":"Guild.js","path":"src/structures"}},{"name":"createTemplate","description":"Creates a template for the guild.","params":[{"name":"name","description":"The name for the template","type":[[["string"]]]},{"name":"description","description":"The description for the template","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildTemplate",">"]]],"meta":{"line":736,"file":"Guild.js","path":"src/structures"}},{"name":"fetchPreview","description":"Obtains a guild preview for this guild from Discord.","async":true,"returns":[[["Promise","<"],["GuildPreview",">"]]],"meta":{"line":745,"file":"Guild.js","path":"src/structures"}},{"name":"fetchVanityData","description":"Fetches the vanity URL invite object to this guild.\nResolves with an object containing the vanity URL invite code and the use count","examples":["// Fetch invite data\nguild.fetchVanityData()\n .then(res => {\n console.log(`Vanity URL: https://discord.gg/${res.code} with ${res.uses} uses`);\n })\n .catch(console.error);"],"async":true,"returns":[[["Promise","<"],["Vanity",">"]]],"meta":{"line":769,"file":"Guild.js","path":"src/structures"}},{"name":"fetchWebhooks","description":"Fetches all webhooks for the guild.","examples":["// Fetch webhooks\nguild.fetchWebhooks()\n .then(webhooks => console.log(`Fetched ${webhooks.size} webhooks`))\n .catch(console.error);"],"async":true,"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Webhook",">>"]]],"meta":{"line":786,"file":"Guild.js","path":"src/structures"}},{"name":"fetchWidget","description":"Fetches the guild widget data, requires the widget to be enabled.","examples":["// Fetches the guild widget data\nguild.fetchWidget()\n .then(widget => console.log(`The widget shows ${widget.channels.size} channels`))\n .catch(console.error);"],"returns":[[["Promise","<"],["Widget",">"]]],"meta":{"line":802,"file":"Guild.js","path":"src/structures"}},{"name":"fetchWidgetSettings","description":"Fetches the guild widget settings.","examples":["// Fetches the guild widget settings\nguild.fetchWidgetSettings()\n .then(widget => console.log(`The widget is ${widget.enabled ? 'enabled' : 'disabled'}`))\n .catch(console.error);"],"async":true,"returns":[[["Promise","<"],["GuildWidgetSettings",">"]]],"meta":{"line":829,"file":"Guild.js","path":"src/structures"}},{"name":"fetchAuditLogs","description":"Fetches audit logs for this guild.","examples":["// Output audit log entries\nguild.fetchAuditLogs()\n .then(audit => console.log(audit.entries.first()))\n .catch(console.error);"],"params":[{"name":"options","description":"Options for fetching audit logs","optional":true,"default":"{}","type":[[["GuildAuditLogsFetchOptions"]]]}],"async":true,"returns":[[["Promise","<"],["GuildAuditLogs",">"]]],"meta":{"line":859,"file":"Guild.js","path":"src/structures"}},{"name":"edit","description":"Updates the guild with new information - e.g. a new name.","examples":["// Set the guild name\nguild.edit({\n name: 'Discord Guild',\n})\n .then(updated => console.log(`New guild name ${updated}`))\n .catch(console.error);"],"params":[{"name":"data","description":"The data to update the guild with","type":[[["GuildEditData"]]]},{"name":"reason","description":"Reason for editing this guild","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":926,"file":"Guild.js","path":"src/structures"}},{"name":"editWelcomeScreen","description":"Updates the guild's welcome screen","examples":["guild.editWelcomeScreen({\n description: 'Hello World',\n enabled: true,\n welcomeChannels: [\n {\n description: 'foobar',\n channel: '222197033908436994',\n }\n ],\n})"],"params":[{"name":"data","description":"Data to edit the welcome screen with","type":[[["WelcomeScreenEditData"]]]}],"async":true,"returns":[[["Promise","<"],["WelcomeScreen",">"]]],"meta":{"line":1033,"file":"Guild.js","path":"src/structures"}},{"name":"setExplicitContentFilter","description":"Edits the level of the explicit content filter.","params":[{"name":"explicitContentFilter","description":"The new level of the explicit content filter","nullable":true,"type":[[["ExplicitContentFilterLevel"]],[["number"]]]},{"name":"reason","description":"Reason for changing the level of the guild's explicit content filter","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1061,"file":"Guild.js","path":"src/structures"}},{"name":"setDefaultMessageNotifications","description":"Edits the setting of the default message notifications of the guild.","params":[{"name":"defaultMessageNotifications","description":"The new default message notification level of the guild","nullable":true,"type":[[["DefaultMessageNotificationLevel"]],[["number"]]]},{"name":"reason","description":"Reason for changing the setting of the default message notifications","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1072,"file":"Guild.js","path":"src/structures"}},{"name":"setSystemChannelFlags","description":"Edits the flags of the default message notifications of the guild.","params":[{"name":"systemChannelFlags","description":"The new flags for the default message notifications","type":[[["SystemChannelFlagsResolvable"]]]},{"name":"reason","description":"Reason for changing the flags of the default message notifications","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1083,"file":"Guild.js","path":"src/structures"}},{"name":"setName","description":"Edits the name of the guild.","examples":["// Edit the guild name\nguild.setName('Discord Guild')\n .then(updated => console.log(`Updated guild name to ${updated.name}`))\n .catch(console.error);"],"params":[{"name":"name","description":"The new name of the guild","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild's name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1098,"file":"Guild.js","path":"src/structures"}},{"name":"setVerificationLevel","description":"Edits the verification level of the guild.","examples":["// Edit the guild verification level\nguild.setVerificationLevel(1)\n .then(updated => console.log(`Updated guild verification level to ${guild.verificationLevel}`))\n .catch(console.error);"],"params":[{"name":"verificationLevel","description":"The new verification level of the guild","nullable":true,"type":[[["VerificationLevel"]],[["number"]]]},{"name":"reason","description":"Reason for changing the guild's verification level","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1113,"file":"Guild.js","path":"src/structures"}},{"name":"setAFKChannel","description":"Edits the AFK channel of the guild.","examples":["// Edit the guild AFK channel\nguild.setAFKChannel(channel)\n .then(updated => console.log(`Updated guild AFK channel to ${guild.afkChannel.name}`))\n .catch(console.error);"],"params":[{"name":"afkChannel","description":"The new AFK channel","nullable":true,"type":[[["VoiceChannelResolvable"]]]},{"name":"reason","description":"Reason for changing the guild's AFK channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1128,"file":"Guild.js","path":"src/structures"}},{"name":"setSystemChannel","description":"Edits the system channel of the guild.","examples":["// Edit the guild system channel\nguild.setSystemChannel(channel)\n .then(updated => console.log(`Updated guild system channel to ${guild.systemChannel.name}`))\n .catch(console.error);"],"params":[{"name":"systemChannel","description":"The new system channel","nullable":true,"type":[[["TextChannelResolvable"]]]},{"name":"reason","description":"Reason for changing the guild's system channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1143,"file":"Guild.js","path":"src/structures"}},{"name":"setAFKTimeout","description":"Edits the AFK timeout of the guild.","examples":["// Edit the guild AFK channel\nguild.setAFKTimeout(60)\n .then(updated => console.log(`Updated guild AFK timeout to ${guild.afkTimeout}`))\n .catch(console.error);"],"params":[{"name":"afkTimeout","description":"The time in seconds that a user must be idle to be considered AFK","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the guild's AFK timeout","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1158,"file":"Guild.js","path":"src/structures"}},{"name":"setIcon","description":"Sets a new guild icon.","examples":["// Edit the guild icon\nguild.setIcon('./icon.png')\n .then(updated => console.log('Updated the guild icon'))\n .catch(console.error);"],"params":[{"name":"icon","description":"The new icon of the guild","nullable":true,"type":[[["Base64Resolvable"]],[["BufferResolvable"]]]},{"name":"reason","description":"Reason for changing the guild's icon","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1173,"file":"Guild.js","path":"src/structures"}},{"name":"setOwner","description":"Sets a new owner of the guild.","examples":["// Edit the guild owner\nguild.setOwner(guild.members.cache.first())\n .then(guild => guild.fetchOwner())\n .then(owner => console.log(`Updated the guild owner to ${owner.displayName}`))\n .catch(console.error);"],"params":[{"name":"owner","description":"The new owner of the guild","type":[[["GuildMemberResolvable"]]]},{"name":"reason","description":"Reason for setting the new owner","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1189,"file":"Guild.js","path":"src/structures"}},{"name":"setSplash","description":"Sets a new guild invite splash image.","examples":["// Edit the guild splash\nguild.setSplash('./splash.png')\n .then(updated => console.log('Updated the guild splash'))\n .catch(console.error);"],"params":[{"name":"splash","description":"The new invite splash image of the guild","nullable":true,"type":[[["Base64Resolvable"]],[["BufferResolvable"]]]},{"name":"reason","description":"Reason for changing the guild's invite splash image","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1204,"file":"Guild.js","path":"src/structures"}},{"name":"setDiscoverySplash","description":"Sets a new guild discovery splash image.","examples":["// Edit the guild discovery splash\nguild.setDiscoverySplash('./discoverysplash.png')\n .then(updated => console.log('Updated the guild discovery splash'))\n .catch(console.error);"],"params":[{"name":"discoverySplash","description":"The new discovery splash image of the guild","nullable":true,"type":[[["Base64Resolvable"]],[["BufferResolvable"]]]},{"name":"reason","description":"Reason for changing the guild's discovery splash image","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1219,"file":"Guild.js","path":"src/structures"}},{"name":"setBanner","description":"Sets a new guild banner.","examples":["guild.setBanner('./banner.png')\n .then(updated => console.log('Updated the guild banner'))\n .catch(console.error);"],"params":[{"name":"banner","description":"The new banner of the guild","nullable":true,"type":[[["Base64Resolvable"]],[["BufferResolvable"]]]},{"name":"reason","description":"Reason for changing the guild's banner","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1233,"file":"Guild.js","path":"src/structures"}},{"name":"setRulesChannel","description":"Edits the rules channel of the guild.","examples":["// Edit the guild rules channel\nguild.setRulesChannel(channel)\n .then(updated => console.log(`Updated guild rules channel to ${guild.rulesChannel.name}`))\n .catch(console.error);"],"params":[{"name":"rulesChannel","description":"The new rules channel","nullable":true,"type":[[["TextChannelResolvable"]]]},{"name":"reason","description":"Reason for changing the guild's rules channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1248,"file":"Guild.js","path":"src/structures"}},{"name":"setPublicUpdatesChannel","description":"Edits the community updates channel of the guild.","examples":["// Edit the guild community updates channel\nguild.setPublicUpdatesChannel(channel)\n .then(updated => console.log(`Updated guild community updates channel to ${guild.publicUpdatesChannel.name}`))\n .catch(console.error);"],"params":[{"name":"publicUpdatesChannel","description":"The new community updates channel","nullable":true,"type":[[["TextChannelResolvable"]]]},{"name":"reason","description":"Reason for changing the guild's community updates channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1263,"file":"Guild.js","path":"src/structures"}},{"name":"setPreferredLocale","description":"Edits the preferred locale of the guild.","examples":["// Edit the guild preferred locale\nguild.setPreferredLocale('en-US')\n .then(updated => console.log(`Updated guild preferred locale to ${guild.preferredLocale}`))\n .catch(console.error);"],"params":[{"name":"preferredLocale","description":"The new preferred locale of the guild","nullable":true,"type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild's preferred locale","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1278,"file":"Guild.js","path":"src/structures"}},{"name":"setSafetyAlertsChannel","description":"Edits the safety alerts channel of the guild.","examples":["// Edit the guild safety alerts channel\nguild.setSafetyAlertsChannel(channel)\n .then(updated => console.log(`Updated guild safety alerts channel to ${updated.safetyAlertsChannel.name}`))\n .catch(console.error);"],"params":[{"name":"safetyAlertsChannel","description":"The new safety alerts channel","nullable":true,"type":[[["TextChannelResolvable"]]]},{"name":"reason","description":"Reason for changing the guild's safety alerts channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1293,"file":"Guild.js","path":"src/structures"}},{"name":"setPremiumProgressBarEnabled","description":"Edits the enabled state of the guild's premium progress bar","params":[{"name":"enabled","description":"The new enabled state of the guild's premium progress bar","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for changing the state of the guild's premium progress bar","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1303,"file":"Guild.js","path":"src/structures"}},{"name":"setChannelPositions","description":"Batch-updates the guild's channels' positions.\nOnly one channel's parent can be changed at a time","examples":["guild.setChannelPositions([{ channel: channelId, position: newChannelIndex }])\n .then(guild => console.log(`Updated channel positions for ${guild}`))\n .catch(console.error);"],"deprecated":"Use {@link GuildChannelManager#setPositions} instead","params":[{"name":"channelPositions","description":"Channel positions to update","type":[[["Array","<"],["ChannelPosition",">"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1334,"file":"Guild.js","path":"src/structures"}},{"name":"setRolePositions","description":"Batch-updates the guild's role positions","examples":["guild.setRolePositions([{ role: roleId, position: updatedRoleIndex }])\n .then(guild => console.log(`Role positions updated for ${guild}`))\n .catch(console.error);"],"deprecated":"Use {@link RoleManager#setPositions} instead","params":[{"name":"rolePositions","description":"Role positions to update","type":[[["Array","<"],["GuildRolePosition",">"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1364,"file":"Guild.js","path":"src/structures"}},{"name":"setWidgetSettings","description":"Edits the guild's widget settings.","params":[{"name":"settings","description":"The widget settings for the guild","type":[[["GuildWidgetSettingsData"]]]},{"name":"reason","description":"Reason for changing the guild's widget settings","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1383,"file":"Guild.js","path":"src/structures"}},{"name":"disableInvites","description":"Sets whether this guild's invites are disabled.","params":[{"name":"disabled","description":"Whether the invites are disabled","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1399,"file":"Guild.js","path":"src/structures"}},{"name":"setIncidentActions","description":"Sets the incident actions for a guild.","params":[{"name":"incidentActions","description":"The incident actions to set","type":[[["IncidentActionsEditOptions"]]]}],"returns":[[["Promise","<"],["IncidentActions",">"]]],"meta":{"line":1410,"file":"Guild.js","path":"src/structures"}},{"name":"leave","description":"Leaves the guild.","examples":["// Leave a guild\nguild.leave()\n .then(guild => console.log(`Left the guild: ${guild.name}`))\n .catch(console.error);"],"async":true,"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1423,"file":"Guild.js","path":"src/structures"}},{"name":"delete","description":"Deletes the guild.","examples":["// Delete a guild\nguild.delete()\n .then(g => console.log(`Deleted the guild ${g}`))\n .catch(console.error);"],"async":true,"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1438,"file":"Guild.js","path":"src/structures"}},{"name":"equals","description":"Whether this guild equals another guild. It compares all properties, so for most operations\nit is advisable to just compare `guild.id === guild2.id` as it is much faster and is often\nwhat most users need.","params":[{"name":"guild","description":"The guild to compare with","type":[[["Guild"]]]}],"returns":[[["boolean"]]],"meta":{"line":1450,"file":"Guild.js","path":"src/structures"}},{"name":"markAsRead","description":"Marks the guild as read.","examples":["const guild = client.guilds.cache.get('id');\nguild.markAsRead();"],"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":1492,"file":"Guild.js","path":"src/structures"}},{"name":"setCommunity","description":"Set Community Feature.","params":[{"name":"stats","description":"True / False to enable / disable Community Feature","default":true,"type":[[["boolean"]]]},{"name":"publicUpdatesChannel","description":"The community updates channel of the guild","optional":true,"type":[[["GuildTextChannelResolvable"]]]},{"name":"rulesChannel","description":"The new rules channel","optional":true,"type":[[["GuildTextChannelResolvable"]]]},{"name":"reason","description":"Reason for changing the community feature","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":1504,"file":"Guild.js","path":"src/structures"}},{"name":"topEmojis","description":"Get the top emojis of this guild.","returns":[[["Promise","<"],["Collection","<"],["number",", "],["GuildEmoji",">>"]]],"meta":{"line":1541,"file":"Guild.js","path":"src/structures"}},{"name":"setVanityCode","description":"Set the vanity URL to this guild.\nResolves with an object containing the vanity URL invite code and the use count.","examples":["// Set invite code\nguild.setVanityCode('elysia', '123456')\n .then(res => {\n console.log(`Vanity URL: https://discord.gg/${res.code} with ${res.uses} uses`);\n })\n .catch(console.error);"],"params":[{"name":"code","description":"Vanity URL code","optional":true,"default":"''","type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Vanity",">"]]],"meta":{"line":1570,"file":"Guild.js","path":"src/structures"}},{"name":"_sortedRoles","description":"Creates a collection of this guild's roles, sorted by their position and ids.","access":"private","returns":[[["Collection","<"],["Snowflake",", "],["Role",">"]]],"meta":{"line":1608,"file":"Guild.js","path":"src/structures"}},{"name":"_sortedChannels","description":"Creates a collection of this guild's or a specific category's channels, sorted by their position and ids.","access":"private","params":[{"name":"channel","description":"Category to get the channels of","optional":true,"type":[[["GuildChannel"]]]}],"returns":[[["Collection","<"],["Snowflake",", "],["GuildChannel",">"]]],"meta":{"line":1618,"file":"Guild.js","path":"src/structures"}},{"name":"bannerURL","description":"The URL to this guild's banner.","inherits":"AnonymousGuild#bannerURL","inherited":true,"params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":84,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"splashURL","description":"The URL to this guild's invite splash image.","inherits":"AnonymousGuild#splashURL","inherited":true,"params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":93,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"iconURL","description":"The URL to this guild's icon.","inherits":"BaseGuild#iconURL","inherited":true,"params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["ImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":93,"file":"BaseGuild.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this guild.","inherits":"BaseGuild#fetch","inherited":true,"async":true,"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":102,"file":"BaseGuild.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the guild's name instead of the Guild object.","inherits":"BaseGuild#toString","inherited":true,"returns":[[["string"]]],"meta":{"line":111,"file":"BaseGuild.js","path":"src/structures"}}],"meta":{"line":57,"file":"Guild.js","path":"src/structures"}},{"name":"GuildAuditLogs","description":"Audit logs entries are held in this class.","props":[{"name":"webhooks","description":"Cached webhooks","access":"private","type":[[["Collection","<"],["Snowflake",", "],["Webhook",">"]]],"meta":{"line":200,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"integrations","description":"Cached integrations","access":"private","type":[[["Collection","<("],["Snowflake","|"],["string","), "],["Integration",">"]]],"meta":{"line":212,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"applicationCommands","description":"Cached application commands, includes application commands from other applications","access":"private","type":[[["Collection","<"],["Snowflake",", "],["ApplicationCommand",">"]]],"meta":{"line":224,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"autoModerationRules","description":"Cached auto moderation rules.","access":"private","type":[[["Collection","<"],["Snowflake",", "],["AutoModerationRule",">"]]],"meta":{"line":235,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"entries","description":"The entries for this guild's audit logs","type":[[["Collection","<"],["Snowflake",", "],["GuildAuditLogsEntry",">"]]],"meta":{"line":245,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"Targets","description":"Key mirror of all available audit log targets.","scope":"static","type":[[["Object","<"],["string",", "],["string",">"]]],"meta":{"line":36,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"Actions","description":"All available actions keyed under their names to their numeric values.","scope":"static","type":[[["Object","<"],["string",", "],["number",">"]]],"meta":{"line":125,"file":"GuildAuditLogs.js","path":"src/structures"}}],"methods":[{"name":"build","description":"Handles possible promises for entry targets.","scope":"static","async":true,"returns":[[["Promise","<"],["GuildAuditLogs",">"]]],"meta":{"line":256,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"targetType","description":"Finds the target type from the entry action.","scope":"static","params":[{"name":"target","description":"The action target","type":[[["AuditLogAction"]]]}],"returns":[[["AuditLogTargetType"]]],"meta":{"line":290,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"actionType","description":"Finds the action type from the entry action.","scope":"static","params":[{"name":"action","description":"The action target","type":[[["AuditLogAction"]]]}],"returns":[[["AuditLogActionType"]]],"meta":{"line":327,"file":"GuildAuditLogs.js","path":"src/structures"}}],"meta":{"line":191,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"GuildAuditLogsEntry","description":"Audit logs entry.","props":[{"name":"targetType","description":"The target type of this entry","type":[[["AuditLogTargetType"]]],"meta":{"line":419,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"actionType","description":"The action type of this entry","type":[[["AuditLogActionType"]]],"meta":{"line":425,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"action","description":"Specific action type of this entry in its string presentation","type":[[["AuditLogAction"]]],"meta":{"line":431,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"reason","description":"The reason of this entry","nullable":true,"type":[[["string"]]],"meta":{"line":437,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"executorId","description":"The id of the user that executed this entry","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":443,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"executor","description":"The user that executed this entry","nullable":true,"type":[[["User"]]],"meta":{"line":449,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"changes","description":"Specific property changes","type":[[["Array","<"],["AuditLogChange",">"]]],"meta":{"line":467,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"id","description":"The entry's id","type":[[["Snowflake"]]],"meta":{"line":478,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"extra","description":"Any extra data from the entry","nullable":true,"type":[[["Object"]],[["Role"]],[["GuildMember"]]],"meta":{"line":484,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"targetId","description":"The id of the target of this entry","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":568,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"target","description":"The target of this entry","nullable":true,"type":[[["AuditLogEntryTarget"]]],"meta":{"line":574,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp this entry was created at","readonly":true,"type":[[["number"]]],"meta":{"line":724,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"createdAt","description":"The time this entry was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":733,"file":"GuildAuditLogs.js","path":"src/structures"}}],"meta":{"line":412,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"GuildBan","description":"Represents a ban in a guild on Discord.","extends":[[["Base"]]],"props":[{"name":"guild","description":"The guild in which the ban is","type":[[["Guild"]]],"meta":{"line":17,"file":"GuildBan.js","path":"src/structures"}},{"name":"user","description":"The user this ban applies to","type":[[["User"]]],"meta":{"line":28,"file":"GuildBan.js","path":"src/structures"}},{"name":"reason","description":"The reason for the ban","nullable":true,"type":[[["string"]]],"meta":{"line":36,"file":"GuildBan.js","path":"src/structures"}},{"name":"partial","description":"Whether this GuildBan is partial. If the reason is not provided the value is null","readonly":true,"type":[[["boolean"]]],"meta":{"line":45,"file":"GuildBan.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"fetch","description":"Fetches this GuildBan.","params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["GuildBan",">"]]],"meta":{"line":54,"file":"GuildBan.js","path":"src/structures"}}],"meta":{"line":9,"file":"GuildBan.js","path":"src/structures"}},{"name":"GuildBoost","description":"Represents a guild boost in a guild on Discord.","extends":[[["Base"]]],"props":[{"name":"id","description":"The id of the guild boost","type":[[["Snowflake"]]],"meta":{"line":21,"file":"GuildBoost.js","path":"src/structures"}},{"name":"subscriptionId","description":"The id of the subscription","type":[[["Snowflake"]]],"meta":{"line":28,"file":"GuildBoost.js","path":"src/structures"}},{"name":"premiumGuildSubscriptionId","description":"The premium guild subscription id","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":35,"file":"GuildBoost.js","path":"src/structures"}},{"name":"guildId","description":"Guild id","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":40,"file":"GuildBoost.js","path":"src/structures"}},{"name":"ended","description":"Ended ???","nullable":true,"type":[[["boolean"]]],"meta":{"line":45,"file":"GuildBoost.js","path":"src/structures"}},{"name":"canceled","description":"Whether the subscription is canceled","type":[[["boolean"]]],"meta":{"line":52,"file":"GuildBoost.js","path":"src/structures"}},{"name":"cooldownEndsAt","description":"The cooldown end date","type":[[["Date"]]],"meta":{"line":59,"file":"GuildBoost.js","path":"src/structures"}},{"name":"guilld","description":"The guild of the boost","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":67,"file":"GuildBoost.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"unsubscribe","description":"Cancel the boost","async":true,"returns":[[["Promise","<"],["GuildBoost",">"]]],"meta":{"line":75,"file":"GuildBoost.js","path":"src/structures"}},{"name":"subscribe","description":"Use the boost","params":[{"name":"guild","description":"The guild to use the boost on","type":[[["GuildResolvable"]]]}],"async":true,"returns":[[["Promise","<"],["GuildBoost",">"]]],"meta":{"line":91,"file":"GuildBoost.js","path":"src/structures"}}],"meta":{"line":9,"file":"GuildBoost.js","path":"src/structures"}},{"name":"GuildChannel","description":"Represents a guild channel from any of the following:\n- {@link TextChannel}\n- {@link VoiceChannel}\n- {@link CategoryChannel}\n- {@link NewsChannel}\n- {@link StoreChannel}\n- {@link StageChannel}\n- {@link ForumChannel}\n- {@link MediaChannel}","extends":[[["Channel"]]],"abstract":true,"props":[{"name":"guild","description":"The guild the channel is in","type":[[["Guild"]]],"meta":{"line":31,"file":"GuildChannel.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild the channel is in","type":[[["Snowflake"]]],"meta":{"line":37,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionOverwrites","description":"A manager of permission overwrites that belong to this channel","type":[[["PermissionOverwriteManager"]]],"meta":{"line":44,"file":"GuildChannel.js","path":"src/structures"}},{"name":"name","description":"The name of the guild channel","type":[[["string"]]],"meta":{"line":57,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rawPosition","description":"The raw position of the channel from Discord","type":[[["number"]]],"meta":{"line":65,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parentId","description":"The id of the category parent of this channel","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":77,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parent","description":"The category parent of this channel","readonly":true,"nullable":true,"type":[[["CategoryChannel"]]],"meta":{"line":99,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionsLocked","description":"If the permissionOverwrites match the parent channel, null if no parent","readonly":true,"nullable":true,"type":[[["boolean"]]],"meta":{"line":108,"file":"GuildChannel.js","path":"src/structures"}},{"name":"position","description":"The position of the channel","readonly":true,"type":[[["number"]]],"meta":{"line":149,"file":"GuildChannel.js","path":"src/structures"}},{"name":"members","description":"A collection of cached members of this channel, mapped by their ids.\nMembers that can view this channel, if the channel is text-based.\nMembers in the channel, if the channel is voice-based.","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":276,"file":"GuildChannel.js","path":"src/structures"}},{"name":"deletable","description":"Whether the channel is deletable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":418,"file":"GuildChannel.js","path":"src/structures"}},{"name":"manageable","description":"Whether the channel is manageable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":427,"file":"GuildChannel.js","path":"src/structures"}},{"name":"viewable","description":"Whether the channel is viewable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":447,"file":"GuildChannel.js","path":"src/structures"}},{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the channel was created at","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"Channel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the channel was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":79,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"partial","description":"Whether this Channel is a partial\nThis is always false outside of DM channels.","readonly":true,"type":[[["boolean"]]],"meta":{"line":119,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"permissionsFor","description":"Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.","params":[{"name":"memberOrRole","description":"The member or role to obtain the overall permissions for","type":[[["GuildMemberResolvable"]],[["RoleResolvable"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":{"types":[[["Readonly","<"],["Permissions",">"]]],"nullable":true},"meta":{"line":173,"file":"GuildChannel.js","path":"src/structures"}},{"name":"memberPermissions","description":"Gets the overall set of permissions for a member in this channel, taking into account channel overwrites.","access":"private","params":[{"name":"member","description":"The member to obtain the overall permissions for","type":[[["GuildMember"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","default":true,"type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":213,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rolePermissions","description":"Gets the overall set of permissions for a role in this channel, taking into account channel overwrites.","access":"private","params":[{"name":"role","description":"The role to obtain the overall permissions for","type":[[["Role"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":242,"file":"GuildChannel.js","path":"src/structures"}},{"name":"lockPermissions","description":"Locks in the permission overwrites from the parent channel.","async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":263,"file":"GuildChannel.js","path":"src/structures"}},{"name":"edit","description":"Edits the channel.","examples":["// Edit a channel\nchannel.edit({ name: 'new-channel' })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"data","description":"The new data for the channel","type":[[["ChannelData"]]]},{"name":"reason","description":"Reason for editing this channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":291,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setName","description":"Sets a new name for the guild channel.","examples":["// Set a new channel name\nchannel.setName('not_general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.error);"],"params":[{"name":"name","description":"The new name for the guild channel","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":306,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setParent","description":"Sets the parent of this channel.","examples":["// Add a parent to a channel\nmessage.channel.setParent('355908108431917066', { lockPermissions: false })\n .then(channel => console.log(`New parent of ${message.channel.name}: ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"channel","description":"The category channel to set as the parent","nullable":true,"type":[[["CategoryChannelResolvable"]]]},{"name":"options","description":"The options for setting the parent","optional":true,"default":"{}","type":[[["SetParentOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":328,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setPosition","description":"Sets a new position for the guild channel.","examples":["// Set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.error);"],"params":[{"name":"position","description":"The new position for the guild channel","type":[[["number"]]]},{"name":"options","description":"Options for setting position","optional":true,"type":[[["SetChannelPositionOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":356,"file":"GuildChannel.js","path":"src/structures"}},{"name":"clone","description":"Clones this channel.","params":[{"name":"options","description":"The options for cloning this channel","optional":true,"type":[[["GuildChannelCloneOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":371,"file":"GuildChannel.js","path":"src/structures"}},{"name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites, and id as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","params":[{"name":"channel","description":"Channel to compare with","type":[[["GuildChannel"]]]}],"returns":[[["boolean"]]],"meta":{"line":393,"file":"GuildChannel.js","path":"src/structures"}},{"name":"delete","description":"Deletes this channel.","examples":["// Delete the channel\nchannel.delete('making room for new channels')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"reason","description":"Reason for deleting this channel","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":464,"file":"GuildChannel.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.","inherits":"Channel#toString","inherited":true,"examples":["// Logs: Hello from <#123456789012345678>!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":130,"file":"Channel.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this channel.","inherits":"Channel#fetch","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":153,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","inherits":"Channel#isText","inherited":true,"returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","inherits":"Channel#isVoice","inherited":true,"returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","inherits":"Channel#isThread","inherited":true,"returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","inherits":"Channel#isThreadOnly","inherited":true,"returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","inherits":"Channel#isDirectory","inherited":true,"returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":23,"file":"GuildChannel.js","path":"src/structures"}},{"name":"GuildEmoji","description":"Represents a custom emoji.","extends":[[["BaseGuildEmoji"]]],"props":[{"name":"author","description":"The user who created this emoji","nullable":true,"type":[[["User"]]],"meta":{"line":20,"file":"GuildEmoji.js","path":"src/structures"}},{"name":"_roles","description":"Array of role ids this emoji is active for","access":"private","type":[[["Array","<"],["Snowflake",">"]]],"meta":{"line":22,"file":"GuildEmoji.js","path":"src/structures"}},{"name":"guild","description":"The guild this emoji is part of","type":[[["Guild"]]],"meta":{"line":33,"file":"GuildEmoji.js","path":"src/structures"}},{"name":"deletable","description":"Whether the emoji is deletable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":57,"file":"GuildEmoji.js","path":"src/structures"}},{"name":"roles","description":"A manager for roles this emoji is active for.","readonly":true,"type":[[["GuildEmojiRoleManager"]]],"meta":{"line":67,"file":"GuildEmoji.js","path":"src/structures"}},{"name":"requiresColons","description":"Whether or not this emoji requires colons surrounding it","nullable":true,"type":[[["boolean"]]],"meta":{"line":35,"file":"BaseGuildEmoji.js","path":"src/structures"}},{"name":"managed","description":"Whether this emoji is managed by an external service","nullable":true,"type":[[["boolean"]]],"meta":{"line":43,"file":"BaseGuildEmoji.js","path":"src/structures"}},{"name":"available","description":"Whether this emoji is available","nullable":true,"type":[[["boolean"]]],"meta":{"line":51,"file":"BaseGuildEmoji.js","path":"src/structures"}},{"name":"animated","description":"Whether or not the emoji is animated","nullable":true,"type":[[["boolean"]]],"meta":{"line":34,"file":"Emoji.js","path":"src/structures"}},{"name":"name","description":"The emoji's name","nullable":true,"type":[[["string"]]],"meta":{"line":40,"file":"Emoji.js","path":"src/structures"}},{"name":"id","description":"The emoji's id","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":46,"file":"Emoji.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":54,"file":"Emoji.js","path":"src/structures"}},{"name":"identifier","description":"The identifier of this emoji, used for message reactions","readonly":true,"type":[[["string"]]],"meta":{"line":84,"file":"Emoji.js","path":"src/structures"}},{"name":"url","description":"The URL to the emoji file if it's a custom emoji","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":94,"file":"Emoji.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the emoji was created at, or null if unicode","readonly":true,"nullable":true,"type":[[["number"]]],"meta":{"line":103,"file":"Emoji.js","path":"src/structures"}},{"name":"createdAt","description":"The time the emoji was created at, or null if unicode","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":112,"file":"Emoji.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"fetchAuthor","description":"Fetches the author for this emoji","returns":[[["Promise","<"],["User",">"]]],"meta":{"line":75,"file":"GuildEmoji.js","path":"src/structures"}},{"name":"edit","description":"Edits the emoji.","examples":["// Edit an emoji\nemoji.edit({ name: 'newemoji' })\n .then(e => console.log(`Edited emoji ${e}`))\n .catch(console.error);"],"params":[{"name":"data","description":"The new data for the emoji","type":[[["GuildEmojiEditData"]]]},{"name":"reason","description":"Reason for editing this emoji","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildEmoji",">"]]],"meta":{"line":97,"file":"GuildEmoji.js","path":"src/structures"}},{"name":"setName","description":"Sets the name of the emoji.","params":[{"name":"name","description":"The new name for the emoji","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the emoji's name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildEmoji",">"]]],"meta":{"line":120,"file":"GuildEmoji.js","path":"src/structures"}},{"name":"delete","description":"Deletes the emoji.","params":[{"name":"reason","description":"Reason for deleting the emoji","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildEmoji",">"]]],"meta":{"line":129,"file":"GuildEmoji.js","path":"src/structures"}},{"name":"equals","description":"Whether this emoji is the same as another one.","params":[{"name":"other","description":"The emoji to compare it to","type":[[["GuildEmoji"]],[["APIEmoji"]]]}],"returns":[[["boolean"]]],"meta":{"line":139,"file":"GuildEmoji.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the text required to form a graphical emoji on Discord\ninstead of the Emoji object.","inherits":"Emoji#toString","inherited":true,"examples":["// Send a custom emoji from a guild:\nconst emoji = guild.emojis.cache.first();\nmsg.channel.send(`Hello! ${emoji}`);","// Send the emoji used in a reaction to the channel the reaction is part of\nreaction.message.channel.send(`The emoji used was: ${reaction.emoji}`);"],"returns":[[["string"]]],"meta":{"line":128,"file":"Emoji.js","path":"src/structures"}}],"meta":{"line":12,"file":"GuildEmoji.js","path":"src/structures"}},{"name":"GuildMember","description":"Represents a member of a guild on Discord.","extends":[[["Base"]]],"implements":[[["TextBasedChannel"]]],"props":[{"name":"guild","description":"The guild that this member is part of","type":[[["Guild"]]],"meta":{"line":33,"file":"GuildMember.js","path":"src/structures"}},{"name":"joinedTimestamp","description":"The timestamp the member joined the guild at","nullable":true,"type":[[["number"]]],"meta":{"line":39,"file":"GuildMember.js","path":"src/structures"}},{"name":"premiumSinceTimestamp","description":"The last timestamp this member started boosting the guild","nullable":true,"type":[[["number"]]],"meta":{"line":45,"file":"GuildMember.js","path":"src/structures"}},{"name":"nickname","description":"The nickname of this member, if they have one","nullable":true,"type":[[["string"]]],"meta":{"line":51,"file":"GuildMember.js","path":"src/structures"}},{"name":"pending","description":"Whether this member has yet to pass the guild's membership gate","type":[[["boolean"]]],"meta":{"line":57,"file":"GuildMember.js","path":"src/structures"}},{"name":"communicationDisabledUntilTimestamp","description":"The timestamp this member's timeout will be removed","nullable":true,"type":[[["number"]]],"meta":{"line":63,"file":"GuildMember.js","path":"src/structures"}},{"name":"_roles","description":"The role ids of the member","access":"private","type":[[["Array","<"],["Snowflake",">"]]],"meta":{"line":70,"file":"GuildMember.js","path":"src/structures"}},{"name":"user","description":"The user that this guild member instance represents","nullable":true,"type":[[["User"]]],"meta":{"line":80,"file":"GuildMember.js","path":"src/structures"}},{"name":"avatar","description":"The guild member's avatar hash","nullable":true,"type":[[["string"]]],"meta":{"line":89,"file":"GuildMember.js","path":"src/structures"}},{"name":"banner","description":"The guild member's banner hash.","nullable":true,"type":[[["string"]]],"meta":{"line":98,"file":"GuildMember.js","path":"src/structures"}},{"name":"flags","description":"The flags of this member","type":[[["Readonly","<"],["GuildMemberFlags",">"]]],"meta":{"line":119,"file":"GuildMember.js","path":"src/structures"}},{"name":"avatarDecorationData","description":"The member avatar decoration's data","nullable":true,"type":[[["AvatarDecorationData"]]],"meta":{"line":129,"file":"GuildMember.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":149,"file":"GuildMember.js","path":"src/structures"}},{"name":"partial","description":"Whether this GuildMember is a partial","readonly":true,"type":[[["boolean"]]],"meta":{"line":179,"file":"GuildMember.js","path":"src/structures"}},{"name":"roles","description":"A manager for the roles belonging to this member","readonly":true,"type":[[["GuildMemberRoleManager"]]],"meta":{"line":188,"file":"GuildMember.js","path":"src/structures"}},{"name":"voice","description":"The voice state of this member","readonly":true,"type":[[["VoiceState"]]],"meta":{"line":197,"file":"GuildMember.js","path":"src/structures"}},{"name":"joinedAt","description":"The time this member joined the guild","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":265,"file":"GuildMember.js","path":"src/structures"}},{"name":"communicationDisabledUntil","description":"The time this member's timeout will be removed","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":274,"file":"GuildMember.js","path":"src/structures"}},{"name":"premiumSince","description":"The last time this member started boosting the guild","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":283,"file":"GuildMember.js","path":"src/structures"}},{"name":"presence","description":"The presence of this guild member","readonly":true,"nullable":true,"type":[[["Presence"]]],"meta":{"line":292,"file":"GuildMember.js","path":"src/structures"}},{"name":"displayColor","description":"The displayed color of this member in base 10","readonly":true,"type":[[["number"]]],"meta":{"line":301,"file":"GuildMember.js","path":"src/structures"}},{"name":"displayHexColor","description":"The displayed color of this member in hexadecimal","readonly":true,"type":[[["string"]]],"meta":{"line":310,"file":"GuildMember.js","path":"src/structures"}},{"name":"id","description":"The member's id","readonly":true,"type":[[["Snowflake"]]],"meta":{"line":319,"file":"GuildMember.js","path":"src/structures"}},{"name":"displayName","description":"The nickname of this member, or their user display name if they don't have one","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":328,"file":"GuildMember.js","path":"src/structures"}},{"name":"permissions","description":"The overall set of permissions for this member, taking only roles and owner status into account","readonly":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":337,"file":"GuildMember.js","path":"src/structures"}},{"name":"manageable","description":"Whether the client user is above this user in the hierarchy, according to role position and guild ownership.\nThis is a prerequisite for many moderative actions.","readonly":true,"type":[[["boolean"]]],"meta":{"line":348,"file":"GuildMember.js","path":"src/structures"}},{"name":"kickable","description":"Whether this member is kickable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":361,"file":"GuildMember.js","path":"src/structures"}},{"name":"bannable","description":"Whether this member is bannable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":370,"file":"GuildMember.js","path":"src/structures"}},{"name":"moderatable","description":"Whether this member is moderatable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":379,"file":"GuildMember.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"avatarDecorationURL","description":"A link to the user's avatar decoration.","returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":205,"file":"GuildMember.js","path":"src/structures"}},{"name":"avatarURL","description":"A link to the member's guild avatar.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["ImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":215,"file":"GuildMember.js","path":"src/structures"}},{"name":"bannerURL","description":"A link to the member's banner.","params":[{"name":"options","description":"Options for the banner URL","optional":true,"default":"{}","type":[[["ImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":225,"file":"GuildMember.js","path":"src/structures"}},{"name":"displayAvatarDecorationURL","description":"A link to the member's guild avatar decoration if they have one.\nOtherwise, a link to their {@link User#avatarDecorationURL} will be returned.","returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":236,"file":"GuildMember.js","path":"src/structures"}},{"name":"displayAvatarURL","description":"A link to the member's guild avatar if they have one.\nOtherwise, a link to their {@link User#displayAvatarURL} will be returned.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["ImageURLOptions"]]]}],"returns":[[["string"]]],"meta":{"line":246,"file":"GuildMember.js","path":"src/structures"}},{"name":"displayBannerURL","description":"A link to the member's guild banner if they have one.\nOtherwise, a link to their {@link User#bannerURL} will be returned.","params":[{"name":"options","description":"Options for the image URL","optional":true,"default":"{}","type":[[["ImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":256,"file":"GuildMember.js","path":"src/structures"}},{"name":"isCommunicationDisabled","description":"Whether this member is currently timed out","returns":[[["boolean"]]],"meta":{"line":391,"file":"GuildMember.js","path":"src/structures"}},{"name":"permissionsIn","description":"Returns `channel.permissionsFor(guildMember)`. Returns permissions for a member in a guild channel,\ntaking into account roles and permission overwrites.","params":[{"name":"channel","description":"The guild channel to use as context","type":[[["GuildChannelResolvable"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":401,"file":"GuildMember.js","path":"src/structures"}},{"name":"edit","description":"Edits this member.","params":[{"name":"data","description":"The data to edit the member with","type":[[["GuildMemberEditData"]]]},{"name":"reason","description":"Reason for editing this user","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":413,"file":"GuildMember.js","path":"src/structures"}},{"name":"setNickname","description":"Sets the nickname for this member.","examples":["// Set a nickname for a guild member\nguildMember.setNickname('cool nickname', 'Needed a new nickname')\n .then(member => console.log(`Set nickname of ${member.user.username}`))\n .catch(console.error);","// Remove a nickname for a guild member\nguildMember.setNickname(null, 'No nicknames allowed!')\n .then(member => console.log(`Removed nickname for ${member.user.username}`))\n .catch(console.error);"],"params":[{"name":"nick","description":"The nickname for the guild member, or `null` if you want to reset their nickname","nullable":true,"type":[[["string"]]]},{"name":"reason","description":"Reason for setting the nickname","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":433,"file":"GuildMember.js","path":"src/structures"}},{"name":"setFlags","description":"Sets the flags for this member.","params":[{"name":"flags","description":"The flags to set","type":[[["GuildMemberFlagsResolvable"]]]},{"name":"reason","description":"Reason for setting the flags","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":443,"file":"GuildMember.js","path":"src/structures"}},{"name":"createDM","description":"Creates a DM channel between the client and this member.","params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["DMChannel",">"]]],"meta":{"line":452,"file":"GuildMember.js","path":"src/structures"}},{"name":"deleteDM","description":"Deletes any DMs with this member.","returns":[[["Promise","<"],["DMChannel",">"]]],"meta":{"line":460,"file":"GuildMember.js","path":"src/structures"}},{"name":"kick","description":"Kicks this member from the guild.","params":[{"name":"reason","description":"Reason for kicking user","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":469,"file":"GuildMember.js","path":"src/structures"}},{"name":"ban","description":"Bans this guild member.","examples":["// Ban a guild member, deleting a week's worth of messages\nguildMember.ban({ deleteMessageSeconds: 60 * 60 * 24 * 7, reason: 'They deserved it' })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for the ban","optional":true,"type":[[["BanOptions"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":483,"file":"GuildMember.js","path":"src/structures"}},{"name":"disableCommunicationUntil","description":"Times this guild member out.","examples":["// Time a guild member out for 5 minutes\nguildMember.disableCommunicationUntil(Date.now() + (5 * 60 * 1000), 'They deserved it')\n .then(console.log)\n .catch(console.error);","// Remove the timeout of a guild member\nguildMember.disableCommunicationUntil(null)\n .then(member => console.log(`Removed timeout for ${member.displayName}`))\n .catch(console.error);"],"params":[{"name":"communicationDisabledUntil","description":"The date or timestamp\nfor the member's communication to be disabled until. Provide `null` to remove the timeout.","type":[[["DateResolvable"]],[["null"]]]},{"name":"reason","description":"The reason for this timeout.","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":504,"file":"GuildMember.js","path":"src/structures"}},{"name":"timeout","description":"Times this guild member out.","examples":["// Time a guild member out for 5 minutes\nguildMember.timeout(5 * 60 * 1000, 'They deserved it')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"timeout","description":"The time in milliseconds\nfor the member's communication to be disabled until. Provide `null` to remove the timeout.","type":[[["number"]],[["null"]]]},{"name":"reason","description":"The reason for this timeout.","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":520,"file":"GuildMember.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this GuildMember.","params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":529,"file":"GuildMember.js","path":"src/structures"}},{"name":"equals","description":"Whether this guild member equals another guild member. It compares all properties, so for most\ncomparison it is advisable to just compare `member.id === member2.id` as it is significantly faster\nand is often what most users need.","params":[{"name":"member","description":"The member to compare with","type":[[["GuildMember"]]]}],"returns":[[["boolean"]]],"meta":{"line":540,"file":"GuildMember.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the user's mention instead of the GuildMember object.","examples":["// Logs: Hello from <@123456789012345678>!\nconsole.log(`Hello from ${member}!`);"],"returns":[[["string"]]],"meta":{"line":567,"file":"GuildMember.js","path":"src/structures"}},{"name":"setAvatar","description":"Sets the guild avatar of the logged in client.","params":[{"name":"avatar","description":"The new avatar","nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":591,"file":"GuildMember.js","path":"src/structures"}},{"name":"setBanner","description":"Sets the guild banner of the logged in client.","params":[{"name":"banner","description":"The new banner","nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":600,"file":"GuildMember.js","path":"src/structures"}},{"name":"setAboutMe","description":"Set Guild About me","params":[{"name":"bio","description":"Bio to set","default":null,"type":[[["string"]],[["null"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":609,"file":"GuildMember.js","path":"src/structures"}},{"name":"send","description":"Sends a message to this user.","implements":["TextBasedChannel#send"],"examples":["// Send a direct message\nguildMember.send('Hello!')\n .then(message => console.log(`Sent message: ${message.content} to ${guildMember.displayName}`))\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["MessageOptions"]]]}],"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":614,"file":"GuildMember.js","path":"src/structures"}}],"meta":{"line":25,"file":"GuildMember.js","path":"src/structures"}},{"name":"GuildPreview","description":"Represents the data about the guild any bot can preview, connected to the specified guild.","extends":[[["Base"]]],"props":[{"name":"id","description":"The id of this guild","type":[[["string"]]],"meta":{"line":27,"file":"GuildPreview.js","path":"src/structures"}},{"name":"name","description":"The name of this guild","type":[[["string"]]],"meta":{"line":34,"file":"GuildPreview.js","path":"src/structures"}},{"name":"icon","description":"The icon of this guild","nullable":true,"type":[[["string"]]],"meta":{"line":42,"file":"GuildPreview.js","path":"src/structures"}},{"name":"splash","description":"The splash icon of this guild","nullable":true,"type":[[["string"]]],"meta":{"line":50,"file":"GuildPreview.js","path":"src/structures"}},{"name":"discoverySplash","description":"The discovery splash icon of this guild","nullable":true,"type":[[["string"]]],"meta":{"line":58,"file":"GuildPreview.js","path":"src/structures"}},{"name":"features","description":"An array of enabled guild features","type":[[["Array","<"],["Features",">"]]],"meta":{"line":66,"file":"GuildPreview.js","path":"src/structures"}},{"name":"approximateMemberCount","description":"The approximate count of members in this guild","type":[[["number"]]],"meta":{"line":74,"file":"GuildPreview.js","path":"src/structures"}},{"name":"approximatePresenceCount","description":"The approximate count of online members in this guild","type":[[["number"]]],"meta":{"line":82,"file":"GuildPreview.js","path":"src/structures"}},{"name":"description","description":"The description for this guild","nullable":true,"type":[[["string"]]],"meta":{"line":90,"file":"GuildPreview.js","path":"src/structures"}},{"name":"emojis","description":"Collection of emojis belonging to this guild","type":[[["Collection","<"],["Snowflake",", "],["GuildPreviewEmoji",">"]]],"meta":{"line":100,"file":"GuildPreview.js","path":"src/structures"}},{"name":"stickers","description":"Collection of stickers belonging to this guild","type":[[["Collection","<"],["Snowflake",", "],["Sticker",">"]]],"meta":{"line":112,"file":"GuildPreview.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp this guild was created at","readonly":true,"type":[[["number"]]],"meta":{"line":122,"file":"GuildPreview.js","path":"src/structures"}},{"name":"createdAt","description":"The time this guild was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":131,"file":"GuildPreview.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"splashURL","description":"The URL to this guild's splash.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":140,"file":"GuildPreview.js","path":"src/structures"}},{"name":"discoverySplashURL","description":"The URL to this guild's discovery splash.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":149,"file":"GuildPreview.js","path":"src/structures"}},{"name":"iconURL","description":"The URL to this guild's icon.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["ImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":158,"file":"GuildPreview.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this guild.","async":true,"returns":[[["Promise","<"],["GuildPreview",">"]]],"meta":{"line":166,"file":"GuildPreview.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the guild's name instead of the Guild object.","examples":["// Logs: Hello from My Guild!\nconsole.log(`Hello from ${previewGuild}!`);"],"returns":[[["string"]]],"meta":{"line":179,"file":"GuildPreview.js","path":"src/structures"}}],"meta":{"line":13,"file":"GuildPreview.js","path":"src/structures"}},{"name":"GuildPreviewEmoji","description":"Represents an instance of an emoji belonging to a public guild obtained through Discord's preview endpoint.","extends":[[["BaseGuildEmoji"]]],"props":[{"name":"guild","description":"The public guild this emoji is part of","type":[[["GuildPreview"]]],"meta":{"line":10,"file":"GuildPreviewEmoji.js","path":"src/structures"}},{"name":"roles","description":"The roles this emoji is active for","type":[[["Array","<"],["Snowflake",">"]]],"meta":{"line":23,"file":"GuildPreviewEmoji.js","path":"src/structures"}},{"name":"requiresColons","description":"Whether or not this emoji requires colons surrounding it","nullable":true,"type":[[["boolean"]]],"meta":{"line":35,"file":"BaseGuildEmoji.js","path":"src/structures"}},{"name":"managed","description":"Whether this emoji is managed by an external service","nullable":true,"type":[[["boolean"]]],"meta":{"line":43,"file":"BaseGuildEmoji.js","path":"src/structures"}},{"name":"available","description":"Whether this emoji is available","nullable":true,"type":[[["boolean"]]],"meta":{"line":51,"file":"BaseGuildEmoji.js","path":"src/structures"}},{"name":"animated","description":"Whether or not the emoji is animated","nullable":true,"type":[[["boolean"]]],"meta":{"line":34,"file":"Emoji.js","path":"src/structures"}},{"name":"name","description":"The emoji's name","nullable":true,"type":[[["string"]]],"meta":{"line":40,"file":"Emoji.js","path":"src/structures"}},{"name":"id","description":"The emoji's id","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":46,"file":"Emoji.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":54,"file":"Emoji.js","path":"src/structures"}},{"name":"identifier","description":"The identifier of this emoji, used for message reactions","readonly":true,"type":[[["string"]]],"meta":{"line":84,"file":"Emoji.js","path":"src/structures"}},{"name":"url","description":"The URL to the emoji file if it's a custom emoji","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":94,"file":"Emoji.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the emoji was created at, or null if unicode","readonly":true,"nullable":true,"type":[[["number"]]],"meta":{"line":103,"file":"Emoji.js","path":"src/structures"}},{"name":"createdAt","description":"The time the emoji was created at, or null if unicode","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":112,"file":"Emoji.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"toString","description":"When concatenated with a string, this automatically returns the text required to form a graphical emoji on Discord\ninstead of the Emoji object.","inherits":"Emoji#toString","inherited":true,"examples":["// Send a custom emoji from a guild:\nconst emoji = guild.emojis.cache.first();\nmsg.channel.send(`Hello! ${emoji}`);","// Send the emoji used in a reaction to the channel the reaction is part of\nreaction.message.channel.send(`The emoji used was: ${reaction.emoji}`);"],"returns":[[["string"]]],"meta":{"line":128,"file":"Emoji.js","path":"src/structures"}}],"meta":{"line":9,"file":"GuildPreviewEmoji.js","path":"src/structures"}},{"name":"GuildScheduledEvent","description":"Represents a scheduled event in a {@link Guild}.","extends":[[["Base"]]],"props":[{"name":"id","description":"The id of the guild scheduled event","type":[[["Snowflake"]]],"meta":{"line":25,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild this guild scheduled event belongs to","type":[[["Snowflake"]]],"meta":{"line":31,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"channelId","description":"The channel id in which the scheduled event will be hosted, or `null` if entity type is `EXTERNAL`","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":42,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"creatorId","description":"The id of the user that created this guild scheduled event","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":52,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"name","description":"The name of the guild scheduled event","nullable":true,"type":[[["string"]]],"meta":{"line":62,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"description","description":"The description of the guild scheduled event","nullable":true,"type":[[["string"]]],"meta":{"line":73,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"scheduledStartTimestamp","description":"The timestamp the guild scheduled event will start at\nThis can be potentially `null` only when it's an {@link AuditLogEntryTarget}","nullable":true,"type":[[["number"]]],"meta":{"line":84,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"scheduledEndTimestamp","description":"The timestamp the guild scheduled event will end at\nor `null` if the event does not have a scheduled time to end","nullable":true,"type":[[["number"]]],"meta":{"line":95,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"privacyLevel","description":"The privacy level of the guild scheduled event","type":[[["PrivacyLevel"]]],"meta":{"line":105,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"status","description":"The status of the guild scheduled event","type":[[["GuildScheduledEventStatus"]]],"meta":{"line":116,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"entityType","description":"The type of hosting entity associated with the scheduled event","type":[[["GuildScheduledEventEntityType"]]],"meta":{"line":127,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"entityId","description":"The id of the hosting entity associated with the scheduled event","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":138,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"userCount","description":"The number of users who are subscribed to this guild scheduled event","nullable":true,"type":[[["number"]]],"meta":{"line":148,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"creator","description":"The user that created this guild scheduled event","nullable":true,"type":[[["User"]]],"meta":{"line":158,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"entityMetadata","description":"Additional metadata","nullable":true,"type":[[["GuildScheduledEventEntityMetadata"]]],"meta":{"line":178,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"image","description":"The cover image hash for this scheduled event","nullable":true,"type":[[["string"]]],"meta":{"line":193,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"recurrenceRule","description":"The recurrence rule for this scheduled event","nullable":true,"type":[[["GuildScheduledEventRecurrenceRule"]]],"meta":{"line":225,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"partial","description":"Whether this guild scheduled event is partial.","readonly":true,"type":[[["boolean"]]],"meta":{"line":262,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the guild scheduled event was created at","readonly":true,"type":[[["number"]]],"meta":{"line":271,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"createdAt","description":"The time the guild scheduled event was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":280,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"scheduledStartAt","description":"The time the guild scheduled event will start at","readonly":true,"type":[[["Date"]]],"meta":{"line":289,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"scheduledEndAt","description":"The time the guild scheduled event will end at,\nor `null` if the event does not have a scheduled time to end","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":299,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"channel","description":"The channel associated with this scheduled event","readonly":true,"nullable":true,"type":[[["VoiceChannel"]],[["StageChannel"]]],"meta":{"line":308,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"guild","description":"The guild this scheduled event belongs to","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":317,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"url","description":"The URL to the guild scheduled event","readonly":true,"type":[[["string"]]],"meta":{"line":326,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"coverImageURL","description":"The URL of this scheduled event's cover image","params":[{"name":"options","description":"Options for image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":253,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this guild scheduled event.","params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["GuildScheduledEvent",">"]]],"meta":{"line":335,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"createInviteURL","description":"Creates an invite URL to this guild scheduled event.","params":[{"name":"options","description":"The options to create the invite","optional":true,"type":[[["CreateGuildScheduledEventInviteURLOptions"]]]}],"async":true,"returns":[[["Promise","<"],["string",">"]]],"meta":{"line":351,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"edit","description":"Edits this guild scheduled event.","examples":["// Edit a guild scheduled event\nguildScheduledEvent.edit({ name: 'Party' })\n .then(guildScheduledEvent => console.log(guildScheduledEvent))\n .catch(console.error);"],"params":[{"name":"options","description":"The options to edit the guild scheduled event","type":[[["GuildScheduledEventEditOptions"]]]}],"returns":[[["Promise","<"],["GuildScheduledEvent",">"]]],"meta":{"line":372,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"delete","description":"Deletes this guild scheduled event.","examples":["// Delete a guild scheduled event\nguildScheduledEvent.delete()\n .then(guildScheduledEvent => console.log(guildScheduledEvent))\n .catch(console.error);"],"async":true,"returns":[[["Promise","<"],["GuildScheduledEvent",">"]]],"meta":{"line":385,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"setName","description":"Sets a new name for the guild scheduled event.","examples":["// Set name of a guild scheduled event\nguildScheduledEvent.setName('Birthday Party')\n .then(guildScheduledEvent => console.log(`Set the name to: ${guildScheduledEvent.name}`))\n .catch(console.error);"],"params":[{"name":"name","description":"The new name of the guild scheduled event","type":[[["string"]]]},{"name":"reason","description":"The reason for changing the name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildScheduledEvent",">"]]],"meta":{"line":401,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"setScheduledStartTime","description":"Sets a new time to schedule the event at.","examples":["// Set start time of a guild scheduled event\nguildScheduledEvent.setScheduledStartTime('2022-09-24T00:00:00+05:30')\n .then(guildScheduledEvent => console.log(`Set the start time to: ${guildScheduledEvent.scheduledStartTime}`))\n .catch(console.error);"],"params":[{"name":"scheduledStartTime","description":"The time to schedule the event at","type":[[["DateResolvable"]]]},{"name":"reason","description":"The reason for changing the scheduled start time","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildScheduledEvent",">"]]],"meta":{"line":416,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"setScheduledEndTime","description":"Sets a new time to end the event at.","examples":["// Set end time of a guild scheduled event\nguildScheduledEvent.setScheduledEndTime('2022-09-25T00:00:00+05:30')\n .then(guildScheduledEvent => console.log(`Set the end time to: ${guildScheduledEvent.scheduledEndTime}`))\n .catch(console.error);"],"params":[{"name":"scheduledEndTime","description":"The time to end the event at","type":[[["DateResolvable"]]]},{"name":"reason","description":"The reason for changing the scheduled end time","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildScheduledEvent",">"]]],"meta":{"line":432,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"setDescription","description":"Sets the new description of the guild scheduled event.","examples":["// Set description of a guild scheduled event\nguildScheduledEvent.setDescription('A virtual birthday party')\n .then(guildScheduledEvent => console.log(`Set the description to: ${guildScheduledEvent.description}`))\n .catch(console.error);"],"params":[{"name":"description","description":"The description of the guild scheduled event","type":[[["string"]]]},{"name":"reason","description":"The reason for changing the description","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildScheduledEvent",">"]]],"meta":{"line":447,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"setStatus","description":"Sets the new status of the guild scheduled event.\nIf you're working with TypeScript, use this method in conjunction with status type-guards\nlike {@link GuildScheduledEvent#isScheduled} to get only valid status as suggestion","examples":["// Set status of a guild scheduled event\nguildScheduledEvent.setStatus('ACTIVE')\n .then(guildScheduledEvent => console.log(`Set the status to: ${guildScheduledEvent.status}`))\n .catch(console.error);"],"params":[{"name":"status","description":"The status of the guild scheduled event","type":[[["GuildScheduledEventStatus"]],[["number"]]]},{"name":"reason","description":"The reason for changing the status","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildScheduledEvent",">"]]],"meta":{"line":464,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"setLocation","description":"Sets the new location of the guild scheduled event.","examples":["// Set location of a guild scheduled event\nguildScheduledEvent.setLocation('Earth')\n .then(guildScheduledEvent => console.log(`Set the location to: ${guildScheduledEvent.entityMetadata.location}`))\n .catch(console.error);"],"params":[{"name":"location","description":"The location of the guild scheduled event","type":[[["string"]]]},{"name":"reason","description":"The reason for changing the location","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildScheduledEvent",">"]]],"meta":{"line":479,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"fetchSubscribers","description":"Fetches subscribers of this guild scheduled event.","params":[{"name":"options","description":"Options for fetching the subscribers","optional":true,"type":[[["FetchGuildScheduledEventSubscribersOptions"]]]}],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["GuildScheduledEventUser",">>"]]],"meta":{"line":488,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically concatenates the event's URL instead of the object.","examples":["// Logs: Event: https://discord.com/events/412345678901234567/499876543211234567\nconsole.log(`Event: ${guildScheduledEvent}`);"],"returns":[[["string"]]],"meta":{"line":499,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"isActive","description":"Indicates whether this guild scheduled event has an `ACTIVE` status.","returns":[[["boolean"]]],"meta":{"line":507,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"isCanceled","description":"Indicates whether this guild scheduled event has a `CANCELED` status.","returns":[[["boolean"]]],"meta":{"line":515,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"isCompleted","description":"Indicates whether this guild scheduled event has a `COMPLETED` status.","returns":[[["boolean"]]],"meta":{"line":523,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"isScheduled","description":"Indicates whether this guild scheduled event has a `SCHEDULED` status.","returns":[[["boolean"]]],"meta":{"line":531,"file":"GuildScheduledEvent.js","path":"src/structures"}}],"meta":{"line":17,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"GuildTemplate","description":"Represents the template for a guild.","extends":[[["Base"]]],"props":[{"name":"code","description":"The unique code of this template","type":[[["string"]]],"meta":{"line":24,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"name","description":"The name of this template","type":[[["string"]]],"meta":{"line":32,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"description","description":"The description of this template","nullable":true,"type":[[["string"]]],"meta":{"line":40,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"usageCount","description":"The amount of times this template has been used","type":[[["number"]]],"meta":{"line":48,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"creatorId","description":"The id of the user that created this template","type":[[["Snowflake"]]],"meta":{"line":56,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"creator","description":"The user that created this template","type":[[["User"]]],"meta":{"line":64,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"createdAt","description":"The time when this template was created at","type":[[["Date"]]],"meta":{"line":72,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"updatedAt","description":"The time when this template was last synced to the guild","type":[[["Date"]]],"meta":{"line":80,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild that this template belongs to","type":[[["Snowflake"]]],"meta":{"line":88,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"serializedGuild","description":"The data of the guild that this template would create","type":[[["APIGuild"]]],"meta":{"line":96,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"unSynced","description":"Whether this template has unsynced changes","nullable":true,"type":[[["boolean"]]],"meta":{"line":103,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp of when this template was created at","readonly":true,"type":[[["number"]]],"meta":{"line":187,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"updatedTimestamp","description":"The timestamp of when this template was last synced to the guild","readonly":true,"type":[[["number"]]],"meta":{"line":196,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"guild","description":"The guild that this template belongs to","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":205,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"url","description":"The URL of this template","readonly":true,"type":[[["string"]]],"meta":{"line":214,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}},{"name":"GUILD_TEMPLATES_PATTERN","description":"Regular expression that globally matches guild template links","scope":"static","type":[[["RegExp"]]],"meta":{"line":234,"file":"GuildTemplate.js","path":"src/structures"}}],"methods":[{"name":"createGuild","description":"Creates a guild based on this template.\nThis is only available to bots in fewer than 10 guilds.","params":[{"name":"name","description":"The name of the guild","type":[[["string"]]]},{"name":"icon","description":"The icon for the guild","optional":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]}],"async":true,"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":115,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"edit","description":"Updates the metadata of this template.","params":[{"name":"options","description":"Options for editing the template","optional":true,"type":[[["EditGuildTemplateOptions"]]]}],"async":true,"returns":[[["Promise","<"],["GuildTemplate",">"]]],"meta":{"line":159,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"delete","description":"Deletes this template.","async":true,"returns":[[["Promise","<"],["GuildTemplate",">"]]],"meta":{"line":168,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"sync","description":"Syncs this template to the current state of the guild.","async":true,"returns":[[["Promise","<"],["GuildTemplate",">"]]],"meta":{"line":177,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the template's code instead of the template object.","examples":["// Logs: Template: FKvmczH2HyUf\nconsole.log(`Template: ${guildTemplate}!`);"],"returns":[[["string"]]],"meta":{"line":225,"file":"GuildTemplate.js","path":"src/structures"}}],"meta":{"line":12,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"Integration","description":"Represents a guild integration.","extends":[[["Base"]]],"props":[{"name":"guild","description":"The guild this integration belongs to","type":[[["Guild"]]],"meta":{"line":34,"file":"Integration.js","path":"src/structures"}},{"name":"id","description":"The integration id","type":[[["Snowflake"]],[["string"]]],"meta":{"line":40,"file":"Integration.js","path":"src/structures"}},{"name":"name","description":"The integration name","type":[[["string"]]],"meta":{"line":46,"file":"Integration.js","path":"src/structures"}},{"name":"type","description":"The integration type","type":[[["IntegrationType"]]],"meta":{"line":52,"file":"Integration.js","path":"src/structures"}},{"name":"enabled","description":"Whether this integration is enabled","type":[[["boolean"]]],"meta":{"line":58,"file":"Integration.js","path":"src/structures"}},{"name":"syncing","description":"Whether this integration is syncing","nullable":true,"type":[[["boolean"]]],"meta":{"line":64,"file":"Integration.js","path":"src/structures"}},{"name":"role","description":"The role that this integration uses for subscribers","nullable":true,"type":[[["Role"]]],"meta":{"line":70,"file":"Integration.js","path":"src/structures"}},{"name":"enableEmoticons","description":"Whether emoticons should be synced for this integration (twitch only currently)","nullable":true,"type":[[["boolean"]]],"meta":{"line":77,"file":"Integration.js","path":"src/structures"}},{"name":"user","description":"The user for this integration","nullable":true,"type":[[["User"]]],"meta":{"line":87,"file":"Integration.js","path":"src/structures"}},{"name":"account","description":"The account integration information","type":[[["IntegrationAccount"]]],"meta":{"line":96,"file":"Integration.js","path":"src/structures"}},{"name":"syncedAt","description":"The last time this integration was last synced","nullable":true,"type":[[["number"]]],"meta":{"line":102,"file":"Integration.js","path":"src/structures"}},{"name":"subscriberCount","description":"How many subscribers this integration has","nullable":true,"type":[[["number"]]],"meta":{"line":109,"file":"Integration.js","path":"src/structures"}},{"name":"revoked","description":"Whether this integration has been revoked","nullable":true,"type":[[["boolean"]]],"meta":{"line":119,"file":"Integration.js","path":"src/structures"}},{"name":"roles","description":"All roles that are managed by this integration","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["Role",">"]]],"meta":{"line":132,"file":"Integration.js","path":"src/structures"}},{"name":"expireBehavior","description":"The behavior of expiring subscribers","nullable":true,"type":[[["number"]]],"meta":{"line":143,"file":"Integration.js","path":"src/structures"}},{"name":"expireGracePeriod","description":"The grace period before expiring subscribers","nullable":true,"type":[[["number"]]],"meta":{"line":151,"file":"Integration.js","path":"src/structures"}},{"name":"application","description":"The application for this integration","nullable":true,"type":[[["IntegrationApplication"]]],"meta":{"line":162,"file":"Integration.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"delete","description":"Deletes this integration.","params":[{"name":"reason","description":"Reason for deleting this integration","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Integration",">"]]],"meta":{"line":174,"file":"Integration.js","path":"src/structures"}}],"meta":{"line":26,"file":"Integration.js","path":"src/structures"}},{"name":"IntegrationApplication","description":"Represents an Integration's OAuth2 Application.","extends":[[["Application"]]],"props":[{"name":"bot","description":"The bot user for this application","nullable":true,"type":[[["User"]]],"meta":{"line":18,"file":"IntegrationApplication.js","path":"src/structures"}},{"name":"termsOfServiceURL","description":"The URL of the application's terms of service","nullable":true,"type":[[["string"]]],"meta":{"line":28,"file":"IntegrationApplication.js","path":"src/structures"}},{"name":"privacyPolicyURL","description":"The URL of the application's privacy policy","nullable":true,"type":[[["string"]]],"meta":{"line":38,"file":"IntegrationApplication.js","path":"src/structures"}},{"name":"rpcOrigins","description":"The Array of RPC origin URLs","type":[[["Array","<"],["string",">"]]],"meta":{"line":48,"file":"IntegrationApplication.js","path":"src/structures"}},{"name":"summary","description":"The application's summary","nullable":true,"deprecated":"This property is no longer being sent by the API.","type":[[["string"]]],"meta":{"line":59,"file":"IntegrationApplication.js","path":"src/structures"}},{"name":"hook","description":"Whether the application can be default hooked by the client","nullable":true,"type":[[["boolean"]]],"meta":{"line":69,"file":"IntegrationApplication.js","path":"src/structures"}},{"name":"cover","description":"The hash of the application's cover image","nullable":true,"type":[[["string"]]],"meta":{"line":79,"file":"IntegrationApplication.js","path":"src/structures"}},{"name":"verifyKey","description":"The hex-encoded key for verification in interactions and the GameSDK's GetTicket","nullable":true,"type":[[["string"]]],"meta":{"line":89,"file":"IntegrationApplication.js","path":"src/structures"}},{"name":"id","description":"The application's id","type":[[["Snowflake"]]],"meta":{"line":32,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"name","description":"The name of the application","nullable":true,"type":[[["string"]]],"meta":{"line":39,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"description","description":"The application's description","nullable":true,"type":[[["string"]]],"meta":{"line":49,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"icon","description":"The application's icon hash","nullable":true,"type":[[["string"]]],"meta":{"line":59,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"roleConnectionsVerificationURL","description":"This application's role connection verification entry point URL","nullable":true,"type":[[["string"]]],"meta":{"line":99,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"tags","description":"The tags this application has (max of 5)","type":[[["Array","<"],["string",">"]]],"meta":{"line":108,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"installParams","description":"Settings for this application's default in-app authorization","nullable":true,"type":[[["ClientApplicationInstallParams"]]],"meta":{"line":115,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"customInstallURL","description":"This application's custom installation URL","nullable":true,"type":[[["string"]]],"meta":{"line":128,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"flags","description":"The flags this application has","type":[[["ApplicationFlags"]]],"meta":{"line":138,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"approximateGuildCount","description":"An approximate amount of guilds this application is in.","nullable":true,"type":[[["number"]]],"meta":{"line":146,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"guildId","description":"The id of the guild associated with this application.","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":156,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"botRequireCodeGrant","description":"If this application's bot requires a code grant when using the OAuth2 flow","nullable":true,"deprecated":true,"type":[[["boolean"]]],"meta":{"line":187,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"botPublic","description":"If this application's bot is public","nullable":true,"deprecated":true,"type":[[["boolean"]]],"meta":{"line":198,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"owner","description":"The owner of this OAuth application","nullable":true,"type":[[["User"]],[["Team"]]],"meta":{"line":207,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"splash","description":"The application's splash image hash","nullable":true,"type":[[["string"]]],"meta":{"line":218,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"type","description":"The type of the application","see":["{@link https://docs.discord.food/resources/application#application-type}"],"type":[[["number"]]],"meta":{"line":229,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"primarySkuId","description":"The ID of the application's primary SKU (game, application subscription, etc.)","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":239,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"eulaId","description":"The ID of the application's EULA","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":249,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"slug","description":"The URL slug that links to the primary store page of the application","nullable":true,"type":[[["string"]]],"meta":{"line":259,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"aliases","description":"Other names the application's game is associated with","type":[[["Array","<"],["string",">"]]],"meta":{"line":269,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"executables","description":"The unique executables of the application's game","nullable":true,"type":[[["Array","<"],["ApplicationExecutable",">"]]],"meta":{"line":286,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"thirdPartySkus","description":"The third party SKUs of the application's game","nullable":true,"type":[[["Array","<"],["ApplicationSku",">"]]],"meta":{"line":303,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"overlay","description":"Whether the application's game supports the Discord overlay (default false)","nullable":true,"type":[[["boolean"]]],"meta":{"line":323,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"overlayMethods","description":"The methods of overlaying that the application's game supports","nullable":true,"type":[[["number"]]],"meta":{"line":333,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"overlayWarn","description":"Whether the Discord overlay is known to be problematic with this application's game (default false)","nullable":true,"type":[[["boolean"]]],"meta":{"line":343,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"overlayCompatibilityHook","description":"Whether to use the compatibility hook for the overlay (default false)","nullable":true,"type":[[["boolean"]]],"meta":{"line":353,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"developers","description":"The companies that developed the application","nullable":true,"type":[[["Array","<"],["Company",">"]]],"meta":{"line":379,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"publishers","description":"The companies that published the application","nullable":true,"type":[[["Array","<"],["Company",">"]]],"meta":{"line":389,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"redirectUris","description":"The whitelisted URLs for redirecting to during OAuth2 authorization (max 10)","nullable":true,"type":[[["Array","<"],["string",">"]]],"meta":{"line":399,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"deeplinkUri","description":"The URL used for deep linking during OAuth2 authorization on mobile devices","nullable":true,"type":[[["string"]]],"meta":{"line":409,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"integrationPublic","description":"Whether only the application owner can add the integration","nullable":true,"type":[[["boolean"]]],"meta":{"line":419,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"integrationRequireCodeGrant","description":"Whether the integration will only be added upon completion of a full OAuth2 token exchange","nullable":true,"type":[[["boolean"]]],"meta":{"line":429,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"botDisabled","description":"Whether the application's bot is disabled by Discord (default false)","nullable":true,"type":[[["boolean"]]],"meta":{"line":439,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"botQuarantined","description":"Whether the application's bot is quarantined by Discord","nullable":true,"type":[[["boolean"]]],"meta":{"line":449,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"approximateUserInstallCount","description":"Approximate count of users that have authorized the application with the applications.commands scope","nullable":true,"type":[[["number"]]],"meta":{"line":459,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"approximateUserAuthorizationCount","description":"Approximate count of users that have OAuth2 authorizations for the application","nullable":true,"type":[[["number"]]],"meta":{"line":469,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"internalGuildRestriction","description":"What guilds the application can be authorized in","nullable":true,"type":[[["number"]]],"meta":{"line":479,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"interactionsEndpointUrl","description":"The URL of the application's interactions endpoint","nullable":true,"type":[[["string"]]],"meta":{"line":489,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"interactionsVersion","description":"The version of the application's interactions endpoint implementation","nullable":true,"type":[[["number"]]],"meta":{"line":499,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"interactionsEventTypes","description":"The enabled event webhook types to send to the interaction endpoint","nullable":true,"type":[[["Array","<"],["string",">"]]],"meta":{"line":509,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"eventWebhooksStatus","description":"Whether event webhooks are enabled","nullable":true,"type":[[["number"]]],"meta":{"line":519,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"eventWebhooksUrl","description":"The URL of the application's event webhooks endpoint","nullable":true,"type":[[["string"]]],"meta":{"line":529,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"eventWebhooksTypes","description":"The enabled event webhook types to send to the event webhooks endpoint","nullable":true,"type":[[["Array","<"],["string",">"]]],"meta":{"line":539,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"explicitContentFilter","description":"Whether uploaded media content used in application commands is scanned and deleted for explicit content","nullable":true,"type":[[["number"]]],"meta":{"line":549,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"integrationTypesConfig","description":"The configuration for each integration type supported by the application","nullable":true,"type":[[["object"]]],"meta":{"line":559,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"isVerified","description":"Whether the application is verified","nullable":true,"type":[[["boolean"]]],"meta":{"line":569,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"verificationState","description":"The current verification state of the application","nullable":true,"type":[[["number"]]],"meta":{"line":579,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"storeApplicationState","description":"The current store approval state of the commerce application","nullable":true,"type":[[["number"]]],"meta":{"line":589,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"rpcApplicationState","description":"The current RPC approval state of the application","nullable":true,"type":[[["number"]]],"meta":{"line":599,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"creatorMonetizationState","description":"The current guild creator monetization state of the application","nullable":true,"type":[[["number"]]],"meta":{"line":609,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"isDiscoverable","description":"Whether the application is discoverable in the application directory","nullable":true,"type":[[["boolean"]]],"meta":{"line":619,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"discoverabilityState","description":"The current application directory discoverability state of the application","nullable":true,"type":[[["number"]]],"meta":{"line":629,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"discoveryEligibilityFlags","description":"The current application directory eligibility flags for the application","nullable":true,"type":[[["number"]]],"meta":{"line":639,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"isMonetized","description":"Whether the application has monetization enabled","nullable":true,"type":[[["boolean"]]],"meta":{"line":649,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"storefrontAvailable","description":"Whether the application has public subscriptions or products available for purchase","nullable":true,"type":[[["boolean"]]],"meta":{"line":659,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"monetizationState","description":"The current application monetization state of the application","nullable":true,"type":[[["number"]]],"meta":{"line":669,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"monetizationEligibilityFlags","description":"The current application monetization eligibility flags for the application","nullable":true,"type":[[["number"]]],"meta":{"line":679,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"maxParticipants","description":"The maximum possible participants in the application's embedded activity (-1 for no limit)","nullable":true,"type":[[["number"]]],"meta":{"line":689,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"guild","description":"The guild associated with this application.","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":700,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"partial","description":"Whether this application is partial","readonly":true,"type":[[["boolean"]]],"meta":{"line":709,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"createdTimestamp","description":"The timestamp the application was created at","readonly":true,"type":[[["number"]]],"meta":{"line":718,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"createdAt","description":"The time the application was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":727,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"fetch","description":"Obtains this application from Discord.","inherits":"Application#fetch","inherited":true,"async":true,"returns":[[["Promise","<"],["Application",">"]]],"meta":{"line":735,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"fetchRoleConnectionMetadataRecords","description":"Gets this application's role connection metadata records","inherits":"Application#fetchRoleConnectionMetadataRecords","inherited":true,"async":true,"returns":[[["Promise","<"],["Array","<"],["ApplicationRoleConnectionMetadata",">>"]]],"meta":{"line":752,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"iconURL","description":"A link to the application's icon.","inherits":"Application#iconURL","inherited":true,"params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":762,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"coverURL","description":"A link to this application's cover image.","inherits":"Application#coverURL","inherited":true,"params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":772,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"fetchAssets","description":"Gets the application's rich presence assets.","inherits":"Application#fetchAssets","inherited":true,"deprecated":"This will be removed in the next major as it is unsupported functionality.","async":true,"returns":[[["Promise","<"],["Array","<"],["ApplicationAsset",">>"]]],"meta":{"line":790,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the application's name instead of the\nApplication object.","inherits":"Application#toString","inherited":true,"examples":["// Logs: Application name: My App\nconsole.log(`Application name: ${application}`);"],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":816,"file":"Application.js","path":"src/structures/interfaces"}}],"meta":{"line":9,"file":"IntegrationApplication.js","path":"src/structures"}},{"name":"Interaction","description":"Represents an interaction.","extends":[[["Base"]]],"props":[{"name":"type","description":"The interaction's type","type":[[["InteractionType"]]],"meta":{"line":20,"file":"Interaction.js","path":"src/structures"}},{"name":"id","description":"The interaction's id","type":[[["Snowflake"]]],"meta":{"line":26,"file":"Interaction.js","path":"src/structures"}},{"name":"token","description":"The interaction's token","readonly":true,"type":[[["string"]]],"meta":{"line":28,"file":"Interaction.js","path":"src/structures"}},{"name":"applicationId","description":"The application's id","type":[[["Snowflake"]]],"meta":{"line":40,"file":"Interaction.js","path":"src/structures"}},{"name":"channelId","description":"The id of the channel this interaction was sent in","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":46,"file":"Interaction.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild this interaction was sent in","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":52,"file":"Interaction.js","path":"src/structures"}},{"name":"user","description":"The user which sent this interaction","type":[[["User"]]],"meta":{"line":58,"file":"Interaction.js","path":"src/structures"}},{"name":"member","description":"If this interaction was sent in a guild, the member which sent it","nullable":true,"type":[[["GuildMember"]],[["APIGuildMember"]]],"meta":{"line":64,"file":"Interaction.js","path":"src/structures"}},{"name":"version","description":"The version","type":[[["number"]]],"meta":{"line":70,"file":"Interaction.js","path":"src/structures"}},{"name":"appPermissions","description":"Set of permissions the application or bot has within the channel the interaction was sent from","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":76,"file":"Interaction.js","path":"src/structures"}},{"name":"memberPermissions","description":"The permissions of the member, if one exists, in the channel this interaction was executed in","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":82,"file":"Interaction.js","path":"src/structures"}},{"name":"locale","description":"The locale of the user who invoked this interaction","type":[[["Locale"]]],"meta":{"line":124,"file":"Interaction.js","path":"src/structures"}},{"name":"guildLocale","description":"The preferred locale from the guild this interaction was sent in","nullable":true,"type":[[["Locale"]]],"meta":{"line":130,"file":"Interaction.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the interaction was created at","readonly":true,"type":[[["number"]]],"meta":{"line":138,"file":"Interaction.js","path":"src/structures"}},{"name":"createdAt","description":"The time the interaction was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":147,"file":"Interaction.js","path":"src/structures"}},{"name":"channel","description":"The channel this interaction was sent in","readonly":true,"nullable":true,"type":[[["TextBasedChannels"]]],"meta":{"line":156,"file":"Interaction.js","path":"src/structures"}},{"name":"guild","description":"The guild this interaction was sent in","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":165,"file":"Interaction.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"inGuild","description":"Indicates whether this interaction is received from a guild.","returns":[[["boolean"]]],"meta":{"line":173,"file":"Interaction.js","path":"src/structures"}},{"name":"inCachedGuild","description":"Indicates whether or not this interaction is both cached and received from a guild.","returns":[[["boolean"]]],"meta":{"line":181,"file":"Interaction.js","path":"src/structures"}},{"name":"inRawGuild","description":"Indicates whether or not this interaction is received from an uncached guild.","returns":[[["boolean"]]],"meta":{"line":189,"file":"Interaction.js","path":"src/structures"}},{"name":"isApplicationCommand","description":"Indicates whether this interaction is a {@link BaseCommandInteraction}.","returns":[[["boolean"]]],"meta":{"line":197,"file":"Interaction.js","path":"src/structures"}},{"name":"isCommand","description":"Indicates whether this interaction is a {@link CommandInteraction}.","returns":[[["boolean"]]],"meta":{"line":205,"file":"Interaction.js","path":"src/structures"}},{"name":"isContextMenu","description":"Indicates whether this interaction is a {@link ContextMenuInteraction}","returns":[[["boolean"]]],"meta":{"line":213,"file":"Interaction.js","path":"src/structures"}},{"name":"isModalSubmit","description":"Indicates whether this interaction is a {@link ModalSubmitInteraction}","returns":[[["boolean"]]],"meta":{"line":221,"file":"Interaction.js","path":"src/structures"}},{"name":"isUserContextMenu","description":"Indicates whether this interaction is a {@link UserContextMenuInteraction}","returns":[[["boolean"]]],"meta":{"line":229,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageContextMenu","description":"Indicates whether this interaction is a {@link MessageContextMenuInteraction}","returns":[[["boolean"]]],"meta":{"line":237,"file":"Interaction.js","path":"src/structures"}},{"name":"isAutocomplete","description":"Indicates whether this interaction is an {@link AutocompleteInteraction}","returns":[[["boolean"]]],"meta":{"line":245,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageComponent","description":"Indicates whether this interaction is a {@link MessageComponentInteraction}.","returns":[[["boolean"]]],"meta":{"line":253,"file":"Interaction.js","path":"src/structures"}},{"name":"isButton","description":"Indicates whether this interaction is a {@link ButtonInteraction}.","returns":[[["boolean"]]],"meta":{"line":261,"file":"Interaction.js","path":"src/structures"}},{"name":"isSelectMenu","description":"Indicates whether this interaction is a {@link SelectMenuInteraction}.","returns":[[["boolean"]]],"meta":{"line":272,"file":"Interaction.js","path":"src/structures"}},{"name":"isRepliable","description":"Indicates whether this interaction can be replied to.","returns":[[["boolean"]]],"meta":{"line":283,"file":"Interaction.js","path":"src/structures"}}],"meta":{"line":12,"file":"Interaction.js","path":"src/structures"}},{"name":"InteractionCollector","description":"Collects interactions.\nWill automatically stop if the message ({@link Client#event:messageDelete messageDelete} or\n{@link Client#event:messageDeleteBulk messageDeleteBulk}),\nchannel ({@link Client#event:channelDelete channelDelete}), or\nguild ({@link Client#event:guildDelete guildDelete}) is deleted.\nInteraction collectors that do not specify `time` or `idle` may be prone to always running.\nEnsure your interaction collectors end via either of these options or manual cancellation.","extends":[[["Collector"]]],"construct":{"name":"InteractionCollector","params":[{"name":"client","description":"The client on which to collect interactions","type":[[["Client"]]]},{"name":"options","description":"The options to apply to this collector","optional":true,"default":"{}","type":[[["InteractionCollectorOptions"]]]}]},"props":[{"name":"messageId","description":"The message from which to collect interactions, if provided","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":42,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"channelId","description":"The channel from which to collect interactions, if provided","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":48,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"guildId","description":"The guild from which to collect interactions, if provided","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":57,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"interactionType","description":"The type of interaction to collect","nullable":true,"type":[[["InteractionType"]]],"meta":{"line":67,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"componentType","description":"The type of component to collect","nullable":true,"type":[[["MessageComponentType"]]],"meta":{"line":76,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"users","description":"The users that have interacted with this collector","type":[[["Collection","<"],["Snowflake",", "],["User",">"]]],"meta":{"line":85,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"total","description":"The total number of interactions collected","type":[[["number"]]],"meta":{"line":91,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"endReason","description":"The reason this collector has ended with, or null if it hasn't ended yet","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":192,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this Collector","readonly":true,"type":[[["Client"]]],"meta":{"line":35,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"filter","description":"The filter applied to this collector","type":[[["CollectorFilter"]]],"meta":{"line":48,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"options","description":"The options of this collector","type":[[["CollectorOptions"]]],"meta":{"line":54,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"collected","description":"The items collected by this collector","type":[[["Collection"]]],"meta":{"line":60,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"ended","description":"Whether this collector has finished collecting","type":[[["boolean"]]],"meta":{"line":66,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"_timeout","description":"Timeout for cleanup","access":"private","nullable":true,"type":[[["Timeout"]]],"meta":{"line":73,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"_idletimeout","description":"Timeout for cleanup due to inactivity","access":"private","nullable":true,"type":[[["Timeout"]]],"meta":{"line":80,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"next","description":"Returns a promise that resolves with the next collected element;\nrejects with collected elements if the collector finishes without receiving a next element","readonly":true,"type":[[["Promise"]]],"meta":{"line":148,"file":"Collector.js","path":"src/structures/interfaces"}}],"methods":[{"name":"collect","description":"Handles an incoming interaction for possible collection.","access":"private","params":[{"name":"interaction","description":"The interaction to possibly collect","type":[[["Interaction"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":142,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"dispose","description":"Handles an interaction for possible disposal.","params":[{"name":"interaction","description":"The interaction that could be disposed of","type":[[["Interaction"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":162,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"empty","description":"Empties this interaction collector.","meta":{"line":180,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"_handleMessageDeletion","description":"Handles checking if the message has been deleted, and if so, stops the collector with the reason 'messageDelete'.","access":"private","params":[{"name":"message","description":"The message that was deleted","type":[[["Message"]]]}],"returns":[[["void"]]],"meta":{"line":205,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"_handleChannelDeletion","description":"Handles checking if the channel has been deleted, and if so, stops the collector with the reason 'channelDelete'.","access":"private","params":[{"name":"channel","description":"The channel that was deleted","type":[[["GuildChannel"]]]}],"returns":[[["void"]]],"meta":{"line":217,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"_handleThreadDeletion","description":"Handles checking if the thread has been deleted, and if so, stops the collector with the reason 'threadDelete'.","access":"private","params":[{"name":"thread","description":"The thread that was deleted","type":[[["ThreadChannel"]]]}],"returns":[[["void"]]],"meta":{"line":229,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"_handleGuildDeletion","description":"Handles checking if the guild has been deleted, and if so, stops the collector with the reason 'guildDelete'.","access":"private","params":[{"name":"guild","description":"The guild that was deleted","type":[[["Guild"]]]}],"returns":[[["void"]]],"meta":{"line":241,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"handleCollect","description":"Call this to handle an event as a collectable element. Accepts any event data as parameters.","inherits":"Collector#handleCollect","inherited":true,"emits":["Collector#event:collect"],"params":[{"name":"args","description":"The arguments emitted by the listener","variable":true,"type":[["*"]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":99,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"handleDispose","description":"Call this to remove an element from the collection. Accepts any event data as parameters.","inherits":"Collector#handleDispose","inherited":true,"emits":["Collector#event:dispose"],"params":[{"name":"args","description":"The arguments emitted by the listener","variable":true,"type":[["*"]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":126,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"stop","description":"Stops this collector and emits the `end` event.","inherits":"Collector#stop","inherited":true,"emits":["Collector#event:end"],"params":[{"name":"reason","description":"The reason this collector is ending","optional":true,"default":"'user'","type":[[["string"]]]}],"meta":{"line":180,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"resetTimer","description":"Resets the collector's timeout and idle timer.","inherits":"Collector#resetTimer","inherited":true,"params":[{"name":"options","description":"Options for resetting","optional":true,"type":[[["CollectorResetTimerOptions"]]]}],"meta":{"line":213,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"checkEnd","description":"Checks whether the collector should end, and if so, ends it.","inherits":"Collector#checkEnd","inherited":true,"returns":{"types":[[["boolean"]]],"description":"Whether the collector ended or not"},"meta":{"line":228,"file":"Collector.js","path":"src/structures/interfaces"}}],"events":[{"name":"collect","description":"Emitted whenever an interaction is collected.","params":[{"name":"interaction","description":"The interaction that was collected","type":[[["Interaction"]]]}],"meta":{"line":143,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"dispose","description":"Emitted whenever an interaction is disposed of.","params":[{"name":"interaction","description":"The interaction that was disposed of","type":[[["Interaction"]]]}],"meta":{"line":163,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"end","description":"Emitted when the collector is finished collecting.","params":[{"name":"collected","description":"The elements collected by the collector","type":[[["Collection"]]]},{"name":"reason","description":"The reason the collector ended","type":[[["string"]]]}],"meta":{"line":193,"file":"Collector.js","path":"src/structures/interfaces"}}],"meta":{"line":30,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"InteractionWebhook","description":"Represents a webhook for an Interaction","implements":[[["Webhook"]]],"construct":{"name":"InteractionWebhook","params":[{"name":"client","description":"The instantiating client","type":[[["Client"]]]},{"name":"id","description":"The application's id","type":[[["Snowflake"]]]},{"name":"token","description":"The interaction's token","type":[[["string"]]]}]},"props":[{"name":"client","description":"The client that instantiated the interaction webhook","readonly":true,"type":[[["Client"]]],"meta":{"line":16,"file":"InteractionWebhook.js","path":"src/structures"}},{"name":"id","description":"The webhook's id","type":[[["Snowflake"]]],"meta":{"line":55,"file":"Webhook.js","path":"src/structures"}},{"name":"url","description":"The URL of this webhook","readonly":true,"type":[[["string"]]],"meta":{"line":429,"file":"Webhook.js","path":"src/structures"}}],"methods":[{"name":"send","description":"Sends a message with this webhook.","implements":["Webhook#send"],"params":[{"name":"options","description":"The content for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":34,"file":"InteractionWebhook.js","path":"src/structures"}},{"name":"fetchMessage","description":"Gets a message that was sent by this webhook.","implements":["Webhook#fetchMessage"],"params":[{"name":"message","description":"The id of the message to fetch","type":[[["Snowflake"]],[["original","'"]]]},{"name":"cacheOrOptions","description":"The options to provide to fetch the message.\nA **deprecated** boolean may be passed instead to specify whether to cache the message.","optional":true,"default":"{}","type":[[["WebhookFetchMessageOptions"]],[["boolean"]]]}],"async":true,"returns":{"types":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"description":"Returns the raw message data if the webhook was instantiated as a\n{@link WebhookClient} or if the channel is uncached, otherwise a {@link Message} will be returned"},"meta":{"line":296,"file":"Webhook.js","path":"src/structures"}},{"name":"editMessage","description":"Edits a message that was sent by this webhook.","implements":["Webhook#editMessage"],"params":[{"name":"message","description":"The message to edit","type":[[["MessageResolvable"]],[["original","'"]]]},{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["WebhookEditMessageOptions"]]]}],"async":true,"returns":{"types":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"description":"Returns the raw message data if the webhook was instantiated as a\n{@link WebhookClient} or if the channel is uncached, otherwise a {@link Message} will be returned"},"meta":{"line":332,"file":"Webhook.js","path":"src/structures"}},{"name":"deleteMessage","description":"Delete a message that was sent by this webhook.","implements":["Webhook#deleteMessage"],"params":[{"name":"message","description":"The message to delete","type":[[["MessageResolvable"]],[["original","'"]]]},{"name":"threadId","description":"The id of the thread this message belongs to","optional":true,"type":[[["Snowflake"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":382,"file":"Webhook.js","path":"src/structures"}}],"meta":{"line":9,"file":"InteractionWebhook.js","path":"src/structures"}},{"name":"Application","description":"Represents an OAuth2 Application.","extends":[[["Base"]]],"abstract":true,"props":[{"name":"id","description":"The application's id","type":[[["Snowflake"]]],"meta":{"line":32,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"name","description":"The name of the application","nullable":true,"type":[[["string"]]],"meta":{"line":39,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"description","description":"The application's description","nullable":true,"type":[[["string"]]],"meta":{"line":49,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"icon","description":"The application's icon hash","nullable":true,"type":[[["string"]]],"meta":{"line":59,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"termsOfServiceURL","description":"The URL of the application's terms of service","nullable":true,"type":[[["string"]]],"meta":{"line":69,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"privacyPolicyURL","description":"The URL of the application's privacy policy","nullable":true,"type":[[["string"]]],"meta":{"line":79,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"verifyKey","description":"The hex-encoded key for verification in interactions and the GameSDK's GetTicket","nullable":true,"type":[[["string"]]],"meta":{"line":89,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"roleConnectionsVerificationURL","description":"This application's role connection verification entry point URL","nullable":true,"type":[[["string"]]],"meta":{"line":99,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"tags","description":"The tags this application has (max of 5)","type":[[["Array","<"],["string",">"]]],"meta":{"line":108,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"installParams","description":"Settings for this application's default in-app authorization","nullable":true,"type":[[["ClientApplicationInstallParams"]]],"meta":{"line":115,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"customInstallURL","description":"This application's custom installation URL","nullable":true,"type":[[["string"]]],"meta":{"line":128,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"flags","description":"The flags this application has","type":[[["ApplicationFlags"]]],"meta":{"line":138,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"approximateGuildCount","description":"An approximate amount of guilds this application is in.","nullable":true,"type":[[["number"]]],"meta":{"line":146,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"guildId","description":"The id of the guild associated with this application.","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":156,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"cover","description":"The hash of the application's cover image","nullable":true,"type":[[["string"]]],"meta":{"line":166,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"rpcOrigins","description":"The application's RPC origins, if enabled","type":[[["Array","<"],["string",">"]]],"meta":{"line":176,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"botRequireCodeGrant","description":"If this application's bot requires a code grant when using the OAuth2 flow","nullable":true,"deprecated":true,"type":[[["boolean"]]],"meta":{"line":187,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"botPublic","description":"If this application's bot is public","nullable":true,"deprecated":true,"type":[[["boolean"]]],"meta":{"line":198,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"owner","description":"The owner of this OAuth application","nullable":true,"type":[[["User"]],[["Team"]]],"meta":{"line":207,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"splash","description":"The application's splash image hash","nullable":true,"type":[[["string"]]],"meta":{"line":218,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"type","description":"The type of the application","see":["{@link https://docs.discord.food/resources/application#application-type}"],"type":[[["number"]]],"meta":{"line":229,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"primarySkuId","description":"The ID of the application's primary SKU (game, application subscription, etc.)","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":239,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"eulaId","description":"The ID of the application's EULA","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":249,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"slug","description":"The URL slug that links to the primary store page of the application","nullable":true,"type":[[["string"]]],"meta":{"line":259,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"aliases","description":"Other names the application's game is associated with","type":[[["Array","<"],["string",">"]]],"meta":{"line":269,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"executables","description":"The unique executables of the application's game","nullable":true,"type":[[["Array","<"],["ApplicationExecutable",">"]]],"meta":{"line":286,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"thirdPartySkus","description":"The third party SKUs of the application's game","nullable":true,"type":[[["Array","<"],["ApplicationSku",">"]]],"meta":{"line":303,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"hook","description":"Whether the Discord client is allowed to hook into the application's game directly","nullable":true,"type":[[["boolean"]]],"meta":{"line":313,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"overlay","description":"Whether the application's game supports the Discord overlay (default false)","nullable":true,"type":[[["boolean"]]],"meta":{"line":323,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"overlayMethods","description":"The methods of overlaying that the application's game supports","nullable":true,"type":[[["number"]]],"meta":{"line":333,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"overlayWarn","description":"Whether the Discord overlay is known to be problematic with this application's game (default false)","nullable":true,"type":[[["boolean"]]],"meta":{"line":343,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"overlayCompatibilityHook","description":"Whether to use the compatibility hook for the overlay (default false)","nullable":true,"type":[[["boolean"]]],"meta":{"line":353,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"bot","description":"The bot attached to this application","nullable":true,"type":[[["User"]]],"meta":{"line":363,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"developers","description":"The companies that developed the application","nullable":true,"type":[[["Array","<"],["Company",">"]]],"meta":{"line":379,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"publishers","description":"The companies that published the application","nullable":true,"type":[[["Array","<"],["Company",">"]]],"meta":{"line":389,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"redirectUris","description":"The whitelisted URLs for redirecting to during OAuth2 authorization (max 10)","nullable":true,"type":[[["Array","<"],["string",">"]]],"meta":{"line":399,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"deeplinkUri","description":"The URL used for deep linking during OAuth2 authorization on mobile devices","nullable":true,"type":[[["string"]]],"meta":{"line":409,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"integrationPublic","description":"Whether only the application owner can add the integration","nullable":true,"type":[[["boolean"]]],"meta":{"line":419,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"integrationRequireCodeGrant","description":"Whether the integration will only be added upon completion of a full OAuth2 token exchange","nullable":true,"type":[[["boolean"]]],"meta":{"line":429,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"botDisabled","description":"Whether the application's bot is disabled by Discord (default false)","nullable":true,"type":[[["boolean"]]],"meta":{"line":439,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"botQuarantined","description":"Whether the application's bot is quarantined by Discord","nullable":true,"type":[[["boolean"]]],"meta":{"line":449,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"approximateUserInstallCount","description":"Approximate count of users that have authorized the application with the applications.commands scope","nullable":true,"type":[[["number"]]],"meta":{"line":459,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"approximateUserAuthorizationCount","description":"Approximate count of users that have OAuth2 authorizations for the application","nullable":true,"type":[[["number"]]],"meta":{"line":469,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"internalGuildRestriction","description":"What guilds the application can be authorized in","nullable":true,"type":[[["number"]]],"meta":{"line":479,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"interactionsEndpointUrl","description":"The URL of the application's interactions endpoint","nullable":true,"type":[[["string"]]],"meta":{"line":489,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"interactionsVersion","description":"The version of the application's interactions endpoint implementation","nullable":true,"type":[[["number"]]],"meta":{"line":499,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"interactionsEventTypes","description":"The enabled event webhook types to send to the interaction endpoint","nullable":true,"type":[[["Array","<"],["string",">"]]],"meta":{"line":509,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"eventWebhooksStatus","description":"Whether event webhooks are enabled","nullable":true,"type":[[["number"]]],"meta":{"line":519,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"eventWebhooksUrl","description":"The URL of the application's event webhooks endpoint","nullable":true,"type":[[["string"]]],"meta":{"line":529,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"eventWebhooksTypes","description":"The enabled event webhook types to send to the event webhooks endpoint","nullable":true,"type":[[["Array","<"],["string",">"]]],"meta":{"line":539,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"explicitContentFilter","description":"Whether uploaded media content used in application commands is scanned and deleted for explicit content","nullable":true,"type":[[["number"]]],"meta":{"line":549,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"integrationTypesConfig","description":"The configuration for each integration type supported by the application","nullable":true,"type":[[["object"]]],"meta":{"line":559,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"isVerified","description":"Whether the application is verified","nullable":true,"type":[[["boolean"]]],"meta":{"line":569,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"verificationState","description":"The current verification state of the application","nullable":true,"type":[[["number"]]],"meta":{"line":579,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"storeApplicationState","description":"The current store approval state of the commerce application","nullable":true,"type":[[["number"]]],"meta":{"line":589,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"rpcApplicationState","description":"The current RPC approval state of the application","nullable":true,"type":[[["number"]]],"meta":{"line":599,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"creatorMonetizationState","description":"The current guild creator monetization state of the application","nullable":true,"type":[[["number"]]],"meta":{"line":609,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"isDiscoverable","description":"Whether the application is discoverable in the application directory","nullable":true,"type":[[["boolean"]]],"meta":{"line":619,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"discoverabilityState","description":"The current application directory discoverability state of the application","nullable":true,"type":[[["number"]]],"meta":{"line":629,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"discoveryEligibilityFlags","description":"The current application directory eligibility flags for the application","nullable":true,"type":[[["number"]]],"meta":{"line":639,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"isMonetized","description":"Whether the application has monetization enabled","nullable":true,"type":[[["boolean"]]],"meta":{"line":649,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"storefrontAvailable","description":"Whether the application has public subscriptions or products available for purchase","nullable":true,"type":[[["boolean"]]],"meta":{"line":659,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"monetizationState","description":"The current application monetization state of the application","nullable":true,"type":[[["number"]]],"meta":{"line":669,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"monetizationEligibilityFlags","description":"The current application monetization eligibility flags for the application","nullable":true,"type":[[["number"]]],"meta":{"line":679,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"maxParticipants","description":"The maximum possible participants in the application's embedded activity (-1 for no limit)","nullable":true,"type":[[["number"]]],"meta":{"line":689,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"guild","description":"The guild associated with this application.","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":700,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"partial","description":"Whether this application is partial","readonly":true,"type":[[["boolean"]]],"meta":{"line":709,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"createdTimestamp","description":"The timestamp the application was created at","readonly":true,"type":[[["number"]]],"meta":{"line":718,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"createdAt","description":"The time the application was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":727,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"fetch","description":"Obtains this application from Discord.","async":true,"returns":[[["Promise","<"],["Application",">"]]],"meta":{"line":735,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"fetchRoleConnectionMetadataRecords","description":"Gets this application's role connection metadata records","async":true,"returns":[[["Promise","<"],["Array","<"],["ApplicationRoleConnectionMetadata",">>"]]],"meta":{"line":752,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"iconURL","description":"A link to the application's icon.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":762,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"coverURL","description":"A link to this application's cover image.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":772,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"fetchAssets","description":"Gets the application's rich presence assets.","deprecated":"This will be removed in the next major as it is unsupported functionality.","async":true,"returns":[[["Promise","<"],["Array","<"],["ApplicationAsset",">>"]]],"meta":{"line":790,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the application's name instead of the\nApplication object.","examples":["// Logs: Application name: My App\nconsole.log(`Application name: ${application}`);"],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":816,"file":"Application.js","path":"src/structures/interfaces"}}],"meta":{"line":21,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"Collector","description":"Abstract class for defining a new Collector.","extends":[[["EventEmitter"]]],"abstract":true,"props":[{"name":"client","description":"The client that instantiated this Collector","readonly":true,"type":[[["Client"]]],"meta":{"line":35,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"filter","description":"The filter applied to this collector","type":[[["CollectorFilter"]]],"meta":{"line":48,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"options","description":"The options of this collector","type":[[["CollectorOptions"]]],"meta":{"line":54,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"collected","description":"The items collected by this collector","type":[[["Collection"]]],"meta":{"line":60,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"ended","description":"Whether this collector has finished collecting","type":[[["boolean"]]],"meta":{"line":66,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"_timeout","description":"Timeout for cleanup","access":"private","nullable":true,"type":[[["Timeout"]]],"meta":{"line":73,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"_idletimeout","description":"Timeout for cleanup due to inactivity","access":"private","nullable":true,"type":[[["Timeout"]]],"meta":{"line":80,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"next","description":"Returns a promise that resolves with the next collected element;\nrejects with collected elements if the collector finishes without receiving a next element","readonly":true,"type":[[["Promise"]]],"meta":{"line":148,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"endReason","description":"The reason this collector has ended with, or null if it hasn't ended yet","readonly":true,"nullable":true,"abstract":true,"type":[[["string"]]],"meta":{"line":276,"file":"Collector.js","path":"src/structures/interfaces"}}],"methods":[{"name":"handleCollect","description":"Call this to handle an event as a collectable element. Accepts any event data as parameters.","emits":["Collector#event:collect"],"params":[{"name":"args","description":"The arguments emitted by the listener","variable":true,"type":[["*"]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":99,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"handleDispose","description":"Call this to remove an element from the collection. Accepts any event data as parameters.","emits":["Collector#event:dispose"],"params":[{"name":"args","description":"The arguments emitted by the listener","variable":true,"type":[["*"]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":126,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"stop","description":"Stops this collector and emits the `end` event.","emits":["Collector#event:end"],"params":[{"name":"reason","description":"The reason this collector is ending","optional":true,"default":"'user'","type":[[["string"]]]}],"meta":{"line":180,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"resetTimer","description":"Resets the collector's timeout and idle timer.","params":[{"name":"options","description":"Options for resetting","optional":true,"type":[[["CollectorResetTimerOptions"]]]}],"meta":{"line":213,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"checkEnd","description":"Checks whether the collector should end, and if so, ends it.","returns":{"types":[[["boolean"]]],"description":"Whether the collector ended or not"},"meta":{"line":228,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"collect","description":"Handles incoming events from the `handleCollect` function. Returns null if the event should not\nbe collected, or returns an object describing the data that should be stored.","see":["Collector#handleCollect"],"abstract":true,"params":[{"name":"args","description":"Any args the event listener emits","variable":true,"type":[["*"]]}],"returns":{"types":[["*"],[["Promise",""]]],"description":"Data to insert into collection, if any","nullable":true},"meta":{"line":286,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"dispose","description":"Handles incoming events from the `handleDispose`. Returns null if the event should not\nbe disposed, or returns the key that should be removed.","see":["Collector#handleDispose"],"abstract":true,"params":[{"name":"args","description":"Any args the event listener emits","variable":true,"type":[["*"]]}],"returns":{"types":[["*"]],"description":"Key to remove from the collection, if any","nullable":true},"meta":{"line":296,"file":"Collector.js","path":"src/structures/interfaces"}}],"events":[{"name":"collect","description":"Emitted whenever an element is collected.","params":[{"name":"args","description":"The arguments emitted by the listener","variable":true,"type":[["*"]]}],"meta":{"line":105,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"dispose","description":"Emitted whenever an element is disposed of.","params":[{"name":"args","description":"The arguments emitted by the listener","variable":true,"type":[["*"]]}],"meta":{"line":133,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"end","description":"Emitted when the collector is finished collecting.","params":[{"name":"collected","description":"The elements collected by the collector","type":[[["Collection"]]]},{"name":"reason","description":"The reason the collector ended","type":[[["string"]]]}],"meta":{"line":193,"file":"Collector.js","path":"src/structures/interfaces"}}],"meta":{"line":31,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"Invite","description":"Represents an invitation to a guild channel.","extends":[[["Base"]]],"props":[{"name":"guild","description":"The guild the invite is for including welcome screen data if present","nullable":true,"type":[[["Guild"]],[["InviteGuild"]]],"meta":{"line":30,"file":"Invite.js","path":"src/structures"}},{"name":"code","description":"The code for this invite","type":[[["string"]]],"meta":{"line":40,"file":"Invite.js","path":"src/structures"}},{"name":"presenceCount","description":"The approximate number of online members of the guild this invite is for\nThis is only available when the invite was fetched through {@link Client#fetchInvite}.","nullable":true,"type":[[["number"]]],"meta":{"line":49,"file":"Invite.js","path":"src/structures"}},{"name":"memberCount","description":"The approximate total number of members of the guild this invite is for\nThis is only available when the invite was fetched through {@link Client#fetchInvite}.","nullable":true,"type":[[["number"]]],"meta":{"line":60,"file":"Invite.js","path":"src/structures"}},{"name":"temporary","description":"Whether or not this invite only grants temporary membership\nThis is only available when the invite was fetched through {@link GuildInviteManager#fetch}\nor created through {@link GuildInviteManager#create}.","nullable":true,"type":[[["boolean"]]],"meta":{"line":72,"file":"Invite.js","path":"src/structures"}},{"name":"maxAge","description":"The maximum age of the invite, in seconds, 0 if never expires\nThis is only available when the invite was fetched through {@link GuildInviteManager#fetch}\nor created through {@link GuildInviteManager#create}.","nullable":true,"type":[[["number"]]],"meta":{"line":84,"file":"Invite.js","path":"src/structures"}},{"name":"uses","description":"How many times this invite has been used\nThis is only available when the invite was fetched through {@link GuildInviteManager#fetch}\nor created through {@link GuildInviteManager#create}.","nullable":true,"type":[[["number"]]],"meta":{"line":96,"file":"Invite.js","path":"src/structures"}},{"name":"maxUses","description":"The maximum uses of this invite\nThis is only available when the invite was fetched through {@link GuildInviteManager#fetch}\nor created through {@link GuildInviteManager#create}.","nullable":true,"type":[[["number"]]],"meta":{"line":108,"file":"Invite.js","path":"src/structures"}},{"name":"inviterId","description":"The user's id who created this invite","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":118,"file":"Invite.js","path":"src/structures"}},{"name":"inviter","description":"The user who created this invite","nullable":true,"type":[[["User"]]],"meta":{"line":129,"file":"Invite.js","path":"src/structures"}},{"name":"targetUser","description":"The user whose stream to display for this voice channel stream invite","nullable":true,"type":[[["User"]]],"meta":{"line":140,"file":"Invite.js","path":"src/structures"}},{"name":"targetApplication","description":"The embedded application to open for this voice channel embedded application invite","nullable":true,"type":[[["IntegrationApplication"]]],"meta":{"line":150,"file":"Invite.js","path":"src/structures"}},{"name":"targetType","description":"The target type","nullable":true,"type":[[["TargetType"]]],"meta":{"line":170,"file":"Invite.js","path":"src/structures"}},{"name":"type","description":"The type of invite","nullable":true,"type":[[["InviteType"]]],"meta":{"line":188,"file":"Invite.js","path":"src/structures"}},{"name":"channelId","description":"The channel's id this invite is for","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":198,"file":"Invite.js","path":"src/structures"}},{"name":"channel","description":"The channel this invite is for","nullable":true,"type":[[["Channel"]]],"meta":{"line":207,"file":"Invite.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp this invite was created at","nullable":true,"type":[[["number"]]],"meta":{"line":216,"file":"Invite.js","path":"src/structures"}},{"name":"stageInstance","description":"The stage instance data if there is a public {@link StageInstance} in the stage channel this invite is for","nullable":true,"type":[[["InviteStageInstance"]]],"meta":{"line":232,"file":"Invite.js","path":"src/structures"}},{"name":"guildScheduledEvent","description":"The guild scheduled event data if there is a {@link GuildScheduledEvent} in the channel this invite is for","nullable":true,"type":[[["GuildScheduledEvent"]]],"meta":{"line":242,"file":"Invite.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the invite.","nullable":true,"type":[[["Readonly","<"],["InviteFlags",">"]]],"meta":{"line":252,"file":"Invite.js","path":"src/structures"}},{"name":"createdAt","description":"The time the invite was created at","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":263,"file":"Invite.js","path":"src/structures"}},{"name":"deletable","description":"Whether the invite is deletable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":272,"file":"Invite.js","path":"src/structures"}},{"name":"expiresTimestamp","description":"The timestamp the invite will expire at","readonly":true,"nullable":true,"type":[[["number"]]],"meta":{"line":287,"file":"Invite.js","path":"src/structures"}},{"name":"expiresAt","description":"The time the invite will expire at","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":299,"file":"Invite.js","path":"src/structures"}},{"name":"url","description":"The URL to the invite","readonly":true,"type":[[["string"]]],"meta":{"line":309,"file":"Invite.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}},{"name":"INVITES_PATTERN","description":"Regular expression that globally matches Discord invite links","scope":"static","type":[[["RegExp"]]],"meta":{"line":356,"file":"Invite.js","path":"src/structures"}}],"methods":[{"name":"delete","description":"Deletes this invite.","params":[{"name":"reason","description":"Reason for deleting this invite","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Invite",">"]]],"meta":{"line":318,"file":"Invite.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically concatenates the invite's URL instead of the object.","examples":["// Logs: Invite: https://discord.gg/A1b2C3\nconsole.log(`Invite: ${invite}`);"],"returns":[[["string"]]],"meta":{"line":330,"file":"Invite.js","path":"src/structures"}}],"meta":{"line":18,"file":"Invite.js","path":"src/structures"}},{"name":"InviteGuild","description":"Represents a guild received from an invite, includes welcome screen data if available.","extends":[[["AnonymousGuild"]]],"props":[{"name":"welcomeScreen","description":"The welcome screen for this invite guild","nullable":true,"type":[[["WelcomeScreen"]]],"meta":{"line":18,"file":"InviteGuild.js","path":"src/structures"}},{"name":"splash","description":"The hash of the guild invite splash image","nullable":true,"type":[[["string"]]],"meta":{"line":25,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"banner","description":"The hash of the guild banner","nullable":true,"type":[[["string"]]],"meta":{"line":33,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"description","description":"The description of the guild, if any","nullable":true,"type":[[["string"]]],"meta":{"line":41,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"verificationLevel","description":"The verification level of the guild","type":[[["VerificationLevel"]]],"meta":{"line":49,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"vanityURLCode","description":"The vanity invite code of the guild, if any","nullable":true,"type":[[["string"]]],"meta":{"line":57,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"nsfwLevel","description":"The NSFW level of this guild","type":[[["NSFWLevel"]]],"meta":{"line":65,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"premiumSubscriptionCount","description":"The total number of boosts for this server","nullable":true,"type":[[["number"]]],"meta":{"line":73,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"id","description":"The guild's id","type":[[["Snowflake"]]],"meta":{"line":19,"file":"BaseGuild.js","path":"src/structures"}},{"name":"name","description":"The name of this guild","type":[[["string"]]],"meta":{"line":25,"file":"BaseGuild.js","path":"src/structures"}},{"name":"icon","description":"The icon hash of this guild","nullable":true,"type":[[["string"]]],"meta":{"line":31,"file":"BaseGuild.js","path":"src/structures"}},{"name":"features","description":"An array of features available to this guild","type":[[["Array","<"],["Features",">"]]],"meta":{"line":37,"file":"BaseGuild.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp this guild was created at","readonly":true,"type":[[["number"]]],"meta":{"line":45,"file":"BaseGuild.js","path":"src/structures"}},{"name":"createdAt","description":"The time this guild was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":54,"file":"BaseGuild.js","path":"src/structures"}},{"name":"nameAcronym","description":"The acronym that shows up in place of a guild icon","readonly":true,"type":[[["string"]]],"meta":{"line":63,"file":"BaseGuild.js","path":"src/structures"}},{"name":"partnered","description":"Whether this guild is partnered","readonly":true,"type":[[["boolean"]]],"meta":{"line":75,"file":"BaseGuild.js","path":"src/structures"}},{"name":"verified","description":"Whether this guild is verified","readonly":true,"type":[[["boolean"]]],"meta":{"line":84,"file":"BaseGuild.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"bannerURL","description":"The URL to this guild's banner.","inherits":"AnonymousGuild#bannerURL","inherited":true,"params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":84,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"splashURL","description":"The URL to this guild's invite splash image.","inherits":"AnonymousGuild#splashURL","inherited":true,"params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":93,"file":"AnonymousGuild.js","path":"src/structures"}},{"name":"iconURL","description":"The URL to this guild's icon.","inherits":"BaseGuild#iconURL","inherited":true,"params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["ImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":93,"file":"BaseGuild.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this guild.","inherits":"BaseGuild#fetch","inherited":true,"async":true,"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":102,"file":"BaseGuild.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the guild's name instead of the Guild object.","inherits":"BaseGuild#toString","inherited":true,"returns":[[["string"]]],"meta":{"line":111,"file":"BaseGuild.js","path":"src/structures"}}],"meta":{"line":10,"file":"InviteGuild.js","path":"src/structures"}},{"name":"InviteStageInstance","description":"Represents the data about a public {@link StageInstance} in an {@link Invite}.","extends":[[["Base"]]],"props":[{"name":"channelId","description":"The id of the stage channel this invite is for","type":[[["Snowflake"]]],"meta":{"line":18,"file":"InviteStageInstance.js","path":"src/structures"}},{"name":"guildId","description":"The stage channel's guild id","type":[[["Snowflake"]]],"meta":{"line":24,"file":"InviteStageInstance.js","path":"src/structures"}},{"name":"members","description":"The members speaking in the stage channel","type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":30,"file":"InviteStageInstance.js","path":"src/structures"}},{"name":"topic","description":"The topic of the stage instance","type":[[["string"]]],"meta":{"line":41,"file":"InviteStageInstance.js","path":"src/structures"}},{"name":"participantCount","description":"The number of users in the stage channel","type":[[["number"]]],"meta":{"line":49,"file":"InviteStageInstance.js","path":"src/structures"}},{"name":"speakerCount","description":"The number of users speaking in the stage channel","type":[[["number"]]],"meta":{"line":57,"file":"InviteStageInstance.js","path":"src/structures"}},{"name":"channel","description":"The stage channel this invite is for","readonly":true,"nullable":true,"type":[[["StageChannel"]]],"meta":{"line":72,"file":"InviteStageInstance.js","path":"src/structures"}},{"name":"guild","description":"The guild of the stage channel this invite is for","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":81,"file":"InviteStageInstance.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"meta":{"line":10,"file":"InviteStageInstance.js","path":"src/structures"}},{"name":"MediaChannel","description":"Represents a media channel.","extends":[[["ThreadOnlyChannel"]]],"props":[{"name":"threads","description":"A manager of the threads belonging to this channel","type":[[["GuildForumThreadManager"]]],"meta":{"line":53,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"availableTags","description":"The set of tags that can be used in this channel.","type":[[["Array","<"],["GuildForumTag",">"]]],"meta":{"line":65,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"defaultReactionEmoji","description":"The emoji to show in the add reaction button on a thread in a guild forum channel","nullable":true,"type":[[["DefaultReactionEmoji"]]],"meta":{"line":75,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"defaultThreadRateLimitPerUser","description":"The initial rate limit per user (slowmode) to set on newly created threads in a channel.","nullable":true,"type":[[["number"]]],"meta":{"line":86,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"rateLimitPerUser","description":"The rate limit per user (slowmode) for this channel.","nullable":true,"type":[[["number"]]],"meta":{"line":96,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"defaultAutoArchiveDuration","description":"The default auto archive duration for newly created threads in this channel.","nullable":true,"type":[[["ThreadAutoArchiveDuration"]]],"meta":{"line":106,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"nsfw","description":"If this channel is considered NSFW.","type":[[["boolean"]]],"meta":{"line":116,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"topic","description":"The topic of this channel.","nullable":true,"type":[[["string"]]],"meta":{"line":126,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"defaultSortOrder","description":"The default sort order mode used to order posts","nullable":true,"type":[[["SortOrderType"]]],"meta":{"line":134,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"guild","description":"The guild the channel is in","type":[[["Guild"]]],"meta":{"line":31,"file":"GuildChannel.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild the channel is in","type":[[["Snowflake"]]],"meta":{"line":37,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionOverwrites","description":"A manager of permission overwrites that belong to this channel","type":[[["PermissionOverwriteManager"]]],"meta":{"line":44,"file":"GuildChannel.js","path":"src/structures"}},{"name":"name","description":"The name of the guild channel","type":[[["string"]]],"meta":{"line":57,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rawPosition","description":"The raw position of the channel from Discord","type":[[["number"]]],"meta":{"line":65,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parentId","description":"The id of the category parent of this channel","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":77,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parent","description":"The category parent of this channel","readonly":true,"nullable":true,"type":[[["CategoryChannel"]]],"meta":{"line":99,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionsLocked","description":"If the permissionOverwrites match the parent channel, null if no parent","readonly":true,"nullable":true,"type":[[["boolean"]]],"meta":{"line":108,"file":"GuildChannel.js","path":"src/structures"}},{"name":"position","description":"The position of the channel","readonly":true,"type":[[["number"]]],"meta":{"line":149,"file":"GuildChannel.js","path":"src/structures"}},{"name":"members","description":"A collection of cached members of this channel, mapped by their ids.\nMembers that can view this channel, if the channel is text-based.\nMembers in the channel, if the channel is voice-based.","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":276,"file":"GuildChannel.js","path":"src/structures"}},{"name":"deletable","description":"Whether the channel is deletable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":418,"file":"GuildChannel.js","path":"src/structures"}},{"name":"manageable","description":"Whether the channel is manageable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":427,"file":"GuildChannel.js","path":"src/structures"}},{"name":"viewable","description":"Whether the channel is viewable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":447,"file":"GuildChannel.js","path":"src/structures"}},{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the channel was created at","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"Channel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the channel was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":79,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"partial","description":"Whether this Channel is a partial\nThis is always false outside of DM channels.","readonly":true,"type":[[["boolean"]]],"meta":{"line":119,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"setAvailableTags","description":"Sets the available tags for this forum channel","inherits":"ThreadOnlyChannel#setAvailableTags","inherited":true,"params":[{"name":"availableTags","description":"The tags to set as available in this channel","type":[[["Array","<"],["GuildForumTagData",">"]]]},{"name":"reason","description":"Reason for changing the available tags","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":146,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"setDefaultReactionEmoji","description":"Sets the default reaction emoji for this channel","inherits":"ThreadOnlyChannel#setDefaultReactionEmoji","inherited":true,"params":[{"name":"defaultReactionEmoji","description":"The emoji to set as the default reaction emoji","nullable":true,"type":[[["DefaultReactionEmoji"]]]},{"name":"reason","description":"Reason for changing the default reaction emoji","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":156,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"setDefaultThreadRateLimitPerUser","description":"Sets the default rate limit per user (slowmode) for new threads in this channel","inherits":"ThreadOnlyChannel#setDefaultThreadRateLimitPerUser","inherited":true,"params":[{"name":"defaultThreadRateLimitPerUser","description":"The rate limit to set on newly created threads in this channel","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the default rate limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":166,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"setDefaultSortOrder","description":"Sets the default sort order mode used to order posts","inherits":"ThreadOnlyChannel#setDefaultSortOrder","inherited":true,"params":[{"name":"defaultSortOrder","description":"The default sort order mode to set on this channel","nullable":true,"type":[[["SortOrderType"]]]},{"name":"reason","description":"Reason for changing the default sort order","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":176,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"createInvite","description":"Creates an invite to this guild channel.","inherits":"ThreadOnlyChannel#createInvite","inherited":true,"examples":["// Create an invite to a channel\nchannel.createInvite()\n .then(invite => console.log(`Created an invite with a code of ${invite.code}`))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for creating the invite","optional":true,"default":"{}","type":[[["CreateInviteOptions"]]]}],"returns":[[["Promise","<"],["Invite",">"]]],"meta":{"line":190,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"fetchInvites","description":"Fetches a collection of invites to this guild channel.\nResolves with a collection mapping invites by their codes.","inherits":"ThreadOnlyChannel#fetchInvites","inherited":true,"params":[{"name":"cache","description":"Whether or not to cache the fetched invites","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Collection","<"],["string",", "],["Invite",">>"]]],"meta":{"line":200,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"setDefaultAutoArchiveDuration","description":"Sets the default auto archive duration for all newly created threads in this channel.","inherits":"ThreadOnlyChannel#setDefaultAutoArchiveDuration","inherited":true,"params":[{"name":"defaultAutoArchiveDuration","description":"The new default auto archive duration","type":[[["ThreadAutoArchiveDuration"]]]},{"name":"reason","description":"Reason for changing the channel's default auto archive duration","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":210,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"setTopic","description":"Sets a new topic for the guild channel.","inherits":"ThreadOnlyChannel#setTopic","inherited":true,"examples":["// Set a new channel topic\nchannel.setTopic('needs more rate limiting')\n .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))\n .catch(console.error);"],"params":[{"name":"topic","description":"The new topic for the guild channel","nullable":true,"type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's topic","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":225,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"fetchWebhooks","description":"Fetches all webhooks for the channel.","inherits":"ThreadOnlyChannel#fetchWebhooks","inherited":true,"implements":["TextBasedChannel#fetchWebhooks"],"examples":["// Fetch webhooks\nchannel.fetchWebhooks()\n .then(hooks => console.log(`This channel has ${hooks.size} hooks`))\n .catch(console.error);"],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Webhook",">>"]]],"meta":{"line":455,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createWebhook","description":"Creates a webhook for the channel.","inherits":"ThreadOnlyChannel#createWebhook","inherited":true,"implements":["TextBasedChannel#createWebhook"],"examples":["// Create a webhook for the current channel\nchannel.createWebhook('Snek', {\n avatar: 'https://i.imgur.com/mI8XcpG.jpg',\n reason: 'Needed a cool new Webhook'\n})\n .then(console.log)\n .catch(console.error)"],"params":[{"name":"name","description":"The name of the webhook","type":[[["string"]]]},{"name":"options","description":"Options for creating the webhook","optional":true,"type":[[["ChannelWebhookCreateOptions"]]]}],"returns":{"types":[[["Promise","<"],["Webhook",">"]]],"description":"Returns the created Webhook"},"meta":{"line":480,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setRateLimitPerUser","description":"Sets the rate limit per user (slowmode) for this channel.","inherits":"ThreadOnlyChannel#setRateLimitPerUser","inherited":true,"implements":["TextBasedChannel#setRateLimitPerUser"],"params":[{"name":"rateLimitPerUser","description":"The new rate limit in seconds","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the channel's rate limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":490,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setNSFW","description":"Sets whether this channel is flagged as NSFW.","inherits":"ThreadOnlyChannel#setNSFW","inherited":true,"implements":["TextBasedChannel#setNSFW"],"params":[{"name":"nsfw","description":"Whether the channel should be considered NSFW","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for changing the channel's NSFW flag","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":500,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"permissionsFor","description":"Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.","inherits":"GuildChannel#permissionsFor","inherited":true,"params":[{"name":"memberOrRole","description":"The member or role to obtain the overall permissions for","type":[[["GuildMemberResolvable"]],[["RoleResolvable"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":{"types":[[["Readonly","<"],["Permissions",">"]]],"nullable":true},"meta":{"line":173,"file":"GuildChannel.js","path":"src/structures"}},{"name":"memberPermissions","description":"Gets the overall set of permissions for a member in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#memberPermissions","inherited":true,"params":[{"name":"member","description":"The member to obtain the overall permissions for","type":[[["GuildMember"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","default":true,"type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":213,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rolePermissions","description":"Gets the overall set of permissions for a role in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#rolePermissions","inherited":true,"params":[{"name":"role","description":"The role to obtain the overall permissions for","type":[[["Role"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":242,"file":"GuildChannel.js","path":"src/structures"}},{"name":"lockPermissions","description":"Locks in the permission overwrites from the parent channel.","inherits":"GuildChannel#lockPermissions","inherited":true,"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":263,"file":"GuildChannel.js","path":"src/structures"}},{"name":"edit","description":"Edits the channel.","inherits":"GuildChannel#edit","inherited":true,"examples":["// Edit a channel\nchannel.edit({ name: 'new-channel' })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"data","description":"The new data for the channel","type":[[["ChannelData"]]]},{"name":"reason","description":"Reason for editing this channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":291,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setName","description":"Sets a new name for the guild channel.","inherits":"GuildChannel#setName","inherited":true,"examples":["// Set a new channel name\nchannel.setName('not_general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.error);"],"params":[{"name":"name","description":"The new name for the guild channel","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":306,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setParent","description":"Sets the parent of this channel.","inherits":"GuildChannel#setParent","inherited":true,"examples":["// Add a parent to a channel\nmessage.channel.setParent('355908108431917066', { lockPermissions: false })\n .then(channel => console.log(`New parent of ${message.channel.name}: ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"channel","description":"The category channel to set as the parent","nullable":true,"type":[[["CategoryChannelResolvable"]]]},{"name":"options","description":"The options for setting the parent","optional":true,"default":"{}","type":[[["SetParentOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":328,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setPosition","description":"Sets a new position for the guild channel.","inherits":"GuildChannel#setPosition","inherited":true,"examples":["// Set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.error);"],"params":[{"name":"position","description":"The new position for the guild channel","type":[[["number"]]]},{"name":"options","description":"Options for setting position","optional":true,"type":[[["SetChannelPositionOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":356,"file":"GuildChannel.js","path":"src/structures"}},{"name":"clone","description":"Clones this channel.","inherits":"GuildChannel#clone","inherited":true,"params":[{"name":"options","description":"The options for cloning this channel","optional":true,"type":[[["GuildChannelCloneOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":371,"file":"GuildChannel.js","path":"src/structures"}},{"name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites, and id as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","inherits":"GuildChannel#equals","inherited":true,"params":[{"name":"channel","description":"Channel to compare with","type":[[["GuildChannel"]]]}],"returns":[[["boolean"]]],"meta":{"line":393,"file":"GuildChannel.js","path":"src/structures"}},{"name":"delete","description":"Deletes this channel.","inherits":"GuildChannel#delete","inherited":true,"examples":["// Delete the channel\nchannel.delete('making room for new channels')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"reason","description":"Reason for deleting this channel","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":464,"file":"GuildChannel.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.","inherits":"Channel#toString","inherited":true,"examples":["// Logs: Hello from <#123456789012345678>!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":130,"file":"Channel.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this channel.","inherits":"Channel#fetch","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":153,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","inherits":"Channel#isText","inherited":true,"returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","inherits":"Channel#isVoice","inherited":true,"returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","inherits":"Channel#isThread","inherited":true,"returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","inherits":"Channel#isThreadOnly","inherited":true,"returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","inherits":"Channel#isDirectory","inherited":true,"returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":9,"file":"MediaChannel.js","path":"src/structures"}},{"name":"MediaGalleryComponent","construct":{"name":"MediaGalleryComponent","params":[{"name":"data","description":"The data","optional":true,"default":"{}","type":[[["MediaGalleryComponent"]],[["APIMediaGalleryComponent"]]]}]},"props":[{"name":"items","description":"1 to 10 media gallery items","type":[[["Array","<"],["MediaGalleryItem",">"]]],"meta":{"line":27,"file":"MediaGalleryComponent.js","path":"src/structures"}}],"methods":[{"name":"toJSON","returns":[[["APIMediaGalleryComponent"]]],"meta":{"line":33,"file":"MediaGalleryComponent.js","path":"src/structures"}}],"meta":{"line":15,"file":"MediaGalleryComponent.js","path":"src/structures"}},{"name":"MediaGalleryItem","construct":{"name":"MediaGalleryItem","params":[{"name":"data","description":"The data","optional":true,"default":"{}","type":[[["MediaGalleryItem"]],[["APIMediaGalleryItem"]]]}]},"props":[{"name":"media","description":"A url or attachment","type":[[["UnfurledMediaItem"]]],"meta":{"line":20,"file":"MediaGalleryItem.js","path":"src/structures"}},{"name":"description","description":"Alt text for the media, max 1024 characters","type":[[["String"]]],"meta":{"line":26,"file":"MediaGalleryItem.js","path":"src/structures"}},{"name":"spoiler","description":"Whether the media should be a spoiler (or blurred out). Defaults to false","type":[[["Boolean"]]],"meta":{"line":32,"file":"MediaGalleryItem.js","path":"src/structures"}}],"methods":[{"name":"toJSON","returns":[[["APIMediaGalleryItem"]]],"meta":{"line":38,"file":"MediaGalleryItem.js","path":"src/structures"}}],"meta":{"line":15,"file":"MediaGalleryItem.js","path":"src/structures"}},{"name":"Message","description":"Represents a message on Discord.","extends":[[["Base"]]],"props":[{"name":"channelId","description":"The id of the channel the message was sent in","type":[[["Snowflake"]]],"meta":{"line":49,"file":"Message.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild the message was sent in, if any","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":55,"file":"Message.js","path":"src/structures"}},{"name":"id","description":"The message's id","type":[[["Snowflake"]]],"meta":{"line":65,"file":"Message.js","path":"src/structures"}},{"name":"position","description":"A generally increasing integer (there may be gaps or duplicates) that represents\nthe approximate position of the message in a thread.","nullable":true,"type":[[["number"]]],"meta":{"line":73,"file":"Message.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the message was sent at","type":[[["number"]]],"meta":{"line":82,"file":"Message.js","path":"src/structures"}},{"name":"type","description":"The type of the message","nullable":true,"type":[[["MessageType"]]],"meta":{"line":89,"file":"Message.js","path":"src/structures"}},{"name":"system","description":"Whether or not this message was sent by Discord, not actually a user (e.g. pin notifications)","nullable":true,"type":[[["boolean"]]],"meta":{"line":95,"file":"Message.js","path":"src/structures"}},{"name":"content","description":"The content of the message","nullable":true,"type":[[["string"]]],"meta":{"line":106,"file":"Message.js","path":"src/structures"}},{"name":"author","description":"The author of the message","nullable":true,"type":[[["User"]]],"meta":{"line":116,"file":"Message.js","path":"src/structures"}},{"name":"pinned","description":"Whether or not this message is pinned","nullable":true,"type":[[["boolean"]]],"meta":{"line":126,"file":"Message.js","path":"src/structures"}},{"name":"tts","description":"Whether or not the message was Text-To-Speech","nullable":true,"type":[[["boolean"]]],"meta":{"line":136,"file":"Message.js","path":"src/structures"}},{"name":"nonce","description":"A random number or string used for checking message delivery\nThis is only received after the message was sent successfully, and\nlost if re-fetched","nullable":true,"type":[[["string"]]],"meta":{"line":148,"file":"Message.js","path":"src/structures"}},{"name":"embeds","description":"A list of embeds in the message - e.g. YouTube Player","type":[[["Array","<"],["MessageEmbed",">"]]],"meta":{"line":158,"file":"Message.js","path":"src/structures"}},{"name":"components","description":"An array of components in the message","type":[[["Array","<"],["TopLevelComponent",">"]]],"meta":{"line":172,"file":"Message.js","path":"src/structures"}},{"name":"attachments","description":"A collection of attachments in the message - e.g. Pictures - mapped by their ids","type":[[["Collection","<"],["Snowflake",", "],["MessageAttachment",">"]]],"meta":{"line":182,"file":"Message.js","path":"src/structures"}},{"name":"stickers","description":"A collection of stickers in the message","type":[[["Collection","<"],["Snowflake",", "],["Sticker",">"]]],"meta":{"line":197,"file":"Message.js","path":"src/structures"}},{"name":"editedTimestamp","description":"The timestamp the message was last edited at (if applicable)","nullable":true,"type":[[["number"]]],"meta":{"line":210,"file":"Message.js","path":"src/structures"}},{"name":"reactions","description":"A manager of the reactions belonging to this message","type":[[["ReactionManager"]]],"meta":{"line":220,"file":"Message.js","path":"src/structures"}},{"name":"mentions","description":"All valid mentions that the message contains","type":[[["MessageMentions"]]],"meta":{"line":235,"file":"Message.js","path":"src/structures"}},{"name":"webhookId","description":"The id of the webhook that sent the message, if applicable","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":259,"file":"Message.js","path":"src/structures"}},{"name":"poll","description":"The poll that was sent with the message","nullable":true,"type":[[["Poll"]]],"meta":{"line":269,"file":"Message.js","path":"src/structures"}},{"name":"groupActivityApplication","description":"Supplemental application information for group activities","nullable":true,"type":[[["Application"]]],"meta":{"line":279,"file":"Message.js","path":"src/structures"}},{"name":"applicationId","description":"The id of the application of the interaction that sent this message, if any","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":289,"file":"Message.js","path":"src/structures"}},{"name":"activity","description":"Group activity","nullable":true,"type":[[["MessageActivity"]]],"meta":{"line":299,"file":"Message.js","path":"src/structures"}},{"name":"flags","description":"Flags that are applied to the message","type":[[["Readonly","<"],["MessageFlags",">"]]],"meta":{"line":322,"file":"Message.js","path":"src/structures"}},{"name":"reference","description":"Message reference data","nullable":true,"type":[[["MessageReference"]]],"meta":{"line":348,"file":"Message.js","path":"src/structures"}},{"name":"interaction","description":"Partial data of the interaction that this message is a reply to","nullable":true,"type":[[["MessageInteraction"]]],"meta":{"line":377,"file":"Message.js","path":"src/structures"}},{"name":"messageSnapshots","description":"The message snapshots associated with the message reference","type":[[["Collection","<"],["Snowflake",", "],["Message",">"]]],"meta":{"line":392,"file":"Message.js","path":"src/structures"}},{"name":"call","description":"The call associated with the message","nullable":true,"type":[[["MessageCall"]]],"meta":{"line":423,"file":"Message.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":440,"file":"Message.js","path":"src/structures"}},{"name":"channel","description":"The channel that the message was sent in","readonly":true,"type":[[["TextBasedChannels"]]],"meta":{"line":470,"file":"Message.js","path":"src/structures"}},{"name":"partial","description":"Whether or not this message is a partial","readonly":true,"type":[[["boolean"]]],"meta":{"line":479,"file":"Message.js","path":"src/structures"}},{"name":"member","description":"Represents the author of the message as a guild member.\nOnly available if the message comes from a guild where the author is still a member","readonly":true,"nullable":true,"type":[[["GuildMember"]]],"meta":{"line":489,"file":"Message.js","path":"src/structures"}},{"name":"createdAt","description":"The time the message was sent at","readonly":true,"type":[[["Date"]]],"meta":{"line":498,"file":"Message.js","path":"src/structures"}},{"name":"editedAt","description":"The time the message was last edited at (if applicable)","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":507,"file":"Message.js","path":"src/structures"}},{"name":"guild","description":"The guild the message was sent in (if in a guild channel)","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":516,"file":"Message.js","path":"src/structures"}},{"name":"hasThread","description":"Whether this message has a thread associated with it","readonly":true,"type":[[["boolean"]]],"meta":{"line":525,"file":"Message.js","path":"src/structures"}},{"name":"thread","description":"The thread started by this message\nThis property is not suitable for checking whether a message has a thread,\nuse {@link Message#hasThread} instead.","readonly":true,"nullable":true,"type":[[["ThreadChannel"]]],"meta":{"line":536,"file":"Message.js","path":"src/structures"}},{"name":"url","description":"The URL to jump to this message","readonly":true,"type":[[["string"]]],"meta":{"line":545,"file":"Message.js","path":"src/structures"}},{"name":"cleanContent","description":"The message contents with all mentions replaced by the equivalent text.\nIf mentions cannot be resolved to a name, the relevant mention in the message content will not be converted.","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":555,"file":"Message.js","path":"src/structures"}},{"name":"editable","description":"Whether the message is editable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":608,"file":"Message.js","path":"src/structures"}},{"name":"deletable","description":"Whether the message is deletable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":634,"file":"Message.js","path":"src/structures"}},{"name":"bulkDeletable","description":"Whether the message is bulk deletable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":666,"file":"Message.js","path":"src/structures"}},{"name":"pinnable","description":"Whether the message is pinnable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":675,"file":"Message.js","path":"src/structures"}},{"name":"crosspostable","description":"Whether the message is crosspostable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":705,"file":"Message.js","path":"src/structures"}},{"name":"isMessage","description":"Check data","readonly":true,"type":[[["boolean"]]],"meta":{"line":1085,"file":"Message.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"createReactionCollector","description":"Creates a reaction collector.","examples":["// Create a reaction collector\nconst filter = (reaction, user) => reaction.emoji.name === '👌' && user.id === 'someId';\nconst collector = message.createReactionCollector({ filter, time: 15_000 });\ncollector.on('collect', r => console.log(`Collected ${r.emoji.name}`));\ncollector.on('end', collected => console.log(`Collected ${collected.size} items`));"],"params":[{"name":"options","description":"Options to send to the collector","optional":true,"default":"{}","type":[[["ReactionCollectorOptions"]]]}],"returns":[[["ReactionCollector"]]],"meta":{"line":571,"file":"Message.js","path":"src/structures"}},{"name":"awaitReactions","description":"Similar to createReactionCollector but in promise form.\nResolves with a collection of reactions that pass the specified filter.","examples":["// Create a reaction collector\nconst filter = (reaction, user) => reaction.emoji.name === '👌' && user.id === 'someId'\nmessage.awaitReactions({ filter, time: 15_000 })\n .then(collected => console.log(`Collected ${collected.size} reactions`))\n .catch(console.error);"],"params":[{"name":"options","description":"Optional options to pass to the internal collector","optional":true,"default":"{}","type":[[["AwaitReactionsOptions"]]]}],"returns":[[["Promise","<"],["Collection","<("],["string","|"],["Snowflake","), "],["MessageReaction",">>"]]],"meta":{"line":593,"file":"Message.js","path":"src/structures"}},{"name":"fetchReference","description":"Fetches the Message this crosspost/reply/pin-add references, if available to the client","async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":690,"file":"Message.js","path":"src/structures"}},{"name":"edit","description":"Edits the content of the message.","examples":["// Update the content of a message\nmessage.edit('This is my new content!')\n .then(msg => console.log(`Updated the content of a message to ${msg.content}`))\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["MessageEditOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":746,"file":"Message.js","path":"src/structures"}},{"name":"crosspost","description":"Publishes a message in an announcement channel to all channels following it.","examples":["// Crosspost a message\nif (message.channel.type === 'GUILD_NEWS') {\n message.crosspost()\n .then(() => console.log('Crossposted message'))\n .catch(console.error);\n}"],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":762,"file":"Message.js","path":"src/structures"}},{"name":"pin","description":"Pins this message to the channel's pinned messages.","examples":["// Pin a message\nmessage.pin()\n .then(console.log)\n .catch(console.error)"],"params":[{"name":"reason","description":"Reason for pinning","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":777,"file":"Message.js","path":"src/structures"}},{"name":"unpin","description":"Unpins this message from the channel's pinned messages.","examples":["// Unpin a message\nmessage.unpin()\n .then(console.log)\n .catch(console.error)"],"params":[{"name":"reason","description":"Reason for unpinning","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":793,"file":"Message.js","path":"src/structures"}},{"name":"react","description":"Adds a reaction to the message.","examples":["// React to a message with a unicode emoji\nmessage.react('🤔')\n .then(console.log)\n .catch(console.error);","// React to a message with a custom emoji\nmessage.react(message.guild.emojis.cache.get('123456789012345678'))\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"emoji","description":"The emoji to react with","type":[[["EmojiIdentifierResolvable"]]]},{"name":"burst","description":"Super Reactions","optional":true,"default":false,"type":[[["boolean"]]]}],"async":true,"returns":[[["Promise","<"],["MessageReaction",">"]]],"meta":{"line":815,"file":"Message.js","path":"src/structures"}},{"name":"delete","description":"Deletes the message.","examples":["// Delete a message\nmessage.delete()\n .then(msg => console.log(`Deleted message from ${msg.author.username}`))\n .catch(console.error);"],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":840,"file":"Message.js","path":"src/structures"}},{"name":"reply","description":"Send an inline reply to this message.","examples":["// Reply to a message\nmessage.reply('This is a reply!')\n .then(() => console.log(`Replied to message \"${message.content}\"`))\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["ReplyMessageOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":864,"file":"Message.js","path":"src/structures"}},{"name":"forward","description":"Forwards this message","params":[{"name":"channel","description":"The channel to forward this message to.","type":[[["TextBasedChannelResolvable"]]]}],"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":886,"file":"Message.js","path":"src/structures"}},{"name":"startThread","description":"Create a new public thread from this message","see":["GuildTextThreadManager#create"],"params":[{"name":"options","description":"Options for starting a thread on this message","optional":true,"type":[[["StartThreadOptions"]]]}],"async":true,"returns":[[["Promise","<"],["ThreadChannel",">"]]],"meta":{"line":926,"file":"Message.js","path":"src/structures"}},{"name":"vote","description":"Submits a poll vote for the current user. Returns a 204 empty response on success.","examples":["// Vote multi choices\nmessage.vote(1,2);\n// Remove vote\nmessage.vote();"],"params":[{"name":"ids","description":"ID of the answer","variable":true,"type":[[["Array","<"],["number",">"]]]}],"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":945,"file":"Message.js","path":"src/structures"}},{"name":"fetch","description":"Fetch this message.","params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":961,"file":"Message.js","path":"src/structures"}},{"name":"fetchWebhook","description":"Fetches the webhook used to create this message.","async":true,"returns":[[["Promise",""]]],"meta":{"line":970,"file":"Message.js","path":"src/structures"}},{"name":"suppressEmbeds","description":"Suppresses or unsuppresses embeds on a message.","params":[{"name":"suppress","description":"If the embeds should be suppressed or not","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":981,"file":"Message.js","path":"src/structures"}},{"name":"removeAttachments","description":"Removes the attachments from this message.","returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":997,"file":"Message.js","path":"src/structures"}},{"name":"resolveComponent","description":"Resolves a component by a custom id.","params":[{"name":"customId","description":"The custom id to resolve against","type":[[["string"]]]}],"returns":{"types":[[["MessageActionRowComponent"]]],"nullable":true},"meta":{"line":1006,"file":"Message.js","path":"src/structures"}},{"name":"equals","description":"Used mainly internally. Whether two messages are identical in properties. If you want to compare messages\nwithout checking all the properties, use `message.id === message2.id`, which is much more efficient. This\nmethod allows you to see if there are differences in content, embeds, attachments, nonce and tts properties.","params":[{"name":"message","description":"The message to compare it to","type":[[["Message"]]]},{"name":"rawData","description":"Raw data passed through the WebSocket about this message","type":[[["APIMessage"]]]}],"returns":[[["boolean"]]],"meta":{"line":1022,"file":"Message.js","path":"src/structures"}},{"name":"inGuild","description":"Whether this message is from a guild.","returns":[[["boolean"]]],"meta":{"line":1052,"file":"Message.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically concatenates the message's content instead of the object.","examples":["// Logs: Message: This is a message!\nconsole.log(`Message: ${message}`);"],"returns":[[["string"]]],"meta":{"line":1063,"file":"Message.js","path":"src/structures"}},{"name":"clickButton","description":"Click a specified button in the message based on the button's CustomID","params":[{"name":"buttonid","description":"customId of the button to click\n\nTo be compatible with Components V2, the following methods have been removed in this version:\n- Clicking by coordinates (using ActionRow)\n- Clicking the first button in the message\n\nCurrently, only clicking by CustomID is supported.","type":[[["string"]]]}],"returns":[[["Promise","<("],["Message","|"],["Modal",")>"]]],"meta":{"line":1100,"file":"Message.js","path":"src/structures"}},{"name":"selectMenu","description":"Select specific menu","params":[{"name":"menu","description":"Target","type":[[["number"]],[["string"]]]},{"name":"values","description":"Any value","type":[[["Array","<("],["UserResolvable","|"],["RoleResolvable","|"],["ChannelResolvable","|"],["string",")>"]]]}],"returns":[[["Promise","<("],["Message","|"],["Modal",")>"]]],"meta":{"line":1131,"file":"Message.js","path":"src/structures"}},{"name":"markUnread","description":"Marks the message as unread.","returns":[[["Promise","<"],["void",">"]]],"meta":{"line":1200,"file":"Message.js","path":"src/structures"}},{"name":"markRead","description":"Marks the message as read.","returns":[[["Promise","<"],["void",">"]]],"meta":{"line":1213,"file":"Message.js","path":"src/structures"}},{"name":"report","description":"Report Message","examples":["// GET https://discord.com/api/v9/reporting/menu/message?variant=4\n// Report Category\n// - MESSAGE_WELCOME (3)\n// - Something else (28)\n// - Hacks, cheats, phishing or malicious links (72)\nmessage.report([3, 28, 72]).then(console.log);\n// { \"report_id\": \"1199663489988440124\" }"],"params":[{"name":"breadcrumbs","description":"Options for reporting","type":[[["Arrray","<"],["number",">"]]]},{"name":"elements","description":"Metadata","optional":true,"default":"{}","type":[[["Object"]]]}],"returns":[[["Promise","<{"],["report_id",": "],["Snowflake","}>"]]],"meta":{"line":1235,"file":"Message.js","path":"src/structures"}}],"meta":{"line":41,"file":"Message.js","path":"src/structures"}},{"name":"MessageActionRow","description":"Represents an action row containing message components.","extends":[[["BaseMessageComponent"]]],"construct":{"name":"MessageActionRow","params":[{"name":"data","description":"MessageActionRow to clone or raw data","optional":true,"default":"{}","type":[[["MessageActionRow"]],[["MessageActionRowOptions"]]]},{"name":"client","description":"The client constructing this MessageActionRow, if provided","optional":true,"default":null,"type":[[["Client"]]]}]},"props":[{"name":"components","description":"The components in this action row","type":[[["Array","<"],["MessageActionRowComponent",">"]]],"meta":{"line":51,"file":"MessageActionRow.js","path":"src/structures"}},{"name":"type","description":"The type of this component","nullable":true,"type":[[["MessageComponentType"]]],"meta":{"line":52,"file":"BaseMessageComponent.js","path":"src/structures"}},{"name":"data","description":"The data for this component","type":[[["MessageComponentOptions"]]],"meta":{"line":60,"file":"BaseMessageComponent.js","path":"src/structures"}},{"name":"id","description":"The id of this component","readonly":true,"type":[[["number"]]],"meta":{"line":68,"file":"BaseMessageComponent.js","path":"src/structures"}}],"methods":[{"name":"addComponents","description":"Adds components to the action row.","params":[{"name":"components","description":"The components to add","variable":true,"type":[[["Array","<"],["MessageActionRowComponentResolvable",">"]]]}],"returns":[[["MessageActionRow"]]],"meta":{"line":61,"file":"MessageActionRow.js","path":"src/structures"}},{"name":"setComponents","description":"Sets the components of the action row.","params":[{"name":"components","description":"The components to set","variable":true,"type":[[["Array","<"],["MessageActionRowComponentResolvable",">"]]]}],"returns":[[["MessageActionRow"]]],"meta":{"line":71,"file":"MessageActionRow.js","path":"src/structures"}},{"name":"spliceComponents","description":"Removes, replaces, and inserts components in the action row.","params":[{"name":"index","description":"The index to start at","type":[[["number"]]]},{"name":"deleteCount","description":"The number of components to remove","type":[[["number"]]]},{"name":"components","description":"The replacing components","optional":true,"variable":true,"type":[[["Array","<"],["MessageActionRowComponentResolvable",">"]]]}],"returns":[[["MessageActionRow"]]],"meta":{"line":83,"file":"MessageActionRow.js","path":"src/structures"}},{"name":"toJSON","description":"Transforms the action row to a plain object.","returns":{"types":[[["APIMessageComponent"]]],"description":"The raw data of this action row"},"meta":{"line":92,"file":"MessageActionRow.js","path":"src/structures"}}],"meta":{"line":10,"file":"MessageActionRow.js","path":"src/structures"}},{"name":"MessageAttachment","description":"Represents an attachment in a message.","construct":{"name":"MessageAttachment","params":[{"name":"attachment","description":"The file","type":[[["BufferResolvable"]],[["Stream"]]]},{"name":"name","description":"The name of the file, if any","optional":true,"default":null,"type":[[["string"]]]},{"name":"data","description":"Extra data","optional":true,"type":[[["APIAttachment"]]]}]},"props":[{"name":"name","description":"The name of this attachment","nullable":true,"type":[[["string"]]],"meta":{"line":21,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"id","description":"The attachment's id","type":[[["Snowflake"]]],"meta":{"line":80,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"size","description":"The size of this attachment in bytes","type":[[["number"]]],"meta":{"line":87,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"url","description":"The URL to this attachment","type":[[["string"]]],"meta":{"line":95,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"proxyURL","description":"The Proxy URL to this attachment","type":[[["string"]]],"meta":{"line":103,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"height","description":"The height of this attachment (if an image or video)","nullable":true,"type":[[["number"]]],"meta":{"line":111,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"width","description":"The width of this attachment (if an image or video)","nullable":true,"type":[[["number"]]],"meta":{"line":121,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"contentType","description":"The media (MIME) type of this attachment","see":["{@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types}"],"nullable":true,"type":[[["string"]]],"meta":{"line":132,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"description","description":"The description (alt text) of this attachment","nullable":true,"type":[[["string"]]],"meta":{"line":142,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"ephemeral","description":"Whether this attachment is ephemeral","type":[[["boolean"]]],"meta":{"line":151,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"duration","description":"The duration of this attachment in seconds\nThis will only be available if the attachment is an audio file.","nullable":true,"type":[[["number"]]],"meta":{"line":159,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"waveform","description":"The base64 encoded byte array representing a sampled waveform\nThis will only be available if the attachment is an audio file.","nullable":true,"type":[[["string"]]],"meta":{"line":170,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"flags","description":"The flags of this attachment","type":[[["Readonly","<"],["AttachmentFlags",">"]]],"meta":{"line":180,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"title","description":"The title of this attachment\nThis will only be available if the attachment name contains special characters.","nullable":true,"type":[[["string"]]],"meta":{"line":191,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"spoiler","description":"Whether or not this attachment has been marked as a spoiler","readonly":true,"type":[[["boolean"]]],"meta":{"line":202,"file":"MessageAttachment.js","path":"src/structures"}}],"methods":[{"name":"setDescription","description":"Sets the description of this attachment.","params":[{"name":"description","description":"The description of the file","type":[[["string"]]]}],"returns":{"types":[[["MessageAttachment"]]],"description":"This attachment"},"meta":{"line":30,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"setFile","description":"Sets the file of this attachment.","params":[{"name":"attachment","description":"The file","type":[[["BufferResolvable"]],[["Stream"]]]},{"name":"name","description":"The name of the file, if any","optional":true,"default":null,"type":[[["string"]]]}],"returns":{"types":[[["MessageAttachment"]]],"description":"This attachment"},"meta":{"line":41,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"setName","description":"Sets the name of this attachment.","params":[{"name":"name","description":"The name of the file","type":[[["string"]]]}],"returns":{"types":[[["MessageAttachment"]]],"description":"This attachment"},"meta":{"line":52,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"setSpoiler","description":"Sets whether this attachment is a spoiler","params":[{"name":"spoiler","description":"Whether the attachment should be marked as a spoiler","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":{"types":[[["MessageAttachment"]]],"description":"This attachment"},"meta":{"line":62,"file":"MessageAttachment.js","path":"src/structures"}}],"meta":{"line":9,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"MessageButton","description":"Represents a button message component.","extends":[[["BaseMessageComponent"]]],"construct":{"name":"MessageButton","params":[{"name":"data","description":"MessageButton to clone or raw data","optional":true,"default":"{}","type":[[["MessageButton"]],[["MessageButtonOptions"]]]}]},"props":[{"name":"label","description":"The text to be displayed on this button","nullable":true,"type":[[["string"]]],"meta":{"line":38,"file":"MessageButton.js","path":"src/structures"}},{"name":"customId","description":"A unique string to be sent in the interaction when clicked","nullable":true,"type":[[["string"]]],"meta":{"line":44,"file":"MessageButton.js","path":"src/structures"}},{"name":"style","description":"The style of this button","nullable":true,"type":[[["MessageButtonStyle"]]],"meta":{"line":50,"file":"MessageButton.js","path":"src/structures"}},{"name":"emoji","description":"Emoji for this button","nullable":true,"type":[[["RawEmoji"]]],"meta":{"line":56,"file":"MessageButton.js","path":"src/structures"}},{"name":"url","description":"The URL this button links to, if it is a Link style button","nullable":true,"type":[[["string"]]],"meta":{"line":62,"file":"MessageButton.js","path":"src/structures"}},{"name":"disabled","description":"Whether this button is currently disabled","type":[[["boolean"]]],"meta":{"line":68,"file":"MessageButton.js","path":"src/structures"}},{"name":"type","description":"The type of this component","nullable":true,"type":[[["MessageComponentType"]]],"meta":{"line":52,"file":"BaseMessageComponent.js","path":"src/structures"}},{"name":"data","description":"The data for this component","type":[[["MessageComponentOptions"]]],"meta":{"line":60,"file":"BaseMessageComponent.js","path":"src/structures"}},{"name":"id","description":"The id of this component","readonly":true,"type":[[["number"]]],"meta":{"line":68,"file":"BaseMessageComponent.js","path":"src/structures"}}],"methods":[{"name":"setCustomId","description":"Sets the custom id for this button","params":[{"name":"customId","description":"A unique string to be sent in the interaction when clicked","type":[[["string"]]]}],"returns":[[["MessageButton"]]],"meta":{"line":76,"file":"MessageButton.js","path":"src/structures"}},{"name":"setDisabled","description":"Sets the interactive status of the button","params":[{"name":"disabled","description":"Whether this button should be disabled","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["MessageButton"]]],"meta":{"line":86,"file":"MessageButton.js","path":"src/structures"}},{"name":"setEmoji","description":"Set the emoji of this button","params":[{"name":"emoji","description":"The emoji to be displayed on this button","type":[[["EmojiIdentifierResolvable"]]]}],"returns":[[["MessageButton"]]],"meta":{"line":96,"file":"MessageButton.js","path":"src/structures"}},{"name":"setLabel","description":"Sets the label of this button","params":[{"name":"label","description":"The text to be displayed on this button","type":[[["string"]]]}],"returns":[[["MessageButton"]]],"meta":{"line":106,"file":"MessageButton.js","path":"src/structures"}},{"name":"setStyle","description":"Sets the style of this button","params":[{"name":"style","description":"The style of this button","type":[[["MessageButtonStyleResolvable"]]]}],"returns":[[["MessageButton"]]],"meta":{"line":116,"file":"MessageButton.js","path":"src/structures"}},{"name":"setURL","description":"Sets the URL of this button.\nMessageButton#style must be LINK when setting a URL","params":[{"name":"url","description":"The URL of this button","type":[[["string"]]]}],"returns":[[["MessageButton"]]],"meta":{"line":127,"file":"MessageButton.js","path":"src/structures"}},{"name":"toJSON","description":"Transforms the button to a plain object.","returns":{"types":[[["APIMessageButton"]]],"description":"The raw data of this button"},"meta":{"line":136,"file":"MessageButton.js","path":"src/structures"}},{"name":"resolveStyle","description":"Resolves the style of a button","scope":"static","access":"private","params":[{"name":"style","description":"The style to resolve","type":[[["MessageButtonStyleResolvable"]]]}],"returns":[[["MessageButtonStyle"]]],"meta":{"line":161,"file":"MessageButton.js","path":"src/structures"}}],"meta":{"line":12,"file":"MessageButton.js","path":"src/structures"}},{"name":"MessageCollector","description":"Collects messages on a channel.\nWill automatically stop if the channel ({@link Client#event:channelDelete channelDelete}),\nthread ({@link Client#event:threadDelete threadDelete}), or\nguild ({@link Client#event:guildDelete guildDelete}) is deleted.","extends":[[["Collector"]]],"construct":{"name":"MessageCollector","params":[{"name":"channel","description":"The channel","type":[[["TextBasedChannels"]]]},{"name":"options","description":"The options to be applied to this collector","type":[[["MessageCollectorOptions"]]]}]},"props":[{"name":"channel","description":"The channel","type":[[["TextBasedChannels"]]],"meta":{"line":32,"file":"MessageCollector.js","path":"src/structures"}},{"name":"received","description":"Total number of messages that were received in the channel during message collection","type":[[["number"]]],"meta":{"line":38,"file":"MessageCollector.js","path":"src/structures"}},{"name":"endReason","description":"The reason this collector has ended with, or null if it hasn't ended yet","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":103,"file":"MessageCollector.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this Collector","readonly":true,"type":[[["Client"]]],"meta":{"line":35,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"filter","description":"The filter applied to this collector","type":[[["CollectorFilter"]]],"meta":{"line":48,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"options","description":"The options of this collector","type":[[["CollectorOptions"]]],"meta":{"line":54,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"collected","description":"The items collected by this collector","type":[[["Collection"]]],"meta":{"line":60,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"ended","description":"Whether this collector has finished collecting","type":[[["boolean"]]],"meta":{"line":66,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"_timeout","description":"Timeout for cleanup","access":"private","nullable":true,"type":[[["Timeout"]]],"meta":{"line":73,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"_idletimeout","description":"Timeout for cleanup due to inactivity","access":"private","nullable":true,"type":[[["Timeout"]]],"meta":{"line":80,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"next","description":"Returns a promise that resolves with the next collected element;\nrejects with collected elements if the collector finishes without receiving a next element","readonly":true,"type":[[["Promise"]]],"meta":{"line":148,"file":"Collector.js","path":"src/structures/interfaces"}}],"methods":[{"name":"collect","description":"Handles a message for possible collection.","access":"private","params":[{"name":"message","description":"The message that could be collected","type":[[["Message"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":73,"file":"MessageCollector.js","path":"src/structures"}},{"name":"dispose","description":"Handles a message for possible disposal.","params":[{"name":"message","description":"The message that could be disposed of","type":[[["Message"]]]}],"returns":{"types":[[["Snowflake"]]],"nullable":true},"meta":{"line":89,"file":"MessageCollector.js","path":"src/structures"}},{"name":"_handleChannelDeletion","description":"Handles checking if the channel has been deleted, and if so, stops the collector with the reason 'channelDelete'.","access":"private","params":[{"name":"channel","description":"The channel that was deleted","type":[[["GuildChannel"]]]}],"returns":[[["void"]]],"meta":{"line":115,"file":"MessageCollector.js","path":"src/structures"}},{"name":"_handleThreadDeletion","description":"Handles checking if the thread has been deleted, and if so, stops the collector with the reason 'threadDelete'.","access":"private","params":[{"name":"thread","description":"The thread that was deleted","type":[[["ThreadChannel"]]]}],"returns":[[["void"]]],"meta":{"line":127,"file":"MessageCollector.js","path":"src/structures"}},{"name":"_handleGuildDeletion","description":"Handles checking if the guild has been deleted, and if so, stops the collector with the reason 'guildDelete'.","access":"private","params":[{"name":"guild","description":"The guild that was deleted","type":[[["Guild"]]]}],"returns":[[["void"]]],"meta":{"line":139,"file":"MessageCollector.js","path":"src/structures"}},{"name":"handleCollect","description":"Call this to handle an event as a collectable element. Accepts any event data as parameters.","inherits":"Collector#handleCollect","inherited":true,"emits":["Collector#event:collect"],"params":[{"name":"args","description":"The arguments emitted by the listener","variable":true,"type":[["*"]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":99,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"handleDispose","description":"Call this to remove an element from the collection. Accepts any event data as parameters.","inherits":"Collector#handleDispose","inherited":true,"emits":["Collector#event:dispose"],"params":[{"name":"args","description":"The arguments emitted by the listener","variable":true,"type":[["*"]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":126,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"stop","description":"Stops this collector and emits the `end` event.","inherits":"Collector#stop","inherited":true,"emits":["Collector#event:end"],"params":[{"name":"reason","description":"The reason this collector is ending","optional":true,"default":"'user'","type":[[["string"]]]}],"meta":{"line":180,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"resetTimer","description":"Resets the collector's timeout and idle timer.","inherits":"Collector#resetTimer","inherited":true,"params":[{"name":"options","description":"Options for resetting","optional":true,"type":[[["CollectorResetTimerOptions"]]]}],"meta":{"line":213,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"checkEnd","description":"Checks whether the collector should end, and if so, ends it.","inherits":"Collector#checkEnd","inherited":true,"returns":{"types":[[["boolean"]]],"description":"Whether the collector ended or not"},"meta":{"line":228,"file":"Collector.js","path":"src/structures/interfaces"}}],"events":[{"name":"collect","description":"Emitted whenever a message is collected.","params":[{"name":"message","description":"The message that was collected","type":[[["Message"]]]}],"meta":{"line":74,"file":"MessageCollector.js","path":"src/structures"}},{"name":"dispose","description":"Emitted whenever a message is disposed of.","params":[{"name":"message","description":"The message that was disposed of","type":[[["Message"]]]}],"meta":{"line":90,"file":"MessageCollector.js","path":"src/structures"}},{"name":"end","description":"Emitted when the collector is finished collecting.","params":[{"name":"collected","description":"The elements collected by the collector","type":[[["Collection"]]]},{"name":"reason","description":"The reason the collector ended","type":[[["string"]]]}],"meta":{"line":193,"file":"Collector.js","path":"src/structures/interfaces"}}],"meta":{"line":19,"file":"MessageCollector.js","path":"src/structures"}},{"name":"MessageComponentInteraction","description":"Represents a message component interaction.","extends":[[["Interaction"]]],"implements":[[["InteractionResponses"]]],"props":[{"name":"channelId","description":"The id of the channel this interaction was sent in","type":[[["Snowflake"]]],"meta":{"line":17,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"message","description":"The message to which the component was attached","type":[[["Message"]],[["APIMessage"]]],"meta":{"line":27,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"customId","description":"The custom id of the component which was interacted with","type":[[["string"]]],"meta":{"line":33,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"componentType","description":"The type of component which was interacted with","type":[[["string"]]],"meta":{"line":39,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"deferred","description":"Whether the reply to this interaction has been deferred","type":[[["boolean"]]],"meta":{"line":45,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"ephemeral","description":"Whether the reply to this interaction is ephemeral","nullable":true,"type":[[["boolean"]]],"meta":{"line":51,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"replied","description":"Whether this interaction has already been replied to","type":[[["boolean"]]],"meta":{"line":57,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"webhook","description":"An associated interaction webhook, can be used to further interact with this interaction","type":[[["InteractionWebhook"]]],"meta":{"line":63,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"component","description":"The component which was interacted with","readonly":true,"type":[[["MessageActionRowComponent"]],[["APIMessageActionRowComponent"]]],"meta":{"line":78,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"type","description":"The interaction's type","type":[[["InteractionType"]]],"meta":{"line":20,"file":"Interaction.js","path":"src/structures"}},{"name":"id","description":"The interaction's id","type":[[["Snowflake"]]],"meta":{"line":26,"file":"Interaction.js","path":"src/structures"}},{"name":"token","description":"The interaction's token","readonly":true,"type":[[["string"]]],"meta":{"line":28,"file":"Interaction.js","path":"src/structures"}},{"name":"applicationId","description":"The application's id","type":[[["Snowflake"]]],"meta":{"line":40,"file":"Interaction.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild this interaction was sent in","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":52,"file":"Interaction.js","path":"src/structures"}},{"name":"user","description":"The user which sent this interaction","type":[[["User"]]],"meta":{"line":58,"file":"Interaction.js","path":"src/structures"}},{"name":"member","description":"If this interaction was sent in a guild, the member which sent it","nullable":true,"type":[[["GuildMember"]],[["APIGuildMember"]]],"meta":{"line":64,"file":"Interaction.js","path":"src/structures"}},{"name":"version","description":"The version","type":[[["number"]]],"meta":{"line":70,"file":"Interaction.js","path":"src/structures"}},{"name":"appPermissions","description":"Set of permissions the application or bot has within the channel the interaction was sent from","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":76,"file":"Interaction.js","path":"src/structures"}},{"name":"memberPermissions","description":"The permissions of the member, if one exists, in the channel this interaction was executed in","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":82,"file":"Interaction.js","path":"src/structures"}},{"name":"locale","description":"The locale of the user who invoked this interaction","type":[[["Locale"]]],"meta":{"line":124,"file":"Interaction.js","path":"src/structures"}},{"name":"guildLocale","description":"The preferred locale from the guild this interaction was sent in","nullable":true,"type":[[["Locale"]]],"meta":{"line":130,"file":"Interaction.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the interaction was created at","readonly":true,"type":[[["number"]]],"meta":{"line":138,"file":"Interaction.js","path":"src/structures"}},{"name":"createdAt","description":"The time the interaction was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":147,"file":"Interaction.js","path":"src/structures"}},{"name":"channel","description":"The channel this interaction was sent in","readonly":true,"nullable":true,"type":[[["TextBasedChannels"]]],"meta":{"line":156,"file":"Interaction.js","path":"src/structures"}},{"name":"guild","description":"The guild this interaction was sent in","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":165,"file":"Interaction.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"deferReply","description":"Defers the reply to this interaction.","implements":["InteractionResponses#deferReply"],"examples":["// Defer the reply to this interaction\ninteraction.deferReply()\n .then(console.log)\n .catch(console.error)","// Defer to send an ephemeral reply later\ninteraction.deferReply({ ephemeral: true })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for deferring the reply to this interaction","optional":true,"type":[[["InteractionDeferReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":58,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"reply","description":"Creates a reply to this interaction.\nUse the `fetchReply` option to get the bot's reply message.","implements":["InteractionResponses#reply"],"examples":["// Reply to the interaction and fetch the response\ninteraction.reply({ content: 'Pong!', fetchReply: true })\n .then((message) => console.log(`Reply sent with content ${message.content}`))\n .catch(console.error);","// Create an ephemeral reply with an embed\nconst embed = new MessageEmbed().setDescription('Pong!');\n\ninteraction.reply({ embeds: [embed], ephemeral: true })\n .then(() => console.log('Reply sent.'))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":93,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"fetchReply","description":"Fetches a reply to this interaction.","see":["Webhook#fetchMessage"],"implements":["InteractionResponses#fetchReply"],"examples":["// Fetch the initial reply to this interaction\ninteraction.fetchReply()\n .then(reply => console.log(`Replied with ${reply.content}`))\n .catch(console.error);"],"params":[{"name":"message","description":"The response to fetch","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":127,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"editReply","description":"Edits a reply to this interaction.","see":["Webhook#editMessage"],"implements":["InteractionResponses#editReply"],"examples":["// Edit the initial reply to this interaction\ninteraction.editReply('New content')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The new options for the message","type":[[["string"]],[["MessagePayload"]],[["InteractionEditReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":148,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"deleteReply","description":"Deletes a reply to this interaction.","see":["Webhook#deleteMessage"],"implements":["InteractionResponses#deleteReply"],"examples":["// Delete the initial reply to this interaction\ninteraction.deleteReply()\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"message","description":"The response to delete","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":166,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"followUp","description":"Send a follow-up message to this interaction.","implements":["InteractionResponses#followUp"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":175,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"deferUpdate","description":"Defers an update to the message to which the component was attached.","implements":["InteractionResponses#deferUpdate"],"examples":["// Defer updating and reset the component's loading state\ninteraction.deferUpdate()\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for deferring the update to this interaction","optional":true,"type":[[["InteractionDeferUpdateOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":190,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"update","description":"Updates the original message of the component on which the interaction was received on.","implements":["InteractionResponses#update"],"examples":["// Remove the components from the message\ninteraction.update({\n content: \"A component interaction was received\",\n components: []\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the updated message","type":[[["string"]],[["MessagePayload"]],[["InteractionUpdateOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":216,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"showModal","description":"Shows a modal component","implements":["InteractionResponses#showModal"],"params":[{"name":"modal","description":"The modal to show","type":[[["Modal"]],[["ModalOptions"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":243,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"awaitModalSubmit","description":"Collects a single modal submit interaction that passes the filter.\nThe Promise will reject if the time expires.","implements":["InteractionResponses#awaitModalSubmit"],"examples":["// Collect a modal submit interaction\nconst filter = (interaction) => interaction.customId === 'modal';\ninteraction.awaitModalSubmit({ filter, time: 15_000 })\n .then(interaction => console.log(`${interaction.customId} was submitted!`))\n .catch(console.error);"],"params":[{"name":"options","description":"Options to pass to the internal collector","type":[[["AwaitModalSubmitOptions"]]]}],"returns":[[["Promise","<"],["ModalSubmitInteraction",">"]]],"meta":{"line":275,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"inGuild","description":"Indicates whether this interaction is received from a guild.","inherits":"Interaction#inGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":173,"file":"Interaction.js","path":"src/structures"}},{"name":"inCachedGuild","description":"Indicates whether or not this interaction is both cached and received from a guild.","inherits":"Interaction#inCachedGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":181,"file":"Interaction.js","path":"src/structures"}},{"name":"inRawGuild","description":"Indicates whether or not this interaction is received from an uncached guild.","inherits":"Interaction#inRawGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":189,"file":"Interaction.js","path":"src/structures"}},{"name":"isApplicationCommand","description":"Indicates whether this interaction is a {@link BaseCommandInteraction}.","inherits":"Interaction#isApplicationCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":197,"file":"Interaction.js","path":"src/structures"}},{"name":"isCommand","description":"Indicates whether this interaction is a {@link CommandInteraction}.","inherits":"Interaction#isCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":205,"file":"Interaction.js","path":"src/structures"}},{"name":"isContextMenu","description":"Indicates whether this interaction is a {@link ContextMenuInteraction}","inherits":"Interaction#isContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":213,"file":"Interaction.js","path":"src/structures"}},{"name":"isModalSubmit","description":"Indicates whether this interaction is a {@link ModalSubmitInteraction}","inherits":"Interaction#isModalSubmit","inherited":true,"returns":[[["boolean"]]],"meta":{"line":221,"file":"Interaction.js","path":"src/structures"}},{"name":"isUserContextMenu","description":"Indicates whether this interaction is a {@link UserContextMenuInteraction}","inherits":"Interaction#isUserContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":229,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageContextMenu","description":"Indicates whether this interaction is a {@link MessageContextMenuInteraction}","inherits":"Interaction#isMessageContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":237,"file":"Interaction.js","path":"src/structures"}},{"name":"isAutocomplete","description":"Indicates whether this interaction is an {@link AutocompleteInteraction}","inherits":"Interaction#isAutocomplete","inherited":true,"returns":[[["boolean"]]],"meta":{"line":245,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageComponent","description":"Indicates whether this interaction is a {@link MessageComponentInteraction}.","inherits":"Interaction#isMessageComponent","inherited":true,"returns":[[["boolean"]]],"meta":{"line":253,"file":"Interaction.js","path":"src/structures"}},{"name":"isButton","description":"Indicates whether this interaction is a {@link ButtonInteraction}.","inherits":"Interaction#isButton","inherited":true,"returns":[[["boolean"]]],"meta":{"line":261,"file":"Interaction.js","path":"src/structures"}},{"name":"isSelectMenu","description":"Indicates whether this interaction is a {@link SelectMenuInteraction}.","inherits":"Interaction#isSelectMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":272,"file":"Interaction.js","path":"src/structures"}},{"name":"isRepliable","description":"Indicates whether this interaction can be replied to.","inherits":"Interaction#isRepliable","inherited":true,"returns":[[["boolean"]]],"meta":{"line":283,"file":"Interaction.js","path":"src/structures"}},{"name":"resolveType","description":"Resolves the type of a MessageComponent","scope":"static","access":"private","params":[{"name":"type","description":"The type to resolve","type":[[["MessageComponentTypeResolvable"]]]}],"returns":[[["MessageComponentType"]]],"meta":{"line":90,"file":"MessageComponentInteraction.js","path":"src/structures"}}],"meta":{"line":13,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"MessageContextMenuInteraction","description":"Represents a message context menu interaction.","extends":[[["ContextMenuInteraction"]]],"props":[{"name":"targetMessage","description":"The message this interaction was sent from","readonly":true,"type":[[["Message"]],[["APIMessage"]]],"meta":{"line":15,"file":"MessageContextMenuInteraction.js","path":"src/structures"}},{"name":"options","description":"The target of the interaction, parsed into options","type":[[["CommandInteractionOptionResolver"]]],"meta":{"line":18,"file":"ContextMenuInteraction.js","path":"src/structures"}},{"name":"targetId","description":"The id of the target of this interaction","type":[[["Snowflake"]]],"meta":{"line":28,"file":"ContextMenuInteraction.js","path":"src/structures"}},{"name":"targetType","description":"The type of the target of the interaction; either USER or MESSAGE","type":[[["ApplicationCommandType"]]],"meta":{"line":34,"file":"ContextMenuInteraction.js","path":"src/structures"}},{"name":"channelId","description":"The id of the channel this interaction was sent in","type":[[["Snowflake"]]],"meta":{"line":20,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"commandId","description":"The invoked application command's id","type":[[["Snowflake"]]],"meta":{"line":30,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"commandName","description":"The invoked application command's name","type":[[["string"]]],"meta":{"line":36,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"deferred","description":"Whether the reply to this interaction has been deferred","type":[[["boolean"]]],"meta":{"line":42,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"replied","description":"Whether this interaction has already been replied to","type":[[["boolean"]]],"meta":{"line":48,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"ephemeral","description":"Whether the reply to this interaction is ephemeral","nullable":true,"type":[[["boolean"]]],"meta":{"line":54,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"webhook","description":"An associated interaction webhook, can be used to further interact with this interaction","type":[[["InteractionWebhook"]]],"meta":{"line":60,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"command","description":"The invoked application command, if it was fetched before","nullable":true,"type":[[["ApplicationCommand"]]],"meta":{"line":67,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"type","description":"The interaction's type","type":[[["InteractionType"]]],"meta":{"line":20,"file":"Interaction.js","path":"src/structures"}},{"name":"id","description":"The interaction's id","type":[[["Snowflake"]]],"meta":{"line":26,"file":"Interaction.js","path":"src/structures"}},{"name":"token","description":"The interaction's token","readonly":true,"type":[[["string"]]],"meta":{"line":28,"file":"Interaction.js","path":"src/structures"}},{"name":"applicationId","description":"The application's id","type":[[["Snowflake"]]],"meta":{"line":40,"file":"Interaction.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild this interaction was sent in","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":52,"file":"Interaction.js","path":"src/structures"}},{"name":"user","description":"The user which sent this interaction","type":[[["User"]]],"meta":{"line":58,"file":"Interaction.js","path":"src/structures"}},{"name":"member","description":"If this interaction was sent in a guild, the member which sent it","nullable":true,"type":[[["GuildMember"]],[["APIGuildMember"]]],"meta":{"line":64,"file":"Interaction.js","path":"src/structures"}},{"name":"version","description":"The version","type":[[["number"]]],"meta":{"line":70,"file":"Interaction.js","path":"src/structures"}},{"name":"appPermissions","description":"Set of permissions the application or bot has within the channel the interaction was sent from","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":76,"file":"Interaction.js","path":"src/structures"}},{"name":"memberPermissions","description":"The permissions of the member, if one exists, in the channel this interaction was executed in","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":82,"file":"Interaction.js","path":"src/structures"}},{"name":"locale","description":"The locale of the user who invoked this interaction","type":[[["Locale"]]],"meta":{"line":124,"file":"Interaction.js","path":"src/structures"}},{"name":"guildLocale","description":"The preferred locale from the guild this interaction was sent in","nullable":true,"type":[[["Locale"]]],"meta":{"line":130,"file":"Interaction.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the interaction was created at","readonly":true,"type":[[["number"]]],"meta":{"line":138,"file":"Interaction.js","path":"src/structures"}},{"name":"createdAt","description":"The time the interaction was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":147,"file":"Interaction.js","path":"src/structures"}},{"name":"channel","description":"The channel this interaction was sent in","readonly":true,"nullable":true,"type":[[["TextBasedChannels"]]],"meta":{"line":156,"file":"Interaction.js","path":"src/structures"}},{"name":"guild","description":"The guild this interaction was sent in","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":165,"file":"Interaction.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"resolveContextMenuOptions","description":"Resolves and transforms options received from the API for a context menu interaction.","access":"private","inherits":"ContextMenuInteraction#resolveContextMenuOptions","inherited":true,"params":[{"name":"data","description":"The interaction data","type":[[["APIApplicationCommandInteractionData"]]]}],"returns":[[["Array","<"],["CommandInteractionOption",">"]]],"meta":{"line":43,"file":"ContextMenuInteraction.js","path":"src/structures"}},{"name":"transformResolved","description":"Transforms the resolved received from the API.","access":"private","inherits":"BaseCommandInteraction#transformResolved","inherited":true,"params":[{"name":"resolved","description":"The received resolved objects","type":[[["APIInteractionDataResolved"]]]}],"returns":[[["CommandInteractionResolvedData"]]],"meta":{"line":89,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"transformOption","description":"Transforms an option received from the API.","access":"private","inherits":"BaseCommandInteraction#transformOption","inherited":true,"params":[{"name":"option","description":"The received option","type":[[["APIApplicationCommandOption"]]]},{"name":"resolved","description":"The resolved interaction data","type":[[["APIInteractionDataResolved"]]]}],"returns":[[["CommandInteractionOption"]]],"meta":{"line":162,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"deferReply","description":"Defers the reply to this interaction.","inherits":"BaseCommandInteraction#deferReply","inherited":true,"implements":["InteractionResponses#deferReply"],"examples":["// Defer the reply to this interaction\ninteraction.deferReply()\n .then(console.log)\n .catch(console.error)","// Defer to send an ephemeral reply later\ninteraction.deferReply({ ephemeral: true })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for deferring the reply to this interaction","optional":true,"type":[[["InteractionDeferReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":58,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"reply","description":"Creates a reply to this interaction.\nUse the `fetchReply` option to get the bot's reply message.","inherits":"BaseCommandInteraction#reply","inherited":true,"implements":["InteractionResponses#reply"],"examples":["// Reply to the interaction and fetch the response\ninteraction.reply({ content: 'Pong!', fetchReply: true })\n .then((message) => console.log(`Reply sent with content ${message.content}`))\n .catch(console.error);","// Create an ephemeral reply with an embed\nconst embed = new MessageEmbed().setDescription('Pong!');\n\ninteraction.reply({ embeds: [embed], ephemeral: true })\n .then(() => console.log('Reply sent.'))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":93,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"fetchReply","description":"Fetches a reply to this interaction.","see":["Webhook#fetchMessage"],"inherits":"BaseCommandInteraction#fetchReply","inherited":true,"implements":["InteractionResponses#fetchReply"],"examples":["// Fetch the initial reply to this interaction\ninteraction.fetchReply()\n .then(reply => console.log(`Replied with ${reply.content}`))\n .catch(console.error);"],"params":[{"name":"message","description":"The response to fetch","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":127,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"editReply","description":"Edits a reply to this interaction.","see":["Webhook#editMessage"],"inherits":"BaseCommandInteraction#editReply","inherited":true,"implements":["InteractionResponses#editReply"],"examples":["// Edit the initial reply to this interaction\ninteraction.editReply('New content')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The new options for the message","type":[[["string"]],[["MessagePayload"]],[["InteractionEditReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":148,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"deleteReply","description":"Deletes a reply to this interaction.","see":["Webhook#deleteMessage"],"inherits":"BaseCommandInteraction#deleteReply","inherited":true,"implements":["InteractionResponses#deleteReply"],"examples":["// Delete the initial reply to this interaction\ninteraction.deleteReply()\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"message","description":"The response to delete","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":166,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"followUp","description":"Send a follow-up message to this interaction.","inherits":"BaseCommandInteraction#followUp","inherited":true,"implements":["InteractionResponses#followUp"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":175,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"showModal","description":"Shows a modal component","inherits":"BaseCommandInteraction#showModal","inherited":true,"implements":["InteractionResponses#showModal"],"params":[{"name":"modal","description":"The modal to show","type":[[["Modal"]],[["ModalOptions"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":243,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"awaitModalSubmit","description":"Collects a single modal submit interaction that passes the filter.\nThe Promise will reject if the time expires.","inherits":"BaseCommandInteraction#awaitModalSubmit","inherited":true,"implements":["InteractionResponses#awaitModalSubmit"],"examples":["// Collect a modal submit interaction\nconst filter = (interaction) => interaction.customId === 'modal';\ninteraction.awaitModalSubmit({ filter, time: 15_000 })\n .then(interaction => console.log(`${interaction.customId} was submitted!`))\n .catch(console.error);"],"params":[{"name":"options","description":"Options to pass to the internal collector","type":[[["AwaitModalSubmitOptions"]]]}],"returns":[[["Promise","<"],["ModalSubmitInteraction",">"]]],"meta":{"line":275,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"inGuild","description":"Indicates whether this interaction is received from a guild.","inherits":"Interaction#inGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":173,"file":"Interaction.js","path":"src/structures"}},{"name":"inCachedGuild","description":"Indicates whether or not this interaction is both cached and received from a guild.","inherits":"Interaction#inCachedGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":181,"file":"Interaction.js","path":"src/structures"}},{"name":"inRawGuild","description":"Indicates whether or not this interaction is received from an uncached guild.","inherits":"Interaction#inRawGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":189,"file":"Interaction.js","path":"src/structures"}},{"name":"isApplicationCommand","description":"Indicates whether this interaction is a {@link BaseCommandInteraction}.","inherits":"Interaction#isApplicationCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":197,"file":"Interaction.js","path":"src/structures"}},{"name":"isCommand","description":"Indicates whether this interaction is a {@link CommandInteraction}.","inherits":"Interaction#isCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":205,"file":"Interaction.js","path":"src/structures"}},{"name":"isContextMenu","description":"Indicates whether this interaction is a {@link ContextMenuInteraction}","inherits":"Interaction#isContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":213,"file":"Interaction.js","path":"src/structures"}},{"name":"isModalSubmit","description":"Indicates whether this interaction is a {@link ModalSubmitInteraction}","inherits":"Interaction#isModalSubmit","inherited":true,"returns":[[["boolean"]]],"meta":{"line":221,"file":"Interaction.js","path":"src/structures"}},{"name":"isUserContextMenu","description":"Indicates whether this interaction is a {@link UserContextMenuInteraction}","inherits":"Interaction#isUserContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":229,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageContextMenu","description":"Indicates whether this interaction is a {@link MessageContextMenuInteraction}","inherits":"Interaction#isMessageContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":237,"file":"Interaction.js","path":"src/structures"}},{"name":"isAutocomplete","description":"Indicates whether this interaction is an {@link AutocompleteInteraction}","inherits":"Interaction#isAutocomplete","inherited":true,"returns":[[["boolean"]]],"meta":{"line":245,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageComponent","description":"Indicates whether this interaction is a {@link MessageComponentInteraction}.","inherits":"Interaction#isMessageComponent","inherited":true,"returns":[[["boolean"]]],"meta":{"line":253,"file":"Interaction.js","path":"src/structures"}},{"name":"isButton","description":"Indicates whether this interaction is a {@link ButtonInteraction}.","inherits":"Interaction#isButton","inherited":true,"returns":[[["boolean"]]],"meta":{"line":261,"file":"Interaction.js","path":"src/structures"}},{"name":"isSelectMenu","description":"Indicates whether this interaction is a {@link SelectMenuInteraction}.","inherits":"Interaction#isSelectMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":272,"file":"Interaction.js","path":"src/structures"}},{"name":"isRepliable","description":"Indicates whether this interaction can be replied to.","inherits":"Interaction#isRepliable","inherited":true,"returns":[[["boolean"]]],"meta":{"line":283,"file":"Interaction.js","path":"src/structures"}}],"meta":{"line":9,"file":"MessageContextMenuInteraction.js","path":"src/structures"}},{"name":"MessageEmbed","description":"Represents an embed in a message (image/video preview, rich embed, etc.)","construct":{"name":"MessageEmbed","params":[{"name":"data","description":"MessageEmbed to clone or raw embed data","optional":true,"default":"{}","type":[[["MessageEmbed"]],[["MessageEmbedOptions"]],[["APIEmbed"]]]}]},"props":[{"name":"type","description":"The type of this embed, either:\n* `rich` - a generic embed rendered from embed attributes\n* `image` - an image embed\n* `video` - a video embed\n* `gifv` - an animated gif image embed rendered as a video embed\n* `article` - an article embed\n* `link` - a link embed","see":["{@link https://discord.com/developers/docs/resources/channel#embed-object-embed-types}"],"deprecated":true,"type":[[["string"]]],"meta":{"line":61,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"title","description":"The title of this embed","nullable":true,"type":[[["string"]]],"meta":{"line":67,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"description","description":"The description of this embed","nullable":true,"type":[[["string"]]],"meta":{"line":73,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"url","description":"The URL of this embed","nullable":true,"type":[[["string"]]],"meta":{"line":79,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"color","description":"The color of this embed","nullable":true,"type":[[["number"]]],"meta":{"line":85,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"timestamp","description":"The timestamp of this embed","nullable":true,"type":[[["number"]]],"meta":{"line":91,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"fields","description":"The fields of this embed","type":[[["Array","<"],["EmbedField",">"]]],"meta":{"line":105,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"thumbnail","description":"The thumbnail of this embed (if there is one)","nullable":true,"type":[[["MessageEmbedThumbnail"]]],"meta":{"line":123,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"image","description":"The image of this embed, if there is one","nullable":true,"type":[[["MessageEmbedImage"]]],"meta":{"line":145,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"video","description":"The video of this embed (if there is one)","readonly":true,"nullable":true,"type":[[["MessageEmbedVideo"]]],"meta":{"line":168,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"author","description":"The author of this embed (if there is one)","nullable":true,"type":[[["MessageEmbedAuthor"]]],"meta":{"line":190,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"provider","description":"The provider of this embed (if there is one)","nullable":true,"type":[[["MessageEmbedProvider"]]],"meta":{"line":210,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"footer","description":"The footer of this embed","nullable":true,"type":[[["MessageEmbedFooter"]]],"meta":{"line":229,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"createdAt","description":"The date displayed on this embed","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":243,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"hexColor","description":"The hexadecimal version of the embed color, with a leading hash","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":252,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"length","description":"The accumulated length for the embed title, description, fields, footer text, and author name","readonly":true,"type":[[["number"]]],"meta":{"line":261,"file":"MessageEmbed.js","path":"src/structures"}}],"methods":[{"name":"equals","description":"Checks if this embed is equal to another one by comparing every single one of their properties.","params":[{"name":"embed","description":"The embed to compare with","type":[[["MessageEmbed"]],[["APIEmbed"]]]}],"returns":[[["boolean"]]],"meta":{"line":278,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"_fieldEquals","description":"Compares two given embed fields to see if they are equal","access":"private","params":[{"name":"field","description":"The first field to compare","type":[[["EmbedFieldData"]]]},{"name":"other","description":"The second field to compare","type":[[["EmbedFieldData"]]]}],"returns":[[["boolean"]]],"meta":{"line":308,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"addField","description":"Adds a field to the embed (max 25).","deprecated":"This method is a wrapper for {@link MessageEmbed#addFields}. Use that instead.","params":[{"name":"name","description":"The name of this field","type":[[["string"]]]},{"name":"value","description":"The value of this field","type":[[["string"]]]},{"name":"inline","description":"If this field will be displayed inline","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":[[["MessageEmbed"]]],"meta":{"line":320,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"addFields","description":"Adds fields to the embed (max 25).","params":[{"name":"fields","description":"The fields to add","variable":true,"type":[[["EmbedFieldData"]],[["Array","<"],["EmbedFieldData",">"]]]}],"returns":[[["MessageEmbed"]]],"meta":{"line":338,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"spliceFields","description":"Removes, replaces, and inserts fields in the embed (max 25).","params":[{"name":"index","description":"The index to start at","type":[[["number"]]]},{"name":"deleteCount","description":"The number of fields to remove","type":[[["number"]]]},{"name":"fields","description":"The replacing field objects","optional":true,"variable":true,"type":[[["EmbedFieldData"]],[["Array","<"],["EmbedFieldData",">"]]]}],"returns":[[["MessageEmbed"]]],"meta":{"line":350,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"setFields","description":"Sets the embed's fields (max 25).","params":[{"name":"fields","description":"The fields to set","variable":true,"type":[[["EmbedFieldData"]],[["Array","<"],["EmbedFieldData",">"]]]}],"returns":[[["MessageEmbed"]]],"meta":{"line":360,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"setAuthor","description":"Sets the author of this embed.","params":[{"name":"options","description":"The options to provide for the author.\nProvide `null` to remove the author data.","type":[[["string"]],[["EmbedAuthorData"]],[["null"]]]},{"name":"deprecatedIconURL","description":"The icon URL of this author.\nThis parameter is **deprecated**. Use the `options` parameter instead.","optional":true,"type":[[["string"]]]},{"name":"deprecatedURL","description":"The URL of this author.\nThis parameter is **deprecated**. Use the `options` parameter instead.","optional":true,"type":[[["string"]]]}],"returns":[[["MessageEmbed"]]],"meta":{"line":383,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"setColor","description":"Sets the color of this embed.","params":[{"name":"color","description":"The color of the embed","type":[[["ColorResolvable"]]]}],"returns":[[["MessageEmbed"]]],"meta":{"line":412,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"setDescription","description":"Sets the description of this embed.","params":[{"name":"description","description":"The description","type":[[["string"]]]}],"returns":[[["MessageEmbed"]]],"meta":{"line":422,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"setFooter","description":"Sets the footer of this embed.","params":[{"name":"options","description":"The options to provide for the footer.\nProvide `null` to remove the footer data.","type":[[["string"]],[["EmbedFooterData"]],[["null"]]]},{"name":"deprecatedIconURL","description":"The icon URL of this footer.\nThis parameter is **deprecated**. Use the `options` parameter instead.","optional":true,"type":[[["string"]]]}],"returns":[[["MessageEmbed"]]],"meta":{"line":442,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"setImage","description":"Sets the image of this embed.","params":[{"name":"url","description":"The URL of the image","type":[[["string"]]]}],"returns":[[["MessageEmbed"]]],"meta":{"line":471,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"setThumbnail","description":"Sets the thumbnail of this embed.","params":[{"name":"url","description":"The URL of the thumbnail","type":[[["string"]]]}],"returns":[[["MessageEmbed"]]],"meta":{"line":481,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"setTimestamp","description":"Sets the timestamp of this embed.","params":[{"name":"timestamp","description":"The timestamp or date.\nIf `null` then the timestamp will be unset (i.e. when editing an existing {@link MessageEmbed})","optional":true,"default":"Date.now()","type":[[["Date"]],[["number"]],[["null"]]]}],"returns":[[["MessageEmbed"]]],"meta":{"line":492,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"setTitle","description":"Sets the title of this embed.","params":[{"name":"title","description":"The title","type":[[["string"]]]}],"returns":[[["MessageEmbed"]]],"meta":{"line":503,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"setURL","description":"Sets the URL of this embed.","params":[{"name":"url","description":"The URL","type":[[["string"]]]}],"returns":[[["MessageEmbed"]]],"meta":{"line":513,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"toJSON","description":"Transforms the embed to a plain object.","returns":{"types":[[["APIEmbed"]]],"description":"The raw data of this embed"},"meta":{"line":522,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"normalizeField","description":"Normalizes field input and verifies strings.","scope":"static","params":[{"name":"name","description":"The name of the field","type":[[["string"]]]},{"name":"value","description":"The value of the field","type":[[["string"]]]},{"name":"inline","description":"Set the field to display inline","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":[[["EmbedField"]]],"meta":{"line":562,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"normalizeFields","description":"Normalizes field input and resolves strings.","scope":"static","params":[{"name":"fields","description":"Fields to normalize","variable":true,"type":[[["EmbedFieldData"]],[["Array","<"],["EmbedFieldData",">"]]]}],"returns":[[["Array","<"],["EmbedField",">"]]],"meta":{"line":582,"file":"MessageEmbed.js","path":"src/structures"}}],"meta":{"line":16,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"MessageMentions","description":"Keeps track of mentions in a {@link Message}.","props":[{"name":"everyone","description":"Whether `@everyone` or `@here` were mentioned","type":[[["boolean"]]],"meta":{"line":38,"file":"MessageMentions.js","path":"src/structures"}},{"name":"users","description":"Any users that were mentioned\nOrder as received from the API, not as they appear in the message content","type":[[["Collection","<"],["Snowflake",", "],["User",">"]]],"meta":{"line":47,"file":"MessageMentions.js","path":"src/structures"}},{"name":"roles","description":"Any roles that were mentioned\nOrder as received from the API, not as they appear in the message content","type":[[["Collection","<"],["Snowflake",", "],["Role",">"]]],"meta":{"line":68,"file":"MessageMentions.js","path":"src/structures"}},{"name":"_members","description":"Cached members for {@link MessageMentions#members}","access":"private","nullable":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":87,"file":"MessageMentions.js","path":"src/structures"}},{"name":"_channels","description":"Cached channels for {@link MessageMentions#channels}","access":"private","nullable":true,"type":[[["Collection","<"],["Snowflake",", "],["Channel",">"]]],"meta":{"line":94,"file":"MessageMentions.js","path":"src/structures"}},{"name":"_parsedUsers","description":"Cached users for {@link MessageMentions#parsedUsers}","access":"private","nullable":true,"type":[[["Collection","<"],["Snowflake",", "],["User",">"]]],"meta":{"line":101,"file":"MessageMentions.js","path":"src/structures"}},{"name":"crosspostedChannels","description":"A collection of crossposted channels\nOrder as received from the API, not as they appear in the message content","type":[[["Collection","<"],["Snowflake",", "],["CrosspostedChannel",">"]]],"meta":{"line":119,"file":"MessageMentions.js","path":"src/structures"}},{"name":"repliedUser","description":"The author of the message that this message is a reply to","nullable":true,"type":[[["User"]]],"meta":{"line":141,"file":"MessageMentions.js","path":"src/structures"}},{"name":"members","description":"Any members that were mentioned (only in {@link Guild}s)\nOrder as received from the API, not as they appear in the message content","readonly":true,"nullable":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":150,"file":"MessageMentions.js","path":"src/structures"}},{"name":"channels","description":"Any channels that were mentioned\nOrder as they appear first in the message content","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["Channel",">"]]],"meta":{"line":167,"file":"MessageMentions.js","path":"src/structures"}},{"name":"parsedUsers","description":"Any user mentions that were included in the message content\nOrder as they appear first in the message content","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["User",">"]]],"meta":{"line":184,"file":"MessageMentions.js","path":"src/structures"}},{"name":"EVERYONE_PATTERN","description":"Regular expression that globally matches `@everyone` and `@here`","scope":"static","type":[[["RegExp"]]],"meta":{"line":253,"file":"MessageMentions.js","path":"src/structures"}},{"name":"USERS_PATTERN","description":"Regular expression that globally matches user mentions like `<@81440962496172032>`","scope":"static","type":[[["RegExp"]]],"meta":{"line":259,"file":"MessageMentions.js","path":"src/structures"}},{"name":"ROLES_PATTERN","description":"Regular expression that globally matches role mentions like `<@&297577916114403338>`","scope":"static","type":[[["RegExp"]]],"meta":{"line":265,"file":"MessageMentions.js","path":"src/structures"}},{"name":"CHANNELS_PATTERN","description":"Regular expression that globally matches channel mentions like `<#222079895583457280>`","scope":"static","type":[[["RegExp"]]],"meta":{"line":271,"file":"MessageMentions.js","path":"src/structures"}}],"methods":[{"name":"has","description":"Checks if a user, guild member, thread member, role, or channel is mentioned.\nTakes into account user mentions, role mentions, channel mentions,\nreplied user mention, and `@everyone`/`@here` mentions.","params":[{"name":"data","description":"The User/Role/Channel to check for","type":[[["UserResolvable"]],[["RoleResolvable"]],[["ChannelResolvable"]]]},{"name":"options","description":"The options for the check","optional":true,"type":[[["MessageMentionsHasOptions"]]]}],"returns":[[["boolean"]]],"meta":{"line":212,"file":"MessageMentions.js","path":"src/structures"}}],"meta":{"line":10,"file":"MessageMentions.js","path":"src/structures"}},{"name":"MessagePayload","description":"Represents a message to be sent to the API.","construct":{"name":"MessagePayload","params":[{"name":"target","description":"The target for this message to be sent to","type":[[["MessageTarget"]]]},{"name":"options","description":"Options passed in from send","type":[[["MessageOptions"]],[["WebhookMessageOptions"]]]}]},"props":[{"name":"target","description":"The target for this message to be sent to","type":[[["MessageTarget"]]],"meta":{"line":27,"file":"MessagePayload.js","path":"src/structures"}},{"name":"options","description":"Options passed in from send","type":[[["MessageOptions"]],[["WebhookMessageOptions"]]],"meta":{"line":33,"file":"MessagePayload.js","path":"src/structures"}},{"name":"data","description":"Data sendable to the API","nullable":true,"type":[[["APIMessage"]]],"meta":{"line":39,"file":"MessagePayload.js","path":"src/structures"}},{"name":"files","description":"Files sendable to the API","nullable":true,"type":[[["Array","<"],["MessageFile",">"]]],"meta":{"line":52,"file":"MessagePayload.js","path":"src/structures"}},{"name":"isWebhook","description":"Whether or not the target is a {@link Webhook} or a {@link WebhookClient}","readonly":true,"type":[[["boolean"]]],"meta":{"line":60,"file":"MessagePayload.js","path":"src/structures"}},{"name":"isUser","description":"Whether or not the target is a {@link User}","readonly":true,"type":[[["boolean"]]],"meta":{"line":71,"file":"MessagePayload.js","path":"src/structures"}},{"name":"isMessage","description":"Whether or not the target is a {@link Message}","readonly":true,"type":[[["boolean"]]],"meta":{"line":82,"file":"MessagePayload.js","path":"src/structures"}},{"name":"isMessageManager","description":"Whether or not the target is a {@link MessageManager}","readonly":true,"type":[[["boolean"]]],"meta":{"line":92,"file":"MessagePayload.js","path":"src/structures"}},{"name":"isInteraction","description":"Whether or not the target is an {@link Interaction} or an {@link InteractionWebhook}","readonly":true,"type":[[["boolean"]]],"meta":{"line":102,"file":"MessagePayload.js","path":"src/structures"}}],"methods":[{"name":"makeContent","description":"Makes the content of this message.","returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":112,"file":"MessagePayload.js","path":"src/structures"}},{"name":"resolveData","description":"Resolves data.","returns":[[["MessagePayload"]]],"meta":{"line":127,"file":"MessagePayload.js","path":"src/structures"}},{"name":"resolveFiles","description":"Resolves files.","async":true,"returns":[[["Promise","<"],["MessagePayload",">"]]],"meta":{"line":279,"file":"MessagePayload.js","path":"src/structures"}},{"name":"resolveFile","description":"Resolves a single file into an object sendable to the API.","scope":"static","params":[{"name":"fileLike","description":"Something that could be resolved to a file","type":[[["BufferResolvable"]],[["Stream"]],[["FileOptions"]],[["MessageAttachment"]]]}],"async":true,"returns":[[["Promise","<"],["MessageFile",">"]]],"meta":{"line":291,"file":"MessagePayload.js","path":"src/structures"}},{"name":"create","description":"Creates a {@link MessagePayload} from user-level arguments.","scope":"static","params":[{"name":"target","description":"Target to send to","type":[[["MessageTarget"]]]},{"name":"options","description":"Options or content to use","type":[[["string"]],[["MessageOptions"]],[["WebhookMessageOptions"]]]},{"name":"extra","description":"Extra options to add onto specified options","optional":true,"default":"{}","type":[[["MessageOptions"]],[["WebhookMessageOptions"]]]}],"returns":[[["MessagePayload"]]],"meta":{"line":335,"file":"MessagePayload.js","path":"src/structures"}}],"meta":{"line":17,"file":"MessagePayload.js","path":"src/structures"}},{"name":"MessageReaction","description":"Represents a reaction to a message.","props":[{"name":"client","description":"The client that instantiated this message reaction","readonly":true,"type":[[["Client"]]],"meta":{"line":13,"file":"MessageReaction.js","path":"src/structures"}},{"name":"message","description":"The message that this reaction refers to","type":[[["Message"]]],"meta":{"line":25,"file":"MessageReaction.js","path":"src/structures"}},{"name":"me","description":"Whether the client has given this reaction","type":[[["boolean"]]],"meta":{"line":31,"file":"MessageReaction.js","path":"src/structures"}},{"name":"meBurst","description":"Whether the client has super-reacted using this emoji","type":[[["boolean"]]],"meta":{"line":37,"file":"MessageReaction.js","path":"src/structures"}},{"name":"users","description":"A manager of the users that have given this reaction","type":[[["ReactionUserManager"]]],"meta":{"line":43,"file":"MessageReaction.js","path":"src/structures"}},{"name":"burstColors","description":"Hexadecimal colors used for this super reaction","nullable":true,"type":[[["Array","<"],["string",">"]]],"meta":{"line":58,"file":"MessageReaction.js","path":"src/structures"}},{"name":"count","description":"The number of people that have given the same reaction","nullable":true,"type":[[["number"]]],"meta":{"line":66,"file":"MessageReaction.js","path":"src/structures"}},{"name":"countDetails","description":"The reaction count details object contains information about super and normal reaction counts.","type":[[["ReactionCountDetailsData"]]],"meta":{"line":81,"file":"MessageReaction.js","path":"src/structures"}},{"name":"emoji","description":"The emoji of this reaction. Either a {@link GuildEmoji} object for known custom emojis, or a {@link ReactionEmoji}\nobject which has fewer properties. Whatever the prototype of the emoji, it will still have\n`name`, `id`, `identifier` and `toString()`","readonly":true,"type":[[["GuildEmoji"]],[["ReactionEmoji"]]],"meta":{"line":110,"file":"MessageReaction.js","path":"src/structures"}},{"name":"partial","description":"Whether or not this reaction is a partial","readonly":true,"type":[[["boolean"]]],"meta":{"line":129,"file":"MessageReaction.js","path":"src/structures"}}],"methods":[{"name":"remove","description":"Removes all users from this reaction.","async":true,"returns":[[["Promise","<"],["MessageReaction",">"]]],"meta":{"line":94,"file":"MessageReaction.js","path":"src/structures"}},{"name":"fetch","description":"Fetch this reaction.","async":true,"returns":[[["Promise","<"],["MessageReaction",">"]]],"meta":{"line":137,"file":"MessageReaction.js","path":"src/structures"}}],"meta":{"line":11,"file":"MessageReaction.js","path":"src/structures"}},{"name":"MessageSelectMenu","description":"Represents a select menu message component","extends":[[["BaseMessageComponent"]]],"construct":{"name":"MessageSelectMenu","params":[{"name":"data","description":"MessageSelectMenu to clone or raw data","optional":true,"default":"{}","type":[[["MessageSelectMenu"]],[["MessageSelectMenuOptions"]]]}]},"props":[{"name":"customId","description":"A unique string to be sent in the interaction when clicked","nullable":true,"type":[[["string"]]],"meta":{"line":56,"file":"MessageSelectMenu.js","path":"src/structures"}},{"name":"placeholder","description":"Custom placeholder text to display when nothing is selected","nullable":true,"type":[[["string"]]],"meta":{"line":62,"file":"MessageSelectMenu.js","path":"src/structures"}},{"name":"minValues","description":"The minimum number of selections required","nullable":true,"type":[[["number"]]],"meta":{"line":68,"file":"MessageSelectMenu.js","path":"src/structures"}},{"name":"maxValues","description":"The maximum number of selections allowed","nullable":true,"type":[[["number"]]],"meta":{"line":74,"file":"MessageSelectMenu.js","path":"src/structures"}},{"name":"options","description":"Options for the STRING_SELECT menu","type":[[["Array","<"],["MessageSelectOption",">"]]],"meta":{"line":80,"file":"MessageSelectMenu.js","path":"src/structures"}},{"name":"disabled","description":"Whether this select menu is currently disabled","type":[[["boolean"]]],"meta":{"line":86,"file":"MessageSelectMenu.js","path":"src/structures"}},{"name":"channelTypes","description":"Channels that are possible to select in CHANNEL_SELECT menu","type":[[["Array","<"],["ChannelType",">"]]],"meta":{"line":92,"file":"MessageSelectMenu.js","path":"src/structures"}},{"name":"type","description":"The type of this component","nullable":true,"type":[[["MessageComponentType"]]],"meta":{"line":52,"file":"BaseMessageComponent.js","path":"src/structures"}},{"name":"data","description":"The data for this component","type":[[["MessageComponentOptions"]]],"meta":{"line":60,"file":"BaseMessageComponent.js","path":"src/structures"}},{"name":"id","description":"The id of this component","readonly":true,"type":[[["number"]]],"meta":{"line":68,"file":"BaseMessageComponent.js","path":"src/structures"}}],"methods":[{"name":"toJSON","description":"Transforms the select menu into a plain object","returns":{"types":[[["APIMessageSelectMenu"]]],"description":"The raw data of this select menu"},"meta":{"line":102,"file":"MessageSelectMenu.js","path":"src/structures"}},{"name":"normalizeOption","description":"Normalizes option input and resolves strings and emojis.","scope":"static","params":[{"name":"option","description":"The select menu option to normalize","type":[[["MessageSelectOptionData"]]]}],"returns":[[["MessageSelectOption"]]],"meta":{"line":120,"file":"MessageSelectMenu.js","path":"src/structures"}},{"name":"normalizeOptions","description":"Normalizes option input and resolves strings and emojis.","scope":"static","params":[{"name":"options","description":"The select menu options to normalize","variable":true,"type":[[["MessageSelectOptionData"]],[["Array","<"],["MessageSelectOptionData",">"]]]}],"returns":[[["Array","<"],["MessageSelectOption",">"]]],"meta":{"line":136,"file":"MessageSelectMenu.js","path":"src/structures"}}],"meta":{"line":11,"file":"MessageSelectMenu.js","path":"src/structures"}},{"name":"Modal","description":"Represents a modal (form) to be shown in response to an interaction","construct":{"name":"Modal","params":[{"name":"data","description":"Modal to clone or raw data","type":[[["Object"]]]},{"name":"client","description":"The client constructing this Modal, if provided","default":null,"type":[[["Client"]]]}]},"props":[{"name":"components","description":"A list of MessageActionRows in the modal","type":[[["Array","<"],["MessageActionRow",">"]]],"meta":{"line":21,"file":"Modal.js","path":"src/structures"}},{"name":"customId","description":"A unique string to be sent in the interaction when submitted","nullable":true,"type":[[["string"]]],"meta":{"line":27,"file":"Modal.js","path":"src/structures"}},{"name":"title","description":"The title to be displayed on this modal","nullable":true,"type":[[["string"]]],"meta":{"line":33,"file":"Modal.js","path":"src/structures"}},{"name":"nonce","description":"Timestamp (Discord epoch) of when this modal was created","type":[[["Snowflake"]]],"meta":{"line":39,"file":"Modal.js","path":"src/structures"}},{"name":"id","description":"ID slash / button / menu when modal is displayed","type":[[["Snowflake"]]],"meta":{"line":45,"file":"Modal.js","path":"src/structures"}},{"name":"applicationId","description":"Application sending the modal","type":[[["Snowflake"]]],"meta":{"line":51,"file":"Modal.js","path":"src/structures"}},{"name":"channelId","description":"The id of the channel the message was sent in","type":[[["Snowflake"]]],"meta":{"line":57,"file":"Modal.js","path":"src/structures"}},{"name":"replied","description":"Whether this interaction has already been replied to","type":[[["boolean"]]],"meta":{"line":63,"file":"Modal.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild the message was sent in, if any","readonly":true,"nullable":true,"type":[[["Snowflake"]]],"meta":{"line":76,"file":"Modal.js","path":"src/structures"}},{"name":"channel","description":"The channel that the message was sent in","readonly":true,"type":[[["TextBasedChannels"]]],"meta":{"line":85,"file":"Modal.js","path":"src/structures"}},{"name":"guild","description":"The guild the message was sent in (if in a guild channel)","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":94,"file":"Modal.js","path":"src/structures"}},{"name":"isMessage","description":"Check data","readonly":true,"type":[[["boolean"]]],"meta":{"line":156,"file":"Modal.js","path":"src/structures"}}],"methods":[{"name":"reply","description":"Reply to this modal with data. (Event only)","examples":["client.on('interactionModalCreate', modal => {\n // Modal > ActionRow > TextInput\n modal.components[0].components[0].setValue('1+1');\n modal.components[1].components[0].setValue('hello');\n modal.reply();\n})"],"returns":[[["Promise","<("],["Message","|"],["Modal",")>"]]],"meta":{"line":118,"file":"Modal.js","path":"src/structures"}}],"meta":{"line":11,"file":"Modal.js","path":"src/structures"}},{"name":"ModalSubmitFieldsResolver","description":"A resolver for modal submit interaction text inputs.","props":[{"name":"components","description":"The components within the modal","type":[[["Array","<"],["PartialModalActionRow",">"]]],"meta":{"line":15,"file":"ModalSubmitFieldsResolver.js","path":"src/structures"}},{"name":"_fields","description":"The extracted fields from the modal","access":"private","type":[[["Array","<"],["PartialInputTextData",">"]]],"meta":{"line":23,"file":"ModalSubmitFieldsResolver.js","path":"src/structures"}}],"methods":[{"name":"getField","description":"Gets a field given a custom id from a component","params":[{"name":"customId","description":"The custom id of the component","type":[[["string"]]]}],"returns":{"types":[[["PartialInputTextData"]]],"nullable":true},"meta":{"line":32,"file":"ModalSubmitFieldsResolver.js","path":"src/structures"}},{"name":"getTextInputValue","description":"Gets the value of a text input component given a custom id","params":[{"name":"customId","description":"The custom id of the text input component","type":[[["string"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":43,"file":"ModalSubmitFieldsResolver.js","path":"src/structures"}}],"meta":{"line":9,"file":"ModalSubmitFieldsResolver.js","path":"src/structures"}},{"name":"ModalSubmitInteraction","description":"Represents a modal submit interaction.","extends":[[["Interaction"]]],"implements":[[["InteractionResponses"]]],"props":[{"name":"customId","description":"The custom id of the modal.","type":[[["string"]]],"meta":{"line":22,"file":"ModalSubmitInteraction.js","path":"src/structures"}},{"name":"components","description":"The inputs within the modal","type":[[["Array","<"],["PartialModalActionRow",">"]]],"meta":{"line":41,"file":"ModalSubmitInteraction.js","path":"src/structures"}},{"name":"message","description":"The message associated with this interaction","type":[[["Message"]],[["APIMessage"]],[["null"]]],"meta":{"line":51,"file":"ModalSubmitInteraction.js","path":"src/structures"}},{"name":"fields","description":"The fields within the modal","type":[[["ModalSubmitFieldsResolver"]]],"meta":{"line":57,"file":"ModalSubmitInteraction.js","path":"src/structures"}},{"name":"deferred","description":"Whether the reply to this interaction has been deferred","type":[[["boolean"]]],"meta":{"line":63,"file":"ModalSubmitInteraction.js","path":"src/structures"}},{"name":"ephemeral","description":"Whether the reply to this interaction is ephemeral","nullable":true,"type":[[["boolean"]]],"meta":{"line":69,"file":"ModalSubmitInteraction.js","path":"src/structures"}},{"name":"replied","description":"Whether this interaction has already been replied to","type":[[["boolean"]]],"meta":{"line":75,"file":"ModalSubmitInteraction.js","path":"src/structures"}},{"name":"webhook","description":"An associated interaction webhook, can be used to further interact with this interaction","type":[[["InteractionWebhook"]]],"meta":{"line":81,"file":"ModalSubmitInteraction.js","path":"src/structures"}},{"name":"type","description":"The interaction's type","type":[[["InteractionType"]]],"meta":{"line":20,"file":"Interaction.js","path":"src/structures"}},{"name":"id","description":"The interaction's id","type":[[["Snowflake"]]],"meta":{"line":26,"file":"Interaction.js","path":"src/structures"}},{"name":"token","description":"The interaction's token","readonly":true,"type":[[["string"]]],"meta":{"line":28,"file":"Interaction.js","path":"src/structures"}},{"name":"applicationId","description":"The application's id","type":[[["Snowflake"]]],"meta":{"line":40,"file":"Interaction.js","path":"src/structures"}},{"name":"channelId","description":"The id of the channel this interaction was sent in","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":46,"file":"Interaction.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild this interaction was sent in","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":52,"file":"Interaction.js","path":"src/structures"}},{"name":"user","description":"The user which sent this interaction","type":[[["User"]]],"meta":{"line":58,"file":"Interaction.js","path":"src/structures"}},{"name":"member","description":"If this interaction was sent in a guild, the member which sent it","nullable":true,"type":[[["GuildMember"]],[["APIGuildMember"]]],"meta":{"line":64,"file":"Interaction.js","path":"src/structures"}},{"name":"version","description":"The version","type":[[["number"]]],"meta":{"line":70,"file":"Interaction.js","path":"src/structures"}},{"name":"appPermissions","description":"Set of permissions the application or bot has within the channel the interaction was sent from","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":76,"file":"Interaction.js","path":"src/structures"}},{"name":"memberPermissions","description":"The permissions of the member, if one exists, in the channel this interaction was executed in","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":82,"file":"Interaction.js","path":"src/structures"}},{"name":"locale","description":"The locale of the user who invoked this interaction","type":[[["Locale"]]],"meta":{"line":124,"file":"Interaction.js","path":"src/structures"}},{"name":"guildLocale","description":"The preferred locale from the guild this interaction was sent in","nullable":true,"type":[[["Locale"]]],"meta":{"line":130,"file":"Interaction.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the interaction was created at","readonly":true,"type":[[["number"]]],"meta":{"line":138,"file":"Interaction.js","path":"src/structures"}},{"name":"createdAt","description":"The time the interaction was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":147,"file":"Interaction.js","path":"src/structures"}},{"name":"channel","description":"The channel this interaction was sent in","readonly":true,"nullable":true,"type":[[["TextBasedChannels"]]],"meta":{"line":156,"file":"Interaction.js","path":"src/structures"}},{"name":"guild","description":"The guild this interaction was sent in","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":165,"file":"Interaction.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"isFromMessage","description":"Whether this is from a {@link MessageComponentInteraction}.","returns":[[["boolean"]]],"meta":{"line":101,"file":"ModalSubmitInteraction.js","path":"src/structures"}},{"name":"deferReply","description":"Defers the reply to this interaction.","implements":["InteractionResponses#deferReply"],"examples":["// Defer the reply to this interaction\ninteraction.deferReply()\n .then(console.log)\n .catch(console.error)","// Defer to send an ephemeral reply later\ninteraction.deferReply({ ephemeral: true })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for deferring the reply to this interaction","optional":true,"type":[[["InteractionDeferReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":58,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"reply","description":"Creates a reply to this interaction.\nUse the `fetchReply` option to get the bot's reply message.","implements":["InteractionResponses#reply"],"examples":["// Reply to the interaction and fetch the response\ninteraction.reply({ content: 'Pong!', fetchReply: true })\n .then((message) => console.log(`Reply sent with content ${message.content}`))\n .catch(console.error);","// Create an ephemeral reply with an embed\nconst embed = new MessageEmbed().setDescription('Pong!');\n\ninteraction.reply({ embeds: [embed], ephemeral: true })\n .then(() => console.log('Reply sent.'))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":93,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"fetchReply","description":"Fetches a reply to this interaction.","see":["Webhook#fetchMessage"],"implements":["InteractionResponses#fetchReply"],"examples":["// Fetch the initial reply to this interaction\ninteraction.fetchReply()\n .then(reply => console.log(`Replied with ${reply.content}`))\n .catch(console.error);"],"params":[{"name":"message","description":"The response to fetch","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":127,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"editReply","description":"Edits a reply to this interaction.","see":["Webhook#editMessage"],"implements":["InteractionResponses#editReply"],"examples":["// Edit the initial reply to this interaction\ninteraction.editReply('New content')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The new options for the message","type":[[["string"]],[["MessagePayload"]],[["InteractionEditReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":148,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"deleteReply","description":"Deletes a reply to this interaction.","see":["Webhook#deleteMessage"],"implements":["InteractionResponses#deleteReply"],"examples":["// Delete the initial reply to this interaction\ninteraction.deleteReply()\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"message","description":"The response to delete","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":166,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"followUp","description":"Send a follow-up message to this interaction.","implements":["InteractionResponses#followUp"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":175,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"deferUpdate","description":"Defers an update to the message to which the component was attached.","implements":["InteractionResponses#deferUpdate"],"examples":["// Defer updating and reset the component's loading state\ninteraction.deferUpdate()\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for deferring the update to this interaction","optional":true,"type":[[["InteractionDeferUpdateOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":190,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"update","description":"Updates the original message of the component on which the interaction was received on.","implements":["InteractionResponses#update"],"examples":["// Remove the components from the message\ninteraction.update({\n content: \"A component interaction was received\",\n components: []\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the updated message","type":[[["string"]],[["MessagePayload"]],[["InteractionUpdateOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":216,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"inGuild","description":"Indicates whether this interaction is received from a guild.","inherits":"Interaction#inGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":173,"file":"Interaction.js","path":"src/structures"}},{"name":"inCachedGuild","description":"Indicates whether or not this interaction is both cached and received from a guild.","inherits":"Interaction#inCachedGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":181,"file":"Interaction.js","path":"src/structures"}},{"name":"inRawGuild","description":"Indicates whether or not this interaction is received from an uncached guild.","inherits":"Interaction#inRawGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":189,"file":"Interaction.js","path":"src/structures"}},{"name":"isApplicationCommand","description":"Indicates whether this interaction is a {@link BaseCommandInteraction}.","inherits":"Interaction#isApplicationCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":197,"file":"Interaction.js","path":"src/structures"}},{"name":"isCommand","description":"Indicates whether this interaction is a {@link CommandInteraction}.","inherits":"Interaction#isCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":205,"file":"Interaction.js","path":"src/structures"}},{"name":"isContextMenu","description":"Indicates whether this interaction is a {@link ContextMenuInteraction}","inherits":"Interaction#isContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":213,"file":"Interaction.js","path":"src/structures"}},{"name":"isModalSubmit","description":"Indicates whether this interaction is a {@link ModalSubmitInteraction}","inherits":"Interaction#isModalSubmit","inherited":true,"returns":[[["boolean"]]],"meta":{"line":221,"file":"Interaction.js","path":"src/structures"}},{"name":"isUserContextMenu","description":"Indicates whether this interaction is a {@link UserContextMenuInteraction}","inherits":"Interaction#isUserContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":229,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageContextMenu","description":"Indicates whether this interaction is a {@link MessageContextMenuInteraction}","inherits":"Interaction#isMessageContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":237,"file":"Interaction.js","path":"src/structures"}},{"name":"isAutocomplete","description":"Indicates whether this interaction is an {@link AutocompleteInteraction}","inherits":"Interaction#isAutocomplete","inherited":true,"returns":[[["boolean"]]],"meta":{"line":245,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageComponent","description":"Indicates whether this interaction is a {@link MessageComponentInteraction}.","inherits":"Interaction#isMessageComponent","inherited":true,"returns":[[["boolean"]]],"meta":{"line":253,"file":"Interaction.js","path":"src/structures"}},{"name":"isButton","description":"Indicates whether this interaction is a {@link ButtonInteraction}.","inherits":"Interaction#isButton","inherited":true,"returns":[[["boolean"]]],"meta":{"line":261,"file":"Interaction.js","path":"src/structures"}},{"name":"isSelectMenu","description":"Indicates whether this interaction is a {@link SelectMenuInteraction}.","inherits":"Interaction#isSelectMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":272,"file":"Interaction.js","path":"src/structures"}},{"name":"isRepliable","description":"Indicates whether this interaction can be replied to.","inherits":"Interaction#isRepliable","inherited":true,"returns":[[["boolean"]]],"meta":{"line":283,"file":"Interaction.js","path":"src/structures"}},{"name":"transformComponent","description":"Transforms component data to discord.js-compatible data","scope":"static","params":[{"name":"rawComponent","description":"The data to transform","type":[["*"]]}],"returns":[[["Array","<"],["PartialTextInputData",">"]]],"meta":{"line":89,"file":"ModalSubmitInteraction.js","path":"src/structures"}}],"meta":{"line":14,"file":"ModalSubmitInteraction.js","path":"src/structures"}},{"name":"NewsChannel","description":"Represents a guild news channel on Discord.","extends":[[["BaseGuildTextChannel"]]],"props":[{"name":"messages","description":"A manager of the messages sent to this channel","type":[[["MessageManager"]]],"meta":{"line":21,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"threads","description":"A manager of the threads belonging to this channel","type":[[["GuildTextThreadManager"]]],"meta":{"line":27,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"nsfw","description":"If the guild considers this channel NSFW","type":[[["boolean"]]],"meta":{"line":33,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"topic","description":"The topic of the text channel","nullable":true,"type":[[["string"]]],"meta":{"line":46,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"lastMessageId","description":"The last message id sent in the channel, if one was sent","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":58,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"lastPinTimestamp","description":"The timestamp when the last pinned message was pinned, if there was one","nullable":true,"type":[[["number"]]],"meta":{"line":66,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"defaultAutoArchiveDuration","description":"The default auto archive duration for newly created threads in this channel","nullable":true,"type":[[["number"]]],"meta":{"line":74,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"defaultThreadRateLimitPerUser","description":"The initial rate limit per user (slowmode) to set on newly created threads in a channel.","nullable":true,"type":[[["number"]]],"meta":{"line":82,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"lastMessage","description":"The Message object of the last message in the channel, if one was sent","readonly":true,"nullable":true,"type":[[["Message"]]],"meta":{"line":51,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"lastPinAt","description":"The date when the last pinned message was pinned, if there was one","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":60,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"guild","description":"The guild the channel is in","type":[[["Guild"]]],"meta":{"line":31,"file":"GuildChannel.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild the channel is in","type":[[["Snowflake"]]],"meta":{"line":37,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionOverwrites","description":"A manager of permission overwrites that belong to this channel","type":[[["PermissionOverwriteManager"]]],"meta":{"line":44,"file":"GuildChannel.js","path":"src/structures"}},{"name":"name","description":"The name of the guild channel","type":[[["string"]]],"meta":{"line":57,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rawPosition","description":"The raw position of the channel from Discord","type":[[["number"]]],"meta":{"line":65,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parentId","description":"The id of the category parent of this channel","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":77,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parent","description":"The category parent of this channel","readonly":true,"nullable":true,"type":[[["CategoryChannel"]]],"meta":{"line":99,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionsLocked","description":"If the permissionOverwrites match the parent channel, null if no parent","readonly":true,"nullable":true,"type":[[["boolean"]]],"meta":{"line":108,"file":"GuildChannel.js","path":"src/structures"}},{"name":"position","description":"The position of the channel","readonly":true,"type":[[["number"]]],"meta":{"line":149,"file":"GuildChannel.js","path":"src/structures"}},{"name":"members","description":"A collection of cached members of this channel, mapped by their ids.\nMembers that can view this channel, if the channel is text-based.\nMembers in the channel, if the channel is voice-based.","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":276,"file":"GuildChannel.js","path":"src/structures"}},{"name":"deletable","description":"Whether the channel is deletable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":418,"file":"GuildChannel.js","path":"src/structures"}},{"name":"manageable","description":"Whether the channel is manageable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":427,"file":"GuildChannel.js","path":"src/structures"}},{"name":"viewable","description":"Whether the channel is viewable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":447,"file":"GuildChannel.js","path":"src/structures"}},{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the channel was created at","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"Channel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the channel was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":79,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"partial","description":"Whether this Channel is a partial\nThis is always false outside of DM channels.","readonly":true,"type":[[["boolean"]]],"meta":{"line":119,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"addFollower","description":"Adds the target to this channel's followers.\nIf you need the created webhook id, use {@link GuildChannelManager#addFollower}.","examples":["if (channel.type === 'GUILD_NEWS') {\n channel.addFollower('222197033908436994', 'Important announcements')\n .then(() => console.log('Added follower'))\n .catch(console.error);\n}"],"params":[{"name":"channel","description":"The channel where the webhook should be created","type":[[["TextChannelResolvable"]]]},{"name":"reason","description":"Reason for creating the webhook","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["NewsChannel",">"]]],"meta":{"line":24,"file":"NewsChannel.js","path":"src/structures"}},{"name":"setDefaultAutoArchiveDuration","description":"Sets the default auto archive duration for all newly created threads in this channel.","inherits":"BaseGuildTextChannel#setDefaultAutoArchiveDuration","inherited":true,"params":[{"name":"defaultAutoArchiveDuration","description":"The new default auto archive duration","type":[[["ThreadAutoArchiveDuration"]]]},{"name":"reason","description":"Reason for changing the channel's default auto archive duration","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["TextChannel",">"]]],"meta":{"line":98,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"setType","description":"Sets the type of this channel (only conversion between text and news is supported)","inherits":"BaseGuildTextChannel#setType","inherited":true,"params":[{"name":"type","description":"The new channel type","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the channel's type","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":108,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"setTopic","description":"Sets a new topic for the guild channel.","inherits":"BaseGuildTextChannel#setTopic","inherited":true,"examples":["// Set a new channel topic\nchannel.setTopic('needs more rate limiting')\n .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))\n .catch(console.error);"],"params":[{"name":"topic","description":"The new topic for the guild channel","nullable":true,"type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's topic","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":123,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"createInvite","description":"Creates an invite to this guild channel.","inherits":"BaseGuildTextChannel#createInvite","inherited":true,"examples":["// Create an invite to a channel\nchannel.createInvite()\n .then(invite => console.log(`Created an invite with a code of ${invite.code}`))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for creating the invite","optional":true,"default":"{}","type":[[["CreateInviteOptions"]]]}],"returns":[[["Promise","<"],["Invite",">"]]],"meta":{"line":161,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"fetchInvites","description":"Fetches a collection of invites to this guild channel.\nResolves with a collection mapping invites by their codes.","inherits":"BaseGuildTextChannel#fetchInvites","inherited":true,"params":[{"name":"cache","description":"Whether or not to cache the fetched invites","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Collection","<"],["string",", "],["Invite",">>"]]],"meta":{"line":171,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"send","description":"Sends a message to this channel.","inherits":"BaseGuildTextChannel#send","inherited":true,"implements":["TextBasedChannel#send"],"examples":["// Send a basic message\nchannel.send('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.error);","// Send a remote file\nchannel.send({\n files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']\n})\n .then(console.log)\n .catch(console.error);","// Send a local file\nchannel.send({\n files: [{\n attachment: 'entire/path/to/file.jpg',\n name: 'file.jpg',\n description: 'A description of the file'\n }]\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["MessageOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":181,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"sendTyping","description":"Sends a typing indicator in the channel.","inherits":"BaseGuildTextChannel#sendTyping","inherited":true,"implements":["TextBasedChannel#sendTyping"],"examples":["// Start typing in a channel\nchannel.sendTyping();"],"returns":{"types":[[["Promise","<({"],["message_send_cooldown_ms",": "],["number",", "],["thread_create_cooldown_ms",": "],["number","}|"],["void",")>"]]],"description":"Resolves upon the typing status being sent"},"meta":{"line":395,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createMessageCollector","description":"Creates a Message Collector.","inherits":"BaseGuildTextChannel#createMessageCollector","inherited":true,"implements":["TextBasedChannel#createMessageCollector"],"examples":["// Create a message collector\nconst filter = m => m.content.includes('discord');\nconst collector = channel.createMessageCollector({ filter, time: 15_000 });\ncollector.on('collect', m => console.log(`Collected ${m.content}`));\ncollector.on('end', collected => console.log(`Collected ${collected.size} items`));"],"params":[{"name":"options","description":"The options to pass to the collector","optional":true,"default":"{}","type":[[["MessageCollectorOptions"]]]}],"returns":[[["MessageCollector"]]],"meta":{"line":410,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"awaitMessages","description":"Similar to createMessageCollector but in promise form.\nResolves with a collection of messages that pass the specified filter.","inherits":"BaseGuildTextChannel#awaitMessages","inherited":true,"implements":["TextBasedChannel#awaitMessages"],"examples":["// Await !vote messages\nconst filter = m => m.content.startsWith('!vote');\n// Errors: ['time'] treats ending because of the time limit as an error\nchannel.awaitMessages({ filter, max: 4, time: 60_000, errors: ['time'] })\n .then(collected => console.log(collected.size))\n .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));"],"params":[{"name":"options","description":"Optional options to pass to the internal collector","optional":true,"default":"{}","type":[[["AwaitMessagesOptions"]]]}],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Message",">>"]]],"meta":{"line":433,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"fetchWebhooks","description":"Fetches all webhooks for the channel.","inherits":"BaseGuildTextChannel#fetchWebhooks","inherited":true,"implements":["TextBasedChannel#fetchWebhooks"],"examples":["// Fetch webhooks\nchannel.fetchWebhooks()\n .then(hooks => console.log(`This channel has ${hooks.size} hooks`))\n .catch(console.error);"],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Webhook",">>"]]],"meta":{"line":455,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createWebhook","description":"Creates a webhook for the channel.","inherits":"BaseGuildTextChannel#createWebhook","inherited":true,"implements":["TextBasedChannel#createWebhook"],"examples":["// Create a webhook for the current channel\nchannel.createWebhook('Snek', {\n avatar: 'https://i.imgur.com/mI8XcpG.jpg',\n reason: 'Needed a cool new Webhook'\n})\n .then(console.log)\n .catch(console.error)"],"params":[{"name":"name","description":"The name of the webhook","type":[[["string"]]]},{"name":"options","description":"Options for creating the webhook","optional":true,"type":[[["ChannelWebhookCreateOptions"]]]}],"returns":{"types":[[["Promise","<"],["Webhook",">"]]],"description":"Returns the created Webhook"},"meta":{"line":480,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setRateLimitPerUser","description":"Sets the rate limit per user (slowmode) for this channel.","inherits":"BaseGuildTextChannel#setRateLimitPerUser","inherited":true,"implements":["TextBasedChannel#setRateLimitPerUser"],"params":[{"name":"rateLimitPerUser","description":"The new rate limit in seconds","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the channel's rate limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":490,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setNSFW","description":"Sets whether this channel is flagged as NSFW.","inherits":"BaseGuildTextChannel#setNSFW","inherited":true,"implements":["TextBasedChannel#setNSFW"],"params":[{"name":"nsfw","description":"Whether the channel should be considered NSFW","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for changing the channel's NSFW flag","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":500,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"permissionsFor","description":"Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.","inherits":"GuildChannel#permissionsFor","inherited":true,"params":[{"name":"memberOrRole","description":"The member or role to obtain the overall permissions for","type":[[["GuildMemberResolvable"]],[["RoleResolvable"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":{"types":[[["Readonly","<"],["Permissions",">"]]],"nullable":true},"meta":{"line":173,"file":"GuildChannel.js","path":"src/structures"}},{"name":"memberPermissions","description":"Gets the overall set of permissions for a member in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#memberPermissions","inherited":true,"params":[{"name":"member","description":"The member to obtain the overall permissions for","type":[[["GuildMember"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","default":true,"type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":213,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rolePermissions","description":"Gets the overall set of permissions for a role in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#rolePermissions","inherited":true,"params":[{"name":"role","description":"The role to obtain the overall permissions for","type":[[["Role"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":242,"file":"GuildChannel.js","path":"src/structures"}},{"name":"lockPermissions","description":"Locks in the permission overwrites from the parent channel.","inherits":"GuildChannel#lockPermissions","inherited":true,"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":263,"file":"GuildChannel.js","path":"src/structures"}},{"name":"edit","description":"Edits the channel.","inherits":"GuildChannel#edit","inherited":true,"examples":["// Edit a channel\nchannel.edit({ name: 'new-channel' })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"data","description":"The new data for the channel","type":[[["ChannelData"]]]},{"name":"reason","description":"Reason for editing this channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":291,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setName","description":"Sets a new name for the guild channel.","inherits":"GuildChannel#setName","inherited":true,"examples":["// Set a new channel name\nchannel.setName('not_general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.error);"],"params":[{"name":"name","description":"The new name for the guild channel","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":306,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setParent","description":"Sets the parent of this channel.","inherits":"GuildChannel#setParent","inherited":true,"examples":["// Add a parent to a channel\nmessage.channel.setParent('355908108431917066', { lockPermissions: false })\n .then(channel => console.log(`New parent of ${message.channel.name}: ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"channel","description":"The category channel to set as the parent","nullable":true,"type":[[["CategoryChannelResolvable"]]]},{"name":"options","description":"The options for setting the parent","optional":true,"default":"{}","type":[[["SetParentOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":328,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setPosition","description":"Sets a new position for the guild channel.","inherits":"GuildChannel#setPosition","inherited":true,"examples":["// Set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.error);"],"params":[{"name":"position","description":"The new position for the guild channel","type":[[["number"]]]},{"name":"options","description":"Options for setting position","optional":true,"type":[[["SetChannelPositionOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":356,"file":"GuildChannel.js","path":"src/structures"}},{"name":"clone","description":"Clones this channel.","inherits":"GuildChannel#clone","inherited":true,"params":[{"name":"options","description":"The options for cloning this channel","optional":true,"type":[[["GuildChannelCloneOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":371,"file":"GuildChannel.js","path":"src/structures"}},{"name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites, and id as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","inherits":"GuildChannel#equals","inherited":true,"params":[{"name":"channel","description":"Channel to compare with","type":[[["GuildChannel"]]]}],"returns":[[["boolean"]]],"meta":{"line":393,"file":"GuildChannel.js","path":"src/structures"}},{"name":"delete","description":"Deletes this channel.","inherits":"GuildChannel#delete","inherited":true,"examples":["// Delete the channel\nchannel.delete('making room for new channels')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"reason","description":"Reason for deleting this channel","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":464,"file":"GuildChannel.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.","inherits":"Channel#toString","inherited":true,"examples":["// Logs: Hello from <#123456789012345678>!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":130,"file":"Channel.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this channel.","inherits":"Channel#fetch","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":153,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","inherits":"Channel#isText","inherited":true,"returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","inherits":"Channel#isVoice","inherited":true,"returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","inherits":"Channel#isThread","inherited":true,"returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","inherits":"Channel#isThreadOnly","inherited":true,"returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","inherits":"Channel#isDirectory","inherited":true,"returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":10,"file":"NewsChannel.js","path":"src/structures"}},{"name":"OAuth2Guild","description":"A partial guild received when using {@link GuildManager#fetch} to fetch multiple guilds.","extends":[[["BaseGuild"]]],"props":[{"name":"owner","description":"Whether the client user is the owner of the guild","type":[[["boolean"]]],"meta":{"line":18,"file":"OAuth2Guild.js","path":"src/structures"}},{"name":"permissions","description":"The permissions that the client user has in this guild","type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":24,"file":"OAuth2Guild.js","path":"src/structures"}},{"name":"id","description":"The guild's id","type":[[["Snowflake"]]],"meta":{"line":19,"file":"BaseGuild.js","path":"src/structures"}},{"name":"name","description":"The name of this guild","type":[[["string"]]],"meta":{"line":25,"file":"BaseGuild.js","path":"src/structures"}},{"name":"icon","description":"The icon hash of this guild","nullable":true,"type":[[["string"]]],"meta":{"line":31,"file":"BaseGuild.js","path":"src/structures"}},{"name":"features","description":"An array of features available to this guild","type":[[["Array","<"],["Features",">"]]],"meta":{"line":37,"file":"BaseGuild.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp this guild was created at","readonly":true,"type":[[["number"]]],"meta":{"line":45,"file":"BaseGuild.js","path":"src/structures"}},{"name":"createdAt","description":"The time this guild was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":54,"file":"BaseGuild.js","path":"src/structures"}},{"name":"nameAcronym","description":"The acronym that shows up in place of a guild icon","readonly":true,"type":[[["string"]]],"meta":{"line":63,"file":"BaseGuild.js","path":"src/structures"}},{"name":"partnered","description":"Whether this guild is partnered","readonly":true,"type":[[["boolean"]]],"meta":{"line":75,"file":"BaseGuild.js","path":"src/structures"}},{"name":"verified","description":"Whether this guild is verified","readonly":true,"type":[[["boolean"]]],"meta":{"line":84,"file":"BaseGuild.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"iconURL","description":"The URL to this guild's icon.","inherits":"BaseGuild#iconURL","inherited":true,"params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["ImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":93,"file":"BaseGuild.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this guild.","inherits":"BaseGuild#fetch","inherited":true,"async":true,"returns":[[["Promise","<"],["Guild",">"]]],"meta":{"line":102,"file":"BaseGuild.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the guild's name instead of the Guild object.","inherits":"BaseGuild#toString","inherited":true,"returns":[[["string"]]],"meta":{"line":111,"file":"BaseGuild.js","path":"src/structures"}}],"meta":{"line":10,"file":"OAuth2Guild.js","path":"src/structures"}},{"name":"PermissionOverwrites","description":"Represents a permission overwrite for a role or member in a guild channel.","extends":[[["Base"]]],"props":[{"name":"channel","description":"The GuildChannel this overwrite is for","readonly":true,"type":[[["GuildChannel"]]],"meta":{"line":17,"file":"PermissionOverwrites.js","path":"src/structures"}},{"name":"id","description":"The overwrite's id, either a {@link User} or a {@link Role} id","type":[[["Snowflake"]]],"meta":{"line":33,"file":"PermissionOverwrites.js","path":"src/structures"}},{"name":"type","description":"The type of this overwrite","type":[[["OverwriteType"]]],"meta":{"line":40,"file":"PermissionOverwrites.js","path":"src/structures"}},{"name":"deny","description":"The permissions that are denied for the user or role.","type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":48,"file":"PermissionOverwrites.js","path":"src/structures"}},{"name":"allow","description":"The permissions that are allowed for the user or role.","type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":56,"file":"PermissionOverwrites.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"edit","description":"Edits this Permission Overwrite.","examples":["// Update permission overwrites\npermissionOverwrites.edit({\n SEND_MESSAGES: false\n})\n .then(channel => console.log(channel.permissionOverwrites.get(message.author.id)))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the update","type":[[["PermissionOverwriteOptions"]]]},{"name":"reason","description":"Reason for creating/editing this overwrite","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["PermissionOverwrites",">"]]],"meta":{"line":73,"file":"PermissionOverwrites.js","path":"src/structures"}},{"name":"delete","description":"Deletes this Permission Overwrite.","params":[{"name":"reason","description":"Reason for deleting this overwrite","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["PermissionOverwrites",">"]]],"meta":{"line":83,"file":"PermissionOverwrites.js","path":"src/structures"}},{"name":"resolveOverwriteOptions","description":"Resolves bitfield permissions overwrites from an object.","scope":"static","params":[{"name":"options","description":"The options for the update","type":[[["PermissionOverwriteOptions"]]]},{"name":"initialPermissions","description":"The initial permissions","type":[[["ResolvedOverwriteOptions"]]]}],"returns":[[["ResolvedOverwriteOptions"]]],"meta":{"line":121,"file":"PermissionOverwrites.js","path":"src/structures"}},{"name":"resolve","description":"Resolves an overwrite into {@link RawOverwriteData}.","scope":"static","params":[{"name":"overwrite","description":"The overwrite-like data to resolve","type":[[["OverwriteResolvable"]]]},{"name":"guild","description":"The guild to resolve from","optional":true,"type":[[["Guild"]]]}],"returns":[[["RawOverwriteData"]]],"meta":{"line":172,"file":"PermissionOverwrites.js","path":"src/structures"}}],"meta":{"line":13,"file":"PermissionOverwrites.js","path":"src/structures"}},{"name":"Poll","description":"Represents a Poll","extends":[[["Base"]]],"props":[{"name":"message","description":"The message that started this poll","readonly":true,"type":[[["Message"]]],"meta":{"line":17,"file":"Poll.js","path":"src/structures"}},{"name":"question","description":"The media for this poll's question","type":[[["PollQuestionMedia"]]],"meta":{"line":36,"file":"Poll.js","path":"src/structures"}},{"name":"answers","description":"The answers of this poll","type":[[["Collection","<"],["number",", "],["PollAnswer",">"]]],"meta":{"line":44,"file":"Poll.js","path":"src/structures"}},{"name":"expiresTimestamp","description":"The timestamp when this poll expires","type":[[["number"]]],"meta":{"line":53,"file":"Poll.js","path":"src/structures"}},{"name":"allowMultiselect","description":"Whether this poll allows multiple answers","type":[[["boolean"]]],"meta":{"line":59,"file":"Poll.js","path":"src/structures"}},{"name":"layoutType","description":"The layout type of this poll","type":[[["PollLayoutType"]]],"meta":{"line":65,"file":"Poll.js","path":"src/structures"}},{"name":"resultsFinalized","description":"Whether this poll's results have been precisely counted","type":[[["boolean"]]],"meta":{"line":76,"file":"Poll.js","path":"src/structures"}},{"name":"expiresAt","description":"The date when this poll expires","readonly":true,"type":[[["Date"]]],"meta":{"line":92,"file":"Poll.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"end","description":"Ends this poll.","async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":100,"file":"Poll.js","path":"src/structures"}}],"meta":{"line":13,"file":"Poll.js","path":"src/structures"}},{"name":"PollAnswer","description":"Represents an answer to a {@link Poll}","extends":[[["Base"]]],"props":[{"name":"poll","description":"The {@link Poll} this answer is part of","readonly":true,"type":[[["Poll"]]],"meta":{"line":14,"file":"PollAnswer.js","path":"src/structures"}},{"name":"id","description":"The id of this answer","type":[[["number"]]],"meta":{"line":26,"file":"PollAnswer.js","path":"src/structures"}},{"name":"text","description":"The text of this answer","nullable":true,"type":[[["string"]]],"meta":{"line":32,"file":"PollAnswer.js","path":"src/structures"}},{"name":"_emoji","description":"The raw emoji of this answer","access":"private","nullable":true,"type":[[["APIPartialEmoji"]]],"meta":{"line":34,"file":"PollAnswer.js","path":"src/structures"}},{"name":"voteCount","description":"The amount of votes this answer has","type":[[["number"]]],"meta":{"line":52,"file":"PollAnswer.js","path":"src/structures"}},{"name":"emoji","description":"The emoji of this answer","nullable":true,"type":[[["GuildEmoji"]],[["Emoji"]]],"meta":{"line":62,"file":"PollAnswer.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"fetchVoters","description":"Fetches the users that voted for this answer","params":[{"name":"options","description":"The options for fetching voters","optional":true,"default":"{}","type":[[["FetchPollVotersOptions"]]]}],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["User",">>"]]],"meta":{"line":78,"file":"PollAnswer.js","path":"src/structures"}}],"meta":{"line":10,"file":"PollAnswer.js","path":"src/structures"}},{"name":"Presence","description":"Represents a user's presence.","extends":[[["Base"]]],"props":[{"name":"userId","description":"The presence's user id","type":[[["Snowflake"]]],"meta":{"line":45,"file":"Presence.js","path":"src/structures"}},{"name":"guild","description":"The guild this presence is in","nullable":true,"type":[[["Guild"]]],"meta":{"line":51,"file":"Presence.js","path":"src/structures"}},{"name":"user","description":"The user of this presence","readonly":true,"nullable":true,"type":[[["User"]]],"meta":{"line":61,"file":"Presence.js","path":"src/structures"}},{"name":"member","description":"The member of this presence","readonly":true,"nullable":true,"type":[[["GuildMember"]]],"meta":{"line":70,"file":"Presence.js","path":"src/structures"}},{"name":"status","description":"The status of this presence","type":[[["PresenceStatus"]]],"meta":{"line":80,"file":"Presence.js","path":"src/structures"}},{"name":"activities","description":"The activities of this presence (Always `Activity[]` if not ClientUser)","type":[[["Array","<"],["CustomStatus",">"]],[["Array","<"],["RichPresence",">"]],[["Array","<"],["SpotifyRPC",">"]],[["Array","<"],["Activity",">"]]],"meta":{"line":90,"file":"Presence.js","path":"src/structures"}},{"name":"clientStatus","description":"The devices this presence is on","nullable":true,"type":[[["Object"]]],"props":[{"name":"web","description":"The current presence in the web application","nullable":true,"type":[[["ClientPresenceStatus"]]]},{"name":"mobile","description":"The current presence in the mobile application","nullable":true,"type":[[["ClientPresenceStatus"]]]},{"name":"desktop","description":"The current presence in the desktop application","nullable":true,"type":[[["ClientPresenceStatus"]]]}],"meta":{"line":115,"file":"Presence.js","path":"src/structures"}},{"name":"lastModified","description":"The timestamp this presence was last updated","type":[[["number"]]],"meta":{"line":125,"file":"Presence.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"equals","description":"Whether this presence is equal to another.","params":[{"name":"presence","description":"The presence to compare with","type":[[["Presence"]]]}],"returns":[[["boolean"]]],"meta":{"line":154,"file":"Presence.js","path":"src/structures"}}],"meta":{"line":37,"file":"Presence.js","path":"src/structures"}},{"name":"Activity","description":"Represents an activity that is part of a user's presence.","props":[{"name":"presence","description":"The presence of the Activity","readonly":true,"type":[[["Presence"]]],"meta":{"line":193,"file":"Presence.js","path":"src/structures"}},{"name":"id","description":"The activity's id","type":[[["string"]]],"meta":{"line":210,"file":"Presence.js","path":"src/structures"}},{"name":"name","description":"The activity's name","type":[[["string"]]],"meta":{"line":218,"file":"Presence.js","path":"src/structures"}},{"name":"type","description":"The activity status's type","type":[[["ActivityType"]]],"meta":{"line":226,"file":"Presence.js","path":"src/structures"}},{"name":"url","description":"If the activity is being streamed, a link to the stream","nullable":true,"type":[[["string"]]],"meta":{"line":234,"file":"Presence.js","path":"src/structures"}},{"name":"createdTimestamp","description":"Creation date of the activity","type":[[["number"]]],"meta":{"line":244,"file":"Presence.js","path":"src/structures"}},{"name":"sessionId","description":"The game's or Spotify session's id","nullable":true,"type":[[["string"]]],"meta":{"line":252,"file":"Presence.js","path":"src/structures"}},{"name":"platform","description":"The platform the game is being played on","nullable":true,"type":[[["ActivityPlatform"]]],"meta":{"line":262,"file":"Presence.js","path":"src/structures"}},{"name":"timestamps","description":"Timestamps for the activity","nullable":true,"type":[[["ActivityTimestamps"]]],"meta":{"line":279,"file":"Presence.js","path":"src/structures"}},{"name":"applicationId","description":"The id of the application associated with this activity","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":292,"file":"Presence.js","path":"src/structures"}},{"name":"details","description":"Details about the activity","nullable":true,"type":[[["string"]]],"meta":{"line":302,"file":"Presence.js","path":"src/structures"}},{"name":"state","description":"State of the activity","nullable":true,"type":[[["string"]]],"meta":{"line":312,"file":"Presence.js","path":"src/structures"}},{"name":"syncId","description":"The sync id of the activity\nThis property is not documented by Discord and represents the track id in spotify activities.","nullable":true,"type":[[["string"]]],"meta":{"line":323,"file":"Presence.js","path":"src/structures"}},{"name":"flags","description":"Flags that describe the activity","type":[[["Readonly","<"],["ActivityFlags",">"]]],"meta":{"line":333,"file":"Presence.js","path":"src/structures"}},{"name":"buttons","description":"The labels of the buttons of this rich presence","type":[[["Array","<"],["string",">"]]],"meta":{"line":343,"file":"Presence.js","path":"src/structures"}},{"name":"emoji","description":"Emoji for a custom activity","nullable":true,"type":[[["EmojiIdentifierResolvable"]]],"meta":{"line":353,"file":"Presence.js","path":"src/structures"}},{"name":"party","description":"Party of the activity","nullable":true,"type":[[["ActivityParty"]]],"meta":{"line":370,"file":"Presence.js","path":"src/structures"}},{"name":"assets","description":"Assets for rich presence","nullable":true,"type":[[["RichPresenceAssets"]]],"meta":{"line":379,"file":"Presence.js","path":"src/structures"}},{"name":"createdAt","description":"The time the activity was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":406,"file":"Presence.js","path":"src/structures"}}],"methods":[{"name":"equals","description":"Whether this activity is equal to another activity.","params":[{"name":"activity","description":"The activity to compare with","type":[[["Activity"]]]}],"returns":[[["boolean"]]],"meta":{"line":387,"file":"Presence.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the activities' name instead of the Activity object.","returns":[[["string"]]],"meta":{"line":414,"file":"Presence.js","path":"src/structures"}}],"meta":{"line":188,"file":"Presence.js","path":"src/structures"}},{"name":"RichPresenceAssets","description":"Assets for a rich presence","props":[{"name":"activity","description":"The activity of the RichPresenceAssets","readonly":true,"type":[[["Activity"]]],"meta":{"line":435,"file":"Presence.js","path":"src/structures"}},{"name":"largeText","description":"Hover text for the large image","nullable":true,"type":[[["string"]]],"meta":{"line":452,"file":"Presence.js","path":"src/structures"}},{"name":"smallText","description":"Hover text for the small image","nullable":true,"type":[[["string"]]],"meta":{"line":462,"file":"Presence.js","path":"src/structures"}},{"name":"largeImage","description":"The large image asset's id","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":472,"file":"Presence.js","path":"src/structures"}},{"name":"smallImage","description":"The small image asset's id","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":482,"file":"Presence.js","path":"src/structures"}}],"methods":[{"name":"smallImageURL","description":"Gets the URL of the small image asset","params":[{"name":"options","description":"Options for the image URL","optional":true,"type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":493,"file":"Presence.js","path":"src/structures"}},{"name":"largeImageURL","description":"Gets the URL of the large image asset","params":[{"name":"options","description":"Options for the image URL","optional":true,"type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":522,"file":"Presence.js","path":"src/structures"}},{"name":"setLargeImage","description":"Set the large image of this activity","params":[{"name":"image","description":"The large image asset's id","nullable":true,"type":[[["RichPresenceImage"]]]}],"returns":[[["RichPresenceAssets"]]],"meta":{"line":597,"file":"Presence.js","path":"src/structures"}},{"name":"setSmallImage","description":"Set the small image of this activity","params":[{"name":"image","description":"The small image asset's id","nullable":true,"type":[[["RichPresenceImage"]]]}],"returns":[[["RichPresenceAssets"]]],"meta":{"line":608,"file":"Presence.js","path":"src/structures"}},{"name":"setLargeText","description":"Hover text for the large image","params":[{"name":"text","description":"Assets text","type":[[["string"]]]}],"returns":[[["RichPresenceAssets"]]],"meta":{"line":619,"file":"Presence.js","path":"src/structures"}},{"name":"setSmallText","description":"Hover text for the small image","params":[{"name":"text","description":"Assets text","type":[[["string"]]]}],"returns":[[["RichPresenceAssets"]]],"meta":{"line":629,"file":"Presence.js","path":"src/structures"}}],"meta":{"line":433,"file":"Presence.js","path":"src/structures"}},{"name":"CustomStatus","construct":{"name":"CustomStatus","params":[{"name":"client","description":"Discord Client","type":[[["Client"]]]},{"name":"data","description":"CustomStatus to clone or raw data","optional":true,"default":"{}","type":[[["CustomStatus"]],[["CustomStatusOptions"]]]}]},"methods":[{"name":"setEmoji","description":"Set the emoji of this activity","params":[{"name":"emoji","description":"The emoji to be displayed","type":[[["EmojiIdentifierResolvable"]]]}],"returns":[[["CustomStatus"]]],"meta":{"line":660,"file":"Presence.js","path":"src/structures"}},{"name":"setState","description":"Set state of this activity","params":[{"name":"state","description":"The state to be displayed","type":[[["string"]],[["null"]]]}],"returns":[[["CustomStatus"]]],"meta":{"line":670,"file":"Presence.js","path":"src/structures"}},{"name":"toJSON","description":"Returns an object that can be used to set the status","returns":[[["CustomStatus"]]],"meta":{"line":680,"file":"Presence.js","path":"src/structures"}}],"meta":{"line":646,"file":"Presence.js","path":"src/structures"}},{"name":"RichPresence","construct":{"name":"RichPresence","params":[{"name":"client","description":"Discord client","type":[[["Client"]]]},{"name":"data","description":"RichPresence to clone or raw data","optional":true,"default":"{}","type":[[["RichPresence"]]]}]},"methods":[{"name":"setup","description":"Sets the status from a JSON object","access":"private","params":[{"name":"data","description":"data","type":[[["RichPresence"]]]}],"meta":{"line":707,"file":"Presence.js","path":"src/structures"}},{"name":"setAssetsLargeImage","description":"Set the large image of this activity","params":[{"name":"image","description":"The large image asset's id","nullable":true,"type":[[["RichPresenceImage"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":717,"file":"Presence.js","path":"src/structures"}},{"name":"setAssetsSmallImage","description":"Set the small image of this activity","params":[{"name":"image","description":"The small image asset's id","nullable":true,"type":[[["RichPresenceImage"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":727,"file":"Presence.js","path":"src/structures"}},{"name":"setAssetsLargeText","description":"Hover text for the large image","params":[{"name":"text","description":"Assets text","type":[[["string"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":737,"file":"Presence.js","path":"src/structures"}},{"name":"setAssetsSmallText","description":"Hover text for the small image","params":[{"name":"text","description":"Assets text","type":[[["string"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":747,"file":"Presence.js","path":"src/structures"}},{"name":"setName","description":"Set the name of the activity","params":[{"name":"name","description":"The activity's name","nullable":true,"type":[[["string"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":757,"file":"Presence.js","path":"src/structures"}},{"name":"setURL","description":"If the activity is being streamed, a link to the stream","params":[{"name":"url","description":"URL of the stream","nullable":true,"type":[[["string"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":767,"file":"Presence.js","path":"src/structures"}},{"name":"setType","description":"The activity status's type","params":[{"name":"type","description":"The type of activity","nullable":true,"type":[[["ActivityTypes"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":778,"file":"Presence.js","path":"src/structures"}},{"name":"setApplicationId","description":"Set the application id of this activity","params":[{"name":"id","description":"Bot's id","nullable":true,"type":[[["Snowflake"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":788,"file":"Presence.js","path":"src/structures"}},{"name":"setState","description":"Set the state of the activity","params":[{"name":"state","description":"The state of the activity","nullable":true,"type":[[["string"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":798,"file":"Presence.js","path":"src/structures"}},{"name":"setDetails","description":"Set the details of the activity","params":[{"name":"details","description":"The details of the activity","nullable":true,"type":[[["string"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":808,"file":"Presence.js","path":"src/structures"}},{"name":"setParty","description":"Set the party of this activity","params":[{"name":"party","description":"The party to be displayed","nullable":true,"type":[[["RichParty"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":825,"file":"Presence.js","path":"src/structures"}},{"name":"setStartTimestamp","description":"Sets the start timestamp of the activity","params":[{"name":"timestamp","description":"The timestamp of the start of the activity","type":[[["Date"]],[["number"]],[["null"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":846,"file":"Presence.js","path":"src/structures"}},{"name":"setEndTimestamp","description":"Sets the end timestamp of the activity","params":[{"name":"timestamp","description":"The timestamp of the end of the activity","type":[[["Date"]],[["number"]],[["null"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":858,"file":"Presence.js","path":"src/structures"}},{"name":"setButtons","description":"Set the buttons of the rich presence","params":[{"name":"button","description":"A list of buttons to set","variable":true,"nullable":true,"type":[[["RichButton"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":875,"file":"Presence.js","path":"src/structures"}},{"name":"setPlatform","description":"The platform the activity is being played on","params":[{"name":"platform","description":"Any platform","type":[[["ActivityPlatform"]],[["null"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":904,"file":"Presence.js","path":"src/structures"}},{"name":"setJoinSecret","description":"Secrets for rich presence joining and spectating (send-only)","params":[{"name":"join","description":"Secrets for rich presence joining","nullable":true,"type":[[["string"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":914,"file":"Presence.js","path":"src/structures"}},{"name":"addButton","description":"Add a button to the rich presence","params":[{"name":"name","description":"The name of the button","type":[[["string"]]]},{"name":"url","description":"The url of the button","type":[[["string"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":925,"file":"Presence.js","path":"src/structures"}},{"name":"toJSON","description":"Convert the rich presence to a JSON object","returns":[[["Object"]]],"meta":{"line":941,"file":"Presence.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the activities' name instead of the Activity object.","returns":[[["string"]]],"meta":{"line":992,"file":"Presence.js","path":"src/structures"}},{"name":"getExternal","description":"Retrieves external assets from a RichPresence","scope":"static","params":[{"name":"client","description":"The Discord client instance.","type":[[["Client"]]]},{"name":"applicationId","description":"The application ID associated with the Rich Presence.","type":[[["Snowflake"]]]},{"name":"images","description":"1 or 2 external image URLs (not hosted by Discord).","variable":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Array","<"],["ExternalAssets",">>"]]],"meta":{"line":966,"file":"Presence.js","path":"src/structures"}}],"meta":{"line":696,"file":"Presence.js","path":"src/structures"}},{"name":"SpotifyRPC","extends":[[["RichPresence"]]],"construct":{"name":"SpotifyRPC","description":"Create a new RichPresence (Spotify style)","params":[{"name":"client","description":"Discord Client","type":[[["Client"]]]},{"name":"options","description":"Options for the Spotify RPC","optional":true,"type":[[["SpotifyRPC"]]]}]},"props":[{"name":"metadata","description":"Spotify metadata","type":[[["SpotifyMetadata"]]],"meta":{"line":1041,"file":"Presence.js","path":"src/structures"}}],"methods":[{"name":"setup","description":"Sets the status from a JSON object","access":"private","params":[{"name":"options","description":"data","type":[[["SpotifyRPC"]]]}],"meta":{"line":1029,"file":"Presence.js","path":"src/structures"}},{"name":"setSongId","description":"Set Spotify song id to sync with","params":[{"name":"id","description":"Song id","type":[[["string"]]]}],"returns":[[["SpotifyRPC"]]],"meta":{"line":1053,"file":"Presence.js","path":"src/structures"}},{"name":"addArtistId","description":"Add the artist id","params":[{"name":"id","description":"Artist id","type":[[["string"]]]}],"returns":[[["SpotifyRPC"]]],"meta":{"line":1063,"file":"Presence.js","path":"src/structures"}},{"name":"setArtistIds","description":"Set the artist ids","params":[{"name":"ids","description":"Artist ids","variable":true,"type":[[["string"]],[["Array","<"],["string",">"]]]}],"returns":[[["SpotifyRPC"]]],"meta":{"line":1074,"file":"Presence.js","path":"src/structures"}},{"name":"setAlbumId","description":"Set the album id","params":[{"name":"id","description":"Album id","type":[[["string"]]]}],"returns":[[["SpotifyRPC"]]],"meta":{"line":1089,"file":"Presence.js","path":"src/structures"}},{"name":"setAssetsLargeImage","description":"Set the large image of this activity","inherits":"RichPresence#setAssetsLargeImage","inherited":true,"params":[{"name":"image","description":"The large image asset's id","nullable":true,"type":[[["RichPresenceImage"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":717,"file":"Presence.js","path":"src/structures"}},{"name":"setAssetsSmallImage","description":"Set the small image of this activity","inherits":"RichPresence#setAssetsSmallImage","inherited":true,"params":[{"name":"image","description":"The small image asset's id","nullable":true,"type":[[["RichPresenceImage"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":727,"file":"Presence.js","path":"src/structures"}},{"name":"setAssetsLargeText","description":"Hover text for the large image","inherits":"RichPresence#setAssetsLargeText","inherited":true,"params":[{"name":"text","description":"Assets text","type":[[["string"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":737,"file":"Presence.js","path":"src/structures"}},{"name":"setAssetsSmallText","description":"Hover text for the small image","inherits":"RichPresence#setAssetsSmallText","inherited":true,"params":[{"name":"text","description":"Assets text","type":[[["string"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":747,"file":"Presence.js","path":"src/structures"}},{"name":"setName","description":"Set the name of the activity","inherits":"RichPresence#setName","inherited":true,"params":[{"name":"name","description":"The activity's name","nullable":true,"type":[[["string"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":757,"file":"Presence.js","path":"src/structures"}},{"name":"setURL","description":"If the activity is being streamed, a link to the stream","inherits":"RichPresence#setURL","inherited":true,"params":[{"name":"url","description":"URL of the stream","nullable":true,"type":[[["string"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":767,"file":"Presence.js","path":"src/structures"}},{"name":"setType","description":"The activity status's type","inherits":"RichPresence#setType","inherited":true,"params":[{"name":"type","description":"The type of activity","nullable":true,"type":[[["ActivityTypes"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":778,"file":"Presence.js","path":"src/structures"}},{"name":"setApplicationId","description":"Set the application id of this activity","inherits":"RichPresence#setApplicationId","inherited":true,"params":[{"name":"id","description":"Bot's id","nullable":true,"type":[[["Snowflake"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":788,"file":"Presence.js","path":"src/structures"}},{"name":"setState","description":"Set the state of the activity","inherits":"RichPresence#setState","inherited":true,"params":[{"name":"state","description":"The state of the activity","nullable":true,"type":[[["string"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":798,"file":"Presence.js","path":"src/structures"}},{"name":"setDetails","description":"Set the details of the activity","inherits":"RichPresence#setDetails","inherited":true,"params":[{"name":"details","description":"The details of the activity","nullable":true,"type":[[["string"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":808,"file":"Presence.js","path":"src/structures"}},{"name":"setParty","description":"Set the party of this activity","inherits":"RichPresence#setParty","inherited":true,"params":[{"name":"party","description":"The party to be displayed","nullable":true,"type":[[["RichParty"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":825,"file":"Presence.js","path":"src/structures"}},{"name":"setStartTimestamp","description":"Sets the start timestamp of the activity","inherits":"RichPresence#setStartTimestamp","inherited":true,"params":[{"name":"timestamp","description":"The timestamp of the start of the activity","type":[[["Date"]],[["number"]],[["null"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":846,"file":"Presence.js","path":"src/structures"}},{"name":"setEndTimestamp","description":"Sets the end timestamp of the activity","inherits":"RichPresence#setEndTimestamp","inherited":true,"params":[{"name":"timestamp","description":"The timestamp of the end of the activity","type":[[["Date"]],[["number"]],[["null"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":858,"file":"Presence.js","path":"src/structures"}},{"name":"setButtons","description":"Set the buttons of the rich presence","inherits":"RichPresence#setButtons","inherited":true,"params":[{"name":"button","description":"A list of buttons to set","variable":true,"nullable":true,"type":[[["RichButton"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":875,"file":"Presence.js","path":"src/structures"}},{"name":"setPlatform","description":"The platform the activity is being played on","inherits":"RichPresence#setPlatform","inherited":true,"params":[{"name":"platform","description":"Any platform","type":[[["ActivityPlatform"]],[["null"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":904,"file":"Presence.js","path":"src/structures"}},{"name":"setJoinSecret","description":"Secrets for rich presence joining and spectating (send-only)","inherits":"RichPresence#setJoinSecret","inherited":true,"params":[{"name":"join","description":"Secrets for rich presence joining","nullable":true,"type":[[["string"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":914,"file":"Presence.js","path":"src/structures"}},{"name":"addButton","description":"Add a button to the rich presence","inherits":"RichPresence#addButton","inherited":true,"params":[{"name":"name","description":"The name of the button","type":[[["string"]]]},{"name":"url","description":"The url of the button","type":[[["string"]]]}],"returns":[[["RichPresence"]]],"meta":{"line":925,"file":"Presence.js","path":"src/structures"}},{"name":"toJSON","description":"Convert the rich presence to a JSON object","inherits":"RichPresence#toJSON","inherited":true,"returns":[[["Object"]]],"meta":{"line":941,"file":"Presence.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the activities' name instead of the Activity object.","inherits":"RichPresence#toString","inherited":true,"returns":[[["string"]]],"meta":{"line":992,"file":"Presence.js","path":"src/structures"}}],"meta":{"line":1004,"file":"Presence.js","path":"src/structures"}},{"name":"ReactionCollector","description":"Collects reactions on messages.\nWill automatically stop if the message ({@link Client#event:messageDelete messageDelete} or\n{@link Client#event:messageDeleteBulk messageDeleteBulk}),\nchannel ({@link Client#event:channelDelete channelDelete}),\nthread ({@link Client#event:threadDelete threadDelete}), or\nguild ({@link Client#event:guildDelete guildDelete}) is deleted.","extends":[[["Collector"]]],"construct":{"name":"ReactionCollector","params":[{"name":"message","description":"The message upon which to collect reactions","type":[[["Message"]]]},{"name":"options","description":"The options to apply to this collector","optional":true,"default":"{}","type":[[["ReactionCollectorOptions"]]]}]},"props":[{"name":"message","description":"The message upon which to collect reactions","type":[[["Message"]]],"meta":{"line":35,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"users","description":"The users that have reacted to this message","type":[[["Collection"]]],"meta":{"line":41,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"total","description":"The total number of reactions collected","type":[[["number"]]],"meta":{"line":47,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"endReason","description":"The reason this collector has ended with, or null if it hasn't ended yet","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":164,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this Collector","readonly":true,"type":[[["Client"]]],"meta":{"line":35,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"filter","description":"The filter applied to this collector","type":[[["CollectorFilter"]]],"meta":{"line":48,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"options","description":"The options of this collector","type":[[["CollectorOptions"]]],"meta":{"line":54,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"collected","description":"The items collected by this collector","type":[[["Collection"]]],"meta":{"line":60,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"ended","description":"Whether this collector has finished collecting","type":[[["boolean"]]],"meta":{"line":66,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"_timeout","description":"Timeout for cleanup","access":"private","nullable":true,"type":[[["Timeout"]]],"meta":{"line":73,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"_idletimeout","description":"Timeout for cleanup due to inactivity","access":"private","nullable":true,"type":[[["Timeout"]]],"meta":{"line":80,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"next","description":"Returns a promise that resolves with the next collected element;\nrejects with collected elements if the collector finishes without receiving a next element","readonly":true,"type":[[["Promise"]]],"meta":{"line":148,"file":"Collector.js","path":"src/structures/interfaces"}}],"methods":[{"name":"collect","description":"Handles an incoming reaction for possible collection.","access":"private","params":[{"name":"reaction","description":"The reaction to possibly collect","type":[[["MessageReaction"]]]},{"name":"user","description":"The user that added the reaction","type":[[["User"]]]}],"returns":{"types":[[["Snowflake"]],[["string"]]],"nullable":true},"meta":{"line":110,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"dispose","description":"Handles a reaction deletion for possible disposal.","params":[{"name":"reaction","description":"The reaction to possibly dispose of","type":[[["MessageReaction"]]]},{"name":"user","description":"The user that removed the reaction","type":[[["User"]]]}],"returns":{"types":[[["Snowflake"]],[["string"]]],"nullable":true},"meta":{"line":128,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"empty","description":"Empties this reaction collector.","meta":{"line":152,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"_handleMessageDeletion","description":"Handles checking if the message has been deleted, and if so, stops the collector with the reason 'messageDelete'.","access":"private","params":[{"name":"message","description":"The message that was deleted","type":[[["Message"]]]}],"returns":[[["void"]]],"meta":{"line":177,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"_handleChannelDeletion","description":"Handles checking if the channel has been deleted, and if so, stops the collector with the reason 'channelDelete'.","access":"private","params":[{"name":"channel","description":"The channel that was deleted","type":[[["GuildChannel"]]]}],"returns":[[["void"]]],"meta":{"line":189,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"_handleThreadDeletion","description":"Handles checking if the thread has been deleted, and if so, stops the collector with the reason 'threadDelete'.","access":"private","params":[{"name":"thread","description":"The thread that was deleted","type":[[["ThreadChannel"]]]}],"returns":[[["void"]]],"meta":{"line":201,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"_handleGuildDeletion","description":"Handles checking if the guild has been deleted, and if so, stops the collector with the reason 'guildDelete'.","access":"private","params":[{"name":"guild","description":"The guild that was deleted","type":[[["Guild"]]]}],"returns":[[["void"]]],"meta":{"line":213,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"handleCollect","description":"Call this to handle an event as a collectable element. Accepts any event data as parameters.","inherits":"Collector#handleCollect","inherited":true,"emits":["Collector#event:collect"],"params":[{"name":"args","description":"The arguments emitted by the listener","variable":true,"type":[["*"]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":99,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"handleDispose","description":"Call this to remove an element from the collection. Accepts any event data as parameters.","inherits":"Collector#handleDispose","inherited":true,"emits":["Collector#event:dispose"],"params":[{"name":"args","description":"The arguments emitted by the listener","variable":true,"type":[["*"]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":126,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"stop","description":"Stops this collector and emits the `end` event.","inherits":"Collector#stop","inherited":true,"emits":["Collector#event:end"],"params":[{"name":"reason","description":"The reason this collector is ending","optional":true,"default":"'user'","type":[[["string"]]]}],"meta":{"line":180,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"resetTimer","description":"Resets the collector's timeout and idle timer.","inherits":"Collector#resetTimer","inherited":true,"params":[{"name":"options","description":"Options for resetting","optional":true,"type":[[["CollectorResetTimerOptions"]]]}],"meta":{"line":213,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"checkEnd","description":"Checks whether the collector should end, and if so, ends it.","inherits":"Collector#checkEnd","inherited":true,"returns":{"types":[[["boolean"]]],"description":"Whether the collector ended or not"},"meta":{"line":228,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"key","description":"Gets the collector key for a reaction.","scope":"static","params":[{"name":"reaction","description":"The message reaction to get the key for","type":[[["MessageReaction"]]]}],"returns":[[["Snowflake"]],[["string"]]],"meta":{"line":224,"file":"ReactionCollector.js","path":"src/structures"}}],"events":[{"name":"create","description":"Emitted whenever a reaction is newly created on a message. Will emit only when a new reaction is\nadded to the message, as opposed to {@link Collector#collect} which will\nbe emitted even when a reaction has already been added to the message.","params":[{"name":"reaction","description":"The reaction that was added","type":[[["MessageReaction"]]]},{"name":"user","description":"The user that added the reaction","type":[[["User"]]]}],"meta":{"line":82,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"collect","description":"Emitted whenever a reaction is collected.","params":[{"name":"reaction","description":"The reaction that was collected","type":[[["MessageReaction"]]]},{"name":"user","description":"The user that added the reaction","type":[[["User"]]]}],"meta":{"line":111,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"dispose","description":"Emitted when the reaction had all the users removed and the `dispose` option is set to true.","params":[{"name":"reaction","description":"The reaction that was disposed of","type":[[["MessageReaction"]]]},{"name":"user","description":"The user that removed the reaction","type":[[["User"]]]}],"meta":{"line":129,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"remove","description":"Emitted when the reaction had one user removed and the `dispose` option is set to true.","params":[{"name":"reaction","description":"The reaction that was removed","type":[[["MessageReaction"]]]},{"name":"user","description":"The user that removed the reaction","type":[[["User"]]]}],"meta":{"line":137,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"end","description":"Emitted when the collector is finished collecting.","params":[{"name":"collected","description":"The elements collected by the collector","type":[[["Collection"]]]},{"name":"reason","description":"The reason the collector ended","type":[[["string"]]]}],"meta":{"line":193,"file":"Collector.js","path":"src/structures/interfaces"}}],"meta":{"line":23,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"ReactionEmoji","description":"Represents a limited emoji set used for both custom and unicode emojis. Custom emojis\nwill use this class opposed to the Emoji class when the client doesn't know enough\ninformation about them.","extends":[[["Emoji"]]],"props":[{"name":"reaction","description":"The message reaction this emoji refers to","type":[[["MessageReaction"]]],"meta":{"line":19,"file":"ReactionEmoji.js","path":"src/structures"}},{"name":"animated","description":"Whether or not the emoji is animated","nullable":true,"type":[[["boolean"]]],"meta":{"line":34,"file":"Emoji.js","path":"src/structures"}},{"name":"name","description":"The emoji's name","nullable":true,"type":[[["string"]]],"meta":{"line":40,"file":"Emoji.js","path":"src/structures"}},{"name":"id","description":"The emoji's id","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":46,"file":"Emoji.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":54,"file":"Emoji.js","path":"src/structures"}},{"name":"identifier","description":"The identifier of this emoji, used for message reactions","readonly":true,"type":[[["string"]]],"meta":{"line":84,"file":"Emoji.js","path":"src/structures"}},{"name":"url","description":"The URL to the emoji file if it's a custom emoji","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":94,"file":"Emoji.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the emoji was created at, or null if unicode","readonly":true,"nullable":true,"type":[[["number"]]],"meta":{"line":103,"file":"Emoji.js","path":"src/structures"}},{"name":"createdAt","description":"The time the emoji was created at, or null if unicode","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":112,"file":"Emoji.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"toString","description":"When concatenated with a string, this automatically returns the text required to form a graphical emoji on Discord\ninstead of the Emoji object.","inherits":"Emoji#toString","inherited":true,"examples":["// Send a custom emoji from a guild:\nconst emoji = guild.emojis.cache.first();\nmsg.channel.send(`Hello! ${emoji}`);","// Send the emoji used in a reaction to the channel the reaction is part of\nreaction.message.channel.send(`The emoji used was: ${reaction.emoji}`);"],"returns":[[["string"]]],"meta":{"line":128,"file":"Emoji.js","path":"src/structures"}}],"meta":{"line":12,"file":"ReactionEmoji.js","path":"src/structures"}},{"name":"Role","description":"Represents a role on Discord.","extends":[[["Base"]]],"props":[{"name":"guild","description":"The guild that the role belongs to","type":[[["Guild"]]],"meta":{"line":32,"file":"Role.js","path":"src/structures"}},{"name":"icon","description":"The icon hash of the role","nullable":true,"type":[[["string"]]],"meta":{"line":38,"file":"Role.js","path":"src/structures"}},{"name":"unicodeEmoji","description":"The unicode emoji for the role","nullable":true,"type":[[["string"]]],"meta":{"line":44,"file":"Role.js","path":"src/structures"}},{"name":"id","description":"The role's id (unique to the guild it is part of)","type":[[["Snowflake"]]],"meta":{"line":54,"file":"Role.js","path":"src/structures"}},{"name":"name","description":"The name of the role","type":[[["string"]]],"meta":{"line":60,"file":"Role.js","path":"src/structures"}},{"name":"color","description":"The base 10 color of the role","deprecated":"Use {@link Role#colors} instead.","type":[[["number"]]],"meta":{"line":69,"file":"Role.js","path":"src/structures"}},{"name":"colors","description":"The colors of the role","type":[[["RoleColors"]]],"meta":{"line":89,"file":"Role.js","path":"src/structures"}},{"name":"hoist","description":"If true, users that are part of this role will appear in a separate category in the users list","type":[[["boolean"]]],"meta":{"line":101,"file":"Role.js","path":"src/structures"}},{"name":"rawPosition","description":"The raw position of the role from the API","type":[[["number"]]],"meta":{"line":109,"file":"Role.js","path":"src/structures"}},{"name":"permissions","description":"The permissions of the role","type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":117,"file":"Role.js","path":"src/structures"}},{"name":"managed","description":"Whether or not the role is managed by an external service","type":[[["boolean"]]],"meta":{"line":125,"file":"Role.js","path":"src/structures"}},{"name":"mentionable","description":"Whether or not the role can be mentioned by anyone","type":[[["boolean"]]],"meta":{"line":133,"file":"Role.js","path":"src/structures"}},{"name":"tags","description":"The tags this role has","nullable":true,"type":[[["Object"]]],"props":[{"name":"botId","description":"The id of the bot this role belongs to","optional":true,"type":[[["Snowflake"]]]},{"name":"integrationId","description":"The id of the integration this role belongs to","optional":true,"type":[[["Snowflake"]],[["string"]]]},{"name":"premiumSubscriberRole","description":"Whether this is the guild's premium subscription role","optional":true,"type":[[["true"]]]},{"name":"subscriptionListingId","description":"The id of this role's subscription SKU and listing","optional":true,"type":[[["Snowflake"]]]},{"name":"availableForPurchase","description":"Whether this role is available for purchase","optional":true,"type":[[["true"]]]},{"name":"guildConnections","description":"Whether this role is a guild's linked role","optional":true,"type":[[["true"]]]}],"meta":{"line":150,"file":"Role.js","path":"src/structures"}},{"name":"flags","description":"The flags of this role","type":[[["Readonly","<"],["RoleFlags",">"]]],"meta":{"line":177,"file":"Role.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the role was created at","readonly":true,"type":[[["number"]]],"meta":{"line":188,"file":"Role.js","path":"src/structures"}},{"name":"createdAt","description":"The time the role was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":197,"file":"Role.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the role has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":206,"file":"Role.js","path":"src/structures"}},{"name":"hexColor","description":"The hexadecimal version of the role color, with a leading hashtag","readonly":true,"type":[[["string"]]],"meta":{"line":236,"file":"Role.js","path":"src/structures"}},{"name":"members","description":"The cached guild members that have this role","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":245,"file":"Role.js","path":"src/structures"}},{"name":"editable","description":"Whether the role is editable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":254,"file":"Role.js","path":"src/structures"}},{"name":"position","description":"The position of the role in the role manager","readonly":true,"type":[[["number"]]],"meta":{"line":266,"file":"Role.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"comparePositionTo","description":"Compares this role's position to another role's.","examples":["// Compare the position of a role to another\nconst roleCompare = role.comparePositionTo(otherRole);\nif (roleCompare >= 1) console.log(`${role.name} is higher than ${otherRole.name}`);"],"params":[{"name":"role","description":"Role to compare to this one","type":[[["RoleResolvable"]]]}],"returns":{"types":[[["number"]]],"description":"Negative number if this role's position is lower (other role's is higher),\npositive number if this one is higher (other's is lower), 0 if equal"},"meta":{"line":286,"file":"Role.js","path":"src/structures"}},{"name":"edit","description":"Edits the role.","examples":["// Edit a role\nrole.edit({ name: 'new role' })\n .then(updated => console.log(`Edited role name to ${updated.name}`))\n .catch(console.error);"],"params":[{"name":"data","description":"The new data for the role","type":[[["RoleData"]]]},{"name":"reason","description":"Reason for editing this role","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Role",">"]]],"meta":{"line":318,"file":"Role.js","path":"src/structures"}},{"name":"permissionsIn","description":"Returns `channel.permissionsFor(role)`. Returns permissions for a role in a guild channel,\ntaking into account permission overwrites.","params":[{"name":"channel","description":"The guild channel to use as context","type":[[["GuildChannel"]],[["Snowflake"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":329,"file":"Role.js","path":"src/structures"}},{"name":"setName","description":"Sets a new name for the role.","examples":["// Set the name of the role\nrole.setName('new role')\n .then(updated => console.log(`Updated role name to ${updated.name}`))\n .catch(console.error);"],"params":[{"name":"name","description":"The new name of the role","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the role's name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Role",">"]]],"meta":{"line":346,"file":"Role.js","path":"src/structures"}},{"name":"setColor","description":"Sets a new color for the role.","deprecated":"Use {@link Role#setColors} instead.","params":[{"name":"color","description":"The color of the role","type":[[["ColorResolvable"]]]},{"name":"reason","description":"Reason for changing the role's color","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Role",">"]]],"meta":{"line":357,"file":"Role.js","path":"src/structures"}},{"name":"setColors","description":"Sets new colors for the role.","examples":["// Set the colors of a role\nrole.setColors({ primaryColor: '#FF0000', secondaryColor: '#00FF00', tertiaryColor: '#0000FF' })\n .then(updated => console.log(`Set colors of role to ${updated.colors}`))\n .catch(console.error);","// Set holographic colors using constants\nrole.setColors({\n primaryColor: Constants.HolographicStyle.Primary,\n secondaryColor: Constants.HolographicStyle.Secondary,\n tertiaryColor: Constants.HolographicStyle.Tertiary,\n})\n .then(updated => console.log(`Set holographic colors for role ${updated.name}`))\n .catch(console.error);"],"params":[{"name":"colors","description":"The colors of the role","type":[[["RoleColorsResolvable"]]]},{"name":"reason","description":"Reason for changing the role's colors","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Role",">"]]],"meta":{"line":382,"file":"Role.js","path":"src/structures"}},{"name":"setHoist","description":"Sets whether or not the role should be hoisted.","examples":["// Set the hoist of the role\nrole.setHoist(true)\n .then(updated => console.log(`Role hoisted: ${updated.hoist}`))\n .catch(console.error);"],"params":[{"name":"hoist","description":"Whether or not to hoist the role","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for setting whether or not the role should be hoisted","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Role",">"]]],"meta":{"line":397,"file":"Role.js","path":"src/structures"}},{"name":"setPermissions","description":"Sets the permissions of the role.","examples":["// Set the permissions of the role\nrole.setPermissions([Permissions.FLAGS.KICK_MEMBERS, Permissions.FLAGS.BAN_MEMBERS])\n .then(updated => console.log(`Updated permissions to ${updated.permissions.bitfield}`))\n .catch(console.error);","// Remove all permissions from a role\nrole.setPermissions(0n)\n .then(updated => console.log(`Updated permissions to ${updated.permissions.bitfield}`))\n .catch(console.error);"],"params":[{"name":"permissions","description":"The permissions of the role","type":[[["PermissionResolvable"]]]},{"name":"reason","description":"Reason for changing the role's permissions","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Role",">"]]],"meta":{"line":417,"file":"Role.js","path":"src/structures"}},{"name":"setMentionable","description":"Sets whether this role is mentionable.","examples":["// Make the role mentionable\nrole.setMentionable(true)\n .then(updated => console.log(`Role updated ${updated.name}`))\n .catch(console.error);"],"params":[{"name":"mentionable","description":"Whether this role should be mentionable","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for setting whether or not this role should be mentionable","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Role",">"]]],"meta":{"line":432,"file":"Role.js","path":"src/structures"}},{"name":"setIcon","description":"Sets a new icon for the role.","params":[{"name":"icon","description":"The icon for the role\nThe `EmojiResolvable` should belong to the same guild as the role.\nIf not, pass the emoji's URL directly","nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]],[["EmojiResolvable"]]]},{"name":"reason","description":"Reason for changing the role's icon","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Role",">"]]],"meta":{"line":444,"file":"Role.js","path":"src/structures"}},{"name":"setUnicodeEmoji","description":"Sets a new unicode emoji for the role.","examples":["// Set a new unicode emoji for the role\nrole.setUnicodeEmoji('🤖')\n .then(updated => console.log(`Set unicode emoji for the role to ${updated.unicodeEmoji}`))\n .catch(console.error);"],"params":[{"name":"unicodeEmoji","description":"The new unicode emoji for the role","nullable":true,"type":[[["string"]]]},{"name":"reason","description":"Reason for changing the role's unicode emoji","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Role",">"]]],"meta":{"line":459,"file":"Role.js","path":"src/structures"}},{"name":"setPosition","description":"Sets the new position of the role.","examples":["// Set the position of the role\nrole.setPosition(1)\n .then(updated => console.log(`Role position: ${updated.position}`))\n .catch(console.error);"],"params":[{"name":"position","description":"The new position for the role","type":[[["number"]]]},{"name":"options","description":"Options for setting the position","optional":true,"type":[[["SetRolePositionOptions"]]]}],"returns":[[["Promise","<"],["Role",">"]]],"meta":{"line":481,"file":"Role.js","path":"src/structures"}},{"name":"delete","description":"Deletes the role.","examples":["// Delete a role\nrole.delete('The role needed to go')\n .then(deleted => console.log(`Deleted role ${deleted.name}`))\n .catch(console.error);"],"params":[{"name":"reason","description":"Reason for deleting this role","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Role",">"]]],"meta":{"line":495,"file":"Role.js","path":"src/structures"}},{"name":"fetchMemberIds","description":"Fetches the member ids for this role in the guild.\nThis only returns 100 member ids","returns":[[["Promise","<"],["Array","<"],["Snowflake",">>"]]],"meta":{"line":505,"file":"Role.js","path":"src/structures"}},{"name":"iconURL","description":"A link to the role's icon","params":[{"name":"options","description":"Options for the image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":514,"file":"Role.js","path":"src/structures"}},{"name":"equals","description":"Whether this role equals another role. It compares all properties, so for most operations\nit is advisable to just compare `role.id === role2.id` as it is much faster and is often\nwhat most users need.","params":[{"name":"role","description":"Role to compare with","type":[[["Role"]]]}],"returns":[[["boolean"]]],"meta":{"line":526,"file":"Role.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the role's mention instead of the Role object.","examples":["// Logs: Role: <@&123456789012345678>\nconsole.log(`Role: ${role}`);"],"returns":[[["string"]]],"meta":{"line":550,"file":"Role.js","path":"src/structures"}},{"name":"comparePositions","description":"Compares the positions of two roles.","scope":"static","deprecated":"Use {@link RoleManager#comparePositions} instead.","params":[{"name":"role1","description":"First role to compare","type":[[["Role"]]]},{"name":"role2","description":"Second role to compare","type":[[["Role"]]]}],"returns":{"types":[[["number"]]],"description":"Negative number if the first role's position is lower (second role's is higher),\npositive number if the first's is higher (second's is lower), 0 if equal"},"meta":{"line":570,"file":"Role.js","path":"src/structures"}}],"meta":{"line":24,"file":"Role.js","path":"src/structures"}},{"name":"SectionComponent","construct":{"name":"SectionComponent","params":[{"name":"data","description":"The data","optional":true,"default":"{}","type":[[["SectionComponent"]],[["APISectionComponent"]]]}]},"props":[{"name":"components","description":"One to three text components","type":[[["Array","<"],["TextDisplayComponent",">"]]],"meta":{"line":27,"file":"SectionComponent.js","path":"src/structures"}},{"name":"accessory","description":"A thumbnail or a button component, with a future possibility of adding more compatible components","type":[[["ThumbnailComponent"]],[["MessageButton"]]],"meta":{"line":33,"file":"SectionComponent.js","path":"src/structures"}}],"methods":[{"name":"toJSON","returns":[[["APISectionComponent"]]],"meta":{"line":39,"file":"SectionComponent.js","path":"src/structures"}}],"meta":{"line":15,"file":"SectionComponent.js","path":"src/structures"}},{"name":"SelectMenuInteraction","description":"Represents a select menu interaction.","extends":[[["MessageComponentInteraction"]]],"props":[{"name":"values","description":"The values selected, if the component which was interacted with was a select menu","type":[[["Array","<"],["string",">"]]],"meta":{"line":17,"file":"SelectMenuInteraction.js","path":"src/structures"}},{"name":"channelId","description":"The id of the channel this interaction was sent in","type":[[["Snowflake"]]],"meta":{"line":17,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"message","description":"The message to which the component was attached","type":[[["Message"]],[["APIMessage"]]],"meta":{"line":27,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"customId","description":"The custom id of the component which was interacted with","type":[[["string"]]],"meta":{"line":33,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"componentType","description":"The type of component which was interacted with","type":[[["string"]]],"meta":{"line":39,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"deferred","description":"Whether the reply to this interaction has been deferred","type":[[["boolean"]]],"meta":{"line":45,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"ephemeral","description":"Whether the reply to this interaction is ephemeral","nullable":true,"type":[[["boolean"]]],"meta":{"line":51,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"replied","description":"Whether this interaction has already been replied to","type":[[["boolean"]]],"meta":{"line":57,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"webhook","description":"An associated interaction webhook, can be used to further interact with this interaction","type":[[["InteractionWebhook"]]],"meta":{"line":63,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"component","description":"The component which was interacted with","readonly":true,"type":[[["MessageActionRowComponent"]],[["APIMessageActionRowComponent"]]],"meta":{"line":78,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"type","description":"The interaction's type","type":[[["InteractionType"]]],"meta":{"line":20,"file":"Interaction.js","path":"src/structures"}},{"name":"id","description":"The interaction's id","type":[[["Snowflake"]]],"meta":{"line":26,"file":"Interaction.js","path":"src/structures"}},{"name":"token","description":"The interaction's token","readonly":true,"type":[[["string"]]],"meta":{"line":28,"file":"Interaction.js","path":"src/structures"}},{"name":"applicationId","description":"The application's id","type":[[["Snowflake"]]],"meta":{"line":40,"file":"Interaction.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild this interaction was sent in","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":52,"file":"Interaction.js","path":"src/structures"}},{"name":"user","description":"The user which sent this interaction","type":[[["User"]]],"meta":{"line":58,"file":"Interaction.js","path":"src/structures"}},{"name":"member","description":"If this interaction was sent in a guild, the member which sent it","nullable":true,"type":[[["GuildMember"]],[["APIGuildMember"]]],"meta":{"line":64,"file":"Interaction.js","path":"src/structures"}},{"name":"version","description":"The version","type":[[["number"]]],"meta":{"line":70,"file":"Interaction.js","path":"src/structures"}},{"name":"appPermissions","description":"Set of permissions the application or bot has within the channel the interaction was sent from","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":76,"file":"Interaction.js","path":"src/structures"}},{"name":"memberPermissions","description":"The permissions of the member, if one exists, in the channel this interaction was executed in","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":82,"file":"Interaction.js","path":"src/structures"}},{"name":"locale","description":"The locale of the user who invoked this interaction","type":[[["Locale"]]],"meta":{"line":124,"file":"Interaction.js","path":"src/structures"}},{"name":"guildLocale","description":"The preferred locale from the guild this interaction was sent in","nullable":true,"type":[[["Locale"]]],"meta":{"line":130,"file":"Interaction.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the interaction was created at","readonly":true,"type":[[["number"]]],"meta":{"line":138,"file":"Interaction.js","path":"src/structures"}},{"name":"createdAt","description":"The time the interaction was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":147,"file":"Interaction.js","path":"src/structures"}},{"name":"channel","description":"The channel this interaction was sent in","readonly":true,"nullable":true,"type":[[["TextBasedChannels"]]],"meta":{"line":156,"file":"Interaction.js","path":"src/structures"}},{"name":"guild","description":"The guild this interaction was sent in","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":165,"file":"Interaction.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"deferReply","description":"Defers the reply to this interaction.","inherits":"MessageComponentInteraction#deferReply","inherited":true,"implements":["InteractionResponses#deferReply"],"examples":["// Defer the reply to this interaction\ninteraction.deferReply()\n .then(console.log)\n .catch(console.error)","// Defer to send an ephemeral reply later\ninteraction.deferReply({ ephemeral: true })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for deferring the reply to this interaction","optional":true,"type":[[["InteractionDeferReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":58,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"reply","description":"Creates a reply to this interaction.\nUse the `fetchReply` option to get the bot's reply message.","inherits":"MessageComponentInteraction#reply","inherited":true,"implements":["InteractionResponses#reply"],"examples":["// Reply to the interaction and fetch the response\ninteraction.reply({ content: 'Pong!', fetchReply: true })\n .then((message) => console.log(`Reply sent with content ${message.content}`))\n .catch(console.error);","// Create an ephemeral reply with an embed\nconst embed = new MessageEmbed().setDescription('Pong!');\n\ninteraction.reply({ embeds: [embed], ephemeral: true })\n .then(() => console.log('Reply sent.'))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":93,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"fetchReply","description":"Fetches a reply to this interaction.","see":["Webhook#fetchMessage"],"inherits":"MessageComponentInteraction#fetchReply","inherited":true,"implements":["InteractionResponses#fetchReply"],"examples":["// Fetch the initial reply to this interaction\ninteraction.fetchReply()\n .then(reply => console.log(`Replied with ${reply.content}`))\n .catch(console.error);"],"params":[{"name":"message","description":"The response to fetch","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":127,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"editReply","description":"Edits a reply to this interaction.","see":["Webhook#editMessage"],"inherits":"MessageComponentInteraction#editReply","inherited":true,"implements":["InteractionResponses#editReply"],"examples":["// Edit the initial reply to this interaction\ninteraction.editReply('New content')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The new options for the message","type":[[["string"]],[["MessagePayload"]],[["InteractionEditReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":148,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"deleteReply","description":"Deletes a reply to this interaction.","see":["Webhook#deleteMessage"],"inherits":"MessageComponentInteraction#deleteReply","inherited":true,"implements":["InteractionResponses#deleteReply"],"examples":["// Delete the initial reply to this interaction\ninteraction.deleteReply()\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"message","description":"The response to delete","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":166,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"followUp","description":"Send a follow-up message to this interaction.","inherits":"MessageComponentInteraction#followUp","inherited":true,"implements":["InteractionResponses#followUp"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":175,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"deferUpdate","description":"Defers an update to the message to which the component was attached.","inherits":"MessageComponentInteraction#deferUpdate","inherited":true,"implements":["InteractionResponses#deferUpdate"],"examples":["// Defer updating and reset the component's loading state\ninteraction.deferUpdate()\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for deferring the update to this interaction","optional":true,"type":[[["InteractionDeferUpdateOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":190,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"update","description":"Updates the original message of the component on which the interaction was received on.","inherits":"MessageComponentInteraction#update","inherited":true,"implements":["InteractionResponses#update"],"examples":["// Remove the components from the message\ninteraction.update({\n content: \"A component interaction was received\",\n components: []\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the updated message","type":[[["string"]],[["MessagePayload"]],[["InteractionUpdateOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":216,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"showModal","description":"Shows a modal component","inherits":"MessageComponentInteraction#showModal","inherited":true,"implements":["InteractionResponses#showModal"],"params":[{"name":"modal","description":"The modal to show","type":[[["Modal"]],[["ModalOptions"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":243,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"awaitModalSubmit","description":"Collects a single modal submit interaction that passes the filter.\nThe Promise will reject if the time expires.","inherits":"MessageComponentInteraction#awaitModalSubmit","inherited":true,"implements":["InteractionResponses#awaitModalSubmit"],"examples":["// Collect a modal submit interaction\nconst filter = (interaction) => interaction.customId === 'modal';\ninteraction.awaitModalSubmit({ filter, time: 15_000 })\n .then(interaction => console.log(`${interaction.customId} was submitted!`))\n .catch(console.error);"],"params":[{"name":"options","description":"Options to pass to the internal collector","type":[[["AwaitModalSubmitOptions"]]]}],"returns":[[["Promise","<"],["ModalSubmitInteraction",">"]]],"meta":{"line":275,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"inGuild","description":"Indicates whether this interaction is received from a guild.","inherits":"Interaction#inGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":173,"file":"Interaction.js","path":"src/structures"}},{"name":"inCachedGuild","description":"Indicates whether or not this interaction is both cached and received from a guild.","inherits":"Interaction#inCachedGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":181,"file":"Interaction.js","path":"src/structures"}},{"name":"inRawGuild","description":"Indicates whether or not this interaction is received from an uncached guild.","inherits":"Interaction#inRawGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":189,"file":"Interaction.js","path":"src/structures"}},{"name":"isApplicationCommand","description":"Indicates whether this interaction is a {@link BaseCommandInteraction}.","inherits":"Interaction#isApplicationCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":197,"file":"Interaction.js","path":"src/structures"}},{"name":"isCommand","description":"Indicates whether this interaction is a {@link CommandInteraction}.","inherits":"Interaction#isCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":205,"file":"Interaction.js","path":"src/structures"}},{"name":"isContextMenu","description":"Indicates whether this interaction is a {@link ContextMenuInteraction}","inherits":"Interaction#isContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":213,"file":"Interaction.js","path":"src/structures"}},{"name":"isModalSubmit","description":"Indicates whether this interaction is a {@link ModalSubmitInteraction}","inherits":"Interaction#isModalSubmit","inherited":true,"returns":[[["boolean"]]],"meta":{"line":221,"file":"Interaction.js","path":"src/structures"}},{"name":"isUserContextMenu","description":"Indicates whether this interaction is a {@link UserContextMenuInteraction}","inherits":"Interaction#isUserContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":229,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageContextMenu","description":"Indicates whether this interaction is a {@link MessageContextMenuInteraction}","inherits":"Interaction#isMessageContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":237,"file":"Interaction.js","path":"src/structures"}},{"name":"isAutocomplete","description":"Indicates whether this interaction is an {@link AutocompleteInteraction}","inherits":"Interaction#isAutocomplete","inherited":true,"returns":[[["boolean"]]],"meta":{"line":245,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageComponent","description":"Indicates whether this interaction is a {@link MessageComponentInteraction}.","inherits":"Interaction#isMessageComponent","inherited":true,"returns":[[["boolean"]]],"meta":{"line":253,"file":"Interaction.js","path":"src/structures"}},{"name":"isButton","description":"Indicates whether this interaction is a {@link ButtonInteraction}.","inherits":"Interaction#isButton","inherited":true,"returns":[[["boolean"]]],"meta":{"line":261,"file":"Interaction.js","path":"src/structures"}},{"name":"isSelectMenu","description":"Indicates whether this interaction is a {@link SelectMenuInteraction}.","inherits":"Interaction#isSelectMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":272,"file":"Interaction.js","path":"src/structures"}},{"name":"isRepliable","description":"Indicates whether this interaction can be replied to.","inherits":"Interaction#isRepliable","inherited":true,"returns":[[["boolean"]]],"meta":{"line":283,"file":"Interaction.js","path":"src/structures"}}],"meta":{"line":9,"file":"SelectMenuInteraction.js","path":"src/structures"}},{"name":"SeparatorComponent","construct":{"name":"SeparatorComponent","params":[{"name":"data","description":"The data","optional":true,"default":"{}","type":[[["SeparatorComponent"]],[["APISeparatorComponent"]]]}]},"props":[{"name":"spacing","description":"Size of separator padding — SeparatorSpacingSizes.SMALL for small padding, SeparatorSpacingSizes.LARGE for large padding. Defaults to SeparatorSpacingSizes.SMALL","type":[[["SeparatorSpacingSizes"]]],"meta":{"line":27,"file":"SeparatorComponent.js","path":"src/structures"}},{"name":"divider","description":"Whether a visual divider should be displayed in the component. Defaults to true","type":[[["Boolean"]]],"meta":{"line":33,"file":"SeparatorComponent.js","path":"src/structures"}}],"methods":[{"name":"toJSON","returns":[[["APISeparatorComponent"]]],"meta":{"line":39,"file":"SeparatorComponent.js","path":"src/structures"}}],"meta":{"line":15,"file":"SeparatorComponent.js","path":"src/structures"}},{"name":"Session","description":"Represents a Client OAuth2 Application Team.","extends":[[["Base"]]],"props":[{"name":"id","description":"The session hash id","type":[[["string"]]],"meta":{"line":28,"file":"Session.js","path":"src/structures"}},{"name":"approxLastUsedTime","description":"The approximate last used time","type":[[["string"]]],"meta":{"line":35,"file":"Session.js","path":"src/structures"}},{"name":"clientInfo","description":"The client info","type":[[["SessionClientInfo"]]],"meta":{"line":42,"file":"Session.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the client was last used at.","readonly":true,"type":[[["number"]]],"meta":{"line":51,"file":"Session.js","path":"src/structures"}},{"name":"createdAt","description":"The time the client was last used at.","readonly":true,"type":[[["Date"]]],"meta":{"line":60,"file":"Session.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"logout","description":"Logout the client (remote).","returns":[[["Promise","<"],["void",">"]]],"meta":{"line":68,"file":"Session.js","path":"src/structures"}}],"meta":{"line":16,"file":"Session.js","path":"src/structures"}},{"name":"StageChannel","description":"Represents a guild stage channel on Discord.","extends":[[["BaseGuildVoiceChannel"]]],"props":[{"name":"topic","description":"The topic of the stage channel","nullable":true,"type":[[["string"]]],"meta":{"line":18,"file":"StageChannel.js","path":"src/structures"}},{"name":"stageInstance","description":"The stage instance of this stage channel, if it exists","readonly":true,"nullable":true,"type":[[["StageInstance"]]],"meta":{"line":27,"file":"StageChannel.js","path":"src/structures"}},{"name":"messages","description":"A manager of the messages sent to this channel","type":[[["MessageManager"]]],"meta":{"line":22,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"nsfw","description":"If the guild considers this channel NSFW","type":[[["boolean"]]],"meta":{"line":28,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"bitrate","description":"The bitrate of this voice-based channel","type":[[["number"]]],"meta":{"line":41,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"rtcRegion","description":"The RTC region for this voice-based channel. This region is automatically selected if `null`.","nullable":true,"type":[[["string"]]],"meta":{"line":49,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"userLimit","description":"The maximum amount of users allowed in this channel.","type":[[["number"]]],"meta":{"line":57,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"videoQualityMode","description":"The camera video quality mode of the channel.","nullable":true,"type":[[["VideoQualityMode"]]],"meta":{"line":65,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"lastMessageId","description":"The last message id sent in the channel, if one was sent","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":75,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"rateLimitPerUser","description":"The rate limit per user (slowmode) for this channel in seconds","type":[[["number"]]],"meta":{"line":87,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"status","description":"The status of the voice channel (max 500 characters)","nullable":true,"type":[[["string"]]],"meta":{"line":99,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"members","description":"The members in this voice-based channel","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":108,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"full","description":"Checks if the voice-based channel is full","readonly":true,"type":[[["boolean"]]],"meta":{"line":123,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"joinable","description":"Whether the channel is joinable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":132,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"lastMessage","description":"The Message object of the last message in the channel, if one was sent","readonly":true,"nullable":true,"type":[[["Message"]]],"meta":{"line":51,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"guild","description":"The guild the channel is in","type":[[["Guild"]]],"meta":{"line":31,"file":"GuildChannel.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild the channel is in","type":[[["Snowflake"]]],"meta":{"line":37,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionOverwrites","description":"A manager of permission overwrites that belong to this channel","type":[[["PermissionOverwriteManager"]]],"meta":{"line":44,"file":"GuildChannel.js","path":"src/structures"}},{"name":"name","description":"The name of the guild channel","type":[[["string"]]],"meta":{"line":57,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rawPosition","description":"The raw position of the channel from Discord","type":[[["number"]]],"meta":{"line":65,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parentId","description":"The id of the category parent of this channel","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":77,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parent","description":"The category parent of this channel","readonly":true,"nullable":true,"type":[[["CategoryChannel"]]],"meta":{"line":99,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionsLocked","description":"If the permissionOverwrites match the parent channel, null if no parent","readonly":true,"nullable":true,"type":[[["boolean"]]],"meta":{"line":108,"file":"GuildChannel.js","path":"src/structures"}},{"name":"position","description":"The position of the channel","readonly":true,"type":[[["number"]]],"meta":{"line":149,"file":"GuildChannel.js","path":"src/structures"}},{"name":"deletable","description":"Whether the channel is deletable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":418,"file":"GuildChannel.js","path":"src/structures"}},{"name":"manageable","description":"Whether the channel is manageable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":427,"file":"GuildChannel.js","path":"src/structures"}},{"name":"viewable","description":"Whether the channel is viewable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":447,"file":"GuildChannel.js","path":"src/structures"}},{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the channel was created at","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"Channel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the channel was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":79,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"partial","description":"Whether this Channel is a partial\nThis is always false outside of DM channels.","readonly":true,"type":[[["boolean"]]],"meta":{"line":119,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"createStageInstance","description":"Creates a stage instance associated with this stage channel.","params":[{"name":"options","description":"The options to create the stage instance","type":[[["StageInstanceCreateOptions"]]]}],"returns":[[["Promise","<"],["StageInstance",">"]]],"meta":{"line":36,"file":"StageChannel.js","path":"src/structures"}},{"name":"setTopic","description":"Sets a new topic for the guild channel.","examples":["// Set a new channel topic\nchannel.setTopic('needs more rate limiting')\n .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))\n .catch(console.error);"],"params":[{"name":"topic","description":"The new topic for the guild channel","nullable":true,"type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's topic","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":51,"file":"StageChannel.js","path":"src/structures"}},{"name":"createInvite","description":"Creates an invite to this guild channel.","inherits":"BaseGuildVoiceChannel#createInvite","inherited":true,"examples":["// Create an invite to a channel\nchannel.createInvite()\n .then(invite => console.log(`Created an invite with a code of ${invite.code}`))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for creating the invite","optional":true,"default":"{}","type":[[["CreateInviteOptions"]]]}],"returns":[[["Promise","<"],["Invite",">"]]],"meta":{"line":156,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"fetchInvites","description":"Fetches a collection of invites to this guild channel.\nResolves with a collection mapping invites by their codes.","inherits":"BaseGuildVoiceChannel#fetchInvites","inherited":true,"params":[{"name":"cache","description":"Whether or not to cache the fetched invites","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Collection","<"],["string",", "],["Invite",">>"]]],"meta":{"line":166,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"setBitrate","description":"Sets the bitrate of the channel.","inherits":"BaseGuildVoiceChannel#setBitrate","inherited":true,"examples":["// Set the bitrate of a voice channel\nchannel.setBitrate(48_000)\n .then(channel => console.log(`Set bitrate to ${channel.bitrate}bps for ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"bitrate","description":"The new bitrate","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the channel's bitrate","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["BaseGuildVoiceChannel",">"]]],"meta":{"line":181,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"setRTCRegion","description":"Sets the RTC region of the channel.","inherits":"BaseGuildVoiceChannel#setRTCRegion","inherited":true,"examples":["// Set the RTC region to sydney\nchannel.setRTCRegion('sydney');","// Remove a fixed region for this channel - let Discord decide automatically\nchannel.setRTCRegion(null, 'We want to let Discord decide.');"],"params":[{"name":"rtcRegion","description":"The new region of the channel. Set to `null` to remove a specific region for the channel","nullable":true,"type":[[["string"]]]},{"name":"reason","description":"The reason for modifying this region.","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["BaseGuildVoiceChannel",">"]]],"meta":{"line":197,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"setUserLimit","description":"Sets the user limit of the channel.","inherits":"BaseGuildVoiceChannel#setUserLimit","inherited":true,"examples":["// Set the user limit of a voice channel\nchannel.setUserLimit(42)\n .then(channel => console.log(`Set user limit to ${channel.userLimit} for ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"userLimit","description":"The new user limit","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the user limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["BaseGuildVoiceChannel",">"]]],"meta":{"line":212,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"setVideoQualityMode","description":"Sets the camera video quality mode of the channel.","inherits":"BaseGuildVoiceChannel#setVideoQualityMode","inherited":true,"params":[{"name":"videoQualityMode","description":"The new camera video quality mode.","type":[[["VideoQualityMode"]],[["number"]]]},{"name":"reason","description":"Reason for changing the camera video quality mode.","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["BaseGuildVoiceChannel",">"]]],"meta":{"line":222,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"send","description":"Sends a message to this channel.","inherits":"BaseGuildVoiceChannel#send","inherited":true,"implements":["TextBasedChannel#send"],"examples":["// Send a basic message\nchannel.send('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.error);","// Send a remote file\nchannel.send({\n files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']\n})\n .then(console.log)\n .catch(console.error);","// Send a local file\nchannel.send({\n files: [{\n attachment: 'entire/path/to/file.jpg',\n name: 'file.jpg',\n description: 'A description of the file'\n }]\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["MessageOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":181,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"sendTyping","description":"Sends a typing indicator in the channel.","inherits":"BaseGuildVoiceChannel#sendTyping","inherited":true,"implements":["TextBasedChannel#sendTyping"],"examples":["// Start typing in a channel\nchannel.sendTyping();"],"returns":{"types":[[["Promise","<({"],["message_send_cooldown_ms",": "],["number",", "],["thread_create_cooldown_ms",": "],["number","}|"],["void",")>"]]],"description":"Resolves upon the typing status being sent"},"meta":{"line":395,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createMessageCollector","description":"Creates a Message Collector.","inherits":"BaseGuildVoiceChannel#createMessageCollector","inherited":true,"implements":["TextBasedChannel#createMessageCollector"],"examples":["// Create a message collector\nconst filter = m => m.content.includes('discord');\nconst collector = channel.createMessageCollector({ filter, time: 15_000 });\ncollector.on('collect', m => console.log(`Collected ${m.content}`));\ncollector.on('end', collected => console.log(`Collected ${collected.size} items`));"],"params":[{"name":"options","description":"The options to pass to the collector","optional":true,"default":"{}","type":[[["MessageCollectorOptions"]]]}],"returns":[[["MessageCollector"]]],"meta":{"line":410,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"awaitMessages","description":"Similar to createMessageCollector but in promise form.\nResolves with a collection of messages that pass the specified filter.","inherits":"BaseGuildVoiceChannel#awaitMessages","inherited":true,"implements":["TextBasedChannel#awaitMessages"],"examples":["// Await !vote messages\nconst filter = m => m.content.startsWith('!vote');\n// Errors: ['time'] treats ending because of the time limit as an error\nchannel.awaitMessages({ filter, max: 4, time: 60_000, errors: ['time'] })\n .then(collected => console.log(collected.size))\n .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));"],"params":[{"name":"options","description":"Optional options to pass to the internal collector","optional":true,"default":"{}","type":[[["AwaitMessagesOptions"]]]}],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Message",">>"]]],"meta":{"line":433,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"fetchWebhooks","description":"Fetches all webhooks for the channel.","inherits":"BaseGuildVoiceChannel#fetchWebhooks","inherited":true,"implements":["TextBasedChannel#fetchWebhooks"],"examples":["// Fetch webhooks\nchannel.fetchWebhooks()\n .then(hooks => console.log(`This channel has ${hooks.size} hooks`))\n .catch(console.error);"],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Webhook",">>"]]],"meta":{"line":455,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createWebhook","description":"Creates a webhook for the channel.","inherits":"BaseGuildVoiceChannel#createWebhook","inherited":true,"implements":["TextBasedChannel#createWebhook"],"examples":["// Create a webhook for the current channel\nchannel.createWebhook('Snek', {\n avatar: 'https://i.imgur.com/mI8XcpG.jpg',\n reason: 'Needed a cool new Webhook'\n})\n .then(console.log)\n .catch(console.error)"],"params":[{"name":"name","description":"The name of the webhook","type":[[["string"]]]},{"name":"options","description":"Options for creating the webhook","optional":true,"type":[[["ChannelWebhookCreateOptions"]]]}],"returns":{"types":[[["Promise","<"],["Webhook",">"]]],"description":"Returns the created Webhook"},"meta":{"line":480,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setRateLimitPerUser","description":"Sets the rate limit per user (slowmode) for this channel.","inherits":"BaseGuildVoiceChannel#setRateLimitPerUser","inherited":true,"implements":["TextBasedChannel#setRateLimitPerUser"],"params":[{"name":"rateLimitPerUser","description":"The new rate limit in seconds","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the channel's rate limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":490,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setNSFW","description":"Sets whether this channel is flagged as NSFW.","inherits":"BaseGuildVoiceChannel#setNSFW","inherited":true,"implements":["TextBasedChannel#setNSFW"],"params":[{"name":"nsfw","description":"Whether the channel should be considered NSFW","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for changing the channel's NSFW flag","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":500,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"permissionsFor","description":"Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.","inherits":"GuildChannel#permissionsFor","inherited":true,"params":[{"name":"memberOrRole","description":"The member or role to obtain the overall permissions for","type":[[["GuildMemberResolvable"]],[["RoleResolvable"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":{"types":[[["Readonly","<"],["Permissions",">"]]],"nullable":true},"meta":{"line":173,"file":"GuildChannel.js","path":"src/structures"}},{"name":"memberPermissions","description":"Gets the overall set of permissions for a member in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#memberPermissions","inherited":true,"params":[{"name":"member","description":"The member to obtain the overall permissions for","type":[[["GuildMember"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","default":true,"type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":213,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rolePermissions","description":"Gets the overall set of permissions for a role in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#rolePermissions","inherited":true,"params":[{"name":"role","description":"The role to obtain the overall permissions for","type":[[["Role"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":242,"file":"GuildChannel.js","path":"src/structures"}},{"name":"lockPermissions","description":"Locks in the permission overwrites from the parent channel.","inherits":"GuildChannel#lockPermissions","inherited":true,"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":263,"file":"GuildChannel.js","path":"src/structures"}},{"name":"edit","description":"Edits the channel.","inherits":"GuildChannel#edit","inherited":true,"examples":["// Edit a channel\nchannel.edit({ name: 'new-channel' })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"data","description":"The new data for the channel","type":[[["ChannelData"]]]},{"name":"reason","description":"Reason for editing this channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":291,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setName","description":"Sets a new name for the guild channel.","inherits":"GuildChannel#setName","inherited":true,"examples":["// Set a new channel name\nchannel.setName('not_general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.error);"],"params":[{"name":"name","description":"The new name for the guild channel","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":306,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setParent","description":"Sets the parent of this channel.","inherits":"GuildChannel#setParent","inherited":true,"examples":["// Add a parent to a channel\nmessage.channel.setParent('355908108431917066', { lockPermissions: false })\n .then(channel => console.log(`New parent of ${message.channel.name}: ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"channel","description":"The category channel to set as the parent","nullable":true,"type":[[["CategoryChannelResolvable"]]]},{"name":"options","description":"The options for setting the parent","optional":true,"default":"{}","type":[[["SetParentOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":328,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setPosition","description":"Sets a new position for the guild channel.","inherits":"GuildChannel#setPosition","inherited":true,"examples":["// Set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.error);"],"params":[{"name":"position","description":"The new position for the guild channel","type":[[["number"]]]},{"name":"options","description":"Options for setting position","optional":true,"type":[[["SetChannelPositionOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":356,"file":"GuildChannel.js","path":"src/structures"}},{"name":"clone","description":"Clones this channel.","inherits":"GuildChannel#clone","inherited":true,"params":[{"name":"options","description":"The options for cloning this channel","optional":true,"type":[[["GuildChannelCloneOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":371,"file":"GuildChannel.js","path":"src/structures"}},{"name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites, and id as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","inherits":"GuildChannel#equals","inherited":true,"params":[{"name":"channel","description":"Channel to compare with","type":[[["GuildChannel"]]]}],"returns":[[["boolean"]]],"meta":{"line":393,"file":"GuildChannel.js","path":"src/structures"}},{"name":"delete","description":"Deletes this channel.","inherits":"GuildChannel#delete","inherited":true,"examples":["// Delete the channel\nchannel.delete('making room for new channels')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"reason","description":"Reason for deleting this channel","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":464,"file":"GuildChannel.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.","inherits":"Channel#toString","inherited":true,"examples":["// Logs: Hello from <#123456789012345678>!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":130,"file":"Channel.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this channel.","inherits":"Channel#fetch","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":153,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","inherits":"Channel#isText","inherited":true,"returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","inherits":"Channel#isVoice","inherited":true,"returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","inherits":"Channel#isThread","inherited":true,"returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","inherits":"Channel#isThreadOnly","inherited":true,"returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","inherits":"Channel#isDirectory","inherited":true,"returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":9,"file":"StageChannel.js","path":"src/structures"}},{"name":"StageInstance","description":"Represents a stage instance.","extends":[[["Base"]]],"props":[{"name":"id","description":"The stage instance's id","type":[[["Snowflake"]]],"meta":{"line":28,"file":"StageInstance.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild associated with the stage channel","type":[[["Snowflake"]]],"meta":{"line":39,"file":"StageInstance.js","path":"src/structures"}},{"name":"channelId","description":"The id of the channel associated with the stage channel","type":[[["Snowflake"]]],"meta":{"line":47,"file":"StageInstance.js","path":"src/structures"}},{"name":"topic","description":"The topic of the stage instance","type":[[["string"]]],"meta":{"line":55,"file":"StageInstance.js","path":"src/structures"}},{"name":"privacyLevel","description":"The privacy level of the stage instance","type":[[["PrivacyLevel"]]],"meta":{"line":63,"file":"StageInstance.js","path":"src/structures"}},{"name":"discoverableDisabled","description":"Whether or not stage discovery is disabled","nullable":true,"type":[[["boolean"]]],"meta":{"line":71,"file":"StageInstance.js","path":"src/structures"}},{"name":"guildScheduledEventId","description":"The associated guild scheduled event id of this stage instance","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":81,"file":"StageInstance.js","path":"src/structures"}},{"name":"channel","description":"The stage channel associated with this stage instance","readonly":true,"nullable":true,"type":[[["StageChannel"]]],"meta":{"line":92,"file":"StageInstance.js","path":"src/structures"}},{"name":"guildScheduledEvent","description":"The associated guild scheduled event of this stage instance","readonly":true,"nullable":true,"type":[[["GuildScheduledEvent"]]],"meta":{"line":101,"file":"StageInstance.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the stage instance has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":110,"file":"StageInstance.js","path":"src/structures"}},{"name":"guild","description":"The guild this stage instance belongs to","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":140,"file":"StageInstance.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp this stage instances was created at","readonly":true,"type":[[["number"]]],"meta":{"line":193,"file":"StageInstance.js","path":"src/structures"}},{"name":"createdAt","description":"The time this stage instance was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":202,"file":"StageInstance.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"edit","description":"Edits this stage instance.","examples":["// Edit a stage instance\nstageInstance.edit({ topic: 'new topic' })\n .then(stageInstance => console.log(stageInstance))\n .catch(console.error)"],"params":[{"name":"options","description":"The options to edit the stage instance","type":[[["StageInstanceEditOptions"]]]}],"returns":[[["Promise","<"],["StageInstance",">"]]],"meta":{"line":154,"file":"StageInstance.js","path":"src/structures"}},{"name":"delete","description":"Deletes this stage instance.","examples":["// Delete a stage instance\nstageInstance.delete()\n .then(stageInstance => console.log(stageInstance))\n .catch(console.error);"],"async":true,"returns":[[["Promise","<"],["StageInstance",">"]]],"meta":{"line":167,"file":"StageInstance.js","path":"src/structures"}},{"name":"setTopic","description":"Sets the topic of this stage instance.","examples":["// Set topic of a stage instance\nstageInstance.setTopic('new topic')\n .then(stageInstance => console.log(`Set the topic to: ${stageInstance.topic}`))\n .catch(console.error);"],"params":[{"name":"topic","description":"The topic for the stage instance","type":[[["string"]]]}],"returns":[[["Promise","<"],["StageInstance",">"]]],"meta":{"line":184,"file":"StageInstance.js","path":"src/structures"}}],"meta":{"line":20,"file":"StageInstance.js","path":"src/structures"}},{"name":"Sticker","description":"Represents a Sticker.","extends":[[["Base"]]],"props":[{"name":"id","description":"The sticker's id","type":[[["Snowflake"]]],"meta":{"line":33,"file":"Sticker.js","path":"src/structures"}},{"name":"description","description":"The description of the sticker","nullable":true,"type":[[["string"]]],"meta":{"line":40,"file":"Sticker.js","path":"src/structures"}},{"name":"type","description":"The type of the sticker","nullable":true,"type":[[["StickerType"]]],"meta":{"line":50,"file":"Sticker.js","path":"src/structures"}},{"name":"format","description":"The format of the sticker","type":[[["StickerFormatType"]]],"meta":{"line":60,"file":"Sticker.js","path":"src/structures"}},{"name":"name","description":"The name of the sticker","type":[[["string"]]],"meta":{"line":68,"file":"Sticker.js","path":"src/structures"}},{"name":"packId","description":"The id of the pack the sticker is from, for standard stickers","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":76,"file":"Sticker.js","path":"src/structures"}},{"name":"tags","description":"An array of tags for the sticker","nullable":true,"type":[[["Array","<"],["string",">"]]],"meta":{"line":86,"file":"Sticker.js","path":"src/structures"}},{"name":"available","description":"Whether or not the guild sticker is available","nullable":true,"type":[[["boolean"]]],"meta":{"line":96,"file":"Sticker.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild that owns this sticker","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":106,"file":"Sticker.js","path":"src/structures"}},{"name":"user","description":"The user that uploaded the guild sticker","nullable":true,"type":[[["User"]]],"meta":{"line":116,"file":"Sticker.js","path":"src/structures"}},{"name":"sortValue","description":"The standard sticker's sort order within its pack","nullable":true,"type":[[["number"]]],"meta":{"line":126,"file":"Sticker.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the sticker was created at","readonly":true,"type":[[["number"]]],"meta":{"line":137,"file":"Sticker.js","path":"src/structures"}},{"name":"createdAt","description":"The time the sticker was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":146,"file":"Sticker.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the sticker has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":155,"file":"Sticker.js","path":"src/structures"}},{"name":"partial","description":"Whether this sticker is partial","readonly":true,"type":[[["boolean"]]],"meta":{"line":185,"file":"Sticker.js","path":"src/structures"}},{"name":"guild","description":"The guild that owns this sticker","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":194,"file":"Sticker.js","path":"src/structures"}},{"name":"url","description":"A link to the sticker\nIf the sticker's format is LOTTIE, it returns the URL of the Lottie JSON file.","type":[[["string"]]],"meta":{"line":203,"file":"Sticker.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"fetch","description":"Fetches this sticker.","async":true,"returns":[[["Promise","<"],["Sticker",">"]]],"meta":{"line":211,"file":"Sticker.js","path":"src/structures"}},{"name":"fetchPack","description":"Fetches the pack this sticker is part of from Discord, if this is a Nitro sticker.","async":true,"returns":[[["Promise",""]]],"meta":{"line":221,"file":"Sticker.js","path":"src/structures"}},{"name":"fetchUser","description":"Fetches the user who uploaded this sticker, if this is a guild sticker.","async":true,"returns":[[["Promise",""]]],"meta":{"line":229,"file":"Sticker.js","path":"src/structures"}},{"name":"edit","description":"Edits the sticker.","examples":["// Update the name of a sticker\nsticker.edit({ name: 'new name' })\n .then(s => console.log(`Updated the name of the sticker to ${s.name}`))\n .catch(console.error);"],"params":[{"name":"data","description":"The new data for the sticker","optional":true,"type":[[["GuildStickerEditData"]]]},{"name":"reason","description":"Reason for editing this sticker","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["Sticker",">"]]],"meta":{"line":254,"file":"Sticker.js","path":"src/structures"}},{"name":"delete","description":"Deletes the sticker.","examples":["// Delete a message\nsticker.delete()\n .then(s => console.log(`Deleted sticker ${s.name}`))\n .catch(console.error);"],"params":[{"name":"reason","description":"Reason for deleting this sticker","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Sticker",">"]]],"meta":{"line":268,"file":"Sticker.js","path":"src/structures"}},{"name":"equals","description":"Whether this sticker is the same as another one.","params":[{"name":"other","description":"The sticker to compare it to","type":[[["Sticker"]],[["APISticker"]]]}],"returns":[[["boolean"]]],"meta":{"line":278,"file":"Sticker.js","path":"src/structures"}}],"meta":{"line":21,"file":"Sticker.js","path":"src/structures"}},{"name":"StickerPack","description":"Represents a pack of standard stickers.","extends":[[["Base"]]],"props":[{"name":"id","description":"The Sticker pack's id","type":[[["Snowflake"]]],"meta":{"line":19,"file":"StickerPack.js","path":"src/structures"}},{"name":"stickers","description":"The stickers in the pack","type":[[["Collection","<"],["Snowflake",", "],["Sticker",">"]]],"meta":{"line":25,"file":"StickerPack.js","path":"src/structures"}},{"name":"name","description":"The name of the sticker pack","type":[[["string"]]],"meta":{"line":31,"file":"StickerPack.js","path":"src/structures"}},{"name":"skuId","description":"The id of the pack's SKU","type":[[["Snowflake"]]],"meta":{"line":37,"file":"StickerPack.js","path":"src/structures"}},{"name":"coverStickerId","description":"The id of a sticker in the pack which is shown as the pack's icon","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":43,"file":"StickerPack.js","path":"src/structures"}},{"name":"description","description":"The description of the sticker pack","type":[[["string"]]],"meta":{"line":49,"file":"StickerPack.js","path":"src/structures"}},{"name":"bannerId","description":"The id of the sticker pack's banner image","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":55,"file":"StickerPack.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the sticker was created at","readonly":true,"type":[[["number"]]],"meta":{"line":63,"file":"StickerPack.js","path":"src/structures"}},{"name":"createdAt","description":"The time the sticker was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":72,"file":"StickerPack.js","path":"src/structures"}},{"name":"coverSticker","description":"The sticker which is shown as the pack's icon","readonly":true,"nullable":true,"type":[[["Sticker"]]],"meta":{"line":81,"file":"StickerPack.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"bannerURL","description":"The URL to this sticker pack's banner.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":90,"file":"StickerPack.js","path":"src/structures"}}],"meta":{"line":12,"file":"StickerPack.js","path":"src/structures"}},{"name":"StoreChannel","description":"Represents a guild store channel on Discord.\nStore channels have been removed from Discord. See\n[Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/6309018858647)\nfor more information.","extends":[[["GuildChannel"]]],"props":[{"name":"nsfw","description":"If the guild considers this channel NSFW","type":[[["boolean"]]],"meta":{"line":20,"file":"StoreChannel.js","path":"src/structures"}},{"name":"guild","description":"The guild the channel is in","type":[[["Guild"]]],"meta":{"line":31,"file":"GuildChannel.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild the channel is in","type":[[["Snowflake"]]],"meta":{"line":37,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionOverwrites","description":"A manager of permission overwrites that belong to this channel","type":[[["PermissionOverwriteManager"]]],"meta":{"line":44,"file":"GuildChannel.js","path":"src/structures"}},{"name":"name","description":"The name of the guild channel","type":[[["string"]]],"meta":{"line":57,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rawPosition","description":"The raw position of the channel from Discord","type":[[["number"]]],"meta":{"line":65,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parentId","description":"The id of the category parent of this channel","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":77,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parent","description":"The category parent of this channel","readonly":true,"nullable":true,"type":[[["CategoryChannel"]]],"meta":{"line":99,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionsLocked","description":"If the permissionOverwrites match the parent channel, null if no parent","readonly":true,"nullable":true,"type":[[["boolean"]]],"meta":{"line":108,"file":"GuildChannel.js","path":"src/structures"}},{"name":"position","description":"The position of the channel","readonly":true,"type":[[["number"]]],"meta":{"line":149,"file":"GuildChannel.js","path":"src/structures"}},{"name":"members","description":"A collection of cached members of this channel, mapped by their ids.\nMembers that can view this channel, if the channel is text-based.\nMembers in the channel, if the channel is voice-based.","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":276,"file":"GuildChannel.js","path":"src/structures"}},{"name":"deletable","description":"Whether the channel is deletable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":418,"file":"GuildChannel.js","path":"src/structures"}},{"name":"manageable","description":"Whether the channel is manageable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":427,"file":"GuildChannel.js","path":"src/structures"}},{"name":"viewable","description":"Whether the channel is viewable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":447,"file":"GuildChannel.js","path":"src/structures"}},{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the channel was created at","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"Channel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the channel was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":79,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"partial","description":"Whether this Channel is a partial\nThis is always false outside of DM channels.","readonly":true,"type":[[["boolean"]]],"meta":{"line":119,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"createInvite","description":"Creates an invite to this guild channel.","examples":["// Create an invite to a channel\nchannel.createInvite()\n .then(invite => console.log(`Created an invite with a code of ${invite.code}`))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for creating the invite","optional":true,"default":"{}","type":[[["CreateInviteOptions"]]]}],"returns":[[["Promise","<"],["Invite",">"]]],"meta":{"line":41,"file":"StoreChannel.js","path":"src/structures"}},{"name":"fetchInvites","description":"Fetches a collection of invites to this guild channel.\nResolves with a collection mapping invites by their codes.","params":[{"name":"cache","description":"Whether or not to cache the fetched invites","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Collection","<"],["string",", "],["Invite",">>"]]],"meta":{"line":51,"file":"StoreChannel.js","path":"src/structures"}},{"name":"permissionsFor","description":"Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.","inherits":"GuildChannel#permissionsFor","inherited":true,"params":[{"name":"memberOrRole","description":"The member or role to obtain the overall permissions for","type":[[["GuildMemberResolvable"]],[["RoleResolvable"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":{"types":[[["Readonly","<"],["Permissions",">"]]],"nullable":true},"meta":{"line":173,"file":"GuildChannel.js","path":"src/structures"}},{"name":"memberPermissions","description":"Gets the overall set of permissions for a member in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#memberPermissions","inherited":true,"params":[{"name":"member","description":"The member to obtain the overall permissions for","type":[[["GuildMember"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","default":true,"type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":213,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rolePermissions","description":"Gets the overall set of permissions for a role in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#rolePermissions","inherited":true,"params":[{"name":"role","description":"The role to obtain the overall permissions for","type":[[["Role"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":242,"file":"GuildChannel.js","path":"src/structures"}},{"name":"lockPermissions","description":"Locks in the permission overwrites from the parent channel.","inherits":"GuildChannel#lockPermissions","inherited":true,"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":263,"file":"GuildChannel.js","path":"src/structures"}},{"name":"edit","description":"Edits the channel.","inherits":"GuildChannel#edit","inherited":true,"examples":["// Edit a channel\nchannel.edit({ name: 'new-channel' })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"data","description":"The new data for the channel","type":[[["ChannelData"]]]},{"name":"reason","description":"Reason for editing this channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":291,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setName","description":"Sets a new name for the guild channel.","inherits":"GuildChannel#setName","inherited":true,"examples":["// Set a new channel name\nchannel.setName('not_general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.error);"],"params":[{"name":"name","description":"The new name for the guild channel","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":306,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setParent","description":"Sets the parent of this channel.","inherits":"GuildChannel#setParent","inherited":true,"examples":["// Add a parent to a channel\nmessage.channel.setParent('355908108431917066', { lockPermissions: false })\n .then(channel => console.log(`New parent of ${message.channel.name}: ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"channel","description":"The category channel to set as the parent","nullable":true,"type":[[["CategoryChannelResolvable"]]]},{"name":"options","description":"The options for setting the parent","optional":true,"default":"{}","type":[[["SetParentOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":328,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setPosition","description":"Sets a new position for the guild channel.","inherits":"GuildChannel#setPosition","inherited":true,"examples":["// Set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.error);"],"params":[{"name":"position","description":"The new position for the guild channel","type":[[["number"]]]},{"name":"options","description":"Options for setting position","optional":true,"type":[[["SetChannelPositionOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":356,"file":"GuildChannel.js","path":"src/structures"}},{"name":"clone","description":"Clones this channel.","inherits":"GuildChannel#clone","inherited":true,"params":[{"name":"options","description":"The options for cloning this channel","optional":true,"type":[[["GuildChannelCloneOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":371,"file":"GuildChannel.js","path":"src/structures"}},{"name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites, and id as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","inherits":"GuildChannel#equals","inherited":true,"params":[{"name":"channel","description":"Channel to compare with","type":[[["GuildChannel"]]]}],"returns":[[["boolean"]]],"meta":{"line":393,"file":"GuildChannel.js","path":"src/structures"}},{"name":"delete","description":"Deletes this channel.","inherits":"GuildChannel#delete","inherited":true,"examples":["// Delete the channel\nchannel.delete('making room for new channels')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"reason","description":"Reason for deleting this channel","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":464,"file":"GuildChannel.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.","inherits":"Channel#toString","inherited":true,"examples":["// Logs: Hello from <#123456789012345678>!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":130,"file":"Channel.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this channel.","inherits":"Channel#fetch","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":153,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","inherits":"Channel#isText","inherited":true,"returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","inherits":"Channel#isVoice","inherited":true,"returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","inherits":"Channel#isThread","inherited":true,"returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","inherits":"Channel#isThreadOnly","inherited":true,"returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","inherits":"Channel#isDirectory","inherited":true,"returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":12,"file":"StoreChannel.js","path":"src/structures"}},{"name":"Team","description":"Represents a Client OAuth2 Application Team.","extends":[[["Base"]]],"props":[{"name":"id","description":"The Team's id","type":[[["Snowflake"]]],"meta":{"line":23,"file":"Team.js","path":"src/structures"}},{"name":"name","description":"The name of the Team","type":[[["string"]]],"meta":{"line":30,"file":"Team.js","path":"src/structures"}},{"name":"icon","description":"The Team's icon hash","nullable":true,"type":[[["string"]]],"meta":{"line":38,"file":"Team.js","path":"src/structures"}},{"name":"ownerId","description":"The Team's owner id","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":48,"file":"Team.js","path":"src/structures"}},{"name":"members","description":"The Team's members","type":[[["Collection","<"],["Snowflake",", "],["TeamMember",">"]]],"meta":{"line":56,"file":"Team.js","path":"src/structures"}},{"name":"owner","description":"The owner of this team","readonly":true,"nullable":true,"type":[[["TeamMember"]]],"meta":{"line":69,"file":"Team.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the team was created at","readonly":true,"type":[[["number"]]],"meta":{"line":78,"file":"Team.js","path":"src/structures"}},{"name":"createdAt","description":"The time the team was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":87,"file":"Team.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"iconURL","description":"A link to the team's icon.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":96,"file":"Team.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the Team's name instead of the\nTeam object.","examples":["// Logs: Team name: My Team\nconsole.log(`Team name: ${team}`);"],"returns":[[["string"]]],"meta":{"line":109,"file":"Team.js","path":"src/structures"}}],"meta":{"line":12,"file":"Team.js","path":"src/structures"}},{"name":"TeamMember","description":"Represents a Client OAuth2 Application Team Member.","extends":[[["Base"]]],"props":[{"name":"team","description":"The Team this member is part of","type":[[["Team"]]],"meta":{"line":18,"file":"TeamMember.js","path":"src/structures"}},{"name":"permissions","description":"The permissions this Team Member has with regard to the team","deprecated":"Use {@link TeamMember#role} instead.","type":[[["Array","<"],["string",">"]]],"meta":{"line":30,"file":"TeamMember.js","path":"src/structures"}},{"name":"role","description":"The role of this Team Member","type":[[["TeamMemberRole"]]],"meta":{"line":38,"file":"TeamMember.js","path":"src/structures"}},{"name":"membershipState","description":"The permissions this Team Member has with regard to the team","type":[[["MembershipState"]]],"meta":{"line":46,"file":"TeamMember.js","path":"src/structures"}},{"name":"user","description":"The user for this Team Member","type":[[["User"]]],"meta":{"line":54,"file":"TeamMember.js","path":"src/structures"}},{"name":"id","description":"The Team Member's id","readonly":true,"type":[[["Snowflake"]]],"meta":{"line":63,"file":"TeamMember.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"toString","description":"When concatenated with a string, this automatically returns the team member's mention instead of the\nTeamMember object.","examples":["// Logs: Team Member's mention: <@123456789012345678>\nconsole.log(`Team Member's mention: ${teamMember}`);"],"returns":[[["string"]]],"meta":{"line":75,"file":"TeamMember.js","path":"src/structures"}}],"meta":{"line":10,"file":"TeamMember.js","path":"src/structures"}},{"name":"TextChannel","description":"Represents a guild text channel on Discord.","extends":[[["BaseGuildTextChannel"]]],"props":[{"name":"rateLimitPerUser","description":"The rate limit per user (slowmode) for this channel in seconds","type":[[["number"]]],"meta":{"line":18,"file":"TextChannel.js","path":"src/structures"}},{"name":"messages","description":"A manager of the messages sent to this channel","type":[[["MessageManager"]]],"meta":{"line":21,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"threads","description":"A manager of the threads belonging to this channel","type":[[["GuildTextThreadManager"]]],"meta":{"line":27,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"nsfw","description":"If the guild considers this channel NSFW","type":[[["boolean"]]],"meta":{"line":33,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"topic","description":"The topic of the text channel","nullable":true,"type":[[["string"]]],"meta":{"line":46,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"lastMessageId","description":"The last message id sent in the channel, if one was sent","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":58,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"lastPinTimestamp","description":"The timestamp when the last pinned message was pinned, if there was one","nullable":true,"type":[[["number"]]],"meta":{"line":66,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"defaultAutoArchiveDuration","description":"The default auto archive duration for newly created threads in this channel","nullable":true,"type":[[["number"]]],"meta":{"line":74,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"defaultThreadRateLimitPerUser","description":"The initial rate limit per user (slowmode) to set on newly created threads in a channel.","nullable":true,"type":[[["number"]]],"meta":{"line":82,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"lastMessage","description":"The Message object of the last message in the channel, if one was sent","readonly":true,"nullable":true,"type":[[["Message"]]],"meta":{"line":51,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"lastPinAt","description":"The date when the last pinned message was pinned, if there was one","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":60,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"guild","description":"The guild the channel is in","type":[[["Guild"]]],"meta":{"line":31,"file":"GuildChannel.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild the channel is in","type":[[["Snowflake"]]],"meta":{"line":37,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionOverwrites","description":"A manager of permission overwrites that belong to this channel","type":[[["PermissionOverwriteManager"]]],"meta":{"line":44,"file":"GuildChannel.js","path":"src/structures"}},{"name":"name","description":"The name of the guild channel","type":[[["string"]]],"meta":{"line":57,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rawPosition","description":"The raw position of the channel from Discord","type":[[["number"]]],"meta":{"line":65,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parentId","description":"The id of the category parent of this channel","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":77,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parent","description":"The category parent of this channel","readonly":true,"nullable":true,"type":[[["CategoryChannel"]]],"meta":{"line":99,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionsLocked","description":"If the permissionOverwrites match the parent channel, null if no parent","readonly":true,"nullable":true,"type":[[["boolean"]]],"meta":{"line":108,"file":"GuildChannel.js","path":"src/structures"}},{"name":"position","description":"The position of the channel","readonly":true,"type":[[["number"]]],"meta":{"line":149,"file":"GuildChannel.js","path":"src/structures"}},{"name":"members","description":"A collection of cached members of this channel, mapped by their ids.\nMembers that can view this channel, if the channel is text-based.\nMembers in the channel, if the channel is voice-based.","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":276,"file":"GuildChannel.js","path":"src/structures"}},{"name":"deletable","description":"Whether the channel is deletable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":418,"file":"GuildChannel.js","path":"src/structures"}},{"name":"manageable","description":"Whether the channel is manageable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":427,"file":"GuildChannel.js","path":"src/structures"}},{"name":"viewable","description":"Whether the channel is viewable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":447,"file":"GuildChannel.js","path":"src/structures"}},{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the channel was created at","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"Channel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the channel was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":79,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"partial","description":"Whether this Channel is a partial\nThis is always false outside of DM channels.","readonly":true,"type":[[["boolean"]]],"meta":{"line":119,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"setRateLimitPerUser","description":"Sets the rate limit per user (slowmode) for this channel.","params":[{"name":"rateLimitPerUser","description":"The new rate limit in seconds","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the channel's rate limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["TextChannel",">"]]],"meta":{"line":28,"file":"TextChannel.js","path":"src/structures"}},{"name":"setDefaultAutoArchiveDuration","description":"Sets the default auto archive duration for all newly created threads in this channel.","inherits":"BaseGuildTextChannel#setDefaultAutoArchiveDuration","inherited":true,"params":[{"name":"defaultAutoArchiveDuration","description":"The new default auto archive duration","type":[[["ThreadAutoArchiveDuration"]]]},{"name":"reason","description":"Reason for changing the channel's default auto archive duration","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["TextChannel",">"]]],"meta":{"line":98,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"setType","description":"Sets the type of this channel (only conversion between text and news is supported)","inherits":"BaseGuildTextChannel#setType","inherited":true,"params":[{"name":"type","description":"The new channel type","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the channel's type","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":108,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"setTopic","description":"Sets a new topic for the guild channel.","inherits":"BaseGuildTextChannel#setTopic","inherited":true,"examples":["// Set a new channel topic\nchannel.setTopic('needs more rate limiting')\n .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))\n .catch(console.error);"],"params":[{"name":"topic","description":"The new topic for the guild channel","nullable":true,"type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's topic","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":123,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"createInvite","description":"Creates an invite to this guild channel.","inherits":"BaseGuildTextChannel#createInvite","inherited":true,"examples":["// Create an invite to a channel\nchannel.createInvite()\n .then(invite => console.log(`Created an invite with a code of ${invite.code}`))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for creating the invite","optional":true,"default":"{}","type":[[["CreateInviteOptions"]]]}],"returns":[[["Promise","<"],["Invite",">"]]],"meta":{"line":161,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"fetchInvites","description":"Fetches a collection of invites to this guild channel.\nResolves with a collection mapping invites by their codes.","inherits":"BaseGuildTextChannel#fetchInvites","inherited":true,"params":[{"name":"cache","description":"Whether or not to cache the fetched invites","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Collection","<"],["string",", "],["Invite",">>"]]],"meta":{"line":171,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"send","description":"Sends a message to this channel.","inherits":"BaseGuildTextChannel#send","inherited":true,"implements":["TextBasedChannel#send"],"examples":["// Send a basic message\nchannel.send('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.error);","// Send a remote file\nchannel.send({\n files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']\n})\n .then(console.log)\n .catch(console.error);","// Send a local file\nchannel.send({\n files: [{\n attachment: 'entire/path/to/file.jpg',\n name: 'file.jpg',\n description: 'A description of the file'\n }]\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["MessageOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":181,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"sendTyping","description":"Sends a typing indicator in the channel.","inherits":"BaseGuildTextChannel#sendTyping","inherited":true,"implements":["TextBasedChannel#sendTyping"],"examples":["// Start typing in a channel\nchannel.sendTyping();"],"returns":{"types":[[["Promise","<({"],["message_send_cooldown_ms",": "],["number",", "],["thread_create_cooldown_ms",": "],["number","}|"],["void",")>"]]],"description":"Resolves upon the typing status being sent"},"meta":{"line":395,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createMessageCollector","description":"Creates a Message Collector.","inherits":"BaseGuildTextChannel#createMessageCollector","inherited":true,"implements":["TextBasedChannel#createMessageCollector"],"examples":["// Create a message collector\nconst filter = m => m.content.includes('discord');\nconst collector = channel.createMessageCollector({ filter, time: 15_000 });\ncollector.on('collect', m => console.log(`Collected ${m.content}`));\ncollector.on('end', collected => console.log(`Collected ${collected.size} items`));"],"params":[{"name":"options","description":"The options to pass to the collector","optional":true,"default":"{}","type":[[["MessageCollectorOptions"]]]}],"returns":[[["MessageCollector"]]],"meta":{"line":410,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"awaitMessages","description":"Similar to createMessageCollector but in promise form.\nResolves with a collection of messages that pass the specified filter.","inherits":"BaseGuildTextChannel#awaitMessages","inherited":true,"implements":["TextBasedChannel#awaitMessages"],"examples":["// Await !vote messages\nconst filter = m => m.content.startsWith('!vote');\n// Errors: ['time'] treats ending because of the time limit as an error\nchannel.awaitMessages({ filter, max: 4, time: 60_000, errors: ['time'] })\n .then(collected => console.log(collected.size))\n .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));"],"params":[{"name":"options","description":"Optional options to pass to the internal collector","optional":true,"default":"{}","type":[[["AwaitMessagesOptions"]]]}],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Message",">>"]]],"meta":{"line":433,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"fetchWebhooks","description":"Fetches all webhooks for the channel.","inherits":"BaseGuildTextChannel#fetchWebhooks","inherited":true,"implements":["TextBasedChannel#fetchWebhooks"],"examples":["// Fetch webhooks\nchannel.fetchWebhooks()\n .then(hooks => console.log(`This channel has ${hooks.size} hooks`))\n .catch(console.error);"],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Webhook",">>"]]],"meta":{"line":455,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createWebhook","description":"Creates a webhook for the channel.","inherits":"BaseGuildTextChannel#createWebhook","inherited":true,"implements":["TextBasedChannel#createWebhook"],"examples":["// Create a webhook for the current channel\nchannel.createWebhook('Snek', {\n avatar: 'https://i.imgur.com/mI8XcpG.jpg',\n reason: 'Needed a cool new Webhook'\n})\n .then(console.log)\n .catch(console.error)"],"params":[{"name":"name","description":"The name of the webhook","type":[[["string"]]]},{"name":"options","description":"Options for creating the webhook","optional":true,"type":[[["ChannelWebhookCreateOptions"]]]}],"returns":{"types":[[["Promise","<"],["Webhook",">"]]],"description":"Returns the created Webhook"},"meta":{"line":480,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setNSFW","description":"Sets whether this channel is flagged as NSFW.","inherits":"BaseGuildTextChannel#setNSFW","inherited":true,"implements":["TextBasedChannel#setNSFW"],"params":[{"name":"nsfw","description":"Whether the channel should be considered NSFW","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for changing the channel's NSFW flag","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":500,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"permissionsFor","description":"Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.","inherits":"GuildChannel#permissionsFor","inherited":true,"params":[{"name":"memberOrRole","description":"The member or role to obtain the overall permissions for","type":[[["GuildMemberResolvable"]],[["RoleResolvable"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":{"types":[[["Readonly","<"],["Permissions",">"]]],"nullable":true},"meta":{"line":173,"file":"GuildChannel.js","path":"src/structures"}},{"name":"memberPermissions","description":"Gets the overall set of permissions for a member in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#memberPermissions","inherited":true,"params":[{"name":"member","description":"The member to obtain the overall permissions for","type":[[["GuildMember"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","default":true,"type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":213,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rolePermissions","description":"Gets the overall set of permissions for a role in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#rolePermissions","inherited":true,"params":[{"name":"role","description":"The role to obtain the overall permissions for","type":[[["Role"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":242,"file":"GuildChannel.js","path":"src/structures"}},{"name":"lockPermissions","description":"Locks in the permission overwrites from the parent channel.","inherits":"GuildChannel#lockPermissions","inherited":true,"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":263,"file":"GuildChannel.js","path":"src/structures"}},{"name":"edit","description":"Edits the channel.","inherits":"GuildChannel#edit","inherited":true,"examples":["// Edit a channel\nchannel.edit({ name: 'new-channel' })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"data","description":"The new data for the channel","type":[[["ChannelData"]]]},{"name":"reason","description":"Reason for editing this channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":291,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setName","description":"Sets a new name for the guild channel.","inherits":"GuildChannel#setName","inherited":true,"examples":["// Set a new channel name\nchannel.setName('not_general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.error);"],"params":[{"name":"name","description":"The new name for the guild channel","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":306,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setParent","description":"Sets the parent of this channel.","inherits":"GuildChannel#setParent","inherited":true,"examples":["// Add a parent to a channel\nmessage.channel.setParent('355908108431917066', { lockPermissions: false })\n .then(channel => console.log(`New parent of ${message.channel.name}: ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"channel","description":"The category channel to set as the parent","nullable":true,"type":[[["CategoryChannelResolvable"]]]},{"name":"options","description":"The options for setting the parent","optional":true,"default":"{}","type":[[["SetParentOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":328,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setPosition","description":"Sets a new position for the guild channel.","inherits":"GuildChannel#setPosition","inherited":true,"examples":["// Set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.error);"],"params":[{"name":"position","description":"The new position for the guild channel","type":[[["number"]]]},{"name":"options","description":"Options for setting position","optional":true,"type":[[["SetChannelPositionOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":356,"file":"GuildChannel.js","path":"src/structures"}},{"name":"clone","description":"Clones this channel.","inherits":"GuildChannel#clone","inherited":true,"params":[{"name":"options","description":"The options for cloning this channel","optional":true,"type":[[["GuildChannelCloneOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":371,"file":"GuildChannel.js","path":"src/structures"}},{"name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites, and id as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","inherits":"GuildChannel#equals","inherited":true,"params":[{"name":"channel","description":"Channel to compare with","type":[[["GuildChannel"]]]}],"returns":[[["boolean"]]],"meta":{"line":393,"file":"GuildChannel.js","path":"src/structures"}},{"name":"delete","description":"Deletes this channel.","inherits":"GuildChannel#delete","inherited":true,"examples":["// Delete the channel\nchannel.delete('making room for new channels')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"reason","description":"Reason for deleting this channel","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":464,"file":"GuildChannel.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.","inherits":"Channel#toString","inherited":true,"examples":["// Logs: Hello from <#123456789012345678>!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":130,"file":"Channel.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this channel.","inherits":"Channel#fetch","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":153,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","inherits":"Channel#isText","inherited":true,"returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","inherits":"Channel#isVoice","inherited":true,"returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","inherits":"Channel#isThread","inherited":true,"returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","inherits":"Channel#isThreadOnly","inherited":true,"returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","inherits":"Channel#isDirectory","inherited":true,"returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":9,"file":"TextChannel.js","path":"src/structures"}},{"name":"TextDisplayComponent","construct":{"name":"TextDisplayComponent","params":[{"name":"data","description":"The data","optional":true,"default":"{}","type":[[["TextDisplayComponent"]],[["APITextDisplayComponent"]]]}]},"props":[{"name":"content","description":"Text that will be displayed similar to a message","type":[[["String"]]],"meta":{"line":26,"file":"TextDisplayComponent.js","path":"src/structures"}}],"methods":[{"name":"toJSON","returns":[[["APITextDisplayComponent"]]],"meta":{"line":32,"file":"TextDisplayComponent.js","path":"src/structures"}}],"meta":{"line":14,"file":"TextDisplayComponent.js","path":"src/structures"}},{"name":"TextInputComponent","description":"Represents a text input component in a modal","extends":[[["BaseMessageComponent"]]],"construct":{"name":"TextInputComponent","params":[{"name":"data","description":"TextInputComponent to clone or raw data","optional":true,"default":"{}","type":[[["TextInputComponent"]],[["TextInputComponentOptions"]]]}]},"props":[{"name":"customId","description":"A unique string to be sent in the interaction when submitted","nullable":true,"type":[[["string"]]],"meta":{"line":41,"file":"TextInputComponent.js","path":"src/structures"}},{"name":"label","description":"The text to be displayed above this text input component","nullable":true,"type":[[["string"]]],"meta":{"line":47,"file":"TextInputComponent.js","path":"src/structures"}},{"name":"maxLength","description":"Maximum length of text that can be entered","nullable":true,"type":[[["number"]]],"meta":{"line":53,"file":"TextInputComponent.js","path":"src/structures"}},{"name":"minLength","description":"Minimum length of text required to be entered","nullable":true,"type":[[["string"]]],"meta":{"line":59,"file":"TextInputComponent.js","path":"src/structures"}},{"name":"placeholder","description":"Custom placeholder text to display when no text is entered","nullable":true,"type":[[["string"]]],"meta":{"line":65,"file":"TextInputComponent.js","path":"src/structures"}},{"name":"required","description":"Whether or not this text input component is required","nullable":true,"type":[[["boolean"]]],"meta":{"line":71,"file":"TextInputComponent.js","path":"src/structures"}},{"name":"style","description":"The style of this text input component","nullable":true,"type":[[["TextInputStyle"]]],"meta":{"line":77,"file":"TextInputComponent.js","path":"src/structures"}},{"name":"value","description":"Value of this text input component","nullable":true,"type":[[["string"]]],"meta":{"line":83,"file":"TextInputComponent.js","path":"src/structures"}},{"name":"type","description":"The type of this component","nullable":true,"type":[[["MessageComponentType"]]],"meta":{"line":52,"file":"BaseMessageComponent.js","path":"src/structures"}},{"name":"data","description":"The data for this component","type":[[["MessageComponentOptions"]]],"meta":{"line":60,"file":"BaseMessageComponent.js","path":"src/structures"}},{"name":"id","description":"The id of this component","readonly":true,"type":[[["number"]]],"meta":{"line":68,"file":"BaseMessageComponent.js","path":"src/structures"}}],"methods":[{"name":"setValue","description":"Sets the value of this text input component","params":[{"name":"value","description":"Value of this text input component","type":[[["string"]]]}],"returns":[[["TextInputComponent"]]],"meta":{"line":91,"file":"TextInputComponent.js","path":"src/structures"}},{"name":"toJSON","description":"Transforms the text input component into a plain object","returns":{"types":[[["APITextInput"]]],"description":"The raw data of this text input component"},"meta":{"line":100,"file":"TextInputComponent.js","path":"src/structures"}},{"name":"resolveStyle","description":"Resolves the style of a text input component","scope":"static","access":"private","params":[{"name":"style","description":"The style to resolve","type":[[["TextInputStyleResolvable"]]]}],"returns":[[["TextInputStyle"]]],"meta":{"line":127,"file":"TextInputComponent.js","path":"src/structures"}}],"meta":{"line":13,"file":"TextInputComponent.js","path":"src/structures"}},{"name":"ThreadChannel","description":"Represents a thread channel on Discord.","extends":[[["Channel"]]],"implements":[[["TextBasedChannel"]]],"props":[{"name":"guild","description":"The guild the thread is in","type":[[["Guild"]]],"meta":{"line":25,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"ownerId","description":"The id of the member who created this thread","type":[[["Snowflake"]]],"meta":{"line":31,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild the channel is in","type":[[["Snowflake"]]],"meta":{"line":37,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"messages","description":"A manager of the messages sent to this thread","type":[[["MessageManager"]]],"meta":{"line":43,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"members","description":"A manager of the members that are part of this thread","type":[[["ThreadMemberManager"]]],"meta":{"line":49,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"name","description":"The name of the thread","type":[[["string"]]],"meta":{"line":61,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"parentId","description":"The id of the parent channel of this thread","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":73,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"locked","description":"Whether the thread is locked","nullable":true,"type":[[["boolean"]]],"meta":{"line":83,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"invitable","description":"Whether members without `MANAGE_THREADS` can invite other members without `MANAGE_THREADS`\nAlways `null` in public threads","nullable":true,"type":[[["boolean"]]],"meta":{"line":90,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"archived","description":"Whether the thread is archived","nullable":true,"type":[[["boolean"]]],"meta":{"line":96,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"autoArchiveDuration","description":"The amount of time (in minutes) after which the thread will automatically archive in case of no recent activity","nullable":true,"type":[[["number"]]],"meta":{"line":102,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"archiveTimestamp","description":"The timestamp when the thread's archive status was last changed\nIf the thread was never archived or unarchived, this is the timestamp at which the thread was\ncreated","nullable":true,"type":[[["number"]]],"meta":{"line":110,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"lastMessageId","description":"The last message id sent in this thread, if one was sent","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":133,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"lastPinTimestamp","description":"The timestamp when the last pinned message was pinned, if there was one","nullable":true,"type":[[["number"]]],"meta":{"line":143,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"rateLimitPerUser","description":"The rate limit per user (slowmode) for this thread in seconds","nullable":true,"type":[[["number"]]],"meta":{"line":153,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"messageCount","description":"Threads created before July 1, 2022 may have an inaccurate count.\nIf you need an approximate value higher than that, use `ThreadChannel#messages.cache.size`","nullable":true,"type":[[["number"]]],"meta":{"line":164,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"memberCount","description":"The approximate count of users in this thread\nThis stops counting at 50. If you need an approximate value higher than that, use\n`ThreadChannel#members.cache.size`","nullable":true,"type":[[["number"]]],"meta":{"line":176,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"totalMessageSent","description":"The number of messages ever sent in a thread, similar to {@link ThreadChannel#messageCount} except it\nwill not decrement whenever a message is deleted","nullable":true,"type":[[["number"]]],"meta":{"line":187,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"appliedTags","description":"The tags applied to this thread","type":[[["Array","<"],["Snowflake",">"]]],"meta":{"line":197,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp when this thread was created. This isn't available for threads\ncreated before 2022-01-09","readonly":true,"nullable":true,"type":[[["number"]]],"meta":{"line":212,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"guildMembers","description":"A collection of associated guild member objects of this thread's members","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":221,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"archivedAt","description":"The time at which this thread's archive status was last changed\nIf the thread was never archived or unarchived, this is the time at which the thread was created","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":231,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the thread was created at","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":241,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"parent","description":"The parent channel of this thread","readonly":true,"nullable":true,"type":[[["NewsChannel"]],[["TextChannel"]],[["ForumChannel"]],[["MediaChannel"]]],"meta":{"line":250,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"joined","description":"Whether the client user is a member of the thread.","readonly":true,"type":[[["boolean"]]],"meta":{"line":480,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"editable","description":"Whether the thread is editable by the client user (name, archived, autoArchiveDuration)","readonly":true,"type":[[["boolean"]]],"meta":{"line":489,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"joinable","description":"Whether the thread is joinable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":500,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"manageable","description":"Whether the thread is manageable by the client user, for deleting or editing rateLimitPerUser or locked.","readonly":true,"type":[[["boolean"]]],"meta":{"line":516,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"viewable","description":"Whether the thread is viewable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":533,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"sendable","description":"Whether the client user can send messages in this thread","readonly":true,"type":[[["boolean"]]],"meta":{"line":545,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"unarchivable","description":"Whether the thread is unarchivable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":564,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"lastMessage","description":"The Message object of the last message in the channel, if one was sent","readonly":true,"nullable":true,"type":[[["Message"]]],"meta":{"line":51,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"lastPinAt","description":"The date when the last pinned message was pinned, if there was one","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":60,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"partial","description":"Whether this Channel is a partial\nThis is always false outside of DM channels.","readonly":true,"type":[[["boolean"]]],"meta":{"line":119,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"join","description":"Makes the client user join the thread.","async":true,"returns":[[["Promise","<"],["ThreadChannel",">"]]],"meta":{"line":258,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"leave","description":"Makes the client user leave the thread.","async":true,"returns":[[["Promise","<"],["ThreadChannel",">"]]],"meta":{"line":267,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"permissionsFor","description":"Gets the overall set of permissions for a member or role in this thread's parent channel, taking overwrites into\naccount.","params":[{"name":"memberOrRole","description":"The member or role to obtain the overall permissions for","type":[[["GuildMemberResolvable"]],[["RoleResolvable"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":{"types":[[["Readonly","<"],["Permissions",">"]]],"nullable":true},"meta":{"line":279,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"fetchOwner","description":"Fetches the owner of this thread. If the thread member object isn't needed,\nuse {@link ThreadChannel#ownerId} instead.","params":[{"name":"options","description":"The options for fetching the member","optional":true,"type":[[["BaseFetchOptions"]]]}],"async":true,"returns":[[["Promise",""]]],"meta":{"line":289,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"fetchStarterMessage","description":"Fetches the message that started this thread, if any.\nThe `Promise` will reject if the original message in a forum post is deleted\nor when the original message in the parent channel is deleted.\nIf you just need the id of that message, use {@link ThreadChannel#id} instead.","params":[{"name":"options","description":"Additional options for this fetch","optional":true,"type":[[["BaseFetchOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["null",")>"]]],"meta":{"line":309,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"edit","description":"Edits this thread.","examples":["// Edit a thread\nthread.edit({ name: 'new-thread' })\n .then(editedThread => console.log(editedThread))\n .catch(console.error);"],"params":[{"name":"data","description":"The new data for this thread","type":[[["ThreadEditData"]]]},{"name":"reason","description":"Reason for editing this thread","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["ThreadChannel",">"]]],"meta":{"line":340,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"setArchived","description":"Sets whether the thread is archived.","examples":["// Archive the thread\nthread.setArchived(true)\n .then(newThread => console.log(`Thread is now ${newThread.archived ? 'archived' : 'active'}`))\n .catch(console.error);"],"params":[{"name":"archived","description":"Whether the thread is archived","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for archiving or unarchiving","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["ThreadChannel",">"]]],"meta":{"line":372,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"setAutoArchiveDuration","description":"Sets the duration after which the thread will automatically archive in case of no recent activity.","examples":["// Set the thread's auto archive time to 1 hour\nthread.setAutoArchiveDuration(60)\n .then(newThread => {\n console.log(`Thread will now archive after ${newThread.autoArchiveDuration} minutes of inactivity`);\n });\n .catch(console.error);"],"params":[{"name":"autoArchiveDuration","description":"The amount of time (in minutes) after which the thread\nshould automatically archive in case of no recent activity","type":[[["ThreadAutoArchiveDuration"]]]},{"name":"reason","description":"Reason for changing the auto archive duration","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["ThreadChannel",">"]]],"meta":{"line":390,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"setInvitable","description":"Sets whether members without the `MANAGE_THREADS` permission can invite other members without the\n`MANAGE_THREADS` permission to this thread.","params":[{"name":"invitable","description":"Whether non-moderators can invite non-moderators to this thread","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for changing invite","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["ThreadChannel",">"]]],"meta":{"line":401,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"setLocked","description":"Sets whether the thread can be **unarchived** by anyone with `SEND_MESSAGES` permission.\nWhen a thread is locked only members with `MANAGE_THREADS` can unarchive it.","examples":["// Set the thread to locked\nthread.setLocked(true)\n .then(newThread => console.log(`Thread is now ${newThread.locked ? 'locked' : 'unlocked'}`))\n .catch(console.error);"],"params":[{"name":"locked","description":"Whether the thread is locked","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for locking or unlocking the thread","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["ThreadChannel",">"]]],"meta":{"line":418,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"setName","description":"Sets a new name for this thread.","examples":["// Change the thread's name\nthread.setName('not_general')\n .then(newThread => console.log(`Thread's new name is ${newThread.name}`))\n .catch(console.error);"],"params":[{"name":"name","description":"The new name for the thread","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the thread's name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["ThreadChannel",">"]]],"meta":{"line":433,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"setRateLimitPerUser","description":"Sets the rate limit per user (slowmode) for this thread.","implements":["TextBasedChannel#setRateLimitPerUser"],"params":[{"name":"rateLimitPerUser","description":"The new rate limit in seconds","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the thread's rate limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["ThreadChannel",">"]]],"meta":{"line":443,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"pin","description":"Pins this thread from the forum channel.","params":[{"name":"reason","description":"Reason for pinning","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["ThreadChannel",">"]]],"meta":{"line":452,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"unpin","description":"Unpins this thread from the forum channel.","params":[{"name":"reason","description":"Reason for unpinning","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["ThreadChannel",">"]]],"meta":{"line":461,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"setAppliedTags","description":"Set the applied tags for this channel (only applicable to forum threads)","params":[{"name":"appliedTags","description":"The tags to set for this channel","type":[[["Array","<"],["Snowflake",">"]]]},{"name":"reason","description":"Reason for changing the thread's applied tags","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["ThreadChannel",">"]]],"meta":{"line":471,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"isPrivate","description":"Whether this thread is a private thread","returns":[[["boolean"]]],"meta":{"line":572,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"delete","description":"Deletes this thread.","examples":["// Delete the thread\nthread.delete('cleaning out old threads')\n .then(deletedThread => console.log(deletedThread))\n .catch(console.error);"],"params":[{"name":"reason","description":"Reason for deleting this thread","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["ThreadChannel",">"]]],"meta":{"line":586,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"send","description":"Sends a message to this channel.","implements":["TextBasedChannel#send"],"examples":["// Send a basic message\nchannel.send('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.error);","// Send a remote file\nchannel.send({\n files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']\n})\n .then(console.log)\n .catch(console.error);","// Send a local file\nchannel.send({\n files: [{\n attachment: 'entire/path/to/file.jpg',\n name: 'file.jpg',\n description: 'A description of the file'\n }]\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["MessageOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":181,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"sendTyping","description":"Sends a typing indicator in the channel.","implements":["TextBasedChannel#sendTyping"],"examples":["// Start typing in a channel\nchannel.sendTyping();"],"returns":{"types":[[["Promise","<({"],["message_send_cooldown_ms",": "],["number",", "],["thread_create_cooldown_ms",": "],["number","}|"],["void",")>"]]],"description":"Resolves upon the typing status being sent"},"meta":{"line":395,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createMessageCollector","description":"Creates a Message Collector.","implements":["TextBasedChannel#createMessageCollector"],"examples":["// Create a message collector\nconst filter = m => m.content.includes('discord');\nconst collector = channel.createMessageCollector({ filter, time: 15_000 });\ncollector.on('collect', m => console.log(`Collected ${m.content}`));\ncollector.on('end', collected => console.log(`Collected ${collected.size} items`));"],"params":[{"name":"options","description":"The options to pass to the collector","optional":true,"default":"{}","type":[[["MessageCollectorOptions"]]]}],"returns":[[["MessageCollector"]]],"meta":{"line":410,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"awaitMessages","description":"Similar to createMessageCollector but in promise form.\nResolves with a collection of messages that pass the specified filter.","implements":["TextBasedChannel#awaitMessages"],"examples":["// Await !vote messages\nconst filter = m => m.content.startsWith('!vote');\n// Errors: ['time'] treats ending because of the time limit as an error\nchannel.awaitMessages({ filter, max: 4, time: 60_000, errors: ['time'] })\n .then(collected => console.log(collected.size))\n .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));"],"params":[{"name":"options","description":"Optional options to pass to the internal collector","optional":true,"default":"{}","type":[[["AwaitMessagesOptions"]]]}],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Message",">>"]]],"meta":{"line":433,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.","inherits":"Channel#toString","inherited":true,"examples":["// Logs: Hello from <#123456789012345678>!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":130,"file":"Channel.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this channel.","inherits":"Channel#fetch","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":153,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","inherits":"Channel#isText","inherited":true,"returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","inherits":"Channel#isVoice","inherited":true,"returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","inherits":"Channel#isThread","inherited":true,"returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","inherits":"Channel#isThreadOnly","inherited":true,"returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","inherits":"Channel#isDirectory","inherited":true,"returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":17,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"ThreadMember","description":"Represents a Member for a Thread.","extends":[[["Base"]]],"props":[{"name":"thread","description":"The thread that this member is a part of","type":[[["ThreadChannel"]]],"meta":{"line":18,"file":"ThreadMember.js","path":"src/structures"}},{"name":"joinedTimestamp","description":"The timestamp the member last joined the thread at","nullable":true,"type":[[["number"]]],"meta":{"line":24,"file":"ThreadMember.js","path":"src/structures"}},{"name":"id","description":"The id of the thread member","type":[[["Snowflake"]]],"meta":{"line":30,"file":"ThreadMember.js","path":"src/structures"}},{"name":"flags","description":"The flags for this thread member","type":[[["ThreadMemberFlags"]]],"meta":{"line":43,"file":"ThreadMember.js","path":"src/structures"}},{"name":"member","description":"The guild member associated with this thread member.","access":"private","nullable":true,"type":[[["GuildMember"]]],"meta":{"line":52,"file":"ThreadMember.js","path":"src/structures"}},{"name":"guildMember","description":"The guild member associated with this thread member","readonly":true,"nullable":true,"type":[[["GuildMember"]]],"meta":{"line":63,"file":"ThreadMember.js","path":"src/structures"}},{"name":"joinedAt","description":"The last time this member joined the thread","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":72,"file":"ThreadMember.js","path":"src/structures"}},{"name":"user","description":"The user associated with this thread member","readonly":true,"nullable":true,"type":[[["User"]]],"meta":{"line":81,"file":"ThreadMember.js","path":"src/structures"}},{"name":"manageable","description":"Whether the client user can manage this thread member","readonly":true,"type":[[["boolean"]]],"meta":{"line":90,"file":"ThreadMember.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"remove","description":"Removes this member from the thread.","params":[{"name":"reason","description":"Reason for removing the member","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["ThreadMember"]]],"meta":{"line":99,"file":"ThreadMember.js","path":"src/structures"}}],"meta":{"line":10,"file":"ThreadMember.js","path":"src/structures"}},{"name":"ThreadOnlyChannel","description":"Represents a channel that only contains threads","extends":[[["GuildChannel"]]],"implements":[[["TextBasedChannel"]]],"abstract":true,"props":[{"name":"threads","description":"A manager of the threads belonging to this channel","type":[[["GuildForumThreadManager"]]],"meta":{"line":53,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"availableTags","description":"The set of tags that can be used in this channel.","type":[[["Array","<"],["GuildForumTag",">"]]],"meta":{"line":65,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"defaultReactionEmoji","description":"The emoji to show in the add reaction button on a thread in a guild forum channel","nullable":true,"type":[[["DefaultReactionEmoji"]]],"meta":{"line":75,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"defaultThreadRateLimitPerUser","description":"The initial rate limit per user (slowmode) to set on newly created threads in a channel.","nullable":true,"type":[[["number"]]],"meta":{"line":86,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"rateLimitPerUser","description":"The rate limit per user (slowmode) for this channel.","nullable":true,"type":[[["number"]]],"meta":{"line":96,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"defaultAutoArchiveDuration","description":"The default auto archive duration for newly created threads in this channel.","nullable":true,"type":[[["ThreadAutoArchiveDuration"]]],"meta":{"line":106,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"nsfw","description":"If this channel is considered NSFW.","type":[[["boolean"]]],"meta":{"line":116,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"topic","description":"The topic of this channel.","nullable":true,"type":[[["string"]]],"meta":{"line":126,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"defaultSortOrder","description":"The default sort order mode used to order posts","nullable":true,"type":[[["SortOrderType"]]],"meta":{"line":134,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"guild","description":"The guild the channel is in","type":[[["Guild"]]],"meta":{"line":31,"file":"GuildChannel.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild the channel is in","type":[[["Snowflake"]]],"meta":{"line":37,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionOverwrites","description":"A manager of permission overwrites that belong to this channel","type":[[["PermissionOverwriteManager"]]],"meta":{"line":44,"file":"GuildChannel.js","path":"src/structures"}},{"name":"name","description":"The name of the guild channel","type":[[["string"]]],"meta":{"line":57,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rawPosition","description":"The raw position of the channel from Discord","type":[[["number"]]],"meta":{"line":65,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parentId","description":"The id of the category parent of this channel","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":77,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parent","description":"The category parent of this channel","readonly":true,"nullable":true,"type":[[["CategoryChannel"]]],"meta":{"line":99,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionsLocked","description":"If the permissionOverwrites match the parent channel, null if no parent","readonly":true,"nullable":true,"type":[[["boolean"]]],"meta":{"line":108,"file":"GuildChannel.js","path":"src/structures"}},{"name":"position","description":"The position of the channel","readonly":true,"type":[[["number"]]],"meta":{"line":149,"file":"GuildChannel.js","path":"src/structures"}},{"name":"members","description":"A collection of cached members of this channel, mapped by their ids.\nMembers that can view this channel, if the channel is text-based.\nMembers in the channel, if the channel is voice-based.","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":276,"file":"GuildChannel.js","path":"src/structures"}},{"name":"deletable","description":"Whether the channel is deletable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":418,"file":"GuildChannel.js","path":"src/structures"}},{"name":"manageable","description":"Whether the channel is manageable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":427,"file":"GuildChannel.js","path":"src/structures"}},{"name":"viewable","description":"Whether the channel is viewable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":447,"file":"GuildChannel.js","path":"src/structures"}},{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the channel was created at","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"Channel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the channel was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":79,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"partial","description":"Whether this Channel is a partial\nThis is always false outside of DM channels.","readonly":true,"type":[[["boolean"]]],"meta":{"line":119,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"setAvailableTags","description":"Sets the available tags for this forum channel","params":[{"name":"availableTags","description":"The tags to set as available in this channel","type":[[["Array","<"],["GuildForumTagData",">"]]]},{"name":"reason","description":"Reason for changing the available tags","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":146,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"setDefaultReactionEmoji","description":"Sets the default reaction emoji for this channel","params":[{"name":"defaultReactionEmoji","description":"The emoji to set as the default reaction emoji","nullable":true,"type":[[["DefaultReactionEmoji"]]]},{"name":"reason","description":"Reason for changing the default reaction emoji","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":156,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"setDefaultThreadRateLimitPerUser","description":"Sets the default rate limit per user (slowmode) for new threads in this channel","params":[{"name":"defaultThreadRateLimitPerUser","description":"The rate limit to set on newly created threads in this channel","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the default rate limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":166,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"setDefaultSortOrder","description":"Sets the default sort order mode used to order posts","params":[{"name":"defaultSortOrder","description":"The default sort order mode to set on this channel","nullable":true,"type":[[["SortOrderType"]]]},{"name":"reason","description":"Reason for changing the default sort order","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":176,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"createInvite","description":"Creates an invite to this guild channel.","examples":["// Create an invite to a channel\nchannel.createInvite()\n .then(invite => console.log(`Created an invite with a code of ${invite.code}`))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for creating the invite","optional":true,"default":"{}","type":[[["CreateInviteOptions"]]]}],"returns":[[["Promise","<"],["Invite",">"]]],"meta":{"line":190,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"fetchInvites","description":"Fetches a collection of invites to this guild channel.\nResolves with a collection mapping invites by their codes.","params":[{"name":"cache","description":"Whether or not to cache the fetched invites","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Collection","<"],["string",", "],["Invite",">>"]]],"meta":{"line":200,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"setDefaultAutoArchiveDuration","description":"Sets the default auto archive duration for all newly created threads in this channel.","params":[{"name":"defaultAutoArchiveDuration","description":"The new default auto archive duration","type":[[["ThreadAutoArchiveDuration"]]]},{"name":"reason","description":"Reason for changing the channel's default auto archive duration","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":210,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"setTopic","description":"Sets a new topic for the guild channel.","examples":["// Set a new channel topic\nchannel.setTopic('needs more rate limiting')\n .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))\n .catch(console.error);"],"params":[{"name":"topic","description":"The new topic for the guild channel","nullable":true,"type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's topic","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":225,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"fetchWebhooks","description":"Fetches all webhooks for the channel.","implements":["TextBasedChannel#fetchWebhooks"],"examples":["// Fetch webhooks\nchannel.fetchWebhooks()\n .then(hooks => console.log(`This channel has ${hooks.size} hooks`))\n .catch(console.error);"],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Webhook",">>"]]],"meta":{"line":455,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createWebhook","description":"Creates a webhook for the channel.","implements":["TextBasedChannel#createWebhook"],"examples":["// Create a webhook for the current channel\nchannel.createWebhook('Snek', {\n avatar: 'https://i.imgur.com/mI8XcpG.jpg',\n reason: 'Needed a cool new Webhook'\n})\n .then(console.log)\n .catch(console.error)"],"params":[{"name":"name","description":"The name of the webhook","type":[[["string"]]]},{"name":"options","description":"Options for creating the webhook","optional":true,"type":[[["ChannelWebhookCreateOptions"]]]}],"returns":{"types":[[["Promise","<"],["Webhook",">"]]],"description":"Returns the created Webhook"},"meta":{"line":480,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setRateLimitPerUser","description":"Sets the rate limit per user (slowmode) for this channel.","implements":["TextBasedChannel#setRateLimitPerUser"],"params":[{"name":"rateLimitPerUser","description":"The new rate limit in seconds","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the channel's rate limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":490,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setNSFW","description":"Sets whether this channel is flagged as NSFW.","implements":["TextBasedChannel#setNSFW"],"params":[{"name":"nsfw","description":"Whether the channel should be considered NSFW","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for changing the channel's NSFW flag","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":500,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"permissionsFor","description":"Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.","inherits":"GuildChannel#permissionsFor","inherited":true,"params":[{"name":"memberOrRole","description":"The member or role to obtain the overall permissions for","type":[[["GuildMemberResolvable"]],[["RoleResolvable"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":{"types":[[["Readonly","<"],["Permissions",">"]]],"nullable":true},"meta":{"line":173,"file":"GuildChannel.js","path":"src/structures"}},{"name":"memberPermissions","description":"Gets the overall set of permissions for a member in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#memberPermissions","inherited":true,"params":[{"name":"member","description":"The member to obtain the overall permissions for","type":[[["GuildMember"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","default":true,"type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":213,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rolePermissions","description":"Gets the overall set of permissions for a role in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#rolePermissions","inherited":true,"params":[{"name":"role","description":"The role to obtain the overall permissions for","type":[[["Role"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":242,"file":"GuildChannel.js","path":"src/structures"}},{"name":"lockPermissions","description":"Locks in the permission overwrites from the parent channel.","inherits":"GuildChannel#lockPermissions","inherited":true,"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":263,"file":"GuildChannel.js","path":"src/structures"}},{"name":"edit","description":"Edits the channel.","inherits":"GuildChannel#edit","inherited":true,"examples":["// Edit a channel\nchannel.edit({ name: 'new-channel' })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"data","description":"The new data for the channel","type":[[["ChannelData"]]]},{"name":"reason","description":"Reason for editing this channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":291,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setName","description":"Sets a new name for the guild channel.","inherits":"GuildChannel#setName","inherited":true,"examples":["// Set a new channel name\nchannel.setName('not_general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.error);"],"params":[{"name":"name","description":"The new name for the guild channel","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":306,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setParent","description":"Sets the parent of this channel.","inherits":"GuildChannel#setParent","inherited":true,"examples":["// Add a parent to a channel\nmessage.channel.setParent('355908108431917066', { lockPermissions: false })\n .then(channel => console.log(`New parent of ${message.channel.name}: ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"channel","description":"The category channel to set as the parent","nullable":true,"type":[[["CategoryChannelResolvable"]]]},{"name":"options","description":"The options for setting the parent","optional":true,"default":"{}","type":[[["SetParentOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":328,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setPosition","description":"Sets a new position for the guild channel.","inherits":"GuildChannel#setPosition","inherited":true,"examples":["// Set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.error);"],"params":[{"name":"position","description":"The new position for the guild channel","type":[[["number"]]]},{"name":"options","description":"Options for setting position","optional":true,"type":[[["SetChannelPositionOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":356,"file":"GuildChannel.js","path":"src/structures"}},{"name":"clone","description":"Clones this channel.","inherits":"GuildChannel#clone","inherited":true,"params":[{"name":"options","description":"The options for cloning this channel","optional":true,"type":[[["GuildChannelCloneOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":371,"file":"GuildChannel.js","path":"src/structures"}},{"name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites, and id as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","inherits":"GuildChannel#equals","inherited":true,"params":[{"name":"channel","description":"Channel to compare with","type":[[["GuildChannel"]]]}],"returns":[[["boolean"]]],"meta":{"line":393,"file":"GuildChannel.js","path":"src/structures"}},{"name":"delete","description":"Deletes this channel.","inherits":"GuildChannel#delete","inherited":true,"examples":["// Delete the channel\nchannel.delete('making room for new channels')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"reason","description":"Reason for deleting this channel","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":464,"file":"GuildChannel.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.","inherits":"Channel#toString","inherited":true,"examples":["// Logs: Hello from <#123456789012345678>!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":130,"file":"Channel.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this channel.","inherits":"Channel#fetch","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":153,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","inherits":"Channel#isText","inherited":true,"returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","inherits":"Channel#isVoice","inherited":true,"returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","inherits":"Channel#isThread","inherited":true,"returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","inherits":"Channel#isThreadOnly","inherited":true,"returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","inherits":"Channel#isDirectory","inherited":true,"returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":45,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"ThumbnailComponent","construct":{"name":"ThumbnailComponent","params":[{"name":"data","description":"The data","optional":true,"default":"{}","type":[[["ThumbnailComponent"]],[["APIThumbnailComponent"]]]}]},"props":[{"name":"media","description":"A url or attachment","type":[[["UnfurledMediaItem"]]],"meta":{"line":29,"file":"ThumbnailComponent.js","path":"src/structures"}},{"name":"description","description":"Alt text for the media, max 1024 characters","type":[[["String"]]],"meta":{"line":35,"file":"ThumbnailComponent.js","path":"src/structures"}},{"name":"spoiler","description":"Whether the thumbnail should be a spoiler (or blurred out). Defaults to false","type":[[["Boolean"]]],"meta":{"line":41,"file":"ThumbnailComponent.js","path":"src/structures"}}],"methods":[{"name":"toJSON","returns":[[["APIThumbnailComponent"]]],"meta":{"line":47,"file":"ThumbnailComponent.js","path":"src/structures"}}],"meta":{"line":17,"file":"ThumbnailComponent.js","path":"src/structures"}},{"name":"Typing","description":"Represents a typing state for a user in a channel.","extends":[[["Base"]]],"props":[{"name":"channel","description":"The channel the status is from","type":[[["TextBasedChannels"]]],"meta":{"line":17,"file":"Typing.js","path":"src/structures"}},{"name":"user","description":"The user who is typing","type":[[["User"]]],"meta":{"line":23,"file":"Typing.js","path":"src/structures"}},{"name":"startedTimestamp","description":"The UNIX timestamp in milliseconds the user started typing at","type":[[["number"]]],"meta":{"line":34,"file":"Typing.js","path":"src/structures"}},{"name":"startedAt","description":"The time the user started typing at","readonly":true,"type":[[["Date"]]],"meta":{"line":51,"file":"Typing.js","path":"src/structures"}},{"name":"guild","description":"The guild the status is from","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":60,"file":"Typing.js","path":"src/structures"}},{"name":"member","description":"The member who is typing","readonly":true,"nullable":true,"type":[[["GuildMember"]]],"meta":{"line":69,"file":"Typing.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"inGuild","description":"Indicates whether the status is received from a guild.","returns":[[["boolean"]]],"meta":{"line":42,"file":"Typing.js","path":"src/structures"}}],"meta":{"line":9,"file":"Typing.js","path":"src/structures"}},{"name":"UnfurledMediaItem","construct":{"name":"UnfurledMediaItem","params":[{"name":"data","description":"The data","optional":true,"default":"{}","type":[[["UnfurledMediaItem"]],[["APIUnfurledMediaItem"]]]}]},"props":[{"name":"url","type":[[["string"]]],"meta":{"line":14,"file":"UnfurledMediaItem.js","path":"src/structures"}},{"name":"data","type":[[["APIUnfurledMediaItem"]]],"meta":{"line":18,"file":"UnfurledMediaItem.js","path":"src/structures"}}],"methods":[{"name":"toJSON","description":"Returns the API-compatible JSON for this media item","returns":[[["APIUnfurledMediaItem"]]],"meta":{"line":24,"file":"UnfurledMediaItem.js","path":"src/structures"}}],"meta":{"line":10,"file":"UnfurledMediaItem.js","path":"src/structures"}},{"name":"User","description":"Represents a user on Discord.","extends":[[["Base"]]],"implements":[[["TextBasedChannel"]]],"props":[{"name":"id","description":"The user's id","type":[[["Snowflake"]]],"meta":{"line":25,"file":"User.js","path":"src/structures"}},{"name":"username","description":"The username of the user","nullable":true,"type":[[["string"]]],"meta":{"line":42,"file":"User.js","path":"src/structures"}},{"name":"globalName","description":"The global name of this user","nullable":true,"type":[[["string"]]],"meta":{"line":52,"file":"User.js","path":"src/structures"}},{"name":"bot","description":"Whether or not the user is a bot","nullable":true,"type":[[["boolean"]]],"meta":{"line":62,"file":"User.js","path":"src/structures"}},{"name":"discriminator","description":"The discriminator of this user\n`'0'`, or a 4-digit stringified number if they're using the legacy username system","nullable":true,"type":[[["string"]]],"meta":{"line":73,"file":"User.js","path":"src/structures"}},{"name":"avatar","description":"The user avatar's hash","nullable":true,"type":[[["string"]]],"meta":{"line":83,"file":"User.js","path":"src/structures"}},{"name":"banner","description":"The user banner's hash\nThe user must be force fetched for this property to be present or be updated","nullable":true,"type":[[["string"]]],"meta":{"line":94,"file":"User.js","path":"src/structures"}},{"name":"bannerColor","description":"The user banner's hex\nThe user must be force fetched for this property to be present or be updated","nullable":true,"type":[[["string"]]],"meta":{"line":105,"file":"User.js","path":"src/structures"}},{"name":"accentColor","description":"The base 10 accent color of the user's banner\nThe user must be force fetched for this property to be present or be updated","nullable":true,"type":[[["number"]]],"meta":{"line":116,"file":"User.js","path":"src/structures"}},{"name":"system","description":"Whether the user is an Official Discord System user (part of the urgent message system)","nullable":true,"type":[[["boolean"]]],"meta":{"line":126,"file":"User.js","path":"src/structures"}},{"name":"flags","description":"The flags for this user","nullable":true,"type":[[["UserFlags"]]],"meta":{"line":136,"file":"User.js","path":"src/structures"}},{"name":"avatarDecorationData","description":"The user avatar decoration's data","nullable":true,"type":[[["AvatarDecorationData"]]],"meta":{"line":151,"file":"User.js","path":"src/structures"}},{"name":"primaryGuild","description":"The primary guild of the user","nullable":true,"type":[[["UserPrimaryGuild"]]],"meta":{"line":176,"file":"User.js","path":"src/structures"}},{"name":"collectibles","description":"The user's collectibles","nullable":true,"type":[[["Collectibles"]]],"meta":{"line":208,"file":"User.js","path":"src/structures"}},{"name":"clan","description":"The primary clan the user is in","nullable":true,"deprecated":"Use `primaryGuild` instead","type":[[["PrimaryGuild"]]],"meta":{"line":229,"file":"User.js","path":"src/structures"}},{"name":"avatarDecoration","description":"The user avatar decoration's hash","nullable":true,"deprecated":"Use `avatarDecorationData` instead\nRemoved in v4","type":[[["string"]]],"meta":{"line":239,"file":"User.js","path":"src/structures"}},{"name":"partial","description":"Whether this User is a partial","readonly":true,"type":[[["boolean"]]],"meta":{"line":248,"file":"User.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the user was created at","readonly":true,"type":[[["number"]]],"meta":{"line":257,"file":"User.js","path":"src/structures"}},{"name":"createdAt","description":"The time the user was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":266,"file":"User.js","path":"src/structures"}},{"name":"defaultAvatarURL","description":"A link to the user's default avatar","readonly":true,"type":[[["string"]]],"meta":{"line":312,"file":"User.js","path":"src/structures"}},{"name":"hexAccentColor","description":"The hexadecimal version of the user accent color, with a leading hash\nThe user must be force fetched for this property to be present","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":336,"file":"User.js","path":"src/structures"}},{"name":"tag","description":"The tag of this user\nThis user's username, or their legacy tag (e.g. `hydrabolt#0001`)\nif they're using the legacy username system","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":361,"file":"User.js","path":"src/structures"}},{"name":"displayName","description":"The global name of this user, or their username if they don't have one","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":374,"file":"User.js","path":"src/structures"}},{"name":"dmChannel","description":"The DM between the client's user and this user","readonly":true,"nullable":true,"type":[[["DMChannel"]]],"meta":{"line":383,"file":"User.js","path":"src/structures"}},{"name":"note","description":"The function returns the note associated with a specific client ID from a cache.","nullable":true,"type":[[["string"]]],"meta":{"line":546,"file":"User.js","path":"src/structures"}},{"name":"voice","description":"The voice state of this member","readonly":true,"type":[[["VoiceState"]]],"meta":{"line":555,"file":"User.js","path":"src/structures"}},{"name":"relationship","description":"Check relationship status (Client -> User)","readonly":true,"type":[[["RelationshipType"]]],"meta":{"line":586,"file":"User.js","path":"src/structures"}},{"name":"friendNickname","description":"Get friend nickname","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":596,"file":"User.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"avatarURL","description":"A link to the user's avatar.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["ImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":275,"file":"User.js","path":"src/structures"}},{"name":"avatarDecorationURL","description":"A link to the user's avatar decoration.","returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":284,"file":"User.js","path":"src/structures"}},{"name":"clanBadgeURL","description":"A link to the user's guild tag badge.","deprecated":true,"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":294,"file":"User.js","path":"src/structures"}},{"name":"guildTagBadgeURL","description":"A link to the user's guild tag badge.","returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":302,"file":"User.js","path":"src/structures"}},{"name":"displayAvatarURL","description":"A link to the user's avatar if they have one.\nOtherwise a link to their default avatar will be returned.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["ImageURLOptions"]]]}],"returns":[[["string"]]],"meta":{"line":326,"file":"User.js","path":"src/structures"}},{"name":"bannerURL","description":"A link to the user's banner.\nThis method will throw an error if called before the user is force fetched.\nSee {@link User#banner} for more info","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["ImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":348,"file":"User.js","path":"src/structures"}},{"name":"createDM","description":"Creates a DM channel between the client and the user.","params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["DMChannel",">"]]],"meta":{"line":392,"file":"User.js","path":"src/structures"}},{"name":"deleteDM","description":"Deletes a DM channel (if one exists) between the client and the user. Resolves with the channel if successful.","returns":[[["Promise","<"],["DMChannel",">"]]],"meta":{"line":400,"file":"User.js","path":"src/structures"}},{"name":"equals","description":"Checks if the user is equal to another.\nIt compares id, username, discriminator, avatar, banner, accent color, and bot flags.\nIt is recommended to compare equality by using `user.id === user2.id` unless you want to compare all properties.","params":[{"name":"user","description":"User to compare with","type":[[["User"]]]}],"returns":[[["boolean"]]],"meta":{"line":411,"file":"User.js","path":"src/structures"}},{"name":"_equals","description":"Compares the user with an API user object","access":"private","params":[{"name":"user","description":"The API user object to compare","type":[[["APIUser"]]]}],"returns":[[["boolean"]]],"meta":{"line":441,"file":"User.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this user.","params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["User",">"]]],"meta":{"line":476,"file":"User.js","path":"src/structures"}},{"name":"getProfile","description":"Returns a user profile object for a given user ID.\nThis endpoint requires one of the following:\n- The user is a bot\n- The user shares a mutual guild with the current user\n- The user is a friend of the current user\n- The user is a friend suggestion of the current user\n- The user has an outgoing friend request to the current user","see":["{@link https://discord-userdoccers.vercel.app/resources/user#response-body}"],"params":[{"name":"guildId","description":"The guild ID to get the user's member profile in","optional":true,"type":[[["Snowflake"]]]}],"returns":[[["Promise","<"],["Object",">"]]],"meta":{"line":492,"file":"User.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the user's mention instead of the User object.","examples":["// Logs: Hello from <@123456789012345678>!\nconsole.log(`Hello from ${user}!`);"],"returns":[[["string"]]],"meta":{"line":510,"file":"User.js","path":"src/structures"}},{"name":"setNote","description":"The function updates the note of a user and returns the updated user.","params":[{"name":"note","description":"The `note` parameter is the new value that you want to set for the note of the\nuser. It is an optional parameter and its default value is `null`.","optional":true,"default":null,"type":[[["string"]],[["null"]],[["undefined"]]]}],"async":true,"returns":{"types":[[["Promise","<"],["User",">"]]],"description":"The `setNote` method is returning the `User` object."},"meta":{"line":537,"file":"User.js","path":"src/structures"}},{"name":"sendFriendRequest","description":"Send Friend Request to the user","returns":[[["Promise","<"],["boolean",">"]]],"meta":{"line":568,"file":"User.js","path":"src/structures"}},{"name":"deleteRelationship","description":"Unblock / Unfriend / Cancels a friend request","returns":[[["Promise","<"],["boolean",">"]]],"meta":{"line":577,"file":"User.js","path":"src/structures"}},{"name":"send","description":"Sends a message to this user.","implements":["TextBasedChannel#send"],"examples":["// Send a direct message\nuser.send('Hello!')\n .then(message => console.log(`Sent message: ${message.content} to ${user.tag}`))\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["MessageOptions"]]]}],"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":601,"file":"User.js","path":"src/structures"}}],"meta":{"line":17,"file":"User.js","path":"src/structures"}},{"name":"UserContextMenuInteraction","description":"Represents a user context menu interaction.","extends":[[["ContextMenuInteraction"]]],"props":[{"name":"targetUser","description":"The target user from this interaction","readonly":true,"type":[[["User"]]],"meta":{"line":15,"file":"UserContextMenuInteraction.js","path":"src/structures"}},{"name":"targetMember","description":"The target member from this interaction","readonly":true,"nullable":true,"type":[[["GuildMember"]],[["APIGuildMember"]]],"meta":{"line":24,"file":"UserContextMenuInteraction.js","path":"src/structures"}},{"name":"options","description":"The target of the interaction, parsed into options","type":[[["CommandInteractionOptionResolver"]]],"meta":{"line":18,"file":"ContextMenuInteraction.js","path":"src/structures"}},{"name":"targetId","description":"The id of the target of this interaction","type":[[["Snowflake"]]],"meta":{"line":28,"file":"ContextMenuInteraction.js","path":"src/structures"}},{"name":"targetType","description":"The type of the target of the interaction; either USER or MESSAGE","type":[[["ApplicationCommandType"]]],"meta":{"line":34,"file":"ContextMenuInteraction.js","path":"src/structures"}},{"name":"channelId","description":"The id of the channel this interaction was sent in","type":[[["Snowflake"]]],"meta":{"line":20,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"commandId","description":"The invoked application command's id","type":[[["Snowflake"]]],"meta":{"line":30,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"commandName","description":"The invoked application command's name","type":[[["string"]]],"meta":{"line":36,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"deferred","description":"Whether the reply to this interaction has been deferred","type":[[["boolean"]]],"meta":{"line":42,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"replied","description":"Whether this interaction has already been replied to","type":[[["boolean"]]],"meta":{"line":48,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"ephemeral","description":"Whether the reply to this interaction is ephemeral","nullable":true,"type":[[["boolean"]]],"meta":{"line":54,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"webhook","description":"An associated interaction webhook, can be used to further interact with this interaction","type":[[["InteractionWebhook"]]],"meta":{"line":60,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"command","description":"The invoked application command, if it was fetched before","nullable":true,"type":[[["ApplicationCommand"]]],"meta":{"line":67,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"type","description":"The interaction's type","type":[[["InteractionType"]]],"meta":{"line":20,"file":"Interaction.js","path":"src/structures"}},{"name":"id","description":"The interaction's id","type":[[["Snowflake"]]],"meta":{"line":26,"file":"Interaction.js","path":"src/structures"}},{"name":"token","description":"The interaction's token","readonly":true,"type":[[["string"]]],"meta":{"line":28,"file":"Interaction.js","path":"src/structures"}},{"name":"applicationId","description":"The application's id","type":[[["Snowflake"]]],"meta":{"line":40,"file":"Interaction.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild this interaction was sent in","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":52,"file":"Interaction.js","path":"src/structures"}},{"name":"user","description":"The user which sent this interaction","type":[[["User"]]],"meta":{"line":58,"file":"Interaction.js","path":"src/structures"}},{"name":"member","description":"If this interaction was sent in a guild, the member which sent it","nullable":true,"type":[[["GuildMember"]],[["APIGuildMember"]]],"meta":{"line":64,"file":"Interaction.js","path":"src/structures"}},{"name":"version","description":"The version","type":[[["number"]]],"meta":{"line":70,"file":"Interaction.js","path":"src/structures"}},{"name":"appPermissions","description":"Set of permissions the application or bot has within the channel the interaction was sent from","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":76,"file":"Interaction.js","path":"src/structures"}},{"name":"memberPermissions","description":"The permissions of the member, if one exists, in the channel this interaction was executed in","nullable":true,"type":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":82,"file":"Interaction.js","path":"src/structures"}},{"name":"locale","description":"The locale of the user who invoked this interaction","type":[[["Locale"]]],"meta":{"line":124,"file":"Interaction.js","path":"src/structures"}},{"name":"guildLocale","description":"The preferred locale from the guild this interaction was sent in","nullable":true,"type":[[["Locale"]]],"meta":{"line":130,"file":"Interaction.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the interaction was created at","readonly":true,"type":[[["number"]]],"meta":{"line":138,"file":"Interaction.js","path":"src/structures"}},{"name":"createdAt","description":"The time the interaction was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":147,"file":"Interaction.js","path":"src/structures"}},{"name":"channel","description":"The channel this interaction was sent in","readonly":true,"nullable":true,"type":[[["TextBasedChannels"]]],"meta":{"line":156,"file":"Interaction.js","path":"src/structures"}},{"name":"guild","description":"The guild this interaction was sent in","readonly":true,"nullable":true,"type":[[["Guild"]]],"meta":{"line":165,"file":"Interaction.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"resolveContextMenuOptions","description":"Resolves and transforms options received from the API for a context menu interaction.","access":"private","inherits":"ContextMenuInteraction#resolveContextMenuOptions","inherited":true,"params":[{"name":"data","description":"The interaction data","type":[[["APIApplicationCommandInteractionData"]]]}],"returns":[[["Array","<"],["CommandInteractionOption",">"]]],"meta":{"line":43,"file":"ContextMenuInteraction.js","path":"src/structures"}},{"name":"transformResolved","description":"Transforms the resolved received from the API.","access":"private","inherits":"BaseCommandInteraction#transformResolved","inherited":true,"params":[{"name":"resolved","description":"The received resolved objects","type":[[["APIInteractionDataResolved"]]]}],"returns":[[["CommandInteractionResolvedData"]]],"meta":{"line":89,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"transformOption","description":"Transforms an option received from the API.","access":"private","inherits":"BaseCommandInteraction#transformOption","inherited":true,"params":[{"name":"option","description":"The received option","type":[[["APIApplicationCommandOption"]]]},{"name":"resolved","description":"The resolved interaction data","type":[[["APIInteractionDataResolved"]]]}],"returns":[[["CommandInteractionOption"]]],"meta":{"line":162,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"deferReply","description":"Defers the reply to this interaction.","inherits":"BaseCommandInteraction#deferReply","inherited":true,"implements":["InteractionResponses#deferReply"],"examples":["// Defer the reply to this interaction\ninteraction.deferReply()\n .then(console.log)\n .catch(console.error)","// Defer to send an ephemeral reply later\ninteraction.deferReply({ ephemeral: true })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for deferring the reply to this interaction","optional":true,"type":[[["InteractionDeferReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":58,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"reply","description":"Creates a reply to this interaction.\nUse the `fetchReply` option to get the bot's reply message.","inherits":"BaseCommandInteraction#reply","inherited":true,"implements":["InteractionResponses#reply"],"examples":["// Reply to the interaction and fetch the response\ninteraction.reply({ content: 'Pong!', fetchReply: true })\n .then((message) => console.log(`Reply sent with content ${message.content}`))\n .catch(console.error);","// Create an ephemeral reply with an embed\nconst embed = new MessageEmbed().setDescription('Pong!');\n\ninteraction.reply({ embeds: [embed], ephemeral: true })\n .then(() => console.log('Reply sent.'))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":93,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"fetchReply","description":"Fetches a reply to this interaction.","see":["Webhook#fetchMessage"],"inherits":"BaseCommandInteraction#fetchReply","inherited":true,"implements":["InteractionResponses#fetchReply"],"examples":["// Fetch the initial reply to this interaction\ninteraction.fetchReply()\n .then(reply => console.log(`Replied with ${reply.content}`))\n .catch(console.error);"],"params":[{"name":"message","description":"The response to fetch","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":127,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"editReply","description":"Edits a reply to this interaction.","see":["Webhook#editMessage"],"inherits":"BaseCommandInteraction#editReply","inherited":true,"implements":["InteractionResponses#editReply"],"examples":["// Edit the initial reply to this interaction\ninteraction.editReply('New content')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The new options for the message","type":[[["string"]],[["MessagePayload"]],[["InteractionEditReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":148,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"deleteReply","description":"Deletes a reply to this interaction.","see":["Webhook#deleteMessage"],"inherits":"BaseCommandInteraction#deleteReply","inherited":true,"implements":["InteractionResponses#deleteReply"],"examples":["// Delete the initial reply to this interaction\ninteraction.deleteReply()\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"message","description":"The response to delete","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":166,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"followUp","description":"Send a follow-up message to this interaction.","inherits":"BaseCommandInteraction#followUp","inherited":true,"implements":["InteractionResponses#followUp"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":175,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"showModal","description":"Shows a modal component","inherits":"BaseCommandInteraction#showModal","inherited":true,"implements":["InteractionResponses#showModal"],"params":[{"name":"modal","description":"The modal to show","type":[[["Modal"]],[["ModalOptions"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":243,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"awaitModalSubmit","description":"Collects a single modal submit interaction that passes the filter.\nThe Promise will reject if the time expires.","inherits":"BaseCommandInteraction#awaitModalSubmit","inherited":true,"implements":["InteractionResponses#awaitModalSubmit"],"examples":["// Collect a modal submit interaction\nconst filter = (interaction) => interaction.customId === 'modal';\ninteraction.awaitModalSubmit({ filter, time: 15_000 })\n .then(interaction => console.log(`${interaction.customId} was submitted!`))\n .catch(console.error);"],"params":[{"name":"options","description":"Options to pass to the internal collector","type":[[["AwaitModalSubmitOptions"]]]}],"returns":[[["Promise","<"],["ModalSubmitInteraction",">"]]],"meta":{"line":275,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"inGuild","description":"Indicates whether this interaction is received from a guild.","inherits":"Interaction#inGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":173,"file":"Interaction.js","path":"src/structures"}},{"name":"inCachedGuild","description":"Indicates whether or not this interaction is both cached and received from a guild.","inherits":"Interaction#inCachedGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":181,"file":"Interaction.js","path":"src/structures"}},{"name":"inRawGuild","description":"Indicates whether or not this interaction is received from an uncached guild.","inherits":"Interaction#inRawGuild","inherited":true,"returns":[[["boolean"]]],"meta":{"line":189,"file":"Interaction.js","path":"src/structures"}},{"name":"isApplicationCommand","description":"Indicates whether this interaction is a {@link BaseCommandInteraction}.","inherits":"Interaction#isApplicationCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":197,"file":"Interaction.js","path":"src/structures"}},{"name":"isCommand","description":"Indicates whether this interaction is a {@link CommandInteraction}.","inherits":"Interaction#isCommand","inherited":true,"returns":[[["boolean"]]],"meta":{"line":205,"file":"Interaction.js","path":"src/structures"}},{"name":"isContextMenu","description":"Indicates whether this interaction is a {@link ContextMenuInteraction}","inherits":"Interaction#isContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":213,"file":"Interaction.js","path":"src/structures"}},{"name":"isModalSubmit","description":"Indicates whether this interaction is a {@link ModalSubmitInteraction}","inherits":"Interaction#isModalSubmit","inherited":true,"returns":[[["boolean"]]],"meta":{"line":221,"file":"Interaction.js","path":"src/structures"}},{"name":"isUserContextMenu","description":"Indicates whether this interaction is a {@link UserContextMenuInteraction}","inherits":"Interaction#isUserContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":229,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageContextMenu","description":"Indicates whether this interaction is a {@link MessageContextMenuInteraction}","inherits":"Interaction#isMessageContextMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":237,"file":"Interaction.js","path":"src/structures"}},{"name":"isAutocomplete","description":"Indicates whether this interaction is an {@link AutocompleteInteraction}","inherits":"Interaction#isAutocomplete","inherited":true,"returns":[[["boolean"]]],"meta":{"line":245,"file":"Interaction.js","path":"src/structures"}},{"name":"isMessageComponent","description":"Indicates whether this interaction is a {@link MessageComponentInteraction}.","inherits":"Interaction#isMessageComponent","inherited":true,"returns":[[["boolean"]]],"meta":{"line":253,"file":"Interaction.js","path":"src/structures"}},{"name":"isButton","description":"Indicates whether this interaction is a {@link ButtonInteraction}.","inherits":"Interaction#isButton","inherited":true,"returns":[[["boolean"]]],"meta":{"line":261,"file":"Interaction.js","path":"src/structures"}},{"name":"isSelectMenu","description":"Indicates whether this interaction is a {@link SelectMenuInteraction}.","inherits":"Interaction#isSelectMenu","inherited":true,"returns":[[["boolean"]]],"meta":{"line":272,"file":"Interaction.js","path":"src/structures"}},{"name":"isRepliable","description":"Indicates whether this interaction can be replied to.","inherits":"Interaction#isRepliable","inherited":true,"returns":[[["boolean"]]],"meta":{"line":283,"file":"Interaction.js","path":"src/structures"}}],"meta":{"line":9,"file":"UserContextMenuInteraction.js","path":"src/structures"}},{"name":"VoiceChannel","description":"Represents a guild voice channel on Discord.","extends":[[["BaseGuildVoiceChannel"]]],"props":[{"name":"editable","description":"Whether the channel is editable by the client user","readonly":true,"deprecated":"Use {@link VoiceChannel#manageable} instead","type":[[["boolean"]]],"meta":{"line":20,"file":"VoiceChannel.js","path":"src/structures"}},{"name":"joinable","description":"Whether the channel is joinable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":38,"file":"VoiceChannel.js","path":"src/structures"}},{"name":"speakable","description":"Checks if the client has permission to send audio to the voice channel","readonly":true,"type":[[["boolean"]]],"meta":{"line":49,"file":"VoiceChannel.js","path":"src/structures"}},{"name":"messages","description":"A manager of the messages sent to this channel","type":[[["MessageManager"]]],"meta":{"line":22,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"nsfw","description":"If the guild considers this channel NSFW","type":[[["boolean"]]],"meta":{"line":28,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"bitrate","description":"The bitrate of this voice-based channel","type":[[["number"]]],"meta":{"line":41,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"rtcRegion","description":"The RTC region for this voice-based channel. This region is automatically selected if `null`.","nullable":true,"type":[[["string"]]],"meta":{"line":49,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"userLimit","description":"The maximum amount of users allowed in this channel.","type":[[["number"]]],"meta":{"line":57,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"videoQualityMode","description":"The camera video quality mode of the channel.","nullable":true,"type":[[["VideoQualityMode"]]],"meta":{"line":65,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"lastMessageId","description":"The last message id sent in the channel, if one was sent","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":75,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"rateLimitPerUser","description":"The rate limit per user (slowmode) for this channel in seconds","type":[[["number"]]],"meta":{"line":87,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"status","description":"The status of the voice channel (max 500 characters)","nullable":true,"type":[[["string"]]],"meta":{"line":99,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"members","description":"The members in this voice-based channel","readonly":true,"type":[[["Collection","<"],["Snowflake",", "],["GuildMember",">"]]],"meta":{"line":108,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"full","description":"Checks if the voice-based channel is full","readonly":true,"type":[[["boolean"]]],"meta":{"line":123,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"lastMessage","description":"The Message object of the last message in the channel, if one was sent","readonly":true,"nullable":true,"type":[[["Message"]]],"meta":{"line":51,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"guild","description":"The guild the channel is in","type":[[["Guild"]]],"meta":{"line":31,"file":"GuildChannel.js","path":"src/structures"}},{"name":"guildId","description":"The id of the guild the channel is in","type":[[["Snowflake"]]],"meta":{"line":37,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionOverwrites","description":"A manager of permission overwrites that belong to this channel","type":[[["PermissionOverwriteManager"]]],"meta":{"line":44,"file":"GuildChannel.js","path":"src/structures"}},{"name":"name","description":"The name of the guild channel","type":[[["string"]]],"meta":{"line":57,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rawPosition","description":"The raw position of the channel from Discord","type":[[["number"]]],"meta":{"line":65,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parentId","description":"The id of the category parent of this channel","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":77,"file":"GuildChannel.js","path":"src/structures"}},{"name":"parent","description":"The category parent of this channel","readonly":true,"nullable":true,"type":[[["CategoryChannel"]]],"meta":{"line":99,"file":"GuildChannel.js","path":"src/structures"}},{"name":"permissionsLocked","description":"If the permissionOverwrites match the parent channel, null if no parent","readonly":true,"nullable":true,"type":[[["boolean"]]],"meta":{"line":108,"file":"GuildChannel.js","path":"src/structures"}},{"name":"position","description":"The position of the channel","readonly":true,"type":[[["number"]]],"meta":{"line":149,"file":"GuildChannel.js","path":"src/structures"}},{"name":"deletable","description":"Whether the channel is deletable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":418,"file":"GuildChannel.js","path":"src/structures"}},{"name":"manageable","description":"Whether the channel is manageable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":427,"file":"GuildChannel.js","path":"src/structures"}},{"name":"viewable","description":"Whether the channel is viewable by the client user","readonly":true,"type":[[["boolean"]]],"meta":{"line":447,"file":"GuildChannel.js","path":"src/structures"}},{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]],"meta":{"line":42,"file":"Channel.js","path":"src/structures"}},{"name":"id","description":"The channel's id","type":[[["Snowflake"]]],"meta":{"line":52,"file":"Channel.js","path":"src/structures"}},{"name":"flags","description":"The flags that are applied to the channel.","nullable":true,"type":[[["Readonly","<"],["ChannelFlags",">"]]],"meta":{"line":59,"file":"Channel.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the channel was created at","readonly":true,"type":[[["number"]]],"meta":{"line":70,"file":"Channel.js","path":"src/structures"}},{"name":"createdAt","description":"The time the channel was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":79,"file":"Channel.js","path":"src/structures"}},{"name":"deleted","description":"Whether or not the structure has been deleted","deprecated":"This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091","type":[[["boolean"]]],"meta":{"line":88,"file":"Channel.js","path":"src/structures"}},{"name":"partial","description":"Whether this Channel is a partial\nThis is always false outside of DM channels.","readonly":true,"type":[[["boolean"]]],"meta":{"line":119,"file":"Channel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"createInvite","description":"Creates an invite to this guild channel.","inherits":"BaseGuildVoiceChannel#createInvite","inherited":true,"examples":["// Create an invite to a channel\nchannel.createInvite()\n .then(invite => console.log(`Created an invite with a code of ${invite.code}`))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for creating the invite","optional":true,"default":"{}","type":[[["CreateInviteOptions"]]]}],"returns":[[["Promise","<"],["Invite",">"]]],"meta":{"line":156,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"fetchInvites","description":"Fetches a collection of invites to this guild channel.\nResolves with a collection mapping invites by their codes.","inherits":"BaseGuildVoiceChannel#fetchInvites","inherited":true,"params":[{"name":"cache","description":"Whether or not to cache the fetched invites","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Collection","<"],["string",", "],["Invite",">>"]]],"meta":{"line":166,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"setBitrate","description":"Sets the bitrate of the channel.","inherits":"BaseGuildVoiceChannel#setBitrate","inherited":true,"examples":["// Set the bitrate of a voice channel\nchannel.setBitrate(48_000)\n .then(channel => console.log(`Set bitrate to ${channel.bitrate}bps for ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"bitrate","description":"The new bitrate","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the channel's bitrate","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["BaseGuildVoiceChannel",">"]]],"meta":{"line":181,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"setRTCRegion","description":"Sets the RTC region of the channel.","inherits":"BaseGuildVoiceChannel#setRTCRegion","inherited":true,"examples":["// Set the RTC region to sydney\nchannel.setRTCRegion('sydney');","// Remove a fixed region for this channel - let Discord decide automatically\nchannel.setRTCRegion(null, 'We want to let Discord decide.');"],"params":[{"name":"rtcRegion","description":"The new region of the channel. Set to `null` to remove a specific region for the channel","nullable":true,"type":[[["string"]]]},{"name":"reason","description":"The reason for modifying this region.","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["BaseGuildVoiceChannel",">"]]],"meta":{"line":197,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"setUserLimit","description":"Sets the user limit of the channel.","inherits":"BaseGuildVoiceChannel#setUserLimit","inherited":true,"examples":["// Set the user limit of a voice channel\nchannel.setUserLimit(42)\n .then(channel => console.log(`Set user limit to ${channel.userLimit} for ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"userLimit","description":"The new user limit","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the user limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["BaseGuildVoiceChannel",">"]]],"meta":{"line":212,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"setVideoQualityMode","description":"Sets the camera video quality mode of the channel.","inherits":"BaseGuildVoiceChannel#setVideoQualityMode","inherited":true,"params":[{"name":"videoQualityMode","description":"The new camera video quality mode.","type":[[["VideoQualityMode"]],[["number"]]]},{"name":"reason","description":"Reason for changing the camera video quality mode.","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["BaseGuildVoiceChannel",">"]]],"meta":{"line":222,"file":"BaseGuildVoiceChannel.js","path":"src/structures"}},{"name":"send","description":"Sends a message to this channel.","inherits":"BaseGuildVoiceChannel#send","inherited":true,"implements":["TextBasedChannel#send"],"examples":["// Send a basic message\nchannel.send('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.error);","// Send a remote file\nchannel.send({\n files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']\n})\n .then(console.log)\n .catch(console.error);","// Send a local file\nchannel.send({\n files: [{\n attachment: 'entire/path/to/file.jpg',\n name: 'file.jpg',\n description: 'A description of the file'\n }]\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["MessageOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":181,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"sendTyping","description":"Sends a typing indicator in the channel.","inherits":"BaseGuildVoiceChannel#sendTyping","inherited":true,"implements":["TextBasedChannel#sendTyping"],"examples":["// Start typing in a channel\nchannel.sendTyping();"],"returns":{"types":[[["Promise","<({"],["message_send_cooldown_ms",": "],["number",", "],["thread_create_cooldown_ms",": "],["number","}|"],["void",")>"]]],"description":"Resolves upon the typing status being sent"},"meta":{"line":395,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createMessageCollector","description":"Creates a Message Collector.","inherits":"BaseGuildVoiceChannel#createMessageCollector","inherited":true,"implements":["TextBasedChannel#createMessageCollector"],"examples":["// Create a message collector\nconst filter = m => m.content.includes('discord');\nconst collector = channel.createMessageCollector({ filter, time: 15_000 });\ncollector.on('collect', m => console.log(`Collected ${m.content}`));\ncollector.on('end', collected => console.log(`Collected ${collected.size} items`));"],"params":[{"name":"options","description":"The options to pass to the collector","optional":true,"default":"{}","type":[[["MessageCollectorOptions"]]]}],"returns":[[["MessageCollector"]]],"meta":{"line":410,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"awaitMessages","description":"Similar to createMessageCollector but in promise form.\nResolves with a collection of messages that pass the specified filter.","inherits":"BaseGuildVoiceChannel#awaitMessages","inherited":true,"implements":["TextBasedChannel#awaitMessages"],"examples":["// Await !vote messages\nconst filter = m => m.content.startsWith('!vote');\n// Errors: ['time'] treats ending because of the time limit as an error\nchannel.awaitMessages({ filter, max: 4, time: 60_000, errors: ['time'] })\n .then(collected => console.log(collected.size))\n .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));"],"params":[{"name":"options","description":"Optional options to pass to the internal collector","optional":true,"default":"{}","type":[[["AwaitMessagesOptions"]]]}],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Message",">>"]]],"meta":{"line":433,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"fetchWebhooks","description":"Fetches all webhooks for the channel.","inherits":"BaseGuildVoiceChannel#fetchWebhooks","inherited":true,"implements":["TextBasedChannel#fetchWebhooks"],"examples":["// Fetch webhooks\nchannel.fetchWebhooks()\n .then(hooks => console.log(`This channel has ${hooks.size} hooks`))\n .catch(console.error);"],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Webhook",">>"]]],"meta":{"line":455,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createWebhook","description":"Creates a webhook for the channel.","inherits":"BaseGuildVoiceChannel#createWebhook","inherited":true,"implements":["TextBasedChannel#createWebhook"],"examples":["// Create a webhook for the current channel\nchannel.createWebhook('Snek', {\n avatar: 'https://i.imgur.com/mI8XcpG.jpg',\n reason: 'Needed a cool new Webhook'\n})\n .then(console.log)\n .catch(console.error)"],"params":[{"name":"name","description":"The name of the webhook","type":[[["string"]]]},{"name":"options","description":"Options for creating the webhook","optional":true,"type":[[["ChannelWebhookCreateOptions"]]]}],"returns":{"types":[[["Promise","<"],["Webhook",">"]]],"description":"Returns the created Webhook"},"meta":{"line":480,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setRateLimitPerUser","description":"Sets the rate limit per user (slowmode) for this channel.","inherits":"BaseGuildVoiceChannel#setRateLimitPerUser","inherited":true,"implements":["TextBasedChannel#setRateLimitPerUser"],"params":[{"name":"rateLimitPerUser","description":"The new rate limit in seconds","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the channel's rate limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":490,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setNSFW","description":"Sets whether this channel is flagged as NSFW.","inherits":"BaseGuildVoiceChannel#setNSFW","inherited":true,"implements":["TextBasedChannel#setNSFW"],"params":[{"name":"nsfw","description":"Whether the channel should be considered NSFW","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for changing the channel's NSFW flag","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":500,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"permissionsFor","description":"Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.","inherits":"GuildChannel#permissionsFor","inherited":true,"params":[{"name":"memberOrRole","description":"The member or role to obtain the overall permissions for","type":[[["GuildMemberResolvable"]],[["RoleResolvable"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":{"types":[[["Readonly","<"],["Permissions",">"]]],"nullable":true},"meta":{"line":173,"file":"GuildChannel.js","path":"src/structures"}},{"name":"memberPermissions","description":"Gets the overall set of permissions for a member in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#memberPermissions","inherited":true,"params":[{"name":"member","description":"The member to obtain the overall permissions for","type":[[["GuildMember"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","default":true,"type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":213,"file":"GuildChannel.js","path":"src/structures"}},{"name":"rolePermissions","description":"Gets the overall set of permissions for a role in this channel, taking into account channel overwrites.","access":"private","inherits":"GuildChannel#rolePermissions","inherited":true,"params":[{"name":"role","description":"The role to obtain the overall permissions for","type":[[["Role"]]]},{"name":"checkAdmin","description":"Whether having `ADMINISTRATOR` will return all permissions","type":[[["boolean"]]]}],"returns":[[["Readonly","<"],["Permissions",">"]]],"meta":{"line":242,"file":"GuildChannel.js","path":"src/structures"}},{"name":"lockPermissions","description":"Locks in the permission overwrites from the parent channel.","inherits":"GuildChannel#lockPermissions","inherited":true,"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":263,"file":"GuildChannel.js","path":"src/structures"}},{"name":"edit","description":"Edits the channel.","inherits":"GuildChannel#edit","inherited":true,"examples":["// Edit a channel\nchannel.edit({ name: 'new-channel' })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"data","description":"The new data for the channel","type":[[["ChannelData"]]]},{"name":"reason","description":"Reason for editing this channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":291,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setName","description":"Sets a new name for the guild channel.","inherits":"GuildChannel#setName","inherited":true,"examples":["// Set a new channel name\nchannel.setName('not_general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.error);"],"params":[{"name":"name","description":"The new name for the guild channel","type":[[["string"]]]},{"name":"reason","description":"Reason for changing the guild channel's name","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":306,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setParent","description":"Sets the parent of this channel.","inherits":"GuildChannel#setParent","inherited":true,"examples":["// Add a parent to a channel\nmessage.channel.setParent('355908108431917066', { lockPermissions: false })\n .then(channel => console.log(`New parent of ${message.channel.name}: ${channel.name}`))\n .catch(console.error);"],"params":[{"name":"channel","description":"The category channel to set as the parent","nullable":true,"type":[[["CategoryChannelResolvable"]]]},{"name":"options","description":"The options for setting the parent","optional":true,"default":"{}","type":[[["SetParentOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":328,"file":"GuildChannel.js","path":"src/structures"}},{"name":"setPosition","description":"Sets a new position for the guild channel.","inherits":"GuildChannel#setPosition","inherited":true,"examples":["// Set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.error);"],"params":[{"name":"position","description":"The new position for the guild channel","type":[[["number"]]]},{"name":"options","description":"Options for setting position","optional":true,"type":[[["SetChannelPositionOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":356,"file":"GuildChannel.js","path":"src/structures"}},{"name":"clone","description":"Clones this channel.","inherits":"GuildChannel#clone","inherited":true,"params":[{"name":"options","description":"The options for cloning this channel","optional":true,"type":[[["GuildChannelCloneOptions"]]]}],"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":371,"file":"GuildChannel.js","path":"src/structures"}},{"name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites, and id as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","inherits":"GuildChannel#equals","inherited":true,"params":[{"name":"channel","description":"Channel to compare with","type":[[["GuildChannel"]]]}],"returns":[[["boolean"]]],"meta":{"line":393,"file":"GuildChannel.js","path":"src/structures"}},{"name":"delete","description":"Deletes this channel.","inherits":"GuildChannel#delete","inherited":true,"examples":["// Delete the channel\nchannel.delete('making room for new channels')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"reason","description":"Reason for deleting this channel","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["GuildChannel",">"]]],"meta":{"line":464,"file":"GuildChannel.js","path":"src/structures"}},{"name":"toString","description":"When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.","inherits":"Channel#toString","inherited":true,"examples":["// Logs: Hello from <#123456789012345678>!\nconsole.log(`Hello from ${channel}!`);"],"returns":[[["string"]]],"meta":{"line":130,"file":"Channel.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this channel.","inherits":"Channel#fetch","inherited":true,"params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["Channel",">"]]],"meta":{"line":153,"file":"Channel.js","path":"src/structures"}},{"name":"isText","description":"Indicates whether this channel is {@link TextBasedChannels text-based}.","inherits":"Channel#isText","inherited":true,"returns":[[["boolean"]]],"meta":{"line":161,"file":"Channel.js","path":"src/structures"}},{"name":"isVoice","description":"Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}.","inherits":"Channel#isVoice","inherited":true,"returns":[[["boolean"]]],"meta":{"line":169,"file":"Channel.js","path":"src/structures"}},{"name":"isThread","description":"Indicates whether this channel is a {@link ThreadChannel}.","inherits":"Channel#isThread","inherited":true,"returns":[[["boolean"]]],"meta":{"line":177,"file":"Channel.js","path":"src/structures"}},{"name":"isThreadOnly","description":"Indicates whether this channel is {@link ThreadOnlyChannel}.","inherits":"Channel#isThreadOnly","inherited":true,"returns":[[["boolean"]]],"meta":{"line":185,"file":"Channel.js","path":"src/structures"}},{"name":"isDirectory","description":"Indicates whether this channel is a {@link DirectoryChannel}","inherits":"Channel#isDirectory","inherited":true,"returns":[[["boolean"]]],"meta":{"line":193,"file":"Channel.js","path":"src/structures"}}],"meta":{"line":13,"file":"VoiceChannel.js","path":"src/structures"}},{"name":"VoiceChannelEffect","description":"Represents an effect used in a {@link VoiceChannel}.","props":[{"name":"guild","description":"The guild where the effect was sent from.","type":[[["Guild"]]],"meta":{"line":14,"file":"VoiceChannelEffect.js","path":"src/structures"}},{"name":"channelId","description":"The id of the channel the effect was sent in.","type":[[["Snowflake"]]],"meta":{"line":20,"file":"VoiceChannelEffect.js","path":"src/structures"}},{"name":"userId","description":"The id of the user that sent the effect.","type":[[["Snowflake"]]],"meta":{"line":26,"file":"VoiceChannelEffect.js","path":"src/structures"}},{"name":"emoji","description":"The emoji of the effect.","nullable":true,"type":[[["Emoji"]]],"meta":{"line":32,"file":"VoiceChannelEffect.js","path":"src/structures"}},{"name":"animationType","description":"The animation type of the effect.","nullable":true,"type":[[["VoiceChannelEffectSendAnimationType"]]],"meta":{"line":38,"file":"VoiceChannelEffect.js","path":"src/structures"}},{"name":"animationId","description":"The animation id of the effect.","nullable":true,"type":[[["number"]]],"meta":{"line":44,"file":"VoiceChannelEffect.js","path":"src/structures"}},{"name":"soundId","description":"The id of the soundboard sound for soundboard effects.","nullable":true,"type":[[["Snowflake"]],[["number"]]],"meta":{"line":50,"file":"VoiceChannelEffect.js","path":"src/structures"}},{"name":"soundVolume","description":"The volume of the soundboard sound [0-1] for soundboard effects.","nullable":true,"type":[[["number"]]],"meta":{"line":56,"file":"VoiceChannelEffect.js","path":"src/structures"}},{"name":"channel","description":"The channel the effect was sent in.","readonly":true,"nullable":true,"type":[[["VoiceChannel"]]],"meta":{"line":64,"file":"VoiceChannelEffect.js","path":"src/structures"}}],"meta":{"line":8,"file":"VoiceChannelEffect.js","path":"src/structures"}},{"name":"VoiceRegion","description":"Represents a Discord voice region for guilds.","props":[{"name":"id","description":"The region's id","type":[[["string"]]],"meta":{"line":14,"file":"VoiceRegion.js","path":"src/structures"}},{"name":"name","description":"Name of the region","type":[[["string"]]],"meta":{"line":20,"file":"VoiceRegion.js","path":"src/structures"}},{"name":"vip","description":"Whether the region is VIP-only","deprecated":"This property is no longer being sent by the API.","type":[[["boolean"]]],"meta":{"line":27,"file":"VoiceRegion.js","path":"src/structures"}},{"name":"deprecated","description":"Whether the region is deprecated","type":[[["boolean"]]],"meta":{"line":33,"file":"VoiceRegion.js","path":"src/structures"}},{"name":"optimal","description":"Whether the region is optimal","type":[[["boolean"]]],"meta":{"line":39,"file":"VoiceRegion.js","path":"src/structures"}},{"name":"custom","description":"Whether the region is custom","type":[[["boolean"]]],"meta":{"line":45,"file":"VoiceRegion.js","path":"src/structures"}}],"meta":{"line":8,"file":"VoiceRegion.js","path":"src/structures"}},{"name":"VoiceState","description":"Represents the voice state for a Guild Member.","extends":[[["Base"]]],"props":[{"name":"guild","description":"The guild of this voice state","type":[[["Guild"]]],"meta":{"line":17,"file":"VoiceState.js","path":"src/structures"}},{"name":"id","description":"The id of the member of this voice state","type":[[["Snowflake"]]],"meta":{"line":22,"file":"VoiceState.js","path":"src/structures"}},{"name":"serverDeaf","description":"Whether this member is deafened server-wide","nullable":true,"type":[[["boolean"]]],"meta":{"line":32,"file":"VoiceState.js","path":"src/structures"}},{"name":"serverMute","description":"Whether this member is muted server-wide","nullable":true,"type":[[["boolean"]]],"meta":{"line":42,"file":"VoiceState.js","path":"src/structures"}},{"name":"selfDeaf","description":"Whether this member is self-deafened","nullable":true,"type":[[["boolean"]]],"meta":{"line":52,"file":"VoiceState.js","path":"src/structures"}},{"name":"selfMute","description":"Whether this member is self-muted","nullable":true,"type":[[["boolean"]]],"meta":{"line":62,"file":"VoiceState.js","path":"src/structures"}},{"name":"selfVideo","description":"Whether this member's camera is enabled","nullable":true,"type":[[["boolean"]]],"meta":{"line":72,"file":"VoiceState.js","path":"src/structures"}},{"name":"sessionId","description":"The session id for this member's connection","nullable":true,"type":[[["string"]]],"meta":{"line":82,"file":"VoiceState.js","path":"src/structures"}},{"name":"streaming","description":"Whether this member is streaming using \"Screen Share\"","type":[[["boolean"]]],"meta":{"line":94,"file":"VoiceState.js","path":"src/structures"}},{"name":"channelId","description":"The {@link VoiceChannel} or {@link StageChannel} id the member is in","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":104,"file":"VoiceState.js","path":"src/structures"}},{"name":"suppress","description":"Whether this member is suppressed from speaking. This property is specific to stage channels only.","type":[[["boolean"]]],"meta":{"line":114,"file":"VoiceState.js","path":"src/structures"}},{"name":"requestToSpeakTimestamp","description":"The time at which the member requested to speak. This property is specific to stage channels only.","nullable":true,"type":[[["number"]]],"meta":{"line":122,"file":"VoiceState.js","path":"src/structures"}},{"name":"member","description":"The member that this voice state belongs to","readonly":true,"nullable":true,"type":[[["GuildMember"]]],"meta":{"line":135,"file":"VoiceState.js","path":"src/structures"}},{"name":"user","description":"The user that this voice state belongs to","readonly":true,"nullable":true,"type":[[["User"]]],"meta":{"line":145,"file":"VoiceState.js","path":"src/structures"}},{"name":"channel","description":"The channel that the member is connected to","readonly":true,"nullable":true,"type":[[["VoiceChannel"]],[["StageChannel"]],[["DMChannel"]],[["GroupDMChannel"]]],"meta":{"line":154,"file":"VoiceState.js","path":"src/structures"}},{"name":"deaf","description":"Whether this member is either self-deafened or server-deafened","readonly":true,"nullable":true,"type":[[["boolean"]]],"meta":{"line":163,"file":"VoiceState.js","path":"src/structures"}},{"name":"mute","description":"Whether this member is either self-muted or server-muted","readonly":true,"nullable":true,"type":[[["boolean"]]],"meta":{"line":172,"file":"VoiceState.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"setMute","description":"Mutes/unmutes the member of this voice state.","params":[{"name":"mute","description":"Whether or not the member should be muted","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for muting or unmuting","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":182,"file":"VoiceState.js","path":"src/structures"}},{"name":"setDeaf","description":"Deafens/undeafens the member of this voice state.","params":[{"name":"deaf","description":"Whether or not the member should be deafened","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for deafening or undeafening","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":193,"file":"VoiceState.js","path":"src/structures"}},{"name":"disconnect","description":"Disconnects the member from the channel.","params":[{"name":"reason","description":"Reason for disconnecting the member from the channel","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":203,"file":"VoiceState.js","path":"src/structures"}},{"name":"setChannel","description":"Moves the member to a different channel, or disconnects them from the one they're in.","params":[{"name":"channel","description":"Channel to move the member to, or `null` if you want to\ndisconnect them from voice.","type":[[["GuildVoiceChannelResolvable"]],[["null"]]]},{"name":"reason","description":"Reason for moving member to another channel or disconnecting","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["GuildMember",">"]]],"meta":{"line":214,"file":"VoiceState.js","path":"src/structures"}},{"name":"setRequestToSpeak","description":"Toggles the request to speak in the channel.\nOnly applicable for stage channels and for the client's own voice state.","examples":["// Making the client request to speak in a stage channel (raise its hand)\nguild.members.me.voice.setRequestToSpeak(true);","// Making the client cancel a request to speak\nguild.members.me.voice.setRequestToSpeak(false);"],"params":[{"name":"request","description":"Whether or not the client is requesting to become a speaker.","optional":true,"default":true,"type":[[["boolean"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":231,"file":"VoiceState.js","path":"src/structures"}},{"name":"setSuppressed","description":"Suppress/unsuppress the user. Only applicable for stage channels.","examples":["// Making the client a speaker\nguild.members.me.voice.setSuppressed(false);","// Making the client an audience member\nguild.members.me.voice.setSuppressed(true);","// Inviting another user to speak\nvoiceState.setSuppressed(false);","// Moving another user to the audience, or cancelling their invite to speak\nvoiceState.setSuppressed(true);"],"params":[{"name":"suppressed","description":"Whether or not the user should be suppressed.","optional":true,"default":true,"type":[[["boolean"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":261,"file":"VoiceState.js","path":"src/structures"}},{"name":"setStatus","description":"Sets the status of the voice channel","examples":["// Setting the status to something\nguild.members.me.voice.setStatus(\"something\")","// Removing the status\nguild.members.me.voice.setStatus()"],"params":[{"name":"status","description":"The message to set the channel status to","optional":true,"default":"\"\"","type":[[["string"]]]}],"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":288,"file":"VoiceState.js","path":"src/structures"}},{"name":"getPreview","description":"Get URL Image of the user's streaming video (NOT STREAMING !!!)","async":true,"returns":{"types":[[["Promise","<"],["string",">"]]],"description":"URL Image of the user's streaming video"},"meta":{"line":301,"file":"VoiceState.js","path":"src/structures"}},{"name":"postPreview","description":"Post Preview Image to the client user's streaming video","params":[{"name":"base64Image","description":"Base64 URI (data:image/jpeg;base64,data)","type":[[["string"]]]}],"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":317,"file":"VoiceState.js","path":"src/structures"}},{"name":"fetch","description":"Fetches this voice state.","params":[{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Promise","<"],["VoiceState",">"]]],"meta":{"line":336,"file":"VoiceState.js","path":"src/structures"}}],"meta":{"line":10,"file":"VoiceState.js","path":"src/structures"}},{"name":"WebEmbed","description":"Send Embedlink to Discord\nOnly works with Discord Web and Discord Client (no custom theme installed)\n- No Timestamp, Footer, Fields, Author iconURL\n- Video with Embed working\n- Can only choose between image and thumbnail\n- Description limit 350 characters","construct":{"name":"WebEmbed","params":[{"name":"data","description":"Raw data","optional":true,"default":"{}","type":[[["WebEmbed"]]]}]},"props":[{"name":"imageType","description":"Type image of this embed","type":[[["thumbnail"]],[["image"]]],"meta":{"line":60,"file":"WebEmbed.js","path":"src/structures"}},{"name":"title","description":"The title of this embed","nullable":true,"type":[[["string"]]],"meta":{"line":65,"file":"WebEmbed.js","path":"src/structures"}},{"name":"description","description":"The description of this embed","nullable":true,"type":[[["string"]]],"meta":{"line":71,"file":"WebEmbed.js","path":"src/structures"}},{"name":"url","description":"The URL of this embed","nullable":true,"type":[[["string"]]],"meta":{"line":77,"file":"WebEmbed.js","path":"src/structures"}},{"name":"color","description":"The color of this embed","nullable":true,"type":[[["number"]]],"meta":{"line":83,"file":"WebEmbed.js","path":"src/structures"}},{"name":"image","description":"The image of this embed, if there is one","nullable":true,"type":[[["WebEmbedImage"]]],"meta":{"line":98,"file":"WebEmbed.js","path":"src/structures"}},{"name":"thumbnail","description":"The thumbnail of this embed (if there is one)","nullable":true,"type":[[["WebEmbedThumbnail"]]],"meta":{"line":111,"file":"WebEmbed.js","path":"src/structures"}},{"name":"video","description":"The video of this embed (if there is one)","readonly":true,"nullable":true,"type":[[["WebEmbedVideo"]]],"meta":{"line":134,"file":"WebEmbed.js","path":"src/structures"}},{"name":"author","description":"The author of this embed (if there is one)","nullable":true,"type":[[["WebEmbedAuthor"]]],"meta":{"line":154,"file":"WebEmbed.js","path":"src/structures"}},{"name":"provider","description":"The provider of this embed (if there is one)","nullable":true,"type":[[["WebEmbedProvider"]]],"meta":{"line":172,"file":"WebEmbed.js","path":"src/structures"}},{"name":"redirect","description":"Redirect URL","type":[[["string"]]],"meta":{"line":183,"file":"WebEmbed.js","path":"src/structures"}}],"methods":[{"name":"_setup","access":"private","params":[{"name":"data","description":"The data for the embed","type":[[["Object"]]]}],"meta":{"line":55,"file":"WebEmbed.js","path":"src/structures"}},{"name":"setAuthor","description":"Sets the author of this embed.","params":[{"name":"options","description":"The options to provide for the author.\nProvide `null` to remove the author data.","type":[[["string"]],[["EmbedAuthorData"]],[["null"]]]}],"returns":[[["WebEmbed"]]],"meta":{"line":197,"file":"WebEmbed.js","path":"src/structures"}},{"name":"setProvider","description":"Sets the provider of this embed.","params":[{"name":"options","description":"The options to provide for the provider.\nProvide `null` to remove the provider data.","type":[[["string"]],[["EmbedProviderData"]],[["null"]]]}],"returns":[[["WebEmbed"]]],"meta":{"line":222,"file":"WebEmbed.js","path":"src/structures"}},{"name":"setColor","description":"Sets the color of this embed.","params":[{"name":"color","description":"The color of the embed","type":[[["ColorResolvable"]]]}],"returns":[[["WebEmbed"]]],"meta":{"line":240,"file":"WebEmbed.js","path":"src/structures"}},{"name":"setDescription","description":"Sets the description of this embed.","params":[{"name":"description","description":"The description (Limit 350 characters)","type":[[["string"]]]}],"returns":[[["WebEmbed"]]],"meta":{"line":250,"file":"WebEmbed.js","path":"src/structures"}},{"name":"setImage","description":"Sets the image of this embed.","params":[{"name":"url","description":"The URL of the image","type":[[["string"]]]}],"returns":[[["WebEmbed"]]],"meta":{"line":260,"file":"WebEmbed.js","path":"src/structures"}},{"name":"setThumbnail","description":"Sets the thumbnail of this embed.","params":[{"name":"url","description":"The URL of the image","type":[[["string"]]]}],"returns":[[["WebEmbed"]]],"meta":{"line":275,"file":"WebEmbed.js","path":"src/structures"}},{"name":"setVideo","description":"Sets the video of this embed.","params":[{"name":"url","description":"The URL of the video","type":[[["string"]]]}],"returns":[[["WebEmbed"]]],"meta":{"line":290,"file":"WebEmbed.js","path":"src/structures"}},{"name":"setTitle","description":"Sets the title of this embed.","params":[{"name":"title","description":"The title","type":[[["string"]]]}],"returns":[[["WebEmbed"]]],"meta":{"line":300,"file":"WebEmbed.js","path":"src/structures"}},{"name":"setURL","description":"Sets the URL of this embed.","params":[{"name":"url","description":"The URL","type":[[["string"]]]}],"returns":[[["WebEmbed"]]],"meta":{"line":310,"file":"WebEmbed.js","path":"src/structures"}},{"name":"setRedirect","description":"Sets the redirect URL of this embed.","params":[{"name":"url","description":"The URL","type":[[["string"]]]}],"returns":[[["WebEmbed"]]],"meta":{"line":320,"file":"WebEmbed.js","path":"src/structures"}}],"meta":{"line":17,"file":"WebEmbed.js","path":"src/structures"}},{"name":"Webhook","description":"Represents a webhook.","props":[{"name":"client","description":"The client that instantiated the webhook","readonly":true,"type":[[["Client"]]],"meta":{"line":17,"file":"Webhook.js","path":"src/structures"}},{"name":"name","description":"The name of the webhook","type":[[["string"]]],"meta":{"line":33,"file":"Webhook.js","path":"src/structures"}},{"name":"token","description":"The token for the webhook, unavailable for follower webhooks and webhooks owned by another application.","nullable":true,"type":[[["string"]]],"meta":{"line":36,"file":"Webhook.js","path":"src/structures"}},{"name":"avatar","description":"The avatar for the webhook","nullable":true,"type":[[["string"]]],"meta":{"line":48,"file":"Webhook.js","path":"src/structures"}},{"name":"id","description":"The webhook's id","type":[[["Snowflake"]]],"meta":{"line":55,"file":"Webhook.js","path":"src/structures"}},{"name":"type","description":"The type of the webhook","type":[[["WebhookType"]]],"meta":{"line":62,"file":"Webhook.js","path":"src/structures"}},{"name":"guildId","description":"The guild the webhook belongs to","type":[[["Snowflake"]]],"meta":{"line":70,"file":"Webhook.js","path":"src/structures"}},{"name":"channelId","description":"The id of the channel the webhook belongs to","type":[[["Snowflake"]]],"meta":{"line":78,"file":"Webhook.js","path":"src/structures"}},{"name":"owner","description":"The owner of the webhook","nullable":true,"type":[[["User"]],[["APIUser"]]],"meta":{"line":86,"file":"Webhook.js","path":"src/structures"}},{"name":"sourceGuild","description":"The source guild of the webhook","nullable":true,"type":[[["Guild"]],[["APIGuild"]]],"meta":{"line":96,"file":"Webhook.js","path":"src/structures"}},{"name":"sourceChannel","description":"The source channel of the webhook","nullable":true,"type":[[["NewsChannel"]],[["APIChannel"]]],"meta":{"line":106,"file":"Webhook.js","path":"src/structures"}},{"name":"channel","description":"The channel the webhook belongs to","readonly":true,"nullable":true,"type":[[["TextChannel"]],[["VoiceChannel"]],[["NewsChannel"]],[["ForumChannel"]],[["MediaChannel"]]],"meta":{"line":402,"file":"Webhook.js","path":"src/structures"}},{"name":"createdTimestamp","description":"The timestamp the webhook was created at","readonly":true,"type":[[["number"]]],"meta":{"line":411,"file":"Webhook.js","path":"src/structures"}},{"name":"createdAt","description":"The time the webhook was created at","readonly":true,"type":[[["Date"]]],"meta":{"line":420,"file":"Webhook.js","path":"src/structures"}},{"name":"url","description":"The URL of this webhook","readonly":true,"type":[[["string"]]],"meta":{"line":429,"file":"Webhook.js","path":"src/structures"}}],"methods":[{"name":"send","description":"Sends a message with this webhook.","examples":["// Send a basic message\nwebhook.send('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.error);","// Send a basic message in a thread\nwebhook.send({ content: 'hello!', threadId: '836856309672348295' })\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.error);","// Send a remote file\nwebhook.send({\n files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']\n})\n .then(console.log)\n .catch(console.error);","// Send a local file\nwebhook.send({\n files: [{\n attachment: 'entire/path/to/file.jpg',\n name: 'file.jpg'\n }]\n})\n .then(console.log)\n .catch(console.error);","// Send an embed with a local image inside\nwebhook.send({\n content: 'This is an embed',\n embeds: [{\n thumbnail: {\n url: 'attachment://file.jpg'\n }\n }],\n files: [{\n attachment: 'entire/path/to/file.jpg',\n name: 'file.jpg'\n }]\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["WebhookMessageOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":191,"file":"Webhook.js","path":"src/structures"}},{"name":"sendSlackMessage","description":"Sends a raw slack message with this webhook.","see":["{@link https://api.slack.com/messaging/webhooks}"],"examples":["// Send a slack message\nwebhook.sendSlackMessage({\n 'username': 'Wumpus',\n 'attachments': [{\n 'pretext': 'this looks pretty cool',\n 'color': '#F0F',\n 'footer_icon': 'http://snek.s3.amazonaws.com/topSnek.png',\n 'footer': 'Powered by sneks',\n 'ts': Date.now() / 1_000\n }]\n}).catch(console.error);"],"params":[{"name":"body","description":"The raw body to send","type":[[["Object"]]]}],"async":true,"returns":[[["Promise","<"],["boolean",">"]]],"meta":{"line":235,"file":"Webhook.js","path":"src/structures"}},{"name":"edit","description":"Edits this webhook.","params":[{"name":"options","description":"Options for editing the webhook","type":[[["WebhookEditData"]]]},{"name":"reason","description":"Reason for editing the webhook","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["Webhook",">"]]],"meta":{"line":262,"file":"Webhook.js","path":"src/structures"}},{"name":"fetchMessage","description":"Gets a message that was sent by this webhook.","params":[{"name":"message","description":"The id of the message to fetch","type":[[["Snowflake"]],[["original","'"]]]},{"name":"cacheOrOptions","description":"The options to provide to fetch the message.\nA **deprecated** boolean may be passed instead to specify whether to cache the message.","optional":true,"default":"{}","type":[[["WebhookFetchMessageOptions"]],[["boolean"]]]}],"async":true,"returns":{"types":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"description":"Returns the raw message data if the webhook was instantiated as a\n{@link WebhookClient} or if the channel is uncached, otherwise a {@link Message} will be returned"},"meta":{"line":296,"file":"Webhook.js","path":"src/structures"}},{"name":"editMessage","description":"Edits a message that was sent by this webhook.","params":[{"name":"message","description":"The message to edit","type":[[["MessageResolvable"]],[["original","'"]]]},{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["WebhookEditMessageOptions"]]]}],"async":true,"returns":{"types":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"description":"Returns the raw message data if the webhook was instantiated as a\n{@link WebhookClient} or if the channel is uncached, otherwise a {@link Message} will be returned"},"meta":{"line":332,"file":"Webhook.js","path":"src/structures"}},{"name":"delete","description":"Deletes the webhook.","params":[{"name":"reason","description":"Reason for deleting this webhook","optional":true,"type":[[["string"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":372,"file":"Webhook.js","path":"src/structures"}},{"name":"deleteMessage","description":"Delete a message that was sent by this webhook.","params":[{"name":"message","description":"The message to delete","type":[[["MessageResolvable"]],[["original","'"]]]},{"name":"threadId","description":"The id of the thread this message belongs to","optional":true,"type":[[["Snowflake"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":382,"file":"Webhook.js","path":"src/structures"}},{"name":"avatarURL","description":"A link to the webhook's avatar.","params":[{"name":"options","description":"Options for the Image URL","optional":true,"default":"{}","type":[[["StaticImageURLOptions"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":438,"file":"Webhook.js","path":"src/structures"}},{"name":"isChannelFollower","description":"Whether or not this webhook is a channel follower webhook.","returns":[[["boolean"]]],"meta":{"line":447,"file":"Webhook.js","path":"src/structures"}},{"name":"isIncoming","description":"Whether or not this webhook is an incoming webhook.","returns":[[["boolean"]]],"meta":{"line":455,"file":"Webhook.js","path":"src/structures"}}],"meta":{"line":15,"file":"Webhook.js","path":"src/structures"}},{"name":"WelcomeChannel","description":"Represents a channel link in a guild's welcome screen.","extends":[[["Base"]]],"props":[{"name":"guild","description":"The guild for this welcome channel","type":[[["Guild"]],[["InviteGuild"]]],"meta":{"line":18,"file":"WelcomeChannel.js","path":"src/structures"}},{"name":"description","description":"The description of this welcome channel","type":[[["string"]]],"meta":{"line":24,"file":"WelcomeChannel.js","path":"src/structures"}},{"name":"_emoji","description":"The raw emoji data","access":"private","type":[[["Object"]]],"meta":{"line":31,"file":"WelcomeChannel.js","path":"src/structures"}},{"name":"channelId","description":"The id of this welcome channel","type":[[["Snowflake"]]],"meta":{"line":40,"file":"WelcomeChannel.js","path":"src/structures"}},{"name":"channel","description":"The channel of this welcome channel","nullable":true,"type":[[["TextChannel"]],[["NewsChannel"]],[["StoreChannel"]],[["ForumChannel"]],[["MediaChannel"]]],"meta":{"line":47,"file":"WelcomeChannel.js","path":"src/structures"}},{"name":"emoji","description":"The emoji of this welcome channel","type":[[["GuildEmoji"]],[["Emoji"]]],"meta":{"line":55,"file":"WelcomeChannel.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"meta":{"line":10,"file":"WelcomeChannel.js","path":"src/structures"}},{"name":"WelcomeScreen","description":"Represents a welcome screen.","extends":[[["Base"]]],"props":[{"name":"guild","description":"The guild for this welcome screen","type":[[["Guild"]]],"meta":{"line":19,"file":"WelcomeScreen.js","path":"src/structures"}},{"name":"description","description":"The description of this welcome screen","nullable":true,"type":[[["string"]]],"meta":{"line":25,"file":"WelcomeScreen.js","path":"src/structures"}},{"name":"welcomeChannels","description":"Collection of welcome channels belonging to this welcome screen","type":[[["Collection","<"],["Snowflake",", "],["WelcomeChannel",">"]]],"meta":{"line":31,"file":"WelcomeScreen.js","path":"src/structures"}},{"name":"enabled","description":"Whether the welcome screen is enabled on the guild or not","type":[[["boolean"]]],"meta":{"line":43,"file":"WelcomeScreen.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"meta":{"line":11,"file":"WelcomeScreen.js","path":"src/structures"}},{"name":"Widget","description":"Represents a Widget.","extends":[[["Base"]]],"props":[{"name":"id","description":"The id of the guild.","type":[[["Snowflake"]]],"meta":{"line":30,"file":"Widget.js","path":"src/structures"}},{"name":"name","description":"The name of the guild.","type":[[["string"]]],"meta":{"line":37,"file":"Widget.js","path":"src/structures"}},{"name":"instantInvite","description":"The invite of the guild.","nullable":true,"type":[[["string"]]],"meta":{"line":45,"file":"Widget.js","path":"src/structures"}},{"name":"channels","description":"The list of channels in the guild.","type":[[["Collection","<"],["Snowflake",", "],["WidgetChannel",">"]]],"meta":{"line":52,"file":"Widget.js","path":"src/structures"}},{"name":"members","description":"The list of members in the guild.\nThese strings are just arbitrary numbers, they aren't Snowflakes.","type":[[["Collection","<"],["string",", "],["WidgetMember",">"]]],"meta":{"line":62,"file":"Widget.js","path":"src/structures"}},{"name":"presenceCount","description":"The number of members online.","type":[[["number"]]],"meta":{"line":72,"file":"Widget.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"methods":[{"name":"fetch","description":"Update the Widget.","async":true,"returns":[[["Promise","<"],["Widget",">"]]],"meta":{"line":80,"file":"Widget.js","path":"src/structures"}}],"meta":{"line":11,"file":"Widget.js","path":"src/structures"}},{"name":"WidgetMember","description":"Represents a WidgetMember.","extends":[[["Base"]]],"props":[{"name":"id","description":"The id of the user. It's an arbitrary number.","type":[[["string"]]],"meta":{"line":23,"file":"WidgetMember.js","path":"src/structures"}},{"name":"username","description":"The username of the member.","type":[[["string"]]],"meta":{"line":29,"file":"WidgetMember.js","path":"src/structures"}},{"name":"discriminator","description":"The discriminator of the member.","type":[[["string"]]],"meta":{"line":35,"file":"WidgetMember.js","path":"src/structures"}},{"name":"avatar","description":"The avatar of the member.","nullable":true,"type":[[["string"]]],"meta":{"line":41,"file":"WidgetMember.js","path":"src/structures"}},{"name":"status","description":"The status of the member.","type":[[["PresenceStatus"]]],"meta":{"line":47,"file":"WidgetMember.js","path":"src/structures"}},{"name":"deaf","description":"If the member is server deafened","nullable":true,"type":[[["boolean"]]],"meta":{"line":53,"file":"WidgetMember.js","path":"src/structures"}},{"name":"mute","description":"If the member is server muted","nullable":true,"type":[[["boolean"]]],"meta":{"line":59,"file":"WidgetMember.js","path":"src/structures"}},{"name":"selfDeaf","description":"If the member is self deafened","nullable":true,"type":[[["boolean"]]],"meta":{"line":65,"file":"WidgetMember.js","path":"src/structures"}},{"name":"selfMute","description":"If the member is self muted","nullable":true,"type":[[["boolean"]]],"meta":{"line":71,"file":"WidgetMember.js","path":"src/structures"}},{"name":"suppress","description":"If the member is suppressed","nullable":true,"type":[[["boolean"]]],"meta":{"line":77,"file":"WidgetMember.js","path":"src/structures"}},{"name":"channelId","description":"The id of the voice channel the member is in, if any","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":83,"file":"WidgetMember.js","path":"src/structures"}},{"name":"avatarURL","description":"The avatar URL of the member.","type":[[["string"]]],"meta":{"line":89,"file":"WidgetMember.js","path":"src/structures"}},{"name":"activity","description":"The activity of the member.","nullable":true,"type":[[["WidgetActivity"]]],"meta":{"line":95,"file":"WidgetMember.js","path":"src/structures"}},{"name":"client","description":"The client that instantiated this","readonly":true,"type":[[["Client"]]],"meta":{"line":11,"file":"Base.js","path":"src/structures"}}],"meta":{"line":9,"file":"WidgetMember.js","path":"src/structures"}},{"name":"ActivityFlags","description":"Data structure that makes it easy to interact with an {@link Activity#flags} bitfield.","extends":[[["BitField"]]],"construct":{"name":"ActivityFlags","params":[{"name":"bits","description":"Bit(s) to read from","optional":true,"default":0,"type":[[["BitFieldResolvable"]]]}]},"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["number"]],[["bigint"]]],"meta":{"line":17,"file":"BitField.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric activity flags. All available properties:\n* `INSTANCE`\n* `JOIN`\n* `SPECTATE`\n* `JOIN_REQUEST`\n* `SYNC`\n* `PLAY`\n* `PARTY_PRIVACY_FRIENDS`\n* `PARTY_PRIVACY_VOICE_CHANNEL`\n* `EMBEDDED`","see":["{@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags}"],"scope":"static","type":[[["Object"]]],"meta":{"line":32,"file":"ActivityFlags.js","path":"src/util"}}],"methods":[{"name":"any","description":"Checks whether the bitfield has a bit, or any of multiple bits.","inherits":"BitField#any","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":25,"file":"BitField.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","inherits":"BitField#equals","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a bit, or multiple bits.","inherits":"BitField#has","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"BitField.js","path":"src/util"}},{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","inherits":"BitField#missing","inherited":true,"params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":54,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","inherits":"BitField#freeze","inherited":true,"returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","inherits":"BitField#add","inherited":true,"params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","inherits":"BitField#remove","inherited":true,"params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","inherits":"BitField#serialize","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the bits available.","inherits":"BitField#toArray","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":113,"file":"BitField.js","path":"src/util"}}],"meta":{"line":9,"file":"ActivityFlags.js","path":"src/util"}},{"name":"ApplicationFlags","description":"Data structure that makes it easy to interact with a {@link Application#flags} bitfield.","extends":[[["BitField"]]],"construct":{"name":"ApplicationFlags","params":[{"name":"bits","description":"Bit(s) to read from","optional":true,"default":0,"type":[[["BitFieldResolvable"]]]}]},"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["number"]]],"meta":{"line":18,"file":"ApplicationFlags.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric application flags. All available properties:\n* `EMBEDDED_RELEASED`\n* `MANAGED_EMOJI`\n* `GROUP_DM_CREATE`\n* `RPC_PRIVATE_BETA`\n* `APPLICATION_AUTO_MODERATION_RULE_CREATE_BADGE`\n* `ALLOW_ASSETS`\n* `ALLOW_ACTIVITY_ACTION_SPECTATE`\n* `ALLOW_ACTIVITY_ACTION_JOIN_REQUEST`\n* `RPC_HAS_CONNECTED`\n* `GATEWAY_PRESENCE`\n* `GATEWAY_PRESENCE_LIMITED`\n* `GATEWAY_GUILD_MEMBERS`\n* `GATEWAY_GUILD_MEMBERS_LIMITED`\n* `VERIFICATION_PENDING_GUILD_LIMIT`\n* `EMBEDDED`\n* `GATEWAY_MESSAGE_CONTENT`\n* `GATEWAY_MESSAGE_CONTENT_LIMITED`\n* `EMBEDDED_FIRST_PARTY`\n* `APPLICATION_COMMAND_BADGE`\n* `ACTIVE`\n* `IFRAME_MODAL`","see":["{@link https://discord.com/developers/docs/resources/application#application-object-application-flags}","{@link https://flags.lewistehminerz.dev/}"],"scope":"static","type":[[["Object"]]],"meta":{"line":51,"file":"ApplicationFlags.js","path":"src/util"}}],"methods":[{"name":"any","description":"Checks whether the bitfield has a bit, or any of multiple bits.","inherits":"BitField#any","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":25,"file":"BitField.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","inherits":"BitField#equals","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a bit, or multiple bits.","inherits":"BitField#has","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"BitField.js","path":"src/util"}},{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","inherits":"BitField#missing","inherited":true,"params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":54,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","inherits":"BitField#freeze","inherited":true,"returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","inherits":"BitField#add","inherited":true,"params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","inherits":"BitField#remove","inherited":true,"params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","inherits":"BitField#serialize","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the bits available.","inherits":"BitField#toArray","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":113,"file":"BitField.js","path":"src/util"}}],"meta":{"line":9,"file":"ApplicationFlags.js","path":"src/util"}},{"name":"AttachmentFlags","description":"Data structure that makes it easy to interact with an {@link GuildMember#flags} bitfield.","extends":[[["BitField"]]],"construct":{"name":"AttachmentFlags","params":[{"name":"bits","description":"Bit(s) to read from","optional":true,"default":0,"type":[[["BitFieldResolvable"]]]}]},"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["number"]],[["bigint"]]],"meta":{"line":17,"file":"BitField.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric guild member flags. All available properties:\n* `IS_REMIX`","see":["{@link https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure-attachment-flags}"],"scope":"static","type":[[["Object"]]],"meta":{"line":25,"file":"AttachmentFlags.js","path":"src/util"}}],"methods":[{"name":"any","description":"Checks whether the bitfield has a bit, or any of multiple bits.","inherits":"BitField#any","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":25,"file":"BitField.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","inherits":"BitField#equals","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a bit, or multiple bits.","inherits":"BitField#has","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"BitField.js","path":"src/util"}},{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","inherits":"BitField#missing","inherited":true,"params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":54,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","inherits":"BitField#freeze","inherited":true,"returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","inherits":"BitField#add","inherited":true,"params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","inherits":"BitField#remove","inherited":true,"params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","inherits":"BitField#serialize","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the bits available.","inherits":"BitField#toArray","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":113,"file":"BitField.js","path":"src/util"}}],"meta":{"line":9,"file":"AttachmentFlags.js","path":"src/util"}},{"name":"BitField","description":"Data structure that makes it easy to interact with a bitfield.","construct":{"name":"BitField","params":[{"name":"bits","description":"Bit(s) to read from","optional":true,"default":"this.constructor.defaultBit","type":[[["BitFieldResolvable"]]]}]},"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["number"]],[["bigint"]]],"meta":{"line":17,"file":"BitField.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric bitfield flags.\nDefined in extension classes","scope":"static","abstract":true,"type":[[["Object"]]],"meta":{"line":162,"file":"BitField.js","path":"src/util"}},{"name":"defaultBit","scope":"static","access":"private","type":[[["number"]],[["bigint"]]],"meta":{"line":168,"file":"BitField.js","path":"src/util"}}],"methods":[{"name":"any","description":"Checks whether the bitfield has a bit, or any of multiple bits.","params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":25,"file":"BitField.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a bit, or multiple bits.","params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"BitField.js","path":"src/util"}},{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":54,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the bits available.","params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":113,"file":"BitField.js","path":"src/util"}},{"name":"resolve","description":"Resolves bitfields to their numeric form.","scope":"static","params":[{"name":"bit","description":"bit(s) to resolve","optional":true,"type":[[["BitFieldResolvable"]]]}],"returns":[[["number"]],[["bigint"]]],"meta":{"line":143,"file":"BitField.js","path":"src/util"}}],"meta":{"line":8,"file":"BitField.js","path":"src/util"}},{"name":"ChannelFlags","description":"Data structure that makes it easy to interact with a {@link Channel#flags} bitfield.","extends":[[["BitField"]]],"construct":{"name":"ChannelFlags","params":[{"name":"bits","description":"Bit(s) to read from","optional":true,"default":0,"type":[[["BitFieldResolvable"]]]}]},"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["number"]]],"meta":{"line":30,"file":"ChannelFlags.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric guild channel flags. All available properties:\n* `PINNED`\n* `REQUIRE_TAG`","see":["{@link https://discord.com/developers/docs/resources/channel#channel-object-channel-flags}"],"scope":"static","type":[[["Object"]]],"meta":{"line":18,"file":"ChannelFlags.js","path":"src/util"}}],"methods":[{"name":"any","description":"Checks whether the bitfield has a bit, or any of multiple bits.","inherits":"BitField#any","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":25,"file":"BitField.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","inherits":"BitField#equals","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a bit, or multiple bits.","inherits":"BitField#has","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"BitField.js","path":"src/util"}},{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","inherits":"BitField#missing","inherited":true,"params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":54,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","inherits":"BitField#freeze","inherited":true,"returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","inherits":"BitField#add","inherited":true,"params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","inherits":"BitField#remove","inherited":true,"params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","inherits":"BitField#serialize","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the bits available.","inherits":"BitField#toArray","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":113,"file":"BitField.js","path":"src/util"}}],"meta":{"line":9,"file":"ChannelFlags.js","path":"src/util"}},{"name":"DataResolver","description":"The DataResolver identifies different objects and tries to resolve a specific piece of information from them.","access":"private","methods":[{"name":"resolveCode","description":"Resolves the string to a code based on the passed regex.","scope":"static","params":[{"name":"data","description":"The string to resolve","type":[[["string"]]]},{"name":"regex","description":"The RegExp used to extract the code","type":[[["RegExp"]]]}],"returns":[[["string"]]],"meta":{"line":36,"file":"DataResolver.js","path":"src/util"}},{"name":"resolveInviteCode","description":"Resolves InviteResolvable to an invite code.","scope":"static","params":[{"name":"data","description":"The invite resolvable to resolve","type":[[["InviteResolvable"]]]}],"returns":[[["string"]]],"meta":{"line":45,"file":"DataResolver.js","path":"src/util"}},{"name":"resolveGuildTemplateCode","description":"Resolves GuildTemplateResolvable to a template code.","scope":"static","params":[{"name":"data","description":"The template resolvable to resolve","type":[[["GuildTemplateResolvable"]]]}],"returns":[[["string"]]],"meta":{"line":54,"file":"DataResolver.js","path":"src/util"}},{"name":"resolveImage","description":"Resolves a Base64Resolvable, a string, or a BufferResolvable to a Base 64 image.","scope":"static","params":[{"name":"image","description":"The image to be resolved","type":[[["BufferResolvable"]],[["Base64Resolvable"]]]}],"async":true,"returns":[[["Promise",""]]],"meta":{"line":64,"file":"DataResolver.js","path":"src/util"}},{"name":"resolveBase64","description":"Resolves a Base64Resolvable to a Base 64 image.","scope":"static","params":[{"name":"data","description":"The base 64 resolvable you want to resolve","type":[[["Base64Resolvable"]]]}],"returns":{"types":[[["string"]]],"nullable":true},"meta":{"line":85,"file":"DataResolver.js","path":"src/util"}},{"name":"resolveFile","description":"Resolves a BufferResolvable to a Buffer or a Stream.","scope":"static","params":[{"name":"resource","description":"The buffer or stream resolvable to resolve","type":[[["BufferResolvable"]],[["Stream"]]]}],"async":true,"returns":[[["Promise","<("],["Buffer","|"],["Stream",")>"]]],"meta":{"line":109,"file":"DataResolver.js","path":"src/util"}},{"name":"resolveFileAsBuffer","description":"Resolves a BufferResolvable to a Buffer.","scope":"static","params":[{"name":"resource","description":"The buffer or stream resolvable to resolve","type":[[["BufferResolvable"]],[["Stream"]]]}],"async":true,"returns":[[["Promise","<"],["Buffer",">"]]],"meta":{"line":136,"file":"DataResolver.js","path":"src/util"}}],"meta":{"line":15,"file":"DataResolver.js","path":"src/util"}},{"name":"Formatters","description":"Contains various Discord-specific functions for formatting messages.","props":[{"name":"TimestampStyles","description":"The message formatting timestamp\n[styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord.","scope":"static","type":[[["Object","<"],["string",", "],["TimestampStylesString",">"]]],"meta":{"line":208,"file":"Formatters.js","path":"src/util"}}],"methods":[{"name":"blockQuote","description":"Formats the content into a block quote. This needs to be at the start of the line for Discord to format it.","scope":"static","params":[{"name":"content","description":"The content to wrap.","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":28,"file":"Formatters.js","path":"src/util"}},{"name":"bold","description":"Formats the content into bold text.","scope":"static","params":[{"name":"content","description":"The content to wrap.","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":37,"file":"Formatters.js","path":"src/util"}},{"name":"channelMention","description":"Formats a channel id into a channel mention.","scope":"static","params":[{"name":"channelId","description":"The channel id to format.","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":46,"file":"Formatters.js","path":"src/util"}},{"name":"chatInputApplicationCommandMention","description":"Formats an application command name, subcommand group name, subcommand name, and ID\ninto an application command mention","scope":"static","params":[{"name":"commandName","description":"The name of the application command","type":[[["string"]]]},{"name":"subcommandGroupOrSubOrId","description":"The subcommand group name, subcommand name, or application command id","type":[[["string"]],[["Snowflake"]]]},{"name":"subcommandNameOrId","description":"The subcommand name or application command id","optional":true,"nullable":true,"type":[[["string"]],[["Snowflake"]]]},{"name":"commandId","description":"The id of the application command","optional":true,"nullable":true,"type":[[["Snowflake"]]]}],"returns":[[["string"]]],"meta":{"line":55,"file":"Formatters.js","path":"src/util"}},{"name":"codeBlock","description":"Wraps the content inside a code block with an optional language.","scope":"static","params":[{"name":"contentOrLanguage","description":"The language to use, content if a second parameter isn't provided.","type":[[["string"]]]},{"name":"content","description":"The content to wrap.","optional":true,"type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":85,"file":"Formatters.js","path":"src/util"}},{"name":"formatEmoji","description":"Formats an emoji id into a fully qualified emoji identifier","scope":"static","params":[{"name":"emojiId","description":"The emoji id to format.","type":[[["string"]]]},{"name":"animated","description":"Whether the emoji is animated or not. Defaults to `false`","optional":true,"type":[[["boolean"]]]}],"returns":[[["string"]]],"meta":{"line":95,"file":"Formatters.js","path":"src/util"}},{"name":"hideLinkEmbed","description":"Wraps the URL into `<>`, which stops it from embedding.","scope":"static","params":[{"name":"content","description":"The content to wrap.","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":105,"file":"Formatters.js","path":"src/util"}},{"name":"hyperlink","description":"Formats the content and the URL into a masked URL with an optional title.","scope":"static","params":[{"name":"content","description":"The content to display.","type":[[["string"]]]},{"name":"url","description":"The URL the content links to.","type":[[["string"]]]},{"name":"title","description":"The title shown when hovering on the masked link.","optional":true,"type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":114,"file":"Formatters.js","path":"src/util"}},{"name":"inlineCode","description":"Wraps the content inside \\`backticks\\`, which formats it as inline code.","scope":"static","params":[{"name":"content","description":"The content to wrap.","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":125,"file":"Formatters.js","path":"src/util"}},{"name":"italic","description":"Formats the content into italic text.","scope":"static","params":[{"name":"content","description":"The content to wrap.","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":134,"file":"Formatters.js","path":"src/util"}},{"name":"quote","description":"Formats the content into a quote. This needs to be at the start of the line for Discord to format it.","scope":"static","params":[{"name":"content","description":"The content to wrap.","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":143,"file":"Formatters.js","path":"src/util"}},{"name":"roleMention","description":"Formats a role id into a role mention.","scope":"static","params":[{"name":"roleId","description":"The role id to format.","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":152,"file":"Formatters.js","path":"src/util"}},{"name":"spoiler","description":"Formats the content into spoiler text.","scope":"static","params":[{"name":"content","description":"The content to spoiler.","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":161,"file":"Formatters.js","path":"src/util"}},{"name":"strikethrough","description":"Formats the content into strike-through text.","scope":"static","params":[{"name":"content","description":"The content to wrap.","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":170,"file":"Formatters.js","path":"src/util"}},{"name":"time","description":"Formats a date into a short date-time string.","scope":"static","params":[{"name":"date","description":"The date to format.","optional":true,"type":[[["number"]],[["Date"]]]},{"name":"style","description":"The style to use.","optional":true,"type":[[["TimestampStylesString"]]]}],"returns":[[["string"]]],"meta":{"line":179,"file":"Formatters.js","path":"src/util"}},{"name":"underscore","description":"Formats the content into underscored text.","scope":"static","params":[{"name":"content","description":"The content to wrap.","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":210,"file":"Formatters.js","path":"src/util"}},{"name":"userMention","description":"Formats a user id into a user mention.","scope":"static","params":[{"name":"userId","description":"The user id to format.","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":219,"file":"Formatters.js","path":"src/util"}}],"meta":{"line":26,"file":"Formatters.js","path":"src/util"}},{"name":"GuildMemberFlags","description":"Data structure that makes it easy to interact with an {@link GuildMember#flags} bitfield.","extends":[[["BitField"]]],"construct":{"name":"GuildMemberFlags","params":[{"name":"bits","description":"Bit(s) to read from","optional":true,"default":0,"type":[[["BitFieldResolvable"]]]}]},"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["number"]],[["bigint"]]],"meta":{"line":17,"file":"BitField.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric guild member flags. All available properties:\n* `DID_REJOIN`\n* `COMPLETED_ONBOARDING`\n* `BYPASSES_VERIFICATION`\n* `STARTED_ONBOARDING`","see":["{@link https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-flags}"],"scope":"static","type":[[["Object"]]],"meta":{"line":27,"file":"GuildMemberFlags.js","path":"src/util"}}],"methods":[{"name":"any","description":"Checks whether the bitfield has a bit, or any of multiple bits.","inherits":"BitField#any","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":25,"file":"BitField.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","inherits":"BitField#equals","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a bit, or multiple bits.","inherits":"BitField#has","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"BitField.js","path":"src/util"}},{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","inherits":"BitField#missing","inherited":true,"params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":54,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","inherits":"BitField#freeze","inherited":true,"returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","inherits":"BitField#add","inherited":true,"params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","inherits":"BitField#remove","inherited":true,"params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","inherits":"BitField#serialize","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the bits available.","inherits":"BitField#toArray","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":113,"file":"BitField.js","path":"src/util"}}],"meta":{"line":9,"file":"GuildMemberFlags.js","path":"src/util"}},{"name":"Intents","description":"Data structure that makes it easy to calculate intents.","extends":[[["BitField"]]],"construct":{"name":"Intents","params":[{"name":"bits","description":"Bit(s) to read from","optional":true,"default":0,"type":[[["IntentsResolvable"]]]}]},"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["number"]],[["bigint"]]],"meta":{"line":17,"file":"BitField.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric WebSocket intents. All available properties:\n* `GUILDS`\n* `GUILD_MEMBERS`\n* `GUILD_BANS`\n* `GUILD_EMOJIS_AND_STICKERS`\n* `GUILD_INTEGRATIONS`\n* `GUILD_WEBHOOKS`\n* `GUILD_INVITES`\n* `GUILD_VOICE_STATES`\n* `GUILD_PRESENCES`\n* `GUILD_MESSAGES`\n* `GUILD_MESSAGE_REACTIONS`\n* `GUILD_MESSAGE_TYPING`\n* `DIRECT_MESSAGES`\n* `DIRECT_MESSAGE_REACTIONS`\n* `DIRECT_MESSAGE_TYPING`\n* `MESSAGE_CONTENT`\n* `GUILD_SCHEDULED_EVENTS`\n* `AUTO_MODERATION_CONFIGURATION`\n* `AUTO_MODERATION_EXECUTION`","see":["{@link https://discord.com/developers/docs/topics/gateway#list-of-intents}"],"scope":"static","type":[[["Object"]]],"meta":{"line":50,"file":"Intents.js","path":"src/util"}}],"methods":[{"name":"any","description":"Checks whether the bitfield has a bit, or any of multiple bits.","inherits":"BitField#any","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":25,"file":"BitField.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","inherits":"BitField#equals","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a bit, or multiple bits.","inherits":"BitField#has","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"BitField.js","path":"src/util"}},{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","inherits":"BitField#missing","inherited":true,"params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":54,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","inherits":"BitField#freeze","inherited":true,"returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","inherits":"BitField#add","inherited":true,"params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","inherits":"BitField#remove","inherited":true,"params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","inherits":"BitField#serialize","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the bits available.","inherits":"BitField#toArray","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":113,"file":"BitField.js","path":"src/util"}}],"meta":{"line":8,"file":"Intents.js","path":"src/util"}},{"name":"InviteFlags","description":"Data structure that makes it easy to interact with an {@link InviteFlags#flags} bitfield.","extends":[[["BitField"]]],"construct":{"name":"InviteFlags","params":[{"name":"bits","description":"Bit(s) to read from","optional":true,"default":0,"type":[[["BitFieldResolvable"]]]}]},"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["number"]],[["bigint"]]],"meta":{"line":17,"file":"BitField.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric the Discord invite flags. All available properties:\n* `IS_GUEST_INVITE`\n* `IS_VIEWED`\n* `IS_ENHANCED`\n* `IS_APPLICATION_BYPASS`","see":["{@link https://docs.discord.food/resources/invite#invite-flags}"],"scope":"static","type":[[["Object"]]],"meta":{"line":27,"file":"InviteFlags.js","path":"src/util"}}],"methods":[{"name":"any","description":"Checks whether the bitfield has a bit, or any of multiple bits.","inherits":"BitField#any","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":25,"file":"BitField.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","inherits":"BitField#equals","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a bit, or multiple bits.","inherits":"BitField#has","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"BitField.js","path":"src/util"}},{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","inherits":"BitField#missing","inherited":true,"params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":54,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","inherits":"BitField#freeze","inherited":true,"returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","inherits":"BitField#add","inherited":true,"params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","inherits":"BitField#remove","inherited":true,"params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","inherits":"BitField#serialize","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the bits available.","inherits":"BitField#toArray","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":113,"file":"BitField.js","path":"src/util"}}],"meta":{"line":9,"file":"InviteFlags.js","path":"src/util"}},{"name":"LimitedCollection","description":"A Collection which holds a max amount of entries and sweeps periodically.","extends":[[["Collection"]]],"construct":{"name":"LimitedCollection","params":[{"name":"options","description":"Options for constructing the Collection.","optional":true,"default":"{}","type":[[["LimitedCollectionOptions"]]]},{"name":"iterable","description":"Optional entries passed to the Map constructor.","optional":true,"default":null,"type":[[["Iterable"]]]}]},"props":[{"name":"maxSize","description":"The max size of the Collection.","type":[[["number"]]],"meta":{"line":63,"file":"LimitedCollection.js","path":"src/util"}},{"name":"keepOverLimit","description":"A function called to check if an entry should be kept when the Collection is at max size.","nullable":true,"type":[[["function"]]],"meta":{"line":69,"file":"LimitedCollection.js","path":"src/util"}},{"name":"sweepFilter","description":"A function called every sweep interval that returns a function passed to `sweep`.","nullable":true,"deprecated":"in favor of {@link Client#sweepers}","type":[[["SweepFilter"]]],"meta":{"line":76,"file":"LimitedCollection.js","path":"src/util"}},{"name":"interval","description":"The id of the interval being used to sweep.","nullable":true,"deprecated":"in favor of {@link Client#sweepers}","type":[[["Timeout"]]],"meta":{"line":83,"file":"LimitedCollection.js","path":"src/util"}}],"methods":[{"name":"filterByLifetime","description":"Create a sweepFilter function that uses a lifetime to determine sweepability.","scope":"static","deprecated":"Use {@link Sweepers.filterByLifetime} instead","params":[{"name":"options","description":"The options used to generate the filter function","optional":true,"default":"{}","type":[[["LifetimeFilterOptions"]]]}],"returns":[[["SweepFilter"]]],"meta":{"line":114,"file":"LimitedCollection.js","path":"src/util"}}],"meta":{"line":37,"file":"LimitedCollection.js","path":"src/util"}},{"name":"MessageFlags","description":"Data structure that makes it easy to interact with a {@link Message#flags} bitfield.","extends":[[["BitField"]]],"construct":{"name":"MessageFlags","params":[{"name":"bits","description":"Bit(s) to read from","optional":true,"default":0,"type":[[["BitFieldResolvable"]]]}]},"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["number"]]],"meta":{"line":18,"file":"MessageFlags.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric message flags. All available properties:\n* `CROSSPOSTED`\n* `IS_CROSSPOST`\n* `SUPPRESS_EMBEDS`\n* `SOURCE_MESSAGE_DELETED`\n* `URGENT`\n* `HAS_THREAD`\n* `EPHEMERAL`\n* `LOADING`\n* `FAILED_TO_MENTION_SOME_ROLES_IN_THREAD`\n* `GUILD_FEED_HIDDEN`\n* `SHOULD_SHOW_LINK_NOT_DISCORD_WARNING`\n* `SUPPRESS_NOTIFICATIONS`\n* `IS_VOICE_MESSAGE`\n* `HAS_SNAPSHOT`\n* `IS_COMPONENTS_V2`","see":["{@link https://discord.com/developers/docs/resources/channel#message-object-message-flags}","{@link https://docs.discord.food/resources/message#message-flags}"],"scope":"static","type":[[["Object"]]],"meta":{"line":45,"file":"MessageFlags.js","path":"src/util"}}],"methods":[{"name":"any","description":"Checks whether the bitfield has a bit, or any of multiple bits.","inherits":"BitField#any","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":25,"file":"BitField.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","inherits":"BitField#equals","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a bit, or multiple bits.","inherits":"BitField#has","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"BitField.js","path":"src/util"}},{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","inherits":"BitField#missing","inherited":true,"params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":54,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","inherits":"BitField#freeze","inherited":true,"returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","inherits":"BitField#add","inherited":true,"params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","inherits":"BitField#remove","inherited":true,"params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","inherits":"BitField#serialize","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the bits available.","inherits":"BitField#toArray","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":113,"file":"BitField.js","path":"src/util"}}],"meta":{"line":9,"file":"MessageFlags.js","path":"src/util"}},{"name":"Options","description":"Contains various utilities for client options.","props":[{"name":"defaultMakeCacheSettings","description":"The default settings passed to {@link ClientOptions.makeCache}.\nThe caches that this changes are:\n* `MessageManager` - Limit to 200 messages\n* `ChannelManager` - Sweep archived threads\n* `GuildChannelManager` - Sweep archived threads\n* `ThreadManager` - Sweep archived threads\nIf you want to keep default behavior and add on top of it you can use this object and add on to it, e.g.\n`makeCache: Options.cacheWithLimits({ ...Options.defaultMakeCacheSettings, ReactionManager: 0 })`","scope":"static","type":[[["Object","<"],["string",", ("],["LimitedCollectionOptions","|"],["number",")>"]]],"meta":{"line":324,"file":"Options.js","path":"src/util"}},{"name":"defaultSweeperSettings","description":"The default settings passed to {@link ClientOptions.sweepers}.\nThe sweepers that this changes are:\n* `threads` - Sweep archived threads every hour, removing those archived more than 4 hours ago\nIf you want to keep default behavior and add on top of it you can use this object and add on to it, e.g.\n`sweepers: { ...Options.defaultSweeperSettings, messages: { interval: 300, lifetime: 600 } }`","scope":"static","type":[[["SweeperOptions"]]],"meta":{"line":351,"file":"Options.js","path":"src/util"}}],"methods":[{"name":"createDefault","description":"The default client options.","scope":"static","returns":[[["ClientOptions"]]],"meta":{"line":163,"file":"Options.js","path":"src/util"}},{"name":"cacheWithLimits","description":"Create a cache factory using predefined settings to sweep or limit.","scope":"static","examples":["// Store up to 200 messages per channel and discard archived threads if they were archived more than 4 hours ago.\n// Note archived threads will remain in the guild and client caches with these settings\nOptions.cacheWithLimits({\n MessageManager: 200,\n ThreadManager: {\n sweepInterval: 3600,\n sweepFilter: LimitedCollection.filterByLifetime({\n getComparisonTimestamp: e => e.archiveTimestamp,\n excludeFromSweep: e => !e.archived,\n }),\n },\n });","// Sweep messages every 5 minutes, removing messages that have not been edited or created in the last 30 minutes\nOptions.cacheWithLimits({\n // Keep default thread sweeping behavior\n ...Options.defaultMakeCacheSettings,\n // Override MessageManager\n MessageManager: {\n sweepInterval: 300,\n sweepFilter: LimitedCollection.filterByLifetime({\n lifetime: 1800,\n getComparisonTimestamp: e => e.editedTimestamp ?? e.createdTimestamp,\n })\n }\n});"],"params":[{"name":"settings","description":"Settings passed to the relevant constructor.\nIf no setting is provided for a manager, it uses Collection.\nIf a number is provided for a manager, it uses that number as the max size for a LimitedCollection.\nIf LimitedCollectionOptions are provided for a manager, it uses those settings to form a LimitedCollection.","optional":true,"default":"{}","type":[[["Object","<"],["string",", ("],["LimitedCollectionOptions","|"],["number",")>"]]]}],"returns":[[["CacheFactory"]]],"meta":{"line":273,"file":"Options.js","path":"src/util"}},{"name":"cacheEverything","description":"Create a cache factory that always caches everything.","scope":"static","returns":[[["CacheFactory"]]],"meta":{"line":308,"file":"Options.js","path":"src/util"}}],"meta":{"line":158,"file":"Options.js","path":"src/util"}},{"name":"Permissions","description":"Data structure that makes it easy to interact with a permission bitfield. All {@link GuildMember}s have a set of\npermissions in their guild, and each channel in the guild may also have {@link PermissionOverwrites} for the member\nthat override their default permissions.","extends":[[["BitField"]]],"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["bigint"]]],"meta":{"line":12,"file":"Permissions.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric permission flags. All available properties:\n* `CREATE_INSTANT_INVITE` (create invitations to the guild)\n* `KICK_MEMBERS`\n* `BAN_MEMBERS`\n* `ADMINISTRATOR` (implicitly has *all* permissions, and bypasses all channel overwrites)\n* `MANAGE_CHANNELS` (edit and reorder channels)\n* `MANAGE_GUILD` (edit the guild information, region, etc.)\n* `ADD_REACTIONS` (add new reactions to messages)\n* `VIEW_AUDIT_LOG`\n* `PRIORITY_SPEAKER`\n* `STREAM`\n* `VIEW_CHANNEL`\n* `SEND_MESSAGES`\n* `SEND_TTS_MESSAGES`\n* `MANAGE_MESSAGES` (delete messages and reactions)\n* `EMBED_LINKS` (links posted will have a preview embedded)\n* `ATTACH_FILES`\n* `READ_MESSAGE_HISTORY` (view messages that were posted prior to opening Discord)\n* `MENTION_EVERYONE`\n* `USE_EXTERNAL_EMOJIS` (use emojis from different guilds)\n* `VIEW_GUILD_INSIGHTS`\n* `CONNECT` (connect to a voice channel)\n* `SPEAK` (speak in a voice channel)\n* `MUTE_MEMBERS` (mute members across all voice channels)\n* `DEAFEN_MEMBERS` (deafen members across all voice channels)\n* `MOVE_MEMBERS` (move members between voice channels)\n* `USE_VAD` (use voice activity detection)\n* `CHANGE_NICKNAME`\n* `MANAGE_NICKNAMES` (change other members' nicknames)\n* `MANAGE_ROLES`\n* `MANAGE_WEBHOOKS`\n* `MANAGE_EMOJIS_AND_STICKERS`\n* `USE_APPLICATION_COMMANDS`\n* `REQUEST_TO_SPEAK`\n* `MANAGE_EVENTS`\n* `MANAGE_THREADS`\n* `USE_PUBLIC_THREADS` (deprecated)\n* `CREATE_PUBLIC_THREADS`\n* `USE_PRIVATE_THREADS` (deprecated)\n* `CREATE_PRIVATE_THREADS`\n* `USE_EXTERNAL_STICKERS` (use stickers from different guilds)\n* `SEND_MESSAGES_IN_THREADS`\n* `START_EMBEDDED_ACTIVITIES`\n* `MODERATE_MEMBERS`\n* `VIEW_CREATOR_MONETIZATION_ANALYTICS`\n* `USE_SOUNDBOARD`\n* `CREATE_GUILD_EXPRESSIONS`\n* `CREATE_EVENTS`\n* `USE_EXTERNAL_SOUNDS`\n* `SEND_VOICE_MESSAGES`\n* `USE_CLYDE_AI`\n* `SET_VOICE_CHANNEL_STATUS`\n* `SEND_POLLS`\n* `USE_EXTERNAL_APPS`","see":["{@link https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags}"],"scope":"static","type":[[["Object","<"],["string",", "],["bigint",">"]]],"meta":{"line":124,"file":"Permissions.js","path":"src/util"}},{"name":"ALL","description":"Bitfield representing every permission combined","scope":"static","type":[[["bigint"]]],"meta":{"line":185,"file":"Permissions.js","path":"src/util"}},{"name":"DEFAULT","description":"Bitfield representing the default permissions for users","scope":"static","type":[[["bigint"]]],"meta":{"line":191,"file":"Permissions.js","path":"src/util"}},{"name":"STAGE_MODERATOR","description":"Bitfield representing the permissions required for moderators of stage channels","scope":"static","type":[[["bigint"]]],"meta":{"line":197,"file":"Permissions.js","path":"src/util"}}],"methods":[{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"checkAdmin","description":"Whether to allow the administrator permission to override","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":33,"file":"Permissions.js","path":"src/util"}},{"name":"any","description":"Checks whether the bitfield has a permission, or any of multiple permissions.","params":[{"name":"permission","description":"Permission(s) to check for","type":[[["PermissionResolvable"]]]},{"name":"checkAdmin","description":"Whether to allow the administrator permission to override","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"Permissions.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a permission, or multiple permissions.","params":[{"name":"permission","description":"Permission(s) to check for","type":[[["PermissionResolvable"]]]},{"name":"checkAdmin","description":"Whether to allow the administrator permission to override","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["boolean"]]],"meta":{"line":53,"file":"Permissions.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the permissions available.","returns":[[["Array","<"],["string",">"]]],"meta":{"line":61,"file":"Permissions.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","inherits":"BitField#equals","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","inherits":"BitField#freeze","inherited":true,"returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","inherits":"BitField#add","inherited":true,"params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","inherits":"BitField#remove","inherited":true,"params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","inherits":"BitField#serialize","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}}],"meta":{"line":11,"file":"Permissions.js","path":"src/util"}},{"name":"PremiumUsageFlags","description":"Data structure that makes it easy to interact with an {@link PremiumUsageFlags#flags} bitfield.","extends":[[["BitField"]]],"construct":{"name":"PremiumUsageFlags","params":[{"name":"bits","description":"Bit(s) to read from","optional":true,"default":0,"type":[[["BitFieldResolvable"]]]}]},"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["number"]],[["bigint"]]],"meta":{"line":17,"file":"BitField.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric the Discord premium usage flags. All available properties:\n* `PREMIUM_DISCRIMINATOR`\n* `ANIMATED_AVATAR`\n* `PROFILE_BANNER`","scope":"static","type":[[["Object"]]],"meta":{"line":25,"file":"PremiumUsageFlags.js","path":"src/util"}}],"methods":[{"name":"any","description":"Checks whether the bitfield has a bit, or any of multiple bits.","inherits":"BitField#any","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":25,"file":"BitField.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","inherits":"BitField#equals","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a bit, or multiple bits.","inherits":"BitField#has","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"BitField.js","path":"src/util"}},{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","inherits":"BitField#missing","inherited":true,"params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":54,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","inherits":"BitField#freeze","inherited":true,"returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","inherits":"BitField#add","inherited":true,"params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","inherits":"BitField#remove","inherited":true,"params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","inherits":"BitField#serialize","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the bits available.","inherits":"BitField#toArray","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":113,"file":"BitField.js","path":"src/util"}}],"meta":{"line":9,"file":"PremiumUsageFlags.js","path":"src/util"}},{"name":"PurchasedFlags","description":"Data structure that makes it easy to interact with an {@link PurchasedFlags#flags} bitfield.","extends":[[["BitField"]]],"construct":{"name":"PurchasedFlags","params":[{"name":"bits","description":"Bit(s) to read from","optional":true,"default":0,"type":[[["BitFieldResolvable"]]]}]},"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["number"]],[["bigint"]]],"meta":{"line":17,"file":"BitField.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric the Discord purchased flags. All available properties:\n* `NITRO_CLASSIC`\n* `NITRO`\n* `GUILD_BOOST`\n* `NITRO_BASIC`","scope":"static","type":[[["Object"]]],"meta":{"line":26,"file":"PurchasedFlags.js","path":"src/util"}}],"methods":[{"name":"any","description":"Checks whether the bitfield has a bit, or any of multiple bits.","inherits":"BitField#any","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":25,"file":"BitField.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","inherits":"BitField#equals","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a bit, or multiple bits.","inherits":"BitField#has","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"BitField.js","path":"src/util"}},{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","inherits":"BitField#missing","inherited":true,"params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":54,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","inherits":"BitField#freeze","inherited":true,"returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","inherits":"BitField#add","inherited":true,"params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","inherits":"BitField#remove","inherited":true,"params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","inherits":"BitField#serialize","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the bits available.","inherits":"BitField#toArray","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":113,"file":"BitField.js","path":"src/util"}}],"meta":{"line":9,"file":"PurchasedFlags.js","path":"src/util"}},{"name":"DiscordAuthWebsocket","description":"Discord Auth QR","extends":[[["EventEmitter"]]],"abstract":true,"construct":{"name":"DiscordAuthWebsocket","description":"Creates a new DiscordAuthWebsocket instance."},"props":[{"name":"AuthURL","type":[[["string"]]],"meta":{"line":71,"file":"RemoteAuth.js","path":"src/util"}},{"name":"exprire","type":[[["Date"]]],"meta":{"line":78,"file":"RemoteAuth.js","path":"src/util"}},{"name":"user","type":[[["UserRaw"]]],"meta":{"line":85,"file":"RemoteAuth.js","path":"src/util"}}],"methods":[{"name":"connect","description":"Connect WS","params":[{"name":"client","description":"DiscordJS Client","optional":true,"type":[[["Client"]]]}],"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":289,"file":"RemoteAuth.js","path":"src/util"}},{"name":"destroy","description":"Destroy client","returns":[[["void"]]],"meta":{"line":302,"file":"RemoteAuth.js","path":"src/util"}},{"name":"generateQR","description":"Generate QR code for user to scan (Terminal)","returns":[[["void"]]],"meta":{"line":317,"file":"RemoteAuth.js","path":"src/util"}}],"events":[{"name":"error","description":"WS Error","params":[{"name":"error","description":"Error","type":[[["Error"]]]}],"meta":{"line":101,"file":"RemoteAuth.js","path":"src/util"}},{"name":"debug","description":"Debug Event","params":[{"name":"msg","description":"Debug msg","type":[[["string"]]]}],"meta":{"line":109,"file":"RemoteAuth.js","path":"src/util"}},{"name":"ready","description":"Ready Event","params":[{"name":"client","description":"WS","type":[[["DiscordAuthWebsocket"]]]}],"meta":{"line":137,"file":"RemoteAuth.js","path":"src/util"}},{"name":"cancel","description":"Cancel","params":[{"name":"client","description":"WS","type":[[["DiscordAuthWebsocket"]]]}],"meta":{"line":158,"file":"RemoteAuth.js","path":"src/util"}},{"name":"pending","description":"Emitted whenever a user is scan QR Code.","params":[{"name":"user","description":"Discord User Raw","type":[[["UserRaw"]]]}],"meta":{"line":268,"file":"RemoteAuth.js","path":"src/util"}},{"name":"closed","description":"Emitted whenever a connection is closed.","meta":{"line":306,"file":"RemoteAuth.js","path":"src/util"}},{"name":"finish","description":"Emitted whenever a real token is found.","params":[{"name":"token","description":"Discord Token","type":[[["string"]]]}],"meta":{"line":356,"file":"RemoteAuth.js","path":"src/util"}}],"meta":{"line":50,"file":"RemoteAuth.js","path":"src/util"}},{"name":"RoleFlags","description":"Data structure that makes it easy to interact with an {@link GuildMember#flags} bitfield.","extends":[[["BitField"]]],"construct":{"name":"RoleFlags","params":[{"name":"bits","description":"Bit(s) to read from","optional":true,"default":0,"type":[[["BitFieldResolvable"]]]}]},"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["number"]],[["bigint"]]],"meta":{"line":17,"file":"BitField.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric guild member flags. All available properties:\n* `IN_PROMPT`","see":["{@link https://discord.com/developers/docs/topics/permissions#role-object-role-flags}"],"scope":"static","type":[[["Object"]]],"meta":{"line":24,"file":"RoleFlags.js","path":"src/util"}}],"methods":[{"name":"any","description":"Checks whether the bitfield has a bit, or any of multiple bits.","inherits":"BitField#any","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":25,"file":"BitField.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","inherits":"BitField#equals","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a bit, or multiple bits.","inherits":"BitField#has","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"BitField.js","path":"src/util"}},{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","inherits":"BitField#missing","inherited":true,"params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":54,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","inherits":"BitField#freeze","inherited":true,"returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","inherits":"BitField#add","inherited":true,"params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","inherits":"BitField#remove","inherited":true,"params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","inherits":"BitField#serialize","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the bits available.","inherits":"BitField#toArray","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":113,"file":"BitField.js","path":"src/util"}}],"meta":{"line":9,"file":"RoleFlags.js","path":"src/util"}},{"name":"SnowflakeUtil","description":"A container for useful snowflake-related methods.","props":[{"name":"EPOCH","description":"Discord's epoch value (2015-01-01T00:00:00.000Z).","scope":"static","readonly":true,"type":[[["number"]]],"meta":{"line":87,"file":"SnowflakeUtil.js","path":"src/util"}}],"methods":[{"name":"generate","description":"Generates a Discord snowflake.\nThis hardcodes the worker's id as 1 and the process's id as 0.","scope":"static","params":[{"name":"timestamp","description":"Timestamp or date of the snowflake to generate","optional":true,"default":"Date.now()","type":[[["number"]],[["Date"]]]}],"returns":{"types":[[["Snowflake"]]],"description":"The generated snowflake"},"meta":{"line":30,"file":"SnowflakeUtil.js","path":"src/util"}},{"name":"deconstruct","description":"Deconstructs a Discord snowflake.","scope":"static","params":[{"name":"snowflake","description":"Snowflake to deconstruct","type":[[["Snowflake"]]]}],"returns":[[["DeconstructedSnowflake"]]],"meta":{"line":59,"file":"SnowflakeUtil.js","path":"src/util"}},{"name":"timestampFrom","description":"Retrieves the timestamp field's value from a Discord snowflake.","scope":"static","params":[{"name":"snowflake","description":"Snowflake to get the timestamp value from","type":[[["Snowflake"]]]}],"returns":[[["number"]]],"meta":{"line":78,"file":"SnowflakeUtil.js","path":"src/util"}}],"meta":{"line":10,"file":"SnowflakeUtil.js","path":"src/util"}},{"name":"Speaking","description":"Data structure that makes it easy to interact with a {@link VoiceConnection#speaking}\nand {@link guildMemberSpeaking} event bitfields.","extends":[[["BitField"]]],"construct":{"name":"Speaking","params":[{"name":"bits","description":"Bit(s) to read from","optional":true,"default":0,"type":[[["BitFieldResolvable"]]]}]},"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["number"]],[["bigint"]]],"meta":{"line":17,"file":"BitField.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric speaking flags. All available properties:\n* `SPEAKING`\n* `SOUNDSHARE`\n* `PRIORITY_SPEAKING`","see":["{@link https://discord.com/developers/docs/topics/voice-connections#speaking}"],"scope":"static","type":[[["Object"]]],"meta":{"line":27,"file":"Speaking.js","path":"src/util"}}],"methods":[{"name":"any","description":"Checks whether the bitfield has a bit, or any of multiple bits.","inherits":"BitField#any","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":25,"file":"BitField.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","inherits":"BitField#equals","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a bit, or multiple bits.","inherits":"BitField#has","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"BitField.js","path":"src/util"}},{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","inherits":"BitField#missing","inherited":true,"params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":54,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","inherits":"BitField#freeze","inherited":true,"returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","inherits":"BitField#add","inherited":true,"params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","inherits":"BitField#remove","inherited":true,"params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","inherits":"BitField#serialize","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the bits available.","inherits":"BitField#toArray","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":113,"file":"BitField.js","path":"src/util"}}],"meta":{"line":10,"file":"Speaking.js","path":"src/util"}},{"name":"Sweepers","description":"A container for all cache sweeping intervals and their associated sweep methods.","props":[{"name":"options","description":"The options the sweepers were instantiated with","type":[[["SweeperOptions"]]],"meta":{"line":30,"file":"Sweepers.js","path":"src/util"}},{"name":"intervals","description":"A record of interval timeout that is used to sweep the indicated items, or null if not being swept","type":[[["Object","<"],["SweeperKey",", ?"],["Timeout",">"]]],"meta":{"line":36,"file":"Sweepers.js","path":"src/util"}}],"methods":[{"name":"sweepApplicationCommands","description":"Sweeps all guild and global application commands and removes the ones which are indicated by the filter.","params":[{"name":"filter","description":"The function used to determine which commands will be removed from the caches.","type":[[["function"]]]}],"returns":{"types":[[["number"]]],"description":"Amount of commands that were removed from the caches"},"meta":{"line":68,"file":"Sweepers.js","path":"src/util"}},{"name":"sweepAutoModerationRules","description":"Sweeps all auto moderation rules and removes the ones which are indicated by the filter.","params":[{"name":"filter","description":"The function used to determine\nwhich auto moderation rules will be removed from the caches","type":[[["function"]]]}],"returns":{"types":[[["number"]]],"description":"Amount of auto moderation rules that were removed from the caches"},"meta":{"line":86,"file":"Sweepers.js","path":"src/util"}},{"name":"sweepBans","description":"Sweeps all guild bans and removes the ones which are indicated by the filter.","params":[{"name":"filter","description":"The function used to determine which bans will be removed from the caches.","type":[[["function"]]]}],"returns":{"types":[[["number"]]],"description":"Amount of bans that were removed from the caches"},"meta":{"line":95,"file":"Sweepers.js","path":"src/util"}},{"name":"sweepEmojis","description":"Sweeps all guild emojis and removes the ones which are indicated by the filter.","params":[{"name":"filter","description":"The function used to determine which emojis will be removed from the caches.","type":[[["function"]]]}],"returns":{"types":[[["number"]]],"description":"Amount of emojis that were removed from the caches"},"meta":{"line":104,"file":"Sweepers.js","path":"src/util"}},{"name":"sweepInvites","description":"Sweeps all guild invites and removes the ones which are indicated by the filter.","params":[{"name":"filter","description":"The function used to determine which invites will be removed from the caches.","type":[[["function"]]]}],"returns":{"types":[[["number"]]],"description":"Amount of invites that were removed from the caches"},"meta":{"line":113,"file":"Sweepers.js","path":"src/util"}},{"name":"sweepGuildMembers","description":"Sweeps all guild members and removes the ones which are indicated by the filter.\nIt is highly recommended to keep the client guild member cached","params":[{"name":"filter","description":"The function used to determine which guild members will be removed from the caches.","type":[[["function"]]]}],"returns":{"types":[[["number"]]],"description":"Amount of guild members that were removed from the caches"},"meta":{"line":123,"file":"Sweepers.js","path":"src/util"}},{"name":"sweepMessages","description":"Sweeps all text-based channels' messages and removes the ones which are indicated by the filter.","examples":["// Remove all messages older than 1800 seconds from the messages cache\nconst amount = sweepers.sweepMessages(\n Sweepers.filterByLifetime({\n lifetime: 1800,\n getComparisonTimestamp: m => m.editedTimestamp ?? m.createdTimestamp,\n })(),\n);\nconsole.log(`Successfully removed ${amount} messages from the cache.`);"],"params":[{"name":"filter","description":"The function used to determine which messages will be removed from the caches.","type":[[["function"]]]}],"returns":{"types":[[["number"]]],"description":"Amount of messages that were removed from the caches"},"meta":{"line":141,"file":"Sweepers.js","path":"src/util"}},{"name":"sweepPresences","description":"Sweeps all presences and removes the ones which are indicated by the filter.","params":[{"name":"filter","description":"The function used to determine which presences will be removed from the caches.","type":[[["function"]]]}],"returns":{"types":[[["number"]]],"description":"Amount of presences that were removed from the caches"},"meta":{"line":163,"file":"Sweepers.js","path":"src/util"}},{"name":"sweepReactions","description":"Sweeps all message reactions and removes the ones which are indicated by the filter.","params":[{"name":"filter","description":"The function used to determine which reactions will be removed from the caches.","type":[[["function"]]]}],"returns":{"types":[[["number"]]],"description":"Amount of reactions that were removed from the caches"},"meta":{"line":172,"file":"Sweepers.js","path":"src/util"}},{"name":"sweepStageInstances","description":"Sweeps all guild stage instances and removes the ones which are indicated by the filter.","params":[{"name":"filter","description":"The function used to determine which stage instances will be removed from the caches.","type":[[["function"]]]}],"returns":{"types":[[["number"]]],"description":"Amount of stage instances that were removed from the caches"},"meta":{"line":201,"file":"Sweepers.js","path":"src/util"}},{"name":"sweepStickers","description":"Sweeps all guild stickers and removes the ones which are indicated by the filter.","params":[{"name":"filter","description":"The function used to determine which stickers will be removed from the caches.","type":[[["function"]]]}],"returns":{"types":[[["number"]]],"description":"Amount of stickers that were removed from the caches"},"meta":{"line":210,"file":"Sweepers.js","path":"src/util"}},{"name":"sweepThreadMembers","description":"Sweeps all thread members and removes the ones which are indicated by the filter.\nIt is highly recommended to keep the client thread member cached","params":[{"name":"filter","description":"The function used to determine which thread members will be removed from the caches.","type":[[["function"]]]}],"returns":{"types":[[["number"]]],"description":"Amount of thread members that were removed from the caches"},"meta":{"line":220,"file":"Sweepers.js","path":"src/util"}},{"name":"sweepThreads","description":"Sweeps all threads and removes the ones which are indicated by the filter.","examples":["// Remove all threads archived greater than 1 day ago from all the channel caches\nconst amount = sweepers.sweepThreads(\n Sweepers.filterByLifetime({\n getComparisonTimestamp: t => t.archivedTimestamp,\n excludeFromSweep: t => !t.archived,\n })(),\n);\nconsole.log(`Successfully removed ${amount} threads from the cache.`);"],"params":[{"name":"filter","description":"The function used to determine which threads will be removed from the caches.","type":[[["function"]]]}],"returns":{"types":[[["number"]]],"description":"filter Amount of threads that were removed from the caches"},"meta":{"line":250,"file":"Sweepers.js","path":"src/util"}},{"name":"sweepUsers","description":"Sweeps all users and removes the ones which are indicated by the filter.","params":[{"name":"filter","description":"The function used to determine which users will be removed from the caches.","type":[[["function"]]]}],"returns":{"types":[[["number"]]],"description":"Amount of users that were removed from the caches"},"meta":{"line":272,"file":"Sweepers.js","path":"src/util"}},{"name":"sweepVoiceStates","description":"Sweeps all guild voice states and removes the ones which are indicated by the filter.","params":[{"name":"filter","description":"The function used to determine which voice states will be removed from the caches.","type":[[["function"]]]}],"returns":{"types":[[["number"]]],"description":"Amount of voice states that were removed from the caches"},"meta":{"line":289,"file":"Sweepers.js","path":"src/util"}},{"name":"destroy","description":"Cancels all sweeping intervals","returns":[[["void"]]],"meta":{"line":297,"file":"Sweepers.js","path":"src/util"}},{"name":"_sweepGuildDirectProp","description":"Sweep a direct sub property of all guilds","access":"private","params":[{"name":"key","description":"The name of the property","type":[[["string"]]]},{"name":"filter","description":"Filter function passed to sweep","type":[[["function"]]]},{"name":"eventOptions","description":"Options for the Client event emitted here","optional":true,"default":"{}","type":[[["SweepEventOptions"]]]}],"returns":{"types":[[["Object"]]],"description":"Object containing the number of guilds swept and the number of items swept"},"meta":{"line":401,"file":"Sweepers.js","path":"src/util"}},{"name":"_validateProperties","description":"Validates a set of properties","access":"private","params":[{"name":"key","description":"Key of the options object to check","type":[[["string"]]]}],"meta":{"line":428,"file":"Sweepers.js","path":"src/util"}},{"name":"_initInterval","description":"Initialize an interval for sweeping","access":"private","params":[{"name":"intervalKey","description":"The name of the property that stores the interval for this sweeper","type":[[["string"]]]},{"name":"sweepKey","description":"The name of the function that sweeps the desired caches","type":[[["string"]]]},{"name":"opts","description":"Validated options for a sweep","type":[[["Object"]]]}],"meta":{"line":455,"file":"Sweepers.js","path":"src/util"}},{"name":"filterByLifetime","description":"Create a sweepFilter function that uses a lifetime to determine sweepability.","scope":"static","params":[{"name":"options","description":"The options used to generate the filter function","optional":true,"default":"{}","type":[[["LifetimeFilterOptions"]]]}],"returns":[[["GlobalSweepFilter"]]],"meta":{"line":319,"file":"Sweepers.js","path":"src/util"}},{"name":"archivedThreadSweepFilter","description":"Creates a sweep filter that sweeps archived threads","scope":"static","params":[{"name":"lifetime","description":"How long a thread has to be archived to be valid for sweeping","optional":true,"default":14400,"type":[[["number"]]]}],"returns":[[["GlobalSweepFilter"]]],"meta":{"line":353,"file":"Sweepers.js","path":"src/util"}},{"name":"expiredInviteSweepFilter","description":"Creates a sweep filter that sweeps expired invites","scope":"static","params":[{"name":"lifetime","description":"How long ago an invite has to have expired to be valid for sweeping","optional":true,"default":14400,"type":[[["number"]]]}],"returns":[[["GlobalSweepFilter"]]],"meta":{"line":366,"file":"Sweepers.js","path":"src/util"}},{"name":"outdatedMessageSweepFilter","description":"Creates a sweep filter that sweeps outdated messages (edits taken into account)","scope":"static","params":[{"name":"lifetime","description":"How long ago a message has to have been sent or edited to be valid for sweeping","optional":true,"default":3600,"type":[[["number"]]]}],"returns":[[["GlobalSweepFilter"]]],"meta":{"line":378,"file":"Sweepers.js","path":"src/util"}}],"meta":{"line":17,"file":"Sweepers.js","path":"src/util"}},{"name":"SystemChannelFlags","description":"Data structure that makes it easy to interact with a {@link Guild#systemChannelFlags} bitfield.\nNote that all event message types are enabled by default,\nand by setting their corresponding flags you are disabling them","extends":[[["BitField"]]],"construct":{"name":"SystemChannelFlags","params":[{"name":"bits","description":"Bit(s) to read from","optional":true,"default":0,"type":[[["SystemChannelFlagsResolvable"]]]}]},"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["number"]]],"meta":{"line":20,"file":"SystemChannelFlags.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric system channel flags. All available properties:\n* `SUPPRESS_JOIN_NOTIFICATIONS` (Suppress member join notifications)\n* `SUPPRESS_PREMIUM_SUBSCRIPTIONS` (Suppress server boost notifications)\n* `SUPPRESS_GUILD_REMINDER_NOTIFICATIONS` (Suppress server setup tips)\n* `SUPPRESS_JOIN_NOTIFICATION_REPLIES` (Hide member join sticker reply buttons)\n* `SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATIONS` (Suppress role subscription purchase and renewal notifications)\n* `SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATION_REPLIES` (HHide role subscription sticker reply buttons)","see":["{@link https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags}"],"scope":"static","type":[[["Object"]]],"meta":{"line":46,"file":"SystemChannelFlags.js","path":"src/util"}}],"methods":[{"name":"any","description":"Checks whether the bitfield has a bit, or any of multiple bits.","inherits":"BitField#any","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":25,"file":"BitField.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","inherits":"BitField#equals","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a bit, or multiple bits.","inherits":"BitField#has","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"BitField.js","path":"src/util"}},{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","inherits":"BitField#missing","inherited":true,"params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":54,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","inherits":"BitField#freeze","inherited":true,"returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","inherits":"BitField#add","inherited":true,"params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","inherits":"BitField#remove","inherited":true,"params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","inherits":"BitField#serialize","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the bits available.","inherits":"BitField#toArray","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":113,"file":"BitField.js","path":"src/util"}}],"meta":{"line":11,"file":"SystemChannelFlags.js","path":"src/util"}},{"name":"ThreadMemberFlags","description":"Data structure that makes it easy to interact with a {@link ThreadMember#flags} bitfield.","extends":[[["BitField"]]],"construct":{"name":"ThreadMemberFlags","params":[{"name":"bits","description":"Bit(s) to read from","optional":true,"default":0,"type":[[["BitFieldResolvable"]]]}]},"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["number"]]],"meta":{"line":18,"file":"ThreadMemberFlags.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric thread member flags. There are currently no bitflags relevant to bots for this.","scope":"static","type":[[["Object","<"],["string",", "],["number",">"]]],"meta":{"line":28,"file":"ThreadMemberFlags.js","path":"src/util"}}],"methods":[{"name":"any","description":"Checks whether the bitfield has a bit, or any of multiple bits.","inherits":"BitField#any","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":25,"file":"BitField.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","inherits":"BitField#equals","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a bit, or multiple bits.","inherits":"BitField#has","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"BitField.js","path":"src/util"}},{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","inherits":"BitField#missing","inherited":true,"params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":54,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","inherits":"BitField#freeze","inherited":true,"returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","inherits":"BitField#add","inherited":true,"params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","inherits":"BitField#remove","inherited":true,"params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","inherits":"BitField#serialize","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the bits available.","inherits":"BitField#toArray","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":113,"file":"BitField.js","path":"src/util"}}],"meta":{"line":9,"file":"ThreadMemberFlags.js","path":"src/util"}},{"name":"UserFlags","description":"Data structure that makes it easy to interact with a {@link User#flags} bitfield.","extends":[[["BitField"]]],"construct":{"name":"UserFlags","params":[{"name":"bits","description":"Bit(s) to read from","optional":true,"default":0,"type":[[["BitFieldResolvable"]]]}]},"props":[{"name":"bitfield","description":"Bitfield of the packed bits","type":[[["number"]]],"meta":{"line":17,"file":"UserFlags.js","path":"src/util"}},{"name":"FLAGS","description":"Numeric user flags. All available properties:\n* `DISCORD_EMPLOYEE`\n* `PARTNERED_SERVER_OWNER`\n* `HYPESQUAD_EVENTS`\n* `BUGHUNTER_LEVEL_1`\n* `MFA_SMS`\n* `PREMIUM_PROMO_DISMISSED`\n* `HOUSE_BRAVERY`\n* `HOUSE_BRILLIANCE`\n* `HOUSE_BALANCE`\n* `EARLY_SUPPORTER`\n* `TEAM_USER`\n* `INTERNAL_APPLICATION`\n* `SYSTEM`\n* `HAS_UNREAD_URGENT_MESSAGES`\n* `BUGHUNTER_LEVEL_2`\n* `UNDERAGE_DELETED`\n* `VERIFIED_BOT`\n* `EARLY_VERIFIED_BOT_DEVELOPER`\n* `DISCORD_CERTIFIED_MODERATOR`\n* `BOT_HTTP_INTERACTIONS`\n* `SPAMMER`\n* `DISABLE_PREMIUM`\n* `ACTIVE_DEVELOPER`\n* `HIGH_GLOBAL_RATE_LIMIT`\n* `DELETED`\n* `DISABLED_SUSPICIOUS_ACTIVITY`\n* `SELF_DELETED`\n* `PREMIUM_DISCRIMINATOR`\n* `USED_DESKTOP_CLIENT`\n* `USED_WEB_CLIENT`\n* `USED_MOBILE_CLIENT`\n* `DISABLED`\n* `VERIFIED_EMAIL`\n* `QUARANTINED`\n* `COLLABORATOR`\n* `RESTRICTED_COLLABORATOR`","see":["{@link https://discord.com/developers/docs/resources/user#user-object-user-flags}","{@link https://github.com/LewisTehMinerz/discord-flags}"],"scope":"static","type":[[["Object"]]],"meta":{"line":65,"file":"UserFlags.js","path":"src/util"}}],"methods":[{"name":"any","description":"Checks whether the bitfield has a bit, or any of multiple bits.","inherits":"BitField#any","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":25,"file":"BitField.js","path":"src/util"}},{"name":"equals","description":"Checks if this bitfield equals another","inherits":"BitField#equals","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":34,"file":"BitField.js","path":"src/util"}},{"name":"has","description":"Checks whether the bitfield has a bit, or multiple bits.","inherits":"BitField#has","inherited":true,"params":[{"name":"bit","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]}],"returns":[[["boolean"]]],"meta":{"line":43,"file":"BitField.js","path":"src/util"}},{"name":"missing","description":"Gets all given bits that are missing from the bitfield.","inherits":"BitField#missing","inherited":true,"params":[{"name":"bits","description":"Bit(s) to check for","type":[[["BitFieldResolvable"]]]},{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":54,"file":"BitField.js","path":"src/util"}},{"name":"freeze","description":"Freezes these bits, making them immutable.","inherits":"BitField#freeze","inherited":true,"returns":[[["Readonly","<"],["BitField",">"]]],"meta":{"line":62,"file":"BitField.js","path":"src/util"}},{"name":"add","description":"Adds bits to these ones.","inherits":"BitField#add","inherited":true,"params":[{"name":"bits","description":"Bits to add","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":71,"file":"BitField.js","path":"src/util"}},{"name":"remove","description":"Removes bits from these.","inherits":"BitField#remove","inherited":true,"params":[{"name":"bits","description":"Bits to remove","optional":true,"variable":true,"type":[[["BitFieldResolvable"]]]}],"returns":{"types":[[["BitField"]]],"description":"These bits or new BitField if the instance is frozen."},"meta":{"line":86,"file":"BitField.js","path":"src/util"}},{"name":"serialize","description":"Gets an object mapping field names to a {@link boolean} indicating whether the\nbit is available.","inherits":"BitField#serialize","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Object"]]],"meta":{"line":102,"file":"BitField.js","path":"src/util"}},{"name":"toArray","description":"Gets an {@link Array} of bitfield names based on the bits available.","inherits":"BitField#toArray","inherited":true,"params":[{"name":"hasParams","description":"Additional parameters for the has method, if any","variable":true,"type":[["*"]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":113,"file":"BitField.js","path":"src/util"}}],"meta":{"line":8,"file":"UserFlags.js","path":"src/util"}},{"name":"Util","description":"Contains various general-purpose utility methods.","methods":[{"name":"flatten","description":"Flatten an object. Any properties that are collections will get converted to an array of keys.","scope":"static","params":[{"name":"obj","description":"The object to flatten.","type":[[["Object"]]]},{"name":"props","description":"Specific properties to include/exclude.","optional":true,"variable":true,"type":[[["Object","<"],["string",", ("],["boolean","|"],["string",")>"]]]}],"returns":[[["Object"]]],"meta":{"line":86,"file":"Util.js","path":"src/util"}},{"name":"splitMessage","description":"Splits a string into multiple chunks at a designated character that do not exceed a specific length.","scope":"static","deprecated":"This will be removed in the next major version.","params":[{"name":"text","description":"Content to split","type":[[["string"]]]},{"name":"options","description":"Options controlling the behavior of the split","optional":true,"type":[[["SplitOptions"]]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":142,"file":"Util.js","path":"src/util"}},{"name":"escapeMarkdown","description":"Escapes any Discord-flavour markdown in a string.","scope":"static","params":[{"name":"text","description":"Content to escape","type":[[["string"]]]},{"name":"options","description":"Options for escaping the markdown","optional":true,"default":"{}","type":[[["EscapeMarkdownOptions"]]]}],"returns":[[["string"]]],"meta":{"line":205,"file":"Util.js","path":"src/util"}},{"name":"escapeCodeBlock","description":"Escapes code block markdown in a string.","scope":"static","params":[{"name":"text","description":"Content to escape","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":287,"file":"Util.js","path":"src/util"}},{"name":"escapeInlineCode","description":"Escapes inline code markdown in a string.","scope":"static","params":[{"name":"text","description":"Content to escape","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":296,"file":"Util.js","path":"src/util"}},{"name":"escapeItalic","description":"Escapes italic markdown in a string.","scope":"static","params":[{"name":"text","description":"Content to escape","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":305,"file":"Util.js","path":"src/util"}},{"name":"escapeBold","description":"Escapes bold markdown in a string.","scope":"static","params":[{"name":"text","description":"Content to escape","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":323,"file":"Util.js","path":"src/util"}},{"name":"escapeUnderline","description":"Escapes underline markdown in a string.","scope":"static","params":[{"name":"text","description":"Content to escape","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":336,"file":"Util.js","path":"src/util"}},{"name":"escapeStrikethrough","description":"Escapes strikethrough markdown in a string.","scope":"static","params":[{"name":"text","description":"Content to escape","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":349,"file":"Util.js","path":"src/util"}},{"name":"escapeSpoiler","description":"Escapes spoiler markdown in a string.","scope":"static","params":[{"name":"text","description":"Content to escape","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":358,"file":"Util.js","path":"src/util"}},{"name":"escapeEscape","description":"Escapes escape characters in a string.","scope":"static","params":[{"name":"text","description":"Content to escape","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":367,"file":"Util.js","path":"src/util"}},{"name":"escapeHeading","description":"Escapes heading characters in a string.","scope":"static","params":[{"name":"text","description":"Content to escape","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":376,"file":"Util.js","path":"src/util"}},{"name":"escapeBulletedList","description":"Escapes bulleted list characters in a string.","scope":"static","params":[{"name":"text","description":"Content to escape","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":385,"file":"Util.js","path":"src/util"}},{"name":"escapeNumberedList","description":"Escapes numbered list characters in a string.","scope":"static","params":[{"name":"text","description":"Content to escape","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":394,"file":"Util.js","path":"src/util"}},{"name":"escapeMaskedLink","description":"Escapes masked link characters in a string.","scope":"static","params":[{"name":"text","description":"Content to escape","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":403,"file":"Util.js","path":"src/util"}},{"name":"parseEmoji","description":"Parses emoji info out of a string. The string must be one of:\n* A UTF-8 emoji (no id)\n* A URL-encoded UTF-8 emoji (no id)\n* A Discord custom emoji (`<:name:id>` or ``)","scope":"static","access":"private","params":[{"name":"text","description":"Emoji string to parse","type":[[["string"]]]}],"returns":{"types":[[["APIEmoji"]]],"description":"Object with `animated`, `name`, and `id` properties"},"meta":{"line":426,"file":"Util.js","path":"src/util"}},{"name":"resolvePartialEmoji","description":"Resolves a partial emoji object from an {@link EmojiIdentifierResolvable}, without checking a Client.","scope":"static","access":"private","params":[{"name":"emoji","description":"Emoji identifier to resolve","type":[[["EmojiIdentifierResolvable"]]]}],"returns":{"types":[[["RawEmoji"]]],"nullable":true},"meta":{"line":439,"file":"Util.js","path":"src/util"}},{"name":"cloneObject","description":"Shallow-copies an object with its class/prototype intact.","scope":"static","access":"private","params":[{"name":"obj","description":"Object to clone","type":[[["Object"]]]}],"returns":[[["Object"]]],"meta":{"line":453,"file":"Util.js","path":"src/util"}},{"name":"mergeDefault","description":"Sets default properties on an object that aren't already specified.","scope":"static","access":"private","params":[{"name":"def","description":"Default properties","type":[[["Object"]]]},{"name":"given","description":"Object to assign defaults to","type":[[["Object"]]]}],"returns":[[["Object"]]],"meta":{"line":464,"file":"Util.js","path":"src/util"}},{"name":"makeError","description":"Makes an Error from a plain info object.","scope":"static","access":"private","params":[{"name":"obj","description":"Error info","type":[[["MakeErrorOptions"]]]}],"returns":[[["Error"]]],"meta":{"line":491,"file":"Util.js","path":"src/util"}},{"name":"makePlainError","description":"Makes a plain error info object from an Error.","scope":"static","access":"private","params":[{"name":"err","description":"Error to get info from","type":[[["Error"]]]}],"returns":[[["MakeErrorOptions"]]],"meta":{"line":504,"file":"Util.js","path":"src/util"}},{"name":"moveElementInArray","description":"Moves an element in an array *in place*.","scope":"static","access":"private","params":[{"name":"array","description":"Array to modify","type":[[["Array","<"],["*",">"]]]},{"name":"element","description":"Element to move","type":[["*"]]},{"name":"newIndex","description":"Index or offset to move the element to","type":[[["number"]]]},{"name":"offset","description":"Move the element by an offset amount rather than to a set index","optional":true,"default":false,"type":[[["boolean"]]]}],"returns":[[["number"]]],"meta":{"line":521,"file":"Util.js","path":"src/util"}},{"name":"verifyString","description":"Verifies the provided data is a string, otherwise throws provided error.","scope":"static","params":[{"name":"data","description":"The string resolvable to resolve","type":[[["string"]]]},{"name":"error","description":"The Error constructor to instantiate. Defaults to Error","optional":true,"type":[[["function"]]]},{"name":"errorMessage","description":"The error message to throw with. Defaults to \"Expected string, got instead.\"","optional":true,"type":[[["string"]]]},{"name":"allowEmpty","description":"Whether an empty string should be allowed","optional":true,"default":true,"type":[[["boolean"]]]}],"returns":[[["string"]]],"meta":{"line":539,"file":"Util.js","path":"src/util"}},{"name":"resolveColor","description":"Resolves a ColorResolvable into a color number.","scope":"static","params":[{"name":"color","description":"Color to resolve","type":[[["ColorResolvable"]]]}],"returns":{"types":[[["number"]]],"description":"A color"},"meta":{"line":563,"file":"Util.js","path":"src/util"}},{"name":"discordSort","description":"Sorts by Discord's position and id.","scope":"static","params":[{"name":"collection","description":"Collection of objects to sort","type":[[["Collection"]]]}],"returns":[[["Collection"]]],"meta":{"line":583,"file":"Util.js","path":"src/util"}},{"name":"setPosition","description":"Sets the position of a Channel or Role.","scope":"static","access":"private","params":[{"name":"item","description":"Object to set the position of","type":[[["Channel"]],[["Role"]]]},{"name":"position","description":"New position for the object","type":[[["number"]]]},{"name":"relative","description":"Whether `position` is relative to its current position","type":[[["boolean"]]]},{"name":"sorted","description":"A collection of the objects sorted properly","type":[[["Collection","<"],["string",", ("],["Channel","|"],["Role",")>"]]]},{"name":"route","description":"Route to call PATCH on","type":[[["APIRouter"]]]},{"name":"reason","description":"Reason for the change","optional":true,"type":[[["string"]]]}],"async":true,"returns":{"types":[[["Promise","<("],["Array","<"],["Channel",">|"],["Array","<"],["Role",">)>"]]],"description":"Updated item list, with `id` and `position` properties"},"meta":{"line":603,"file":"Util.js","path":"src/util"}},{"name":"basename","description":"Alternative to Node's `path.basename`, removing query string after the extension if it exists.","scope":"static","access":"private","params":[{"name":"path","description":"Path to get the basename of","type":[[["string"]]]},{"name":"ext","description":"File extension to remove","optional":true,"type":[[["string"]]]}],"returns":{"types":[[["string"]]],"description":"Basename of the path"},"meta":{"line":618,"file":"Util.js","path":"src/util"}},{"name":"removeMentions","description":"Breaks user, role and everyone/here mentions by adding a zero width space after every @ character","scope":"static","deprecated":"Use {@link BaseMessageOptions#allowedMentions} instead.","params":[{"name":"str","description":"The string to sanitize","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":629,"file":"Util.js","path":"src/util"}},{"name":"cleanContent","description":"The content to have all mentions replaced by the equivalent text.\nWhen {@link Util.removeMentions} is removed, this method will no longer sanitize mentions.\nUse {@link BaseMessageOptions#allowedMentions} instead to prevent mentions when sending a message.","scope":"static","params":[{"name":"str","description":"The string to be converted","type":[[["string"]]]},{"name":"channel","description":"The channel the string was sent in","type":[[["TextBasedChannels"]]]}],"returns":[[["string"]]],"meta":{"line":654,"file":"Util.js","path":"src/util"}},{"name":"cleanCodeBlockContent","description":"The content to put in a code block with all code block fences replaced by the equivalent backticks.","scope":"static","params":[{"name":"text","description":"The string to be converted","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":688,"file":"Util.js","path":"src/util"}},{"name":"archivedThreadSweepFilter","description":"Creates a sweep filter that sweeps archived threads","scope":"static","deprecated":"When not using with `makeCache` use `Sweepers.archivedThreadSweepFilter` instead","params":[{"name":"lifetime","description":"How long a thread has to be archived to be valid for sweeping","optional":true,"default":14400,"type":[[["number"]]]}],"returns":[[["SweepFilter"]]],"meta":{"line":698,"file":"Util.js","path":"src/util"}},{"name":"resolveAutoArchiveMaxLimit","description":"Resolves the maximum time a guild's thread channels should automatically archive in case of no recent activity.","scope":"static","deprecated":"This will be removed in the next major version.","params":[{"name":"guild","description":"The guild to resolve this limit from.","type":[[["Guild"]]]}],"returns":[[["number"]]],"meta":{"line":710,"file":"Util.js","path":"src/util"}},{"name":"transformAPIGuildForumTag","description":"Transforms an API guild forum tag to camel-cased guild forum tag.","scope":"static","params":[{"name":"tag","description":"The tag to transform","type":[[["APIGuildForumTag"]]]}],"returns":[[["GuildForumTag"]]],"meta":{"line":728,"file":"Util.js","path":"src/util"}},{"name":"transformGuildForumTag","description":"Transforms a camel-cased guild forum tag to an API guild forum tag.","scope":"static","params":[{"name":"tag","description":"The tag to transform","type":[[["GuildForumTag"]]]}],"returns":[[["APIGuildForumTag"]]],"meta":{"line":749,"file":"Util.js","path":"src/util"}},{"name":"transformAPIGuildDefaultReaction","description":"Transforms an API guild forum default reaction object to a\ncamel-cased guild forum default reaction object.","scope":"static","params":[{"name":"defaultReaction","description":"The default reaction to transform","type":[[["APIGuildForumDefaultReactionEmoji"]]]}],"returns":[[["DefaultReactionEmoji"]]],"meta":{"line":766,"file":"Util.js","path":"src/util"}},{"name":"transformGuildDefaultReaction","description":"Transforms a camel-cased guild forum default reaction object to an\nAPI guild forum default reaction object.","scope":"static","params":[{"name":"defaultReaction","description":"The default reaction to transform","type":[[["DefaultReactionEmoji"]]]}],"returns":[[["APIGuildForumDefaultReactionEmoji"]]],"meta":{"line":780,"file":"Util.js","path":"src/util"}},{"name":"transformGuildScheduledEventRecurrenceRule","description":"Transforms a guild scheduled event recurrence rule object to a snake-cased variant.","scope":"static","params":[{"name":"recurrenceRule","description":"The recurrence rule to transform","type":[[["GuildScheduledEventRecurrenceRuleOptions"]]]}],"returns":[[["APIGuildScheduledEventRecurrenceRule"]]],"meta":{"line":793,"file":"Util.js","path":"src/util"}},{"name":"transformAPIIncidentsData","description":"Transforms API incidents data to a camel-cased variant.","scope":"static","params":[{"name":"data","description":"The incidents data to transform","type":[[["APIIncidentsData"]]]}],"returns":[[["IncidentActions"]]],"meta":{"line":811,"file":"Util.js","path":"src/util"}},{"name":"getSortableGroupTypes","description":"Gets an array of the channel types that can be moved in the channel group. For example, a GuildText channel would\nreturn an array containing the types that can be ordered within the text channels (always at the top), and a voice\nchannel would return an array containing the types that can be ordered within the voice channels (always at the\nbottom).","scope":"static","params":[{"name":"type","description":"The type of the channel","type":[[["ChannelType"]]]}],"returns":[[["Array","<"],["ChannelType",">"]]],"meta":{"line":829,"file":"Util.js","path":"src/util"}},{"name":"calculateUserDefaultAvatarIndex","description":"Calculates the default avatar index for a given user id.","scope":"static","params":[{"name":"userId","description":"The user id to calculate the default avatar index for","type":[[["Snowflake"]]]}],"returns":[[["number"]]],"meta":{"line":850,"file":"Util.js","path":"src/util"}},{"name":"lazy","description":"Lazily evaluates a callback function (yea it's v14 :yay:)","scope":"static","examples":["const User = lazy(() => require('./User'));\nconst user = new (User())(client, data);"],"params":[{"name":"cb","description":"The callback to lazily evaluate","type":[[["function"]]]}],"returns":[[["function"]]],"meta":{"line":896,"file":"Util.js","path":"src/util"}},{"name":"verifyProxyAgent","description":"Hacking check object instanceof Proxy-agent","scope":"static","params":[{"name":"object","description":"any","type":[[["Object"]]]}],"returns":[[["boolean"]]],"meta":{"line":906,"file":"Util.js","path":"src/util"}},{"name":"getPayloadType","description":"Get the payload type of the codec","scope":"static","params":[{"name":"codecName","description":"Codec name","type":[[["opus","'"]],[["H264","'"]],[["H265","'"]],[["VP8","'"]],[["VP9","'"]],[["AV1","'"]]]}],"returns":[[["number"]]],"meta":{"line":996,"file":"Util.js","path":"src/util"}}],"meta":{"line":79,"file":"Util.js","path":"src/util"}}],"interfaces":[{"name":"InteractionResponses","description":"Interface for classes that support shared interaction response types.","methods":[{"name":"deferReply","description":"Defers the reply to this interaction.","examples":["// Defer the reply to this interaction\ninteraction.deferReply()\n .then(console.log)\n .catch(console.error)","// Defer to send an ephemeral reply later\ninteraction.deferReply({ ephemeral: true })\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for deferring the reply to this interaction","optional":true,"type":[[["InteractionDeferReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":58,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"reply","description":"Creates a reply to this interaction.\nUse the `fetchReply` option to get the bot's reply message.","examples":["// Reply to the interaction and fetch the response\ninteraction.reply({ content: 'Pong!', fetchReply: true })\n .then((message) => console.log(`Reply sent with content ${message.content}`))\n .catch(console.error);","// Create an ephemeral reply with an embed\nconst embed = new MessageEmbed().setDescription('Pong!');\n\ninteraction.reply({ embeds: [embed], ephemeral: true })\n .then(() => console.log('Reply sent.'))\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":93,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"fetchReply","description":"Fetches a reply to this interaction.","see":["Webhook#fetchMessage"],"examples":["// Fetch the initial reply to this interaction\ninteraction.fetchReply()\n .then(reply => console.log(`Replied with ${reply.content}`))\n .catch(console.error);"],"params":[{"name":"message","description":"The response to fetch","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":127,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"editReply","description":"Edits a reply to this interaction.","see":["Webhook#editMessage"],"examples":["// Edit the initial reply to this interaction\ninteraction.editReply('New content')\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The new options for the message","type":[[["string"]],[["MessagePayload"]],[["InteractionEditReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":148,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"deleteReply","description":"Deletes a reply to this interaction.","see":["Webhook#deleteMessage"],"examples":["// Delete the initial reply to this interaction\ninteraction.deleteReply()\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"message","description":"The response to delete","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":166,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"followUp","description":"Send a follow-up message to this interaction.","params":[{"name":"options","description":"The options for the reply","type":[[["string"]],[["MessagePayload"]],[["InteractionReplyOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage",")>"]]],"meta":{"line":175,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"deferUpdate","description":"Defers an update to the message to which the component was attached.","examples":["// Defer updating and reset the component's loading state\ninteraction.deferUpdate()\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"Options for deferring the update to this interaction","optional":true,"type":[[["InteractionDeferUpdateOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":190,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"update","description":"Updates the original message of the component on which the interaction was received on.","examples":["// Remove the components from the message\ninteraction.update({\n content: \"A component interaction was received\",\n components: []\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options for the updated message","type":[[["string"]],[["MessagePayload"]],[["InteractionUpdateOptions"]]]}],"async":true,"returns":[[["Promise","<("],["Message","|"],["APIMessage","|"],["void",")>"]]],"meta":{"line":216,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"showModal","description":"Shows a modal component","params":[{"name":"modal","description":"The modal to show","type":[[["Modal"]],[["ModalOptions"]]]}],"async":true,"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":243,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"awaitModalSubmit","description":"Collects a single modal submit interaction that passes the filter.\nThe Promise will reject if the time expires.","examples":["// Collect a modal submit interaction\nconst filter = (interaction) => interaction.customId === 'modal';\ninteraction.awaitModalSubmit({ filter, time: 15_000 })\n .then(interaction => console.log(`${interaction.customId} was submitted!`))\n .catch(console.error);"],"params":[{"name":"options","description":"Options to pass to the internal collector","type":[[["AwaitModalSubmitOptions"]]]}],"returns":[[["Promise","<"],["ModalSubmitInteraction",">"]]],"meta":{"line":275,"file":"InteractionResponses.js","path":"src/structures/interfaces"}}],"meta":{"line":14,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"TextBasedChannel","description":"Interface for classes that have text-channel-like features.","props":[{"name":"messages","description":"A manager of the messages sent to this channel","type":[[["MessageManager"]]],"meta":{"line":31,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"lastMessageId","description":"The channel's last message id, if one was sent","nullable":true,"type":[[["Snowflake"]]],"meta":{"line":37,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"lastPinTimestamp","description":"The timestamp when the last pinned message was pinned, if there was one","nullable":true,"type":[[["number"]]],"meta":{"line":43,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"lastMessage","description":"The Message object of the last message in the channel, if one was sent","readonly":true,"nullable":true,"type":[[["Message"]]],"meta":{"line":51,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"lastPinAt","description":"The date when the last pinned message was pinned, if there was one","readonly":true,"nullable":true,"type":[[["Date"]]],"meta":{"line":60,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}}],"methods":[{"name":"send","description":"Sends a message to this channel.","examples":["// Send a basic message\nchannel.send('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.error);","// Send a remote file\nchannel.send({\n files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']\n})\n .then(console.log)\n .catch(console.error);","// Send a local file\nchannel.send({\n files: [{\n attachment: 'entire/path/to/file.jpg',\n name: 'file.jpg',\n description: 'A description of the file'\n }]\n})\n .then(console.log)\n .catch(console.error);"],"params":[{"name":"options","description":"The options to provide","type":[[["string"]],[["MessagePayload"]],[["MessageOptions"]]]}],"async":true,"returns":[[["Promise","<"],["Message",">"]]],"meta":{"line":181,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"sendTyping","description":"Sends a typing indicator in the channel.","examples":["// Start typing in a channel\nchannel.sendTyping();"],"returns":{"types":[[["Promise","<({"],["message_send_cooldown_ms",": "],["number",", "],["thread_create_cooldown_ms",": "],["number","}|"],["void",")>"]]],"description":"Resolves upon the typing status being sent"},"meta":{"line":395,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createMessageCollector","description":"Creates a Message Collector.","examples":["// Create a message collector\nconst filter = m => m.content.includes('discord');\nconst collector = channel.createMessageCollector({ filter, time: 15_000 });\ncollector.on('collect', m => console.log(`Collected ${m.content}`));\ncollector.on('end', collected => console.log(`Collected ${collected.size} items`));"],"params":[{"name":"options","description":"The options to pass to the collector","optional":true,"default":"{}","type":[[["MessageCollectorOptions"]]]}],"returns":[[["MessageCollector"]]],"meta":{"line":410,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"awaitMessages","description":"Similar to createMessageCollector but in promise form.\nResolves with a collection of messages that pass the specified filter.","examples":["// Await !vote messages\nconst filter = m => m.content.startsWith('!vote');\n// Errors: ['time'] treats ending because of the time limit as an error\nchannel.awaitMessages({ filter, max: 4, time: 60_000, errors: ['time'] })\n .then(collected => console.log(collected.size))\n .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));"],"params":[{"name":"options","description":"Optional options to pass to the internal collector","optional":true,"default":"{}","type":[[["AwaitMessagesOptions"]]]}],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Message",">>"]]],"meta":{"line":433,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"fetchWebhooks","description":"Fetches all webhooks for the channel.","examples":["// Fetch webhooks\nchannel.fetchWebhooks()\n .then(hooks => console.log(`This channel has ${hooks.size} hooks`))\n .catch(console.error);"],"returns":[[["Promise","<"],["Collection","<"],["Snowflake",", "],["Webhook",">>"]]],"meta":{"line":455,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"createWebhook","description":"Creates a webhook for the channel.","examples":["// Create a webhook for the current channel\nchannel.createWebhook('Snek', {\n avatar: 'https://i.imgur.com/mI8XcpG.jpg',\n reason: 'Needed a cool new Webhook'\n})\n .then(console.log)\n .catch(console.error)"],"params":[{"name":"name","description":"The name of the webhook","type":[[["string"]]]},{"name":"options","description":"Options for creating the webhook","optional":true,"type":[[["ChannelWebhookCreateOptions"]]]}],"returns":{"types":[[["Promise","<"],["Webhook",">"]]],"description":"Returns the created Webhook"},"meta":{"line":480,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setRateLimitPerUser","description":"Sets the rate limit per user (slowmode) for this channel.","params":[{"name":"rateLimitPerUser","description":"The new rate limit in seconds","type":[[["number"]]]},{"name":"reason","description":"Reason for changing the channel's rate limit","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":490,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"setNSFW","description":"Sets whether this channel is flagged as NSFW.","params":[{"name":"nsfw","description":"Whether the channel should be considered NSFW","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"Reason for changing the channel's NSFW flag","optional":true,"type":[[["string"]]]}],"returns":[[["Promise","<"],["this",">"]]],"meta":{"line":500,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}}],"meta":{"line":25,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}}],"typedefs":[{"name":"ApplicationCommandPermissionsUpdateData","description":"The data received in the {@link Client#event:applicationCommandPermissionsUpdate} event","type":[[["Object"]]],"props":[{"name":"id","description":"The id of the command or global entity that was updated","type":[[["Snowflake"]]]},{"name":"guildId","description":"The id of the guild in which permissions were updated","type":[[["Snowflake"]]]},{"name":"applicationId","description":"The id of the application that owns the command or entity being updated","type":[[["Snowflake"]]]},{"name":"permissions","description":"The updated permissions","type":[[["Array","<"],["ApplicationCommandPermissions",">"]]]}],"meta":{"line":6,"file":"ApplicationCommandPermissionsUpdate.js","path":"src/client/actions"}},{"name":"MessageReactionEventDetails","description":"Provides additional information about altered reaction","type":[[["Object"]]],"props":[{"name":"type","description":"The type of the reaction","type":[[["ReactionType"]]]},{"name":"burst","description":"Determines whether a super reaction was used","type":[[["boolean"]]]}],"meta":{"line":49,"file":"MessageReactionAdd.js","path":"src/client/actions"}},{"name":"ClientFetchInviteOptions","description":"Options used when fetching an invite from Discord.","type":[[["Object"]]],"props":[{"name":"guildScheduledEventId","description":"The id of the guild scheduled event to include with\nthe invite","optional":true,"type":[[["Snowflake"]]]}],"meta":{"line":376,"file":"Client.js","path":"src/client"}},{"name":"InviteGenerationOptions","description":"Options for {@link Client#generateInvite}.","type":[[["Object"]]],"props":[{"name":"scopes","description":"Scopes that should be requested","type":[[["Array","<"],["InviteScope",">"]]]},{"name":"permissions","description":"Permissions to request","optional":true,"type":[[["PermissionResolvable"]]]},{"name":"guild","description":"Guild to preselect","optional":true,"type":[[["GuildResolvable"]]]},{"name":"disableGuildSelect","description":"Whether to disable the guild selection","optional":true,"type":[[["boolean"]]]}],"meta":{"line":570,"file":"Client.js","path":"src/client"}},{"name":"AcceptInviteOptions","description":"Options for {@link Client#acceptInvite}.","type":[[["Object"]]],"props":[{"name":"bypassOnboarding","description":"Whether to bypass onboarding","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"bypassVerify","description":"Whether to bypass rule screening","optional":true,"default":true,"type":[[["boolean"]]]}],"meta":{"line":603,"file":"Client.js","path":"src/client"}},{"name":"OAuth2AuthorizeOptions","type":[[["Object"]]],"props":[{"name":"guild_id","description":"Guild ID","optional":true,"type":[[["string"]]]},{"name":"permissions","description":"Permissions","optional":true,"type":[[["string"]]]},{"name":"authorize","description":"Whether to authorize or not","optional":true,"type":[[["boolean"]]]},{"name":"code","description":"2FA Code","optional":true,"type":[[["string"]]]},{"name":"webhook_channel_id","description":"Webhook Channel ID","optional":true,"type":[[["string"]]]}],"meta":{"line":720,"file":"Client.js","path":"src/client"}},{"name":"AuthorizedApplicationData","type":[[["Object"]]],"props":[{"name":"application","description":"The application object.","type":[[["Application"]]]},{"name":"authorizedApplicationId","description":"The ID of the OAuth2 token.","type":[[["Snowflake"]]]},{"name":"scopes","description":"The scopes that were granted to this token.","type":[[["Array","<"],["string",">"]]]},{"name":"deauthorize","description":"Function to revoke this token.","type":[[["function"]]]}],"meta":{"line":818,"file":"Client.js","path":"src/client"}},{"name":"JoinChannelConfig","type":[[["Object"]]],"props":[{"name":"selfMute","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"selfDeaf","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"selfVideo","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"videoCodec","optional":true,"default":"'H264'","type":[[["VideoCodec"]]]}],"meta":{"line":88,"file":"ClientVoiceManager.js","path":"src/client/voice"}},{"name":"ReceiveStreamOptions","description":"Options passed to `VoiceReceiver#createStream`.","type":[[["Object"]]],"props":[{"name":"mode","description":"The mode for audio output. This defaults to opus, meaning discord.js won't decode\nthe packets for you. You can set this to 'pcm' so that the stream's output will be 16-bit little-endian stereo\naudio","optional":true,"default":"'opus'","type":[[["string"]]]},{"name":"end","description":"When the stream should be destroyed. If `silence`, this will be when the user\nstops talking. Otherwise, if `manual`, this should be handled by you.","optional":true,"default":"'silence'","type":[[["string"]]]},{"name":"paddingSilence","description":"Whether to add silence padding\nIf 'end' is set to 'silence', this property automatically defaults to `false`","optional":true,"default":false,"type":[[["boolean"]]]}],"meta":{"line":29,"file":"Receiver.js","path":"src/client/voice/receiver"}},{"name":"InterfaceAddresses","type":[[["Object"]]],"props":[{"name":"udp4","description":"IPv4 address","optional":true,"type":[[["string"]]]},{"name":"udp6","description":"IPv6 address","optional":true,"type":[[["string"]]]}],"meta":{"line":6,"file":"Function.js","path":"src/client/voice/util"}},{"name":"StreamOptions","description":"Options that can be passed to stream-playing methods:","type":[[["Object"]]],"props":[{"name":"type","description":"The type of stream.","optional":true,"default":"'unknown'","type":[[["StreamType"]]]},{"name":"seek","description":"The time to seek to, will be ignored when playing `ogg/opus` or `webm/opus` streams","optional":true,"default":0,"type":[[["number"]]]},{"name":"volume","description":"The volume to play at. Set this to false to disable volume transforms for\nthis stream to improve performance.","optional":true,"default":1,"type":[[["number"]],[["boolean"]]]},{"name":"plp","description":"Expected packet loss percentage","optional":true,"type":[[["number"]]]},{"name":"fec","description":"Enabled forward error correction","optional":true,"type":[[["boolean"]]]},{"name":"bitrate","description":"The bitrate (quality) of the audio in kbps.\nIf set to 'auto', the voice channel's bitrate will be used","optional":true,"default":96,"type":[[["number"]],[["string"]]]},{"name":"highWaterMark","description":"The maximum number of opus packets to make and store before they are\nactually needed. See https://nodejs.org/en/docs/guides/backpressuring-in-streams/. Setting this value to\n1 means that changes in volume will be more instant.","optional":true,"default":12,"type":[[["number"]]]}],"meta":{"line":7,"file":"PlayInterface.js","path":"src/client/voice/util"}},{"name":"StreamType","description":"An option passed as part of `StreamOptions` specifying the type of the stream.\n* `unknown`: The default type, streams/input will be passed through to ffmpeg before encoding.\nWill play most streams.\n* `converted`: Play a stream of 16bit signed stereo PCM data, skipping ffmpeg.\n* `opus`: Play a stream of opus packets, skipping ffmpeg. You lose the ability to alter volume.\n* `ogg/opus`: Play an ogg file with the opus encoding, skipping ffmpeg. You lose the ability to alter volume.\n* `webm/opus`: Play a webm file with opus audio, skipping ffmpeg. You lose the ability to alter volume.","type":[[["string"]]],"meta":{"line":23,"file":"PlayInterface.js","path":"src/client/voice/util"}},{"name":"VideoOptions","description":"Options that can be passed to stream-playing methods:","type":[[["Object"]]],"props":[{"name":"seek","description":"The time to seek to","optional":true,"default":0,"type":[[["number"]]]},{"name":"fps","description":"Video fps","optional":true,"type":[[["number"]]]},{"name":"highWaterMark","description":"The maximum number of opus packets to make and store before they are\nactually needed. See https://nodejs.org/en/docs/guides/backpressuring-in-streams/. Setting this value to\n1 means that changes in volume will be more instant.","optional":true,"default":12,"type":[[["number"]]]},{"name":"presetH26x","description":"ffmpeg preset h264","optional":true,"default":"'veryfast'","type":[[["ultrafast","'"]],[["superfast","'"]],[["veryfast","'"]],[["faster","'"]],[["fast","'"]],[["medium","'"]],[["slow","'"]],[["slower","'"]],[["veryslow","'"]]]},{"name":"hwAccel","description":"Enables hardware accelerated video decoding. Enabling this option might result in an exception\nbeing thrown by Ffmpeg process if your system does not support hardware acceleration","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"inputFFmpegArgs","description":"input ffmpeg\nEx: ['-config1', 'value1', '-config2', 'value2']","optional":true,"type":[[["Array","<"],["string",">"]]]},{"name":"outputFFmpegArgs","description":"output ffmpeg\nEx: ['-config1', 'value1', '-config2', 'value2']","optional":true,"type":[[["Array","<"],["string",">"]]]},{"name":"bitrate","description":"The bitrate (quality) of the video in kbps.\nIf set to 'auto', ffmpeg will automatically select","optional":true,"default":2000,"type":[[["number"]],[["auto","'"]]]}],"meta":{"line":77,"file":"PlayInterface.js","path":"src/client/voice/util"}},{"name":"VideoCodec","description":"Video codec\n* `VP8`\n* `VP9` (Not supported for encoding & decoding)\n* `H264`\n* `H265` (Not supported for encoding & decoding)\n* `AV1` (Not supported for encoding & decoding)","type":[[["string"]]],"meta":{"line":142,"file":"VoiceConnection.js","path":"src/client/voice"}},{"name":"WebhookClientData","description":"The data for the webhook client containing either an id and token or just a URL","type":[[["Object"]]],"props":[{"name":"id","description":"The id of the webhook","optional":true,"type":[[["Snowflake"]]]},{"name":"token","description":"The token of the webhook","optional":true,"type":[[["string"]]]},{"name":"url","description":"The full URL for the webhook client","optional":true,"type":[[["string"]]]}],"meta":{"line":13,"file":"WebhookClient.js","path":"src/client"}},{"name":"GuildMembersChunk","description":"Represents the properties of a guild members chunk","type":[[["Object"]]],"props":[{"name":"index","description":"Index of the received chunk","type":[[["number"]]]},{"name":"count","description":"Number of chunks the client should receive","type":[[["number"]]]},{"name":"nonce","description":"Nonce for this chunk","nullable":true,"type":[[["string"]]]},{"name":"notFound","description":"An array of whatever could not be found\nwhen using {@link Opcodes.REQUEST_GUILD_MEMBERS}","type":[[["Array","<"],["*",">"]]]}],"meta":{"line":16,"file":"GUILD_MEMBERS_CHUNK.js","path":"src/client/websocket/handlers"}},{"name":"RelationshipUpdateObject","type":[[["Object"]]],"props":[{"name":"type","description":"The type of relationship","type":[[["RelationshipType"]]]},{"name":"since","description":"When the user requested a relationship","type":[[["Date"]]]},{"name":"nickname","description":"The nickname of the user in this relationship (1-32 characters)","type":[[["string"]],[["null"]]]}],"meta":{"line":6,"file":"RELATIONSHIP_UPDATE.js","path":"src/client/websocket/handlers"}},{"name":"ApplicationCommandResolvable","description":"Data that resolves to give an ApplicationCommand object. This can be:\n* An ApplicationCommand object\n* A Snowflake","type":[[["ApplicationCommand"]],[["Snowflake"]]],"meta":{"line":51,"file":"ApplicationCommandManager.js","path":"src/managers"}},{"name":"ApplicationCommandDataResolvable","description":"Data that resolves to the data of an ApplicationCommand","type":[[["ApplicationCommandData"]],[["APIApplicationCommand"]],[["SlashCommandBuilder"]],[["ContextMenuCommandBuilder"]]],"meta":{"line":59,"file":"ApplicationCommandManager.js","path":"src/managers"}},{"name":"BaseFetchOptions","description":"Options used to fetch data from Discord","type":[[["Object"]]],"props":[{"name":"cache","description":"Whether to cache the fetched data if it wasn't already","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":false,"type":[[["boolean"]]]}],"meta":{"line":65,"file":"ApplicationCommandManager.js","path":"src/managers"}},{"name":"FetchApplicationCommandOptions","description":"Options used to fetch Application Commands from Discord","type":[[["BaseFetchOptions"]]],"props":[{"name":"guildId","description":"The guild's id to fetch commands for, for when the guild is not cached","optional":true,"type":[[["Snowflake"]]]},{"name":"locale","description":"The locale to use when fetching this command","optional":true,"type":[[["LocaleString"]]]},{"name":"withLocalizations","description":"Whether to fetch all localization data","optional":true,"type":[[["boolean"]]]}],"meta":{"line":72,"file":"ApplicationCommandManager.js","path":"src/managers"}},{"name":"ApplicationCommandPermissionData","description":"Data for setting the permissions of an application command.","type":[[["Object"]]],"props":[{"name":"id","description":"The role or user's id","type":[[["Snowflake"]]]},{"name":"type","description":"Whether this permission is for a role or a user","type":[[["ApplicationCommandPermissionType"]],[["number"]]]},{"name":"permission","description":"Whether the role or user has the permission to use this command","type":[[["boolean"]]]}],"meta":{"line":53,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"ApplicationCommandPermissions","description":"The object returned when fetching permissions for an application command.","type":[[["Object"]]],"props":[{"name":"id","description":"The role or user's id","type":[[["Snowflake"]]]},{"name":"type","description":"Whether this permission is for a role or a user","type":[[["ApplicationCommandPermissionType"]]]},{"name":"permission","description":"Whether the role or user has the permission to use this command","type":[[["boolean"]]]}],"meta":{"line":61,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"BaseApplicationCommandPermissionsOptions","description":"Options for managing permissions for one or more Application Commands\nWhen passing these options to a manager where `guildId` is `null`,\n`guild` is a required parameter","type":[[["Object"]]],"props":[{"name":"guild","description":"The guild to modify / check permissions for\nIgnored when the manager has a non-null `guildId` property","optional":true,"type":[[["GuildResolvable"]]]},{"name":"command","description":"The command to modify / check permissions for\nIgnored when the manager has a non-null `commandId` property","optional":true,"type":[[["ApplicationCommandResolvable"]]]}],"meta":{"line":69,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"GuildApplicationCommandPermissionData","description":"Data used for overwriting the permissions for all application commands in a guild.","type":[[["Object"]]],"props":[{"name":"id","description":"The command's id","type":[[["Snowflake"]]]},{"name":"permissions","description":"The permissions for this command","type":[[["Array","<"],["ApplicationCommandPermissionData",">"]]]}],"meta":{"line":113,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"SetApplicationCommandPermissionsOptions","description":"Options used to set permissions for one or more Application Commands in a guild\nOne of `command` AND `permissions`, OR `fullPermissions` is required.\n`fullPermissions` is not a valid option when passing to a manager where `commandId` is non-null","type":[[["BaseApplicationCommandPermissionsOptions"]]],"props":[{"name":"permissions","description":"The new permissions for the command","optional":true,"type":[[["Array","<"],["ApplicationCommandPermissionData",">"]]]},{"name":"fullPermissions","description":"The new permissions for all commands\nin a guild When this parameter is set, `permissions` and `command` are ignored","optional":true,"type":[[["Array","<"],["GuildApplicationCommandPermissionData",">"]]]}],"meta":{"line":120,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"AddApplicationCommandPermissionsOptions","description":"Options used to add permissions to a command\nThe `command` parameter is not optional when the managers `commandId` is `null`","type":[[["BaseApplicationCommandPermissionsOptions"]]],"props":[{"name":"permissions","description":"The permissions to add to the command","type":[[["Array","<"],["ApplicationCommandPermissionData",">"]]]}],"meta":{"line":199,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"RemoveApplicationCommandPermissionsOptions","description":"Options used to remove permissions from a command\nThe `command` parameter is not optional when the managers `commandId` is `null`","type":[[["BaseApplicationCommandPermissionsOptions"]]],"props":[{"name":"users","description":"The user(s) to remove from the command permissions\nOne of `users` or `roles` is required","optional":true,"type":[[["UserResolvable"]],[["Array","<"],["UserResolvable",">"]]]},{"name":"roles","description":"The role(s) to remove from the command permissions\nOne of `users` or `roles` is required","optional":true,"type":[[["RoleResolvable"]],[["Array","<"],["RoleResolvable",">"]]]}],"meta":{"line":246,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"HasApplicationCommandPermissionsOptions","description":"Options used to check the existence of permissions on a command\nThe `command` parameter is not optional when the managers `commandId` is `null`","type":[[["BaseApplicationCommandPermissionsOptions"]]],"props":[{"name":"permissionId","description":"The user or role to check if a permission exists for\non this command.","type":[[["UserResolvable"]],[["RoleResolvable"]]]}],"meta":{"line":330,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"AutoModerationTriggerMetadataOptions","description":"Options used to set the trigger metadata of an auto moderation rule.","type":[[["Object"]]],"props":[{"name":"keywordFilter","description":"The substrings that will be searched for in the content","optional":true,"type":[[["Array","<"],["string",">"]]]},{"name":"regexPatterns","description":"The regular expression patterns which will be matched against the content\nOnly Rust-flavored regular expressions are supported.","optional":true,"type":[[["Array","<"],["string",">"]]]},{"name":"presets","description":"The internally pre-defined wordsets which will be searched for in the content","optional":true,"type":[[["Array","<"],["AutoModerationRuleKeywordPresetType",">"]]]},{"name":"allowList","description":"The substrings that will be exempt from triggering\n{@link AutoModerationRuleTriggerType.KEYWORD} and {@link AutoModerationRuleTriggerType.KEYWORD_PRESET}","optional":true,"type":[[["Array","<"],["string",">"]]]},{"name":"mentionTotalLimit","description":"The total number of role & user mentions allowed per message","optional":true,"nullable":true,"type":[[["number"]]]},{"name":"mentionRaidProtectionEnabled","description":"Whether to automatically detect mention raids","optional":true,"type":[[["boolean"]]]}],"meta":{"line":50,"file":"AutoModerationRuleManager.js","path":"src/managers"}},{"name":"AutoModerationActionOptions","description":"Options used to set the actions of an auto moderation rule.","type":[[["Object"]]],"props":[{"name":"type","description":"The type of this auto moderation rule action","type":[[["AutoModerationActionType"]]]},{"name":"metadata","description":"Additional metadata needed during execution\nThis property is required if using a `type` of\n{@link AutoModerationActionType.SEND_ALERT_MESSAGE} or {@link AutoModerationActionType.TIMEOUT}.","optional":true,"type":[[["AutoModerationActionMetadataOptions"]]]}],"meta":{"line":64,"file":"AutoModerationRuleManager.js","path":"src/managers"}},{"name":"AutoModerationActionMetadataOptions","description":"Options used to set the metadata of an auto moderation rule action.","type":[[["Object"]]],"props":[{"name":"channel","description":"The channel to which content will be logged","optional":true,"type":[[["GuildTextChannelResolvable"]],[["ThreadChannel"]]]},{"name":"durationSeconds","description":"The timeout duration in seconds","optional":true,"type":[[["number"]]]},{"name":"customMessage","description":"The custom message that is shown whenever a message is blocked","optional":true,"type":[[["string"]]]}],"meta":{"line":73,"file":"AutoModerationRuleManager.js","path":"src/managers"}},{"name":"AutoModerationRuleCreateOptions","description":"Options used to create an auto moderation rule.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the auto moderation rule","type":[[["string"]]]},{"name":"eventType","description":"The event type of the auto moderation rule","type":[[["AutoModerationRuleEventType"]]]},{"name":"triggerType","description":"The trigger type of the auto moderation rule","type":[[["AutoModerationRuleTriggerType"]]]},{"name":"triggerMetadata","description":"The trigger metadata of the auto moderation rule\nThis property is required if the following `triggerType`s are used:\n* {@link AutoModerationRuleTriggerType.KEYWORD KEYWORD}\n* {@link AutoModerationRuleTriggerType.KEYWORD_PRESET KEYWORD_PRESET}\n* {@link AutoModerationRuleTriggerType.MENTION_SPAM MENTION_SPAM}\n","optional":true,"type":[[["AutoModerationTriggerMetadataOptions"]]]},{"name":"actions","description":"The actions that will execute when the auto moderation rule is triggered","type":[[["Array","<"],["AutoModerationActionOptions",">"]]]},{"name":"enabled","description":"Whether the auto moderation rule should be enabled","optional":true,"type":[[["boolean"]]]},{"name":"exemptRoles","description":"The roles that should not be affected by the auto moderation rule","optional":true,"type":[[["Collection","<"],["Snowflake",", "],["Role",">"]],[["Array","<"],["RoleResolvable",">"]]]},{"name":"exemptChannels","description":"The channels that should not be affected by the auto moderation rule","optional":true,"type":[[["Collection","<"],["Snowflake",", ("],["GuildChannel","|"],["ThreadChannel",")>"]],[["Array","<"],["GuildChannelResolvable",">"]]]},{"name":"reason","description":"The reason for creating the auto moderation rule","optional":true,"type":[[["string"]]]}],"meta":{"line":81,"file":"AutoModerationRuleManager.js","path":"src/managers"}},{"name":"AutoModerationRuleEditOptions","description":"Options used to edit an auto moderation rule.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the auto moderation rule","optional":true,"type":[[["string"]]]},{"name":"eventType","description":"The event type of the auto moderation rule","optional":true,"type":[[["AutoModerationRuleEventType"]]]},{"name":"triggerMetadata","description":"The trigger metadata of the auto moderation rule","optional":true,"type":[[["AutoModerationTriggerMetadataOptions"]]]},{"name":"actions","description":"The actions that will execute when the auto moderation rule is triggered","optional":true,"type":[[["Array","<"],["AutoModerationActionOptions",">"]]]},{"name":"enabled","description":"Whether the auto moderation rule should be enabled","optional":true,"type":[[["boolean"]]]},{"name":"exemptRoles","description":"The roles that should not be affected by the auto moderation rule","optional":true,"type":[[["Collection","<"],["Snowflake",", "],["Role",">"]],[["Array","<"],["RoleResolvable",">"]]]},{"name":"exemptChannels","description":"The channels that should not be affected by the auto moderation rule","optional":true,"type":[[["Collection","<"],["Snowflake",", ("],["GuildChannel","|"],["ThreadChannel",")>"]],[["Array","<"],["GuildChannelResolvable",">"]]]},{"name":"reason","description":"The reason for creating the auto moderation rule","optional":true,"type":[[["string"]]]}],"meta":{"line":152,"file":"AutoModerationRuleManager.js","path":"src/managers"}},{"name":"AutoModerationRuleResolvable","description":"Data that can be resolved to give an AutoModerationRule object. This can be:\n* An AutoModerationRule\n* A Snowflake","type":[[["AutoModerationRule"]],[["Snowflake"]]],"meta":{"line":215,"file":"AutoModerationRuleManager.js","path":"src/managers"}},{"name":"FetchAutoModerationRuleOptions","description":"Options used to fetch a single auto moderation rule from a guild.","type":[[["BaseFetchOptions"]]],"props":[{"name":"autoModerationRule","description":"The auto moderation rule to fetch","type":[[["AutoModerationRuleResolvable"]]]}],"meta":{"line":222,"file":"AutoModerationRuleManager.js","path":"src/managers"}},{"name":"FetchAutoModerationRulesOptions","description":"Options used to fetch all auto moderation rules from a guild.","type":[[["Object"]]],"props":[{"name":"cache","description":"Whether to cache the fetched auto moderation rules","optional":true,"type":[[["boolean"]]]}],"meta":{"line":228,"file":"AutoModerationRuleManager.js","path":"src/managers"}},{"name":"EmojiResolvable","description":"Data that can be resolved into a GuildEmoji object. This can be:\n* A Snowflake\n* A GuildEmoji object\n* A ReactionEmoji object","type":[[["Snowflake"]],[["GuildEmoji"]],[["ReactionEmoji"]]],"meta":{"line":23,"file":"BaseGuildEmojiManager.js","path":"src/managers"}},{"name":"EmojiIdentifierResolvable","description":"Data that can be resolved to give an emoji identifier. This can be:\n* An EmojiResolvable\n* The ``, `<:name:id>`, `a:name:id` or `name:id` emoji identifier string of an emoji\n* The Unicode representation of an emoji","type":[[["string"]],[["EmojiResolvable"]]],"meta":{"line":51,"file":"BaseGuildEmojiManager.js","path":"src/managers"}},{"name":"ChannelResolvable","description":"Data that can be resolved to give a Channel object. This can be:\n* A Channel object\n* A Snowflake","type":[[["Channel"]],[["Snowflake"]]],"meta":{"line":75,"file":"ChannelManager.js","path":"src/managers"}},{"name":"FetchChannelOptions","description":"Options for fetching a channel from Discord","type":[[["BaseFetchOptions"]]],"props":[{"name":"allowUnknownGuild","description":"Allows the channel to be returned even if the guild is not in cache,\nit will not be cached. Many of the properties and methods on the returned channel will throw errors","optional":true,"default":false,"type":[[["boolean"]]]}],"meta":{"line":100,"file":"ChannelManager.js","path":"src/managers"}},{"name":"CustomStatusOption","description":"CustomStatus Object","type":[[["Object"]]],"props":[{"name":"text","description":"Text to set","type":[[["string"]],[["null"]]]},{"name":"status","description":"The status to set: 'online', 'idle', 'dnd', 'invisible' or null.","type":[[["string"]],[["null"]]]},{"name":"emoji","description":"UnicodeEmoji, DiscordEmoji, or null.","type":[[["EmojiResolvable"]],[["null"]]]},{"name":"expires","description":"The number of seconds until the status expires, or null.","type":[[["number"]],[["null"]]]}],"meta":{"line":264,"file":"ClientUserSettingManager.js","path":"src/managers"}},{"name":"GuildBanResolvable","description":"Data that resolves to give a GuildBan object. This can be:\n* A GuildBan object\n* A User resolvable","type":[[["GuildBan"]],[["UserResolvable"]]],"meta":{"line":37,"file":"GuildBanManager.js","path":"src/managers"}},{"name":"FetchBanOptions","description":"Options used to fetch a single ban from a guild.","type":[[["BaseFetchOptions"]]],"props":[{"name":"user","description":"The ban to fetch","type":[[["UserResolvable"]]]}],"meta":{"line":53,"file":"GuildBanManager.js","path":"src/managers"}},{"name":"FetchBansOptions","description":"Options used to fetch multiple bans from a guild.","type":[[["Object"]]],"props":[{"name":"limit","description":"The maximum number of bans to return","optional":true,"type":[[["number"]]]},{"name":"before","description":"Consider only bans before this id","optional":true,"type":[[["Snowflake"]]]},{"name":"after","description":"Consider only bans after this id","optional":true,"type":[[["Snowflake"]]]},{"name":"cache","description":"Whether to cache the fetched bans","optional":true,"type":[[["boolean"]]]}],"meta":{"line":59,"file":"GuildBanManager.js","path":"src/managers"}},{"name":"BanOptions","description":"Options used to ban a user from a guild.","type":[[["Object"]]],"props":[{"name":"days","description":"Number of days of messages to delete, must be between 0 and 7, inclusive\nThis property is deprecated. Use `deleteMessageSeconds` instead.","optional":true,"default":0,"type":[[["number"]]]},{"name":"deleteMessageSeconds","description":"Number of seconds of messages to delete,\nmust be between 0 and 604800 (7 days), inclusive","optional":true,"type":[[["number"]]]},{"name":"reason","description":"The reason for the ban","optional":true,"type":[[["string"]]]}],"meta":{"line":128,"file":"GuildBanManager.js","path":"src/managers"}},{"name":"BulkBanOptions","description":"Options used for bulk banning users from a guild.","type":[[["Object"]]],"props":[{"name":"deleteMessageSeconds","description":"Number of seconds of messages to delete,\nmust be between 0 and 604800 (7 days), inclusive","optional":true,"type":[[["number"]]]},{"name":"reason","description":"The reason for the bans","optional":true,"type":[[["string"]]]}],"meta":{"line":203,"file":"GuildBanManager.js","path":"src/managers"}},{"name":"BulkBanResult","description":"Result of bulk banning users from a guild.","type":[[["Object"]]],"props":[{"name":"bannedUsers","description":"IDs of the banned users","type":[[["Array","<"],["Snowflake",">"]]]},{"name":"failedUsers","description":"IDs of the users that could not be banned or were already banned","type":[[["Array","<"],["Snowflake",">"]]]}],"meta":{"line":211,"file":"GuildBanManager.js","path":"src/managers"}},{"name":"GuildChannelResolvable","description":"Data that can be resolved to give a Guild Channel object. This can be:\n* A GuildChannel object\n* A ThreadChannel object\n* A Snowflake","type":[[["GuildChannel"]],[["ThreadChannel"]],[["Snowflake"]]],"meta":{"line":78,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"GuildChannelCreateOptions","description":"Options used to create a new channel in a guild.","type":[[["CategoryCreateChannelOptions"]]],"props":[{"name":"parent","description":"Parent of the new channel","optional":true,"type":[[["CategoryChannelResolvable"]]]}],"meta":{"line":106,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"ChannelData","description":"The data for a guild channel.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the channel","optional":true,"type":[[["string"]]]},{"name":"type","description":"The type of the channel (only conversion between text and news is supported)","optional":true,"type":[[["ChannelType"]]]},{"name":"position","description":"The position of the channel","optional":true,"type":[[["number"]]]},{"name":"topic","description":"The topic of the text channel","optional":true,"type":[[["string"]]]},{"name":"nsfw","description":"Whether the channel is NSFW","optional":true,"type":[[["boolean"]]]},{"name":"bitrate","description":"The bitrate of the voice channel","optional":true,"type":[[["number"]]]},{"name":"userLimit","description":"The user limit of the voice channel","optional":true,"type":[[["number"]]]},{"name":"parent","description":"The parent of the channel","optional":true,"nullable":true,"type":[[["CategoryChannelResolvable"]]]},{"name":"lockPermissions","description":"Lock the permissions of the channel to what the parent's permissions are","optional":true,"type":[[["boolean"]]]},{"name":"permissionOverwrites","description":"Permission overwrites for the channel","optional":true,"type":[[["Array","<"],["OverwriteResolvable",">"]],[["Collection","<"],["Snowflake",", "],["OverwriteResolvable",">"]]]},{"name":"rateLimitPerUser","description":"The rate limit per user (slowmode) for the channel in seconds","optional":true,"type":[[["number"]]]},{"name":"defaultAutoArchiveDuration","description":"The default auto archive duration for all new threads in this channel","optional":true,"type":[[["ThreadAutoArchiveDuration"]]]},{"name":"rtcRegion","description":"The RTC region of the channel","optional":true,"nullable":true,"type":[[["string"]]]},{"name":"videoQualityMode","description":"The camera video quality mode of the channel","optional":true,"type":[[["VideoQualityMode"]],[["number"]]]},{"name":"flags","description":"The flags to set on the channel","optional":true,"type":[[["ChannelFlagsResolvable"]]]},{"name":"availableTags","description":"The tags to set as available in a forum channel","optional":true,"type":[[["Array","<"],["GuildForumTagData",">"]]]},{"name":"defaultReactionEmoji","description":"The emoji to set as the default reaction emoji","optional":true,"nullable":true,"type":[[["DefaultReactionEmoji"]]]},{"name":"defaultThreadRateLimitPerUser","description":"The rate limit per user (slowmode) to set on forum posts","optional":true,"type":[[["number"]]]},{"name":"defaultSortOrder","description":"The default sort order mode to set on the channel","optional":true,"nullable":true,"type":[[["SortOrderType"]]]}],"meta":{"line":250,"file":"GuildChannelManager.js","path":"src/managers"}},{"name":"CategoryChannelResolvable","description":"Data that can be resolved to give a Category Channel object. This can be:\n* A CategoryChannel object\n* A Snowflake","type":[[["CategoryChannel"]],[["Snowflake"]]],"meta":{"line":1307,"file":"Guild.js","path":"src/structures"}},{"name":"ChannelPosition","description":"The data needed for updating a channel's position.","type":[[["Object"]]],"props":[{"name":"channel","description":"Channel to update","type":[[["GuildChannel"]],[["Snowflake"]]]},{"name":"position","description":"New position for the channel","optional":true,"type":[[["number"]]]},{"name":"parent","description":"Parent channel for this channel","optional":true,"type":[[["CategoryChannelResolvable"]]]},{"name":"lockPermissions","description":"If the overwrites should be locked to the parents overwrites","optional":true,"type":[[["boolean"]]]}],"meta":{"line":1314,"file":"Guild.js","path":"src/structures"}},{"name":"GuildEmojiCreateOptions","description":"Options used for creating an emoji in a guild.","type":[[["Object"]]],"props":[{"name":"roles","description":"The roles to limit the emoji to","optional":true,"type":[[["Collection","<"],["Snowflake",", "],["Role",">"]],[["Array","<"],["RoleResolvable",">"]]]},{"name":"reason","description":"The reason for creating the emoji","optional":true,"type":[[["string"]]]}],"meta":{"line":28,"file":"GuildEmojiManager.js","path":"src/managers"}},{"name":"GuildForumThreadMessageCreateOptions","type":[[["BaseMessageOptions"]]],"props":[{"name":"stickers","description":"The stickers to send with the message","optional":true,"type":[[["StickerResolvable"]]]},{"name":"flags","description":"The flags to send with the message.\nOnly `SUPPRESS_EMBEDS` and `SUPPRESS_NOTIFICATIONS` can be set.","optional":true,"type":[[["BitFieldResolvable"]]]}],"meta":{"line":19,"file":"GuildForumThreadManager.js","path":"src/managers"}},{"name":"GuildForumThreadCreateOptions","description":"Options for creating a thread.","type":[[["StartThreadOptions"]]],"props":[{"name":"message","description":"The message associated with the thread post","type":[[["GuildForumThreadMessageCreateOptions"]],[["MessagePayload"]]]},{"name":"appliedTags","description":"The tags to apply to the thread","optional":true,"type":[[["Array","<"],["Snowflake",">"]]]}],"meta":{"line":26,"file":"GuildForumThreadManager.js","path":"src/managers"}},{"name":"InviteResolvable","description":"Data that can be resolved to give an invite code. This can be:\n* An invite code\n* An invite URL","type":[[["string"]]],"meta":{"line":16,"file":"DataResolver.js","path":"src/util"}},{"name":"GuildInvitableChannelResolvable","description":"Data that can be resolved to a channel that an invite can be created on. This can be:\n* TextChannel\n* VoiceChannel\n* NewsChannel\n* StoreChannel\n* StageChannel\n* Snowflake","type":[[["TextChannel"]],[["VoiceChannel"]],[["NewsChannel"]],[["StoreChannel"]],[["StageChannel"]],[["Snowflake"]]],"meta":{"line":41,"file":"GuildInviteManager.js","path":"src/managers"}},{"name":"FetchInviteOptions","description":"Options used to fetch a single invite from a guild.","type":[[["Object"]]],"props":[{"name":"code","description":"The invite to fetch","type":[[["InviteResolvable"]]]},{"name":"cache","description":"Whether or not to cache the fetched invite","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":false,"type":[[["boolean"]]]}],"meta":{"line":71,"file":"GuildInviteManager.js","path":"src/managers"}},{"name":"FetchInvitesOptions","description":"Options used to fetch all invites from a guild.","type":[[["Object"]]],"props":[{"name":"channelId","description":"The channel to fetch all invites from","optional":true,"type":[[["GuildInvitableChannelResolvable"]]]},{"name":"cache","description":"Whether or not to cache the fetched invites","optional":true,"default":true,"type":[[["boolean"]]]}],"meta":{"line":79,"file":"GuildInviteManager.js","path":"src/managers"}},{"name":"GuildResolvable","description":"Data that resolves to give a Guild object. This can be:\n* A Guild object\n* A GuildChannel object\n* A GuildEmoji object\n* A Role object\n* A Snowflake\n* An Invite object","type":[[["Guild"]],[["GuildChannel"]],[["GuildMember"]],[["GuildEmoji"]],[["Role"]],[["Snowflake"]],[["Invite"]]],"meta":{"line":53,"file":"GuildManager.js","path":"src/managers"}},{"name":"PartialRoleData","description":"Partial data for a Role.","type":[[["Object"]]],"props":[{"name":"id","description":"The role's id, used to set channel overrides,\nthis is a placeholder and will be replaced by the API after consumption","optional":true,"type":[[["Snowflake"]],[["number"]]]},{"name":"name","description":"The name of the role","optional":true,"type":[[["string"]]]},{"name":"color","description":"The color of the role, either a hex string or a base 10 number","optional":true,"type":[[["ColorResolvable"]]]},{"name":"hoist","description":"Whether or not the role should be hoisted","optional":true,"type":[[["boolean"]]]},{"name":"position","description":"The position of the role","optional":true,"type":[[["number"]]]},{"name":"permissions","description":"The permissions of the role","optional":true,"type":[[["PermissionResolvable"]]]},{"name":"mentionable","description":"Whether or not the role should be mentionable","optional":true,"type":[[["boolean"]]]}],"meta":{"line":64,"file":"GuildManager.js","path":"src/managers"}},{"name":"PartialOverwriteData","description":"Partial overwrite data.","type":[[["Object"]]],"props":[{"name":"id","description":"The id of the {@link Role} or {@link User} this overwrite belongs to","type":[[["Snowflake"]],[["number"]]]},{"name":"type","description":"The type of this overwrite","optional":true,"type":[[["OverwriteType"]]]},{"name":"allow","description":"The permissions to allow","optional":true,"type":[[["PermissionResolvable"]]]},{"name":"deny","description":"The permissions to deny","optional":true,"type":[[["PermissionResolvable"]]]}],"meta":{"line":77,"file":"GuildManager.js","path":"src/managers"}},{"name":"PartialChannelData","description":"Partial data for a Channel.","type":[[["Object"]]],"props":[{"name":"id","description":"The channel's id, used to set its parent,\nthis is a placeholder and will be replaced by the API after consumption","optional":true,"type":[[["Snowflake"]],[["number"]]]},{"name":"parentId","description":"The parent id for this channel","optional":true,"type":[[["Snowflake"]],[["number"]]]},{"name":"type","description":"The type of the channel","optional":true,"type":[[["ChannelType"]],[["number"]]]},{"name":"name","description":"The name of the channel","type":[[["string"]]]},{"name":"topic","description":"The topic of the text channel","optional":true,"type":[[["string"]]]},{"name":"nsfw","description":"Whether the channel is NSFW","optional":true,"type":[[["boolean"]]]},{"name":"bitrate","description":"The bitrate of the voice channel","optional":true,"type":[[["number"]]]},{"name":"userLimit","description":"The user limit of the channel","optional":true,"type":[[["number"]]]},{"name":"rtcRegion","description":"The RTC region of the channel","optional":true,"nullable":true,"type":[[["string"]]]},{"name":"videoQualityMode","description":"The camera video quality mode of the channel","optional":true,"type":[[["VideoQualityMode"]],[["number"]]]},{"name":"permissionOverwrites","description":"Overwrites of the channel","optional":true,"type":[[["Array","<"],["PartialOverwriteData",">"]]]},{"name":"rateLimitPerUser","description":"The rate limit per user (slowmode) of the channel in seconds","optional":true,"type":[[["number"]]]}],"meta":{"line":86,"file":"GuildManager.js","path":"src/managers"}},{"name":"GuildCreateOptions","description":"Options used to create a guild.","type":[[["Object"]]],"props":[{"name":"afkChannelId","description":"The AFK channel's id","optional":true,"type":[[["Snowflake"]],[["number"]]]},{"name":"afkTimeout","description":"The AFK timeout in seconds","optional":true,"type":[[["number"]]]},{"name":"channels","description":"The channels for this guild","optional":true,"default":"[]","type":[[["Array","<"],["PartialChannelData",">"]]]},{"name":"defaultMessageNotifications","description":"The default message notifications\nfor the guild","optional":true,"type":[[["DefaultMessageNotificationLevel"]],[["number"]]]},{"name":"explicitContentFilter","description":"The explicit content filter level for the guild","optional":true,"type":[[["ExplicitContentFilterLevel"]]]},{"name":"icon","description":"The icon for the guild","optional":true,"default":null,"nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]},{"name":"roles","description":"The roles for this guild,\nthe first element of this array is used to change properties of the guild's everyone role.","optional":true,"default":"[]","type":[[["Array","<"],["PartialRoleData",">"]]]},{"name":"systemChannelId","description":"The system channel's id","optional":true,"type":[[["Snowflake"]],[["number"]]]},{"name":"systemChannelFlags","description":"The flags of the system channel","optional":true,"type":[[["SystemChannelFlagsResolvable"]]]},{"name":"verificationLevel","description":"The verification level for the guild","optional":true,"type":[[["VerificationLevel"]]]}],"meta":{"line":147,"file":"GuildManager.js","path":"src/managers"}},{"name":"FetchGuildOptions","description":"Options used to fetch a single guild.","type":[[["BaseFetchOptions"]]],"props":[{"name":"guild","description":"The guild to fetch","type":[[["GuildResolvable"]]]},{"name":"withCounts","description":"Whether the approximate member and presence counts should be returned","optional":true,"default":true,"type":[[["boolean"]]]}],"meta":{"line":267,"file":"GuildManager.js","path":"src/managers"}},{"name":"FetchGuildsOptions","description":"Options used to fetch multiple guilds.","type":[[["Object"]]],"props":[{"name":"before","description":"Get guilds before this guild id","optional":true,"type":[[["Snowflake"]]]},{"name":"after","description":"Get guilds after this guild id","optional":true,"type":[[["Snowflake"]]]},{"name":"limit","description":"Maximum number of guilds to request (1-200)","optional":true,"default":200,"type":[[["number"]]]}],"meta":{"line":274,"file":"GuildManager.js","path":"src/managers"}},{"name":"IncidentActionsEditOptions","description":"Options used to set incident actions. Supplying `null` to any option will disable the action.","type":[[["Object"]]],"props":[{"name":"invitesDisabledUntil","description":"When invites should be enabled again","optional":true,"nullable":true,"type":[[["DateResolvable"]]]},{"name":"dmsDisabledUntil","description":"When direct messages should be enabled again","optional":true,"nullable":true,"type":[[["DateResolvable"]]]}],"meta":{"line":304,"file":"GuildManager.js","path":"src/managers"}},{"name":"GuildMemberResolvable","description":"Data that resolves to give a GuildMember object. This can be:\n* A GuildMember object\n* A User resolvable","type":[[["GuildMember"]],[["UserResolvable"]]],"meta":{"line":43,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"AddGuildMemberOptions","description":"Options used to add a user to a guild using OAuth2.","type":[[["Object"]]],"props":[{"name":"accessToken","description":"An OAuth2 access token for the user with the `guilds.join` scope granted to the\nbot's application","type":[[["string"]]]},{"name":"nick","description":"The nickname to give to the member (requires `MANAGE_NICKNAMES`)","optional":true,"type":[[["string"]]]},{"name":"roles","description":"The roles to add to the member\n(requires `MANAGE_ROLES`)","optional":true,"type":[[["Collection","<"],["Snowflake",", "],["Role",">"]],[["Array","<"],["RoleResolvable",">"]]]},{"name":"mute","description":"Whether the member should be muted (requires `MUTE_MEMBERS`)","optional":true,"type":[[["boolean"]]]},{"name":"deaf","description":"Whether the member should be deafened (requires `DEAFEN_MEMBERS`)","optional":true,"type":[[["boolean"]]]},{"name":"force","description":"Whether to skip the cache check and call the API directly","optional":true,"type":[[["boolean"]]]},{"name":"fetchWhenExisting","description":"Whether to fetch the user if not cached and already a member","optional":true,"default":true,"type":[[["boolean"]]]}],"meta":{"line":75,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"FetchMemberOptions","description":"Options used to fetch a single member from a guild.","type":[[["BaseFetchOptions"]]],"props":[{"name":"user","description":"The user to fetch","type":[[["UserResolvable"]]]}],"meta":{"line":139,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"FetchMembersOptions","description":"Options used to fetch multiple members from a guild.","type":[[["Object"]]],"props":[{"name":"user","description":"The user(s) to fetch","type":[[["UserResolvable"]],[["Array","<"],["UserResolvable",">"]]]},{"name":"query","description":"Limit fetch to members with similar usernames","nullable":true,"type":[[["string"]]]},{"name":"limit","description":"Maximum number of members to request","optional":true,"default":0,"type":[[["number"]]]},{"name":"withPresences","description":"Whether or not to include the presences","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"time","description":"Timeout for receipt of members","optional":true,"default":"120e3","type":[[["number"]]]},{"name":"nonce","description":"Nonce for this request (32 characters max - default to base 16 now timestamp)","nullable":true,"type":[[["string"]]]},{"name":"force","description":"Whether to skip the cache check and request the API","optional":true,"default":false,"type":[[["boolean"]]]}],"meta":{"line":145,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"GuildSearchMembersOptions","description":"Options used for searching guild members.","type":[[["Object"]]],"props":[{"name":"query","description":"Filter members whose username or nickname start with this query","type":[[["string"]]]},{"name":"limit","description":"Maximum number of members to search","optional":true,"default":1,"type":[[["number"]]]},{"name":"cache","description":"Whether or not to cache the fetched member(s)","optional":true,"default":true,"type":[[["boolean"]]]}],"meta":{"line":229,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"GuildMemberEditData","description":"The data for editing a guild member.","type":[[["Object"]]],"props":[{"name":"nick","description":"The nickname to set for the member","optional":true,"nullable":true,"type":[[["string"]]]},{"name":"roles","description":"The roles or role ids to apply","optional":true,"type":[[["Collection","<"],["Snowflake",", "],["Role",">"]],[["Array","<"],["RoleResolvable",">"]]]},{"name":"mute","description":"Whether or not the member should be muted","optional":true,"type":[[["boolean"]]]},{"name":"deaf","description":"Whether or not the member should be deafened","optional":true,"type":[[["boolean"]]]},{"name":"channel","description":"Channel to move the member to\n(if they are connected to voice), or `null` if you want to disconnect them from voice","optional":true,"type":[[["GuildVoiceChannelResolvable"]],[["null"]]]},{"name":"communicationDisabledUntil","description":"The date or timestamp\nfor the member's communication to be disabled until. Provide `null` to enable communication again.","optional":true,"type":[[["DateResolvable"]],[["null"]]]},{"name":"flags","description":"The flags to set for the member","optional":true,"type":[[["GuildMemberFlagsResolvable"]]]},{"name":"avatar","description":"The new guild avatar","optional":true,"nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]},{"name":"banner","description":"The new guild banner","optional":true,"nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]},{"name":"bio","description":"The new guild about me","optional":true,"nullable":true,"type":[[["string"]]]}],"meta":{"line":247,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"GuildPruneMembersOptions","description":"Options used for pruning guild members.\nIt's recommended to set {@link GuildPruneMembersOptions#count options.count}\nto `false` for large guilds.","type":[[["Object"]]],"props":[{"name":"days","description":"Number of days of inactivity required to kick","optional":true,"default":7,"type":[[["number"]]]},{"name":"dry","description":"Get the number of users that will be kicked, without actually kicking them","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"count","description":"Whether or not to return the number of users that have been kicked.","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"roles","description":"Array of roles to bypass the \"...and no roles\" constraint when pruning","optional":true,"type":[[["Array","<"],["RoleResolvable",">"]]]},{"name":"reason","description":"Reason for this prune","optional":true,"type":[[["string"]]]}],"meta":{"line":322,"file":"GuildMemberManager.js","path":"src/managers"}},{"name":"GuildScheduledEventResolvable","description":"Data that resolves to give a GuildScheduledEvent object. This can be:\n* A Snowflake\n* A GuildScheduledEvent object","type":[[["Snowflake"]],[["GuildScheduledEvent"]]],"meta":{"line":32,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"GuildScheduledEventRecurrenceRuleOptions","description":"Options for setting a recurrence rule for a guild scheduled event.","type":[[["Object"]]],"props":[{"name":"startAt","description":"The time the recurrence rule interval starts at","type":[[["DateResolvable"]]]},{"name":"frequency","description":"How often the event occurs","type":[[["GuildScheduledEventRecurrenceRuleFrequency"]]]},{"name":"interval","description":"The spacing between the events","type":[[["number"]]]},{"name":"byWeekday","description":"The days within a week to recur on","nullable":true,"type":[[["Array","<"],["GuildScheduledEventRecurrenceRuleWeekday",">"]]]},{"name":"byNWeekday","description":"The days within a week to recur on","nullable":true,"type":[[["Array","<"],["GuildScheduledEventRecurrenceRuleNWeekday",">"]]]},{"name":"byMonth","description":"The months to recur on","nullable":true,"type":[[["Array","<"],["GuildScheduledEventRecurrenceRuleMonth",">"]]]},{"name":"byMonthDay","description":"The days within a month to recur on","nullable":true,"type":[[["Array","<"],["number",">"]]]}],"meta":{"line":39,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"GuildScheduledEventCreateOptions","description":"Options used to create a guild scheduled event.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the guild scheduled event","type":[[["string"]]]},{"name":"scheduledStartTime","description":"The time to schedule the event at","type":[[["DateResolvable"]]]},{"name":"scheduledEndTime","description":"The time to end the event at\nThis is required if `entityType` is 'EXTERNAL'","optional":true,"type":[[["DateResolvable"]]]},{"name":"privacyLevel","description":"The privacy level of the guild scheduled event","type":[[["PrivacyLevel"]],[["number"]]]},{"name":"entityType","description":"The scheduled entity type of the event","type":[[["GuildScheduledEventEntityType"]],[["number"]]]},{"name":"description","description":"The description of the guild scheduled event","optional":true,"type":[[["string"]]]},{"name":"channel","description":"The channel of the guild scheduled event\nThis is required if `entityType` is 'STAGE_INSTANCE' or `VOICE`","optional":true,"type":[[["GuildVoiceChannelResolvable"]]]},{"name":"entityMetadata","description":"The entity metadata of the\nguild scheduled event\nThis is required if `entityType` is 'EXTERNAL'","optional":true,"type":[[["GuildScheduledEventEntityMetadataOptions"]]]},{"name":"image","description":"The cover image of the guild scheduled event","optional":true,"nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]},{"name":"reason","description":"The reason for creating the guild scheduled event","optional":true,"type":[[["string"]]]},{"name":"recurrenceRule","description":"The recurrence rule of the guild scheduled event","optional":true,"type":[[["GuildScheduledEventRecurrenceRuleOptions"]]]}],"meta":{"line":51,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"GuildScheduledEventEntityMetadataOptions","description":"Options used to set entity metadata of a guild scheduled event.","type":[[["Object"]]],"props":[{"name":"location","description":"The location of the guild scheduled event\nThis is required if `entityType` is 'EXTERNAL'","optional":true,"type":[[["string"]]]}],"meta":{"line":72,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"FetchGuildScheduledEventOptions","description":"Options used to fetch a single guild scheduled event from a guild.","type":[[["BaseFetchOptions"]]],"props":[{"name":"guildScheduledEvent","description":"The guild scheduled event to fetch","type":[[["GuildScheduledEventResolvable"]]]},{"name":"withUserCount","description":"Whether to fetch the number of users subscribed to the scheduled event","optional":true,"default":true,"type":[[["boolean"]]]}],"meta":{"line":132,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"FetchGuildScheduledEventsOptions","description":"Options used to fetch multiple guild scheduled events from a guild.","type":[[["Object"]]],"props":[{"name":"cache","description":"Whether or not to cache the fetched guild scheduled events","optional":true,"type":[[["boolean"]]]},{"name":"withUserCount","description":"Whether to fetch the number of users subscribed to each scheduled event\nshould be returned","optional":true,"default":true,"type":[[["boolean"]]]}],"meta":{"line":139,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"GuildScheduledEventEditOptions","description":"Options used to edit a guild scheduled event.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the guild scheduled event","optional":true,"type":[[["string"]]]},{"name":"scheduledStartTime","description":"The time to schedule the event at","optional":true,"type":[[["DateResolvable"]]]},{"name":"scheduledEndTime","description":"The time to end the event at","optional":true,"type":[[["DateResolvable"]]]},{"name":"privacyLevel","description":"The privacy level of the guild scheduled event","optional":true,"type":[[["PrivacyLevel"]],[["number"]]]},{"name":"entityType","description":"The scheduled entity type of the event","optional":true,"type":[[["GuildScheduledEventEntityType"]],[["number"]]]},{"name":"description","description":"The description of the guild scheduled event","optional":true,"type":[[["string"]]]},{"name":"channel","description":"The channel of the guild scheduled event","optional":true,"nullable":true,"type":[[["GuildVoiceChannelResolvable"]]]},{"name":"status","description":"The status of the guild scheduled event","optional":true,"type":[[["GuildScheduledEventStatus"]],[["number"]]]},{"name":"entityMetadata","description":"The entity metadata of the\nguild scheduled event\nThis can be modified only if `entityType` of the `GuildScheduledEvent` to be edited is 'EXTERNAL'","optional":true,"type":[[["GuildScheduledEventEntityMetadataOptions"]]]},{"name":"image","description":"The cover image of the guild scheduled event","optional":true,"nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]},{"name":"reason","description":"The reason for editing the guild scheduled event","optional":true,"type":[[["string"]]]},{"name":"recurrenceRule","description":"The recurrence rule of the guild scheduled event","optional":true,"nullable":true,"type":[[["GuildScheduledEventRecurrenceRuleOptions"]]]}],"meta":{"line":179,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"FetchGuildScheduledEventSubscribersOptions","description":"Options used to fetch subscribers of a guild scheduled event","type":[[["Object"]]],"props":[{"name":"limit","description":"The maximum numbers of users to fetch","optional":true,"type":[[["number"]]]},{"name":"withMember","description":"Whether to fetch guild member data of the users","optional":true,"type":[[["boolean"]]]},{"name":"before","description":"Consider only users before this user id","optional":true,"type":[[["Snowflake"]]]},{"name":"after","description":"Consider only users after this user id\nIf both `before` and `after` are provided, only `before` is respected","optional":true,"type":[[["Snowflake"]]]}],"meta":{"line":268,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"GuildScheduledEventUser","description":"Represents a subscriber of a {@link GuildScheduledEvent}","type":[[["Object"]]],"props":[{"name":"guildScheduledEventId","description":"The id of the guild scheduled event which the user subscribed to","type":[[["Snowflake"]]]},{"name":"user","description":"The user that subscribed to the guild scheduled event","type":[[["User"]]]},{"name":"member","description":"The guild member associated with the user, if any","nullable":true,"type":[[["GuildMember"]]]}],"meta":{"line":278,"file":"GuildScheduledEventManager.js","path":"src/managers"}},{"name":"GuildStickerCreateOptions","description":"Options for creating a guild sticker.","type":[[["Object"]]],"props":[{"name":"description","description":"The description for the sticker","optional":true,"nullable":true,"type":[[["string"]]]},{"name":"reason","description":"Reason for creating the sticker","optional":true,"type":[[["string"]]]}],"meta":{"line":34,"file":"GuildStickerManager.js","path":"src/managers"}},{"name":"StickerResolvable","description":"Data that resolves to give a Sticker object. This can be:\n* A Sticker object\n* A Snowflake","type":[[["Sticker"]],[["Snowflake"]]],"meta":{"line":72,"file":"GuildStickerManager.js","path":"src/managers"}},{"name":"GuildTextThreadCreateOptions","description":"Options for creating a thread. Only one of `startMessage` or `type` can be defined.","type":[[["StartThreadOptions"]]],"props":[{"name":"startMessage","description":"The message to start a thread from. If this is defined then type\nof thread gets automatically defined and cannot be changed. The provided `type` field will be ignored","optional":true,"type":[[["MessageResolvable"]]]},{"name":"type","description":"The type of thread to create. Defaults to `GUILD_PUBLIC_THREAD` if\ncreated in a {@link TextChannel} When creating threads in a {@link NewsChannel} this is ignored and is always\n`GUILD_NEWS_THREAD`","optional":true,"type":[[["ThreadChannelTypes"]],[["number"]]]},{"name":"invitable","description":"Whether non-moderators can add other non-moderators to the thread\nCan only be set when type will be `GUILD_PRIVATE_THREAD`","optional":true,"type":[[["boolean"]]]},{"name":"rateLimitPerUser","description":"The rate limit per user (slowmode) for the new channel in seconds","optional":true,"type":[[["number"]]]}],"meta":{"line":19,"file":"GuildTextThreadManager.js","path":"src/managers"}},{"name":"ChannelLogsQueryOptions","description":"The parameters to pass in when requesting previous messages from a channel. `around`, `before` and\n`after` are mutually exclusive. All the parameters are optional.","type":[[["Object"]]],"props":[{"name":"limit","description":"Number of messages to acquire","optional":true,"default":50,"type":[[["number"]]]},{"name":"before","description":"The message's id to get the messages that were posted before it","optional":true,"type":[[["Snowflake"]]]},{"name":"after","description":"The message's id to get the messages that were posted after it","optional":true,"type":[[["Snowflake"]]]},{"name":"around","description":"The message's id to get the messages that were posted around it","optional":true,"type":[[["Snowflake"]]]}],"meta":{"line":35,"file":"MessageManager.js","path":"src/managers"}},{"name":"MessageResolvable","description":"Data that can be resolved to a Message object. This can be:\n* A Message\n* A Snowflake","type":[[["Message"]],[["Snowflake"]]],"meta":{"line":93,"file":"MessageManager.js","path":"src/managers"}},{"name":"MessageSearchOptions","type":[[["object"]]],"props":[{"name":"authors","description":"An array of author to filter by","optional":true,"type":[[["Array","<"],["UserResolvable",">"]]]},{"name":"mentions","description":"An array of user (mentioned) to filter by","optional":true,"type":[[["Array","<"],["UserResolvable",">"]]]},{"name":"content","description":"A messageContent to filter by","optional":true,"type":[[["string"]]]},{"name":"maxId","description":"The maximum Message ID to filter by","optional":true,"type":[[["Snowflake"]]]},{"name":"minId","description":"The minimum Message ID to filter by","optional":true,"type":[[["Snowflake"]]]},{"name":"channels","description":"An array of channel to filter by","optional":true,"type":[[["Array","<"],["TextChannelResolvable",">"]]]},{"name":"pinned","description":"Whether to filter by pinned messages","optional":true,"type":[[["boolean"]]]},{"name":"has","description":"Message has: `link`, `embed`, `file`, `video`, `image`, or `sound`","optional":true,"type":[[["Array","<"],["string",">"]]]},{"name":"nsfw","description":"Whether to filter by NSFW channels","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"offset","description":"The number of messages to skip (for pagination, 25 results per page)","optional":true,"default":0,"type":[[["number"]]]},{"name":"limit","description":"The number of messages to fetch\nThe maximum limit allowed is 25.","optional":true,"default":25,"type":[[["number"]]]},{"name":"sortBy","description":"The order to sort by (`timestamp` or `relevance`)","optional":true,"type":[[["string"]]]},{"name":"sortOrder","description":"The order to return results in (`asc` or `desc`)\nThe default sort is timestamp in descending order desc (newest first).","optional":true,"type":[[["string"]]]}],"meta":{"line":267,"file":"MessageManager.js","path":"src/managers"}},{"name":"MessageSearchResult","type":[[["object"]]],"props":[{"name":"messages","description":"A collection of found messages","type":[[["Collection","<"],["Snowflake",", "],["Message",">"]]]},{"name":"total","description":"The total number of messages that match the search criteria","type":[[["number"]]]}],"meta":{"line":286,"file":"MessageManager.js","path":"src/managers"}},{"name":"FetchPollAnswerVotersOptions","description":"Options used for fetching voters of an answer in a poll.","type":[[["BaseFetchPollAnswerVotersOptions"]]],"params":[{"name":"messageId","description":"The id of the message","type":[[["Snowflake"]]]},{"name":"answerId","description":"The id of the answer","type":[[["number"]]]}],"meta":{"line":402,"file":"MessageManager.js","path":"src/managers"}},{"name":"GuildChannelOverwriteOptions","description":"Extra information about the overwrite","type":[[["Object"]]],"props":[{"name":"reason","description":"Reason for creating/editing this overwrite","optional":true,"type":[[["string"]]]},{"name":"type","description":"The type of overwrite, either `0` for a role or `1` for a member. Use this to bypass\nautomatic resolution of type that results in an error for uncached structure","optional":true,"type":[[["number"]]]}],"meta":{"line":72,"file":"PermissionOverwriteManager.js","path":"src/managers"}},{"name":"PresenceResolvable","description":"Data that can be resolved to a Presence object. This can be:\n* A Presence\n* A UserResolvable\n* A Snowflake","type":[[["Presence"]],[["UserResolvable"]],[["Snowflake"]]],"meta":{"line":25,"file":"PresenceManager.js","path":"src/managers"}},{"name":"MessageReactionResolvable","description":"Data that can be resolved to a MessageReaction object. This can be:\n* A MessageReaction\n* A Snowflake\n* The Unicode representation of an emoji","type":[[["MessageReaction"]],[["Snowflake"]]],"meta":{"line":31,"file":"ReactionManager.js","path":"src/managers"}},{"name":"FetchReactionUsersOptions","description":"Options used to fetch users who gave a reaction.","type":[[["Object"]]],"props":[{"name":"type","description":"The reaction type to fetch","optional":true,"default":"'NORMAL'","type":[[["ReactionType"]]]},{"name":"limit","description":"The maximum amount of users to fetch, defaults to `100`","optional":true,"default":100,"type":[[["number"]]]},{"name":"after","description":"Limit fetching users to those with an id greater than the supplied id","optional":true,"type":[[["Snowflake"]]]}],"meta":{"line":30,"file":"ReactionUserManager.js","path":"src/managers"}},{"name":"RelationshipJSONData","type":[[["Object"]]],"props":[{"name":"id","description":"The ID of the target user","type":[[["Snowflake"]]]},{"name":"type","description":"The type of relationship","type":[[["RelationshipType"]]]},{"name":"nickname","description":"The nickname of the user in this relationship (1-32 characters)","type":[[["string"]],[["null"]]]},{"name":"since","description":"When the user requested a relationship (ISO8601 timestamp)","type":[[["string"]]]}],"meta":{"line":81,"file":"RelationshipManager.js","path":"src/managers"}},{"name":"RoleResolvable","description":"Data that can be resolved to a Role object. This can be:\n* A Role\n* A Snowflake","type":[[["Role"]],[["Snowflake"]]],"meta":{"line":103,"file":"RoleManager.js","path":"src/managers"}},{"name":"RoleColorsResolvable","type":[[["Object"]]],"props":[{"name":"primaryColor","description":"The primary color of the role","type":[[["ColorResolvable"]]]},{"name":"secondaryColor","description":"The secondary color of the role.\nThis will make the role a gradient between the other provided colors","optional":true,"type":[[["ColorResolvable"]]]},{"name":"tertiaryColor","description":"The tertiary color of the role.\nWhen sending `tertiaryColor` the API enforces the role color to be a holographic style\nwith values of `primaryColor = 11127295`, `secondaryColor = 16759788`, and `tertiaryColor = 16761760`.\nThese values are available as a constant: `Constants.HolographicStyle`","optional":true,"type":[[["ColorResolvable"]]]}],"meta":{"line":128,"file":"RoleManager.js","path":"src/managers"}},{"name":"CreateRoleOptions","description":"Options used to create a new role.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the new role","optional":true,"type":[[["string"]]]},{"name":"color","description":"The data to create the role with\nThis property is deprecated. Use `colors` instead.","optional":true,"type":[[["ColorResolvable"]]]},{"name":"colors","description":"The colors to create the role with","optional":true,"type":[[["RoleColorsResolvable"]]]},{"name":"hoist","description":"Whether or not the new role should be hoisted","optional":true,"type":[[["boolean"]]]},{"name":"permissions","description":"The permissions for the new role","optional":true,"type":[[["PermissionResolvable"]]]},{"name":"position","description":"The position of the new role","optional":true,"type":[[["number"]]]},{"name":"mentionable","description":"Whether or not the new role should be mentionable","optional":true,"type":[[["boolean"]]]},{"name":"icon","description":"The icon for the role\nThe `EmojiResolvable` should belong to the same guild as the role.\nIf not, pass the emoji's URL directly","optional":true,"nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]],[["EmojiResolvable"]]]},{"name":"unicodeEmoji","description":"The unicode emoji for the role","optional":true,"nullable":true,"type":[[["string"]]]},{"name":"reason","description":"The reason for creating this role","optional":true,"type":[[["string"]]]}],"meta":{"line":139,"file":"RoleManager.js","path":"src/managers"}},{"name":"GuildRolePosition","description":"The data needed for updating a guild role's position","type":[[["Object"]]],"props":[{"name":"role","description":"The role's id","type":[[["RoleResolvable"]]]},{"name":"position","description":"The position to update","type":[[["number"]]]}],"meta":{"line":1347,"file":"Guild.js","path":"src/structures"}},{"name":"StageInstanceCreateOptions","description":"Options used to create a stage instance.","type":[[["Object"]]],"props":[{"name":"topic","description":"The topic of the stage instance","type":[[["string"]]]},{"name":"privacyLevel","description":"The privacy level of the stage instance","optional":true,"type":[[["PrivacyLevel"]],[["number"]]]},{"name":"sendStartNotification","description":"Whether to notify `@everyone` that the stage instance has started","optional":true,"type":[[["boolean"]]]},{"name":"guildScheduledEvent","description":"The guild scheduled event associated with the stage instance","optional":true,"type":[[["GuildScheduledEventResolvable"]]]}],"meta":{"line":29,"file":"StageInstanceManager.js","path":"src/managers"}},{"name":"StageChannelResolvable","description":"Data that can be resolved to a Stage Channel object. This can be:\n* A StageChannel\n* A Snowflake","type":[[["StageChannel"]],[["Snowflake"]]],"meta":{"line":39,"file":"StageInstanceManager.js","path":"src/managers"}},{"name":"StageInstanceEditOptions","description":"Options used to edit an existing stage instance.","type":[[["Object"]]],"props":[{"name":"topic","description":"The new topic of the stage instance","optional":true,"type":[[["string"]]]},{"name":"privacyLevel","description":"The new privacy level of the stage instance","optional":true,"type":[[["PrivacyLevel"]],[["number"]]]}],"meta":{"line":106,"file":"StageInstanceManager.js","path":"src/managers"}},{"name":"ThreadChannelResolvable","description":"Data that can be resolved to a Thread Channel object. This can be:\n* A ThreadChannel object\n* A Snowflake","type":[[["ThreadChannel"]],[["Snowflake"]]],"meta":{"line":35,"file":"ThreadManager.js","path":"src/managers"}},{"name":"FetchThreadsOptions","description":"Options for fetching multiple threads.","type":[[["Object"]]],"props":[{"name":"archived","description":"The options used to fetch archived threads","optional":true,"type":[[["FetchArchivedThreadOptions"]]]}],"meta":{"line":60,"file":"ThreadManager.js","path":"src/managers"}},{"name":"DateResolvable","description":"Data that can be resolved to a Date object. This can be:\n* A Date object\n* A number representing a timestamp\n* An [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) string","type":[[["Date"]],[["number"]],[["string"]]],"meta":{"line":89,"file":"ThreadManager.js","path":"src/managers"}},{"name":"FetchArchivedThreadOptions","description":"The options used to fetch archived threads.","type":[[["Object"]]],"props":[{"name":"type","description":"The type of threads to fetch, either `public` or `private`","optional":true,"default":"'public'","type":[[["string"]]]},{"name":"fetchAll","description":"Whether to fetch **all** archived threads when type is `private`.\nRequires `MANAGE_THREADS` if true","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"before","description":"Only return threads that were archived before this Date\nor Snowflake. Must be a {@link ThreadChannelResolvable} when type is `private` and fetchAll is `false`","optional":true,"type":[[["DateResolvable"]],[["ThreadChannelResolvable"]]]},{"name":"limit","description":"Maximum number of threads to return","optional":true,"type":[[["number"]]]}],"meta":{"line":97,"file":"ThreadManager.js","path":"src/managers"}},{"name":"FetchedThreads","description":"The data returned from a thread fetch that returns multiple threads.","type":[[["Object"]]],"props":[{"name":"threads","description":"The threads that were fetched, with any members returned","type":[[["Collection","<"],["Snowflake",", "],["ThreadChannel",">"]]]},{"name":"hasMore","description":"Whether there are potentially additional threads that require a subsequent call","nullable":true,"type":[[["boolean"]]]}],"meta":{"line":108,"file":"ThreadManager.js","path":"src/managers"}},{"name":"FetchChannelThreadsOptions","description":"Discord.js self-bot specific options field for fetching active threads.","type":[[["Object"]]],"props":[{"name":"archived","description":"Whether to fetch archived threads (default is false)","optional":true,"type":[[["boolean"]]]},{"name":"sortBy","description":"The order in which the threads should be fetched in (default is last_message_time)","optional":true,"type":[[["string"]]]},{"name":"sortOrder","description":"How the threads should be ordered (default is desc)","optional":true,"type":[[["string"]]]},{"name":"limit","description":"The maximum number of threads to return (default is 25)","optional":true,"type":[[["number"]]]},{"name":"offset","description":"The number of threads to offset fetching (useful when making multiple fetches) (default is 0)","optional":true,"type":[[["number"]]]}],"meta":{"line":125,"file":"ThreadManager.js","path":"src/managers"}},{"name":"ThreadMemberResolvable","description":"Data that resolves to give a ThreadMember object. This can be:\n* A ThreadMember object\n* A User resolvable","type":[[["ThreadMember"]],[["UserResolvable"]]],"meta":{"line":60,"file":"ThreadMemberManager.js","path":"src/managers"}},{"name":"FetchThreadMemberOptions","description":"Options used to fetch a thread member.","type":[[["BaseFetchOptions"]]],"props":[{"name":"withMember","description":"Whether to also return the guild member associated with this thread member","optional":true,"type":[[["boolean"]]]}],"meta":{"line":135,"file":"ThreadMemberManager.js","path":"src/managers"}},{"name":"FetchThreadMembersWithGuildMemberDataOptions","description":"Options used to fetch multiple thread members with guild member data.\nWith `withMember` set to `true`, pagination is enabled.","type":[[["Object"]]],"props":[{"name":"withMember","description":"Whether to also return the guild member data","type":[[["true"]]]},{"name":"after","description":"Consider only thread members after this id","optional":true,"type":[[["Snowflake"]]]},{"name":"limit","description":"The maximum number of thread members to return","optional":true,"type":[[["number"]]]},{"name":"cache","description":"Whether to cache the fetched thread members and guild members","optional":true,"type":[[["boolean"]]]}],"meta":{"line":141,"file":"ThreadMemberManager.js","path":"src/managers"}},{"name":"FetchThreadMembersWithoutGuildMemberDataOptions","description":"Options used to fetch multiple thread members without guild member data.","type":[[["Object"]]],"props":[{"name":"withMember","description":"Whether to also return the guild member data","optional":true,"type":[[["false"]]]},{"name":"cache","description":"Whether to cache the fetched thread members","optional":true,"type":[[["boolean"]]]}],"meta":{"line":151,"file":"ThreadMemberManager.js","path":"src/managers"}},{"name":"FetchThreadMembersOptions","description":"Options used to fetch multiple thread members.","type":[[["FetchThreadMembersWithGuildMemberDataOptions"]],[["FetchThreadMembersWithoutGuildMemberDataOptions"]]],"meta":{"line":158,"file":"ThreadMemberManager.js","path":"src/managers"}},{"name":"UserResolvable","description":"Data that resolves to give a User object. This can be:\n* A User object\n* A Snowflake\n* A Message object (resolves to the message author)\n* A GuildMember object\n* A ThreadMember object","type":[[["User"]],[["Snowflake"]],[["Message"]],[["GuildMember"]],[["ThreadMember"]]],"meta":{"line":25,"file":"UserManager.js","path":"src/managers"}},{"name":"Captcha","type":[[["Object"]]],"props":[{"name":"captcha_key","description":"['message']","type":[[["Array","<"],["string",">"]]]},{"name":"captcha_sitekey","description":"Captcha sitekey (hcaptcha)","type":[[["string"]]]},{"name":"captcha_service","description":"hcaptcha","type":[[["string"]]]},{"name":"captcha_rqdata","optional":true,"type":[[["string"]]]},{"name":"captcha_rqtoken","optional":true,"type":[[["string"]]]}],"meta":{"line":54,"file":"DiscordAPIError.js","path":"src/rest"}},{"name":"HTTPErrorData","description":"The HTTP data that was sent to Discord","type":[[["Object"]]],"props":[{"name":"json","description":"The JSON data that was sent","type":[["*"]]},{"name":"files","description":"The files that were sent with this request, if any","type":[[["Array","<"],["HTTPAttachmentData",">"]]]}],"meta":{"line":35,"file":"HTTPError.js","path":"src/rest"}},{"name":"HTTPAttachmentData","description":"The attachment data that is sent to Discord","type":[[["Object"]]],"props":[{"name":"attachment","description":"The source of this attachment data","type":[[["string"]],[["Buffer"]],[["Stream"]]]},{"name":"name","description":"The file name","type":[[["string"]]]},{"name":"file","description":"The file buffer","type":[[["Buffer"]],[["Stream"]]]}],"meta":{"line":42,"file":"HTTPError.js","path":"src/rest"}},{"name":"APIRequest","description":"Represents a request that will or has been made to the Discord API","type":[[["Object"]]],"props":[{"name":"method","description":"The HTTP method used in this request","type":[[["HTTPMethod"]]]},{"name":"path","description":"The full path used to make the request","type":[[["string"]]]},{"name":"route","description":"The API route identifying the rate limit for this request","type":[[["string"]]]},{"name":"options","description":"Additional options for this request","type":[[["Object"]]]},{"name":"retries","description":"The number of times this request has been attempted","type":[[["number"]]]}],"meta":{"line":178,"file":"RequestHandler.js","path":"src/rest"}},{"name":"InvalidRequestWarningData","type":[[["Object"]]],"props":[{"name":"count","description":"Number of invalid requests that have been made in the window","type":[[["number"]]]},{"name":"remainingTime","description":"Time in milliseconds remaining before the count resets","type":[[["number"]]]}],"meta":{"line":292,"file":"RequestHandler.js","path":"src/rest"}},{"name":"ShardRespawnOptions","description":"Options used to respawn a shard.","type":[[["Object"]]],"props":[{"name":"delay","description":"How long to wait between killing the process/worker and\nrestarting it (in milliseconds)","optional":true,"default":500,"type":[[["number"]]]},{"name":"timeout","description":"The amount in milliseconds to wait until the {@link Client}\nhas become ready before resolving (`-1` or `Infinity` for no wait)","optional":true,"default":30000,"type":[[["number"]]]}],"meta":{"line":192,"file":"Shard.js","path":"src/sharding"}},{"name":"ShardingManagerMode","description":"The mode to spawn shards with for a {@link ShardingManager}. Can be either one of:\n* 'process' to use child processes\n* 'worker' to use [Worker threads](https://nodejs.org/api/worker_threads.html)","type":[[["string"]]],"meta":{"line":24,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"ShardingManagerOptions","description":"The options to spawn shards with for a {@link ShardingManager}.","type":[[["Object"]]],"props":[{"name":"totalShards","description":"Number of total shards of all shard managers or \"auto\"","optional":true,"default":"'auto'","type":[[["string"]],[["number"]]]},{"name":"shardList","description":"List of shards to spawn or \"auto\"","optional":true,"default":"'auto'","type":[[["string"]],[["Array","<"],["number",">"]]]},{"name":"mode","description":"Which mode to use for shards","optional":true,"default":"'process'","type":[[["ShardingManagerMode"]]]},{"name":"respawn","description":"Whether shards should automatically respawn upon exiting","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"shardArgs","description":"Arguments to pass to the shard script when spawning\n(only available when mode is set to 'process')","optional":true,"default":"[]","type":[[["Array","<"],["string",">"]]]},{"name":"execArgv","description":"Arguments to pass to the shard script executable when spawning\n(only available when mode is set to 'process')","optional":true,"default":"[]","type":[[["Array","<"],["string",">"]]]},{"name":"token","description":"Token to use for automatic shard count and passing to shards","optional":true,"type":[[["string"]]]}],"meta":{"line":31,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"MultipleShardSpawnOptions","description":"Options used to spawn multiple shards.","type":[[["Object"]]],"props":[{"name":"amount","description":"Number of shards to spawn","optional":true,"default":"this.totalShards","type":[[["number"]],[["string"]]]},{"name":"delay","description":"How long to wait in between spawning each shard (in milliseconds)","optional":true,"default":5500,"type":[[["number"]]]},{"name":"timeout","description":"The amount in milliseconds to wait until the {@link Client} has become ready","optional":true,"default":30000,"type":[[["number"]]]}],"meta":{"line":171,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"BroadcastEvalOptions","description":"Options for {@link ShardingManager#broadcastEval} and {@link ShardClientUtil#broadcastEval}.","type":[[["Object"]]],"props":[{"name":"shard","description":"Shard to run script on, all if undefined","optional":true,"type":[[["number"]]]},{"name":"context","description":"The JSON-serializable values to call the script with","optional":true,"type":[["*"]]}],"meta":{"line":238,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"MultipleShardRespawnOptions","description":"Options used to respawn all shards.","type":[[["Object"]]],"props":[{"name":"shardDelay","description":"How long to wait between shards (in milliseconds)","optional":true,"default":5000,"type":[[["number"]]]},{"name":"respawnDelay","description":"How long to wait between killing a shard's process and restarting it\n(in milliseconds)","optional":true,"default":500,"type":[[["number"]]]},{"name":"timeout","description":"The amount in milliseconds to wait for a shard to become ready before\ncontinuing to another (`-1` or `Infinity` for no wait)","optional":true,"default":30000,"type":[[["number"]]]}],"meta":{"line":293,"file":"ShardingManager.js","path":"src/sharding"}},{"name":"ApplicationCommandData","description":"Data for creating or editing an application command.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the command","type":[[["string"]]]},{"name":"nameLocalizations","description":"The localizations for the command name","optional":true,"type":[[["Object","<"],["Locale",", "],["string",">"]]]},{"name":"description","description":"The description of the command","type":[[["string"]]]},{"name":"descriptionLocalizations","description":"The localizations for the command description","optional":true,"type":[[["Object","<"],["Locale",", "],["string",">"]]]},{"name":"type","description":"The type of the command","optional":true,"type":[[["ApplicationCommandType"]]]},{"name":"options","description":"Options for the command","optional":true,"type":[[["Array","<"],["ApplicationCommandOptionData",">"]]]},{"name":"defaultPermission","description":"Whether the command is enabled by default when the app is added to a guild","optional":true,"type":[[["boolean"]]]},{"name":"defaultMemberPermissions","description":"The bitfield used to determine the default permissions\na member needs in order to run the command","optional":true,"nullable":true,"type":[[["PermissionResolvable"]]]},{"name":"dmPermission","description":"Whether the command is enabled in DMs","optional":true,"type":[[["boolean"]]]}],"meta":{"line":194,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"ApplicationCommandOptionData","description":"An option for an application command or subcommand.\nIn addition to the listed properties, when used as a parameter,\nAPI style `snake_case` properties can be used for compatibility with generators like `@discordjs/builders`.\nNote that providing a value for the `camelCase` counterpart for any `snake_case` property\nwill discard the provided `snake_case` property.","type":[[["Object"]]],"props":[{"name":"type","description":"The type of the option","type":[[["ApplicationCommandOptionType"]],[["number"]]]},{"name":"name","description":"The name of the option","type":[[["string"]]]},{"name":"nameLocalizations","description":"The name localizations for the option","optional":true,"type":[[["Object","<"],["Locale",", "],["string",">"]]]},{"name":"description","description":"The description of the option","type":[[["string"]]]},{"name":"descriptionLocalizations","description":"The description localizations for the option","optional":true,"type":[[["Object","<"],["Locale",", "],["string",">"]]]},{"name":"autocomplete","description":"Whether the option is an autocomplete option","optional":true,"type":[[["boolean"]]]},{"name":"required","description":"Whether the option is required","optional":true,"type":[[["boolean"]]]},{"name":"choices","description":"The choices of the option for the user to pick from","optional":true,"type":[[["Array","<"],["ApplicationCommandOptionChoiceData",">"]]]},{"name":"options","description":"Additional options if this option is a subcommand (group)","optional":true,"type":[[["Array","<"],["ApplicationCommandOptionData",">"]]]},{"name":"channelTypes","description":"When the option type is channel,\nthe allowed types of channels that can be selected","optional":true,"type":[[["Array","<"],["ChannelType",">"]],[["Array","<"],["number",">"]]]},{"name":"minValue","description":"The minimum value for an `INTEGER` or `NUMBER` option","optional":true,"type":[[["number"]]]},{"name":"maxValue","description":"The maximum value for an `INTEGER` or `NUMBER` option","optional":true,"type":[[["number"]]]},{"name":"minLength","description":"The minimum length for a `STRING` option\n(maximum of `6000`)","optional":true,"type":[[["number"]]]},{"name":"maxLength","description":"The maximum length for a `STRING` option\n(maximum of `6000`)","optional":true,"type":[[["number"]]]}],"meta":{"line":209,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"ApplicationCommandOptionChoiceData","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the choice","type":[[["string"]]]},{"name":"nameLocalizations","description":"The localized names for this choice","optional":true,"type":[[["Object","<"],["Locale",", "],["string",">"]]]},{"name":"value","description":"The value of the choice","type":[[["string"]],[["number"]]]}],"meta":{"line":235,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"ApplicationCommandOption","description":"An option for an application command or subcommand.","type":[[["Object"]]],"props":[{"name":"type","description":"The type of the option","type":[[["ApplicationCommandOptionType"]]]},{"name":"name","description":"The name of the option","type":[[["string"]]]},{"name":"nameLocalizations","description":"The localizations for the option name","optional":true,"type":[[["Object","<"],["string",", "],["string",">"]]]},{"name":"nameLocalized","description":"The localized name for this option","optional":true,"type":[[["string"]]]},{"name":"description","description":"The description of the option","type":[[["string"]]]},{"name":"descriptionLocalizations","description":"The localizations for the option description","optional":true,"type":[[["Object","<"],["string",", "],["string",">"]]]},{"name":"descriptionLocalized","description":"The localized description for this option","optional":true,"type":[[["string"]]]},{"name":"required","description":"Whether the option is required","optional":true,"type":[[["boolean"]]]},{"name":"autocomplete","description":"Whether the option is an autocomplete option","optional":true,"type":[[["boolean"]]]},{"name":"choices","description":"The choices of the option for the user to pick from","optional":true,"type":[[["Array","<"],["ApplicationCommandOptionChoice",">"]]]},{"name":"options","description":"Additional options if this option is a subcommand (group)","optional":true,"type":[[["Array","<"],["ApplicationCommandOption",">"]]]},{"name":"channelTypes","description":"When the option type is channel,\nthe allowed types of channels that can be selected","optional":true,"type":[[["Array","<"],["ChannelType",">"]]]},{"name":"minValue","description":"The minimum value for an `INTEGER` or `NUMBER` option","optional":true,"type":[[["number"]]]},{"name":"maxValue","description":"The maximum value for an `INTEGER` or `NUMBER` option","optional":true,"type":[[["number"]]]},{"name":"minLength","description":"The minimum length for a `STRING` option\n(maximum of `6000`)","optional":true,"type":[[["number"]]]},{"name":"maxLength","description":"The maximum length for a `STRING` option\n(maximum of `6000`)","optional":true,"type":[[["number"]]]}],"meta":{"line":500,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"ApplicationCommandOptionChoice","description":"A choice for an application command option.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the choice","type":[[["string"]]]},{"name":"nameLocalized","description":"The localized name of the choice in the provided locale, if any","nullable":true,"type":[[["string"]]]},{"name":"nameLocalizations","description":"The localized names for this choice","optional":true,"nullable":true,"type":[[["Object","<"],["string",", "],["string",">"]]]},{"name":"value","description":"The value of the choice","type":[[["string"]],[["number"]]]}],"meta":{"line":524,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"AutoModerationTriggerMetadata","description":"Additional data used to determine whether an auto moderation rule should be triggered.","type":[[["Object"]]],"props":[{"name":"keywordFilter","description":"The substrings that will be searched for in the content","type":[[["Array","<"],["string",">"]]]},{"name":"regexPatterns","description":"The regular expression patterns which will be matched against the content\nOnly Rust-flavored regular expressions are supported.","type":[[["Array","<"],["string",">"]]]},{"name":"presets","description":"The internally pre-defined wordsets which will be searched for in the content","type":[[["Array","<"],["AutoModerationRuleKeywordPresetType",">"]]]},{"name":"allowList","description":"The substrings that will be exempt from triggering\n{@link AutoModerationRuleTriggerType.KEYWORD} and {@link AutoModerationRuleTriggerType.KEYWORD_PRESET}","type":[[["Array","<"],["string",">"]]]},{"name":"mentionTotalLimit","description":"The total number of role & user mentions allowed per message","nullable":true,"type":[[["number"]]]},{"name":"mentionRaidProtectionEnabled","description":"Whether mention raid protection is enabled","type":[[["boolean"]]]}],"meta":{"line":65,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"AutoModerationAction","description":"An object containing information about an auto moderation rule action.","type":[[["Object"]]],"props":[{"name":"type","description":"The type of this auto moderation rule action","type":[[["AutoModerationActionType"]]]},{"name":"metadata","description":"Additional metadata needed during execution","type":[[["AutoModerationActionMetadata"]]]}],"meta":{"line":94,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"AutoModerationActionMetadata","description":"Additional data used when an auto moderation rule is executed.","type":[[["Object"]]],"props":[{"name":"channelId","description":"The id of the channel to which content will be logged","nullable":true,"type":[[["Snowflake"]]]},{"name":"durationSeconds","description":"The timeout duration in seconds","nullable":true,"type":[[["number"]]]},{"name":"customMessage","description":"The custom message that is shown whenever a message is blocked","nullable":true,"type":[[["string"]]]}],"meta":{"line":101,"file":"AutoModerationRule.js","path":"src/structures"}},{"name":"CommandInteractionResolvedData","description":"Represents the resolved data of a received command interaction.","type":[[["Object"]]],"props":[{"name":"users","description":"The resolved users","optional":true,"type":[[["Collection","<"],["Snowflake",", "],["User",">"]]]},{"name":"members","description":"The resolved guild members","optional":true,"type":[[["Collection","<"],["Snowflake",", ("],["GuildMember","|"],["APIGuildMember",")>"]]]},{"name":"roles","description":"The resolved roles","optional":true,"type":[[["Collection","<"],["Snowflake",", ("],["Role","|"],["APIRole",")>"]]]},{"name":"channels","description":"The resolved channels","optional":true,"type":[[["Collection","<"],["Snowflake",", ("],["Channel","|"],["APIChannel",")>"]]]},{"name":"messages","description":"The resolved messages","optional":true,"type":[[["Collection","<"],["Snowflake",", ("],["Message","|"],["APIMessage",")>"]]]},{"name":"attachments","description":"The resolved attachments","optional":true,"type":[[["Collection","<"],["Snowflake",", "],["MessageAttachment",">"]]]}],"meta":{"line":72,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"CommandInteractionOption","description":"Represents an option of a received command interaction.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the option","type":[[["string"]]]},{"name":"type","description":"The type of the option","type":[[["ApplicationCommandOptionType"]]]},{"name":"autocomplete","description":"Whether the option is an autocomplete option","optional":true,"type":[[["boolean"]]]},{"name":"value","description":"The value of the option","optional":true,"type":[[["string"]],[["number"]],[["boolean"]]]},{"name":"options","description":"Additional options if this option is a\nsubcommand (group)","optional":true,"type":[[["Array","<"],["CommandInteractionOption",">"]]]},{"name":"user","description":"The resolved user","optional":true,"type":[[["User"]]]},{"name":"member","description":"The resolved member","optional":true,"type":[[["GuildMember"]],[["APIGuildMember"]]]},{"name":"channel","description":"The resolved channel","optional":true,"type":[[["GuildChannel"]],[["ThreadChannel"]],[["APIChannel"]]]},{"name":"role","description":"The resolved role","optional":true,"type":[[["Role"]],[["APIRole"]]]},{"name":"attachment","description":"The resolved attachment","optional":true,"type":[[["MessageAttachment"]]]}],"meta":{"line":139,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"ApplicationResolvable","description":"Data that can be resolved to an Application. This can be:\n* An Application\n* An Activity with associated Application\n* A Snowflake","type":[[["Application"]],[["Snowflake"]]],"meta":{"line":127,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"CreateInviteOptions","description":"Options used to create an invite to a guild channel.","type":[[["Object"]]],"props":[{"name":"temporary","description":"Whether members that joined via the invite should be automatically\nkicked after 24 hours if they have not yet received a role","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"maxAge","description":"How long the invite should last (in seconds, 0 for forever)","optional":true,"default":86400,"type":[[["number"]]]},{"name":"maxUses","description":"Maximum number of uses","optional":true,"default":0,"type":[[["number"]]]},{"name":"unique","description":"Create a unique invite, or use an existing one with similar settings","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"targetUser","description":"The user whose stream to display for this invite,\nrequired if `targetType` is 1, the user must be streaming in the channel","optional":true,"type":[[["UserResolvable"]]]},{"name":"targetApplication","description":"The embedded application to open for this invite,\nrequired if `targetType` is 2, the application must have the `EMBEDDED` flag","optional":true,"type":[[["ApplicationResolvable"]]]},{"name":"targetType","description":"The type of the target for this voice channel invite","optional":true,"type":[[["TargetType"]]]},{"name":"reason","description":"The reason for creating the invite","optional":true,"type":[[["string"]]]}],"meta":{"line":135,"file":"BaseGuildTextChannel.js","path":"src/structures"}},{"name":"BaseMessageComponentOptions","description":"Options for a BaseMessageComponent","type":[[["Object"]]],"props":[{"name":"type","description":"The type of this component","type":[[["MessageComponentTypeResolvable"]]]}],"meta":{"line":11,"file":"BaseMessageComponent.js","path":"src/structures"}},{"name":"MessageComponentOptions","description":"Data that can be resolved into options for a component. This can be:\n* MessageActionRowOptions\n* MessageButtonOptions\n* MessageSelectMenuOptions\n* TextInputComponentOptions","type":[[["MessageActionRowOptions"]],[["MessageButtonOptions"]],[["MessageSelectMenuOptions"]]],"meta":{"line":17,"file":"BaseMessageComponent.js","path":"src/structures"}},{"name":"MessageComponent","description":"Components that can be sent in a payload. These can be:\n* MessageActionRow\n* MessageButton\n* MessageSelectMenu\n* TextInputComponent","see":["{@link https://discord.com/developers/docs/interactions/message-components#component-object-component-types}"],"type":[[["MessageActionRow"]],[["MessageButton"]],[["MessageSelectMenu"]]],"meta":{"line":26,"file":"BaseMessageComponent.js","path":"src/structures"}},{"name":"MessageComponentTypeResolvable","description":"Data that can be resolved to a MessageComponentType. This can be:\n* MessageComponentType\n* string\n* number","type":[[["string"]],[["number"]],[["MessageComponentType"]]],"meta":{"line":36,"file":"BaseMessageComponent.js","path":"src/structures"}},{"name":"CategoryCreateChannelOptions","description":"Options for creating a channel using {@link CategoryChannel#createChannel}.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the new channel","optional":true,"type":[[["string"]]]},{"name":"type","description":"The type of the new channel.","optional":true,"default":"'GUILD_TEXT'","type":[[["ChannelType"]],[["number"]]]},{"name":"position","description":"Position of the new channel","optional":true,"type":[[["number"]]]},{"name":"topic","description":"The topic for the new channel","optional":true,"type":[[["string"]]]},{"name":"nsfw","description":"Whether the new channel is NSFW","optional":true,"type":[[["boolean"]]]},{"name":"bitrate","description":"Bitrate of the new channel in bits (only voice)","optional":true,"type":[[["number"]]]},{"name":"userLimit","description":"Maximum amount of users allowed in the new channel (only voice)","optional":true,"type":[[["number"]]]},{"name":"permissionOverwrites","description":"Permission overwrites of the new channel","optional":true,"type":[[["Array","<"],["OverwriteResolvable",">"]],[["Collection","<"],["Snowflake",", "],["OverwriteResolvable",">"]]]},{"name":"rateLimitPerUser","description":"The rate limit per user (slowmode) for the new channel in seconds","optional":true,"type":[[["number"]]]},{"name":"defaultAutoArchiveDuration","description":"The default auto archive duration for all new threads in this channel","optional":true,"type":[[["ThreadAutoArchiveDuration"]]]},{"name":"rtcRegion","description":"The specific region of the new channel","optional":true,"nullable":true,"type":[[["string"]]]},{"name":"videoQualityMode","description":"The camera video quality mode of the new channel","optional":true,"type":[[["VideoQualityMode"]],[["number"]]]},{"name":"flags","description":"The flags to set on the new channel","optional":true,"type":[[["ChannelFlagsResolvable"]]]},{"name":"availableTags","description":"The tags to set as available in a forum channel","optional":true,"type":[[["Array","<"],["GuildForumTagData",">"]]]},{"name":"defaultReactionEmoji","description":"The emoji to set as the default reaction emoji","optional":true,"nullable":true,"type":[[["DefaultReactionEmoji"]]]},{"name":"defaultThreadRateLimitPerUser","description":"The rate limit per user (slowmode) to set on forum posts","optional":true,"type":[[["number"]]]},{"name":"defaultSortOrder","description":"The default sort order mode to set on the new channel","optional":true,"nullable":true,"type":[[["SortOrderType"]]]},{"name":"defaultThreadRateLimitPerUser","description":"The initial rate limit per user (slowmode)\nto set on newly created threads in a channel.","optional":true,"type":[[["number"]]]},{"name":"reason","description":"Reason for creating the new channel","optional":true,"type":[[["string"]]]}],"meta":{"line":43,"file":"CategoryChannel.js","path":"src/structures"}},{"name":"ClientUserEditData","description":"Data used to edit the logged in client","type":[[["Object"]]],"props":[{"name":"username","description":"The new username","optional":true,"type":[[["string"]]]},{"name":"avatar","description":"The new avatar","optional":true,"nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]},{"name":"banner","description":"The new banner","optional":true,"nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]},{"name":"bio","description":"The new bio","optional":true,"nullable":true,"type":[[["string"]]]}],"meta":{"line":128,"file":"ClientUser.js","path":"src/structures"}},{"name":"ActivitiesOptions","description":"Options for setting activities","type":[[["Object"]]],"props":[{"name":"name","description":"Name of the activity","type":[[["string"]]]},{"name":"state","description":"State of the activity","optional":true,"type":[[["string"]]]},{"name":"type","description":"Type of the activity","optional":true,"type":[[["ActivityType"]],[["number"]]]},{"name":"url","description":"Twitch / YouTube stream URL","optional":true,"type":[[["string"]]]}],"meta":{"line":180,"file":"ClientUser.js","path":"src/structures"}},{"name":"PresenceData","description":"Data resembling a raw Discord presence.","type":[[["Object"]]],"props":[{"name":"status","description":"Status of the user","optional":true,"type":[[["PresenceStatusData"]]]},{"name":"afk","description":"Whether the user is AFK","optional":true,"type":[[["boolean"]]]},{"name":"activities","description":"Activity the user is playing","optional":true,"type":[[["Array","<"],["ActivitiesOptions",">"]],[["Array","<"],["CustomStatus",">"]],[["Array","<"],["RichPresence",">"]],[["Array","<"],["SpotifyRPC",">"]]]},{"name":"shardId","description":"Shard id(s) to have the activity set on","optional":true,"type":[[["number"]],[["Array","<"],["number",">"]]]}],"meta":{"line":189,"file":"ClientUser.js","path":"src/structures"}},{"name":"PresenceStatusData","description":"A user's status. Must be one of:\n* `online`\n* `idle`\n* `invisible`\n* `dnd` (do not disturb)","type":[[["string"]]],"meta":{"line":211,"file":"ClientUser.js","path":"src/structures"}},{"name":"ActivityOptions","description":"Options for setting an activity.","type":[[["Object"]]],"props":[{"name":"name","description":"Name of the activity","type":[[["string"]]]},{"name":"url","description":"Twitch / YouTube stream URL","optional":true,"type":[[["string"]]]},{"name":"type","description":"Type of the activity","optional":true,"type":[[["ActivityType"]],[["number"]]]},{"name":"shardId","description":"Shard Id(s) to have the activity set on","optional":true,"type":[[["number"]],[["Array","<"],["number",">"]]]}],"meta":{"line":233,"file":"ClientUser.js","path":"src/structures"}},{"name":"AutocompleteFocusedOption","description":"The full autocomplete option object.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the option","type":[[["string"]]]},{"name":"type","description":"The type of the application command option","type":[[["ApplicationCommandOptionType"]]]},{"name":"value","description":"The value of the option","type":[[["string"]]]},{"name":"focused","description":"Whether this option is currently in focus for autocomplete","type":[[["boolean"]]]}],"meta":{"line":243,"file":"CommandInteractionOptionResolver.js","path":"src/structures"}},{"name":"ContainerComponents","type":[[["MessageActionRow"]],[["TextDisplayComponent"]],[["SectionComponent"]],[["MediaGalleryComponent"]],[["SeparatorComponent"]],[["FileComponent"]]],"props":[{"name":"components","description":"Components of the type action row, text display, section, media gallery, separator, or file","optional":true,"type":[[["Array","<"],["ContainerComponents",">"]]]},{"name":"accent_color","description":"Color for the accent on the container as RGB from 0x000000 to 0xFFFFFF","optional":true,"type":[[["Number"]]]},{"name":"spoiler","description":"Whether the container should be a spoiler (or blurred out). Defaults to false.","optional":true,"type":[[["Boolean"]]]}],"meta":{"line":7,"file":"ContainerComponent.js","path":"src/structures"}},{"name":"RawEmoji","description":"Represents raw emoji data from the API","type":[[["APIEmoji"]]],"props":[{"name":"id","description":"The emoji's id","nullable":true,"type":[[["Snowflake"]]]},{"name":"name","description":"The emoji's name","nullable":true,"type":[[["string"]]]},{"name":"animated","description":"Whether the emoji is animated","nullable":true,"type":[[["boolean"]]]}],"meta":{"line":15,"file":"Emoji.js","path":"src/structures"}},{"name":"GroupDMChannelEditData","description":"The data for editing a channe;.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the channel","optional":true,"type":[[["string"]]]},{"name":"icon","description":"The icon of the channel","optional":true,"nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]},{"name":"owner","description":"The owner of the channel","optional":true,"type":[[["GuildMemberResolvable"]]]}],"meta":{"line":174,"file":"GroupDMChannel.js","path":"src/structures"}},{"name":"Features","description":"An array of enabled guild features, here are the possible values:\n* ANIMATED_ICON\n* AUTO_MODERATION\n* BANNER\n* COMMERCE\n* COMMUNITY\n* CREATOR_MONETIZABLE_PROVISIONAL\n* CREATOR_STORE_PAGE\n* DISCOVERABLE\n* FEATURABLE\n* INVITES_DISABLED\n* INVITE_SPLASH\n* MEMBER_VERIFICATION_GATE_ENABLED\n* NEWS\n* PARTNERED\n* PREVIEW_ENABLED\n* VANITY_URL\n* VERIFIED\n* VIP_REGIONS\n* WELCOME_SCREEN_ENABLED\n* TICKETED_EVENTS_ENABLED\n* MONETIZATION_ENABLED\n`MONETIZATION_ENABLED` has been replaced.\nSee [this pull request](https://github.com/discord/discord-api-docs/pull/5724) for more information.\n* MORE_STICKERS\n* THREE_DAY_THREAD_ARCHIVE\n* SEVEN_DAY_THREAD_ARCHIVE\n* PRIVATE_THREADS\n* ROLE_ICONS\n* RAID_ALERTS_DISABLED\n* ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE\n* ROLE_SUBSCRIPTIONS_ENABLED","see":["{@link https://discord.com/developers/docs/resources/guild#guild-object-guild-features}"],"type":[[["string"]]],"meta":{"line":228,"file":"Guild.js","path":"src/structures"}},{"name":"IncidentActions","description":"Incident actions of a guild.","type":[[["Object"]]],"props":[{"name":"invitesDisabledUntil","description":"When invites would be enabled again","nullable":true,"type":[[["Date"]]]},{"name":"dmsDisabledUntil","description":"When direct messages would be enabled again","nullable":true,"type":[[["Date"]]]},{"name":"dmSpamDetectedAt","description":"When direct message spam was detected","nullable":true,"type":[[["Date"]]]},{"name":"raidDetectedAt","description":"When a raid was detected","nullable":true,"type":[[["Date"]]]}],"meta":{"line":553,"file":"Guild.js","path":"src/structures"}},{"name":"Vanity","description":"An object containing information about a guild's vanity invite.","type":[[["Object"]]],"props":[{"name":"code","description":"Vanity invite code","nullable":true,"type":[[["string"]]]},{"name":"uses","description":"How many times this invite has been used","type":[[["number"]]]}],"meta":{"line":750,"file":"Guild.js","path":"src/structures"}},{"name":"GuildWidgetSettings","description":"Data for the Guild Widget Settings object","type":[[["Object"]]],"props":[{"name":"enabled","description":"Whether the widget is enabled","type":[[["boolean"]]]},{"name":"channel","description":"The widget invite channel","nullable":true,"type":[[["GuildChannel"]]]}],"meta":{"line":806,"file":"Guild.js","path":"src/structures"}},{"name":"GuildWidgetSettingsData","description":"The Guild Widget Settings object","type":[[["Object"]]],"props":[{"name":"enabled","description":"Whether the widget is enabled","type":[[["boolean"]]]},{"name":"channel","description":"The widget invite channel","nullable":true,"type":[[["GuildChannelResolvable"]]]}],"meta":{"line":813,"file":"Guild.js","path":"src/structures"}},{"name":"GuildAuditLogsFetchOptions","description":"Options used to fetch audit logs.","type":[[["Object"]]],"props":[{"name":"before","description":"Consider only entries before this entry","optional":true,"type":[[["Snowflake"]],[["GuildAuditLogsEntry"]]]},{"name":"after","description":"Consider only entries after this entry","optional":true,"type":[[["Snowflake"]],[["GuildAuditLogsEntry"]]]},{"name":"limit","description":"The number of entries to return","optional":true,"type":[[["number"]]]},{"name":"user","description":"Only return entries for actions made by this user","optional":true,"type":[[["UserResolvable"]]]},{"name":"type","description":"Only return entries for this action type","optional":true,"type":[[["AuditLogAction"]],[["number"]]]}],"meta":{"line":839,"file":"Guild.js","path":"src/structures"}},{"name":"GuildEditData","description":"The data for editing a guild.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the guild","optional":true,"type":[[["string"]]]},{"name":"verificationLevel","description":"The verification level of the guild","optional":true,"nullable":true,"type":[[["VerificationLevel"]],[["number"]]]},{"name":"explicitContentFilter","description":"The level of the explicit content filter","optional":true,"nullable":true,"type":[[["ExplicitContentFilterLevel"]],[["number"]]]},{"name":"afkChannel","description":"The AFK channel of the guild","optional":true,"nullable":true,"type":[[["VoiceChannelResolvable"]]]},{"name":"systemChannel","description":"The system channel of the guild","optional":true,"nullable":true,"type":[[["TextChannelResolvable"]]]},{"name":"afkTimeout","description":"The AFK timeout of the guild","optional":true,"type":[[["number"]]]},{"name":"icon","description":"The icon of the guild","optional":true,"nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]},{"name":"owner","description":"The owner of the guild","optional":true,"type":[[["GuildMemberResolvable"]]]},{"name":"splash","description":"The invite splash image of the guild","optional":true,"nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]},{"name":"discoverySplash","description":"The discovery splash image of the guild","optional":true,"nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]},{"name":"banner","description":"The banner of the guild","optional":true,"nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]},{"name":"defaultMessageNotifications","description":"The default message\nnotification level of the guild","optional":true,"nullable":true,"type":[[["DefaultMessageNotificationLevel"]],[["number"]]]},{"name":"systemChannelFlags","description":"The system channel flags of the guild","optional":true,"type":[[["SystemChannelFlagsResolvable"]]]},{"name":"rulesChannel","description":"The rules channel of the guild","optional":true,"nullable":true,"type":[[["TextChannelResolvable"]]]},{"name":"publicUpdatesChannel","description":"The community updates channel of the guild","optional":true,"nullable":true,"type":[[["TextChannelResolvable"]]]},{"name":"preferredLocale","description":"The preferred locale of the guild","optional":true,"nullable":true,"type":[[["string"]]]},{"name":"safetyAlertsChannel","description":"The safety alerts channel of the guild","optional":true,"nullable":true,"type":[[["TextChannelResolvable"]]]},{"name":"premiumProgressBarEnabled","description":"Whether the guild's premium progress bar is enabled","optional":true,"type":[[["boolean"]]]},{"name":"description","description":"The discovery description of the guild","optional":true,"nullable":true,"type":[[["string"]]]},{"name":"features","description":"The features of the guild","optional":true,"type":[[["Array","<"],["Features",">"]]]}],"meta":{"line":873,"file":"Guild.js","path":"src/structures"}},{"name":"TextChannelResolvable","description":"Data that can be resolved to a Text Channel object. This can be:\n* A TextChannel\n* A Snowflake","type":[[["TextChannel"]],[["Snowflake"]]],"meta":{"line":899,"file":"Guild.js","path":"src/structures"}},{"name":"VoiceChannelResolvable","description":"Data that can be resolved to a Voice Channel object. This can be:\n* A VoiceChannel\n* A Snowflake","type":[[["VoiceChannel"]],[["Snowflake"]]],"meta":{"line":906,"file":"Guild.js","path":"src/structures"}},{"name":"WelcomeChannelData","description":"Welcome channel data","type":[[["Object"]]],"props":[{"name":"description","description":"The description to show for this welcome channel","type":[[["string"]]]},{"name":"channel","description":"The channel to link for this welcome channel","type":[[["TextChannel"]],[["NewsChannel"]],[["StoreChannel"]],[["Snowflake"]]]},{"name":"emoji","description":"The emoji to display for this welcome channel","optional":true,"type":[[["EmojiIdentifierResolvable"]]]}],"meta":{"line":985,"file":"Guild.js","path":"src/structures"}},{"name":"WelcomeScreenEditData","description":"Welcome screen edit data","type":[[["Object"]]],"props":[{"name":"enabled","description":"Whether the welcome screen is enabled","optional":true,"type":[[["boolean"]]]},{"name":"description","description":"The description for the welcome screen","optional":true,"type":[[["string"]]]},{"name":"welcomeChannels","description":"The welcome channel data for the welcome screen","optional":true,"type":[[["Array","<"],["WelcomeChannelData",">"]]]}],"meta":{"line":993,"file":"Guild.js","path":"src/structures"}},{"name":"GuildTextChannelResolvable","description":"Data that can be resolved to a GuildTextChannel object. This can be:\n* A TextChannel\n* A NewsChannel\n* A Snowflake","type":[[["TextChannel"]],[["NewsChannel"]],[["Snowflake"]]],"meta":{"line":1001,"file":"Guild.js","path":"src/structures"}},{"name":"GuildVoiceChannelResolvable","description":"Data that can be resolved to a GuildVoiceChannel object. This can be:\n* A VoiceChannel\n* A StageChannel\n* A Snowflake","type":[[["VoiceChannel"]],[["StageChannel"]],[["Snowflake"]]],"meta":{"line":1009,"file":"Guild.js","path":"src/structures"}},{"name":"AuditLogTargetType","description":"The target type of an entry. Here are the available types:\n* GUILD\n* CHANNEL\n* USER\n* ROLE\n* INVITE\n* WEBHOOK\n* EMOJI\n* MESSAGE\n* INTEGRATION\n* STAGE_INSTANCE\n* STICKER\n* THREAD\n* GUILD_SCHEDULED_EVENT\n* APPLICATION_COMMAND\n* AUTO_MODERATION","type":[[["string"]]],"meta":{"line":16,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"AuditLogAction","description":"The action of an entry. Here are the available actions:\n* ALL: null\n* GUILD_UPDATE: 1\n* CHANNEL_CREATE: 10\n* CHANNEL_UPDATE: 11\n* CHANNEL_DELETE: 12\n* CHANNEL_OVERWRITE_CREATE: 13\n* CHANNEL_OVERWRITE_UPDATE: 14\n* CHANNEL_OVERWRITE_DELETE: 15\n* MEMBER_KICK: 20\n* MEMBER_PRUNE: 21\n* MEMBER_BAN_ADD: 22\n* MEMBER_BAN_REMOVE: 23\n* MEMBER_UPDATE: 24\n* MEMBER_ROLE_UPDATE: 25\n* MEMBER_MOVE: 26\n* MEMBER_DISCONNECT: 27\n* BOT_ADD: 28,\n* ROLE_CREATE: 30\n* ROLE_UPDATE: 31\n* ROLE_DELETE: 32\n* INVITE_CREATE: 40\n* INVITE_UPDATE: 41\n* INVITE_DELETE: 42\n* WEBHOOK_CREATE: 50\n* WEBHOOK_UPDATE: 51\n* WEBHOOK_DELETE: 52\n* EMOJI_CREATE: 60\n* EMOJI_UPDATE: 61\n* EMOJI_DELETE: 62\n* MESSAGE_DELETE: 72\n* MESSAGE_BULK_DELETE: 73\n* MESSAGE_PIN: 74\n* MESSAGE_UNPIN: 75\n* INTEGRATION_CREATE: 80\n* INTEGRATION_UPDATE: 81\n* INTEGRATION_DELETE: 82\n* STAGE_INSTANCE_CREATE: 83\n* STAGE_INSTANCE_UPDATE: 84\n* STAGE_INSTANCE_DELETE: 85\n* STICKER_CREATE: 90\n* STICKER_UPDATE: 91\n* STICKER_DELETE: 92\n* GUILD_SCHEDULED_EVENT_CREATE: 100\n* GUILD_SCHEDULED_EVENT_UPDATE: 101\n* GUILD_SCHEDULED_EVENT_DELETE: 102\n* THREAD_CREATE: 110\n* THREAD_UPDATE: 111\n* THREAD_DELETE: 112\n* APPLICATION_COMMAND_PERMISSION_UPDATE: 121\n* AUTO_MODERATION_RULE_CREATE: 140\n* AUTO_MODERATION_RULE_UPDATE: 141\n* AUTO_MODERATION_RULE_DELETE: 142\n* AUTO_MODERATION_BLOCK_MESSAGE: 143\n* AUTO_MODERATION_FLAG_TO_CHANNEL: 144\n* AUTO_MODERATION_USER_COMMUNICATION_DISABLED: 145","see":["{@link https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events}"],"type":[[["number"]],[["string"]]],"meta":{"line":64,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"AuditLogEntryTarget","description":"The target of an entry. It can be one of:\n* A guild\n* A channel\n* A user\n* A role\n* An invite\n* A webhook\n* An emoji\n* A message\n* An integration\n* A stage instance\n* A sticker\n* A guild scheduled event\n* A thread\n* An application command\n* An auto moderation rule\n* An object with an id key if target was deleted\n* An object where the keys represent either the new value or the old value","type":[[["Object"]],[["Guild"]],[["Channel"]],[["User"]],[["Role"]],[["Invite"]],[["Webhook"]],[["GuildEmoji"]],[["Message"]],[["Integration"]],[["StageInstance"]],[["Sticker"]],[["GuildScheduledEvent"]],[["ApplicationCommand"]],[["AutoModerationRule"]]],"meta":{"line":262,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"AuditLogActionType","description":"The action type of an entry, e.g. `CREATE`. Here are the available types:\n* CREATE\n* DELETE\n* UPDATE\n* ALL","type":[[["string"]]],"meta":{"line":313,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"AuditLogChange","description":"An entry in the audit log representing a specific change.","type":[[["Object"]]],"props":[{"name":"key","description":"The property that was changed, e.g. `nick` for nickname changes","type":[[["string"]]]},{"name":"old","description":"The old value of the change, e.g. for nicknames, the old nickname","optional":true,"type":[["*"]]},{"name":"new","description":"The new value of the change, e.g. for nicknames, the new nickname","optional":true,"type":[["*"]]}],"meta":{"line":455,"file":"GuildAuditLogs.js","path":"src/structures"}},{"name":"SetParentOptions","description":"Options used to set the parent of a channel.","type":[[["Object"]]],"props":[{"name":"lockPermissions","description":"Whether to lock the permissions to what the parent's permissions are","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"reason","description":"The reason for modifying the parent of the channel","optional":true,"type":[[["string"]]]}],"meta":{"line":310,"file":"GuildChannel.js","path":"src/structures"}},{"name":"SetChannelPositionOptions","description":"Options used to set the position of a channel.","type":[[["Object"]]],"props":[{"name":"relative","description":"Whether or not to change the position relative to its current value","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"reason","description":"The reason for changing the position","optional":true,"type":[[["string"]]]}],"meta":{"line":338,"file":"GuildChannel.js","path":"src/structures"}},{"name":"GuildChannelCloneOptions","description":"Options used to clone a guild channel.","type":[[["GuildChannelCreateOptions"]]],"props":[{"name":"name","description":"Name of the new channel","optional":true,"default":"this.name","type":[[["string"]]]}],"meta":{"line":360,"file":"GuildChannel.js","path":"src/structures"}},{"name":"GuildEmojiEditData","description":"Data for editing an emoji.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the emoji","optional":true,"type":[[["string"]]]},{"name":"roles","description":"Roles to restrict emoji to","optional":true,"type":[[["Collection","<"],["Snowflake",", "],["Role",">"]],[["Array","<"],["RoleResolvable",">"]]]}],"meta":{"line":79,"file":"GuildEmoji.js","path":"src/structures"}},{"name":"GuildScheduledEventEntityMetadata","description":"Represents the additional metadata for a {@link GuildScheduledEvent}","see":["{@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata}"],"type":[[["Object"]]],"props":[{"name":"location","description":"The location of the guild scheduled event","nullable":true,"type":[[["string"]]]}],"meta":{"line":164,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"GuildScheduledEventRecurrenceRule","description":"Represents the recurrence rule for a {@link GuildScheduledEvent}.","type":[[["Object"]]],"props":[{"name":"startTimestamp","description":"The timestamp the recurrence rule interval starts at","type":[[["number"]]]},{"name":"startAt","description":"The time the recurrence rule interval starts at","type":[[["Date"]]]},{"name":"endTimestamp","description":"The timestamp the recurrence rule interval ends at","nullable":true,"type":[[["number"]]]},{"name":"endAt","description":"The time the recurrence rule interval ends at","nullable":true,"type":[[["Date"]]]},{"name":"frequency","description":"How often the event occurs","type":[[["GuildScheduledEventRecurrenceRuleFrequency"]]]},{"name":"interval","description":"The spacing between the events","type":[[["number"]]]},{"name":"byWeekday","description":"The days within a week to recur on","nullable":true,"type":[[["Array","<"],["GuildScheduledEventRecurrenceRuleWeekday",">"]]]},{"name":"byNWeekday","description":"The days within a week to recur on","nullable":true,"type":[[["Array","<"],["GuildScheduledEventRecurrenceRuleNWeekday",">"]]]},{"name":"byMonth","description":"The months to recur on","nullable":true,"type":[[["Array","<"],["GuildScheduledEventRecurrenceRuleMonth",">"]]]},{"name":"byMonthDay","description":"The days within a month to recur on","nullable":true,"type":[[["Array","<"],["number",">"]]]},{"name":"byYearDay","description":"The days within a year to recur on","nullable":true,"type":[[["Array","<"],["number",">"]]]},{"name":"count","description":"The total amount of times the event is allowed to recur before stopping","nullable":true,"type":[[["number"]]]}],"meta":{"line":198,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"GuildScheduledEventRecurrenceRuleNWeekday","type":[[["Object"]]],"props":[{"name":"n","description":"The week to recur on","type":[[["number"]]]},{"name":"day","description":"The day within the week to recur on","type":[[["GuildScheduledEventRecurrenceRuleWeekday"]]]}],"meta":{"line":214,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"CreateGuildScheduledEventInviteURLOptions","description":"Options used to create an invite URL to a {@link GuildScheduledEvent}","type":[[["CreateInviteOptions"]]],"props":[{"name":"channel","description":"The channel to create the invite in.\nThis is required when the `entityType` of `GuildScheduledEvent` is `EXTERNAL`, gets ignored otherwise","optional":true,"type":[[["GuildInvitableChannelResolvable"]]]}],"meta":{"line":339,"file":"GuildScheduledEvent.js","path":"src/structures"}},{"name":"EditGuildTemplateOptions","description":"Options used to edit a guild template.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of this template","optional":true,"type":[[["string"]]]},{"name":"description","description":"The description of this template","optional":true,"type":[[["string"]]]}],"meta":{"line":147,"file":"GuildTemplate.js","path":"src/structures"}},{"name":"IntegrationAccount","description":"The information account for an integration","type":[[["Object"]]],"props":[{"name":"id","description":"The id of the account","type":[[["Snowflake"]],[["string"]]]},{"name":"name","description":"The name of the account","type":[[["string"]]]}],"meta":{"line":6,"file":"Integration.js","path":"src/structures"}},{"name":"IntegrationType","description":"The type of an {@link Integration}. This can be:\n* `twitch`\n* `youtube`\n* `discord`\n* `guild_subscription`","type":[[["string"]]],"meta":{"line":13,"file":"Integration.js","path":"src/structures"}},{"name":"Locale","description":"A Discord locale string, possible values are:\n* en-US (English, US)\n* en-GB (English, UK)\n* bg (Bulgarian)\n* zh-CN (Chinese, China)\n* zh-TW (Chinese, Taiwan)\n* hr (Croatian)\n* cs (Czech)\n* da (Danish)\n* nl (Dutch)\n* fi (Finnish)\n* fr (French)\n* de (German)\n* el (Greek)\n* hi (Hindi)\n* hu (Hungarian)\n* it (Italian)\n* ja (Japanese)\n* ko (Korean)\n* lt (Lithuanian)\n* no (Norwegian)\n* pl (Polish)\n* pt-BR (Portuguese, Brazilian)\n* ro (Romanian, Romania)\n* ru (Russian)\n* es-ES (Spanish)\n* sv-SE (Swedish)\n* th (Thai)\n* tr (Turkish)\n* uk (Ukrainian)\n* vi (Vietnamese)","see":["{@link https://discord.com/developers/docs/reference#locales}"],"type":[[["string"]]],"meta":{"line":84,"file":"Interaction.js","path":"src/structures"}},{"name":"InteractionCollectorOptions","type":[[["CollectorOptions"]]],"props":[{"name":"channel","description":"The channel to listen to interactions from","optional":true,"type":[[["TextBasedChannelsResolvable"]]]},{"name":"componentType","description":"The type of component to listen for","optional":true,"type":[[["MessageComponentType"]]]},{"name":"guild","description":"The guild to listen to interactions from","optional":true,"type":[[["GuildResolvable"]]]},{"name":"interactionType","description":"The type of interaction to listen for","optional":true,"type":[[["InteractionType"]]]},{"name":"max","description":"The maximum total amount of interactions to collect","optional":true,"type":[[["number"]]]},{"name":"maxComponents","description":"The maximum number of components to collect","optional":true,"type":[[["number"]]]},{"name":"maxUsers","description":"The maximum number of users to interact","optional":true,"type":[[["number"]]]},{"name":"message","description":"The message to listen to interactions from","optional":true,"type":[[["Message"]],[["APIMessage"]]]}],"meta":{"line":8,"file":"InteractionCollector.js","path":"src/structures"}},{"name":"ApplicationExecutable","type":[[["Object"]]],"props":[{"name":"os","description":"The operating system the executable can be found on","type":[[["string"]]]},{"name":"name","description":"The name of the executable","type":[[["string"]]]},{"name":"is_launcher","description":"Whether the executable is for a game launcher","type":[[["boolean"]]]}],"meta":{"line":275,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"ApplicationSku","type":[[["Object"]]],"props":[{"name":"id","description":"The ID of the game","nullable":true,"type":[[["Snowflake"]]]},{"name":"sku","description":"The SKU of the game","nullable":true,"type":[[["string"]]]},{"name":"distributor","description":"The distributor of the game","type":[[["string"]]]}],"meta":{"line":292,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"Company","type":[[["Object"]]],"props":[{"name":"id","description":"The ID of the company","nullable":true,"type":[[["Snowflake"]]]},{"name":"name","description":"The name of the company","nullable":true,"type":[[["string"]]]}],"meta":{"line":369,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"ApplicationAsset","description":"Asset data.","type":[[["Object"]]],"props":[{"name":"id","description":"The asset's id","type":[[["Snowflake"]]]},{"name":"name","description":"The asset's name","type":[[["string"]]]},{"name":"type","description":"The asset's type","type":[[["string"]]]}],"meta":{"line":777,"file":"Application.js","path":"src/structures/interfaces"}},{"name":"CollectorFilter","description":"Filter to be applied to the collector.","type":[[["function"]]],"params":[{"name":"args","description":"Any arguments received by the listener","variable":true,"type":[["*"]]},{"name":"collection","description":"The items collected by this collector","type":[[["Collection"]]]}],"returns":[[["boolean"]],[["Promise","<"],["boolean",">"]]],"meta":{"line":9,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"CollectorOptions","description":"Options to be applied to the collector.","type":[[["Object"]]],"props":[{"name":"filter","description":"The filter applied to this collector","optional":true,"type":[[["CollectorFilter"]]]},{"name":"time","description":"How long to run the collector for in milliseconds","optional":true,"type":[[["number"]]]},{"name":"idle","description":"How long to stop the collector after inactivity in milliseconds","optional":true,"type":[[["number"]]]},{"name":"dispose","description":"Whether to dispose data when it's deleted","optional":true,"default":false,"type":[[["boolean"]]]}],"meta":{"line":17,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"CollectorResetTimerOptions","description":"Options used to reset the timeout and idle timer of a {@link Collector}.","type":[[["Object"]]],"props":[{"name":"time","description":"How long to run the collector for (in milliseconds)","optional":true,"type":[[["number"]]]},{"name":"idle","description":"How long to wait to stop the collector after inactivity (in milliseconds)","optional":true,"type":[[["number"]]]}],"meta":{"line":202,"file":"Collector.js","path":"src/structures/interfaces"}},{"name":"InteractionDeferReplyOptions","description":"Options for deferring the reply to an {@link Interaction}.","type":[[["Object"]]],"props":[{"name":"ephemeral","description":"Whether the reply should be ephemeral","optional":true,"type":[[["boolean"]]]},{"name":"fetchReply","description":"Whether to fetch the reply","optional":true,"type":[[["boolean"]]]}],"meta":{"line":15,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"InteractionDeferUpdateOptions","description":"Options for deferring and updating the reply to a {@link MessageComponentInteraction}.","type":[[["Object"]]],"props":[{"name":"fetchReply","description":"Whether to fetch the reply","optional":true,"type":[[["boolean"]]]}],"meta":{"line":22,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"InteractionReplyOptions","description":"Options for a reply to an {@link Interaction}.","type":[[["BaseMessageOptionsWithPoll"]]],"props":[{"name":"ephemeral","description":"Whether the reply should be ephemeral","optional":true,"type":[[["boolean"]]]},{"name":"fetchReply","description":"Whether to fetch the reply","optional":true,"type":[[["boolean"]]]},{"name":"flags","description":"Which flags to set for the message.\nOnly `SUPPRESS_EMBEDS` and `EPHEMERAL` can be set.","optional":true,"type":[[["MessageFlags"]]]}],"meta":{"line":28,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"InteractionUpdateOptions","description":"Options for updating the message received from a {@link MessageComponentInteraction}.","type":[[["MessageEditOptions"]]],"props":[{"name":"fetchReply","description":"Whether to fetch the reply","optional":true,"type":[[["boolean"]]]}],"meta":{"line":37,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"InteractionEditReplyOptions","description":"Options that can be passed into {@link InteractionResponses#editReply}.","type":[[["WebhookEditMessageOptions"]]],"props":[{"name":"message","description":"The response to edit","optional":true,"default":"'@original'","type":[[["MessageResolvable"]],[["original","'"]]]}],"meta":{"line":131,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"AwaitModalSubmitOptions","description":"An object containing the same properties as CollectorOptions, but a few more:","type":[[["Object"]]],"props":[{"name":"filter","description":"The filter applied to this collector","optional":true,"type":[[["CollectorFilter"]]]},{"name":"time","description":"Time in milliseconds to wait for an interaction before rejecting","type":[[["number"]]]}],"meta":{"line":256,"file":"InteractionResponses.js","path":"src/structures/interfaces"}},{"name":"PollAnswerData","description":"Represents the data for a poll answer.","type":[[["Object"]]],"props":[{"name":"text","description":"The text for the poll answer","type":[[["string"]]]},{"name":"emoji","description":"The emoji for the poll answer","optional":true,"type":[[["EmojiIdentifierResolvable"]]]}],"meta":{"line":64,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"PollData","description":"Represents the data for a poll.","type":[[["Object"]]],"props":[{"name":"question","description":"The question for the poll","type":[[["PollQuestionMedia"]]]},{"name":"answers","description":"The answers for the poll","type":[[["Array","<"],["PollAnswerData",">"]]]},{"name":"duration","description":"The duration in hours for the poll","type":[[["number"]]]},{"name":"allowMultiselect","description":"Whether the poll allows multiple answers","type":[[["boolean"]]]},{"name":"layoutType","description":"The layout type for the poll","optional":true,"type":[[["PollLayoutType"]]]}],"meta":{"line":71,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"BaseMessageOptions","description":"Base options provided when sending.","type":[[["Object"]]],"props":[{"name":"activity","description":"Group activity","optional":true,"type":[[["MessageActivity"]]]},{"name":"tts","description":"Whether or not the message should be spoken aloud","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"nonce","description":"The nonce for the message","optional":true,"default":"''","type":[[["string"]]]},{"name":"content","description":"The content for the message","optional":true,"default":"''","type":[[["string"]]]},{"name":"embeds","description":"The embeds for the message\n(see [here](https://discord.com/developers/docs/resources/channel#embed-object) for more details)","optional":true,"type":[[["Array","<("],["MessageEmbed","|"],["APIEmbed",")>"]]]},{"name":"allowedMentions","description":"Which mentions should be parsed from the message content\n(see [here](https://discord.com/developers/docs/resources/channel#allowed-mentions-object) for more details)","optional":true,"type":[[["MessageMentionOptions"]]]},{"name":"files","description":"Files to send with the message","optional":true,"type":[[["Array","<("],["FileOptions","|"],["BufferResolvable","|"],["Array","<"],["MessageAttachment",">)>"]]]},{"name":"components","description":"Action rows containing interactive components for the message (buttons, select menus)","optional":true,"type":[[["Array","<("],["MessageActionRow","|"],["MessageActionRowOptions",")>"]]]},{"name":"attachments","description":"Attachments to send in the message","optional":true,"type":[[["Array","<"],["MessageAttachment",">"]]]}],"meta":{"line":81,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"BaseMessageOptionsWithPoll","description":"The base message options for messages including a poll.","type":[[["BaseMessageOptions"]]],"props":[{"name":"poll","description":"The poll to send with the message","optional":true,"type":[[["PollData"]]]}],"meta":{"line":98,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"ForwardOptions","type":[[["Object"]]],"props":[{"name":"message","description":"The originating message","type":[[["MessageResolvable"]]]},{"name":"channel","description":"The channel of the originating message","optional":true,"type":[[["TextBasedChannelResolvable"]]]},{"name":"guild","description":"The guild of the originating message","optional":true,"type":[[["GuildResolvable"]]]}],"meta":{"line":104,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"MessageOptions","description":"Options provided when sending or editing a message.","type":[[["BaseMessageOptions"]]],"props":[{"name":"reply","description":"The options for replying to a message","optional":true,"type":[[["ReplyOptions"]]]},{"name":"forward","description":"The options for forwarding a message","optional":true,"type":[[["ForwardOptions"]]]},{"name":"stickers","description":"Stickers to send in the message","optional":true,"default":"[]","type":[[["Array","<"],["StickerResolvable",">"]]]},{"name":"flags","description":"Which flags to set for the message.\nOnly `SUPPRESS_EMBEDS`, `SUPPRESS_NOTIFICATIONS` and `IS_VOICE_MESSAGE` can be set.","optional":true,"type":[[["MessageFlags"]]]}],"meta":{"line":111,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"MessageMentionOptions","description":"Options provided to control parsing of mentions by Discord","type":[[["Object"]]],"props":[{"name":"parse","description":"Types of mentions to be parsed","optional":true,"type":[[["Array","<"],["MessageMentionTypes",">"]]]},{"name":"users","description":"Snowflakes of Users to be parsed as mentions","optional":true,"type":[[["Array","<"],["Snowflake",">"]]]},{"name":"roles","description":"Snowflakes of Roles to be parsed as mentions","optional":true,"type":[[["Array","<"],["Snowflake",">"]]]},{"name":"repliedUser","description":"Whether the author of the Message being replied to should be pinged","optional":true,"default":true,"type":[[["boolean"]]]}],"meta":{"line":121,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"MessageMentionTypes","description":"Types of mentions to enable in MessageMentionOptions.\n- `roles`\n- `users`\n- `everyone`","type":[[["string"]]],"meta":{"line":130,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"FileOptions","type":[[["Object"]]],"props":[{"name":"attachment","description":"File to attach","type":[[["BufferResolvable"]]]},{"name":"name","description":"Filename of the attachment","optional":true,"default":"'file.jpg'","type":[[["string"]]]},{"name":"description","description":"The description of the file","type":[[["string"]]]}],"meta":{"line":138,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"ReplyOptions","description":"Options for sending a message with a reply.","type":[[["Object"]]],"props":[{"name":"messageReference","description":"The message to reply to (must be in the same channel and not system)","type":[[["MessageResolvable"]]]},{"name":"failIfNotExists","description":"Whether to error if the referenced message\ndoes not exist (creates a standard message in this case when false)","optional":true,"default":true,"type":[[["boolean"]]]}],"meta":{"line":145,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"AwaitMessagesOptions","description":"An object containing the same properties as CollectorOptions, but a few more:","type":[[["MessageCollectorOptions"]]],"props":[{"name":"errors","description":"Stop/end reasons that cause the promise to reject","optional":true,"type":[[["Array","<"],["string",">"]]]}],"meta":{"line":414,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"ChannelWebhookCreateOptions","description":"Options used to create a {@link Webhook} in a guild text-based channel.","type":[[["Object"]]],"props":[{"name":"avatar","description":"Avatar for the webhook","optional":true,"nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]]]},{"name":"reason","description":"Reason for creating the webhook","optional":true,"type":[[["string"]]]}],"meta":{"line":459,"file":"TextBasedChannel.js","path":"src/structures/interfaces"}},{"name":"TargetType","description":"The type of the invite target:\n* 1: STREAM\n* 2: EMBEDDED_APPLICATION\n* 3: ROLE_SUBSCRIPTIONS\n* 4: CREATOR_PAGE","see":["{@link https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types}"],"type":[[["number"]]],"meta":{"line":155,"file":"Invite.js","path":"src/structures"}},{"name":"InviteType","description":"The type of the invite:\n* 0: GUILD\n* 1: GROUP_DM\n* 2: FRIEND","see":["{@link https://docs.discord.food/resources/invite#invite-type}"],"type":[[["number"]]],"meta":{"line":175,"file":"Invite.js","path":"src/structures"}},{"name":"TopLevelComponent","type":[[["MessageActionRow"]],[["ContainerComponent"]],[["FileComponent"]],[["MediaGalleryComponent"]],[["SectionComponent"]],[["SeparatorComponent"]],[["TextDisplayComponent"]]],"meta":{"line":163,"file":"Message.js","path":"src/structures"}},{"name":"MessageReference","description":"Reference data sent in a message that contains ids identifying the referenced message.\nThis can be present in the following types of message:\n* Crossposted messages (IS_CROSSPOST {@link MessageFlags.FLAGS message flag})\n* CHANNEL_FOLLOW_ADD\n* CHANNEL_PINNED_MESSAGE\n* REPLY\n* THREAD_STARTER_MESSAGE","see":["{@link https://discord.com/developers/docs/resources/channel#message-types}"],"type":[[["Object"]]],"props":[{"name":"channelId","description":"The channel's id the message was referenced","type":[[["Snowflake"]]]},{"name":"guildId","description":"The guild's id the message was referenced","nullable":true,"type":[[["Snowflake"]]]},{"name":"messageId","description":"The message's id that was referenced","nullable":true,"type":[[["Snowflake"]]]},{"name":"type","description":"The type of the message reference","type":[[["MessageReferenceType"]]]}],"meta":{"line":327,"file":"Message.js","path":"src/structures"}},{"name":"MessageInteraction","description":"Partial data of the interaction that a message is a reply to","type":[[["Object"]]],"props":[{"name":"id","description":"The interaction's id","type":[[["Snowflake"]]]},{"name":"type","description":"The type of the interaction","type":[[["InteractionType"]]]},{"name":"commandName","description":"The name of the interaction's application command,\nas well as the subcommand and subcommand group, where applicable","type":[[["string"]]]},{"name":"user","description":"The user that invoked the interaction","type":[[["User"]]]}],"meta":{"line":362,"file":"Message.js","path":"src/structures"}},{"name":"MessageCall","description":"A call associated with a message","type":[[["Object"]]],"props":[{"name":"endedAt","description":"The time the call ended","type":[[["Readonly",""]]]},{"name":"endedTimestamp","description":"The timestamp the call ended","nullable":true,"type":[[["number"]]]},{"name":"participants","description":"The ids of the users that participated in the call","type":[[["Array","<"],["Snowflake",">"]]]}],"meta":{"line":410,"file":"Message.js","path":"src/structures"}},{"name":"AwaitReactionsOptions","description":"An object containing the same properties as CollectorOptions, but a few more:","type":[[["ReactionCollectorOptions"]]],"props":[{"name":"errors","description":"Stop/end reasons that cause the promise to reject","optional":true,"type":[[["Array","<"],["string",">"]]]}],"meta":{"line":575,"file":"Message.js","path":"src/structures"}},{"name":"MessageEditOptions","description":"Options that can be passed into {@link Message#edit}.","type":[[["Object"]]],"props":[{"name":"content","description":"Content to be edited","optional":true,"nullable":true,"type":[[["string"]]]},{"name":"embeds","description":"Embeds to be added/edited","optional":true,"type":[[["Array","<"],["MessageEmbed",">"]],[["Array","<"],["APIEmbed",">"]]]},{"name":"allowedMentions","description":"Which mentions should be parsed from the message content","optional":true,"type":[[["MessageMentionOptions"]]]},{"name":"flags","description":"Which flags to set for the message. Only `SUPPRESS_EMBEDS` can be edited.","optional":true,"type":[[["MessageFlags"]]]},{"name":"attachments","description":"An array of attachments to keep,\nall attachments will be kept if omitted","optional":true,"type":[[["Array","<"],["MessageAttachment",">"]]]},{"name":"files","description":"Files to add to the message","optional":true,"type":[[["Array","<"],["FileOptions",">"]],[["Array","<"],["BufferResolvable",">"]],[["Array","<"],["MessageAttachment",">"]]]},{"name":"components","description":"Action rows containing interactive components for the message (buttons, select menus)","optional":true,"type":[[["Array","<"],["MessageActionRow",">"]],[["Array","<"],["MessageActionRowOptions",">"]]]}],"meta":{"line":722,"file":"Message.js","path":"src/structures"}},{"name":"ReplyMessageOptions","description":"Options provided when sending a message as an inline reply.","type":[[["BaseMessageOptions"]]],"props":[{"name":"failIfNotExists","description":"Whether to error if the referenced message\ndoes not exist (creates a standard message in this case when false)","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"stickers","description":"Stickers to send in the message","optional":true,"default":"[]","type":[[["Array","<"],["StickerResolvable",">"]]]}],"meta":{"line":846,"file":"Message.js","path":"src/structures"}},{"name":"ThreadAutoArchiveDuration","description":"A number that is allowed to be the duration (in minutes) of inactivity after which a thread is automatically\narchived. This can be:\n* `60` (1 hour)\n* `1440` (1 day)\n* `4320` (3 days)\n* `10080` (7 days)\n* `'MAX'` (7 days)\nThis option is deprecated and will be removed in the next major version.","type":[[["number"]],[["string"]]],"meta":{"line":898,"file":"Message.js","path":"src/structures"}},{"name":"StartThreadOptions","description":"Options for starting a thread on a message.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the new thread","type":[[["string"]]]},{"name":"autoArchiveDuration","description":"The amount of\ntime (in minutes) after which the thread should automatically archive in case of no recent activity","optional":true,"default":"this.channel.defaultAutoArchiveDuration","type":[[["ThreadAutoArchiveDuration"]]]},{"name":"reason","description":"Reason for creating the thread","optional":true,"type":[[["string"]]]},{"name":"rateLimitPerUser","description":"The rate limit per user (slowmode) for the thread in seconds","optional":true,"type":[[["number"]]]}],"meta":{"line":910,"file":"Message.js","path":"src/structures"}},{"name":"MessageActionRowComponent","description":"Components that can be placed in an action row\n* MessageButton\n* MessageSelectMenu\n* TextInputComponent","type":[[["MessageButton"]],[["MessageSelectMenu"]],[["TextInputComponent"]]],"meta":{"line":11,"file":"MessageActionRow.js","path":"src/structures"}},{"name":"MessageActionRowComponentOptions","description":"Options for components that can be placed in an action row\n* MessageButtonOptions\n* MessageSelectMenuOptions\n* TextInputComponentOptions","type":[[["MessageButtonOptions"]],[["MessageSelectMenuOptions"]],[["TextInputComponentOptions"]]],"meta":{"line":19,"file":"MessageActionRow.js","path":"src/structures"}},{"name":"MessageActionRowComponentResolvable","description":"Data that can be resolved into components that can be placed in an action row\n* MessageActionRowComponent\n* MessageActionRowComponentOptions","type":[[["MessageActionRowComponent"]],[["MessageActionRowComponentOptions"]]],"meta":{"line":27,"file":"MessageActionRow.js","path":"src/structures"}},{"name":"MessageActionRowOptions","type":[[["BaseMessageComponentOptions"]]],"props":[{"name":"components","description":"The components to place in this action row","optional":true,"type":[[["Array","<"],["MessageActionRowComponentResolvable",">"]]]}],"meta":{"line":34,"file":"MessageActionRow.js","path":"src/structures"}},{"name":"MessageButtonOptions","type":[[["BaseMessageComponentOptions"]]],"props":[{"name":"label","description":"The text to be displayed on this button","optional":true,"type":[[["string"]]]},{"name":"customId","description":"A unique string to be sent in the interaction when clicked","optional":true,"type":[[["string"]]]},{"name":"style","description":"The style of this button","optional":true,"type":[[["MessageButtonStyleResolvable"]]]},{"name":"emoji","description":"The emoji to be displayed to the left of the text","optional":true,"type":[[["EmojiIdentifierResolvable"]]]},{"name":"url","description":"Optional URL for link-style buttons","optional":true,"type":[[["string"]]]},{"name":"disabled","description":"Disables the button to prevent interactions","optional":true,"default":false,"type":[[["boolean"]]]}],"meta":{"line":13,"file":"MessageButton.js","path":"src/structures"}},{"name":"MessageButtonStyleResolvable","description":"Data that can be resolved to a MessageButtonStyle. This can be\n* MessageButtonStyle\n* number","type":[[["number"]],[["MessageButtonStyle"]]],"meta":{"line":148,"file":"MessageButton.js","path":"src/structures"}},{"name":"MessageCollectorOptions","type":[[["CollectorOptions"]]],"props":[{"name":"max","description":"The maximum amount of messages to collect","type":[[["number"]]]},{"name":"maxProcessed","description":"The maximum amount of messages to process","type":[[["number"]]]}],"meta":{"line":6,"file":"MessageCollector.js","path":"src/structures"}},{"name":"APIMessageActionRowComponent","description":"Raw message components from the API\n* APIMessageButton\n* APIMessageSelectMenu","type":[[["APIMessageButton"]],[["APIMessageSelectMenu"]]],"meta":{"line":66,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"Partial","description":"A `Partial` object is a representation of any existing object.\nThis object contains between 0 and all of the original objects parameters.\nThis is true regardless of whether the parameters are optional in the base object.","type":[[["Object"]]],"meta":{"line":22,"file":"WebEmbed.js","path":"src/structures"}},{"name":"MessageEmbedOptions","description":"Represents the possible options for a MessageEmbed","type":[[["Object"]]],"props":[{"name":"title","description":"The title of this embed","optional":true,"type":[[["string"]]]},{"name":"description","description":"The description of this embed","optional":true,"type":[[["string"]]]},{"name":"url","description":"The URL of this embed","optional":true,"type":[[["string"]]]},{"name":"timestamp","description":"The timestamp of this embed","optional":true,"type":[[["Date"]],[["number"]]]},{"name":"color","description":"The color of this embed","optional":true,"type":[[["ColorResolvable"]]]},{"name":"fields","description":"The fields of this embed","optional":true,"type":[[["Array","<"],["EmbedFieldData",">"]]]},{"name":"author","description":"The author of this embed","optional":true,"type":[[["Partial","<"],["MessageEmbedAuthor",">"]]]},{"name":"thumbnail","description":"The thumbnail of this embed","optional":true,"type":[[["Partial","<"],["MessageEmbedThumbnail",">"]]]},{"name":"image","description":"The image of this embed","optional":true,"type":[[["Partial","<"],["MessageEmbedImage",">"]]]},{"name":"video","description":"The video of this embed","optional":true,"type":[[["Partial","<"],["MessageEmbedVideo",">"]]]},{"name":"footer","description":"The footer of this embed","optional":true,"type":[[["Partial","<"],["MessageEmbedFooter",">"]]]}],"meta":{"line":24,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"EmbedField","description":"Represents a field of a MessageEmbed","type":[[["Object"]]],"props":[{"name":"name","description":"The name of this field","type":[[["string"]]]},{"name":"value","description":"The value of this field","type":[[["string"]]]},{"name":"inline","description":"If this field will be displayed inline","type":[[["boolean"]]]}],"meta":{"line":93,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"MessageEmbedThumbnail","description":"Represents the thumbnail of a MessageEmbed","type":[[["Object"]]],"props":[{"name":"url","description":"URL for this thumbnail","type":[[["string"]]]},{"name":"proxyURL","description":"ProxyURL for this thumbnail","type":[[["string"]]]},{"name":"height","description":"Height of this thumbnail","type":[[["number"]]]},{"name":"width","description":"Width of this thumbnail","type":[[["number"]]]}],"meta":{"line":110,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"MessageEmbedImage","description":"Represents the image of a MessageEmbed","type":[[["Object"]]],"props":[{"name":"url","description":"URL for this image","type":[[["string"]]]},{"name":"proxyURL","description":"ProxyURL for this image","type":[[["string"]]]},{"name":"height","description":"Height of this image","type":[[["number"]]]},{"name":"width","description":"Width of this image","type":[[["number"]]]}],"meta":{"line":132,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"MessageEmbedVideo","description":"Represents the video of a MessageEmbed","type":[[["Object"]]],"props":[{"name":"url","description":"URL of this video","type":[[["string"]]]},{"name":"proxyURL","description":"ProxyURL for this video","type":[[["string"]]]},{"name":"height","description":"Height of this video","type":[[["number"]]]},{"name":"width","description":"Width of this video","type":[[["number"]]]}],"meta":{"line":154,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"MessageEmbedAuthor","description":"Represents the author field of a MessageEmbed","type":[[["Object"]]],"props":[{"name":"name","description":"The name of this author","type":[[["string"]]]},{"name":"url","description":"URL of this author","type":[[["string"]]]},{"name":"iconURL","description":"URL of the icon for this author","type":[[["string"]]]},{"name":"proxyIconURL","description":"Proxied URL of the icon for this author","type":[[["string"]]]}],"meta":{"line":177,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"MessageEmbedProvider","description":"Represents the provider of a MessageEmbed","type":[[["Object"]]],"props":[{"name":"name","description":"The name of this provider","type":[[["string"]]]},{"name":"url","description":"URL of this provider","type":[[["string"]]]}],"meta":{"line":199,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"MessageEmbedFooter","description":"Represents the footer field of a MessageEmbed","type":[[["Object"]]],"props":[{"name":"text","description":"The text of this footer","type":[[["string"]]]},{"name":"iconURL","description":"URL of the icon for this footer","type":[[["string"]]]},{"name":"proxyIconURL","description":"Proxied URL of the icon for this footer","type":[[["string"]]]}],"meta":{"line":217,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"EmbedAuthorData","description":"The options to provide for setting an author for a {@link WebEmbed}.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of this author.","type":[[["string"]]]}],"meta":{"line":185,"file":"WebEmbed.js","path":"src/structures"}},{"name":"EmbedFooterData","description":"The options to provide for setting a footer for a {@link MessageEmbed}.","type":[[["Object"]]],"props":[{"name":"text","description":"The text of the footer.","type":[[["string"]]]},{"name":"iconURL","description":"The icon URL of the footer.","optional":true,"type":[[["string"]]]}],"meta":{"line":427,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"EmbedFieldData","type":[[["Object"]]],"props":[{"name":"name","description":"The name of this field","type":[[["string"]]]},{"name":"value","description":"The value of this field","type":[[["string"]]]},{"name":"inline","description":"If this field will be displayed inline","optional":true,"type":[[["boolean"]]]}],"meta":{"line":570,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"CrosspostedChannel","description":"Crossposted channel data.","type":[[["Object"]]],"props":[{"name":"channelId","description":"The mentioned channel's id","type":[[["Snowflake"]]]},{"name":"guildId","description":"The id of the guild that has the channel","type":[[["Snowflake"]]]},{"name":"type","description":"The channel's type","type":[[["ChannelType"]]]},{"name":"name","description":"The channel's name","type":[[["string"]]]}],"meta":{"line":103,"file":"MessageMentions.js","path":"src/structures"}},{"name":"MessageMentionsHasOptions","description":"Options used to check for a mention.","type":[[["Object"]]],"props":[{"name":"ignoreDirect","description":"Whether to ignore direct mentions to the item","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"ignoreRoles","description":"Whether to ignore role mentions to a guild member","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"ignoreRepliedUser","description":"Whether to ignore replied user mention to an user","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"ignoreEveryone","description":"Whether to ignore `@everyone`/`@here` mentions","optional":true,"default":false,"type":[[["boolean"]]]}],"meta":{"line":195,"file":"MessageMentions.js","path":"src/structures"}},{"name":"MessageTarget","description":"A target for a message.","type":[[["TextBasedChannels"]],[["User"]],[["GuildMember"]],[["Webhook"]],[["WebhookClient"]],[["Interaction"]],[["InteractionWebhook"]],[["Message"]],[["MessageManager"]]],"meta":{"line":345,"file":"MessagePayload.js","path":"src/structures"}},{"name":"MessageFile","type":[[["Object"]]],"props":[{"name":"attachment","description":"The original attachment that generated this file","type":[[["Buffer"]],[["string"]],[["Stream"]]]},{"name":"name","description":"The name of this file","type":[[["string"]]]},{"name":"file","description":"The file to be sent to the API","type":[[["Buffer"]],[["Stream"]]]}],"meta":{"line":41,"file":"MessagePayload.js","path":"src/structures"}},{"name":"ReactionCountDetailsData","description":"The reaction count details object contains information about super and normal reaction counts.","type":[[["Object"]]],"props":[{"name":"burst","description":"Count of super reactions","type":[[["number"]]]},{"name":"normal","description":"Count of normal reactions","type":[[["number"]]]}],"meta":{"line":70,"file":"MessageReaction.js","path":"src/structures"}},{"name":"MessageSelectMenuOptions","type":[[["BaseMessageComponentOptions"]]],"props":[{"name":"customId","description":"A unique string to be sent in the interaction when clicked","optional":true,"type":[[["string"]]]},{"name":"placeholder","description":"Custom placeholder text to display when nothing is selected","optional":true,"type":[[["string"]]]},{"name":"minValues","description":"The minimum number of selections required","optional":true,"type":[[["number"]]]},{"name":"maxValues","description":"The maximum number of selections allowed","optional":true,"type":[[["number"]]]},{"name":"options","description":"Options for the select menu","optional":true,"type":[[["Array","<"],["MessageSelectOption",">"]]]},{"name":"disabled","description":"Disables the select menu to prevent interactions","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"channelTypes","description":"List of channel types to include in the ChannelSelect component","optional":true,"type":[[["Array","<"],["ChannelType",">"]]]}],"meta":{"line":12,"file":"MessageSelectMenu.js","path":"src/structures"}},{"name":"MessageSelectOption","type":[[["Object"]]],"props":[{"name":"label","description":"The text to be displayed on this option","type":[[["string"]]]},{"name":"value","description":"The value to be sent for this option","type":[[["string"]]]},{"name":"description","description":"Optional description to show for this option","nullable":true,"type":[[["string"]]]},{"name":"emoji","description":"Emoji to display for this option","nullable":true,"type":[[["RawEmoji"]]]},{"name":"default","description":"Render this option as the default selection","type":[[["boolean"]]]}],"meta":{"line":23,"file":"MessageSelectMenu.js","path":"src/structures"}},{"name":"MessageSelectOptionData","type":[[["Object"]]],"props":[{"name":"label","description":"The text to be displayed on this option","type":[[["string"]]]},{"name":"value","description":"The value to be sent for this option","type":[[["string"]]]},{"name":"description","description":"Optional description to show for this option","optional":true,"type":[[["string"]]]},{"name":"emoji","description":"Emoji to display for this option","optional":true,"type":[[["EmojiIdentifierResolvable"]]]},{"name":"default","description":"Render this option as the default selection","optional":true,"type":[[["boolean"]]]}],"meta":{"line":32,"file":"MessageSelectMenu.js","path":"src/structures"}},{"name":"PartialTextInputData","type":[[["Object"]]],"props":[{"name":"customId","description":"A unique string to be sent in the interaction when submitted","optional":true,"type":[[["string"]]]},{"name":"type","description":"The type of this component","optional":true,"type":[[["MessageComponentType"]]]},{"name":"value","description":"Value of this text input component","optional":true,"type":[[["string"]]]}],"meta":{"line":24,"file":"ModalSubmitInteraction.js","path":"src/structures"}},{"name":"PartialModalActionRow","type":[[["Object"]]],"props":[{"name":"type","description":"The type of this component","optional":true,"type":[[["MessageComponentType"]]]},{"name":"components","description":"Partial text input components","optional":true,"type":[[["Array","<"],["PartialTextInputData",">"]]]}],"meta":{"line":31,"file":"ModalSubmitInteraction.js","path":"src/structures"}},{"name":"PermissionOverwriteOptions","description":"An object mapping permission flags to `true` (enabled), `null` (unset) or `false` (disabled).\n```js\n{\n 'SEND_MESSAGES': true,\n 'EMBED_LINKS': null,\n 'ATTACH_FILES': false,\n}\n```","type":[[["Object"]]],"meta":{"line":97,"file":"PermissionOverwrites.js","path":"src/structures"}},{"name":"ResolvedOverwriteOptions","type":[[["Object"]]],"props":[{"name":"allow","description":"The allowed permissions","type":[[["Permissions"]]]},{"name":"deny","description":"The denied permissions","type":[[["Permissions"]]]}],"meta":{"line":109,"file":"PermissionOverwrites.js","path":"src/structures"}},{"name":"RawOverwriteData","description":"The raw data for a permission overwrite","type":[[["Object"]]],"props":[{"name":"id","description":"The id of the {@link Role} or {@link User} this overwrite belongs to","type":[[["Snowflake"]]]},{"name":"allow","description":"The permissions to allow","type":[[["string"]]]},{"name":"deny","description":"The permissions to deny","type":[[["string"]]]},{"name":"type","description":"The type of this OverwriteData","type":[[["number"]]]}],"meta":{"line":141,"file":"PermissionOverwrites.js","path":"src/structures"}},{"name":"OverwriteResolvable","description":"Data that can be resolved into {@link RawOverwriteData}. This can be:\n* PermissionOverwrites\n* OverwriteData","type":[[["PermissionOverwrites"]],[["OverwriteData"]]],"meta":{"line":150,"file":"PermissionOverwrites.js","path":"src/structures"}},{"name":"OverwriteData","description":"Data that can be used for a permission overwrite","type":[[["Object"]]],"props":[{"name":"id","description":"Member or role this overwrite is for","type":[[["GuildMemberResolvable"]],[["RoleResolvable"]]]},{"name":"allow","description":"The permissions to allow","optional":true,"type":[[["PermissionResolvable"]]]},{"name":"deny","description":"The permissions to deny","optional":true,"type":[[["PermissionResolvable"]]]},{"name":"type","description":"The type of this OverwriteData","optional":true,"type":[[["OverwriteType"]]]}],"meta":{"line":157,"file":"PermissionOverwrites.js","path":"src/structures"}},{"name":"PollQuestionMedia","description":"The media for a poll's question","type":[[["Object"]]],"props":[{"name":"text","description":"The text of this question","type":[[["string"]]]}],"meta":{"line":26,"file":"Poll.js","path":"src/structures"}},{"name":"FetchPollVotersOptions","type":[[["Object"]]],"props":[{"name":"limit","description":"The maximum number of voters to fetch","optional":true,"type":[[["number"]]]},{"name":"after","description":"The user id to fetch voters after","optional":true,"type":[[["Snowflake"]]]}],"meta":{"line":67,"file":"PollAnswer.js","path":"src/structures"}},{"name":"MessageActivity","description":"Activity sent in a message.","type":[[["Object"]]],"props":[{"name":"partyId","description":"Id of the party represented in activity","optional":true,"type":[[["string"]]]},{"name":"type","description":"Type of activity sent","type":[[["MessageActivityType"]]]}],"meta":{"line":9,"file":"Presence.js","path":"src/structures"}},{"name":"PresenceStatus","description":"The status of this presence:\n* **`online`** - user is online\n* **`idle`** - user is AFK\n* **`offline`** - user is offline or invisible\n* **`dnd`** - user is in Do Not Disturb","type":[[["string"]]],"meta":{"line":16,"file":"Presence.js","path":"src/structures"}},{"name":"ClientPresenceStatus","description":"The status of this presence:\n* **`online`** - user is online\n* **`idle`** - user is AFK\n* **`dnd`** - user is in Do Not Disturb","type":[[["string"]]],"meta":{"line":25,"file":"Presence.js","path":"src/structures"}},{"name":"ActivityPlatform","description":"The platform of this activity:\n* **`desktop`**\n* **`samsung`** - playing on Samsung Galaxy\n* **`xbox`** - playing on Xbox Live\n* **`ios`**\n* **`android`**\n* **`embedded`**\n* **`ps4`**\n* **`ps5`**","type":[[["string"]]],"meta":{"line":172,"file":"Presence.js","path":"src/structures"}},{"name":"ActivityTimestamps","description":"Represents timestamps of an activity","type":[[["Object"]]],"props":[{"name":"start","description":"When the activity started","nullable":true,"type":[[["number"]]]},{"name":"end","description":"When the activity will end","nullable":true,"type":[[["number"]]]}],"meta":{"line":268,"file":"Presence.js","path":"src/structures"}},{"name":"ActivityParty","description":"Represents a party of an activity","type":[[["Object"]]],"props":[{"name":"id","description":"The party's id","nullable":true,"type":[[["string"]]]},{"name":"size","description":"Size of the party as `[current, max]`","type":[[["Array","<"],["number",">"]]]}],"meta":{"line":359,"file":"Presence.js","path":"src/structures"}},{"name":"RichPresenceImage","description":"Support:\n- cdn.discordapp.com\n- media.discordapp.net\n- Assets ID (https://discord.com/api/v9/oauth2/applications/{application_id}/assets)\n- Media Proxy (mp:external/{hash})\n- Twitch (twitch:{username})\n- YouTube (youtube:{video_id})\n- Spotify (spotify:{image_id})","type":[[["string"]]],"meta":{"line":580,"file":"Presence.js","path":"src/structures"}},{"name":"CustomStatusOptions","type":[[["Object"]]],"props":[{"name":"state","description":"The state to be displayed","optional":true,"type":[[["string"]]]},{"name":"emoji","description":"The emoji to be displayed","optional":true,"type":[[["EmojiIdentifierResolvable"]]]}],"meta":{"line":636,"file":"Presence.js","path":"src/structures"}},{"name":"RichParty","type":[[["Object"]]],"props":[{"name":"id","description":"The id of the party","type":[[["string"]]]},{"name":"max","description":"The maximum number of members in the party","type":[[["number"]]]},{"name":"current","description":"The current number of members in the party","type":[[["number"]]]}],"meta":{"line":813,"file":"Presence.js","path":"src/structures"}},{"name":"RichButton","type":[[["object"]]],"props":[{"name":"name","description":"The name of the button","type":[[["string"]]]},{"name":"url","description":"The url of the button","type":[[["string"]]]}],"meta":{"line":865,"file":"Presence.js","path":"src/structures"}},{"name":"ExternalAssets","type":[[["Object"]]],"props":[{"name":"url","description":"Orginal url of the image","nullable":true,"type":[[["string"]]]},{"name":"external_asset_path","description":"Proxy url of the image (Using to RPC)","nullable":true,"type":[[["string"]]]}],"meta":{"line":953,"file":"Presence.js","path":"src/structures"}},{"name":"SpotifyMetadata","type":[[["Object"]]],"props":[{"name":"album_id","description":"The Spotify ID of the album of the song being played","type":[[["string"]]]},{"name":"artist_ids","description":"The Spotify IDs of the artists of the song being played","type":[[["Array","<"],["string",">"]]]},{"name":"context_uri","description":"The Spotify URI of the current player context","type":[[["string"]]]}],"meta":{"line":1030,"file":"Presence.js","path":"src/structures"}},{"name":"ReactionCollectorOptions","type":[[["CollectorOptions"]]],"props":[{"name":"max","description":"The maximum total amount of reactions to collect","type":[[["number"]]]},{"name":"maxEmojis","description":"The maximum number of emojis to collect","type":[[["number"]]]},{"name":"maxUsers","description":"The maximum number of users to react","type":[[["number"]]]}],"meta":{"line":7,"file":"ReactionCollector.js","path":"src/structures"}},{"name":"RoleColors","type":[[["Object"]]],"props":[{"name":"primaryColor","description":"The primary color of the role","type":[[["number"]]]},{"name":"secondaryColor","description":"The secondary color of the role.\nThis will make the role a gradient between the other provided colors","nullable":true,"type":[[["number"]]]},{"name":"tertiaryColor","description":"The tertiary color of the role.\nWhen sending `tertiaryColor` the API enforces the role color to be a holographic style\nwith values of `primaryColor = 11127295`, `secondaryColor = 16759788`, and `tertiaryColor = 16761760`.\nThese values are available as a constant: `Constants.HolographicStyle`","nullable":true,"type":[[["number"]]]}],"meta":{"line":72,"file":"Role.js","path":"src/structures"}},{"name":"RoleData","description":"The data for a role.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the role","optional":true,"type":[[["string"]]]},{"name":"color","description":"The color of the role, either a hex string or a base 10 number\nThis property is deprecated. Use `colors` instead.","optional":true,"type":[[["ColorResolvable"]]]},{"name":"colors","description":"The colors of the role","optional":true,"type":[[["RoleColorsResolvable"]]]},{"name":"hoist","description":"Whether or not the role should be hoisted","optional":true,"type":[[["boolean"]]]},{"name":"position","description":"The position of the role","optional":true,"type":[[["number"]]]},{"name":"permissions","description":"The permissions of the role","optional":true,"type":[[["PermissionResolvable"]]]},{"name":"mentionable","description":"Whether or not the role should be mentionable","optional":true,"type":[[["boolean"]]]},{"name":"icon","description":"The icon for the role\nThe `EmojiResolvable` should belong to the same guild as the role.\nIf not, pass the emoji's URL directly","optional":true,"nullable":true,"type":[[["BufferResolvable"]],[["Base64Resolvable"]],[["EmojiResolvable"]]]},{"name":"unicodeEmoji","description":"The unicode emoji for the role","optional":true,"nullable":true,"type":[[["string"]]]}],"meta":{"line":290,"file":"Role.js","path":"src/structures"}},{"name":"SetRolePositionOptions","description":"Options used to set the position of a role.","type":[[["Object"]]],"props":[{"name":"relative","description":"Whether to change the position relative to its current value or not","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"reason","description":"The reason for changing the position","optional":true,"type":[[["string"]]]}],"meta":{"line":463,"file":"Role.js","path":"src/structures"}},{"name":"SessionClientInfo","type":[[["Object"]]],"props":[{"name":"location","description":"Location of the client (using IP address)","type":[[["string"]]]},{"name":"platform","description":"Platform of the client","type":[[["string"]]]},{"name":"os","description":"Operating system of the client","type":[[["string"]]]}],"meta":{"line":5,"file":"Session.js","path":"src/structures"}},{"name":"GuildStickerEditData","description":"Data for editing a sticker.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the sticker","optional":true,"type":[[["string"]]]},{"name":"description","description":"The description of the sticker","optional":true,"nullable":true,"type":[[["string"]]]},{"name":"tags","description":"The Discord name of a unicode emoji representing the sticker's expression","optional":true,"type":[[["string"]]]}],"meta":{"line":235,"file":"Sticker.js","path":"src/structures"}},{"name":"TextInputComponentOptions","type":[[["BaseMessageComponentOptions"]]],"props":[{"name":"customId","description":"A unique string to be sent in the interaction when submitted","optional":true,"type":[[["string"]]]},{"name":"label","description":"The text to be displayed above this text input component","optional":true,"type":[[["string"]]]},{"name":"maxLength","description":"Maximum length of text that can be entered","optional":true,"type":[[["number"]]]},{"name":"minLength","description":"Minimum length of text required to be entered","optional":true,"type":[[["number"]]]},{"name":"placeholder","description":"Custom placeholder text to display when no text is entered","optional":true,"type":[[["string"]]]},{"name":"required","description":"Whether or not this text input component is required","optional":true,"type":[[["boolean"]]]},{"name":"style","description":"The style of this text input component","optional":true,"type":[[["TextInputStyleResolvable"]]]},{"name":"value","description":"Value of this text input component","optional":true,"type":[[["string"]]]}],"meta":{"line":14,"file":"TextInputComponent.js","path":"src/structures"}},{"name":"TextInputStyleResolvable","description":"Data that can be resolved to a TextInputStyle. This can be\n* TextInputStyle\n* number","type":[[["number"]],[["TextInputStyle"]]],"meta":{"line":114,"file":"TextInputComponent.js","path":"src/structures"}},{"name":"ThreadEditData","description":"The options used to edit a thread channel","type":[[["Object"]]],"props":[{"name":"name","description":"The new name for the thread","optional":true,"type":[[["string"]]]},{"name":"archived","description":"Whether the thread is archived","optional":true,"type":[[["boolean"]]]},{"name":"autoArchiveDuration","description":"The amount of time (in minutes) after which the thread\nshould automatically archive in case of no recent activity","optional":true,"type":[[["ThreadAutoArchiveDuration"]]]},{"name":"rateLimitPerUser","description":"The rate limit per user (slowmode) for the thread in seconds","optional":true,"type":[[["number"]]]},{"name":"locked","description":"Whether the thread is locked","optional":true,"type":[[["boolean"]]]},{"name":"invitable","description":"Whether non-moderators can add other non-moderators to a thread\nCan only be edited on `GUILD_PRIVATE_THREAD`","optional":true,"type":[[["boolean"]]]},{"name":"appliedTags","description":"The tags to apply to the thread","optional":true,"type":[[["Array","<"],["Snowflake",">"]]]},{"name":"flags","description":"The flags to set on the channel","optional":true,"type":[[["ChannelFlagsResolvable"]]]}],"meta":{"line":314,"file":"ThreadChannel.js","path":"src/structures"}},{"name":"GuildForumTagEmoji","type":[[["Object"]]],"props":[{"name":"id","description":"The id of a guild's custom emoji","nullable":true,"type":[[["Snowflake"]]]},{"name":"name","description":"The unicode character of the emoji","nullable":true,"type":[[["string"]]]}],"meta":{"line":9,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"GuildForumTag","type":[[["Object"]]],"props":[{"name":"id","description":"The id of the tag","type":[[["Snowflake"]]]},{"name":"name","description":"The name of the tag","type":[[["string"]]]},{"name":"moderated","description":"Whether this tag can only be added to or removed from threads\nby a member with the `ManageThreads` permission","type":[[["boolean"]]]},{"name":"emoji","description":"The emoji of this tag","nullable":true,"type":[[["GuildForumTagEmoji"]]]}],"meta":{"line":15,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"GuildForumTagData","type":[[["Object"]]],"props":[{"name":"id","description":"The id of the tag","optional":true,"type":[[["Snowflake"]]]},{"name":"name","description":"The name of the tag","type":[[["string"]]]},{"name":"moderated","description":"Whether this tag can only be added to or removed from threads\nby a member with the `ManageThreads` permission","optional":true,"type":[[["boolean"]]]},{"name":"emoji","description":"The emoji of this tag","optional":true,"nullable":true,"type":[[["GuildForumTagEmoji"]]]}],"meta":{"line":24,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"DefaultReactionEmoji","type":[[["Object"]]],"props":[{"name":"id","description":"The id of a guild's custom emoji","nullable":true,"type":[[["Snowflake"]]]},{"name":"name","description":"The unicode character of the emoji","nullable":true,"type":[[["string"]]]}],"meta":{"line":33,"file":"ThreadOnlyChannel.js","path":"src/structures"}},{"name":"AvatarDecorationData","type":[[["Object"]]],"props":[{"name":"asset","description":"The avatar decoration hash","type":[[["string"]]]},{"name":"skuId","description":"The id of the avatar decoration's SKU","type":[[["Snowflake"]]]}],"meta":{"line":139,"file":"User.js","path":"src/structures"}},{"name":"UserPrimaryGuild","type":[[["Object"]]],"props":[{"name":"identityGuildId","description":"The id of the user's primary guild","nullable":true,"type":[[["Snowflake"]]]},{"name":"identityEnabled","description":"Whether the user is displaying the primary guild's tag","nullable":true,"type":[[["boolean"]]]},{"name":"tag","description":"The user's guild tag. Limited to 4 characters","nullable":true,"type":[[["string"]]]},{"name":"badge","description":"The guild tag badge hash","nullable":true,"type":[[["string"]]]}],"meta":{"line":162,"file":"User.js","path":"src/structures"}},{"name":"NameplateData","type":[[["Object"]]],"props":[{"name":"skuId","description":"The id of the nameplate's SKU","type":[[["Snowflake"]]]},{"name":"asset","description":"The nameplate's asset path","type":[[["string"]]]},{"name":"label","description":"The nameplate's label","type":[[["string"]]]},{"name":"palette","description":"Background color of the nameplate","type":[[["NameplatePalette"]]]}],"meta":{"line":189,"file":"User.js","path":"src/structures"}},{"name":"Collectibles","type":[[["Object"]]],"props":[{"name":"nameplate","description":"The user's nameplate data","nullable":true,"type":[[["NameplateData"]]]}],"meta":{"line":197,"file":"User.js","path":"src/structures"}},{"name":"WebEmbedOptions","description":"Represents the possible options for a WebEmbed","type":[[["Object"]]],"props":[{"name":"title","description":"The title of this embed","optional":true,"type":[[["string"]]]},{"name":"description","description":"The description of this embed","optional":true,"type":[[["string"]]]},{"name":"url","description":"The URL of this embed","optional":true,"type":[[["string"]]]},{"name":"color","description":"The color of this embed","optional":true,"type":[[["ColorResolvable"]]]},{"name":"author","description":"The author of this embed","optional":true,"type":[[["Partial","<"],["WebEmbedAuthor",">"]]]},{"name":"thumbnail","description":"The thumbnail of this embed","optional":true,"type":[[["Partial","<"],["WebEmbedThumbnail",">"]]]},{"name":"image","description":"The image of this embed","optional":true,"type":[[["Partial","<"],["WebEmbedImage",">"]]]},{"name":"video","description":"The video of this embed","optional":true,"type":[[["Partial","<"],["WebEmbedVideo",">"]]]},{"name":"footer","description":"The footer of this embed","optional":true,"type":[[["Partial","<"],["WebEmbedFooter",">"]]]},{"name":"provider","description":"The provider of this embed","optional":true,"type":[[["Partial","<"],["WebEmbedProvider",">"]]]},{"name":"redirect","description":"Redirect URL","optional":true,"type":[[["string"]]]}],"meta":{"line":29,"file":"WebEmbed.js","path":"src/structures"}},{"name":"WebEmbedImage","description":"Represents the image of a WebEmbed","type":[[["Object"]]],"props":[{"name":"url","description":"URL for this image","type":[[["string"]]]},{"name":"proxyURL","description":"ProxyURL for this image","type":[[["string"]]]},{"name":"height","description":"Height of this image","type":[[["number"]]]},{"name":"width","description":"Width of this image","type":[[["number"]]]}],"meta":{"line":85,"file":"WebEmbed.js","path":"src/structures"}},{"name":"WebEmbedVideo","description":"Represents the video of a WebEmbed","type":[[["Object"]]],"props":[{"name":"url","description":"URL of this video","type":[[["string"]]]},{"name":"proxyURL","description":"ProxyURL for this video","type":[[["string"]]]},{"name":"height","description":"Height of this video","type":[[["number"]]]},{"name":"width","description":"Width of this video","type":[[["number"]]]}],"meta":{"line":120,"file":"WebEmbed.js","path":"src/structures"}},{"name":"WebEmbedAuthor","description":"Represents the author field of a WebEmbed","type":[[["Object"]]],"props":[{"name":"name","description":"The name of this author","type":[[["string"]]]},{"name":"url","description":"URL of this author","type":[[["string"]]]}],"meta":{"line":143,"file":"WebEmbed.js","path":"src/structures"}},{"name":"WebEmbedProvider","description":"Represents the provider of a WebEmbed","type":[[["Object"]]],"props":[{"name":"name","description":"The name of this provider","type":[[["string"]]]},{"name":"url","description":"URL of this provider","type":[[["string"]]]}],"meta":{"line":161,"file":"WebEmbed.js","path":"src/structures"}},{"name":"EmbedProviderData","description":"The options to provide for setting an provider for a {@link WebEmbed}.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of this provider.","type":[[["string"]]]}],"meta":{"line":210,"file":"WebEmbed.js","path":"src/structures"}},{"name":"WebhookMessageOptions","description":"Options that can be passed into send.","type":[[["BaseMessageOptionsWithPoll"]]],"props":[{"name":"username","description":"Username override for the message","optional":true,"default":"this.name","type":[[["string"]]]},{"name":"avatarURL","description":"Avatar URL override for the message","optional":true,"type":[[["string"]]]},{"name":"threadId","description":"The id of the thread in the channel to send to.\nFor interaction webhooks, this property is ignored","optional":true,"type":[[["Snowflake"]]]},{"name":"threadName","description":"Name of the thread to create (only available if webhook is in a forum channel)","optional":true,"type":[[["string"]]]},{"name":"flags","description":"Which flags to set for the message. Only `SUPPRESS_EMBEDS` can be set.","optional":true,"type":[[["MessageFlags"]]]},{"name":"appliedTags","description":"The tags to apply to the created thread (only available if the webhook is in a forum channel)","optional":true,"type":[[["Array","<"],["Snowflake",">"]]]},{"name":"withComponents","description":"Whether to allow sending non-interactive components in the message.\nFor application-owned webhooks, this property is ignored","optional":true,"type":[[["boolean"]]]}],"meta":{"line":112,"file":"Webhook.js","path":"src/structures"}},{"name":"WebhookEditMessageOptions","description":"Options that can be passed into editMessage.","type":[[["Object"]]],"props":[{"name":"embeds","description":"See {@link WebhookMessageOptions#embeds}","optional":true,"type":[[["Array","<"],["MessageEmbed",">"]],[["Array","<"],["APIEmbed",">"]]]},{"name":"content","description":"See {@link BaseMessageOptions#content}","optional":true,"type":[[["string"]]]},{"name":"files","description":"See {@link BaseMessageOptions#files}","optional":true,"type":[[["Array","<"],["FileOptions",">"]],[["Array","<"],["BufferResolvable",">"]],[["Array","<"],["MessageAttachment",">"]]]},{"name":"allowedMentions","description":"See {@link BaseMessageOptions#allowedMentions}","optional":true,"type":[[["MessageMentionOptions"]]]},{"name":"attachments","description":"Attachments to send with the message","optional":true,"type":[[["Array","<"],["MessageAttachment",">"]]]},{"name":"components","description":"Action rows containing interactive components for the message (buttons, select menus)","optional":true,"type":[[["Array","<"],["MessageActionRow",">"]],[["Array","<"],["MessageActionRowOptions",">"]]]},{"name":"threadId","description":"The id of the thread this message belongs to\nFor interaction webhooks, this property is ignored","optional":true,"type":[[["Snowflake"]]]},{"name":"withComponents","description":"Whether to allow sending non-interactive components in the message.\nFor application-owned webhooks, this property is ignored","optional":true,"type":[[["boolean"]]]}],"meta":{"line":127,"file":"Webhook.js","path":"src/structures"}},{"name":"WebhookEditData","description":"Options used to edit a {@link Webhook}.","type":[[["Object"]]],"props":[{"name":"name","description":"The new name for the webhook","optional":true,"default":"this.name","type":[[["string"]]]},{"name":"avatar","description":"The new avatar for the webhook","optional":true,"nullable":true,"type":[[["BufferResolvable"]]]},{"name":"channel","description":"The new channel for the webhook","optional":true,"type":[[["GuildTextChannelResolvable"]],[["VoiceChannel"]],[["StageChannel"]],[["ForumChannel"]],[["MediaChannel"]]]}],"meta":{"line":247,"file":"Webhook.js","path":"src/structures"}},{"name":"WebhookFetchMessageOptions","description":"Options that can be passed into fetchMessage.","type":[[["options"]]],"props":[{"name":"cache","description":"Whether to cache the message.","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"threadId","description":"The id of the thread this message belongs to.\nFor interaction webhooks, this property is ignored","optional":true,"type":[[["Snowflake"]]]}],"meta":{"line":280,"file":"Webhook.js","path":"src/structures"}},{"name":"WidgetChannel","description":"Represents a channel in a Widget","type":[[["Object"]]],"props":[{"name":"id","description":"Id of the channel","type":[[["Snowflake"]]]},{"name":"name","description":"Name of the channel","type":[[["string"]]]},{"name":"position","description":"Position of the channel","type":[[["number"]]]}],"meta":{"line":17,"file":"Widget.js","path":"src/structures"}},{"name":"WidgetActivity","description":"Activity sent in a {@link WidgetMember}.","type":[[["Object"]]],"props":[{"name":"name","description":"The name of the activity","type":[[["string"]]]}],"meta":{"line":10,"file":"WidgetMember.js","path":"src/structures"}},{"name":"AttachmentFlagsResolvable","description":"Data that can be resolved to give a guild attachment bitfield. This can be:\n* A string (see {@link AttachmentFlags.FLAGS})\n* A attachment flag\n* An instance of AttachmentFlags\n* An Array of AttachmentFlagsResolvable","type":[[["string"]],[["number"]],[["AttachmentFlags"]],[["Array","<"],["AttachmentFlagsResolvable",">"]]],"meta":{"line":29,"file":"AttachmentFlags.js","path":"src/util"}},{"name":"BitFieldResolvable","description":"Data that can be resolved to give a bitfield. This can be:\n* A bit number (this can be a number literal or a value taken from {@link BitField.FLAGS})\n* A string bit number\n* An instance of BitField\n* An Array of BitFieldResolvable","type":[[["number"]],[["string"]],[["bigint"]],[["BitField"]],[["Array","<"],["BitFieldResolvable",">"]]],"meta":{"line":129,"file":"BitField.js","path":"src/util"}},{"name":"ChannelFlagsResolvable","description":"Data that can be resolved to give a channel flag bitfield. This can be:\n* A string (see {@link ChannelFlags.FLAGS})\n* A channel flag\n* An instance of ChannelFlags\n* An Array of ChannelFlags","type":[[["string"]],[["number"]],[["ChannelFlags"]],[["Array","<"],["ChannelFlagsResolvable",">"]]],"meta":{"line":36,"file":"ChannelFlags.js","path":"src/util"}},{"name":"Constants","description":"Constants that can be used in an enum or object-like way.","type":[[["Object"]]],"props":[{"name":"ActivityTypes","description":"The type of an activity of a users presence.","type":[[["Object","<"],["ActivityType",", "],["number",">"]]]},{"name":"APIErrors","description":"An error encountered while performing an API request.","type":[[["Object","<"],["APIError",", "],["number",">"]]]},{"name":"ApplicationCommandOptionTypes","description":"The type of an {@link ApplicationCommandOption} object.","type":[[["Object","<"],["ApplicationCommandOptionType",", "],["number",">"]]]},{"name":"ApplicationCommandPermissionTypes","description":"The type of an {@link ApplicationCommandPermissions} object.","type":[[["Object","<"],["ApplicationCommandPermissionType",", "],["number",">"]]]},{"name":"ApplicationCommandTypes","description":"The type of an {@link ApplicationCommand} object.","type":[[["Object","<"],["ApplicationCommandType",", "],["number",">"]]]},{"name":"ApplicationRoleConnectionMetadataTypes","description":"The type of an {@link ApplicationRoleConnectionMetadata} object.","type":[[["Object","<"],["ApplicationRoleConnectionMetadataType",", "],["number",">"]]]},{"name":"AutoModerationActionTypes","description":"A type of an action which executes whenever a rule is triggered.","type":[[["Object","<"],["AutoModerationActionType",", "],["number",">"]]]},{"name":"AutoModerationRuleEventTypes","description":"Indicates in what event context\na rule should be checked.","type":[[["Object","<"],["AutoModerationRuleEventType",", "],["number",">"]]]},{"name":"AutoModerationRuleKeywordPresetTypes","description":"The internally pre-defined wordsetswhich will be searched for in content","type":[[["Object","<"],["AutoModerationRuleKeywordPresetType",", "],["number",">"]]]},{"name":"AutoModerationRuleTriggerTypes","description":"Characterizes the type\nof content which can trigger the rule.","type":[[["Object","<"],["AutoModerationRuleTriggerType",", "],["number",">"]]]},{"name":"ChannelTypes","description":"All available channel types.","type":[[["Object","<"],["ChannelType",", "],["number",">"]]]},{"name":"ClientApplicationAssetTypes","description":"The types of an {@link ApplicationAsset} object.","type":[[["ClientApplicationAssetTypes"]]]},{"name":"Colors","description":"An object with regularly used colors.","type":[[["Object","<"],["Color",", "],["number",">"]]]},{"name":"DefaultMessageNotificationLevels","description":"The value set for a guilds default message notifications.","type":[[["Object","<"],["DefaultMessageNotificationLevel",", "],["number",">"]]]},{"name":"Endpoints","description":"Object containing functions that return certain endpoints on the API.","type":[[["Endpoints"]]]},{"name":"Events","description":"The types of events emitted by the Client.","type":[[["Events"]]]},{"name":"ExplicitContentFilterLevels","description":"The value set for the explicit content filter levels for a guild.","type":[[["Object","<"],["ExplicitContentFilterLevel",", "],["number",">"]]]},{"name":"GuildScheduledEventEntityTypes","description":"The entity type of a {@link GuildScheduledEvent} object.","type":[[["Object","<"],["GuildScheduledEventEntityType",", "],["number",">"]]]},{"name":"GuildScheduledEventPrivacyLevels","description":"Privacy level of a {@link GuildScheduledEvent} object.","type":[[["Object","<"],["GuildScheduledEventPrivacyLevel",", "],["number",">"]]]},{"name":"GuildScheduledEventStatuses","description":"The status of a {@link GuildScheduledEvent} object.","type":[[["Object","<"],["GuildScheduledEventStatus",", "],["number",">"]]]},{"name":"IntegrationExpireBehaviors","description":"The behavior of expiring subscribers for Integrations.","type":[[["Object","<"],["IntegrationExpireBehavior",", "],["number",">"]]]},{"name":"InteractionResponseTypes","description":"The type of an interaction response.","type":[[["Object","<"],["InteractionResponseType",", "],["number",">"]]]},{"name":"InteractionTypes","description":"The type of an {@link Interaction} object.","type":[[["Object","<"],["InteractionType",", "],["number",">"]]]},{"name":"InviteScopes","description":"The scopes of an invite.","type":[[["Array","<"],["InviteScope",">"]]]},{"name":"RelationshipTypes","description":"Relationship Enums","type":[[["Object","<"],["RelationshipType",", "],["number",">"]]]},{"name":"SeparatorSpacingSize","description":"Size of separator padding (Enums)","type":[[["Object","<"],["SeparatorSpacingSize",", "],["number",">"]]]},{"name":"MembershipStates","description":"The value set for a team members membership state.","type":[[["Object","<"],["MembershipState",", "],["number",">"]]]},{"name":"MessageButtonStyles","description":"The style of a message button.","type":[[["Object","<"],["MessageButtonStyle",", "],["number",">"]]]},{"name":"MessageComponentTypes","description":"The type of a message component.","type":[[["Object","<"],["MessageComponentType",", "],["number",">"]]]},{"name":"MessageTypes","description":"The type of a {@link Message} object.","type":[[["Array","<"],["MessageType",">"]]]},{"name":"MFALevels","description":"The required MFA level for a guild.","type":[[["Object","<"],["MFALevel",", "],["number",">"]]]},{"name":"NSFWLevels","description":"NSFW level of a guild.","type":[[["Object","<"],["NSFWLevel",", "],["number",">"]]]},{"name":"Opcodes","description":"The types of Opcodes sent to the Gateway.","type":[[["Opcodes"]]]},{"name":"OverwriteTypes","description":"An overwrite type.","type":[[["Object","<"],["OverwriteType",", "],["number",">"]]]},{"name":"Package","description":"The package.json of the library.","type":[[["Object"]]]},{"name":"PartialTypes","description":"The type of Structure allowed to be a partial.","type":[[["Object","<"],["PartialType",", "],["PartialType",">"]]]},{"name":"PremiumTiers","description":"The premium tier (Server Boost level) of a guild.","type":[[["Object","<"],["PremiumTier",", "],["number",">"]]]},{"name":"PrivacyLevels","description":"Privacy level of a {@link StageInstance} object.","type":[[["Object","<"],["PrivacyLevel",", "],["number",">"]]]},{"name":"ShardEvents","description":"The type of events emitted by a Shard.","type":[[["ShardEvents"]]]},{"name":"Status","description":"The available statuses of the client.","type":[[["Status"]]]},{"name":"SelectMenuComponentTypes","description":"The type of any select menu.","type":[[["Object","<"],["SelectMenuComponentType",", "],["number",">"]]]},{"name":"StickerFormatTypes","description":"The value set for a stickers format type.","type":[[["Object","<"],["StickerFormatType",", "],["number",">"]]]},{"name":"StickerTypes","description":"The value set for a stickers type.","type":[[["Object","<"],["StickerType",", "],["number",">"]]]},{"name":"SweeperKeys","description":"The name of an item to be swept in Sweepers.","type":[[["Array","<"],["SweeperKey",">"]]]},{"name":"SystemMessageTypes","description":"The types of messages that are `System`.","type":[[["Array","<"],["SystemMessageType",">"]]]},{"name":"TextInputStyles","description":"The style of a text input component.","type":[[["Object","<"],["TextInputStyle",", "],["number",">"]]]},{"name":"ThreadChannelTypes","description":"The type of a {@link ThreadChannel} object.","type":[[["Array","<"],["ThreadChannelTypes",">"]]]},{"name":"UserAgent","description":"The user agent used for requests.","type":[[["string"]]]},{"name":"VerificationLevels","description":"The value set for the verification levels for a guild.","type":[[["Object","<"],["VerificationLevel",", "],["number",">"]]]},{"name":"VideoQualityModes","description":"The camera video quality mode for a {@link VoiceChannel}.","type":[[["Object","<"],["VideoQualityMode",", "],["number",">"]]]},{"name":"WebhookTypes","description":"The value set for a webhooks type.","type":[[["Object","<"],["WebhookType",", "],["number",">"]]]},{"name":"WSCodes","description":"The types of WebSocket error codes.","type":[[["WSCodes"]]]},{"name":"WSEvents","description":"The type of a WebSocket message event.","type":[[["Object","<"],["WSEventType",", "],["WSEventType",">"]]]},{"name":"HolographicStyles","description":"Holographic color values for role styling.","type":[[["HolographicStyle"]]]}],"meta":{"line":1842,"file":"Constants.js","path":"src/util"}},{"name":"MaxBulkDeletableMessageAge","description":"Max bulk deletable message age","type":[[["number"]]],"meta":{"line":5,"file":"Constants.js","path":"src/util"}},{"name":"Ciphers","description":"Chrome TLS ciphers","see":["{@link https://tls.browserleaks.com/tls}","{@link https://github.com/yifeikong/curl-impersonate}"],"type":[[["Array","<"],["string",">"]]],"meta":{"line":14,"file":"Constants.js","path":"src/util"}},{"name":"WSCodes","description":"The types of WebSocket error codes:\n* 1000: WS_CLOSE_REQUESTED\n* 1011: INTERNAL_ERROR\n* 4004: TOKEN_INVALID\n* 4010: SHARDING_INVALID\n* 4011: SHARDING_REQUIRED\n* 4013: INVALID_INTENTS\n* 4014: DISALLOWED_INTENTS","type":[[["Object","<"],["number",", "],["string",">"]]],"meta":{"line":38,"file":"Constants.js","path":"src/util"}},{"name":"ImageURLOptions","description":"Options for Image URLs.","type":[[["StaticImageURLOptions"]]],"props":[{"name":"dynamic","description":"If true, the format will dynamically change to `gif` for animated avatars.","optional":true,"default":false,"type":[[["boolean"]]]}],"meta":{"line":70,"file":"Constants.js","path":"src/util"}},{"name":"StaticImageURLOptions","description":"Options for static Image URLs.","type":[[["Object"]]],"props":[{"name":"format","description":"One of `webp`, `png`, `jpg`, `jpeg`.","optional":true,"default":"'webp'","type":[[["string"]]]},{"name":"size","description":"One of `16`, `32`, `56`, `64`, `96`, `128`, `256`, `300`, `512`, `600`, `1024`, `2048`,\n`4096`","optional":true,"type":[[["number"]]]}],"meta":{"line":76,"file":"Constants.js","path":"src/util"}},{"name":"Endpoints","description":"An object containing functions that return certain endpoints on the API.","see":["{@link https://discord.com/developers/docs/reference#image-formatting-cdn-endpoints}"],"type":[[["Object","<"],["string",", ("],["function","()|"],["string",")>"]]],"meta":{"line":84,"file":"Constants.js","path":"src/util"}},{"name":"Status","description":"The current status of the client. Here are the available statuses:\n* READY: 0\n* CONNECTING: 1\n* RECONNECTING: 2\n* IDLE: 3\n* NEARLY: 4\n* DISCONNECTED: 5\n* WAITING_FOR_GUILDS: 6\n* IDENTIFYING: 7\n* RESUMING: 8","type":[[["Object","<"],["string",", "],["number",">"]]],"meta":{"line":142,"file":"Constants.js","path":"src/util"}},{"name":"VoiceStatus","description":"The current status of a voice connection. Here are the available statuses:\n* CONNECTED: 0\n* CONNECTING: 1\n* AUTHENTICATING: 2\n* RECONNECTING: 3\n* DISCONNECTED: 4","type":[[["number"]]],"meta":{"line":167,"file":"Constants.js","path":"src/util"}},{"name":"Opcodes","description":"The Opcodes sent to the Gateway:\n* DISPATCH: 0\n* HEARTBEAT: 1\n* IDENTIFY: 2\n* STATUS_UPDATE: 3\n* VOICE_STATE_UPDATE: 4\n* VOICE_GUILD_PING: 5\n* RESUME: 6\n* RECONNECT: 7\n* REQUEST_GUILD_MEMBERS: 8\n* INVALID_SESSION: 9\n* HELLO: 10\n* HEARTBEAT_ACK: 11\n* GUILD_SYNC: 12 [Unused]\n* DM_UPDATE: 13 # Send => used to get dm features\n* GUILD_SUBSCRIPTIONS: 14 # Send => discord responds back with GUILD_MEMBER_LIST_UPDATE type SYNC...\n* LOBBY_CONNECT: 15\n* LOBBY_DISCONNECT: 16\n* LOBBY_VOICE_STATE_UPDATE: 17 # Receive\n* STREAM_CREATE: 18\n* STREAM_DELETE: 19\n* STREAM_WATCH: 20\n* STREAM_PING: 21 # Send\n* STREAM_SET_PAUSED: 22\n* LFG_SUBSCRIPTIONS: 23 [Unused]\n* REQUEST_GUILD_APPLICATION_COMMANDS: 24 [Unused]\n* EMBEDDED_ACTIVITY_LAUNCH: 25 => Launch an embedded activity in a voice channel or call.\n* EMBEDDED_ACTIVITY_CLOSE: 26 => Stop an embedded activity.\n* EMBEDDED_ACTIVITY_UPDATE: 27 => Update an embedded activity.\n* REQUEST_FORUM_UNREADS: 28 => Request forum channel unread counts.\n* REMOTE_COMMAND: 29 => Send a remote command to an embedded (Xbox, PlayStation) voice session.\n* GET_DELETED_ENTITY_IDS_NOT_MATCHING_HASH: 30 => Request deleted entity IDs not matching a given hash for a guild.\n* REQUEST_SOUNDBOARD_SOUNDS: 31\n* SPEED_TEST_CREATE: 32 => Create a voice speed test.\n* SPEED_TEST_DELETE: 33 => Delete a voice speed test.\n* REQUEST_LAST_MESSAGES: 34 => Request last messages for a guild's channels.\n* SEARCH_RECENT_MEMBERS: 35 => ~ Opcode 8 (Member Safety)\n* REQUEST_CHANNEL_STATUSES: 36 => Request Voice Channel status.\n* GUILD_SUBSCRIPTIONS_BULK: 37 => ~ Opcode 14","type":[[["Object","<"],["string",", "],["number",">"]]],"meta":{"line":184,"file":"Constants.js","path":"src/util"}},{"name":"VoiceOpcodes","type":[[["Opject","<"],["string",", "],["number",">"]]],"meta":{"line":267,"file":"Constants.js","path":"src/util"}},{"name":"Events","description":"The types of events emitted by the Client:\n* RATE_LIMIT: rateLimit\n* INVALID_REQUEST_WARNING: invalidRequestWarning\n* API_RESPONSE: apiResponse\n* API_REQUEST: apiRequest\n* CLIENT_READY: ready\n* APPLICATION_COMMAND_CREATE: applicationCommandCreate (deprecated)\n* APPLICATION_COMMAND_DELETE: applicationCommandDelete (deprecated)\n* APPLICATION_COMMAND_UPDATE: applicationCommandUpdate (deprecated)\n* APPLICATION_COMMAND_PERMISSIONS_UPDATE: applicationCommandPermissionsUpdate\n* AUTO_MODERATION_ACTION_EXECUTION: autoModerationActionExecution\n* AUTO_MODERATION_RULE_CREATE: autoModerationRuleCreate\n* AUTO_MODERATION_RULE_DELETE: autoModerationRuleDelete\n* AUTO_MODERATION_RULE_UPDATE: autoModerationRuleUpdate\n* GUILD_AVAILABLE: guildAvailable\n* GUILD_CREATE: guildCreate\n* GUILD_DELETE: guildDelete\n* GUILD_UPDATE: guildUpdate\n* GUILD_UNAVAILABLE: guildUnavailable\n* GUILD_MEMBER_ADD: guildMemberAdd\n* GUILD_MEMBER_REMOVE: guildMemberRemove\n* GUILD_MEMBER_UPDATE: guildMemberUpdate\n* GUILD_MEMBER_AVAILABLE: guildMemberAvailable\n* GUILD_MEMBERS_CHUNK: guildMembersChunk\n* GUILD_INTEGRATIONS_UPDATE: guildIntegrationsUpdate\n* GUILD_ROLE_CREATE: roleCreate\n* GUILD_ROLE_DELETE: roleDelete\n* INVITE_CREATE: inviteCreate\n* INVITE_DELETE: inviteDelete\n* GUILD_ROLE_UPDATE: roleUpdate\n* GUILD_EMOJI_CREATE: emojiCreate\n* GUILD_EMOJI_DELETE: emojiDelete\n* GUILD_EMOJI_UPDATE: emojiUpdate\n* GUILD_BAN_ADD: guildBanAdd\n* GUILD_BAN_REMOVE: guildBanRemove\n* CHANNEL_CREATE: channelCreate\n* CHANNEL_DELETE: channelDelete\n* CHANNEL_UPDATE: channelUpdate\n* CHANNEL_PINS_UPDATE: channelPinsUpdate\n* MESSAGE_CREATE: messageCreate\n* MESSAGE_DELETE: messageDelete\n* MESSAGE_UPDATE: messageUpdate\n* MESSAGE_BULK_DELETE: messageDeleteBulk\n* MESSAGE_REACTION_ADD: messageReactionAdd\n* MESSAGE_REACTION_REMOVE: messageReactionRemove\n* MESSAGE_REACTION_REMOVE_ALL: messageReactionRemoveAll\n* MESSAGE_REACTION_REMOVE_EMOJI: messageReactionRemoveEmoji\n* THREAD_CREATE: threadCreate\n* THREAD_DELETE: threadDelete\n* THREAD_UPDATE: threadUpdate\n* THREAD_LIST_SYNC: threadListSync\n* THREAD_MEMBER_UPDATE: threadMemberUpdate\n* THREAD_MEMBERS_UPDATE: threadMembersUpdate\n* USER_UPDATE: userUpdate\n* PRESENCE_UPDATE: presenceUpdate\n* VOICE_SERVER_UPDATE: voiceServerUpdate\n* VOICE_STATE_UPDATE: voiceStateUpdate\n* TYPING_START: typingStart\n* WEBHOOKS_UPDATE: webhookUpdate\n* ERROR: error\n* WARN: warn\n* DEBUG: debug\n* CACHE_SWEEP: cacheSweep\n* SHARD_DISCONNECT: shardDisconnect\n* SHARD_ERROR: shardError\n* SHARD_RECONNECTING: shardReconnecting\n* SHARD_READY: shardReady\n* SHARD_RESUME: shardResume\n* INVALIDATED: invalidated\n* RAW: raw\n* STAGE_INSTANCE_CREATE: stageInstanceCreate\n* STAGE_INSTANCE_UPDATE: stageInstanceUpdate\n* STAGE_INSTANCE_DELETE: stageInstanceDelete\n* GUILD_STICKER_CREATE: stickerCreate\n* GUILD_STICKER_DELETE: stickerDelete\n* GUILD_STICKER_UPDATE: stickerUpdate\n* GUILD_SCHEDULED_EVENT_CREATE: guildScheduledEventCreate\n* GUILD_SCHEDULED_EVENT_UPDATE: guildScheduledEventUpdate\n* GUILD_SCHEDULED_EVENT_DELETE: guildScheduledEventDelete\n* GUILD_SCHEDULED_EVENT_USER_ADD: guildScheduledEventUserAdd\n* GUILD_SCHEDULED_EVENT_USER_REMOVE: guildScheduledEventUserRemove\n* GUILD_AUDIT_LOG_ENTRY_CREATE: guildAuditLogEntryCreate\n* UNHANDLED_PACKET: unhandledPacket\n* RELATIONSHIP_ADD: relationshipAdd\n* RELATIONSHIP_REMOVE: relationshipRemove\n* RELATIONSHIP_UPDATE: relationshipUpdate\n* CHANNEL_RECIPIENT_ADD: channelRecipientAdd\n* CHANNEL_RECIPIENT_REMOVE: channelRecipientRemove\n* INTERACTION_MODAL_CREATE: interactionModalCreate\n* CALL_CREATE: callCreate\n* CALL_UPDATE: callUpdate\n* CALL_DELETE: callDelete\n* VOICE_CHANNEL_EFFECT_SEND: voiceChannelEffectSend","type":[[["Object","<"],["string",", "],["string",">"]]],"meta":{"line":289,"file":"Constants.js","path":"src/util"}},{"name":"ShardEvents","description":"The types of events emitted by a Shard:\n* CLOSE: close\n* DESTROYED: destroyed\n* INVALID_SESSION: invalidSession\n* READY: ready\n* RESUMED: resumed\n* ALL_READY: allReady","type":[[["Object","<"],["string",", "],["string",">"]]],"meta":{"line":485,"file":"Constants.js","path":"src/util"}},{"name":"PartialType","description":"The type of Structure allowed to be a partial:\n* USER\n* CHANNEL (only affects DMChannels)\n* GUILD_MEMBER\n* MESSAGE\n* REACTION\n* GUILD_SCHEDULED_EVENT\nPartials require you to put checks in place when handling data. See the \"Partial Structures\" topic on the\n[guide](https://discordjs.guide/popular-topics/partials.html) for more information.","type":[[["string"]]],"meta":{"line":504,"file":"Constants.js","path":"src/util"}},{"name":"WSEventType","description":"The type of a WebSocket message event, e.g. `MESSAGE_CREATE`. Here are the available events:\n* READY\n* RESUMED\n* APPLICATION_COMMAND_CREATE (deprecated)\n* APPLICATION_COMMAND_DELETE (deprecated)\n* APPLICATION_COMMAND_PERMISSIONS_UPDATE\n* APPLICATION_COMMAND_UPDATE (deprecated)\n* AUTO_MODERATION_ACTION_EXECUTION\n* AUTO_MODERATION_RULE_CREATE\n* AUTO_MODERATION_RULE_DELETE\n* AUTO_MODERATION_RULE_UPDATE\n* GUILD_CREATE\n* GUILD_DELETE\n* GUILD_UPDATE\n* INVITE_CREATE\n* INVITE_DELETE\n* GUILD_MEMBER_ADD\n* GUILD_MEMBER_REMOVE\n* GUILD_MEMBER_UPDATE\n* GUILD_MEMBERS_CHUNK\n* GUILD_INTEGRATIONS_UPDATE\n* GUILD_ROLE_CREATE\n* GUILD_ROLE_DELETE\n* GUILD_ROLE_UPDATE\n* GUILD_BAN_ADD\n* GUILD_BAN_REMOVE\n* GUILD_EMOJIS_UPDATE\n* CHANNEL_CREATE\n* CHANNEL_DELETE\n* CHANNEL_UPDATE\n* CHANNEL_PINS_UPDATE\n* MESSAGE_CREATE\n* MESSAGE_DELETE\n* MESSAGE_UPDATE\n* MESSAGE_DELETE_BULK\n* MESSAGE_REACTION_ADD\n* MESSAGE_REACTION_REMOVE\n* MESSAGE_REACTION_REMOVE_ALL\n* MESSAGE_REACTION_REMOVE_EMOJI\n* THREAD_CREATE\n* THREAD_UPDATE\n* THREAD_DELETE\n* THREAD_LIST_SYNC\n* THREAD_MEMBER_UPDATE\n* THREAD_MEMBERS_UPDATE\n* USER_UPDATE\n* PRESENCE_UPDATE\n* TYPING_START\n* VOICE_STATE_UPDATE\n* VOICE_SERVER_UPDATE\n* WEBHOOKS_UPDATE\n* STAGE_INSTANCE_CREATE\n* STAGE_INSTANCE_UPDATE\n* STAGE_INSTANCE_DELETE\n* GUILD_STICKERS_UPDATE\n* GUILD_SCHEDULED_EVENT_CREATE\n* GUILD_SCHEDULED_EVENT_UPDATE\n* GUILD_SCHEDULED_EVENT_DELETE\n* GUILD_SCHEDULED_EVENT_USER_ADD\n* GUILD_SCHEDULED_EVENT_USER_REMOVE\n* GUILD_AUDIT_LOG_ENTRY_CREATE","see":["{@link https://discord.com/developers/docs/topics/gateway-events#receive-events}"],"type":[[["string"]]],"meta":{"line":518,"file":"Constants.js","path":"src/util"}},{"name":"InviteScope","description":"A valid scope to request when generating an invite link.\nScopes that require whitelist are not considered valid for this generator\n* `applications.builds.read`: allows reading build data for a users applications\n* `applications.commands`: allows this bot to create commands in the server\n* `applications.entitlements`: allows reading entitlements for a users applications\n* `applications.store.update`: allows reading and updating of store data for a users applications\n* `bot`: makes the bot join the selected guild\n* `connections`: makes the endpoint for getting a users connections available\n* `email`: allows the `/users/@me` endpoint return with an email\n* `identify`: allows the `/users/@me` endpoint without an email\n* `guilds`: makes the `/users/@me/guilds` endpoint available for a user\n* `guilds.join`: allows the bot to join the user to any guild it is in using Guild#addMember\n* `gdm.join`: allows joining the user to a group dm\n* `webhook.incoming`: generates a webhook to a channel\n* `role_connections.write`: allows your app to update a user's connection and metadata for the app","see":["{@link https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes}"],"type":[[["string"]]],"meta":{"line":646,"file":"Constants.js","path":"src/util"}},{"name":"IntegrationExpireBehavior","description":"The behavior of expiring subscribers for Integrations. This can be:\n* REMOVE_ROLE\n* KICK","see":["{@link https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors}"],"type":[[["string"]]],"meta":{"line":682,"file":"Constants.js","path":"src/util"}},{"name":"MessageType","description":"The type of a message, e.g. `DEFAULT`. Here are the available types:\n* DEFAULT\n* RECIPIENT_ADD\n* RECIPIENT_REMOVE\n* CALL\n* CHANNEL_NAME_CHANGE\n* CHANNEL_ICON_CHANGE\n* CHANNEL_PINNED_MESSAGE\n* GUILD_MEMBER_JOIN\n* USER_PREMIUM_GUILD_SUBSCRIPTION\n* USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1\n* USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2\n* USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3\n* CHANNEL_FOLLOW_ADD\n* GUILD_DISCOVERY_DISQUALIFIED\n* GUILD_DISCOVERY_REQUALIFIED\n* GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING\n* GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING\n* THREAD_CREATED\n* REPLY\n* APPLICATION_COMMAND\n* THREAD_STARTER_MESSAGE\n* GUILD_INVITE_REMINDER\n* CONTEXT_MENU_COMMAND\n* AUTO_MODERATION_ACTION\n* ROLE_SUBSCRIPTION_PURCHASE\n* INTERACTION_PREMIUM_UPSELL\n* STAGE_START\n* STAGE_END\n* STAGE_SPEAKER\n* STAGE_RAISE_HAND\n* STAGE_TOPIC\n* GUILD_APPLICATION_PREMIUM_SUBSCRIPTION\n* PREMIUM_REFERRAL\n* GUILD_INCIDENT_ALERT_MODE_ENABLED\n* GUILD_INCIDENT_ALERT_MODE_DISABLED\n* GUILD_INCIDENT_REPORT_RAID\n* GUILD_INCIDENT_REPORT_FALSE_ALARM\n* GUILD_DEADCHAT_REVIVE_PROMPT\n* CUSTOM_GIFT\n* GUILD_GAMING_STATS_PROMPT\n* PURCHASE_NOTIFICATION\n* POLL_RESULT\n* CHANGELOG\n* NITRO_NOTIFICATION","see":["{@link https://discord.com/developers/docs/resources/channel#message-object-message-types}","{@link https://docs.discord.food/resources/message#message-type}"],"type":[[["string"]]],"meta":{"line":691,"file":"Constants.js","path":"src/util"}},{"name":"MessageReferenceType","description":"The type of a message reference, e.g. `DEFAULT`. Here are the available types:\n* DEFAULT\n* FORWARD","see":["{@link https://discord.com/developers/docs/resources/message#message-reference-types}"],"type":[[["string"]]],"meta":{"line":793,"file":"Constants.js","path":"src/util"}},{"name":"SweeperKey","description":"The name of an item to be swept in Sweepers\n* `applicationCommands` - both global and guild commands\n* `autoModerationRules`\n* `bans`\n* `emojis`\n* `invites` - accepts the `lifetime` property, using it will sweep based on expires timestamp\n* `guildMembers`\n* `messages` - accepts the `lifetime` property, using it will sweep based on edited or created timestamp\n* `presences`\n* `reactions`\n* `stageInstances`\n* `stickers`\n* `threadMembers`\n* `threads` - accepts the `lifetime` property, using it will sweep archived threads based on archived timestamp\n* `users`\n* `voiceStates`","type":[[["string"]]],"meta":{"line":805,"file":"Constants.js","path":"src/util"}},{"name":"SystemMessageType","description":"The types of messages that are `System`. The available types are `MessageTypes` excluding:\n* DEFAULT\n* REPLY\n* APPLICATION_COMMAND\n* CONTEXT_MENU_COMMAND","type":[[["string"]]],"meta":{"line":842,"file":"Constants.js","path":"src/util"}},{"name":"ActivityType","description":"Bots cannot set a `CUSTOM` activity type, it is only for custom statuses received from users\nThe type of an activity of a user's presence. Here are the available types:\n* PLAYING\n* STREAMING\n* LISTENING\n* WATCHING\n* CUSTOM\n* COMPETING\n* HANG","see":["{@link https://discord.com/developers/docs/game-sdk/activities#data-models-activitytype-enum}"],"type":[[["string"]]],"meta":{"line":854,"file":"Constants.js","path":"src/util"}},{"name":"ChannelType","description":"All available channel types:\n* `GUILD_TEXT` - a guild text channel\n* `DM` - a DM channel\n* `GUILD_VOICE` - a guild voice channel\n* `GROUP_DM` - a group DM channel\n* `GUILD_CATEGORY` - a guild category channel\n* `GUILD_NEWS` - a guild news channel\n* `GUILD_STORE` - a guild store channel\nStore channels are deprecated and will be removed from Discord in March 2022. See\n[Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/6309018858647)\nfor more information.\n* `GUILD_NEWS_THREAD` - a guild news channel's public thread channel\n* `GUILD_PUBLIC_THREAD` - a guild text channel's public thread channel\n* `GUILD_PRIVATE_THREAD` - a guild text channel's private thread channel\n* `GUILD_STAGE_VOICE` - a guild stage voice channel\n* `GUILD_DIRECTORY` - the channel in a hub containing guilds\n* `GUILD_FORUM` - a channel that can only contain threads\n* `GUILD_MEDIA` - a channel that can only contain threads, similar to `GUILD_FORUM` channels\n* `UNKNOWN` - a generic channel of unknown type, could be Channel or GuildChannel","see":["{@link https://discord.com/developers/docs/resources/channel#channel-object-channel-types}"],"type":[[["string"]]],"meta":{"line":869,"file":"Constants.js","path":"src/util"}},{"name":"TextBasedChannels","description":"The channels that are text-based.\n* DMChannel\n* TextChannel\n* NewsChannel\n* ThreadChannel\n* VoiceChannel\n* StageChannel","type":[[["DMChannel"]],[["TextChannel"]],[["NewsChannel"]],[["ThreadChannel"]],[["VoiceChannel"]],[["StageChannel"]]],"meta":{"line":911,"file":"Constants.js","path":"src/util"}},{"name":"TextBasedChannelsResolvable","description":"Data that resolves to give a text-based channel. This can be:\n* A text-based channel\n* A snowflake","type":[[["TextBasedChannels"]],[["Snowflake"]]],"meta":{"line":922,"file":"Constants.js","path":"src/util"}},{"name":"TextBasedChannelTypes","description":"The types of channels that are text-based. The available types are:\n* DM\n* GUILD_TEXT\n* GUILD_NEWS\n* GUILD_NEWS_THREAD\n* GUILD_PUBLIC_THREAD\n* GUILD_PRIVATE_THREAD\n* GUILD_VOICE\n* GUILD_STAGE_VOICE","type":[[["string"]]],"meta":{"line":929,"file":"Constants.js","path":"src/util"}},{"name":"ThreadChannelTypes","description":"The types of channels that are threads. The available types are:\n* GUILD_NEWS_THREAD\n* GUILD_PUBLIC_THREAD\n* GUILD_PRIVATE_THREAD","type":[[["string"]]],"meta":{"line":952,"file":"Constants.js","path":"src/util"}},{"name":"VoiceBasedChannelTypes","description":"The types of channels that are voice-based. The available types are:\n* GUILD_VOICE\n* GUILD_STAGE_VOICE","type":[[["string"]]],"meta":{"line":961,"file":"Constants.js","path":"src/util"}},{"name":"ClientApplicationAssetTypes","description":"The types of assets of an application:\n* SMALL: 1\n* BIG: 2","type":[[["Object","<"],["string",", "],["number",">"]]],"meta":{"line":969,"file":"Constants.js","path":"src/util"}},{"name":"Color","description":"A commonly used color:\n* DEFAULT\n* WHITE\n* AQUA\n* GREEN\n* BLUE\n* YELLOW\n* PURPLE\n* LUMINOUS_VIVID_PINK\n* FUCHSIA\n* GOLD\n* ORANGE\n* RED\n* GREY\n* NAVY\n* DARK_AQUA\n* DARK_GREEN\n* DARK_BLUE\n* DARK_PURPLE\n* DARK_VIVID_PINK\n* DARK_GOLD\n* DARK_ORANGE\n* DARK_RED\n* DARK_GREY\n* DARKER_GREY\n* LIGHT_GREY\n* DARK_NAVY\n* BLURPLE\n* GREYPLE\n* DARK_BUT_NOT_BLACK\n* NOT_QUITE_BLACK","type":[[["string"]]],"meta":{"line":980,"file":"Constants.js","path":"src/util"}},{"name":"HolographicStyle","description":"Holographic color values for role styling.\nWhen using `tertiaryColor`, the API enforces these specific values for holographic effect.\n\n* PRIMARY: 11127295 (0xA9FFFF)\n* SECONDARY: 16759788 (0xFFCCCC)\n* TERTIARY: 16761760 (0xFFE0A0)","type":[[["Object","<"],["string",", "],["number",">"]]],"meta":{"line":1047,"file":"Constants.js","path":"src/util"}},{"name":"ExplicitContentFilterLevel","description":"The value set for the explicit content filter levels for a guild:\n* DISABLED\n* MEMBERS_WITHOUT_ROLES\n* ALL_MEMBERS","see":["{@link https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level}"],"type":[[["string"]]],"meta":{"line":1062,"file":"Constants.js","path":"src/util"}},{"name":"VerificationLevel","description":"The value set for the verification levels for a guild:\n* NONE\n* LOW\n* MEDIUM\n* HIGH\n* VERY_HIGH","see":["{@link https://discord.com/developers/docs/resources/guild#guild-object-verification-level}"],"type":[[["string"]]],"meta":{"line":1072,"file":"Constants.js","path":"src/util"}},{"name":"APIError","description":"An error encountered while performing an API request. Here are the potential errors:\n* UNKNOWN_ACCOUNT\n* UNKNOWN_APPLICATION\n* UNKNOWN_CHANNEL\n* UNKNOWN_GUILD\n* UNKNOWN_INTEGRATION\n* UNKNOWN_INVITE\n* UNKNOWN_MEMBER\n* UNKNOWN_MESSAGE\n* UNKNOWN_OVERWRITE\n* UNKNOWN_PROVIDER\n* UNKNOWN_ROLE\n* UNKNOWN_TOKEN\n* UNKNOWN_USER\n* UNKNOWN_EMOJI\n* UNKNOWN_WEBHOOK\n* UNKNOWN_WEBHOOK_SERVICE\n* UNKNOWN_SESSION\n* UNKNOWN_BAN\n* UNKNOWN_SKU\n* UNKNOWN_STORE_LISTING\n* UNKNOWN_ENTITLEMENT\n* UNKNOWN_BUILD\n* UNKNOWN_LOBBY\n* UNKNOWN_BRANCH\n* UNKNOWN_STORE_DIRECTORY_LAYOUT\n* UNKNOWN_REDISTRIBUTABLE\n* UNKNOWN_GIFT_CODE\n* UNKNOWN_STREAM\n* UNKNOWN_PREMIUM_SERVER_SUBSCRIBE_COOLDOWN\n* UNKNOWN_GUILD_TEMPLATE\n* UNKNOWN_DISCOVERABLE_SERVER_CATEGORY\n* UNKNOWN_STICKER\n* UNKNOWN_INTERACTION\n* UNKNOWN_APPLICATION_COMMAND\n* UNKNOWN_APPLICATION_COMMAND_PERMISSIONS\n* UNKNOWN_STAGE_INSTANCE\n* UNKNOWN_GUILD_MEMBER_VERIFICATION_FORM\n* UNKNOWN_GUILD_WELCOME_SCREEN\n* UNKNOWN_GUILD_SCHEDULED_EVENT\n* UNKNOWN_GUILD_SCHEDULED_EVENT_USER\n* BOT_PROHIBITED_ENDPOINT\n* BOT_ONLY_ENDPOINT\n* CANNOT_SEND_EXPLICIT_CONTENT\n* NOT_AUTHORIZED\n* SLOWMODE_RATE_LIMIT\n* ACCOUNT_OWNER_ONLY\n* ANNOUNCEMENT_EDIT_LIMIT_EXCEEDED\n* CHANNEL_HIT_WRITE_RATELIMIT\n* SERVER_HIT_WRITE_RATELIMIT\n* CONTENT_NOT_ALLOWED\n* GUILD_PREMIUM_LEVEL_TOO_LOW\n* MAXIMUM_GUILDS\n* MAXIMUM_FRIENDS\n* MAXIMUM_PINS\n* MAXIMUM_RECIPIENTS\n* MAXIMUM_ROLES\n* MAXIMUM_WEBHOOKS\n* MAXIMUM_EMOJIS\n* MAXIMUM_REACTIONS\n* MAXIMUM_CHANNELS\n* MAXIMUM_ATTACHMENTS\n* MAXIMUM_INVITES\n* MAXIMUM_ANIMATED_EMOJIS\n* MAXIMUM_SERVER_MEMBERS\n* MAXIMUM_NUMBER_OF_SERVER_CATEGORIES\n* GUILD_ALREADY_HAS_TEMPLATE\n* MAXIMUM_THREAD_PARTICIPANTS\n* MAXIMUM_NON_GUILD_MEMBERS_BANS\n* MAXIMUM_BAN_FETCHES\n* MAXIMUM_NUMBER_OF_UNCOMPLETED_GUILD_SCHEDULED_EVENTS_REACHED\n* MAXIMUM_NUMBER_OF_STICKERS_REACHED\n* MAXIMUM_PRUNE_REQUESTS\n* MAXIMUM_GUILD_WIDGET_SETTINGS_UPDATE\n* UNAUTHORIZED\n* ACCOUNT_VERIFICATION_REQUIRED\n* DIRECT_MESSAGES_TOO_FAST\n* REQUEST_ENTITY_TOO_LARGE\n* FEATURE_TEMPORARILY_DISABLED\n* USER_BANNED\n* TARGET_USER_NOT_CONNECTED_TO_VOICE\n* ALREADY_CROSSPOSTED\n* MISSING_ACCESS\n* INVALID_ACCOUNT_TYPE\n* CANNOT_EXECUTE_ON_DM\n* EMBED_DISABLED\n* CANNOT_EDIT_MESSAGE_BY_OTHER\n* CANNOT_SEND_EMPTY_MESSAGE\n* CANNOT_MESSAGE_USER\n* CANNOT_SEND_MESSAGES_IN_VOICE_CHANNEL\n* CHANNEL_VERIFICATION_LEVEL_TOO_HIGH\n* OAUTH2_APPLICATION_BOT_ABSENT\n* MAXIMUM_OAUTH2_APPLICATIONS\n* INVALID_OAUTH_STATE\n* MISSING_PERMISSIONS\n* INVALID_AUTHENTICATION_TOKEN\n* NOTE_TOO_LONG\n* INVALID_BULK_DELETE_QUANTITY\n* CANNOT_PIN_MESSAGE_IN_OTHER_CHANNEL\n* INVALID_OR_TAKEN_INVITE_CODE\n* CANNOT_EXECUTE_ON_SYSTEM_MESSAGE\n* CANNOT_EXECUTE_ON_CHANNEL_TYPE\n* INVALID_OAUTH_TOKEN\n* MISSING_OAUTH_SCOPE\n* INVALID_WEBHOOK_TOKEN\n* INVALID_ROLE\n* INVALID_RECIPIENTS\n* BULK_DELETE_MESSAGE_TOO_OLD\n* INVALID_FORM_BODY\n* INVITE_ACCEPTED_TO_GUILD_NOT_CONTAINING_BOT\n* INVALID_API_VERSION\n* FILE_UPLOADED_EXCEEDS_MAXIMUM_SIZE\n* INVALID_FILE_UPLOADED\n* CANNOT_SELF_REDEEM_GIFT\n* INVALID_GUILD\n* INVALID_MESSAGE_TYPE\n* PAYMENT_SOURCE_REQUIRED\n* CANNOT_DELETE_COMMUNITY_REQUIRED_CHANNEL\n* INVALID_STICKER_SENT\n* INVALID_OPERATION_ON_ARCHIVED_THREAD\n* INVALID_THREAD_NOTIFICATION_SETTINGS\n* PARAMETER_EARLIER_THAN_CREATION\n* GUILD_NOT_AVAILABLE_IN_LOCATION\n* GUILD_MONETIZATION_REQUIRED\n* INSUFFICIENT_BOOSTS\n* INVALID_JSON\n* TWO_FACTOR_REQUIRED\n* NO_USERS_WITH_DISCORDTAG_EXIST\n* REACTION_BLOCKED\n* RESOURCE_OVERLOADED\n* STAGE_ALREADY_OPEN\n* CANNOT_REPLY_WITHOUT_READ_MESSAGE_HISTORY_PERMISSION\n* MESSAGE_ALREADY_HAS_THREAD\n* THREAD_LOCKED\n* MAXIMUM_ACTIVE_THREADS\n* MAXIMUM_ACTIVE_ANNOUNCEMENT_THREADS\n* INVALID_JSON_FOR_UPLOADED_LOTTIE_FILE\n* UPLOADED_LOTTIES_CANNOT_CONTAIN_RASTERIZED_IMAGES\n* STICKER_MAXIMUM_FRAMERATE_EXCEEDED\n* STICKER_FRAME_COUNT_EXCEEDS_MAXIMUM_OF_1000_FRAMES\n* LOTTIE_ANIMATION_MAXIMUM_DIMENSIONS_EXCEEDED\n* STICKER_FRAME_RATE_IS_TOO_SMALL_OR_TOO_LARGE\n* STICKER_ANIMATION_DURATION_EXCEEDS_MAXIMUM_OF_5_SECONDS\n* CANNOT_UPDATE_A_FINISHED_EVENT\n* FAILED_TO_CREATE_STAGE_NEEDED_FOR_STAGE_EVENT","see":["{@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes}","{@link https://gist.github.com/Dziurwa14/de2498e5ee28d2089f095aa037957cbb}"],"type":[[["string"]]],"meta":{"line":1084,"file":"Constants.js","path":"src/util"}},{"name":"DefaultMessageNotificationLevel","description":"The value set for a guild's default message notifications, e.g. `ALL_MESSAGES`. Here are the available types:\n* ALL_MESSAGES\n* ONLY_MENTIONS","see":["{@link https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level}"],"type":[[["string"]]],"meta":{"line":1389,"file":"Constants.js","path":"src/util"}},{"name":"MembershipState","description":"The value set for a team member's membership state:\n* INVITED\n* ACCEPTED","see":["{@link https://discord.com/developers/docs/topics/teams#data-models-membership-state-enum}"],"type":[[["string"]]],"meta":{"line":1398,"file":"Constants.js","path":"src/util"}},{"name":"WebhookType","description":"The value set for a webhook's type:\n* Incoming\n* Channel Follower\n* Application","see":["{@link https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types}"],"type":[[["string"]]],"meta":{"line":1407,"file":"Constants.js","path":"src/util"}},{"name":"StickerType","description":"The value set for a sticker's type:\n* STANDARD\n* GUILD","see":["{@link https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-types}"],"type":[[["string"]]],"meta":{"line":1417,"file":"Constants.js","path":"src/util"}},{"name":"StickerFormatType","description":"The value set for a sticker's format type:\n* PNG\n* APNG\n* LOTTIE\n* GIF","see":["{@link https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-format-types}"],"type":[[["string"]]],"meta":{"line":1426,"file":"Constants.js","path":"src/util"}},{"name":"OverwriteType","description":"An overwrite type:\n* role\n* member","see":["{@link https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure}"],"type":[[["string"]]],"meta":{"line":1437,"file":"Constants.js","path":"src/util"}},{"name":"ApplicationCommandType","description":"The type of an {@link ApplicationCommand} object:\n* CHAT_INPUT\n* USER\n* MESSAGE","see":["{@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types}"],"type":[[["string"]]],"meta":{"line":1447,"file":"Constants.js","path":"src/util"}},{"name":"ApplicationCommandOptionType","description":"The type of an {@link ApplicationCommandOption} object:\n* SUB_COMMAND\n* SUB_COMMAND_GROUP\n* STRING\n* INTEGER\n* BOOLEAN\n* USER\n* CHANNEL\n* ROLE\n* MENTIONABLE\n* NUMBER\n* ATTACHMENT","see":["{@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type}"],"type":[[["string"]]],"meta":{"line":1457,"file":"Constants.js","path":"src/util"}},{"name":"ApplicationCommandPermissionType","description":"The type of an {@link ApplicationCommandPermissions} object:\n* ROLE\n* USER","see":["{@link https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type}"],"type":[[["string"]]],"meta":{"line":1488,"file":"Constants.js","path":"src/util"}},{"name":"ApplicationRoleConnectionMetadataType","description":"Each metadata type offers a comparison operation that allows\nguilds to configure role requirements based on metadata values stored by the bot.\nBots specify a metadata value for each user and guilds specify\nthe required guild's configured value within the guild role settings.\nAll available channel types:\n* INTEGER_LESS_THAN_OR_EQUAL\n* INTEGER_GREATER_THAN_OR_EQUAL\n* INTEGER_EQUAL\n* INTEGER_NOT_EQUAL\n* DATATIME_LESS_THAN_OR_EQUAL\n* DATATIME_GREATER_THAN_OR_EQUAL\n* BOOLEAN_EQUAL\n* BOOLEAN_NOT_EQUAL","type":[[["string"]]],"meta":{"line":1497,"file":"Constants.js","path":"src/util"}},{"name":"AutoModerationRuleTriggerType","description":"The type of an {@link AutoModerationRuleTriggerTypes} object:\n* KEYWORD\n* SPAM\n* KEYWORD_PRESET\n* MENTION_SPAM","see":["{@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types}"],"type":[[["string"]]],"meta":{"line":1526,"file":"Constants.js","path":"src/util"}},{"name":"AutoModerationRuleKeywordPresetType","description":"The type of an {@link AutoModerationRuleKeywordPresetTypes} object:\n* KEYWORD\n* SPAM\n* KEYWORD_PRESET\n* MENTION_SPAM","see":["{@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-preset-types}"],"type":[[["string"]]],"meta":{"line":1537,"file":"Constants.js","path":"src/util"}},{"name":"AutoModerationActionType","description":"The type of an {@link AutoModerationActionTypes} object:\n* BLOCK_MESSAGE\n* SEND_ALERT_MESSAGE\n* TIMEOUT","see":["{@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-types}"],"type":[[["string"]]],"meta":{"line":1547,"file":"Constants.js","path":"src/util"}},{"name":"AutoModerationRuleEventType","description":"The type of an {@link AutoModerationRuleEventTypes} object:\n* MESSAGE_SEND","see":["{@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-event-types}"],"type":[[["string"]]],"meta":{"line":1557,"file":"Constants.js","path":"src/util"}},{"name":"InteractionType","description":"The type of an {@link Interaction} object:\n* PING\n* APPLICATION_COMMAND\n* MESSAGE_COMPONENT\n* APPLICATION_COMMAND_AUTOCOMPLETE\n* MODAL_SUBMIT","see":["{@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type}"],"type":[[["string"]]],"meta":{"line":1565,"file":"Constants.js","path":"src/util"}},{"name":"InteractionResponseType","description":"The type of an interaction response:\n* PONG\n* CHANNEL_MESSAGE_WITH_SOURCE\n* DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE\n* DEFERRED_MESSAGE_UPDATE\n* UPDATE_MESSAGE\n* APPLICATION_COMMAND_AUTOCOMPLETE_RESULT\n* MODAL","see":["{@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type}"],"type":[[["string"]]],"meta":{"line":1584,"file":"Constants.js","path":"src/util"}},{"name":"MessageComponentType","description":"The type of a message component\n* ACTION_ROW\n* BUTTON\n* STRING_SELECT\n* TEXT_INPUT\n* USER_SELECT\n* ROLE_SELECT\n* MENTIONABLE_SELECT\n* CHANNEL_SELECT","see":["{@link https://discord.com/developers/docs/interactions/message-components#component-object-component-types}"],"type":[[["string"]]],"meta":{"line":1609,"file":"Constants.js","path":"src/util"}},{"name":"SelectMenuComponentType","description":"The types of components that are select menus. The available types are:\n* STRING_MENU\n* USER_SELECT\n* ROLE_SELECT\n* MENTIONABLE_SELECT\n* CHANNEL_SELECT","see":["{@link https://discord.com/developers/docs/interactions/message-components#component-object-component-types}"],"type":[[["string"]]],"meta":{"line":1643,"file":"Constants.js","path":"src/util"}},{"name":"MessageButtonStyle","description":"The style of a message button\n* PRIMARY\n* SECONDARY\n* SUCCESS\n* DANGER\n* LINK","see":["{@link https://discord.com/developers/docs/interactions/message-components#button-object-button-styles}"],"type":[[["string"]]],"meta":{"line":1663,"file":"Constants.js","path":"src/util"}},{"name":"MFALevel","description":"The required MFA level for a guild\n* NONE\n* ELEVATED","see":["{@link https://discord.com/developers/docs/resources/guild#guild-object-mfa-level}"],"type":[[["string"]]],"meta":{"line":1675,"file":"Constants.js","path":"src/util"}},{"name":"NSFWLevel","description":"NSFW level of a Guild:\n* DEFAULT\n* EXPLICIT\n* SAFE\n* AGE_RESTRICTED","see":["{@link https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level}"],"type":[[["string"]]],"meta":{"line":1684,"file":"Constants.js","path":"src/util"}},{"name":"PrivacyLevel","description":"Privacy level of a {@link StageInstance} object:\n* PUBLIC\n* GUILD_ONLY","see":["{@link https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-privacy-level}"],"type":[[["string"]]],"meta":{"line":1695,"file":"Constants.js","path":"src/util"}},{"name":"TextInputStyle","description":"The style of a text input component\n* SHORT\n* PARAGRAPH","see":["{@link https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-styles}"],"type":[[["string"]]],"meta":{"line":1704,"file":"Constants.js","path":"src/util"}},{"name":"GuildScheduledEventPrivacyLevel","description":"Privacy level of a {@link GuildScheduledEvent} object:\n* GUILD_ONLY","see":["{@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level}"],"type":[[["string"]]],"meta":{"line":1713,"file":"Constants.js","path":"src/util"}},{"name":"PremiumTier","description":"The premium tier (Server Boost level) of a guild:\n* NONE\n* TIER_1\n* TIER_2\n* TIER_3","see":["{@link https://discord.com/developers/docs/resources/guild#guild-object-premium-tier}"],"type":[[["string"]]],"meta":{"line":1721,"file":"Constants.js","path":"src/util"}},{"name":"GuildScheduledEventStatus","description":"The status of a {@link GuildScheduledEvent}:\n* SCHEDULED\n* ACTIVE\n* COMPLETED\n* CANCELED","see":["{@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-status}"],"type":[[["string"]]],"meta":{"line":1732,"file":"Constants.js","path":"src/util"}},{"name":"GuildScheduledEventEntityType","description":"The entity type of a {@link GuildScheduledEvent}:\n* NONE\n* STAGE_INSTANCE\n* VOICE\n* EXTERNAL","see":["{@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-types}"],"type":[[["string"]]],"meta":{"line":1743,"file":"Constants.js","path":"src/util"}},{"name":"VideoQualityMode","description":"The camera video quality mode of a {@link VoiceChannel}:\n* AUTO\n* FULL","see":["{@link https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes}"],"type":[[["string"]]],"meta":{"line":1755,"file":"Constants.js","path":"src/util"}},{"name":"ReactionType","description":"The type of reaction\n* NORMAL\n* BURST","see":["{@link https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes}"],"type":[[["string"]]],"meta":{"line":1764,"file":"Constants.js","path":"src/util"}},{"name":"SortOrderType","description":"Sort {@link ThreadOnlyChannel} posts by creation time or activity\n* LATEST_ACTIVITY\n* CREATION_DATE","see":["{@link https://discord.com/developers/docs/resources/channel/#channel-object-sort-order-types}"],"type":[[["string"]]],"meta":{"line":1773,"file":"Constants.js","path":"src/util"}},{"name":"ForumLayoutType","description":"The default forum layout to set on the {@link ForumChannel}\n* NOT_SET\n* LIST_VIEW\n* GALLERY_VIEW","see":["{@link https://discord.com/developers/docs/resources/channel/#channel-object-forum-layout-types}"],"type":[[["string"]]],"meta":{"line":1782,"file":"Constants.js","path":"src/util"}},{"name":"PollLayoutType","description":"Different layouts for {@link MessagePoll} will come in the future. For now though, this value will always be `DEFAULT`.\n* DEFAULT\n* IMAGE_ONLY_ANSWERS","see":["{@link https://docs.discord.food/resources/message#poll-layout-type}"],"type":[[["string"]]],"meta":{"line":1792,"file":"Constants.js","path":"src/util"}},{"name":"RelationshipType","description":"Relationship Enums:\n* 0: NONE\n* 1: FRIEND\n* 2: BLOCKED\n* 3: PENDING_INCOMING\n* 4: PENDING_OUTGOING\n* 5: IMPLICIT","see":["{@link https://luna.gitlab.io/discord-unofficial-docs/relationships.html}"],"type":[[["string"]]],"meta":{"line":1801,"file":"Constants.js","path":"src/util"}},{"name":"GuildTemplateResolvable","description":"Data that can be resolved to give a template code. This can be:\n* A template code\n* A template URL","type":[[["string"]]],"meta":{"line":23,"file":"DataResolver.js","path":"src/util"}},{"name":"Base64Resolvable","description":"Data that resolves to give a Base64 string, typically for image uploading. This can be:\n* A Buffer\n* A base64 string","type":[[["Buffer"]],[["string"]]],"meta":{"line":73,"file":"DataResolver.js","path":"src/util"}},{"name":"BufferResolvable","description":"Data that can be resolved to give a Buffer. This can be:\n* A Buffer\n* The path to a local file\n* A URL When provided a URL, discord.js will fetch the URL internally in order to create a Buffer.\nThis can pose a security risk when the URL has not been sanitized","type":[[["string"]],[["Buffer"]]],"meta":{"line":90,"file":"DataResolver.js","path":"src/util"}},{"name":"TimestampStylesString","description":"A message formatting timestamp style, as defined in\n[here](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles).\n* `t` Short time format, consisting of hours and minutes, e.g. 16:20.\n* `T` Long time format, consisting of hours, minutes, and seconds, e.g. 16:20:30.\n* `d` Short date format, consisting of day, month, and year, e.g. 20/04/2021.\n* `D` Long date format, consisting of day, month, and year, e.g. 20 April 2021.\n* `f` Short date-time format, consisting of short date and short time formats, e.g. 20 April 2021 16:20.\n* `F` Long date-time format, consisting of long date and short time formats, e.g. Tuesday, 20 April 2021 16:20.\n* `R` Relative time format, consisting of a relative duration format, e.g. 2 months ago.","type":[[["string"]]],"meta":{"line":189,"file":"Formatters.js","path":"src/util"}},{"name":"GuildMemberFlagsResolvable","description":"Data that can be resolved to give a guild member flag bitfield. This can be:\n* A string (see {@link GuildMemberFlags.FLAGS})\n* A guild member flag\n* An instance of GuildMemberFlags\n* An Array of GuildMemberFlagsResolvable","type":[[["string"]],[["number"]],[["GuildMemberFlags"]],[["Array","<"],["GuildMemberFlagsResolvable",">"]]],"meta":{"line":34,"file":"GuildMemberFlags.js","path":"src/util"}},{"name":"IntentsResolvable","description":"Data that can be resolved to give a permission number. This can be:\n* A string (see {@link Intents.FLAGS})\n* An intents flag\n* An instance of Intents\n* An array of IntentsResolvable","type":[[["string"]],[["number"]],[["Intents"]],[["Array","<"],["IntentsResolvable",">"]]],"meta":{"line":17,"file":"Intents.js","path":"src/util"}},{"name":"SweepFilter","type":[[["function"]]],"params":[{"name":"collection","description":"The collection being swept","type":[[["LimitedCollection"]]]}],"returns":{"types":[[["function"]],[["null"]]],"description":"Return `null` to skip sweeping, otherwise a function passed to `sweep()`,\nSee {@link [Collection#sweep](https://discord.js.org/docs/packages/collection/stable/Collection:Class#sweep)}\nfor the definition of this function."},"meta":{"line":9,"file":"LimitedCollection.js","path":"src/util"}},{"name":"LimitedCollectionOptions","description":"Options for defining the behavior of a LimitedCollection","type":[[["Object"]]],"props":[{"name":"maxSize","description":"The maximum size of the Collection","optional":true,"default":"Infinity","nullable":true,"type":[[["number"]]]},{"name":"keepOverLimit","description":"A function, which is passed the value and key of an entry, ran to decide\nto keep an entry past the maximum size","optional":true,"default":null,"nullable":true,"type":[[["function"]]]},{"name":"sweepFilter","description":"DEPRECATED: There is no direct alternative to this,\nhowever most of its purpose is fulfilled by {@link Client#sweepers}\nA function ran every `sweepInterval` to determine how to sweep","optional":true,"default":null,"nullable":true,"type":[[["SweepFilter"]]]},{"name":"sweepInterval","description":"DEPRECATED: There is no direct alternative to this,\nhowever most of its purpose is fulfilled by {@link Client#sweepers}\nHow frequently, in seconds, to sweep the collection.","optional":true,"default":0,"nullable":true,"type":[[["number"]]]}],"meta":{"line":17,"file":"LimitedCollection.js","path":"src/util"}},{"name":"RateLimitData","description":"Rate limit data","type":[[["Object"]]],"props":[{"name":"timeout","description":"Time until this rate limit ends, in milliseconds","type":[[["number"]]]},{"name":"limit","description":"The maximum amount of requests of this endpoint","type":[[["number"]]]},{"name":"method","description":"The HTTP method of this request","type":[[["string"]]]},{"name":"path","description":"The path of the request relative to the HTTP endpoint","type":[[["string"]]]},{"name":"route","description":"The route of the request relative to the HTTP endpoint","type":[[["string"]]]},{"name":"global","description":"Whether this is a global rate limit","type":[[["boolean"]]]}],"meta":{"line":7,"file":"Options.js","path":"src/util"}},{"name":"RateLimitQueueFilter","description":"Whether this rate limit should throw an Error","type":[[["function"]]],"params":[{"name":"rateLimitData","description":"The data of this rate limit","type":[[["RateLimitData"]]]}],"returns":[[["boolean"]],[["Promise","<"],["boolean",">"]]],"meta":{"line":18,"file":"Options.js","path":"src/util"}},{"name":"CacheFactory","type":[[["function"]]],"params":[{"name":"manager","description":"The manager class the cache is being requested from.","type":[[["function"]]]},{"name":"holds","description":"The class that the cache will hold.","type":[[["function"]]]}],"returns":{"types":[[["Collection"]]],"description":"A Collection used to store the cache of the manager."},"meta":{"line":25,"file":"Options.js","path":"src/util"}},{"name":"CaptchaSolver","type":[[["function"]]],"params":[{"name":"captcha","description":"Discord Captcha","type":[[["Captcha"]]]},{"name":"UserAgent","description":"Current UserAgent","type":[[["string"]]]}],"returns":{"types":[[["Promise","<"],["string",">"]]],"description":"HCaptcha Token"},"meta":{"line":32,"file":"Options.js","path":"src/util"}},{"name":"ClientOptions","description":"Options for a client.","type":[[["Object"]]],"props":[{"name":"DMChannelVoiceStatusSync","description":"The amount of time in milliseconds that the Client to register the event with each DM channel (0=Disable)","optional":true,"default":0,"type":[[["number"]]]},{"name":"captchaRetryLimit","description":"Captcha retry limit","optional":true,"default":3,"type":[[["number"]]]},{"name":"captchaSolver","description":"Captcha Solver","optional":true,"type":[[["CaptchaSolver"]]]},{"name":"TOTPKey","description":"TOTP key / 2FA Key for two-factor authentication\nThis is a 32-character Base32 string (excluding spaces), typically shown only once during your 2FA setup (QR code), or in the \"Manual Entry\" section.\nThe library automatically removes spaces and converts the secret to uppercase.\nExample value: 'ftc3 uz6q 5lpw 2kew 4thr vtyp n2cu topn' or 'WSLIVE6EKYSRMVRBZLFGG2KVIVJMMQY5'","optional":true,"type":[[["string"]]]},{"name":"closeTimeout","description":"The amount of time in milliseconds to wait for the close frame to be received\nfrom the WebSocket.\nDon't have this too high/low. It's best to have it between 2000-6000 ms.\n(e.g. recommended shard count, shard count of the ShardingManager)","optional":true,"default":5000,"type":[[["number"]]]},{"name":"makeCache","description":"Function to create a cache.\nYou can use your own function, or the {@link Options} class to customize the Collection used for the cache.\nOverriding the cache used in `GuildManager`, `ChannelManager`, `GuildChannelManager`, `RoleManager`,\nand `PermissionOverwriteManager` is unsupported and **will** break functionality","optional":true,"type":[[["CacheFactory"]]]},{"name":"messageCacheLifetime","description":"DEPRECATED: Pass `lifetime` to `sweepers.messages` instead.\nHow long a message should stay in the cache until it is considered sweepable (in seconds, 0 for forever)","optional":true,"default":0,"type":[[["number"]]]},{"name":"messageSweepInterval","description":"DEPRECATED: Pass `interval` to `sweepers.messages` instead.\nHow frequently to remove messages from the cache that are older than the message cache lifetime\n(in seconds, 0 for never)","optional":true,"default":0,"type":[[["number"]]]},{"name":"allowedMentions","description":"Default value for {@link MessageOptions#allowedMentions}","optional":true,"type":[[["MessageMentionOptions"]]]},{"name":"invalidRequestWarningInterval","description":"The number of invalid REST requests (those that return\n401, 403, or 429) in a 10 minute window between emitted warnings (0 for no warnings). That is, if set to 500,\nwarnings will be emitted at invalid request number 500, 1000, 1500, and so on.","optional":true,"default":0,"type":[[["number"]]]},{"name":"partials","description":"Structures allowed to be partial. This means events can be emitted even when\nthey're missing all the data for a particular structure. See the \"Partial Structures\" topic on the\n[guide](https://discordjs.guide/popular-topics/partials.html) for some\nimportant usage information, as partials require you to put checks in place when handling data.","optional":true,"default":"['USER', 'CHANNEL', 'GUILD_MEMBER', 'MESSAGE', 'REACTION', 'GUILD_SCHEDULED_EVENT']","type":[[["Array","<"],["PartialType",">"]]]},{"name":"restWsBridgeTimeout","description":"Maximum time permitted between REST responses and their\ncorresponding WebSocket events","optional":true,"default":5000,"type":[[["number"]]]},{"name":"restTimeOffset","description":"Extra time in milliseconds to wait before continuing to make REST\nrequests (higher values will reduce rate-limiting errors on bad connections)","optional":true,"default":500,"type":[[["number"]]]},{"name":"restRequestTimeout","description":"Time to wait before cancelling a REST request, in milliseconds","optional":true,"default":15000,"type":[[["number"]]]},{"name":"restSweepInterval","description":"How frequently to delete inactive request buckets, in seconds\n(or 0 for never)","optional":true,"default":60,"type":[[["number"]]]},{"name":"restGlobalRateLimit","description":"How many requests to allow sending per second (0 for unlimited, 50 for\nthe standard global limit used by Discord)","optional":true,"default":0,"type":[[["number"]]]},{"name":"rejectOnRateLimit","description":"Decides how rate limits and pre-emptive throttles\nshould be handled. If this option is an array containing the prefix of the request route (e.g. /channels to match any\nroute starting with /channels, such as /channels/222197033908436994/messages) or a function returning true, a\n{@link RateLimitError} will be thrown. Otherwise the request will be queued for later","optional":true,"type":[[["Array","<"],["string",">"]],[["RateLimitQueueFilter"]]]},{"name":"retryLimit","description":"How many times to retry on 5XX errors\n(Infinity for an indefinite amount of retries)","optional":true,"default":1,"type":[[["number"]]]},{"name":"failIfNotExists","description":"Default value for {@link ReplyMessageOptions#failIfNotExists}","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"presence","description":"Presence data to use upon login","optional":true,"default":"{ status: 'online', since: 0, activities: [], afk: false }","type":[[["PresenceData"]]]},{"name":"waitGuildTimeout","description":"Time in milliseconds that Clients with the GUILDS intent should wait for\nmissing guilds to be received before starting the bot. If not specified, the default is 15 seconds.","optional":true,"default":"15_000","type":[[["number"]]]},{"name":"sweepers","description":"Options for cache sweeping","optional":true,"default":"{}","type":[[["SweeperOptions"]]]},{"name":"ws","description":"Options for the WebSocket","optional":true,"type":[[["WebsocketOptions"]]]},{"name":"http","description":"HTTP options","optional":true,"type":[[["HTTPOptions"]]]}],"meta":{"line":50,"file":"Options.js","path":"src/util"}},{"name":"SweeperOptions","description":"Options for {@link Sweepers} defining the behavior of cache sweeping","type":[[["Object","<"],["SweeperKey",", "],["SweepOptions",">"]]],"meta":{"line":105,"file":"Options.js","path":"src/util"}},{"name":"SweepOptions","description":"Options for sweeping a single type of item from cache","type":[[["Object"]]],"props":[{"name":"interval","description":"The interval (in seconds) at which to perform sweeping of the item","type":[[["number"]]]},{"name":"lifetime","description":"How long an item should stay in cache until it is considered sweepable.\nThis property is only valid for the `invites`, `messages`, and `threads` keys. The `filter` property\nis mutually exclusive to this property and takes priority","optional":true,"type":[[["number"]]]},{"name":"filter","description":"The function used to determine the function passed to the sweep method\nThis property is optional when the key is `invites`, `messages`, or `threads` and `lifetime` is set","type":[[["GlobalSweepFilter"]]]}],"meta":{"line":110,"file":"Options.js","path":"src/util"}},{"name":"WebsocketOptions","description":"WebSocket options (these are left as snake_case to match the API)","type":[[["Object"]]],"props":[{"name":"agent","description":"HTTPS Agent options (WS Proxy)","optional":true,"default":"{}","type":[[["AgentOptions"]]]},{"name":"compress","description":"Whether to compress data sent on the connection","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"properties","description":"Properties to identify the client with","optional":true,"type":[[["WebSocketProperties"]]]}],"meta":{"line":121,"file":"Options.js","path":"src/util"}},{"name":"AgentOptions","description":"HTTPS Agent options.","see":["{@link https://nodejs.org/api/https.html#https_class_https_agent}","{@link https://nodejs.org/api/http.html#http_new_agent_options}"],"type":[[["Object"]]],"meta":{"line":129,"file":"Options.js","path":"src/util"}},{"name":"ProxyAgentOptions","description":"ProxyAgent options.","see":["{@link https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md}"],"type":[[["Object"]]],"meta":{"line":136,"file":"Options.js","path":"src/util"}},{"name":"HTTPOptions","description":"HTTP options","type":[[["Object"]]],"props":[{"name":"version","description":"API version to use","optional":true,"default":9,"type":[[["number"]]]},{"name":"agent","description":"ProxyAgent options","optional":true,"default":"{}","type":[[["ProxyAgentOptions"]]]},{"name":"api","description":"Base URL of the API","optional":true,"default":"'https://discord.com/api'","type":[[["string"]]]},{"name":"cdn","description":"Base URL of the CDN","optional":true,"default":"'https://cdn.discordapp.com'","type":[[["string"]]]},{"name":"invite","description":"Base URL of invites","optional":true,"default":"'https://discord.gg'","type":[[["string"]]]},{"name":"template","description":"Base URL of templates","optional":true,"default":"'https://discord.new'","type":[[["string"]]]},{"name":"headers","description":"Additional headers to send for all API requests","optional":true,"type":[[["Object"]]]},{"name":"scheduledEvent","description":"Base URL of guild scheduled events","optional":true,"default":"'https://discord.com/events'","type":[[["string"]]]}],"meta":{"line":142,"file":"Options.js","path":"src/util"}},{"name":"PermissionResolvable","description":"Data that can be resolved to give a permission number. This can be:\n* A string (see {@link Permissions.FLAGS})\n* A permission number\n* An instance of Permissions\n* An Array of PermissionResolvable","type":[[["string"]],[["bigint"]],[["Permissions"]],[["Array","<"],["PermissionResolvable",">"]]],"meta":{"line":18,"file":"Permissions.js","path":"src/util"}},{"name":"UserRaw","type":[[["Object"]]],"props":[{"name":"id","type":[[["Snowflake"]]]},{"name":"username","type":[[["string"]]]},{"name":"discriminator","type":[[["number"]]]},{"name":"avatar","type":[[["string"]]]}],"meta":{"line":260,"file":"RemoteAuth.js","path":"src/util"}},{"name":"RoleFlagsResolvable","description":"Data that can be resolved to give a role flag bitfield. This can be:\n* A string (see {@link RoleFlags.FLAGS})\n* A role flag\n* An instance of RoleFlags\n* An Array of RoleFlagsResolvable","type":[[["string"]],[["number"]],[["RoleFlags"]],[["Array","<"],["RoleFlagsResolvable",">"]]],"meta":{"line":28,"file":"RoleFlags.js","path":"src/util"}},{"name":"Snowflake","description":"A {@link https://docs.x.com/resources/fundamentals/x-ids Twitter snowflake},\nexcept the epoch is 2015-01-01T00:00:00.000Z.\n\nIf we have a snowflake '266241948824764416' we can represent it as binary:\n```\n64 22 17 12 0\n 000000111011000111100001101001000101000000 00001 00000 000000000000\n number of milliseconds since Discord epoch worker pid increment\n```","type":[[["string"]]],"meta":{"line":11,"file":"SnowflakeUtil.js","path":"src/util"}},{"name":"DeconstructedSnowflake","description":"A deconstructed snowflake.","type":[[["Object"]]],"props":[{"name":"timestamp","description":"Timestamp the snowflake was created","type":[[["number"]]]},{"name":"date","description":"Date the snowflake was created","type":[[["Date"]]]},{"name":"workerId","description":"The worker's id in the snowflake","type":[[["number"]]]},{"name":"processId","description":"The process's id in the snowflake","type":[[["number"]]]},{"name":"increment","description":"Increment in the snowflake","type":[[["number"]]]},{"name":"binary","description":"Binary representation of the snowflake","type":[[["string"]]]}],"meta":{"line":43,"file":"SnowflakeUtil.js","path":"src/util"}},{"name":"GlobalSweepFilter","type":[[["function"]]],"returns":{"types":[[["function"]],[["null"]]],"description":"Return `null` to skip sweeping, otherwise a function passed to `sweep()`,\nSee {@link [Collection#sweep](https://discord.js.org/docs/packages/collection/stable/Collection:Class#sweep)}\nfor the definition of this function."},"meta":{"line":7,"file":"Sweepers.js","path":"src/util"}},{"name":"LifetimeFilterOptions","description":"Options for generating a filter function based on lifetime","type":[[["Object"]]],"props":[{"name":"lifetime","description":"How long, in seconds, an entry should stay in the collection\nbefore it is considered sweepable.","optional":true,"default":14400,"type":[[["number"]]]},{"name":"getComparisonTimestamp","description":"A function that takes an entry, key,\nand the collection and returns a timestamp to compare against in order to determine the lifetime of the entry.","optional":true,"default":"e => e?.createdTimestamp","type":[[["function"]]]},{"name":"excludeFromSweep","description":"A function that takes an entry, key, and the collection\nand returns a boolean, `true` when the entry should not be checked for sweepability.","optional":true,"default":"() => false","type":[[["function"]]]}],"meta":{"line":303,"file":"Sweepers.js","path":"src/util"}},{"name":"SweepEventOptions","description":"Configuration options for emitting the cache sweep client event","access":"private","type":[[["Object"]]],"props":[{"name":"emit","description":"Whether to emit the client event in this method","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"outputName","description":"A name to output in the client event if it should differ from the key","optional":true,"type":[[["string"]]]}],"meta":{"line":385,"file":"Sweepers.js","path":"src/util"}},{"name":"SystemChannelFlagsResolvable","description":"Data that can be resolved to give a system channel flag bitfield. This can be:\n* A string (see {@link SystemChannelFlags.FLAGS})\n* A system channel flag\n* An instance of SystemChannelFlags\n* An Array of SystemChannelFlagsResolvable","type":[[["string"]],[["number"]],[["SystemChannelFlags"]],[["Array","<"],["SystemChannelFlagsResolvable",">"]]],"meta":{"line":26,"file":"SystemChannelFlags.js","path":"src/util"}},{"name":"SplitOptions","description":"Options for splitting a message.","type":[[["Object"]]],"props":[{"name":"maxLength","description":"Maximum character length per message piece","optional":true,"default":2000,"type":[[["number"]]]},{"name":"char","description":"Character(s) or Regex(es) to split the message with,\nan array can be used to split multiple times","optional":true,"default":"'\\n'","type":[[["string"]],[["Array","<"],["string",">"]],[["RegExp"]],[["Array","<"],["RegExp",">"]]]},{"name":"prepend","description":"Text to prepend to every piece except the first","optional":true,"default":"''","type":[[["string"]]]},{"name":"append","description":"Text to append to every piece except the last","optional":true,"default":"''","type":[[["string"]]]}],"meta":{"line":125,"file":"Util.js","path":"src/util"}},{"name":"EscapeMarkdownOptions","description":"Options used to escape markdown.","type":[[["Object"]]],"props":[{"name":"codeBlock","description":"Whether to escape code blocks","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"inlineCode","description":"Whether to escape inline code","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"bold","description":"Whether to escape bolds","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"italic","description":"Whether to escape italics","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"underline","description":"Whether to escape underlines","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"strikethrough","description":"Whether to escape strikethroughs","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"spoiler","description":"Whether to escape spoilers","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"codeBlockContent","description":"Whether to escape text inside code blocks","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"inlineCodeContent","description":"Whether to escape text inside inline code","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"escape","description":"Whether to escape escape characters","optional":true,"default":true,"type":[[["boolean"]]]},{"name":"heading","description":"Whether to escape headings","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"bulletedList","description":"Whether to escape bulleted lists","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"numberedList","description":"Whether to escape numbered lists","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"maskedLink","description":"Whether to escape masked links","optional":true,"default":false,"type":[[["boolean"]]]}],"meta":{"line":180,"file":"Util.js","path":"src/util"}},{"name":"FetchRecommendedShardsOptions","type":[[["Object"]]],"props":[{"name":"guildsPerShard","description":"Number of guilds assigned per shard","optional":true,"default":1000,"type":[[["number"]]]},{"name":"multipleOf","description":"The multiple the shard count should round up to. (16 for large bot sharding)","optional":true,"default":1,"type":[[["number"]]]}],"meta":{"line":407,"file":"Util.js","path":"src/util"}},{"name":"MakeErrorOptions","description":"Options used to make an error object.","type":[[["Object"]]],"props":[{"name":"name","description":"Error type","type":[[["string"]]]},{"name":"message","description":"Message for the error","type":[[["string"]]]},{"name":"stack","description":"Stack for the error","type":[[["string"]]]}],"meta":{"line":477,"file":"Util.js","path":"src/util"}},{"name":"ColorResolvable","description":"Can be a number, hex string, a {@link Color}, or an RGB array like:\n```js\n[255, 0, 255] // purple\n```","type":[[["string"]],[["Color"]],[["number"]],[["Array","<"],["number",">"]]],"meta":{"line":550,"file":"Util.js","path":"src/util"}}],"externals":[{"name":"Collection","see":["{@link https://discord.js.org/docs/packages/collection/stable/Collection:Class}"],"meta":{"line":931,"file":"Client.js","path":"src/client"}},{"name":"WritableStream","see":["{@link https://nodejs.org/api/stream.html#stream_class_stream_writable}"],"meta":{"line":14,"file":"BaseDispatcher.js","path":"src/client/voice/dispatcher"}},{"name":"Inflate","see":["{@link https://www.npmjs.com/package/zlib-sync}"],"meta":{"line":124,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"CloseEvent","see":["{@link https://developer.mozilla.org/docs/Web/API/CloseEvent}"],"meta":{"line":353,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"ErrorEvent","see":["{@link https://developer.mozilla.org/docs/Web/API/ErrorEvent}"],"meta":{"line":358,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"MessageEvent","see":["{@link https://developer.mozilla.org/docs/Web/API/MessageEvent}"],"meta":{"line":363,"file":"WebSocketShard.js","path":"src/client/websocket"}},{"name":"SlashCommandBuilder","see":["{@link https://discord.js.org/docs/packages/builders/stable/SlashCommandBuilder:Class}"],"meta":{"line":256,"file":"ApplicationCommandManager.js","path":"src/managers"}},{"name":"ContextMenuCommandBuilder","see":["{@link https://discord.js.org/docs/packages/builders/stable/ContextMenuCommandBuilder:Class}"],"meta":{"line":261,"file":"ApplicationCommandManager.js","path":"src/managers"}},{"name":"APIApplicationCommandPermissions","see":["{@link https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-structure}"],"meta":{"line":414,"file":"ApplicationCommandPermissionsManager.js","path":"src/managers"}},{"name":"APIError","see":["{@link https://discord.com/developers/docs/reference#error-messages}"],"meta":{"line":116,"file":"DiscordAPIError.js","path":"src/rest"}},{"name":"HTTPMethod","see":["{@link https://developer.mozilla.org/docs/Web/HTTP/Methods}"],"meta":{"line":458,"file":"RequestHandler.js","path":"src/rest"}},{"name":"Response","see":["{@link https://developer.mozilla.org/docs/Web/API/Response}"],"meta":{"line":463,"file":"RequestHandler.js","path":"src/rest"}},{"name":"APIApplicationCommand","see":["{@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure}"],"meta":{"line":585,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"APIApplicationCommandOption","see":["{@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure}"],"meta":{"line":590,"file":"ApplicationCommand.js","path":"src/structures"}},{"name":"APIInteractionDataResolved","see":["{@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure}"],"meta":{"line":208,"file":"BaseCommandInteraction.js","path":"src/structures"}},{"name":"APIChannel","see":["{@link https://discord.com/developers/docs/resources/channel#channel-object}"],"meta":{"line":281,"file":"Channel.js","path":"src/structures"}},{"name":"APIPresence","see":["{@link https://discord.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields}"],"meta":{"line":74,"file":"ClientPresence.js","path":"src/structures"}},{"name":"APIEmoji","see":["{@link https://discord.com/developers/docs/resources/emoji#emoji-object}"],"meta":{"line":145,"file":"Emoji.js","path":"src/structures"}},{"name":"APIGuild","see":["{@link https://discord.com/developers/docs/resources/guild#guild-object}"],"meta":{"line":1635,"file":"Guild.js","path":"src/structures"}},{"name":"APIGuildMember","see":["{@link https://discord.com/developers/docs/resources/guild#guild-member-object}"],"meta":{"line":633,"file":"GuildMember.js","path":"src/structures"}},{"name":"APIMessageComponent","see":["{@link https://discord.com/developers/docs/interactions/message-components#component-object}"],"meta":{"line":102,"file":"MessageActionRow.js","path":"src/structures"}},{"name":"APIAttachment","see":["{@link https://discord.com/developers/docs/resources/channel#attachment-object}"],"meta":{"line":213,"file":"MessageAttachment.js","path":"src/structures"}},{"name":"APIMessageSelectMenu","see":["{@link https://discord.com/developers/docs/interactions/message-components#select-menu-object}"],"meta":{"line":112,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"APIMessageButton","see":["{@link https://discord.com/developers/docs/interactions/message-components#button-object}"],"meta":{"line":117,"file":"MessageComponentInteraction.js","path":"src/structures"}},{"name":"APIEmbed","see":["{@link https://discord.com/developers/docs/resources/channel#embed-object}"],"meta":{"line":593,"file":"MessageEmbed.js","path":"src/structures"}},{"name":"APIMessage","see":["{@link https://discord.com/developers/docs/resources/channel#message-object}"],"meta":{"line":351,"file":"MessagePayload.js","path":"src/structures"}},{"name":"APIRole","see":["{@link https://discord.com/developers/docs/topics/permissions#role-object}"],"meta":{"line":587,"file":"Role.js","path":"src/structures"}},{"name":"APISticker","see":["{@link https://discord.com/developers/docs/resources/sticker#sticker-object}"],"meta":{"line":307,"file":"Sticker.js","path":"src/structures"}},{"name":"APIUser","see":["{@link https://discord.com/developers/docs/resources/user#user-object}"],"meta":{"line":619,"file":"User.js","path":"src/structures"}},{"name":"APIGuildScheduledEventRecurrenceRule","see":["{@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIGuildScheduledEventRecurrenceRule}"],"meta":{"line":1,"file":"APITypes.js","path":"src/util"}},{"name":"APIIncidentsData","see":["{@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIIncidentsData}"],"meta":{"line":6,"file":"APITypes.js","path":"src/util"}},{"name":"GuildScheduledEventRecurrenceRuleFrequency","see":["{@link https://discord-api-types.dev/api/discord-api-types-v10/enum/GuildScheduledEventRecurrenceRuleFrequency}"],"meta":{"line":11,"file":"APITypes.js","path":"src/util"}},{"name":"GuildScheduledEventRecurrenceRuleMonth","see":["{@link https://discord-api-types.dev/api/discord-api-types-v10/enum/GuildScheduledEventRecurrenceRuleMonth}"],"meta":{"line":16,"file":"APITypes.js","path":"src/util"}},{"name":"GuildScheduledEventRecurrenceRuleWeekday","see":["{@link https://discord-api-types.dev/api/discord-api-types-v10/enum/GuildScheduledEventRecurrenceRuleWeekday}"],"meta":{"line":21,"file":"APITypes.js","path":"src/util"}},{"name":"MessageActivityType","see":["{@link https://discord-api-types.dev/api/discord-api-types-v10/enum/MessageActivityType}"],"meta":{"line":26,"file":"APITypes.js","path":"src/util"}},{"name":"NameplatePalette","see":["{@link https://discord-api-types.dev/api/discord-api-types-v10/enum/NameplatePalette}"],"meta":{"line":31,"file":"APITypes.js","path":"src/util"}},{"name":"PollLayoutType","see":["{@link https://discord-api-types.dev/api/discord-api-types-v10/enum/PollLayoutType}"],"meta":{"line":36,"file":"APITypes.js","path":"src/util"}},{"name":"ReactionType","see":["{@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ReactionType}"],"meta":{"line":41,"file":"APITypes.js","path":"src/util"}},{"name":"RtpPacket","see":["{@link https://github.com/shinyoshiaki/werift-webrtc/blob/develop/doc/classes/RtpPacket.md}"],"meta":{"line":46,"file":"APITypes.js","path":"src/util"}},{"name":"TeamMemberRole","see":["{@link https://discord-api-types.dev/api/discord-api-types-v10/enum/TeamMemberRole}"],"meta":{"line":51,"file":"APITypes.js","path":"src/util"}},{"name":"VoiceChannelEffectSendAnimationType","see":["{@link https://discord-api-types.dev/api/discord-api-types-v10/enum/VoiceChannelEffectSendAnimationType}"],"meta":{"line":56,"file":"APITypes.js","path":"src/util"}},{"name":"Stream","see":["{@link https://nodejs.org/api/stream.html}"],"meta":{"line":99,"file":"DataResolver.js","path":"src/util"}}]} \ No newline at end of file diff --git a/vendor/discord.js-selfbot-v13/docs/readme.md b/vendor/discord.js-selfbot-v13/docs/readme.md deleted file mode 100644 index 5c992da..0000000 --- a/vendor/discord.js-selfbot-v13/docs/readme.md +++ /dev/null @@ -1 +0,0 @@ -# [View the documentation here.](https://discordjs-self-v13.netlify.app/#/docs) \ No newline at end of file diff --git a/vendor/discord.js-selfbot-v13/examples/ActivityMessage.js b/vendor/discord.js-selfbot-v13/examples/ActivityMessage.js deleted file mode 100644 index 306f3e9..0000000 --- a/vendor/discord.js-selfbot-v13/examples/ActivityMessage.js +++ /dev/null @@ -1,15 +0,0 @@ -const { Client } = require('../src/index'); -const client = new Client(); - -client.on('ready', async () => { - console.log(`${client.user.username} is ready!`); - const channel = client.channels.cache.get('id'); - channel.send({ - activity: { - type: 3, // MessageActivityType.Listen - partyId: `spotify:${client.user.id}`, - }, - }); -}); - -client.login('token'); diff --git a/vendor/discord.js-selfbot-v13/examples/AddBot.js b/vendor/discord.js-selfbot-v13/examples/AddBot.js deleted file mode 100644 index fa114dd..0000000 --- a/vendor/discord.js-selfbot-v13/examples/AddBot.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -// No longer using 2captcha since the website no longer supports hCaptcha, which Discord uses. -const Captcha = require('2captcha'); -const Discord = require('../src/index'); - -const solver = new Captcha.Solver('<2captcha key>'); - -const client = new Discord.Client({ - captchaSolver: function (captcha, UA) { - return solver - .hcaptcha(captcha.captcha_sitekey, 'discord.com', { - invisible: 1, - userAgent: UA, - data: captcha.captcha_rqdata, - }) - .then(res => res.data); - }, - TOTPKey: '', -}); - -client.on('ready', async () => { - console.log('Ready!', client.user.tag); - // Note - // You need to include `guild_id` to invite the bot - // These two fields can appear either in the URL or in the options. - await client.authorizeURL( - `https://discord.com/api/oauth2/authorize?client_id=289066747443675143&permissions=414501424448&scope=bot%20applications.commands`, - { - guild_id: 'guild id', - }, - ); -}); - -client.login('token'); diff --git a/vendor/discord.js-selfbot-v13/examples/AuthorizeUserApps.js b/vendor/discord.js-selfbot-v13/examples/AuthorizeUserApps.js deleted file mode 100644 index f07c09c..0000000 --- a/vendor/discord.js-selfbot-v13/examples/AuthorizeUserApps.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -const Discord = require('../src/index'); - -const client = new Discord.Client(); - -client.on('ready', async () => { - console.log('Ready!', client.user.tag); - await client.installUserApps('936929561302675456'); // Midjourney -}); - -client.login('token'); diff --git a/vendor/discord.js-selfbot-v13/examples/Basic.js b/vendor/discord.js-selfbot-v13/examples/Basic.js deleted file mode 100644 index 84dbd68..0000000 --- a/vendor/discord.js-selfbot-v13/examples/Basic.js +++ /dev/null @@ -1,14 +0,0 @@ -const { Client } = require('../src/index'); -const client = new Client(); - -client.on('ready', async () => { - console.log(`${client.user.username} is ready!`); -}); - -client.on("messageCreate", message => { - if (message.content == 'ping') { - message.reply('pong'); - } -}); - -client.login('token'); diff --git a/vendor/discord.js-selfbot-v13/examples/CreateAndVotePoll.js b/vendor/discord.js-selfbot-v13/examples/CreateAndVotePoll.js deleted file mode 100644 index 398cf50..0000000 --- a/vendor/discord.js-selfbot-v13/examples/CreateAndVotePoll.js +++ /dev/null @@ -1,37 +0,0 @@ -const { Client } = require('../src/index'); -const client = new Client(); - -client.on('ready', async () => { - console.log(`${client.user.username} is ready!`); - const channel = client.channels.cache.get('channel id'); - const message = await channel.send({ - poll: { - question: { - text: 'What is your favorite color?', - }, - answers: [{ text: 'Red', emoji: '🍎' }, { text: 'Green', emoji: '🥗' }, { text: 'Blue', emoji: '💙' }, { text: 'Yellow', emoji: '🟡' }], - duration: 8, - allowMultiselect: true, - }, - }); - - console.log(message.poll); - // Multi select - await message.vote(1, 3); -}); - -client.on('messagePollVoteAdd', (answer, userId) => { - console.log(`User ${userId} voted for answer ${answer.id}`); -}); - -client.on('messagePollVoteRemove', (answer, userId) => { - console.log(`User ${userId} removed their vote for answer ${answer.id}`); -}); - -client.on('messageUpdate', async (_oldMessage, newMessage) => { - if (!newMessage.poll) return; - - console.log('Poll was updated', newMessage.poll); -}); - -client.login('token'); diff --git a/vendor/discord.js-selfbot-v13/examples/Embed.js b/vendor/discord.js-selfbot-v13/examples/Embed.js deleted file mode 100644 index 29b3bfe..0000000 --- a/vendor/discord.js-selfbot-v13/examples/Embed.js +++ /dev/null @@ -1,41 +0,0 @@ -const { Client, WebEmbed } = require('../src/index'); -const client = new Client(); - -client.on('ready', async () => { - console.log(`${client.user.username} is ready!`); -}); - -client.on('messageCreate', message => { - if (message.content == 'embed_hidden_url') { - const embed = new WebEmbed() - .setAuthor({ name: 'hello', url: 'https://google.com' }) - .setColor('RED') - .setDescription('description uh') - .setProvider({ name: 'provider', url: 'https://google.com' }) - .setTitle('This is Title') - .setURL('https://google.com') - .setImage('https://i.ytimg.com/vi/iBP8HambzpY/maxresdefault.jpg') - .setRedirect('https://www.youtube.com/watch?v=iBP8HambzpY') - .setVideo('http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4'); - message.channel.send({ - content: `Hello world ${WebEmbed.hiddenEmbed}${embed}`, - }); - } - if (message.content == 'embed') { - const embed = new WebEmbed() - .setAuthor({ name: 'hello', url: 'https://google.com' }) - .setColor('RED') - .setDescription('description uh') - .setProvider({ name: 'provider', url: 'https://google.com' }) - .setTitle('This is Title') - .setURL('https://google.com') - .setImage('https://i.ytimg.com/vi/iBP8HambzpY/maxresdefault.jpg') - .setRedirect('https://www.youtube.com/watch?v=iBP8HambzpY') - .setVideo('http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4'); - message.channel.send({ - content: `${embed}`, - }); - } -}); - -client.login('token'); diff --git a/vendor/discord.js-selfbot-v13/examples/JoinGuild.js b/vendor/discord.js-selfbot-v13/examples/JoinGuild.js deleted file mode 100644 index 807ebcc..0000000 --- a/vendor/discord.js-selfbot-v13/examples/JoinGuild.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -// No longer using 2captcha since the website no longer supports hCaptcha, which Discord uses. -const Captcha = require('2captcha'); -const Discord = require('../src/index'); - -const solver = new Captcha.Solver('<2captcha key>'); - -const client = new Discord.Client({ - captchaSolver: function (captcha, UA) { - return solver - .hcaptcha(captcha.captcha_sitekey, 'discord.com', { - invisible: 1, - userAgent: UA, - data: captcha.captcha_rqdata, - }) - .then(res => res.data); - }, - captchaRetryLimit: 3, -}); - -client.on('ready', async () => { - console.log('Ready!', client.user.tag); - await client.acceptInvite('mdmc'); -}); - -client.login('token'); diff --git a/vendor/discord.js-selfbot-v13/examples/Proxy.js b/vendor/discord.js-selfbot-v13/examples/Proxy.js deleted file mode 100644 index 53cf5d3..0000000 --- a/vendor/discord.js-selfbot-v13/examples/Proxy.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -const Discord = require('../src/index'); -const { ProxyAgent } = require('proxy-agent'); - -const proxy = new ProxyAgent({ - getProxyForUrl: function () { - return ''; - }, -}); - -const client = new Discord.Client({ - ws: { - agent: proxy, // WebSocket Proxy - // Do not use the `proxy` option if you don't need to use the WebSocket Proxy - }, - http: { - // API Proxy - // Read more: https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md - // agent: ProxyAgentOptions - agent: 'my.proxy.server', - // or new URL('my.proxy.server') - // or { uri: 'my.proxy.server' } - }, -}); - -// So if you only need to use the API Proxy (for the purpose of saving data), you don't need to install `proxy-agent`. - -client.on('ready', async () => { - console.log('Ready!', client.user.tag); -}); - -client.login('token'); diff --git a/vendor/discord.js-selfbot-v13/examples/RichPresence.js b/vendor/discord.js-selfbot-v13/examples/RichPresence.js deleted file mode 100644 index 0bc6fcb..0000000 --- a/vendor/discord.js-selfbot-v13/examples/RichPresence.js +++ /dev/null @@ -1,47 +0,0 @@ -const { Client, RichPresence, CustomStatus, SpotifyRPC } = require('discord.js-selfbot-v13'); -const client = new Client(); - -client.on('ready', async () => { - console.log(`${client.user.username} is ready!`); - const getExtendURL = await RichPresence.getExternal( - client, - '367827983903490050', - 'https://assets.ppy.sh/beatmaps/1550633/covers/list.jpg', // Required if the image you use is not in Discord - ); - const status = new RichPresence(client) - .setApplicationId('367827983903490050') - .setType('PLAYING') - .setURL('https://www.youtube.com/watch?v=5icFcPkVzMg') // If you set a URL, it will automatically change to STREAMING type - .setState('Arcade Game') - .setName('osu!') - .setDetails('MariannE - Yooh') - .setParty({ - max: 8, - current: 1, - }) - .setStartTimestamp(Date.now()) - .setAssetsLargeImage(getExtendURL[0].external_asset_path) // https://assets.ppy.sh/beatmaps/1550633/covers/list.jpg - .setAssetsLargeText('Idle') - .setAssetsSmallImage('373370493127884800') // https://discord.com/api/v9/oauth2/applications/367827983903490050/assets - .setAssetsSmallText('click the circles') - .setPlatform('desktop') - .addButton('Beatmap', 'https://osu.ppy.sh/beatmapsets/1391659#osu/2873429'); - // Custom Status - const custom = new CustomStatus(client).setEmoji('😋').setState('yum'); - // Spotify - const spotify = new SpotifyRPC(client) - .setAssetsLargeImage('spotify:ab67616d00001e02768629f8bc5b39b68797d1bb') // Image ID - .setAssetsSmallImage('spotify:ab6761610000f178049d8aeae802c96c8208f3b7') // Image ID - .setAssetsLargeText('未来茶屋 (vol.1)') // Album Name - .setState('Yunomi; Kizuna AI') // Artists - .setDetails('ロボットハート') // Song name - .setStartTimestamp(Date.now()) - .setEndTimestamp(Date.now() + 1_000 * (2 * 60 + 56)) // Song length = 2m56s - .setSongId('667eE4CFfNtJloC6Lvmgrx') // Song ID - .setAlbumId('6AAmvxoPoDbJAwbatKwMb9') // Album ID - .setArtistIds('2j00CVYTPx6q9ANbmB2keb', '2nKGmC5Mc13ct02xAY8ccS'); // Artist IDs - - client.user.setPresence({ activities: [status, custom, spotify] }); -}); - -client.login('token'); diff --git a/vendor/discord.js-selfbot-v13/examples/SamsungRPC.js b/vendor/discord.js-selfbot-v13/examples/SamsungRPC.js deleted file mode 100644 index ca61d88..0000000 --- a/vendor/discord.js-selfbot-v13/examples/SamsungRPC.js +++ /dev/null @@ -1,17 +0,0 @@ -const { Client } = require('../src/index'); - -const client = new Client(); - -client.on('ready', async () => { - client.user.setSamsungActivity('com.YostarJP.BlueArchive', 'START'); - - setTimeout(() => { - client.user.setSamsungActivity('com.miHoYo.bh3oversea', 'UPDATE'); - }, 30_000); - - setTimeout(() => { - client.user.setSamsungActivity('com.miHoYo.GenshinImpact', 'STOP'); - }, 60_000); -}); - -client.login('token'); diff --git a/vendor/discord.js-selfbot-v13/examples/SlashCommand.md b/vendor/discord.js-selfbot-v13/examples/SlashCommand.md deleted file mode 100644 index 0e0a319..0000000 --- a/vendor/discord.js-selfbot-v13/examples/SlashCommand.md +++ /dev/null @@ -1,129 +0,0 @@ -# Slash command - -```js -TextBasedChannel.sendSlash( - user: BotId (Snowflake) | User (User.bot === true), - commandName: 'command_name [sub_group] [sub]', - ...args: (string|number|boolean|FileLike|undefined)[], -): Promise | Modal> -``` - -## Basic - -### Demo - -![image](https://user-images.githubusercontent.com/71698422/173344527-86520c60-64cd-459c-ba3b-d35f14279f93.png) - -### Code - -```js -await channel.sendSlash('bot_id', 'aiko') -``` - -## Sub Command / Sub Group - -### Demo - -![image](https://user-images.githubusercontent.com/71698422/173346438-678009a1-870c-49a2-97fe-8ceed4f1ab64.png) - -### Code test - -```js -await channel.sendSlash('450323683840491530', 'animal chat', 'bye') -``` - -## Attachment - -### Demo - -![image](https://user-images.githubusercontent.com/71698422/173346964-0c44f91f-e5bf-43d4-8401-914fc3e92073.png) - -### Code test - -```js -const { MessageAttachment } = require('discord.js-selfbot-v13') -const fs = require('fs') -const a = new MessageAttachment(fs.readFileSync('./wallpaper.jpg') , 'test.jpg') -await message.channel.sendSlash('718642000898818048', 'sauce', a) -``` - -### Result - -![image](https://user-images.githubusercontent.com/71698422/173347075-5c8a1347-3845-489e-956b-63975911b6e0.png) - -## Skip options - -### Demo Command - -![image](https://github.com/user-attachments/assets/e7b8fc6c-4816-49df-a400-6a4eed7a9a88) -![image](https://github.com/user-attachments/assets/3452f388-639b-4626-a826-56ec3683ee32) -![image](https://github.com/user-attachments/assets/4a1e92d7-402d-4087-afa7-5794ce8ba6eb) -![image](https://github.com/user-attachments/assets/85b029f4-27f7-4e20-b3a7-a4d0597b4a98) - -### Code -```js - const channel = client.channels.cache.get('channel_id'); - const response = await channel.sendSlash( - 'bot_id', - 'image make', - 'MeinaMix - v11', - 'Phone (9:16) [576x1024 | 810x1440]', - '2', // String choices, not number - undefined, // VAE - undefined, // sdxl_refiner - undefined, // sampling_method, - 30, - ); - // Submit Modal - if (!response.isMessage) { // Modal - response.components[0].components[0].setValue( - '1girl, brown hair, green eyes, colorful, autumn, cumulonimbus clouds', - ); - response.components[1].components[0].setValue( - '(worst quality:1.4), (low quality:1.4), (normal quality:1.4), (ugly:1.4), (bad anatomy:1.4), (extra limbs:1.2), (text, error, signature, watermark:1.2), (bad legs, incomplete legs), (bad feet), (bad arms), (bad hands, too many hands, mutated hands), (zombie, sketch, interlocked fingers, comic, morbid), cropped, long neck, lowres, missing fingers, missing arms, missing legs, extra fingers, extra digit, fewer digits, jpeg artifacts', - ); - await response.reply(); - } - -``` - -### Receive messages after bot has replied `{botname} is thinking...` - -> [aiko-chan-ai/discord.js-selfbot-v13#1055 (comment)](https://github.com/aiko-chan-ai/discord.js-selfbot-v13/issues/1055#issuecomment-1949653100) - -![image](https://github.com/user-attachments/assets/0a1d253a-7751-4f63-a750-58b50d055928) - -```js -const channel = client.channels.cache.get('id'); -channel - .sendSlash('289066747443675143', 'osu', 'Accolibed') - .then(async (message) => { - if (message.flags.has('LOADING')) { // owo is thinking... - return new Promise((resolve, reject) => { - let done = false; - const timeout = setTimeout(() => { - if (!done) { - done = true; - client.off('messageUpdate', onUpdate); - reject('timeout'); - } - }, 15 * 60 * 1000); // 15m (DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE) - - function onUpdate(_, m) { - if (_.id === message.id) { - if (!done) { - done = true; - clearTimeout(timeout); - client.off('messageUpdate', onUpdate); - resolve(m); - } - } - } - client.on('messageUpdate', onUpdate); - }); - } else { - return Promise.resolve(message); - } - }) - .then(console.log); -``` diff --git a/vendor/discord.js-selfbot-v13/examples/VoiceChannel/JoinVoice.js b/vendor/discord.js-selfbot-v13/examples/VoiceChannel/JoinVoice.js deleted file mode 100644 index eacc003..0000000 --- a/vendor/discord.js-selfbot-v13/examples/VoiceChannel/JoinVoice.js +++ /dev/null @@ -1,30 +0,0 @@ -// Join a voice channel and do nothing - -/* -Install: -- An Opus library: @discordjs/opus or opusscript -- An encryption packages: - + sodium (best performance) - + libsodium-wrappers - + @stablelib/xchacha20poly1305 -- ffmpeg (install and add to your system environment) -*/ - -const { Client } = require('../../src/index'); -const client = new Client(); - -client.on('ready', async () => { - console.log(`${client.user.username} is ready!`); - const channel = client.channels.cache.get('voice_channel'); - const connection = await client.voice.joinChannel(channel, { - selfMute: true, - selfDeaf: true, - selfVideo: false, - }); - // Leave voice - setTimeout(() => { - connection.disconnect(); - }, 5_000); -}); - -client.login('token'); diff --git a/vendor/discord.js-selfbot-v13/examples/VoiceChannel/PlayAudio.js b/vendor/discord.js-selfbot-v13/examples/VoiceChannel/PlayAudio.js deleted file mode 100644 index fd140c1..0000000 --- a/vendor/discord.js-selfbot-v13/examples/VoiceChannel/PlayAudio.js +++ /dev/null @@ -1,58 +0,0 @@ -// Join a channel and play music, like a Discord bot. - -/* -Install: -- An Opus library: @discordjs/opus or opusscript -- An encryption packages: - + sodium (best performance) - + libsodium-wrappers - + @stablelib/xchacha20poly1305 -- ffmpeg (install and add to your system environment) -*/ - - -const { Client } = require('../../src/index'); -const ytdl = require('@distube/ytdl-core'); // better than ytdl-core -const client = new Client(); - -client.on('ready', async client => { - console.log(`${client.user.username} is ready!`); - const channel = client.channels.cache.get('voice_id'); - const connection = await client.voice.joinChannel(channel, { - selfMute: true, - selfDeaf: true, - selfVideo: false, - }); - const dispatcher = connection.playAudio( - ytdl('https://www.youtube.com/watch?v=3KadWjpqDXs', { - quality: 'highestaudio', - }), - ); - dispatcher.on('start', () => { - console.log('audio is now playing!'); - // pause - console.log('paused'); - dispatcher.pause(); - // resume - setTimeout(() => { - console.log('resumed'); - dispatcher.resume(); - }, 5_000); - - // Set volume - dispatcher.setVolume(0.5); - console.log('50% volume'); - }); - - dispatcher.on('finish', () => { - console.log('audio has finished playing!'); - }); - dispatcher.on('error', console.error); - // Leave voice - setTimeout(() => { - console.log('disconnected'); - connection.disconnect(); - }, 30_000); -}); - -client.login('token'); diff --git a/vendor/discord.js-selfbot-v13/examples/VoiceChannel/PlayVideo.js b/vendor/discord.js-selfbot-v13/examples/VoiceChannel/PlayVideo.js deleted file mode 100644 index 40e6d36..0000000 --- a/vendor/discord.js-selfbot-v13/examples/VoiceChannel/PlayVideo.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -Credit: https://github.com/dank074/Discord-video-stream -The use of video streaming in this library is an incomplete implementation with many bugs, primarily aimed at lazy users. -The video streaming features in this library are sourced from https://github.com/dank074/Discord-video-stream. - -Please use the @dank074/discord-video-stream library to access all advanced and professional features, -along with comprehensive support. I will not actively fix bugs related to streaming and encourage everyone to -use https://github.com/dank074/Discord-video-stream for stable and smooth streaming. - -To reiterate: This is an incomplete implementation of the library https://github.com/dank074/Discord-video-stream. - -Thanks to dank074 and longnguyen2004 for implementing new codecs (H264, H265). -Thanks to mrjvs for discovering how Discord transmits data and the VP8 codec. - -Please use the @dank074/discord-video-stream library for the best support. -*/ - -/* -Install: -- An Opus library: @discordjs/opus or opusscript -- An encryption packages: - + sodium (best performance) - + libsodium-wrappers - + @stablelib/xchacha20poly1305 -- ffmpeg (install and add to your system environment) -*/ - -const { Client } = require('../../src/index'); -const client = new Client(); - -client.on('ready', async client => { - console.log(`${client.user.username} is ready!`); - const channel = client.channels.cache.get('voice_channel'); - const connection = await client.voice.joinChannel(channel, { - selfMute: true, - selfDeaf: true, - selfVideo: false, // Turn on the camera? If you turn on the camera, use the connection similar to - // PlayAudio.js, and it will stream video through the camera. This is an implementation of screen sharing. - videoCodec: 'H264', - }); - const stream = await connection.createStreamConnection(); - // You can also access it by using `connection.streamConnection` (only after it has been initialized by the `createStreamConnection` function). - // Split it into two separate streams (audio / video) - // Or with a combined stream that will be automatically processed by FFmpeg. - const input = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4'; - // Play - const dispatcher = stream.playVideo(input, { - fps: 60, - bitrate: 4000, - }); - const dispatcher2 = stream.playAudio(input); - dispatcher.on('start', () => { - console.log('video is now playing!'); - }); - - dispatcher.on('finish', () => { - console.log('video has finished playing!'); - }); - dispatcher.on('error', console.error); - - dispatcher2.on('start', () => { - console.log('audio is now playing!'); - }); - - dispatcher2.on('finish', () => { - console.log('audio has finished playing!'); - }); - dispatcher2.on('error', console.error); - // Of course, you can also pause the stream using the `pause` function, but remember to pause both video and audio. -}); - -client.login('token'); diff --git a/vendor/discord.js-selfbot-v13/examples/VoiceChannel/RecordingAudio.js b/vendor/discord.js-selfbot-v13/examples/VoiceChannel/RecordingAudio.js deleted file mode 100644 index 5e8c0c9..0000000 --- a/vendor/discord.js-selfbot-v13/examples/VoiceChannel/RecordingAudio.js +++ /dev/null @@ -1,54 +0,0 @@ -// https://v12.discordjs.guide/voice/receiving-audio.html#basic-usage - -/* -Install: -- An Opus library: @discordjs/opus or opusscript -- An encryption packages: - + sodium (best performance) - + libsodium-wrappers - + @stablelib/xchacha20poly1305 -- ffmpeg (install and add to your system environment) -*/ - - -const { Client } = require('../../src/index'); -const client = new Client(); - -const fs = require('fs'); -const Speaker = require('speaker'); - -client.on('ready', async client => { - console.log(`${client.user.username} is ready!`); - - const speaker = new Speaker({ - channels: 2, // 2 channels - bitDepth: 16, // 16-bit samples - sampleRate: 48000, // 48000 Hz sample rate - }); - - const channel = client.channels.cache.get('voice_id'); - const connection = await client.voice.joinChannel(channel, { - selfMute: true, - selfDeaf: true, - selfVideo: false, - }); - - const audio = connection.receiver.createStream('user_id', { - mode: 'pcm', - end: 'manual', - paddingSilence: true, - }); - - audio.pipe(fs.createWriteStream('test.pcm')); - - // After 15s - setTimeout(() => { - console.log('Stop recording'); - audio.destroy(); - // Play this record... - fs.createReadStream('test.pcm').pipe(speaker); - }, 15_000); -}); - - -client.login('token'); diff --git a/vendor/discord.js-selfbot-v13/examples/VoiceChannel/RecordingVideo.js b/vendor/discord.js-selfbot-v13/examples/VoiceChannel/RecordingVideo.js deleted file mode 100644 index a994965..0000000 --- a/vendor/discord.js-selfbot-v13/examples/VoiceChannel/RecordingVideo.js +++ /dev/null @@ -1,45 +0,0 @@ -// https://v12.discordjs.guide/voice/receiving-audio.html#basic-usage - -/* -Install: -- An Opus library: @discordjs/opus or opusscript -- An encryption packages: - + sodium (best performance) - + libsodium-wrappers - + @stablelib/xchacha20poly1305 -- ffmpeg (install and add to your system environment) -*/ - -const { Client } = require('../../src/index'); -const client = new Client(); - -const fs = require('fs'); - -client.on('ready', async client => { - console.log(`${client.user.username} is ready!`); - - const channel = client.channels.cache.get('voice_id'); - const connection = await client.voice.joinChannel(channel, { - selfMute: true, - selfDeaf: true, - selfVideo: false, - }); - - const connectionStream = await connection.joinStreamConnection('user_id'); - - const video = connectionStream.receiver.createVideoStream('user_id', fs.createWriteStream('video.mkv')); // Output file using matroska container - - video.on('ready', () => { - console.log('FFmpeg process ready!'); - video.stream.stderr.on('data', data => { - console.log(`FFmpeg: ${data}`); - }); - }); - - // After 15s - setTimeout(() => { - video.destroy(); - }, 15_000); -}); - -client.login('token'); diff --git a/vendor/discord.js-selfbot-v13/examples/VoiceMessage.js b/vendor/discord.js-selfbot-v13/examples/VoiceMessage.js deleted file mode 100644 index f9ba873..0000000 --- a/vendor/discord.js-selfbot-v13/examples/VoiceMessage.js +++ /dev/null @@ -1,21 +0,0 @@ -const { Client, MessageAttachment } = require('../src/index'); -const client = new Client(); - -client.on('ready', async () => { - console.log(`${client.user.username} is ready!`); - const channel = client.channels.cache.get('channel_id'); - const attachment = new MessageAttachment( - './test.mp3', // path file - 'random_file_name.ogg', // must be .ogg - { - waveform: 'AAAAAAAAAAAA', - duration_secs: 1, // any number you want - }, - ); - channel.send({ - files: [attachment], - flags: 'IS_VOICE_MESSAGE', - }); -}); - -client.login('token'); diff --git a/vendor/discord.js-selfbot-v13/package.json b/vendor/discord.js-selfbot-v13/package.json deleted file mode 100644 index 8fcfa4a..0000000 --- a/vendor/discord.js-selfbot-v13/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "name": "discord.js-selfbot-v13", - "version": "3.7.1", - "description": "An unofficial discord.js fork for creating selfbots", - "main": "./src/index.js", - "types": "./typings/index.d.ts", - "scripts": { - "all": "npm run build && npm publish", - "test": "npm run lint && npm run test:typescript && npm run docs:test", - "fix:all": "npm run format", - "test:typescript": "tsc --noEmit && tsd", - "lint": "biome check . --diagnostic-level=error", - "format": "biome format --write .", - "docs": "docgen --source src --custom docs/index.yml --output docs/main.json", - "docs:test": "docgen --source src --custom docs/index.yml", - "build": "npm run format && npm run docs" - }, - "files": [ - "src", - "typings" - ], - "directories": { - "lib": "src", - "test": "test" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/aiko-chan-ai/discord.js-selfbot-v13.git" - }, - "keywords": [ - "discord.js", - "discord.js v13", - "selfbot", - "selfbot v13", - "djs", - "api", - "bot", - "node", - "discord", - "client", - "discordapp" - ], - "author": "aiko-chan-ai", - "license": "GNU General Public License v3.0", - "bugs": { - "url": "https://github.com/aiko-chan-ai/discord.js-selfbot-v13/issues" - }, - "homepage": "https://github.com/aiko-chan-ai/discord.js-selfbot-v13#readme", - "dependencies": { - "@discordjs/builders": "^1.13.0", - "@discordjs/collection": "^2.1.1", - "@sapphire/async-queue": "^1.5.5", - "@sapphire/shapeshift": "^4.0.0", - "discord-api-types": "^0.38.38", - "fetch-cookie": "^3.1.0", - "find-process": "^2.0.0", - "otplib": "^12.0.1", - "prism-media": "^2.0.0-alpha.0", - "qrcode": "^1.5.4", - "tough-cookie": "^5.1.2", - "tree-kill": "^1.2.2", - "undici": "^7.16.0", - "werift-rtp": "^0.8.4", - "ws": "^8.20.0" - }, - "engines": { - "node": ">=20.18" - }, - "devDependencies": { - "@biomejs/biome": "latest", - "@discordjs/docgen": "^0.11.1", - "@types/debug": "^4.1.12", - "@types/node": "^25.8.0", - "@types/ws": "^8.18.1", - "patch-package": "^8.0.1", - "tsd": "^0.33.0", - "typescript": "^5.9.3" - } -} diff --git a/vendor/discord.js-selfbot-v13/patches/jsdoc+3.6.11.patch b/vendor/discord.js-selfbot-v13/patches/jsdoc+3.6.11.patch deleted file mode 100644 index dcb6972..0000000 --- a/vendor/discord.js-selfbot-v13/patches/jsdoc+3.6.11.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/node_modules/jsdoc/lib/jsdoc/util/dumper.js b/node_modules/jsdoc/lib/jsdoc/util/dumper.js -index 515c972..975757b 100644 ---- a/node_modules/jsdoc/lib/jsdoc/util/dumper.js -+++ b/node_modules/jsdoc/lib/jsdoc/util/dumper.js -@@ -95,13 +95,13 @@ class ObjectWalker { - return newArray; - }); - } -- else if ( util.isRegExp(o) ) { -+ else if ( util.types.isRegExp(o) ) { - result = ``; - } -- else if ( util.isDate(o) ) { -+ else if ( util.types.isDate(o) ) { - result = ``; - } -- else if ( util.isError(o) ) { -+ else if ( Object.prototype.toString.call(o) === '[object Error]' ) { - result = { message: o.message }; - } - else if ( this.isFunction(o) ) { diff --git a/vendor/discord.js-selfbot-v13/src/WebSocket.js b/vendor/discord.js-selfbot-v13/src/WebSocket.js deleted file mode 100644 index 872cfe6..0000000 --- a/vendor/discord.js-selfbot-v13/src/WebSocket.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -let erlpack; -const { Buffer } = require('node:buffer'); - -try { - erlpack = require('erlpack'); - if (!erlpack.pack) erlpack = null; -} catch {} // eslint-disable-line no-empty - -exports.WebSocket = require('ws'); - -const ab = new TextDecoder(); - -exports.encoding = erlpack ? 'etf' : 'json'; - -exports.pack = erlpack ? erlpack.pack : JSON.stringify; - -exports.unpack = (data, type) => { - if (exports.encoding === 'json' || type === 'json') { - if (typeof data !== 'string') { - data = ab.decode(data); - } - return JSON.parse(data); - } - if (!Buffer.isBuffer(data)) data = Buffer.from(new Uint8Array(data)); - return erlpack.unpack(data); -}; - -exports.create = (gateway, query = {}, ...args) => { - const [g, q] = gateway.split('?'); - query.encoding = exports.encoding; - query = new URLSearchParams(query); - if (q) new URLSearchParams(q).forEach((v, k) => query.set(k, v)); - const ws = new exports.WebSocket(`${g}?${query}`, ...args); - return ws; -}; - -for (const state of ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED']) - exports[state] = exports.WebSocket[state]; diff --git a/vendor/discord.js-selfbot-v13/src/client/BaseClient.js b/vendor/discord.js-selfbot-v13/src/client/BaseClient.js deleted file mode 100644 index ed7bdd5..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/BaseClient.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -const EventEmitter = require('node:events'); -const process = require('node:process'); -const RESTManager = require('../rest/RESTManager'); -const Options = require('../util/Options'); -const Util = require('../util/Util'); - -/** - * The base class for all clients. - * @extends {EventEmitter} - */ -class BaseClient extends EventEmitter { - constructor(options = {}) { - super({ captureRejections: true }); - - if (options.intents) { - process.emitWarning('Intents is not available.', 'DeprecationWarning'); - } - - /** - * The options the client was instantiated with - * @type {ClientOptions} - */ - this.options = Util.mergeDefault(Options.createDefault(), options); - - /** - * The REST manager of the client - * @type {RESTManager} - * @private - */ - this.rest = new RESTManager(this); - } - - /** - * API shortcut - * @type {Object} - * @readonly - * @private - */ - get api() { - return this.rest.api; - } - - /** - * Destroys all assets used by the base client. - * @returns {void} - */ - destroy() { - if (this.rest.sweepInterval) clearInterval(this.rest.sweepInterval); - } - - /** - * Increments max listeners by one, if they are not zero. - * @private - */ - incrementMaxListeners() { - const maxListeners = this.getMaxListeners(); - if (maxListeners !== 0) { - this.setMaxListeners(maxListeners + 1); - } - } - - /** - * Decrements max listeners by one, if they are not zero. - * @private - */ - decrementMaxListeners() { - const maxListeners = this.getMaxListeners(); - if (maxListeners !== 0) { - this.setMaxListeners(maxListeners - 1); - } - } - - toJSON(...props) { - return Util.flatten(this, { domain: false }, ...props); - } -} - -module.exports = BaseClient; - -/** - * Emitted for general debugging information. - * @event BaseClient#debug - * @param {string} info The debug information - */ diff --git a/vendor/discord.js-selfbot-v13/src/client/Client.js b/vendor/discord.js-selfbot-v13/src/client/Client.js deleted file mode 100644 index 9a182f1..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/Client.js +++ /dev/null @@ -1,1069 +0,0 @@ -/* eslint-disable no-unreachable */ -'use strict'; - -const process = require('node:process'); -const { setInterval } = require('node:timers'); -const { setTimeout } = require('node:timers'); -const { Collection } = require('@discordjs/collection'); -const { authenticator } = require('otplib'); -const BaseClient = require('./BaseClient'); -const ActionsManager = require('./actions/ActionsManager'); -const ClientVoiceManager = require('./voice/ClientVoiceManager'); -const WebSocketManager = require('./websocket/WebSocketManager'); -const { Error, TypeError } = require('../errors'); -const BaseGuildEmojiManager = require('../managers/BaseGuildEmojiManager'); -const BillingManager = require('../managers/BillingManager'); -const ChannelManager = require('../managers/ChannelManager'); -const ClientUserSettingManager = require('../managers/ClientUserSettingManager'); -const GuildManager = require('../managers/GuildManager'); -const PresenceManager = require('../managers/PresenceManager'); -const RelationshipManager = require('../managers/RelationshipManager'); -const SessionManager = require('../managers/SessionManager'); -const UserManager = require('../managers/UserManager'); -const UserNoteManager = require('../managers/UserNoteManager'); -const VoiceStateManager = require('../managers/VoiceStateManager'); -const ShardClientUtil = require('../sharding/ShardClientUtil'); -const ClientPresence = require('../structures/ClientPresence'); -const GuildPreview = require('../structures/GuildPreview'); -const GuildTemplate = require('../structures/GuildTemplate'); -const Invite = require('../structures/Invite'); -const { Sticker } = require('../structures/Sticker'); -const StickerPack = require('../structures/StickerPack'); -const VoiceRegion = require('../structures/VoiceRegion'); -const Webhook = require('../structures/Webhook'); -const Widget = require('../structures/Widget'); -const Application = require('../structures/interfaces/Application'); -const { Events, Status } = require('../util/Constants'); -const DataResolver = require('../util/DataResolver'); -const Intents = require('../util/Intents'); -const DiscordAuthWebsocket = require('../util/RemoteAuth'); -const Sweepers = require('../util/Sweepers'); - -/** - * The main hub for interacting with the Discord API, and the starting point for any bot. - * @extends {BaseClient} - */ -class Client extends BaseClient { - /** - * @param {ClientOptions} [options] Options for the client - */ - constructor(options) { - super(options); - - this._validateOptions(); - - /** - * Functions called when a cache is garbage collected or the Client is destroyed - * @type {Set} - * @private - */ - this._cleanups = new Set(); - - /** - * The finalizers used to cleanup items. - * @type {FinalizationRegistry} - * @private - */ - this._finalizers = new FinalizationRegistry(this._finalize.bind(this)); - - /** - * The WebSocket manager of the client - * @type {WebSocketManager} - */ - this.ws = new WebSocketManager(this); - - /** - * The action manager of the client - * @type {ActionsManager} - * @private - */ - this.actions = new ActionsManager(this); - - /** - * The voice manager of the client - * @type {ClientVoiceManager} - */ - this.voice = new ClientVoiceManager(this); - - /** - * A manager of the voice states of this client (Support DM / Group DM) - * @type {VoiceStateManager} - */ - this.voiceStates = new VoiceStateManager({ client: this }); - - /** - * Shard helpers for the client (only if the process was spawned from a {@link ShardingManager}) - * @type {?ShardClientUtil} - */ - this.shard = process.env.SHARDING_MANAGER - ? ShardClientUtil.singleton(this, process.env.SHARDING_MANAGER_MODE) - : null; - - /** - * The user manager of this client - * @type {UserManager} - */ - this.users = new UserManager(this); - - /** - * A manager of all the guilds the client is currently handling - - * as long as sharding isn't being used, this will be *every* guild the bot is a member of - * @type {GuildManager} - */ - this.guilds = new GuildManager(this); - - /** - * All of the {@link Channel}s that the client is currently handling - - * as long as sharding isn't being used, this will be *every* channel in *every* guild the bot - * is a member of. Note that DM channels will not be initially cached, and thus not be present - * in the Manager without their explicit fetching or use. - * @type {ChannelManager} - */ - this.channels = new ChannelManager(this); - - /** - * The sweeping functions and their intervals used to periodically sweep caches - * @type {Sweepers} - */ - this.sweepers = new Sweepers(this, this.options.sweepers); - - /** - * The presence of the Client - * @private - * @type {ClientPresence} - */ - this.presence = new ClientPresence(this, this.options.presence); - - /** - * A manager of the presences belonging to this client - * @type {PresenceManager} - */ - this.presences = new PresenceManager(this); - - /** - * All of the note that have been cached at any point, mapped by their ids - * @type {UserManager} - */ - this.notes = new UserNoteManager(this); - - /** - * All of the relationships {@link User} - * @type {RelationshipManager} - */ - this.relationships = new RelationshipManager(this); - - /** - * Manages the API methods - * @type {BillingManager} - */ - this.billing = new BillingManager(this); - - /** - * All of the sessions of the client - * @type {SessionManager} - */ - this.sessions = new SessionManager(this); - - /** - * All of the settings {@link Object} - * @type {ClientUserSettingManager} - */ - this.settings = new ClientUserSettingManager(this); - - Object.defineProperty(this, 'token', { writable: true }); - if (!this.token && 'DISCORD_TOKEN' in process.env) { - /** - * Authorization token for the logged in bot. - * If present, this defaults to `process.env.DISCORD_TOKEN` when instantiating the client - * This should be kept private at all times. - * @type {?string} - */ - this.token = process.env.DISCORD_TOKEN; - } else { - this.token = null; - } - - /** - * User that the client is logged in as - * @type {?ClientUser} - */ - this.user = null; - - /** - * Time at which the client was last regarded as being in the `READY` state - * (each time the client disconnects and successfully reconnects, this will be overwritten) - * @type {?Date} - */ - this.readyAt = null; - - /** - * The authenticator used for TOTP - * @type {Object} - */ - this.authenticator = authenticator; - - this.authenticator.options = { - step: 30, - digits: 6, - algorithm: 'sha1', - }; - - if (this.options.messageSweepInterval > 0) { - process.emitWarning( - 'The message sweeping client options are deprecated, use the global sweepers instead.', - 'DeprecationWarning', - ); - this.sweepMessageInterval = setInterval( - this.sweepMessages.bind(this), - this.options.messageSweepInterval * 1_000, - ).unref(); - } - } - - /** - * A manager of all the custom emojis that the client has access to - * @type {BaseGuildEmojiManager} - * @readonly - */ - get emojis() { - const emojis = new BaseGuildEmojiManager(this); - for (const guild of this.guilds.cache.values()) { - if (guild.available) - for (const emoji of guild.emojis.cache.values()) - emojis.cache.set(emoji.id, emoji); - } - return emojis; - } - - /** - * Timestamp of the time the client was last `READY` at - * @type {?number} - * @readonly - */ - get readyTimestamp() { - return this.readyAt?.getTime() ?? null; - } - - /** - * How long it has been since the client last entered the `READY` state in milliseconds - * @type {?number} - * @readonly - */ - get uptime() { - return this.readyAt ? Date.now() - this.readyAt : null; - } - - /** - * Logs the client in, establishing a WebSocket connection to Discord. - * @param {string} [token=this.token] Token of the account to log in with - * @returns {Promise} Token of the account used - * @example - * client.login('my token'); - */ - async login(token = this.token) { - if (!token || typeof token !== 'string') throw new Error('TOKEN_INVALID'); - this.token = token = token.replace(/^(Bot|Bearer)\s*/i, ''); - this.emit( - Events.DEBUG, - ` - Logging on with a user token is unfortunately against the Discord - \`Terms of Service\` - and doing so might potentially get your account banned. - Use this at your own risk.`, - ); - this.emit( - Events.DEBUG, - `Provided token: ${token - .split('.') - .map((val, i) => (i > 1 ? val.replace(/./g, '*') : val)) - .join('.')}`, - ); - - if (this.options.presence) { - this.options.ws.presence = this.presence._parse(this.options.presence); - } - - this.emit(Events.DEBUG, 'Preparing to connect to the gateway...'); - - try { - await this.ws.connect(); - return this.token; - } catch (error) { - this.destroy(); - throw error; - } - } - - QRLogin() { - const ws = new DiscordAuthWebsocket(); - ws.once('ready', () => ws.generateQR()); - return ws.connect(this); - } - - /** - * Logs the client in, establishing a WebSocket connection to Discord. - * @param {string} email The email associated with the account - * @param {string} password The password assicated with the account - * @returns {string | null} Token of the account used - * - * @example - * client.passLogin("test@gmail.com", "SuperSecretPa$$word", 1234) - * @deprecated This method will not be updated until I find the most convenient way to implement MFA. - */ - async passLogin(email, password) { - const initial = await this.api.auth.login.post({ - auth: false, - versioned: true, - data: { - gift_code_sku_id: null, - login_source: null, - undelete: false, - login: email, - password, - }, - }); - - if ('token' in initial) { - return this.login(initial.token); - } else if ('ticket' in initial) { - if (!this.options.TOTPKey) throw new Error('TOTPKEY_MISSING'); - const otp = this.authenticator.generate(this.options.TOTPKey); - const totp = await this.api.auth.mfa.totp.post({ - auth: false, - versioned: true, - data: { - gift_code_sku_id: null, - login_source: null, - code: otp, - ticket: initial.ticket, - }, - }); - if ('token' in totp) { - return this.login(totp.token); - } - } - - return null; - } - - /** - * Returns whether the client has logged in, indicative of being able to access - * properties such as `user` and `application`. - * @returns {boolean} - */ - isReady() { - return !this.ws.destroyed && this.ws.status === Status.READY; - } - - /** - * Logs out, terminates the connection to Discord, and destroys the client. - * @returns {void} - */ - destroy() { - super.destroy(); - - for (const fn of this._cleanups) fn(); - this._cleanups.clear(); - - if (this.sweepMessageInterval) clearInterval(this.sweepMessageInterval); - - this.sweepers.destroy(); - this.ws.destroy(); - this.token = null; - } - - /** - * Logs out, terminates the connection to Discord, destroys the client and destroys the token. - * @returns {Promise} - */ - async logout() { - await this.api.auth.logout.post({ - data: { - provider: null, - voip_provider: null, - }, - }); - return this.destroy(); - } - - /** - * Options used when fetching an invite from Discord. - * @typedef {Object} ClientFetchInviteOptions - * @property {Snowflake} [guildScheduledEventId] The id of the guild scheduled event to include with - * the invite - */ - - /** - * Obtains an invite from Discord. - * @param {InviteResolvable} invite Invite code or URL - * @param {ClientFetchInviteOptions} [options] Options for fetching the invite - * @returns {Promise} - * @example - * client.fetchInvite('https://discord.gg/djs') - * .then(invite => console.log(`Obtained invite with code: ${invite.code}`)) - * .catch(console.error); - */ - async fetchInvite(invite, options) { - const code = DataResolver.resolveInviteCode(invite); - const data = await this.api.invites(code).get({ - query: { - with_counts: true, - guild_scheduled_event_id: options?.guildScheduledEventId, - }, - }); - return new Invite(this, data); - } - - /** - * Obtains a template from Discord. - * @param {GuildTemplateResolvable} template Template code or URL - * @returns {Promise} - * @example - * client.fetchGuildTemplate('https://discord.new/FKvmczH2HyUf') - * .then(template => console.log(`Obtained template with code: ${template.code}`)) - * .catch(console.error); - */ - async fetchGuildTemplate(template) { - const code = DataResolver.resolveGuildTemplateCode(template); - const data = await this.api.guilds.templates(code).get(); - return new GuildTemplate(this, data); - } - - /** - * Obtains a webhook from Discord. - * @param {Snowflake} id The webhook's id - * @param {string} [token] Token for the webhook - * @returns {Promise} - * @example - * client.fetchWebhook('id', 'token') - * .then(webhook => console.log(`Obtained webhook with name: ${webhook.name}`)) - * .catch(console.error); - */ - async fetchWebhook(id, token) { - const data = await this.api.webhooks(id, token).get(); - return new Webhook(this, { token, ...data }); - } - - /** - * Obtains the available voice regions from Discord. - * @returns {Promise>} - * @example - * client.fetchVoiceRegions() - * .then(regions => console.log(`Available regions are: ${regions.map(region => region.name).join(', ')}`)) - * .catch(console.error); - */ - async fetchVoiceRegions() { - const apiRegions = await this.api.voice.regions.get(); - const regions = new Collection(); - for (const region of apiRegions) - regions.set(region.id, new VoiceRegion(region)); - return regions; - } - - /** - * Obtains a sticker from Discord. - * @param {Snowflake} id The sticker's id - * @returns {Promise} - * @example - * client.fetchSticker('id') - * .then(sticker => console.log(`Obtained sticker with name: ${sticker.name}`)) - * .catch(console.error); - */ - async fetchSticker(id) { - const data = await this.api.stickers(id).get(); - return new Sticker(this, data); - } - - /** - * Obtains the list of sticker packs available to Nitro subscribers from Discord. - * @returns {Promise>} - * @example - * client.fetchPremiumStickerPacks() - * .then(packs => console.log(`Available sticker packs are: ${packs.map(pack => pack.name).join(', ')}`)) - * .catch(console.error); - */ - async fetchPremiumStickerPacks() { - const data = await this.api('sticker-packs').get(); - return new Collection( - data.sticker_packs.map((p) => [p.id, new StickerPack(this, p)]), - ); - } - /** - * A last ditch cleanup function for garbage collection. - * @param {Function} options.cleanup The function called to GC - * @param {string} [options.message] The message to send after a successful GC - * @param {string} [options.name] The name of the item being GCed - * @private - */ - _finalize({ cleanup, message, name }) { - try { - cleanup(); - this._cleanups.delete(cleanup); - if (message) { - this.emit(Events.DEBUG, message); - } - } catch { - this.emit( - Events.DEBUG, - `Garbage collection failed on ${name ?? 'an unknown item'}.`, - ); - } - } - - /** - * Sweeps all text-based channels' messages and removes the ones older than the max message lifetime. - * If the message has been edited, the time of the edit is used rather than the time of the original message. - * @param {number} [lifetime=this.options.messageCacheLifetime] Messages that are older than this (in seconds) - * will be removed from the caches. The default is based on {@link ClientOptions#messageCacheLifetime} - * @returns {number} Amount of messages that were removed from the caches, - * or -1 if the message cache lifetime is unlimited - * @example - * // Remove all messages older than 1800 seconds from the messages cache - * const amount = client.sweepMessages(1800); - * console.log(`Successfully removed ${amount} messages from the cache.`); - */ - sweepMessages(lifetime = this.options.messageCacheLifetime) { - if (typeof lifetime !== 'number' || isNaN(lifetime)) { - throw new TypeError('INVALID_TYPE', 'lifetime', 'number'); - } - if (lifetime <= 0) { - this.emit(Events.DEBUG, "Didn't sweep messages - lifetime is unlimited"); - return -1; - } - - const messages = this.sweepers.sweepMessages( - Sweepers.outdatedMessageSweepFilter(lifetime)(), - ); - this.emit( - Events.DEBUG, - `Swept ${messages} messages older than ${lifetime} seconds`, - ); - return messages; - } - - /** - * Obtains a guild preview from Discord, available for all guilds the bot is in and all Discoverable guilds. - * @param {GuildResolvable} guild The guild to fetch the preview for - * @returns {Promise} - */ - async fetchGuildPreview(guild) { - const id = this.guilds.resolveId(guild); - if (!id) throw new TypeError('INVALID_TYPE', 'guild', 'GuildResolvable'); - const data = await this.api.guilds(id).preview.get(); - return new GuildPreview(this, data); - } - - /** - * Obtains the widget data of a guild from Discord, available for guilds with the widget enabled. - * @param {GuildResolvable} guild The guild to fetch the widget data for - * @returns {Promise} - */ - async fetchGuildWidget(guild) { - const id = this.guilds.resolveId(guild); - if (!id) throw new TypeError('INVALID_TYPE', 'guild', 'GuildResolvable'); - const data = await this.api.guilds(id, 'widget.json').get(); - return new Widget(this, data); - } - - /** - * Refresh the Discord CDN links with hashes so they can be usable. - * @param {...string} urls Discord CDN URLs - * @returns {Promise>} - */ - async refreshAttachmentURL(...urls) { - // Clean up the URLs - urls = urls.map((url) => { - const urlObject = new URL(url); - // Clean query - urlObject.search = ''; - return urlObject.toString(); - }); - const data = await this.api.attachments('refresh-urls').post({ - data: { attachment_urls: urls }, - }); - /** -{ - "refreshed_urls": [ - { - "original": "url", - "refreshed": "url with hash" - } - ] -} - */ - return data.refreshed_urls; - } - - /** - * Options for {@link Client#generateInvite}. - * @typedef {Object} InviteGenerationOptions - * @property {InviteScope[]} scopes Scopes that should be requested - * @property {PermissionResolvable} [permissions] Permissions to request - * @property {GuildResolvable} [guild] Guild to preselect - * @property {boolean} [disableGuildSelect] Whether to disable the guild selection - */ - - /** - * The sleep function in JavaScript returns a promise that resolves after a specified timeout. - * @param {number} timeout - The timeout parameter is the amount of time, in milliseconds, that the sleep - * function will wait before resolving the promise and continuing execution. - * @returns {void} The `sleep` function is returning a Promise. - */ - sleep(timeout) { - return new Promise((r) => setTimeout(r, timeout)); - } - - toJSON() { - return super.toJSON({ - readyAt: false, - }); - } - - /** - * The current session id of the shard - * @type {?string} - */ - get sessionId() { - return this.ws.shards.first()?.sessionId; - } - - /** - * Options for {@link Client#acceptInvite}. - * @typedef {Object} AcceptInviteOptions - * @property {boolean} [bypassOnboarding=true] Whether to bypass onboarding - * @property {boolean} [bypassVerify=true] Whether to bypass rule screening - */ - - /** - * Join this Guild / GroupDMChannel using this invite - * @param {InviteResolvable} invite Invite code or URL - * @param {AcceptInviteOptions} [options] Options - * @returns {Promise} - * @example - * await client.acceptInvite('https://discord.gg/genshinimpact', { bypassOnboarding: true, bypassVerify: true }) - */ - async acceptInvite( - invite, - options = { bypassOnboarding: true, bypassVerify: true }, - ) { - // ! throw new Error('METHOD_WARNING'); - const code = DataResolver.resolveInviteCode(invite); - if (!code) throw new Error('INVITE_RESOLVE_CODE'); - const i = await this.fetchInvite(code); - if (i.guild?.id && this.guilds.cache.has(i.guild?.id)) - return this.guilds.cache.get(i.guild?.id); - if (this.channels.cache.has(i.channelId)) - return this.channels.cache.get(i.channelId); - const data = await this.api.invites(code).post({ - DiscordContext: { location: 'Markdown Link' }, - data: { - session_id: this.sessionId, - }, - }); - this.emit(Events.DEBUG, `[Invite > Guild ${i.guild?.id}] Joined`); - // Guild - if (i.guild?.id) { - const guild = this.guilds.cache.get(i.guild?.id); - if (i.flags.has('GUEST')) { - this.emit(Events.DEBUG, `[Invite > Guild ${i.guild?.id}] Guest invite`); - return guild; - } - if (options.bypassOnboarding) { - const onboardingData = - await this.api.guilds[i.guild?.id].onboarding.get(); - // Onboarding - if (onboardingData.enabled) { - const prompts = onboardingData.prompts.filter((o) => o.in_onboarding); - if (prompts.length) { - const onboarding_prompts_seen = {}; - const onboarding_responses = []; - const onboarding_responses_seen = {}; - - const currentDate = Date.now(); - - prompts.forEach((prompt) => { - onboarding_prompts_seen[prompt.id] = currentDate; - if (prompt.required) - onboarding_responses.push(prompt.options[0].id); - prompt.options.forEach((option) => { - onboarding_responses_seen[option.id] = currentDate; - }); - }); - - await this.api.guilds[i.guild?.id]['onboarding-responses'].post({ - data: { - onboarding_prompts_seen, - onboarding_responses, - onboarding_responses_seen, - }, - }); - this.emit( - Events.DEBUG, - `[Invite > Guild ${i.guild?.id}] Bypassed onboarding`, - ); - } - } - } - // Read rule - if (data.show_verification_form && options.bypassVerify) { - // Check Guild - if (i.guild.verificationLevel == 'VERY_HIGH' && !this.user.phone) { - this.emit( - Events.DEBUG, - `[Invite > Guild ${i.guild?.id}] Cannot bypass verify (Phone required)`, - ); - return this.guilds.cache.get(i.guild?.id); - } - if (i.guild.verificationLevel !== 'NONE' && !this.user.email) { - this.emit( - Events.DEBUG, - `[Invite > Guild ${i.guild?.id}] Cannot bypass verify (Email required)`, - ); - return this.guilds.cache.get(i.guild?.id); - } - const getForm = await this.api - .guilds(i.guild?.id) - ['member-verification'].get({ - query: { with_guild: false, invite_code: this.code }, - }) - .catch(() => {}); - if (getForm && getForm.form_fields[0]) { - const form = Object.assign(getForm.form_fields[0], { - response: true, - }); - await this.api.guilds(i.guild?.id).requests['@me'].put({ - data: { form_fields: [form], version: getForm.version }, - }); - this.emit( - Events.DEBUG, - `[Invite > Guild ${i.guild?.id}] Bypassed verify`, - ); - } - } - return guild; - } else { - return this.channels.cache.has(i.channelId || data.channel?.id); - } - } - - /** - * Redeem nitro from code or url. - * @param {string} nitro Nitro url or code - * @param {TextChannelResolvable} [channel] Channel that the code was sent in - * @param {Snowflake} [paymentSourceId] Payment source id - * @returns {Promise} - */ - redeemNitro(nitro, channel, paymentSourceId) { - if (typeof nitro !== 'string') throw new Error('INVALID_NITRO'); - const nitroCode = - nitro.match( - /(discord.gift|discord.com|discordapp.com\/gifts)\/(\w{16,25})/, - ) || - nitro.match( - /(discord\.gift\/|discord\.com\/gifts\/|discordapp\.com\/gifts\/)(\w+)/, - ); - if (!nitroCode) return false; - const code = nitroCode[2]; - channel = this.channels.resolveId(channel); - return this.api.entitlements['gift-codes'](code).redeem.post({ - auth: true, - data: { - channel_id: channel || null, - payment_source_id: paymentSourceId || null, - }, - }); - } - - /** - * @typedef {Object} OAuth2AuthorizeOptions - * @property {string} [guild_id] Guild ID - * @property {string} [permissions] Permissions - * @property {boolean} [authorize] Whether to authorize or not - * @property {string} [code] 2FA Code - * @property {string} [webhook_channel_id] Webhook Channel ID - */ - - /** - * Authorize an application. - * @param {string} urlOAuth2 Discord Auth URL - * @param {OAuth2AuthorizeOptions} [options] Oauth2 options - * @returns {Promise<{ location: string }>} - * @example - * client.authorizeURL(`https://discord.com/api/oauth2/authorize?client_id=botID&permissions=8&scope=applications.commands%20bot`, { - guild_id: "guildID", - }) - */ - authorizeURL(urlOAuth2, options = {}) { - // ! throw new Error('METHOD_WARNING'); - const url = new URL(urlOAuth2); - if ( - !/^https:\/\/(?:canary\.|ptb\.)?discord\.com(?:\/api(?:\/v\d{1,2})?)?\/oauth2\/authorize\?/.test( - urlOAuth2, - ) - ) { - throw new Error('INVALID_URL', urlOAuth2); - } - const searchParams = Object.fromEntries(url.searchParams); - // Assign options - options = { - authorize: true, - permissions: '0', - integration_type: 0, - location_context: { - guild_id: '10000', - channel_id: '10000', - channel_type: 10000, - }, - ...searchParams, - ...options, - }; - delete searchParams.permissions; - delete searchParams.integration_type; - delete searchParams.guild_id; - return this.api.oauth2.authorize.post({ - query: searchParams, - data: options, - }); - } - - /** - * Install User Apps - * @param {Snowflake} applicationId Discord Application id - * @returns {Promise} - */ - installUserApps(applicationId) { - return this.api - .applications(applicationId) - .public.get({ - query: { - with_guild: false, - }, - }) - .then((rawData) => { - const installTypes = rawData.integration_types_config['1']; - if (installTypes) { - return this.api.oauth2.authorize.post({ - query: { - client_id: applicationId, - scope: installTypes.oauth2_install_params.scopes.join(' '), - }, - data: { - permissions: '0', - authorize: true, - integration_type: 1, - }, - }); - } else { - return false; - } - }); - } - - /** - * Deauthorizes an application or token. - * @param {Snowflake} id - The ID of the Discord Application or Token. - * @param {'application' | 'token'} [type='application'] - The type of the ID provided. Defaults to 'application'. - * @returns {Promise} A promise that resolves when the deauthorization is complete. - */ - deauthorize(id, type = 'application') { - if (type === 'application') { - return this.api.oauth2.tokens - .get() - .then((data) => data.find((o) => o.application.id == id)) - .then((o) => this.api.oauth2.tokens(o.id).delete()); - } else { - return this.api.oauth2.tokens(id).delete(); - } - } - - /** - * @typedef {Object} AuthorizedApplicationData - * @property {Application} application - The application object. - * @property {Snowflake} authorizedApplicationId - The ID of the OAuth2 token. - * @property {string[]} scopes - The scopes that were granted to this token. - * @property {function(): Promise} deauthorize - Function to revoke this token. - */ - - /** - * Retrieves the list of authorized applications (OAuth2 tokens). - * @returns {Promise>} - */ - authorizedApplications() { - return this.api.oauth2.tokens.get().then((data) => { - const results = new Collection(); - for (const o of data) { - const application = new Application(this, o.application); - const data = { - application, - authorizedApplicationId: o.id, - scopes: o.scopes, - deauthorize: () => this.deauthorize(o.id, 'token'), - }; - results.set(o.application.id, data); - } - return results; - }); - } - - /** - * Calls {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval} on a script - * with the client as `this`. - * @param {string} script Script to eval - * @returns {*} - * @private - */ - _eval(script) { - return eval(script); - } - - /** - * Validates the client options. - * @param {ClientOptions} [options=this.options] Options to validate - * @private - */ - _validateOptions(options = this.options) { - if (typeof options.makeCache !== 'function') { - throw new TypeError('CLIENT_INVALID_OPTION', 'makeCache', 'a function'); - } - if ( - typeof options.messageCacheLifetime !== 'number' || - isNaN(options.messageCacheLifetime) - ) { - throw new TypeError( - 'CLIENT_INVALID_OPTION', - 'The messageCacheLifetime', - 'a number', - ); - } - if ( - typeof options.messageSweepInterval !== 'number' || - isNaN(options.messageSweepInterval) - ) { - throw new TypeError( - 'CLIENT_INVALID_OPTION', - 'messageSweepInterval', - 'a number', - ); - } - if (typeof options.sweepers !== 'object' || options.sweepers === null) { - throw new TypeError('CLIENT_INVALID_OPTION', 'sweepers', 'an object'); - } - if ( - typeof options.invalidRequestWarningInterval !== 'number' || - isNaN(options.invalidRequestWarningInterval) - ) { - throw new TypeError( - 'CLIENT_INVALID_OPTION', - 'invalidRequestWarningInterval', - 'a number', - ); - } - if (!Array.isArray(options.partials)) { - throw new TypeError('CLIENT_INVALID_OPTION', 'partials', 'an Array'); - } - if ( - typeof options.DMChannelVoiceStatusSync !== 'number' || - isNaN(options.DMChannelVoiceStatusSync) - ) { - throw new TypeError( - 'CLIENT_INVALID_OPTION', - 'DMChannelVoiceStatusSync', - 'a number', - ); - } - if ( - typeof options.waitGuildTimeout !== 'number' || - isNaN(options.waitGuildTimeout) - ) { - throw new TypeError( - 'CLIENT_INVALID_OPTION', - 'waitGuildTimeout', - 'a number', - ); - } - if ( - typeof options.restWsBridgeTimeout !== 'number' || - isNaN(options.restWsBridgeTimeout) - ) { - throw new TypeError( - 'CLIENT_INVALID_OPTION', - 'restWsBridgeTimeout', - 'a number', - ); - } - if ( - typeof options.restRequestTimeout !== 'number' || - isNaN(options.restRequestTimeout) - ) { - throw new TypeError( - 'CLIENT_INVALID_OPTION', - 'restRequestTimeout', - 'a number', - ); - } - if ( - typeof options.restGlobalRateLimit !== 'number' || - isNaN(options.restGlobalRateLimit) - ) { - throw new TypeError( - 'CLIENT_INVALID_OPTION', - 'restGlobalRateLimit', - 'a number', - ); - } - if ( - typeof options.restSweepInterval !== 'number' || - isNaN(options.restSweepInterval) - ) { - throw new TypeError( - 'CLIENT_INVALID_OPTION', - 'restSweepInterval', - 'a number', - ); - } - if (typeof options.retryLimit !== 'number' || isNaN(options.retryLimit)) { - throw new TypeError('CLIENT_INVALID_OPTION', 'retryLimit', 'a number'); - } - if (typeof options.failIfNotExists !== 'boolean') { - throw new TypeError( - 'CLIENT_INVALID_OPTION', - 'failIfNotExists', - 'a boolean', - ); - } - if ( - typeof options.rejectOnRateLimit !== 'undefined' && - !( - typeof options.rejectOnRateLimit === 'function' || - Array.isArray(options.rejectOnRateLimit) - ) - ) { - throw new TypeError( - 'CLIENT_INVALID_OPTION', - 'rejectOnRateLimit', - 'an array or a function', - ); - } - if (typeof options.TOTPKey === 'string') { - // Convert to base32 if not already - options.TOTPKey = options.TOTPKey.replace(/ +/g, '').toUpperCase(); - } - // Hardcode - this.options.shardCount = 1; - this.options.shards = [0]; - this.options.intents = Intents.ALL; - } -} - -module.exports = Client; - -/** - * Emitted for general warnings. - * @event Client#warn - * @param {string} info The warning - */ - -/** - * @external Collection - * @see {@link https://discord.js.org/docs/packages/collection/stable/Collection:Class} - */ diff --git a/vendor/discord.js-selfbot-v13/src/client/WebhookClient.js b/vendor/discord.js-selfbot-v13/src/client/WebhookClient.js deleted file mode 100644 index 6064abb..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/WebhookClient.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -const BaseClient = require('./BaseClient'); -const { Error } = require('../errors'); -const Webhook = require('../structures/Webhook'); - -/** - * The webhook client. - * @implements {Webhook} - * @extends {BaseClient} - */ -class WebhookClient extends BaseClient { - /** - * The data for the webhook client containing either an id and token or just a URL - * @typedef {Object} WebhookClientData - * @property {Snowflake} [id] The id of the webhook - * @property {string} [token] The token of the webhook - * @property {string} [url] The full URL for the webhook client - */ - - /** - * @param {WebhookClientData} data The data of the webhook - * @param {ClientOptions} [options] Options for the client - */ - constructor(data, options) { - super(options); - Object.defineProperty(this, 'client', { value: this }); - let { id, token } = data; - - if ('url' in data) { - const url = data.url.match( - // eslint-disable-next-line no-useless-escape - /^https?:\/\/(?:canary|ptb)?\.?discord\.com\/api\/webhooks(?:\/v[0-9]\d*)?\/([^\/]+)\/([^\/]+)/i, - ); - - if (!url || url.length <= 1) throw new Error('WEBHOOK_URL_INVALID'); - - [, id, token] = url; - } - - this.id = id; - Object.defineProperty(this, 'token', { - value: token, - writable: true, - configurable: true, - }); - } - - // These are here only for documentation purposes - they are implemented by Webhook - /* eslint-disable no-empty-function */ - send() {} - sendSlackMessage() {} - fetchMessage() {} - edit() {} - editMessage() {} - delete() {} - deleteMessage() {} - get createdTimestamp() {} - get createdAt() {} - get url() {} -} - -Webhook.applyToClass(WebhookClient); - -module.exports = WebhookClient; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/Action.js b/vendor/discord.js-selfbot-v13/src/client/actions/Action.js deleted file mode 100644 index 809667c..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/Action.js +++ /dev/null @@ -1,130 +0,0 @@ -'use strict'; - -const { PartialTypes } = require('../../util/Constants'); - -/* - -ABOUT ACTIONS - -Actions are similar to WebSocket Packet Handlers, but since introducing -the REST API methods, in order to prevent rewriting code to handle data, -"actions" have been introduced. They're basically what Packet Handlers -used to be but they're strictly for manipulating data and making sure -that WebSocket events don't clash with REST methods. - -*/ - -class GenericAction { - constructor(client) { - this.client = client; - } - - handle(data) { - return data; - } - - getPayload(data, manager, id, partialType, cache) { - const existing = manager.cache.get(id); - if (!existing && this.client.options.partials.includes(partialType)) { - return manager._add(data, cache); - } - return existing; - } - - getChannel(data) { - const payloadData = {}; - const id = data.channel_id ?? data.id; - - if (!('recipients' in data)) { - // Try to resolve the recipient, but do not add the client user. - const recipient = data.author ?? data.user ?? { id: data.user_id }; - if (recipient.id !== this.client.user.id) - payloadData.recipients = [recipient]; - } - - if (id !== undefined) payloadData.id = id; - - return ( - data[this.client.actions.injectedChannel] ?? - this.getPayload( - { ...data, ...payloadData }, - this.client.channels, - id, - PartialTypes.CHANNEL, - ) - ); - } - - getMessage(data, channel, cache) { - const id = data.message_id ?? data.id; - return ( - data[this.client.actions.injectedMessage] ?? - this.getPayload( - { - id, - channel_id: channel.id, - guild_id: data.guild_id ?? channel.guild?.id, - }, - channel.messages, - id, - PartialTypes.MESSAGE, - cache, - ) - ); - } - - getReaction(data, message, user) { - const id = data.emoji.id ?? decodeURIComponent(data.emoji.name); - return this.getPayload( - { - emoji: data.emoji, - count: message.partial ? null : 0, - me: user?.id === this.client.user.id, - }, - message.reactions, - id, - PartialTypes.REACTION, - ); - } - - getMember(data, guild) { - return this.getPayload( - data, - guild.members, - data.user.id, - PartialTypes.GUILD_MEMBER, - ); - } - - getUser(data) { - const id = data.user_id; - return ( - data[this.client.actions.injectedUser] ?? - this.getPayload({ id }, this.client.users, id, PartialTypes.USER) - ); - } - - getUserFromMember(data) { - if (data.guild_id && data.member?.user) { - const guild = this.client.guilds.cache.get(data.guild_id); - if (guild) { - return guild.members._add(data.member).user; - } else { - return this.client.users._add(data.member.user); - } - } - return this.getUser(data); - } - - getScheduledEvent(data, guild) { - const id = data.guild_scheduled_event_id ?? data.id; - return this.getPayload( - { id, guild_id: data.guild_id ?? guild.id }, - guild.scheduledEvents, - id, - PartialTypes.GUILD_SCHEDULED_EVENT, - ); - } -} - -module.exports = GenericAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/ActionsManager.js b/vendor/discord.js-selfbot-v13/src/client/actions/ActionsManager.js deleted file mode 100644 index 056ca61..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/ActionsManager.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict'; - -class ActionsManager { - constructor(client) { - this.client = client; - - // These symbols represent fully built data that we inject at times when calling actions manually. - // Action#getUser for example, will return the injected data (which is assumed to be a built structure) - // instead of trying to make it from provided data - this.injectedUser = Symbol('djs.actions.injectedUser'); - this.injectedChannel = Symbol('djs.actions.injectedChannel'); - this.injectedMessage = Symbol('djs.actions.injectedMessage'); - - this.register(require('./ApplicationCommandPermissionsUpdate')); - this.register(require('./AutoModerationActionExecution')); - this.register(require('./AutoModerationRuleCreate')); - this.register(require('./AutoModerationRuleDelete')); - this.register(require('./AutoModerationRuleUpdate')); - this.register(require('./ChannelCreate')); - this.register(require('./ChannelDelete')); - this.register(require('./ChannelUpdate')); - this.register(require('./GuildAuditLogEntryCreate')); - this.register(require('./GuildBanAdd')); - this.register(require('./GuildBanRemove')); - this.register(require('./GuildChannelsPositionUpdate')); - this.register(require('./GuildDelete')); - this.register(require('./GuildEmojiCreate')); - this.register(require('./GuildEmojiDelete')); - this.register(require('./GuildEmojiUpdate')); - this.register(require('./GuildEmojisUpdate')); - this.register(require('./GuildIntegrationsUpdate')); - this.register(require('./GuildMemberRemove')); - this.register(require('./GuildMemberUpdate')); - this.register(require('./GuildRoleCreate')); - this.register(require('./GuildRoleDelete')); - this.register(require('./GuildRoleUpdate')); - this.register(require('./GuildRolesPositionUpdate')); - this.register(require('./GuildScheduledEventCreate')); - this.register(require('./GuildScheduledEventDelete')); - this.register(require('./GuildScheduledEventUpdate')); - this.register(require('./GuildScheduledEventUserAdd')); - this.register(require('./GuildScheduledEventUserRemove')); - this.register(require('./GuildStickerCreate')); - this.register(require('./GuildStickerDelete')); - this.register(require('./GuildStickerUpdate')); - this.register(require('./GuildStickersUpdate')); - this.register(require('./GuildUpdate')); - this.register(require('./InviteCreate')); - this.register(require('./InviteDelete')); - this.register(require('./MessageCreate')); - this.register(require('./MessageDelete')); - this.register(require('./MessageDeleteBulk')); - this.register(require('./MessagePollVoteAdd')); - this.register(require('./MessagePollVoteRemove')); - this.register(require('./MessageReactionAdd')); - this.register(require('./MessageReactionRemove')); - this.register(require('./MessageReactionRemoveAll')); - this.register(require('./MessageReactionRemoveEmoji')); - this.register(require('./MessageUpdate')); - this.register(require('./PresenceUpdate')); - this.register(require('./StageInstanceCreate')); - this.register(require('./StageInstanceDelete')); - this.register(require('./StageInstanceUpdate')); - this.register(require('./ThreadCreate')); - this.register(require('./ThreadDelete')); - this.register(require('./ThreadListSync')); - this.register(require('./ThreadMemberUpdate')); - this.register(require('./ThreadMembersUpdate')); - this.register(require('./TypingStart')); - this.register(require('./UserUpdate')); - this.register(require('./VoiceStateUpdate')); - this.register(require('./WebhooksUpdate')); - } - - register(Action) { - this[Action.name.replace(/Action$/, '')] = new Action(this.client); - } -} - -module.exports = ActionsManager; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/ApplicationCommandPermissionsUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/ApplicationCommandPermissionsUpdate.js deleted file mode 100644 index 0aa518c..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/ApplicationCommandPermissionsUpdate.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -/** - * The data received in the {@link Client#event:applicationCommandPermissionsUpdate} event - * @typedef {Object} ApplicationCommandPermissionsUpdateData - * @property {Snowflake} id The id of the command or global entity that was updated - * @property {Snowflake} guildId The id of the guild in which permissions were updated - * @property {Snowflake} applicationId The id of the application that owns the command or entity being updated - * @property {ApplicationCommandPermissions[]} permissions The updated permissions - */ - -class ApplicationCommandPermissionsUpdateAction extends Action { - handle(data) { - const client = this.client; - /** - * Emitted whenever permissions for an application command in a guild were updated. - * This includes permission updates for other applications in addition to the logged in client, - * check `data.applicationId` to verify which application the update is for - * @event Client#applicationCommandPermissionsUpdate - * @param {ApplicationCommandPermissionsUpdateData} data The updated permissions - */ - client.emit(Events.APPLICATION_COMMAND_PERMISSIONS_UPDATE, { - permissions: data.permissions, - id: data.id, - guildId: data.guild_id, - applicationId: data.application_id, - }); - } -} - -module.exports = ApplicationCommandPermissionsUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/AutoModerationActionExecution.js b/vendor/discord.js-selfbot-v13/src/client/actions/AutoModerationActionExecution.js deleted file mode 100644 index 5dbb23d..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/AutoModerationActionExecution.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const AutoModerationActionExecution = require('../../structures/AutoModerationActionExecution'); -const { Events } = require('../../util/Constants'); - -class AutoModerationActionExecutionAction extends Action { - handle(data) { - const { client } = this; - const guild = client.guilds.cache.get(data.guild_id); - - if (guild) { - /** - * Emitted whenever an auto moderation rule is triggered. - * This event requires the {@link Permissions.FLAGS.MANAGE_GUILD} permission. - * @event Client#autoModerationActionExecution - * @param {AutoModerationActionExecution} autoModerationActionExecution The data of the execution - * @deprecated This event is not received by user accounts. - */ - client.emit( - Events.AUTO_MODERATION_ACTION_EXECUTION, - new AutoModerationActionExecution(data, guild), - ); - } - - return {}; - } -} - -module.exports = AutoModerationActionExecutionAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/AutoModerationRuleCreate.js b/vendor/discord.js-selfbot-v13/src/client/actions/AutoModerationRuleCreate.js deleted file mode 100644 index e92fd1d..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/AutoModerationRuleCreate.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class AutoModerationRuleCreateAction extends Action { - handle(data) { - const { client } = this; - const guild = client.guilds.cache.get(data.guild_id); - - if (guild) { - const autoModerationRule = guild.autoModerationRules._add(data); - - /** - * Emitted whenever an auto moderation rule is created. - * This event requires the {@link Permissions.FLAGS.MANAGE_GUILD} permission. - * @event Client#autoModerationRuleCreate - * @param {AutoModerationRule} autoModerationRule The created auto moderation rule - * @deprecated This event is not received by user accounts. - */ - client.emit(Events.AUTO_MODERATION_RULE_CREATE, autoModerationRule); - } - - return {}; - } -} - -module.exports = AutoModerationRuleCreateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/AutoModerationRuleDelete.js b/vendor/discord.js-selfbot-v13/src/client/actions/AutoModerationRuleDelete.js deleted file mode 100644 index 07fd289..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/AutoModerationRuleDelete.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class AutoModerationRuleDeleteAction extends Action { - handle(data) { - const { client } = this; - const guild = client.guilds.cache.get(data.guild_id); - - if (guild) { - const autoModerationRule = guild.autoModerationRules.cache.get(data.id); - - if (autoModerationRule) { - guild.autoModerationRules.cache.delete(autoModerationRule.id); - - /** - * Emitted whenever an auto moderation rule is deleted. - * This event requires the {@link Permissions.FLAGS.MANAGE_GUILD} permission. - * @event Client#autoModerationRuleDelete - * @param {AutoModerationRule} autoModerationRule The deleted auto moderation rule - * @deprecated This event is not received by user accounts. - */ - client.emit(Events.AUTO_MODERATION_RULE_DELETE, autoModerationRule); - } - } - - return {}; - } -} - -module.exports = AutoModerationRuleDeleteAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/AutoModerationRuleUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/AutoModerationRuleUpdate.js deleted file mode 100644 index 23ca15a..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/AutoModerationRuleUpdate.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class AutoModerationRuleUpdateAction extends Action { - handle(data) { - const { client } = this; - const guild = client.guilds.cache.get(data.guild_id); - - if (guild) { - const oldAutoModerationRule = - guild.autoModerationRules.cache.get(data.id)?._clone() ?? null; - const newAutoModerationRule = guild.autoModerationRules._add(data); - - /** - * Emitted whenever an auto moderation rule gets updated. - * This event requires the {@link Permissions.FLAGS.MANAGE_GUILD} permission. - * @event Client#autoModerationRuleUpdate - * @param {?AutoModerationRule} oldAutoModerationRule The auto moderation rule before the update - * @param {AutoModerationRule} newAutoModerationRule The auto moderation rule after the update - * @deprecated This event is not received by user accounts. - */ - client.emit( - Events.AUTO_MODERATION_RULE_UPDATE, - oldAutoModerationRule, - newAutoModerationRule, - ); - } - - return {}; - } -} - -module.exports = AutoModerationRuleUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/ChannelCreate.js b/vendor/discord.js-selfbot-v13/src/client/actions/ChannelCreate.js deleted file mode 100644 index 68eb2dc..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/ChannelCreate.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class ChannelCreateAction extends Action { - handle(data) { - const client = this.client; - const existing = client.channels.cache.has(data.id); - const channel = client.channels._add(data); - if (!existing && channel) { - /** - * Emitted whenever a guild channel is created. - * @event Client#channelCreate - * @param {GuildChannel} channel The channel that was created - */ - client.emit(Events.CHANNEL_CREATE, channel); - } - return { channel }; - } -} - -module.exports = ChannelCreateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/ChannelDelete.js b/vendor/discord.js-selfbot-v13/src/client/actions/ChannelDelete.js deleted file mode 100644 index 43fdb32..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/ChannelDelete.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { deletedChannels } = require('../../structures/Channel'); -const DMChannel = require('../../structures/DMChannel'); -const { deletedMessages } = require('../../structures/Message'); -const { Events } = require('../../util/Constants'); - -class ChannelDeleteAction extends Action { - constructor(client) { - super(client); - this.deleted = new Map(); - } - - handle(data) { - const client = this.client; - const channel = client.channels.cache.get(data.id); - - if (channel) { - client.channels._remove(channel.id); - deletedChannels.add(channel); - if (channel.messages && !(channel instanceof DMChannel)) { - for (const message of channel.messages.cache.values()) { - deletedMessages.add(message); - } - } - /** - * Emitted whenever a channel is deleted. - * @event Client#channelDelete - * @param {DMChannel|GuildChannel} channel The channel that was deleted - */ - client.emit(Events.CHANNEL_DELETE, channel); - } - - return { channel }; - } -} - -module.exports = ChannelDeleteAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/ChannelUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/ChannelUpdate.js deleted file mode 100644 index 11b3ade..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/ChannelUpdate.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Channel } = require('../../structures/Channel'); -const { ChannelTypes } = require('../../util/Constants'); - -class ChannelUpdateAction extends Action { - handle(data) { - const client = this.client; - let channel = client.channels.cache.get(data.id); - - if (channel) { - const old = channel._update(data); - - if (ChannelTypes[channel.type] !== data.type) { - const newChannel = Channel.create(this.client, data, channel.guild); - - if (!newChannel) { - this.client.channels.cache.delete(channel.id); - return {}; - } - - if (channel.isText() && newChannel.isText()) { - for (const [id, message] of channel.messages.cache) - newChannel.messages.cache.set(id, message); - } - - channel = newChannel; - this.client.channels.cache.set(channel.id, channel); - } - - return { - old, - updated: channel, - }; - } else { - client.channels._add(data); - } - - return {}; - } -} - -module.exports = ChannelUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildAuditLogEntryCreate.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildAuditLogEntryCreate.js deleted file mode 100644 index ea50f78..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildAuditLogEntryCreate.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const GuildAuditLogsEntry = require('../../structures/GuildAuditLogs').Entry; -const { Events } = require('../../util/Constants'); - -class GuildAuditLogEntryCreateAction extends Action { - handle(data) { - const client = this.client; - const guild = client.guilds.cache.get(data.guild_id); - let auditLogEntry; - - if (guild) { - auditLogEntry = new GuildAuditLogsEntry(guild, data); - - /** - * Emitted whenever a guild audit log entry is created. - * @event Client#guildAuditLogEntryCreate - * @param {GuildAuditLogsEntry} auditLogEntry The entry that was created - * @param {Guild} guild The guild where the entry was created - */ - client.emit(Events.GUILD_AUDIT_LOG_ENTRY_CREATE, auditLogEntry, guild); - } - - return { auditLogEntry }; - } -} - -module.exports = GuildAuditLogEntryCreateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildBanAdd.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildBanAdd.js deleted file mode 100644 index e97e789..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildBanAdd.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class GuildBanAdd extends Action { - handle(data) { - const client = this.client; - const guild = client.guilds.cache.get(data.guild_id); - - /** - * Emitted whenever a member is banned from a guild. - * @event Client#guildBanAdd - * @param {GuildBan} ban The ban that occurred - */ - if (guild) client.emit(Events.GUILD_BAN_ADD, guild.bans._add(data)); - } -} - -module.exports = GuildBanAdd; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildBanRemove.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildBanRemove.js deleted file mode 100644 index 2574c03..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildBanRemove.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const GuildBan = require('../../structures/GuildBan'); -const { Events } = require('../../util/Constants'); - -class GuildBanRemove extends Action { - handle(data) { - const client = this.client; - const guild = client.guilds.cache.get(data.guild_id); - - /** - * Emitted whenever a member is unbanned from a guild. - * @event Client#guildBanRemove - * @param {GuildBan} ban The ban that was removed - */ - if (guild) { - const ban = - guild.bans.cache.get(data.user.id) ?? new GuildBan(client, data, guild); - guild.bans.cache.delete(ban.user.id); - client.emit(Events.GUILD_BAN_REMOVE, ban); - } - } -} - -module.exports = GuildBanRemove; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildChannelsPositionUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildChannelsPositionUpdate.js deleted file mode 100644 index a393167..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildChannelsPositionUpdate.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -const Action = require('./Action'); - -class GuildChannelsPositionUpdate extends Action { - handle(data) { - const client = this.client; - - const guild = client.guilds.cache.get(data.guild_id); - if (guild) { - for (const partialChannel of data.channels) { - const channel = guild.channels.cache.get(partialChannel.id); - if (channel) channel.rawPosition = partialChannel.position; - } - } - - return { guild }; - } -} - -module.exports = GuildChannelsPositionUpdate; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildDelete.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildDelete.js deleted file mode 100644 index e3417bb..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildDelete.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; - -const { setTimeout } = require('node:timers'); -const Action = require('./Action'); -const { deletedGuilds } = require('../../structures/Guild'); -const { Events } = require('../../util/Constants'); - -class GuildDeleteAction extends Action { - constructor(client) { - super(client); - this.deleted = new Map(); - } - - handle(data) { - const client = this.client; - - let guild = client.guilds.cache.get(data.id); - if (guild) { - if (data.unavailable) { - // Guild is unavailable - guild.available = false; - - /** - * Emitted whenever a guild becomes unavailable, likely due to a server outage. - * @event Client#guildUnavailable - * @param {Guild} guild The guild that has become unavailable - */ - client.emit(Events.GUILD_UNAVAILABLE, guild); - - // Stops the GuildDelete packet thinking a guild was actually deleted, - // handles emitting of event itself - return { - guild: null, - }; - } - - for (const channel of guild.channels.cache.values()) - this.client.channels._remove(channel.id); - client.voice.adapters.get(data.id)?.destroy(); - - // Delete guild - client.guilds.cache.delete(guild.id); - deletedGuilds.add(guild); - - /** - * Emitted whenever a guild kicks the client or the guild is deleted/left. - * @event Client#guildDelete - * @param {Guild} guild The guild that was deleted - */ - client.emit(Events.GUILD_DELETE, guild); - - this.deleted.set(guild.id, guild); - this.scheduleForDeletion(guild.id); - } else { - guild = this.deleted.get(data.id) ?? null; - } - - return { guild }; - } - - scheduleForDeletion(id) { - setTimeout( - () => this.deleted.delete(id), - this.client.options.restWsBridgeTimeout, - ).unref(); - } -} - -module.exports = GuildDeleteAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildEmojiCreate.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildEmojiCreate.js deleted file mode 100644 index ccc634c..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildEmojiCreate.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class GuildEmojiCreateAction extends Action { - handle(guild, createdEmoji) { - const already = guild.emojis.cache.has(createdEmoji.id); - const emoji = guild.emojis._add(createdEmoji); - /** - * Emitted whenever a custom emoji is created in a guild. - * @event Client#emojiCreate - * @param {GuildEmoji} emoji The emoji that was created - */ - if (!already) this.client.emit(Events.GUILD_EMOJI_CREATE, emoji); - return { emoji }; - } -} - -module.exports = GuildEmojiCreateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildEmojiDelete.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildEmojiDelete.js deleted file mode 100644 index 0c20287..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildEmojiDelete.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { deletedEmojis } = require('../../structures/Emoji'); -const { Events } = require('../../util/Constants'); - -class GuildEmojiDeleteAction extends Action { - handle(emoji) { - emoji.guild.emojis.cache.delete(emoji.id); - deletedEmojis.add(emoji); - /** - * Emitted whenever a custom emoji is deleted in a guild. - * @event Client#emojiDelete - * @param {GuildEmoji} emoji The emoji that was deleted - */ - this.client.emit(Events.GUILD_EMOJI_DELETE, emoji); - return { emoji }; - } -} - -module.exports = GuildEmojiDeleteAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildEmojiUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildEmojiUpdate.js deleted file mode 100644 index 9fa59c9..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildEmojiUpdate.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class GuildEmojiUpdateAction extends Action { - handle(current, data) { - const old = current._update(data); - /** - * Emitted whenever a custom emoji is updated in a guild. - * @event Client#emojiUpdate - * @param {GuildEmoji} oldEmoji The old emoji - * @param {GuildEmoji} newEmoji The new emoji - */ - this.client.emit(Events.GUILD_EMOJI_UPDATE, old, current); - return { emoji: current }; - } -} - -module.exports = GuildEmojiUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildEmojisUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildEmojisUpdate.js deleted file mode 100644 index 7829db1..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildEmojisUpdate.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -const Action = require('./Action'); - -class GuildEmojisUpdateAction extends Action { - handle(data) { - const guild = this.client.guilds.cache.get(data.guild_id); - if (!guild?.emojis) return; - - const deletions = new Map(guild.emojis.cache); - - for (const emoji of data.emojis) { - // Determine type of emoji event - const cachedEmoji = guild.emojis.cache.get(emoji.id); - if (cachedEmoji) { - deletions.delete(emoji.id); - if (!cachedEmoji.equals(emoji)) { - // Emoji updated - this.client.actions.GuildEmojiUpdate.handle(cachedEmoji, emoji); - } - } else { - // Emoji added - this.client.actions.GuildEmojiCreate.handle(guild, emoji); - } - } - - for (const emoji of deletions.values()) { - // Emoji deleted - this.client.actions.GuildEmojiDelete.handle(emoji); - } - } -} - -module.exports = GuildEmojisUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildIntegrationsUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildIntegrationsUpdate.js deleted file mode 100644 index bbce076..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildIntegrationsUpdate.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class GuildIntegrationsUpdate extends Action { - handle(data) { - const client = this.client; - const guild = client.guilds.cache.get(data.guild_id); - /** - * Emitted whenever a guild integration is updated - * @event Client#guildIntegrationsUpdate - * @param {Guild} guild The guild whose integrations were updated - */ - if (guild) client.emit(Events.GUILD_INTEGRATIONS_UPDATE, guild); - } -} - -module.exports = GuildIntegrationsUpdate; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildMemberRemove.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildMemberRemove.js deleted file mode 100644 index 23d786a..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildMemberRemove.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { deletedGuildMembers } = require('../../structures/GuildMember'); -const { Events, Status } = require('../../util/Constants'); - -class GuildMemberRemoveAction extends Action { - handle(data, shard) { - const client = this.client; - const guild = client.guilds.cache.get(data.guild_id); - let member = null; - if (guild) { - member = this.getMember({ user: data.user }, guild); - guild.memberCount--; - if (member) { - deletedGuildMembers.add(member); - guild.members.cache.delete(member.id); - /** - * Emitted whenever a member leaves a guild, or is kicked. - * @event Client#guildMemberRemove - * @param {GuildMember} member The member that has left/been kicked from the guild - * @deprecated See {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/issues/197 this issue} for more information. - */ - if (shard.status === Status.READY) - client.emit(Events.GUILD_MEMBER_REMOVE, member); - } - guild.presences.cache.delete(data.user.id); - guild.voiceStates.cache.delete(data.user.id); - } - return { guild, member }; - } -} - -module.exports = GuildMemberRemoveAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildMemberUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildMemberUpdate.js deleted file mode 100644 index f5d5f5a..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildMemberUpdate.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Status, Events } = require('../../util/Constants'); - -class GuildMemberUpdateAction extends Action { - handle(data, shard) { - const { client } = this; - if (data.user.username) { - const user = client.users.cache.get(data.user.id); - if (!user) { - client.users._add(data.user); - } else if (!user._equals(data.user)) { - client.actions.UserUpdate.handle(data.user); - } - } - - const guild = client.guilds.cache.get(data.guild_id); - if (guild) { - const member = this.getMember({ user: data.user }, guild); - if (member) { - const old = member._update(data); - /** - * Emitted whenever a guild member changes - i.e. new role, removed role, nickname. - * @event Client#guildMemberUpdate - * @param {GuildMember} oldMember The member before the update - * @param {GuildMember} newMember The member after the update - * @deprecated See {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/issues/197 this issue} for more information. - */ - if (shard.status === Status.READY && !member.equals(old)) - client.emit(Events.GUILD_MEMBER_UPDATE, old, member); - } else { - const newMember = guild.members._add(data); - /** - * Emitted whenever a member becomes available. - * @event Client#guildMemberAvailable - * @param {GuildMember} member The member that became available - */ - this.client.emit(Events.GUILD_MEMBER_AVAILABLE, newMember); - } - } - } -} - -module.exports = GuildMemberUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildRoleCreate.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildRoleCreate.js deleted file mode 100644 index 102e0f6..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildRoleCreate.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class GuildRoleCreate extends Action { - handle(data) { - const client = this.client; - const guild = client.guilds.cache.get(data.guild_id); - let role; - if (guild) { - const already = guild.roles.cache.has(data.role.id); - role = guild.roles._add(data.role); - /** - * Emitted whenever a role is created. - * @event Client#roleCreate - * @param {Role} role The role that was created - */ - if (!already) client.emit(Events.GUILD_ROLE_CREATE, role); - } - return { role }; - } -} - -module.exports = GuildRoleCreate; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildRoleDelete.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildRoleDelete.js deleted file mode 100644 index 9d156db..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildRoleDelete.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { deletedRoles } = require('../../structures/Role'); -const { Events } = require('../../util/Constants'); - -class GuildRoleDeleteAction extends Action { - handle(data) { - const client = this.client; - const guild = client.guilds.cache.get(data.guild_id); - let role; - - if (guild) { - role = guild.roles.cache.get(data.role_id); - if (role) { - guild.roles.cache.delete(data.role_id); - deletedRoles.add(role); - /** - * Emitted whenever a guild role is deleted. - * @event Client#roleDelete - * @param {Role} role The role that was deleted - */ - client.emit(Events.GUILD_ROLE_DELETE, role); - } - } - - return { role }; - } -} - -module.exports = GuildRoleDeleteAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildRoleUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildRoleUpdate.js deleted file mode 100644 index faea120..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildRoleUpdate.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class GuildRoleUpdateAction extends Action { - handle(data) { - const client = this.client; - const guild = client.guilds.cache.get(data.guild_id); - - if (guild) { - let old = null; - - const role = guild.roles.cache.get(data.role.id); - if (role) { - old = role._update(data.role); - /** - * Emitted whenever a guild role is updated. - * @event Client#roleUpdate - * @param {Role} oldRole The role before the update - * @param {Role} newRole The role after the update - */ - client.emit(Events.GUILD_ROLE_UPDATE, old, role); - } - - return { - old, - updated: role, - }; - } - - return { - old: null, - updated: null, - }; - } -} - -module.exports = GuildRoleUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildRolesPositionUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildRolesPositionUpdate.js deleted file mode 100644 index d7abca9..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildRolesPositionUpdate.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -const Action = require('./Action'); - -class GuildRolesPositionUpdate extends Action { - handle(data) { - const client = this.client; - - const guild = client.guilds.cache.get(data.guild_id); - if (guild) { - for (const partialRole of data.roles) { - const role = guild.roles.cache.get(partialRole.id); - if (role) role.rawPosition = partialRole.position; - } - } - - return { guild }; - } -} - -module.exports = GuildRolesPositionUpdate; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildScheduledEventCreate.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildScheduledEventCreate.js deleted file mode 100644 index b1a2d92..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildScheduledEventCreate.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class GuildScheduledEventCreateAction extends Action { - handle(data) { - const client = this.client; - const guild = client.guilds.cache.get(data.guild_id); - if (guild) { - const guildScheduledEvent = guild.scheduledEvents._add(data); - - /** - * Emitted whenever a guild scheduled event is created. - * @event Client#guildScheduledEventCreate - * @param {GuildScheduledEvent} guildScheduledEvent The created guild scheduled event - */ - client.emit(Events.GUILD_SCHEDULED_EVENT_CREATE, guildScheduledEvent); - - return { guildScheduledEvent }; - } - - return {}; - } -} - -module.exports = GuildScheduledEventCreateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildScheduledEventDelete.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildScheduledEventDelete.js deleted file mode 100644 index 0e7baa1..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildScheduledEventDelete.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class GuildScheduledEventDeleteAction extends Action { - handle(data) { - const client = this.client; - const guild = client.guilds.cache.get(data.guild_id); - - if (guild) { - const guildScheduledEvent = this.getScheduledEvent(data, guild); - if (guildScheduledEvent) { - guild.scheduledEvents.cache.delete(guildScheduledEvent.id); - - /** - * Emitted whenever a guild scheduled event is deleted. - * @event Client#guildScheduledEventDelete - * @param {GuildScheduledEvent} guildScheduledEvent The deleted guild scheduled event - */ - client.emit(Events.GUILD_SCHEDULED_EVENT_DELETE, guildScheduledEvent); - - return { guildScheduledEvent }; - } - } - - return {}; - } -} - -module.exports = GuildScheduledEventDeleteAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildScheduledEventUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildScheduledEventUpdate.js deleted file mode 100644 index ecd7b62..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildScheduledEventUpdate.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class GuildScheduledEventUpdateAction extends Action { - handle(data) { - const client = this.client; - const guild = client.guilds.cache.get(data.guild_id); - - if (guild) { - const oldGuildScheduledEvent = - guild.scheduledEvents.cache.get(data.id)?._clone() ?? null; - const newGuildScheduledEvent = guild.scheduledEvents._add(data); - - /** - * Emitted whenever a guild scheduled event gets updated. - * @event Client#guildScheduledEventUpdate - * @param {?GuildScheduledEvent} oldGuildScheduledEvent The guild scheduled event object before the update - * @param {GuildScheduledEvent} newGuildScheduledEvent The guild scheduled event object after the update - */ - client.emit( - Events.GUILD_SCHEDULED_EVENT_UPDATE, - oldGuildScheduledEvent, - newGuildScheduledEvent, - ); - - return { oldGuildScheduledEvent, newGuildScheduledEvent }; - } - - return {}; - } -} - -module.exports = GuildScheduledEventUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildScheduledEventUserAdd.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildScheduledEventUserAdd.js deleted file mode 100644 index 878c8ad..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildScheduledEventUserAdd.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class GuildScheduledEventUserAddAction extends Action { - handle(data) { - const client = this.client; - const guild = client.guilds.cache.get(data.guild_id); - - if (guild) { - const guildScheduledEvent = this.getScheduledEvent(data, guild); - const user = this.getUser(data); - - if (guildScheduledEvent && user) { - /** - * Emitted whenever a user subscribes to a guild scheduled event - * @event Client#guildScheduledEventUserAdd - * @param {GuildScheduledEvent} guildScheduledEvent The guild scheduled event - * @param {User} user The user who subscribed - */ - client.emit( - Events.GUILD_SCHEDULED_EVENT_USER_ADD, - guildScheduledEvent, - user, - ); - - return { guildScheduledEvent, user }; - } - } - - return {}; - } -} - -module.exports = GuildScheduledEventUserAddAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildScheduledEventUserRemove.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildScheduledEventUserRemove.js deleted file mode 100644 index ac08b89..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildScheduledEventUserRemove.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class GuildScheduledEventUserRemoveAction extends Action { - handle(data) { - const client = this.client; - const guild = client.guilds.cache.get(data.guild_id); - - if (guild) { - const guildScheduledEvent = this.getScheduledEvent(data, guild); - const user = this.getUser(data); - - if (guildScheduledEvent && user) { - /** - * Emitted whenever a user unsubscribes from a guild scheduled event - * @event Client#guildScheduledEventUserRemove - * @param {GuildScheduledEvent} guildScheduledEvent The guild scheduled event - * @param {User} user The user who unsubscribed - */ - client.emit( - Events.GUILD_SCHEDULED_EVENT_USER_REMOVE, - guildScheduledEvent, - user, - ); - - return { guildScheduledEvent, user }; - } - } - - return {}; - } -} - -module.exports = GuildScheduledEventUserRemoveAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildStickerCreate.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildStickerCreate.js deleted file mode 100644 index c02cafa..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildStickerCreate.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class GuildStickerCreateAction extends Action { - handle(guild, createdSticker) { - const already = guild.stickers.cache.has(createdSticker.id); - const sticker = guild.stickers._add(createdSticker); - /** - * Emitted whenever a custom sticker is created in a guild. - * @event Client#stickerCreate - * @param {Sticker} sticker The sticker that was created - */ - if (!already) this.client.emit(Events.GUILD_STICKER_CREATE, sticker); - return { sticker }; - } -} - -module.exports = GuildStickerCreateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildStickerDelete.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildStickerDelete.js deleted file mode 100644 index 4adfe52..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildStickerDelete.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { deletedStickers } = require('../../structures/Sticker'); -const { Events } = require('../../util/Constants'); - -class GuildStickerDeleteAction extends Action { - handle(sticker) { - sticker.guild.stickers.cache.delete(sticker.id); - deletedStickers.add(sticker); - /** - * Emitted whenever a custom sticker is deleted in a guild. - * @event Client#stickerDelete - * @param {Sticker} sticker The sticker that was deleted - */ - this.client.emit(Events.GUILD_STICKER_DELETE, sticker); - return { sticker }; - } -} - -module.exports = GuildStickerDeleteAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildStickerUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildStickerUpdate.js deleted file mode 100644 index 0c3edc7..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildStickerUpdate.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class GuildStickerUpdateAction extends Action { - handle(current, data) { - const old = current._update(data); - /** - * Emitted whenever a custom sticker is updated in a guild. - * @event Client#stickerUpdate - * @param {Sticker} oldSticker The old sticker - * @param {Sticker} newSticker The new sticker - */ - this.client.emit(Events.GUILD_STICKER_UPDATE, old, current); - return { sticker: current }; - } -} - -module.exports = GuildStickerUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildStickersUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildStickersUpdate.js deleted file mode 100644 index ccf1d63..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildStickersUpdate.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -const Action = require('./Action'); - -class GuildStickersUpdateAction extends Action { - handle(data) { - const guild = this.client.guilds.cache.get(data.guild_id); - if (!guild?.stickers) return; - - const deletions = new Map(guild.stickers.cache); - - for (const sticker of data.stickers) { - // Determine type of sticker event - const cachedSticker = guild.stickers.cache.get(sticker.id); - if (cachedSticker) { - deletions.delete(sticker.id); - if (!cachedSticker.equals(sticker)) { - // Sticker updated - this.client.actions.GuildStickerUpdate.handle(cachedSticker, sticker); - } - } else { - // Sticker added - this.client.actions.GuildStickerCreate.handle(guild, sticker); - } - } - - for (const sticker of deletions.values()) { - // Sticker deleted - this.client.actions.GuildStickerDelete.handle(sticker); - } - } -} - -module.exports = GuildStickersUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/GuildUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/GuildUpdate.js deleted file mode 100644 index 78a8afb..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/GuildUpdate.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class GuildUpdateAction extends Action { - handle(data) { - const client = this.client; - - const guild = client.guilds.cache.get(data.id); - if (guild) { - const old = guild._update(data); - /** - * Emitted whenever a guild is updated - e.g. name change. - * @event Client#guildUpdate - * @param {Guild} oldGuild The guild before the update - * @param {Guild} newGuild The guild after the update - */ - client.emit(Events.GUILD_UPDATE, old, guild); - return { - old, - updated: guild, - }; - } - - return { - old: null, - updated: null, - }; - } -} - -module.exports = GuildUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/InviteCreate.js b/vendor/discord.js-selfbot-v13/src/client/actions/InviteCreate.js deleted file mode 100644 index 2f7c216..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/InviteCreate.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class InviteCreateAction extends Action { - handle(data) { - const client = this.client; - const channel = client.channels.cache.get(data.channel_id); - const guild = client.guilds.cache.get(data.guild_id); - if (!channel) return false; - - const inviteData = Object.assign(data, { channel, guild }); - const invite = guild.invites._add(inviteData); - - /** - * Emitted when an invite is created. - * This event only triggers if the client has `MANAGE_GUILD` permissions for the guild, - * or `MANAGE_CHANNELS` permissions for the channel. - * @event Client#inviteCreate - * @param {Invite} invite The invite that was created - */ - client.emit(Events.INVITE_CREATE, invite); - return { invite }; - } -} - -module.exports = InviteCreateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/InviteDelete.js b/vendor/discord.js-selfbot-v13/src/client/actions/InviteDelete.js deleted file mode 100644 index 47c77fa..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/InviteDelete.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const Invite = require('../../structures/Invite'); -const { Events } = require('../../util/Constants'); - -class InviteDeleteAction extends Action { - handle(data) { - const client = this.client; - const channel = client.channels.cache.get(data.channel_id); - const guild = client.guilds.cache.get(data.guild_id); - if (!channel) return false; - - const inviteData = Object.assign(data, { channel, guild }); - const invite = new Invite(client, inviteData); - guild.invites.cache.delete(invite.code); - - /** - * Emitted when an invite is deleted. - * This event only triggers if the client has `MANAGE_GUILD` permissions for the guild, - * or `MANAGE_CHANNELS` permissions for the channel. - * @event Client#inviteDelete - * @param {Invite} invite The invite that was deleted - */ - client.emit(Events.INVITE_DELETE, invite); - return { invite }; - } -} - -module.exports = InviteDeleteAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/MessageCreate.js b/vendor/discord.js-selfbot-v13/src/client/actions/MessageCreate.js deleted file mode 100644 index ef34143..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/MessageCreate.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -let deprecationEmitted = false; - -class MessageCreateAction extends Action { - handle(data) { - const client = this.client; - const channel = this.getChannel({ - id: data.channel_id, - author: data.author, - ...('guild_id' in data && { guild_id: data.guild_id }), - }); - if (channel) { - if (!channel.isText()) return {}; - - const existing = channel.messages.cache.get(data.id); - if (existing && existing.author?.id !== this.client.user.id) - return { message: existing }; - const message = existing ?? channel.messages._add(data); - channel.lastMessageId = data.id; - - /** - * Emitted whenever a message is created. - * @event Client#messageCreate - * @param {Message} message The created message - */ - client.emit(Events.MESSAGE_CREATE, message); - - /** - * Emitted whenever a message is created. - * @event Client#message - * @param {Message} message The created message - * @deprecated Use {@link Client#event:messageCreate} instead - */ - if (client.emit('message', message) && !deprecationEmitted) { - deprecationEmitted = true; - process.emitWarning( - 'The message event is deprecated. Use messageCreate instead', - 'DeprecationWarning', - ); - } - - return { message }; - } - - return {}; - } -} - -module.exports = MessageCreateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/MessageDelete.js b/vendor/discord.js-selfbot-v13/src/client/actions/MessageDelete.js deleted file mode 100644 index 86da89f..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/MessageDelete.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { deletedMessages } = require('../../structures/Message'); -const { Events } = require('../../util/Constants'); - -class MessageDeleteAction extends Action { - handle(data) { - const client = this.client; - const channel = this.getChannel({ - id: data.channel_id, - ...('guild_id' in data && { guild_id: data.guild_id }), - }); - let message; - if (channel) { - if (!channel.isText()) return {}; - - message = this.getMessage(data, channel); - if (message) { - channel.messages.cache.delete(message.id); - deletedMessages.add(message); - /** - * Emitted whenever a message is deleted. - * @event Client#messageDelete - * @param {Message} message The deleted message - */ - client.emit(Events.MESSAGE_DELETE, message); - } - } - - return { message }; - } -} - -module.exports = MessageDeleteAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/MessageDeleteBulk.js b/vendor/discord.js-selfbot-v13/src/client/actions/MessageDeleteBulk.js deleted file mode 100644 index 31a3717..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/MessageDeleteBulk.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const Action = require('./Action'); -const { deletedMessages } = require('../../structures/Message'); -const { Events } = require('../../util/Constants'); - -class MessageDeleteBulkAction extends Action { - handle(data) { - const client = this.client; - const channel = client.channels.cache.get(data.channel_id); - - if (channel) { - if (!channel.isText()) return {}; - - const ids = data.ids; - const messages = new Collection(); - for (const id of ids) { - const message = this.getMessage( - { - id, - guild_id: data.guild_id, - }, - channel, - false, - ); - if (message) { - deletedMessages.add(message); - messages.set(message.id, message); - channel.messages.cache.delete(id); - } - } - - /** - * Emitted whenever messages are deleted in bulk. - * @event Client#messageDeleteBulk - * @param {Collection} messages The deleted messages, mapped by their id - */ - if (messages.size > 0) client.emit(Events.MESSAGE_BULK_DELETE, messages); - return { messages }; - } - return {}; - } -} - -module.exports = MessageDeleteBulkAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/MessagePollVoteAdd.js b/vendor/discord.js-selfbot-v13/src/client/actions/MessagePollVoteAdd.js deleted file mode 100644 index bbe29a2..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/MessagePollVoteAdd.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class MessagePollVoteAddAction extends Action { - handle(data) { - const channel = this.getChannel(data); - if (!channel?.isText()) return false; - - const message = this.getMessage(data, channel); - if (!message) return false; - - const { poll } = message; - - const answer = poll?.answers.get(data.answer_id); - if (!answer) return false; - - answer.voteCount++; - - /** - * Emitted whenever a user votes in a poll. - * @event Client#messagePollVoteAdd - * @param {PollAnswer} pollAnswer The answer that was voted on - * @param {Snowflake} userId The id of the user that voted - */ - this.client.emit(Events.MESSAGE_POLL_VOTE_ADD, answer, data.user_id); - - return { poll }; - } -} - -module.exports = MessagePollVoteAddAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/MessagePollVoteRemove.js b/vendor/discord.js-selfbot-v13/src/client/actions/MessagePollVoteRemove.js deleted file mode 100644 index 3986805..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/MessagePollVoteRemove.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class MessagePollVoteRemoveAction extends Action { - handle(data) { - const channel = this.getChannel(data); - if (!channel?.isText()) return false; - - const message = this.getMessage(data, channel); - if (!message) return false; - - const { poll } = message; - - const answer = poll?.answers.get(data.answer_id); - if (!answer) return false; - - answer.voteCount--; - - /** - * Emitted whenever a user removes their vote in a poll. - * @event Client#messagePollVoteRemove - * @param {PollAnswer} pollAnswer The answer where the vote was removed - * @param {Snowflake} userId The id of the user that removed their vote - */ - this.client.emit(Events.MESSAGE_POLL_VOTE_REMOVE, answer, data.user_id); - - return { poll }; - } -} - -module.exports = MessagePollVoteRemoveAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/MessageReactionAdd.js b/vendor/discord.js-selfbot-v13/src/client/actions/MessageReactionAdd.js deleted file mode 100644 index 2d80940..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/MessageReactionAdd.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); -const { PartialTypes } = require('../../util/Constants'); - -/* -{ user_id: 'id', - message_id: 'id', - emoji: { name: '�', id: null }, - channel_id: 'id', - burst: boolean - // If originating from a guild - guild_id: 'id', - member: { ..., user: { ... } } } -*/ - -class MessageReactionAdd extends Action { - handle(data, fromStructure = false) { - if (!data.emoji) return false; - - const user = this.getUserFromMember(data); - if (!user) return false; - - // Verify channel - const channel = this.getChannel({ - id: data.channel_id, - user_id: data.user_id, - ...('guild_id' in data && { guild_id: data.guild_id }), - }); - if (!channel || !channel.isText()) return false; - - // Verify message - const message = this.getMessage(data, channel); - if (!message) return false; - - // Verify reaction - const includePartial = this.client.options.partials.includes( - PartialTypes.REACTION, - ); - if (message.partial && !includePartial) return false; - const reaction = message.reactions._add({ - emoji: data.emoji, - count: message.partial ? null : 0, - me: user.id === this.client.user.id, - ...data, - }); - if (!reaction) return false; - reaction._add(user, data.burst); - if (fromStructure) return { message, reaction, user }; - /** - * Provides additional information about altered reaction - * @typedef {Object} MessageReactionEventDetails - * @property {ReactionType} type The type of the reaction - * @property {boolean} burst Determines whether a super reaction was used - */ - /** - * Emitted whenever a reaction is added to a cached message. - * @event Client#messageReactionAdd - * @param {MessageReaction} messageReaction The reaction object - * @param {User} user The user that applied the guild or reaction emoji - * @param {MessageReactionEventDetails} details Details of adding the reaction - */ - this.client.emit(Events.MESSAGE_REACTION_ADD, reaction, user, { - type: data.type, - burst: data.burst, - }); - - return { message, reaction, user }; - } -} - -module.exports = MessageReactionAdd; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/MessageReactionRemove.js b/vendor/discord.js-selfbot-v13/src/client/actions/MessageReactionRemove.js deleted file mode 100644 index 5ac6eab..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/MessageReactionRemove.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -/* -{ user_id: 'id', - message_id: 'id', - emoji: { name: '�', id: null }, - channel_id: 'id', - guild_id: 'id' } -*/ - -class MessageReactionRemove extends Action { - handle(data) { - if (!data.emoji) return false; - - const user = this.getUser(data); - if (!user) return false; - - // Verify channel - const channel = this.getChannel({ - id: data.channel_id, - user_id: data.user_id, - ...('guild_id' in data && { guild_id: data.guild_id }), - }); - if (!channel || !channel.isText()) return false; - - // Verify message - const message = this.getMessage(data, channel); - if (!message) return false; - - // Verify reaction - const reaction = this.getReaction(data, message, user); - if (!reaction) return false; - reaction._remove(user, data.burst); - /** - * Emitted whenever a reaction is removed from a cached message. - * @event Client#messageReactionRemove - * @param {MessageReaction} messageReaction The reaction object - * @param {User} user The user whose emoji or reaction emoji was removed - * @param {MessageReactionEventDetails} details Details of removing the reaction - */ - this.client.emit(Events.MESSAGE_REACTION_REMOVE, reaction, user, { - type: data.type, - burst: data.burst, - }); - - return { message, reaction, user }; - } -} - -module.exports = MessageReactionRemove; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/MessageReactionRemoveAll.js b/vendor/discord.js-selfbot-v13/src/client/actions/MessageReactionRemoveAll.js deleted file mode 100644 index e7a3145..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/MessageReactionRemoveAll.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class MessageReactionRemoveAll extends Action { - handle(data) { - // Verify channel - const channel = this.getChannel({ - id: data.channel_id, - ...('guild_id' in data && { guild_id: data.guild_id }), - }); - if (!channel || !channel.isText()) return false; - - // Verify message - const message = this.getMessage(data, channel); - if (!message) return false; - - // Copy removed reactions to emit for the event. - const removed = message.reactions.cache.clone(); - - message.reactions.cache.clear(); - this.client.emit(Events.MESSAGE_REACTION_REMOVE_ALL, message, removed); - - return { message }; - } -} - -/** - * Emitted whenever all reactions are removed from a cached message. - * @event Client#messageReactionRemoveAll - * @param {Message} message The message the reactions were removed from - * @param {Collection} reactions The cached message reactions that were removed. - */ - -module.exports = MessageReactionRemoveAll; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/MessageReactionRemoveEmoji.js b/vendor/discord.js-selfbot-v13/src/client/actions/MessageReactionRemoveEmoji.js deleted file mode 100644 index 492001d..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/MessageReactionRemoveEmoji.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class MessageReactionRemoveEmoji extends Action { - handle(data) { - const channel = this.getChannel({ - id: data.channel_id, - ...('guild_id' in data && { guild_id: data.guild_id }), - }); - if (!channel || !channel.isText()) return false; - - const message = this.getMessage(data, channel); - if (!message) return false; - - const reaction = this.getReaction(data, message); - if (!reaction) return false; - if (!message.partial) - message.reactions.cache.delete(reaction.emoji.id ?? reaction.emoji.name); - - /** - * Emitted when a bot removes an emoji reaction from a cached message. - * @event Client#messageReactionRemoveEmoji - * @param {MessageReaction} reaction The reaction that was removed - */ - this.client.emit(Events.MESSAGE_REACTION_REMOVE_EMOJI, reaction); - return { reaction }; - } -} - -module.exports = MessageReactionRemoveEmoji; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/MessageUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/MessageUpdate.js deleted file mode 100644 index 3513263..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/MessageUpdate.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const Action = require('./Action'); - -class MessageUpdateAction extends Action { - handle(data) { - const channel = this.getChannel({ - id: data.channel_id, - ...('guild_id' in data && { guild_id: data.guild_id }), - }); - if (channel) { - if (!channel.isText()) return {}; - - const { id, channel_id, guild_id, author, timestamp, type } = data; - const message = this.getMessage( - { id, channel_id, guild_id, author, timestamp, type }, - channel, - ); - if (message) { - const old = message._update(data); - return { - old, - updated: message, - }; - } - } - - return {}; - } -} - -module.exports = MessageUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/PresenceUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/PresenceUpdate.js deleted file mode 100644 index 4f6977d..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/PresenceUpdate.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); -const { PartialTypes } = require('../../util/Constants'); - -class PresenceUpdateAction extends Action { - handle(data) { - let user = this.client.users.cache.get(data.user.id); - if (!user && data.user?.username) user = this.client.users._add(data.user); - if ( - !user && - ('username' in data.user || - this.client.options.partials.includes(PartialTypes.USER)) - ) { - user = this.client.users._add(data.user); - } - if (!user) return; - - if (data.user?.username) { - if (!user._equals(data.user)) - this.client.actions.UserUpdate.handle(data.user); - } - - const guild = this.client.guilds.cache.get(data.guild_id); - - if (guild) { - let member = guild.members.cache.get(user.id); - if (!member && data.status !== 'offline') { - member = guild.members._add({ - user, - deaf: false, - mute: false, - }); - this.client.emit(Events.GUILD_MEMBER_AVAILABLE, member); - } - } - - const oldPresence = - (guild || this.client).presences.cache.get(user.id)?._clone() ?? null; - - const newPresence = (guild || this.client).presences._add( - Object.assign(data, { guild }), - ); - - if ( - this.client.listenerCount(Events.PRESENCE_UPDATE) && - !newPresence.equals(oldPresence) - ) { - /** - * Emitted whenever a guild member's presence (e.g. status, activity) is changed. - * @event Client#presenceUpdate - * @param {?Presence} oldPresence The presence before the update, if one at all - * @param {Presence} newPresence The presence after the update - */ - this.client.emit(Events.PRESENCE_UPDATE, oldPresence, newPresence); - } - } -} - -module.exports = PresenceUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/StageInstanceCreate.js b/vendor/discord.js-selfbot-v13/src/client/actions/StageInstanceCreate.js deleted file mode 100644 index fc8b242..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/StageInstanceCreate.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class StageInstanceCreateAction extends Action { - handle(data) { - const client = this.client; - const channel = this.getChannel({ - id: data.channel_id, - guild_id: data.guild_id, - }); - - if (channel) { - const stageInstance = channel.guild.stageInstances._add(data); - - /** - * Emitted whenever a stage instance is created. - * @event Client#stageInstanceCreate - * @param {StageInstance} stageInstance The created stage instance - */ - client.emit(Events.STAGE_INSTANCE_CREATE, stageInstance); - - return { stageInstance }; - } - - return {}; - } -} - -module.exports = StageInstanceCreateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/StageInstanceDelete.js b/vendor/discord.js-selfbot-v13/src/client/actions/StageInstanceDelete.js deleted file mode 100644 index bca4f9a..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/StageInstanceDelete.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { deletedStageInstances } = require('../../structures/StageInstance'); -const { Events } = require('../../util/Constants'); - -class StageInstanceDeleteAction extends Action { - handle(data) { - const client = this.client; - const channel = this.getChannel({ - id: data.channel_id, - guild_id: data.guild_id, - }); - - if (channel) { - const stageInstance = channel.guild.stageInstances._add(data); - if (stageInstance) { - channel.guild.stageInstances.cache.delete(stageInstance.id); - deletedStageInstances.add(stageInstance); - - /** - * Emitted whenever a stage instance is deleted. - * @event Client#stageInstanceDelete - * @param {StageInstance} stageInstance The deleted stage instance - */ - client.emit(Events.STAGE_INSTANCE_DELETE, stageInstance); - - return { stageInstance }; - } - } - - return {}; - } -} - -module.exports = StageInstanceDeleteAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/StageInstanceUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/StageInstanceUpdate.js deleted file mode 100644 index eb1501c..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/StageInstanceUpdate.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class StageInstanceUpdateAction extends Action { - handle(data) { - const client = this.client; - const channel = this.getChannel({ - id: data.channel_id, - guild_id: data.guild_id, - }); - - if (channel) { - const oldStageInstance = - channel.guild.stageInstances.cache.get(data.id)?._clone() ?? null; - const newStageInstance = channel.guild.stageInstances._add(data); - - /** - * Emitted whenever a stage instance gets updated - e.g. change in topic or privacy level - * @event Client#stageInstanceUpdate - * @param {?StageInstance} oldStageInstance The stage instance before the update - * @param {StageInstance} newStageInstance The stage instance after the update - */ - client.emit( - Events.STAGE_INSTANCE_UPDATE, - oldStageInstance, - newStageInstance, - ); - - return { oldStageInstance, newStageInstance }; - } - - return {}; - } -} - -module.exports = StageInstanceUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/ThreadCreate.js b/vendor/discord.js-selfbot-v13/src/client/actions/ThreadCreate.js deleted file mode 100644 index d2d5859..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/ThreadCreate.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class ThreadCreateAction extends Action { - handle(data) { - const client = this.client; - const existing = client.channels.cache.has(data.id); - const thread = client.channels._add(data); - if (!existing && thread) { - /** - * Emitted whenever a thread is created or when the client user is added to a thread. - * @event Client#threadCreate - * @param {ThreadChannel} thread The thread that was created - * @param {boolean} newlyCreated Whether the thread was newly created - */ - client.emit(Events.THREAD_CREATE, thread, data.newly_created ?? false); - } - return { thread }; - } -} - -module.exports = ThreadCreateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/ThreadDelete.js b/vendor/discord.js-selfbot-v13/src/client/actions/ThreadDelete.js deleted file mode 100644 index 9307dd2..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/ThreadDelete.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { deletedChannels } = require('../../structures/Channel'); -const { deletedMessages } = require('../../structures/Message'); -const { Events } = require('../../util/Constants'); - -class ThreadDeleteAction extends Action { - handle(data) { - const client = this.client; - const thread = client.channels.cache.get(data.id); - - if (thread) { - client.channels._remove(thread.id); - deletedChannels.add(thread); - for (const message of thread.messages.cache.values()) { - deletedMessages.add(message); - } - - /** - * Emitted whenever a thread is deleted. - * @event Client#threadDelete - * @param {ThreadChannel} thread The thread that was deleted - */ - client.emit(Events.THREAD_DELETE, thread); - } - - return { thread }; - } -} - -module.exports = ThreadDeleteAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/ThreadListSync.js b/vendor/discord.js-selfbot-v13/src/client/actions/ThreadListSync.js deleted file mode 100644 index a0f8143..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/ThreadListSync.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class ThreadListSyncAction extends Action { - handle(data) { - const client = this.client; - - const guild = client.guilds.cache.get(data.guild_id); - if (!guild) return {}; - - if (data.channel_ids) { - for (const id of data.channel_ids) { - const channel = client.channels.cache.get(id); - if (channel) this.removeStale(channel); - } - } else { - for (const channel of guild.channels.cache.values()) { - this.removeStale(channel); - } - } - - const syncedThreads = data.threads.reduce((coll, rawThread) => { - const thread = client.channels._add(rawThread); - return coll.set(thread.id, thread); - }, new Collection()); - - for (const rawMember of Object.values(data.members || {})) { - // Discord sends the thread id as id in this object - const thread = client.channels.cache.get(rawMember.id); - if (thread) { - thread.members._add(rawMember); - } - } - - /** - * Emitted whenever the client user gains access to a text or news channel that contains threads - * @event Client#threadListSync - * @param {Collection} threads The threads that were synced - */ - client.emit(Events.THREAD_LIST_SYNC, syncedThreads); - - return { - syncedThreads, - }; - } - - removeStale(channel) { - channel.threads?.cache.forEach((thread) => { - if (!thread.archived) { - this.client.channels._remove(thread.id); - } - }); - } -} - -module.exports = ThreadListSyncAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/ThreadMemberUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/ThreadMemberUpdate.js deleted file mode 100644 index b84bcac..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/ThreadMemberUpdate.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class ThreadMemberUpdateAction extends Action { - handle(data) { - const client = this.client; - // Discord sends the thread id as id in this object - const thread = client.channels.cache.get(data.id); - if (thread) { - const member = thread.members.cache.get(data.user_id); - if (!member) { - const newMember = thread.members._add(data); - return { newMember }; - } - const old = member._update(data); - /** - * Emitted whenever the client user's thread member is updated. - * @event Client#threadMemberUpdate - * @param {ThreadMember} oldMember The member before the update - * @param {ThreadMember} newMember The member after the update - */ - client.emit(Events.THREAD_MEMBER_UPDATE, old, member); - } - return {}; - } -} - -module.exports = ThreadMemberUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/ThreadMembersUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/ThreadMembersUpdate.js deleted file mode 100644 index 92102ae..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/ThreadMembersUpdate.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class ThreadMembersUpdateAction extends Action { - handle(data) { - const client = this.client; - const thread = client.channels.cache.get(data.id); - if (thread) { - const old = thread.members.cache.clone(); - thread.memberCount = data.member_count; - - data.added_members?.forEach((rawMember) => { - thread.members._add(rawMember); - }); - - data.removed_member_ids?.forEach((memberId) => { - thread.members.cache.delete(memberId); - }); - - /** - * Emitted whenever members are added or removed from a thread. Requires `GUILD_MEMBERS` privileged intent - * @event Client#threadMembersUpdate - * @param {Collection} oldMembers The members before the update - * @param {Collection} newMembers The members after the update - */ - client.emit(Events.THREAD_MEMBERS_UPDATE, old, thread.members.cache); - } - return {}; - } -} - -module.exports = ThreadMembersUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/TypingStart.js b/vendor/discord.js-selfbot-v13/src/client/actions/TypingStart.js deleted file mode 100644 index f1aee23..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/TypingStart.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const Typing = require('../../structures/Typing'); -const { Events } = require('../../util/Constants'); - -class TypingStart extends Action { - handle(data) { - const channel = this.getChannel({ - id: data.channel_id, - ...('guild_id' in data && { guild_id: data.guild_id }), - }); - if (!channel) return; - - if (!channel.isText()) { - this.client.emit( - Events.WARN, - `Discord sent a typing packet to a ${channel.type} channel ${channel.id}`, - ); - return; - } - - const user = this.getUserFromMember(data); - if (user) { - /** - * Emitted whenever a user starts typing in a channel. - * @event Client#typingStart - * @param {Typing} typing The typing state - */ - this.client.emit(Events.TYPING_START, new Typing(channel, user, data)); - } - } -} - -module.exports = TypingStart; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/UserUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/UserUpdate.js deleted file mode 100644 index bfba1b9..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/UserUpdate.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class UserUpdateAction extends Action { - handle(data) { - const client = this.client; - - const newUser = - data.id === client.user.id - ? client.user - : client.users.cache.get(data.id); - const oldUser = newUser._update(data); - - if (!oldUser.equals(newUser)) { - /** - * Emitted whenever a user's details (e.g. username) are changed. - * Triggered by the Discord gateway events USER_UPDATE, GUILD_MEMBER_UPDATE, and PRESENCE_UPDATE. - * @event Client#userUpdate - * @param {User} oldUser The user before the update - * @param {User} newUser The user after the update - */ - client.emit(Events.USER_UPDATE, oldUser, newUser); - return { - old: oldUser, - updated: newUser, - }; - } - - return { - old: null, - updated: null, - }; - } -} - -module.exports = UserUpdateAction; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/VoiceStateUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/VoiceStateUpdate.js deleted file mode 100644 index c68650d..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/VoiceStateUpdate.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const VoiceState = require('../../structures/VoiceState'); -const { Events } = require('../../util/Constants'); - -class VoiceStateUpdate extends Action { - handle(data) { - const client = this.client; - const guild = client.guilds.cache.get(data.guild_id); - if (guild) { - // Update the state - const oldState = - guild.voiceStates.cache.get(data.user_id)?._clone() ?? - new VoiceState(guild, { user_id: data.user_id }); - - const newState = guild.voiceStates._add(data); - - // Get the member - let member = guild.members.cache.get(data.user_id); - if (member && data.member) { - member._patch(data.member); - } else if (data.member?.user && data.member.joined_at) { - member = guild.members._add(data.member); - } - - /** - * Emitted whenever a member changes voice state - e.g. joins/leaves a channel, mutes/unmutes. - * @event Client#voiceStateUpdate - * @param {VoiceState} oldState The voice state before the update - * @param {VoiceState} newState The voice state after the update - */ - client.emit(Events.VOICE_STATE_UPDATE, oldState, newState); - } else { - // Update the state - const oldState = - client.voiceStates.cache.get(data.user_id)?._clone() ?? - new VoiceState({ client }, { user_id: data.user_id }); - - const newState = client.voiceStates._add(data); - - client.emit(Events.VOICE_STATE_UPDATE, oldState, newState); - } - // Emit event - if (data.user_id === client.user?.id) { - client.emit( - 'debug', - `[VOICE] received voice state update: ${JSON.stringify(data)}`, - ); - client.voice.onVoiceStateUpdate(data); - } - } -} - -module.exports = VoiceStateUpdate; diff --git a/vendor/discord.js-selfbot-v13/src/client/actions/WebhooksUpdate.js b/vendor/discord.js-selfbot-v13/src/client/actions/WebhooksUpdate.js deleted file mode 100644 index 3551e16..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/actions/WebhooksUpdate.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -const Action = require('./Action'); -const { Events } = require('../../util/Constants'); - -class WebhooksUpdate extends Action { - handle(data) { - const client = this.client; - const channel = client.channels.cache.get(data.channel_id); - /** - * Emitted whenever a channel has its webhooks changed. - * @event Client#webhookUpdate - * @param {TextChannel|NewsChannel|VoiceChannel|StageChannel|ForumChannel|MediaChannel} channel - * The channel that had a webhook update - */ - if (channel) client.emit(Events.WEBHOOKS_UPDATE, channel); - } -} - -module.exports = WebhooksUpdate; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/ClientVoiceManager.js b/vendor/discord.js-selfbot-v13/src/client/voice/ClientVoiceManager.js deleted file mode 100644 index 53467ed..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/ClientVoiceManager.js +++ /dev/null @@ -1,168 +0,0 @@ -'use strict'; - -const VoiceConnection = require('./VoiceConnection'); -const { Error } = require('../../errors'); -const { Events } = require('../../util/Constants'); - -/** - * Manages voice connections for the client - * Feat: Support both lib & djs/voice - */ -class ClientVoiceManager { - constructor(client) { - /** - * The client that instantiated this voice manager - * @type {Client} - * @readonly - * @name ClientVoiceManager#client - */ - Object.defineProperty(this, 'client', { value: client }); - - /** - * A current connection objects - * @type {?VoiceConnection} - */ - this.connection = null; - - /** - * Maps guild ids to voice adapters created for use with @discordjs/voice. - * @type {Map} - */ - this.adapters = new Map(); - - client.on(Events.SHARD_DISCONNECT, (_, shardId) => { - for (const [guildId, adapter] of this.adapters.entries()) { - if (client.guilds.cache.get(guildId)?.shardId === shardId) { - // Because it has 1 shard => adapter.destroy(); - } - adapter.destroy(); - } - }); - } - - onVoiceServer(payload) { - const { guild_id, channel_id, token, endpoint } = payload; - this.client.emit( - 'debug', - `[VOICE] voiceServer ${channel_id ? 'channel' : 'guild'}: ${ - channel_id || guild_id - } token: ${token} endpoint: ${endpoint}`, - ); - const connection = this.connection; - if (connection) connection.setTokenAndEndpoint(token, endpoint); - // Djs / voice - if (payload.guild_id) { - this.adapters.get(payload.guild_id)?.onVoiceServerUpdate(payload); - } else { - this.adapters.get(payload.channel_id)?.onVoiceServerUpdate(payload); - } - } - - onVoiceStateUpdate(payload) { - const { guild_id, session_id, channel_id } = payload; - // @discordjs/voice - if ( - payload.guild_id && - payload.session_id && - payload.user_id === this.client.user?.id - ) { - this.adapters.get(payload.guild_id)?.onVoiceStateUpdate(payload); - } else if ( - payload.channel_id && - payload.session_id && - payload.user_id === this.client.user?.id - ) { - this.adapters.get(payload.channel_id)?.onVoiceStateUpdate(payload); - } - // Main lib - const connection = this.connection; - this.client.emit( - 'debug', - `[VOICE] connection? ${!!connection}, ${guild_id} ${session_id} ${channel_id}`, - ); - if (!connection) return; - if (!channel_id) { - connection._disconnect(); - this.connection = null; - return; - } - const channel = this.client.channels.cache.get(channel_id); - if (channel) { - connection.channel = channel; - connection.setSessionId(session_id); - } else { - this.client.emit( - 'debug', - `[VOICE] disconnecting from guild ${guild_id} as channel ${channel_id} is uncached`, - ); - connection.disconnect(); - } - } - - /** - * @property {boolean} [selfMute=false] - * @property {boolean} [selfDeaf=false] - * @property {boolean} [selfVideo=false] - * @property {VideoCodec} [videoCodec='H264'] - * @typedef {Object} JoinChannelConfig - */ - - /** - * Sets up a request to join a voice channel. - * @param {VoiceChannel | StageChannel | DMChannel | GroupDMChannel | Snowflake} channel The voice channel to join - * @param {JoinChannelConfig} config Config to join voice channel - * @returns {Promise} - */ - joinChannel(channel, config = {}) { - return new Promise((resolve, reject) => { - channel = this.client.channels.resolve(channel); - if (!['DM', 'GROUP_DM'].includes(channel?.type) && !channel.joinable) { - throw new Error('VOICE_JOIN_CHANNEL', channel.full); - } - - let connection = this.connection; - - if (connection) { - if (connection.channel.id !== channel.id) { - this.connection.updateChannel(channel); - } - resolve(connection); - return; - } else { - connection = new VoiceConnection(this, channel); - if (config?.videoCodec) connection.setVideoCodec(config.videoCodec); - connection.on('debug', (msg) => - this.client.emit( - 'debug', - `[VOICE (${channel.guild?.id || channel.id}:${connection.status})]: ${msg}`, - ), - ); - connection.authenticate({ - self_mute: Boolean(config.selfMute), - self_deaf: Boolean(config.selfDeaf), - self_video: Boolean(config.selfVideo), - }); - this.connection = connection; - } - - connection.once('failed', (reason) => { - this.connection = null; - reject(reason); - }); - - connection.on('error', reject); - - connection.once('authenticated', () => { - connection.once('ready', () => { - resolve(connection); - connection.removeListener('error', reject); - }); - connection.once('disconnect', () => { - this.connection = null; - }); - }); - }); - } -} - -module.exports = ClientVoiceManager; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/VoiceConnection.js b/vendor/discord.js-selfbot-v13/src/client/voice/VoiceConnection.js deleted file mode 100644 index 2238b1c..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/VoiceConnection.js +++ /dev/null @@ -1,1324 +0,0 @@ -'use strict'; - -const EventEmitter = require('events'); -const { getCiphers } = require('node:crypto'); -const { setTimeout } = require('node:timers'); -const { Collection } = require('@discordjs/collection'); -const VoiceUDP = require('./networking/VoiceUDPClient'); -const VoiceWebSocket = require('./networking/VoiceWebSocket'); -const MediaPlayer = require('./player/MediaPlayer'); -const VoiceReceiver = require('./receiver/Receiver'); -const { parseStreamKey } = require('./util/Function'); -const PlayInterface = require('./util/PlayInterface'); -const Silence = require('./util/Silence'); -const { Error } = require('../../errors'); -const { - Opcodes, - VoiceOpcodes, - VoiceStatus, - Events, -} = require('../../util/Constants'); -const Speaking = require('../../util/Speaking'); -const Util = require('../../util/Util'); - -// Workaround for Discord now requiring silence to be sent before being able to receive audio -class SingleSilence extends Silence { - _read() { - super._read(); - this.push(null); - } -} - -const SUPPORTED_MODES = ['aead_xchacha20_poly1305_rtpsize']; - -// Just in case there's some system that doesn't come with aes-256-gcm, conditionally add it as supported -if (getCiphers().includes('aes-256-gcm')) { - SUPPORTED_MODES.unshift('aead_aes256_gcm_rtpsize'); -} - -const SUPPORTED_CODECS = ['VP8', 'H264']; - -/** - * Represents a connection to a guild's voice server. - * ```js - * // Obtained using: - * client.voice.joinChannel(channel) - * .then(connection => { - * - * }); - * ``` - * @extends {EventEmitter} - * @implements {PlayInterface} - */ -class VoiceConnection extends EventEmitter { - constructor(voiceManager, channel) { - super(); - - /** - * The voice manager that instantiated this connection - * @type {ClientVoiceManager} - */ - this.voiceManager = voiceManager; - - /** - * The voice channel this connection is currently serving - * @type {VoiceChannel} - */ - this.channel = channel; - - /** - * The current status of the voice connection - * @type {VoiceStatus} - */ - this.status = VoiceStatus.AUTHENTICATING; - - /** - * Our current speaking state - * @type {Readonly} - */ - this.speaking = new Speaking().freeze(); - - /** - * Our current video state - * @type {boolean | null} - */ - this.videoStatus = null; - - /** - * The authentication data needed to connect to the voice server - * @type {Object} - * @private - */ - this.authentication = {}; - - /** - * The audio player for this voice connection - * @type {MediaPlayer} - */ - this.player = new MediaPlayer( - this, - this.constructor.name === 'StreamConnection', - ); - - this.player.on('debug', (m) => { - /** - * Debug info from the connection. - * @event VoiceConnection#debug - * @param {string} message The debug message - */ - this.emit('debug', `media player - ${m}`); - }); - - this.player.on('error', (e) => { - /** - * Warning info from the connection. - * @event VoiceConnection#warn - * @param {string|Error} warning The warning - */ - this.emit('warn', e); - }); - - this.once('closing', () => this.player.destroy()); - - /** - * Map SSRC values to user IDs - * @type {Map} - * @private - */ - this.ssrcMap = new Map(); - - /** - * Tracks which users are talking - * @type {Map>} - * @private - */ - this._speaking = new Map(); - - /** - * Object that wraps contains the `ws` and `udp` sockets of this voice connection - * @type {Object} - * @private - */ - this.sockets = {}; - - /** - * The voice receiver of this connection - * @type {VoiceReceiver} - */ - this.receiver = new VoiceReceiver(this); - - /** - * Video codec - * * `VP8` - * * `VP9` (Not supported for encoding & decoding) - * * `H264` - * * `H265` (Not supported for encoding & decoding) - * * `AV1` (Not supported for encoding & decoding) - * @typedef {string} VideoCodec - */ - - /** - * Video codec (encoded) of this connection - * @type {VideoCodec} - */ - this.videoCodec = 'H264'; - - /** - * Create a stream connection ? - * @type {?StreamConnection} - */ - this.streamConnection = null; - - /** - * All stream watch connection - * @type {Collection} - */ - this.streamWatchConnection = new Collection(); - } - - /** - * The client that instantiated this connection - * @type {Client} - * @readonly - */ - get client() { - return this.voiceManager.client; - } - - /** - * The current audio dispatcher (if any) - * @type {?AudioDispatcher} - * @readonly - */ - get dispatcher() { - return this.player.dispatcher; - } - - /** - * The current video dispatcher (if any) - * @type {?VideoDispatcher} - * @readonly - */ - get videoDispatcher() { - return this.player.videoDispatcher; - } - - /** - * Sets whether the voice connection should display as "speaking", "soundshare" or "none". - * @param {BitFieldResolvable} value The new speaking state - */ - setSpeaking(value) { - if (this.speaking.equals(value)) return; - if (this.status !== VoiceStatus.CONNECTED) return; - this.speaking = new Speaking(value).freeze(); - this.sockets.ws - .sendPacket({ - op: VoiceOpcodes.SPEAKING, - d: { - speaking: this.speaking.bitfield, - delay: 0, - ssrc: this.authentication.ssrc, - }, - }) - .catch((e) => { - this.emit('debug', e); - }); - } - - /** - * Set video codec before select protocol - * @param {VideoCodec} value Codec - * @returns {VoiceConnection} - */ - setVideoCodec(value) { - if (!SUPPORTED_CODECS.includes(value)) - throw new Error('INVALID_VIDEO_CODEC', SUPPORTED_CODECS); - this.videoCodec = value; - return this; - } - - /** - * Sets video status - * @param {boolean} value Video on or off - */ - setVideoStatus(value) { - if (value === this.videoStatus) return; - if (this.status !== VoiceStatus.CONNECTED) return; - this.videoStatus = value; - if (!value) { - this.sockets.ws - .sendPacket({ - op: VoiceOpcodes.SOURCES, - d: { - audio_ssrc: this.authentication.ssrc, - video_ssrc: 0, - rtx_ssrc: 0, - streams: [], - }, - }) - .catch((e) => { - this.emit('debug', e); - }); - } else { - this.sockets.ws - .sendPacket({ - op: VoiceOpcodes.SOURCES, - d: { - audio_ssrc: this.authentication.ssrc, - video_ssrc: this.authentication.ssrc + 1, - rtx_ssrc: this.authentication.ssrc + 2, - streams: [ - { - type: 'video', - rid: '100', - ssrc: this.authentication.ssrc + 1, - active: true, - quality: 100, - rtx_ssrc: this.authentication.ssrc + 2, - max_bitrate: 8000000, - max_framerate: 60, - max_resolution: { - type: 'source', - width: 0, - height: 0, - }, - }, - ], - }, - }) - .catch((e) => { - this.emit('debug', e); - }); - } - } - - /** - * The voice state of this connection - * @type {?VoiceState} - */ - get voice() { - return this.client.user.voice; - } - - /** - * Sends a request to the main gateway to join a voice channel. - * @param {Object} [options] The options to provide - * @returns {Promise} - * @private - */ - sendVoiceStateUpdate(options = {}) { - options = Util.mergeDefault( - { - guild_id: this.channel.guild?.id || null, - channel_id: this.channel.id, - self_mute: this.voice ? this.voice.selfMute : false, - self_deaf: this.voice ? this.voice.selfDeaf : false, - self_video: this.voice ? this.voice.selfVideo : false, - flags: 2, - }, - options, - ); - - this.emit( - 'debug', - `Sending voice state update: ${JSON.stringify(options)}`, - ); - - return this.channel.client.ws.broadcast({ - op: Opcodes.VOICE_STATE_UPDATE, - d: options, - }); - } - - /** - * Set the token and endpoint required to connect to the voice servers. - * @param {string} token The voice token - * @param {string} endpoint The voice endpoint - * @returns {void} - * @private - */ - setTokenAndEndpoint(token, endpoint) { - this.emit('debug', `Token "${token}" and endpoint "${endpoint}"`); - if (!endpoint) { - // Signifies awaiting endpoint stage - return; - } - - if (!token) { - this.authenticateFailed('VOICE_TOKEN_ABSENT'); - return; - } - - endpoint = endpoint.match(/([^:]*)/)[0]; - this.emit('debug', `Endpoint resolved as ${endpoint}`); - - if (!endpoint) { - this.authenticateFailed('VOICE_INVALID_ENDPOINT'); - return; - } - - if (this.status === VoiceStatus.AUTHENTICATING) { - this.authentication.token = token; - this.authentication.endpoint = endpoint; - this.checkAuthenticated(); - } else if ( - token !== this.authentication.token || - endpoint !== this.authentication.endpoint - ) { - this.reconnect(token, endpoint); - } - } - - /** - * Sets the Session ID for the connection. - * @param {string} sessionId The voice session ID - * @private - */ - setSessionId(sessionId) { - this.emit( - 'debug', - `Setting sessionId ${sessionId} (stored as "${this.authentication.sessionId}")`, - ); - if (!sessionId) { - this.authenticateFailed('VOICE_SESSION_ABSENT'); - return; - } - - if (this.status === VoiceStatus.AUTHENTICATING) { - this.authentication.sessionId = sessionId; - this.checkAuthenticated(); - } else if (sessionId !== this.authentication.sessionId) { - this.authentication.sessionId = sessionId; - /** - * Emitted when a new session ID is received. - * @event VoiceConnection#newSession - * @private - */ - this.emit('newSession', sessionId); - } - } - - /** - * Checks whether the voice connection is authenticated. - * @private - */ - checkAuthenticated() { - const { token, endpoint, sessionId } = this.authentication; - this.emit('debug', `Authenticated with sessionId ${sessionId}`); - if (token && endpoint && sessionId) { - this.status = VoiceStatus.CONNECTING; - /** - * Emitted when we successfully initiate a voice connection. - * @event VoiceConnection#authenticated - */ - this.emit('authenticated'); - this.connect(); - } - } - - /** - * Invoked when we fail to initiate a voice connection. - * @param {string} reason The reason for failure - * @private - */ - authenticateFailed(reason) { - clearTimeout(this.connectTimeout); - this.emit('debug', `Authenticate failed - ${reason}`); - if (this.status === VoiceStatus.AUTHENTICATING) { - /** - * Emitted when we fail to initiate a voice connection. - * @event VoiceConnection#failed - * @param {Error} error The encountered error - */ - this.emit('failed', new Error(reason)); - } else { - /** - * Emitted whenever the connection encounters an error. - * @event VoiceConnection#error - * @param {Error} error The encountered error - */ - this.emit('error', new Error(reason)); - } - this.status = VoiceStatus.DISCONNECTED; - } - - /** - * Move to a different voice channel in the same guild. - * @param {VoiceChannel} channel The channel to move to - * @private - */ - updateChannel(channel) { - this.channel = channel; - this.sendVoiceStateUpdate(); - } - - /** - * Attempts to authenticate to the voice server. - * @param {Object} options Join config - * @private - */ - authenticate(options = {}) { - this.sendVoiceStateUpdate(options); - this.connectTimeout = setTimeout( - () => this.authenticateFailed('VOICE_CONNECTION_TIMEOUT'), - 15_000, - ).unref(); - } - - /** - * Attempts to reconnect to the voice server (typically after a region change). - * @param {string} token The voice token - * @param {string} endpoint The voice endpoint - * @private - */ - reconnect(token, endpoint) { - this.authentication.token = token; - this.authentication.endpoint = endpoint; - this.speaking = new Speaking().freeze(); - this.status = VoiceStatus.RECONNECTING; - this.emit('debug', `Reconnecting to ${endpoint}`); - /** - * Emitted when the voice connection is reconnecting (typically after a region change). - * @event VoiceConnection#reconnecting - */ - this.emit('reconnecting'); - this.connect(); - } - - /** - * Disconnects the voice connection, causing a disconnect and closing event to be emitted. - */ - disconnect() { - this.emit('closing'); - this.emit('debug', 'disconnect() triggered'); - clearTimeout(this.connectTimeout); - const conn = this.voiceManager.connection; - if (conn === this) this.voiceManager.connection = null; - this.sendVoiceStateUpdate({ - channel_id: null, - }); - this._disconnect(); - } - - /** - * Internally disconnects (doesn't send disconnect packet). - * @private - */ - _disconnect() { - this.cleanup(); - this.status = VoiceStatus.DISCONNECTED; - /** - * Emitted when the voice connection disconnects. - * @event VoiceConnection#disconnect - */ - this.emit('disconnect'); - } - - /** - * Cleans up after disconnect. - * @private - */ - cleanup() { - this.player.destroy(); - this.speaking = new Speaking().freeze(); - const { ws, udp } = this.sockets; - - this.emit('debug', 'Connection clean up'); - - if (ws) { - ws.removeAllListeners('error'); - ws.removeAllListeners('ready'); - ws.removeAllListeners('sessionDescription'); - ws.removeAllListeners('speaking'); - ws.shutdown(); - } - - if (udp) udp.removeAllListeners('error'); - - this.sockets.ws = null; - this.sockets.udp = null; - } - - /** - * Connect the voice connection. - * @private - */ - connect() { - this.emit('debug', `Connect triggered`); - if (this.status !== VoiceStatus.RECONNECTING) { - if (this.sockets.ws) throw new Error('WS_CONNECTION_EXISTS'); - if (this.sockets.udp) throw new Error('UDP_CONNECTION_EXISTS'); - } - - if (this.sockets.ws) this.sockets.ws.shutdown(); - if (this.sockets.udp) this.sockets.udp.shutdown(); - - this.sockets.ws = new VoiceWebSocket(this); - this.sockets.udp = new VoiceUDP(this); - - const { ws, udp } = this.sockets; - - ws.on('debug', (msg) => this.emit('debug', msg)); - udp.on('debug', (msg) => this.emit('debug', msg)); - ws.on('error', (err) => this.emit('error', err)); - udp.on('error', (err) => this.emit('error', err)); - ws.on('ready', this.onReady.bind(this)); - ws.on('sessionDescription', this.onSessionDescription.bind(this)); - ws.on('startSpeaking', this.onStartSpeaking.bind(this)); - ws.on('startStreaming', this.onStartStreaming.bind(this)); - - this.sockets.ws.connect(); - } - - /** - * Invoked when the voice websocket is ready. - * @param {Object} data The received data - * @private - */ - onReady(data) { - Object.assign(this.authentication, data); - for (let mode of data.modes) { - if (SUPPORTED_MODES.includes(mode)) { - this.authentication.mode = mode; - this.emit('debug', `Selecting the ${mode} mode`); - break; - } - } - this.sockets.udp.createUDPSocket(data.ip); - } - - /** - * Invoked when a session description is received. - * @param {Object} data The received data - * @private - */ - onSessionDescription(data) { - Object.assign(this.authentication, data); - this.status = VoiceStatus.CONNECTED; - const ready = () => { - clearTimeout(this.connectTimeout); - this.emit( - 'debug', - `Ready with authentication details: ${JSON.stringify(this.authentication)}`, - ); - /** - * Emitted once the connection is ready, when a promise to join a voice channel resolves, - * the connection will already be ready. - * @event VoiceConnection#ready - */ - this.emit('ready'); - }; - if (this.dispatcher || this.videoDispatcher) { - ready(); - } else { - // This serves to provide support for voice receive, sending audio is required to receive it. - const dispatcher = this.playAudio(new SingleSilence(), { - type: 'opus', - volume: false, - }); - dispatcher.once('finish', ready); - } - } - - onStartSpeaking({ user_id, ssrc, speaking }) { - this.ssrcMap.set(+ssrc, { - ...(this.ssrcMap.get(+ssrc) || {}), - userId: user_id, - speaking: speaking, - }); - } - - onStartStreaming({ video_ssrc, user_id, audio_ssrc }) { - this.ssrcMap.set(+audio_ssrc, { - ...(this.ssrcMap.get(+audio_ssrc) || {}), - userId: user_id, - hasVideo: Boolean(video_ssrc), // Maybe ? - }); - /** -{ - video_ssrc: 0, - user_id: 'uid', - streams: [ - { - ssrc: 27734, - rtx_ssrc: 27735, - rid: '100', - quality: 100, - max_resolution: { width: 0, type: 'source', height: 0 },, - max_framerate: 60, - active: false - } - ], - audio_ssrc: 27733 -} - */ - } - - /** - * Invoked when a speaking event is received. - * @param {Object} data The received data - * @private - */ - onSpeaking({ user_id, speaking }) { - speaking = new Speaking(speaking).freeze(); - const guild = this.channel.guild; - const user = this.client.users.cache.get(user_id); - const old = this._speaking.get(user_id) || new Speaking(0).freeze(); - this._speaking.set(user_id, speaking); - /** - * Emitted whenever a user changes speaking state. - * @event VoiceConnection#speaking - * @param {User} user The user that has changed speaking state - * @param {Readonly} speaking The speaking state of the user - */ - if (this.status === VoiceStatus.CONNECTED) { - this.emit('speaking', user, speaking); - if (!speaking.has(Speaking.FLAGS.SPEAKING)) { - this.receiver.packets._stoppedSpeaking(user_id); - } - } - - if (guild && user && !speaking.equals(old)) { - const member = guild.members.cache.get(user); - if (member) { - /** - * Emitted once a guild member changes speaking state. - * @event Client#guildMemberSpeaking - * @param {GuildMember} member The member that started/stopped speaking - * @param {Readonly} speaking The speaking state of the member - */ - this.client.emit(Events.GUILD_MEMBER_SPEAKING, member, speaking); - } - } - } - - playAudio() {} // eslint-disable-line no-empty-function - playVideo() {} // eslint-disable-line no-empty-function - - /** - * Create new connection to screenshare stream - * @returns {Promise} - */ - createStreamConnection() { - // eslint-disable-next-line consistent-return - return new Promise((resolve, reject) => { - if (this.streamConnection) { - return resolve(this.streamConnection); - } else { - const connection = (this.streamConnection = new StreamConnection( - this.voiceManager, - this.channel, - this, - )); - connection.setVideoCodec(this.videoCodec); // Sync :? - // Setup event... - if (!this.eventHook) { - this.eventHook = true; // Dont listen this event two times :/ - this.channel.client.on('raw', (packet) => { - if ( - typeof packet !== 'object' || - !packet.t || - !packet.d || - !packet.d?.stream_key - ) { - return; - } - const { t: event, d: data } = packet; - const StreamKey = parseStreamKey(data.stream_key); - if ( - StreamKey.userId === this.channel.client.user.id && - this.channel.id == StreamKey.channelId && - this.streamConnection - ) { - // Current user stream - switch (event) { - case 'STREAM_CREATE': { - this.streamConnection.setSessionId( - this.authentication.sessionId, - ); - this.streamConnection.serverId = data.rtc_server_id; - break; - } - case 'STREAM_SERVER_UPDATE': { - this.streamConnection.setTokenAndEndpoint( - data.token, - data.endpoint, - ); - break; - } - case 'STREAM_DELETE': { - this.streamConnection.disconnect(); - break; - } - case 'STREAM_UPDATE': { - this.streamConnection.update(data); - break; - } - } - } - if ( - this.streamWatchConnection.has(StreamKey.userId) && - this.channel.id == StreamKey.channelId - ) { - const streamConnection = this.streamWatchConnection.get( - StreamKey.userId, - ); - // Watch user stream - switch (event) { - case 'STREAM_CREATE': { - streamConnection.setSessionId(this.authentication.sessionId); - streamConnection.serverId = data.rtc_server_id; - break; - } - case 'STREAM_SERVER_UPDATE': { - streamConnection.setTokenAndEndpoint( - data.token, - data.endpoint, - ); - break; - } - case 'STREAM_DELETE': { - streamConnection.disconnect(); - streamConnection.receiver.packets.destroyAllStream(); - break; - } - case 'STREAM_UPDATE': { - streamConnection.update(data); - break; - } - } - } - }); - } - - connection.sendSignalScreenshare(); - connection.sendScreenshareState(true); - - connection.on('debug', (msg) => - this.channel.client.emit( - 'debug', - `[VOICE STREAM (${this.channel.guild?.id || this.channel.id}:${connection.status})]: ${msg}`, - ), - ); - connection.once('failed', (reason) => { - this.streamConnection = null; - reject(reason); - }); - - connection.on('error', reject); - - connection.once('authenticated', () => { - connection.once('ready', () => { - resolve(connection); - connection.removeListener('error', reject); - }); - connection.once('disconnect', () => { - this.streamConnection = null; - }); - }); - } - }); - } - - /** - * Watch user stream - * @param {UserResolvable} user Discord user - * @returns {Promise} - */ - async joinStreamConnection(user) { - const userId = this.client.users.resolveId(user); - // Check if user is streaming - if (!userId) { - throw new Error('VOICE_USER_MISSING'); - } - const voiceState = - this.channel.guild?.voiceStates.cache.get(userId) || - this.client.voiceStates.cache.get(userId); - if (!voiceState || !voiceState.streaming) { - throw new Error('VOICE_USER_NOT_STREAMING'); - } - // eslint-disable-next-line consistent-return - return new Promise((resolve, reject) => { - if (this.streamWatchConnection.has(userId)) { - return resolve(this.streamWatchConnection.get(userId)); - } else { - const connection = new StreamConnectionReadonly( - this.voiceManager, - this.channel, - this, - userId, - ); - this.streamWatchConnection.set(userId, connection); - connection.setVideoCodec(this.videoCodec); - // Setup event... - if (!this.eventHook) { - this.eventHook = true; // Dont listen this event two times :/ - this.channel.client.on('raw', (packet) => { - if ( - typeof packet !== 'object' || - !packet.t || - !packet.d || - !packet.d?.stream_key - ) { - return; - } - const { t: event, d: data } = packet; - const StreamKey = parseStreamKey(data.stream_key); - if ( - StreamKey.userId === this.channel.client.user.id && - this.channel.id == StreamKey.channelId && - this.streamConnection - ) { - // Current user stream - switch (event) { - case 'STREAM_CREATE': { - this.streamConnection.setSessionId( - this.authentication.sessionId, - ); - this.streamConnection.serverId = data.rtc_server_id; - break; - } - case 'STREAM_SERVER_UPDATE': { - this.streamConnection.setTokenAndEndpoint( - data.token, - data.endpoint, - ); - break; - } - case 'STREAM_DELETE': { - this.streamConnection.disconnect(); - break; - } - case 'STREAM_UPDATE': { - this.streamConnection.update(data); - break; - } - } - } - if ( - this.streamWatchConnection.has(StreamKey.userId) && - this.channel.id == StreamKey.channelId - ) { - const streamConnection = this.streamWatchConnection.get( - StreamKey.userId, - ); - // Watch user stream - switch (event) { - case 'STREAM_CREATE': { - streamConnection.setSessionId(this.authentication.sessionId); - streamConnection.serverId = data.rtc_server_id; - break; - } - case 'STREAM_SERVER_UPDATE': { - streamConnection.setTokenAndEndpoint( - data.token, - data.endpoint, - ); - break; - } - case 'STREAM_DELETE': { - streamConnection.disconnect(); - streamConnection.receiver.packets.destroyAllStream(); - break; - } - case 'STREAM_UPDATE': { - streamConnection.update(data); - break; - } - } - } - }); - } - - connection.sendSignalScreenshare(); - - connection.on('debug', (msg) => - this.channel.client.emit( - 'debug', - `[VOICE STREAM WATCH (${userId}>${this.channel.guild?.id || this.channel.id}:${ - connection.status - })]: ${msg}`, - ), - ); - connection.once('failed', (reason) => { - this.streamWatchConnection.delete(userId); - reject(reason); - }); - - connection.on('error', reject); - - connection.once('authenticated', () => { - connection.once('ready', () => { - resolve(connection); - connection.removeListener('error', reject); - }); - connection.once('disconnect', () => { - this.streamWatchConnection.delete(userId); - }); - }); - } - }); - } - - /** - * @event VoiceConnection#streamUpdate - * @description Emitted when the StreamConnection or StreamConnectionReadonly - * state changes, providing the previous and current stream state. - * - * @param {StreamState} oldData - The previous state of the stream. - * @param {StreamState} newData - The current state of the stream. - * - * @typedef {Object} StreamState - * @property {boolean} isPaused - Indicates whether the stream is currently paused. - * @property {string|null} region - The region where the stream is hosted, or null if not specified. - * @property {Snowflake[]} viewerIds - An array of Snowflake IDs representing the viewers connected to the stream. - */ -} - -/** - * Represents a connection to a guild's voice server. - * ```js - * // Obtained using: - * client.voice.joinChannel(channel) - * .then(connection => connection.createStreamConnection()) - * .then(connection => { - * - * }); - * ``` - * @extends {VoiceConnection} - */ -class StreamConnection extends VoiceConnection { - #requestDisconnect = false; - /** - * @param {ClientVoiceManager} voiceManager Voice manager - * @param {Channel} channel any channel (joinable) - * @param {VoiceConnection} voiceConnection parent - */ - constructor(voiceManager, channel, voiceConnection) { - super(voiceManager, channel); - - /** - * Current voice connection - * @type {VoiceConnection} - */ - this.voiceConnection = voiceConnection; - - Object.defineProperty(this, 'voiceConnection', { - value: voiceConnection, - writable: false, - }); - - /** - * Server Id - * @type {string | null} - */ - this.serverId = null; - - /** - * Stream state - * @type {boolean | null} - */ - this.isPaused = null; - - /** - * Viewer IDs - * @type {Snowflake[]} - */ - this.viewerIds = []; - - /** - * Voice region name - * @type {string | null} - */ - this.region = null; - } - - createStreamConnection() { - return Promise.resolve(this); - } - - joinStreamConnection() { - throw new Error('STREAM_CANNOT_JOIN'); - } - - get streamConnection() { - return this; - } - - set streamConnection(value) { - // Why ? - } - - get streamWatchConnection() { - return new Collection(); - } - - set streamWatchConnection(value) { - // Why ? - } - - disconnect() { - if (this.#requestDisconnect) return; - this.emit('closing'); - this.emit('debug', 'Stream: disconnect() triggered'); - clearTimeout(this.connectTimeout); - if (this.voiceConnection.streamConnection === this) - this.voiceConnection.streamConnection = null; - this.sendStopScreenshare(); - this._disconnect(); - } - - /** - * Create new stream connection (WS packet) - * @returns {void} - */ - sendSignalScreenshare() { - const data = { - type: ['DM', 'GROUP_DM'].includes(this.channel.type) ? 'call' : 'guild', - guild_id: this.channel.guild?.id || null, - channel_id: this.channel.id, - preferred_region: null, - }; - this.emit('debug', `Signal Stream: ${JSON.stringify(data)}`); - return this.channel.client.ws.broadcast({ - op: Opcodes.STREAM_CREATE, - d: data, - }); - } - - /** - * Send screenshare state... (WS) - * @param {boolean} isPaused screenshare paused ? - * @returns {void} - */ - sendScreenshareState(isPaused = false) { - if (isPaused == this.isPaused) return; - this.emit( - 'streamUpdate', - { - isPaused: this.isPaused, - region: this.region, - viewerIds: this.viewerIds, - }, - { - isPaused, - region: this.region, - viewerIds: this.viewerIds, - }, - ); - this.isPaused = isPaused; - this.channel.client.ws.broadcast({ - op: Opcodes.STREAM_SET_PAUSED, - d: { - stream_key: this.streamKey, - paused: isPaused, - }, - }); - } - - /** - * Stop screenshare, delete this connection (WS) - * @returns {void} - * @private Using StreamConnection#disconnect() - */ - sendStopScreenshare() { - this.#requestDisconnect = true; - this.channel.client.ws.broadcast({ - op: Opcodes.STREAM_DELETE, - d: { - stream_key: this.streamKey, - }, - }); - } - - update(data) { - this.emit( - 'streamUpdate', - { - isPaused: this.isPaused, - region: this.region, - viewerIds: this.viewerIds.slice(), - }, - { - isPaused: data.paused, - region: data.region, - viewerIds: data.viewer_ids, - }, - ); - this.viewerIds = data.viewer_ids; - this.region = data.region; - } - - /** - * Current stream key - * @type {string} - */ - get streamKey() { - return `${['DM', 'GROUP_DM'].includes(this.channel.type) ? 'call' : `guild:${this.channel.guild.id}`}:${ - this.channel.id - }:${this.channel.client.user.id}`; - } -} - -/** - * Represents a connection to a guild's voice server. - * ```js - * // Obtained using: - * client.voice.joinChannel(channel) - * .then(connection => connection.createStreamConnection()) - * .then(connection => { - * - * }); - * ``` - * @extends {VoiceConnection} - */ -class StreamConnectionReadonly extends VoiceConnection { - #requestDisconnect = false; - /** - * @param {ClientVoiceManager} voiceManager Voice manager - * @param {Channel} channel any channel (joinable) - * @param {VoiceConnection} voiceConnection parent - * @param {Snowflake} userId User ID - */ - constructor(voiceManager, channel, voiceConnection, userId) { - super(voiceManager, channel); - - /** - * Current voice connection - * @type {VoiceConnection} - */ - this.voiceConnection = voiceConnection; - - /** - * User ID (who started the stream) - * @type {Snowflake} - */ - this.userId = userId; - - Object.defineProperty(this, 'voiceConnection', { - value: voiceConnection, - writable: false, - }); - - /** - * Server Id - * @type {string | null} - */ - this.serverId = null; - - /** - * Stream state - * @type {boolean} - */ - this.isPaused = false; - - /** - * Viewer IDs - * @type {Snowflake[]} - */ - this.viewerIds = []; - - /** - * Voice region name - * @type {string | null} - */ - this.region = null; - } - - createStreamConnection() { - throw new Error('STREAM_CONNECTION_READONLY'); - } - - joinStreamConnection() { - return Promise.resolve(this); - } - - get streamConnection() { - return null; - } - - set streamConnection(value) { - // Why ? - } - - get streamWatchConnection() { - return new Collection(); - } - - set streamWatchConnection(value) { - // Why ? - } - - disconnect() { - if (this.#requestDisconnect) return; - this.emit('closing'); - this.emit('debug', 'Stream: disconnect() triggered'); - clearTimeout(this.connectTimeout); - this.voiceConnection.streamWatchConnection.delete(this.userId); - this.sendStopScreenshare(); - this._disconnect(); - } - - /** - * Create new stream connection (WS packet) - * @returns {void} - */ - sendSignalScreenshare() { - this.emit('debug', `Signal Stream Watch: ${this.streamKey}`); - return this.channel.client.ws.broadcast({ - op: Opcodes.STREAM_WATCH, - d: { - stream_key: this.streamKey, - }, - }); - } - - /** - * Stop screenshare, delete this connection (WS) - * @returns {void} - * @private Using StreamConnection#disconnect() - */ - sendStopScreenshare() { - this.#requestDisconnect = true; - this.channel.client.ws.broadcast({ - op: Opcodes.STREAM_DELETE, - d: { - stream_key: this.streamKey, - }, - }); - } - - update(data) { - this.emit( - 'streamUpdate', - { - isPaused: this.isPaused, - region: this.region, - viewerIds: this.viewerIds.slice(), - }, - { - isPaused: data.paused, - region: data.region, - viewerIds: data.viewer_ids, - }, - ); - this.isPaused = data.paused; - this.viewerIds = data.viewer_ids; - this.region = data.region; - } - - /** - * Current stream key - * @type {string} - */ - get streamKey() { - return `${['DM', 'GROUP_DM'].includes(this.channel.type) ? 'call' : `guild:${this.channel.guild.id}`}:${ - this.channel.id - }:${this.userId}`; - } -} - -PlayInterface.applyToClass(VoiceConnection); -PlayInterface.applyToClass(StreamConnection); - -module.exports = VoiceConnection; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/dispatcher/AnnexBDispatcher.js b/vendor/discord.js-selfbot-v13/src/client/voice/dispatcher/AnnexBDispatcher.js deleted file mode 100644 index d292b31..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/dispatcher/AnnexBDispatcher.js +++ /dev/null @@ -1,155 +0,0 @@ -'use strict'; - -/* -Credit: https://github.com/dank074/Discord-video-stream -The use of video streaming in this library is an incomplete implementation with many bugs, primarily aimed at lazy users. -The video streaming features in this library are sourced from https://github.com/dank074/Discord-video-stream. - -Please use the @dank074/discord-video-stream library to access all advanced and professional features, -along with comprehensive support. I will not actively fix bugs related to streaming and encourage everyone to -use https://github.com/dank074/Discord-video-stream for stable and smooth streaming. - -To reiterate: This is an incomplete implementation of the library https://github.com/dank074/Discord-video-stream. - -Thanks to dank074 and longnguyen2004 for implementing new codecs (H264, H265). -Thanks to mrjvs for discovering how Discord transmits data and the VP8 codec. - -Please use the @dank074/discord-video-stream library for the best support. -*/ - -const { Buffer } = require('buffer'); -const VideoDispatcher = require('./VideoDispatcher'); -const Util = require('../../../util/Util'); -const { - H264Helpers, - H265Helpers, -} = require('../player/processing/AnnexBNalSplitter'); - -class AnnexBDispatcher extends VideoDispatcher { - constructor( - player, - highWaterMark = 12, - streams, - fps, - nalFunctions, - payloadType, - ) { - super(player, highWaterMark, streams, fps, payloadType); - this._nalFunctions = nalFunctions; - } - - _codecCallback(frame) { - let accessUnit = frame; - let offset = 0; - - // Extract NALUs from the access unit - while (offset < accessUnit.length) { - const naluSize = accessUnit.readUInt32BE(offset); - offset += 4; - const nalu = accessUnit.subarray(offset, offset + naluSize); - const isLastNal = offset + naluSize >= accessUnit.length; - if (nalu.length <= this.mtu) { - // Send as Single NAL Unit Packet. - this._playChunk( - Buffer.concat([this.createPayloadExtension(), nalu]), - isLastNal, - ); - } else { - const [naluHeader, naluData] = this._nalFunctions.splitHeader(nalu); - const dataFragments = this.partitionMtu(naluData); - // Send as Fragmentation Unit A (FU-A): - for ( - let fragmentIndex = 0; - fragmentIndex < dataFragments.length; - fragmentIndex++ - ) { - const data = dataFragments[fragmentIndex]; - const isFirstPacket = fragmentIndex === 0; - const isFinalPacket = fragmentIndex === dataFragments.length - 1; - - this._playChunk( - Buffer.concat([ - this.createPayloadExtension(), - this.makeFragmentationUnitHeader( - isFirstPacket, - isFinalPacket, - naluHeader, - ), - data, - ]), - isLastNal && isFinalPacket, - ); - } - } - offset += naluSize; - } - } -} - -class H264Dispatcher extends AnnexBDispatcher { - constructor(player, highWaterMark = 12, streams, fps) { - super( - player, - highWaterMark, - streams, - fps, - H264Helpers, - Util.getPayloadType('H264'), - ); - } - - makeFragmentationUnitHeader(isFirstPacket, isLastPacket, naluHeader) { - const nal0 = naluHeader[0]; - const fuPayloadHeader = Buffer.alloc(2); - const nalType = H264Helpers.getUnitType(naluHeader); - const fnri = nal0 & 0xe0; - - fuPayloadHeader[0] = 0x1c | fnri; - - if (isFirstPacket) { - fuPayloadHeader[1] = 0x80 | nalType; - } else if (isLastPacket) { - fuPayloadHeader[1] = 0x40 | nalType; - } else { - fuPayloadHeader[1] = nalType; - } - - return fuPayloadHeader; - } -} - -class H265Dispatcher extends AnnexBDispatcher { - constructor(player, highWaterMark = 12, streams, fps) { - super( - player, - highWaterMark, - streams, - fps, - H265Helpers, - Util.getPayloadType('H265'), - ); - } - - makeFragmentationUnitHeader(isFirstPacket, isLastPacket, naluHeader) { - const fuIndicatorHeader = Buffer.allocUnsafe(3); - naluHeader.copy(fuIndicatorHeader); - const nalType = H265Helpers.getUnitType(naluHeader); - - fuIndicatorHeader[0] = (fuIndicatorHeader[0] & 0b10000001) | (49 << 1); - - if (isFirstPacket) { - fuIndicatorHeader[2] = 0x80 | nalType; - } else if (isLastPacket) { - fuIndicatorHeader[2] = 0x40 | nalType; - } else { - fuIndicatorHeader[2] = nalType; - } - - return fuIndicatorHeader; - } -} - -module.exports = { - H264Dispatcher, - H265Dispatcher, -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/dispatcher/AudioDispatcher.js b/vendor/discord.js-selfbot-v13/src/client/voice/dispatcher/AudioDispatcher.js deleted file mode 100644 index 4b52031..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/dispatcher/AudioDispatcher.js +++ /dev/null @@ -1,150 +0,0 @@ -'use strict'; - -const BaseDispatcher = require('./BaseDispatcher'); -const Util = require('../../../util/Util'); -const Silence = require('../util/Silence'); -const VolumeInterface = require('../util/VolumeInterface'); - -const CHANNELS = 2; - -/** - * @external WritableStream - * @see {@link https://nodejs.org/api/stream.html#stream_class_stream_writable} - */ - -/** - * The class that sends voice packet data to the voice connection. - * ```js - * // Obtained using: - * client.voice.joinChannel(channel).then(connection => { - * // You can play a file or a stream here: - * const dispatcher = connection.playAudio('/home/hydrabolt/audio.mp3'); - * }); - * ``` - * @implements {VolumeInterface} - * @extends {BaseDispatcher} - */ -class AudioDispatcher extends BaseDispatcher { - constructor( - player, - { seek = 0, volume = 1, fec, plp, bitrate = 96, highWaterMark = 12 } = {}, - streams, - ) { - const streamOptions = { seek, volume, fec, plp, bitrate, highWaterMark }; - super(player, highWaterMark, Util.getPayloadType('opus'), false, streams); - - this.streamOptions = streamOptions; - - this.streams.silence = new Silence(); - - this.setVolume(volume); - this.setBitrate(bitrate); - if (typeof fec !== 'undefined') this.setFEC(fec); - if (typeof plp !== 'undefined') this.setPLP(plp); - } - - get TIMESTAMP_INC() { - return 480 * CHANNELS; - } - - get FRAME_LENGTH() { - return 20; - } - - /** - * Get the type of the dispatcher - * @returns {'audio'} - */ - getTypeDispatcher() { - return 'audio'; - } - - /** - * Set the bitrate of the current Opus encoder if using a compatible Opus stream. - * @param {number} value New bitrate, in kbps - * If set to 'auto', the voice channel's bitrate will be used - * @returns {boolean} true if the bitrate has been successfully changed. - */ - setBitrate(value) { - if (!value || !this.bitrateEditable) return false; - const bitrate = - value === 'auto' ? this.player.voiceConnection.channel.bitrate : value; - this.streams.opus.setBitrate(bitrate * 1000); - return true; - } - - /** - * Sets the expected packet loss percentage if using a compatible Opus stream. - * @param {number} value between 0 and 1 - * @returns {boolean} Returns true if it was successfully set. - */ - setPLP(value) { - if (!this.bitrateEditable) return false; - this.streams.opus.setPLP(value); - return true; - } - - /** - * Enables or disables forward error correction if using a compatible Opus stream. - * @param {boolean} enabled true to enable - * @returns {boolean} Returns true if it was successfully set. - */ - setFEC(enabled) { - if (!this.bitrateEditable) return false; - this.streams.opus.setFEC(enabled); - return true; - } - - get volumeEditable() { - return Boolean(this.streams.volume); - } - - /** - * Whether or not the Opus bitrate of this stream is editable - * @type {boolean} - * @readonly - */ - get bitrateEditable() { - return this.streams.opus && this.streams.opus.setBitrate; - } - - // Volume - get volume() { - return this.streams.volume ? this.streams.volume.volume : 1; - } - - setVolume(value) { - if (!this.streams.volume) return false; - /** - * Emitted when the volume of this dispatcher changes. - * @event AudioDispatcher#volumeChange - * @param {number} oldVolume The old volume of this dispatcher - * @param {number} newVolume The new volume of this dispatcher - */ - this.emit('volumeChange', this.volume, value); - this.streams.volume.setVolume(value); - return true; - } - - /** - * Sync with another video dispatcher to ensure that the audio and video are played at the same time. - * @param {VideoDispatcher} otherDispatcher The video dispatcher to sync with - */ - setSyncVideoDispatcher(otherDispatcher) { - if (otherDispatcher.getTypeDispatcher() !== 'video') { - throw new Error('Dispatcher must be a video dispatcher'); - } - this._syncDispatcher = otherDispatcher; - } - - // Volume stubs for docs - /* eslint-disable no-empty-function*/ - get volumeDecibels() {} - get volumeLogarithmic() {} - setVolumeDecibels() {} - setVolumeLogarithmic() {} -} - -VolumeInterface.applyToClass(AudioDispatcher); - -module.exports = AudioDispatcher; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/dispatcher/BaseDispatcher.js b/vendor/discord.js-selfbot-v13/src/client/voice/dispatcher/BaseDispatcher.js deleted file mode 100644 index 2e4156e..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/dispatcher/BaseDispatcher.js +++ /dev/null @@ -1,490 +0,0 @@ -'use strict'; - -const { Buffer } = require('node:buffer'); -const crypto = require('node:crypto'); -const { Writable } = require('node:stream'); -const { setTimeout } = require('node:timers'); -const secretbox = require('../util/Secretbox'); - -const MAX_UINT_16 = 2 ** 16 - 1; -const MAX_UINT_32 = 2 ** 32 - 1; - -const extensions = [{ id: 5, length: 2, value: 0 }]; - -/** - * @external WritableStream - * @see {@link https://nodejs.org/api/stream.html#stream_class_stream_writable} - */ - -/** - * @extends {Writable} - */ -class BaseDispatcher extends Writable { - constructor( - player, - highWaterMark = 12, - payloadType, - extensionEnabled, - streams = {}, - ) { - super({ - highWaterMark, - }); - this.streams = streams; - /** - * The Player that controls this dispatcher - * @type {MediaPlayer} - */ - this.player = player; - this.payloadType = payloadType; - this.extensionEnabled = extensionEnabled; - - this._nonce = 0; - this._nonceBuffer = null; - - /** - * The time that the stream was paused at (null if not paused) - * @type {?number} - */ - this.pausedSince = null; - this._writeCallback = null; - - this._pausedTime = 0; - this._silentPausedTime = 0; - - this.count = 0; - this.sequence = 0; - this.timestamp = 0; - - const streamError = (type, err) => { - /** - * Emitted when the dispatcher encounters an error. - * @event BaseDispatcher#error - */ - if (type && err) { - err.message = `${type} stream: ${err.message}`; - this.emit(this.player.dispatcher === this ? 'error' : 'debug', err); - } - this.destroy(); - }; - - this.on('error', () => streamError()); - if (this.streams.input) - this.streams.input.on('error', (err) => streamError('input', err)); - if (this.streams.ffmpeg) - this.streams.ffmpeg.on('error', (err) => streamError('ffmpeg', err)); - if (this.streams.opus) - this.streams.opus.on('error', (err) => streamError('opus', err)); - if (this.streams.volume) - this.streams.volume.on('error', (err) => streamError('volume', err)); - - this.on('finish', () => { - this._cleanup(); - this._setSpeaking(0); - this._setVideoStatus(false); - this._setStreamStatus(true); - }); - } - - getTypeDispatcher() { - return 'base'; - } - - resetNonceBuffer() { - this._nonceBuffer = - this.player.voiceConnection.authentication.mode === - 'aead_aes256_gcm_rtpsize' - ? Buffer.alloc(12) - : Buffer.alloc(24); - } - - getNewSequence() { - const currentSeq = this.sequence; - this.sequence++; - if (this.sequence > MAX_UINT_16) this.sequence = 0; - return currentSeq; - } - - _write(chunk, enc, done) { - if (!this.startTime) { - /** - * Emitted once the stream has started to play. - * @event BaseDispatcher#start - */ - this.emit('start'); - this.startTime = performance.now(); - } - if (this._syncDispatcher && !this._syncDispatcher.startTime) { - this.pause(); - const cb = () => { - this.resume(); - clearTimeout(timeout); - }; - this._syncDispatcher.once('start', cb); - let timeout = setTimeout(() => { - this.removeListener('start', cb); - this.resume(); - }, 10_000).unref(); - } - if (this.getTypeDispatcher() === 'video') { - this._codecCallback(chunk); - } else { - this._playChunk(chunk); - } - this._step(done); - } - - _destroy(err, cb) { - this._cleanup(); - super._destroy(err, cb); - } - - _cleanup() { - if (this.player.dispatcher === this) { - this.player.dispatcher.destroy(); - this.player.dispatcher = null; - } - if (this.player.videoDispatcher === this) { - this.player.videoDispatcher.destroy(); - this.player.videoDispatcher = null; - } - const { streams } = this; - if (streams.opus) streams.opus.destroy(); - streams.ffmpeg?.destroy(); - } - - /** - * Pauses playback - * @param {boolean} [silence=false] Whether to play silence while paused to prevent audio glitches - */ - pause(silence = false) { - if (this.paused) return; - if (this.streams.opus) this.streams.opus.unpipe(this); // Audio - if (this.streams.video) { - this.streams.ffmpeg.pause(); - this.streams.video.unpipe(this); - } - if (this.getTypeDispatcher() === 'audio') { - if (silence) { - this.streams.silence.pipe(this); - this._silence = true; - } else { - this._setSpeaking(0); - } - } - this.pausedSince = performance.now(); - } - - /** - * Whether or not playback is paused - * @type {boolean} - * @readonly - */ - get paused() { - return Boolean(this.pausedSince); - } - - /** - * Total time that this dispatcher has been paused in milliseconds - * @type {number} - * @readonly - */ - get pausedTime() { - return ( - this._silentPausedTime + - this._pausedTime + - (this.paused ? performance.now() - this.pausedSince : 0) - ); - } - - /** - * Resumes playback - */ - resume() { - if (!this.pausedSince) return; - if (this.getTypeDispatcher() === 'audio') this.streams.silence.unpipe(this); - if (this.streams.opus) this.streams.opus.pipe(this); - if (this.streams.video) { - this.streams.ffmpeg.resume(); - this.streams.video.pipe(this); - } - if (this._silence) { - this._silentPausedTime += performance.now() - this.pausedSince; - this._silence = false; - } else { - this._pausedTime += performance.now() - this.pausedSince; - } - this.pausedSince = null; - if (typeof this._writeCallback === 'function') this._writeCallback(); - } - - /** - * The time (in milliseconds) that the dispatcher has been playing audio for, taking into account skips and pauses - * @type {number} - * @readonly - */ - get totalStreamTime() { - return performance.now() - this.startTime; - } - - _step(done) { - this._writeCallback = () => { - this._writeCallback = null; - done(); - }; - const next = - (this.count + 1) * this.FRAME_LENGTH - - (performance.now() - this.startTime - this._pausedTime); - setTimeout(() => { - if ((!this.pausedSince || this._silence) && this._writeCallback) - this._writeCallback(); - }, next).unref(); - this.timestamp += this.TIMESTAMP_INC; - if (this.timestamp > MAX_UINT_32) this.timestamp = 0; - this.count++; - if (this.count > MAX_UINT_16) this.count = 0; - } - - _final(callback) { - this._writeCallback = null; - callback(); - } - - _playChunk(chunk, isLastPacket = false) { - if ( - (this.player.dispatcher !== this && - this.player.videoDispatcher !== this) || - !this.player.voiceConnection.authentication.secret_key - ) { - return; - } - const packet = this._createPacket(chunk, isLastPacket); - if (packet) this._sendPacket(packet); - } - - /** - * Creates a one-byte extension header - * https://www.rfc-editor.org/rfc/rfc5285#section-4.2 - * @returns {Buffer} - */ - createHeaderExtension() { - /** - * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | defined by profile | length | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - */ - const profile = Buffer.alloc(4); - profile[0] = 0xbe; - profile[1] = 0xde; - profile.writeInt16BE(extensions.length, 2); // Extension count - - return profile; - } - - /** - * Creates a one-byte extension header & a single extension of type playout-delay - * @see https://docs.discord.food/topics/voice-connections#sending-and-receiving-voice - * Discord expects a playout delay RTP extension header on every video packet. - * @see https://webrtc.googlesource.com/src/+/refs/heads/main/docs/native-code/rtp-hdrext/playout-delay - * @returns {Buffer} playout-delay extension - */ - createPayloadExtension() { - const extensionsData = []; - for (let ext of extensions) { - /** - * EXTENSION DATA - each extension payload is 32 bits - */ - const data = Buffer.alloc(4); - - // https://webrtc.googlesource.com/src/+/refs/heads/main/docs/native-code/rtp-hdrext/playout-delay - if (ext.id === 5) { - /** - * 0 1 2 3 4 5 6 7 - +-+-+-+-+-+-+-+-+ - | ID | len | - +-+-+-+-+-+-+-+-+ - - where len = actual length - 1 - / - data[0] = (ext.id & 0b00001111) << 4; - data[0] |= (ext.len - 1) & 0b00001111; - - /** Specific to type playout-delay - * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | MIN delay | MAX delay | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - */ - data.writeUIntBE(ext.value, 1, 2); // Not quite but its 0 anyway - } - extensionsData.push(data); - } - return Buffer.concat(extensionsData); - } - - _encrypt(buffer, additionalData) { - const { secret_key, mode } = this.player.voiceConnection.authentication; - // Both supported encryption methods want the nonce to be an incremental integer - this._nonce++; - if (this._nonce > MAX_UINT_32) this._nonce = 0; - if (!this._nonceBuffer) { - this.resetNonceBuffer(); - } - this._nonceBuffer.writeUInt32BE(this._nonce, 0); - - // 4 extra bytes of padding on the end of the encrypted packet - const noncePadding = this._nonceBuffer.slice(0, 4); - - let encrypted; - - switch (mode) { - case 'aead_aes256_gcm_rtpsize': { - const cipher = crypto.createCipheriv( - 'aes-256-gcm', - secret_key, - this._nonceBuffer, - ); - cipher.setAAD(additionalData); - - encrypted = Buffer.concat([ - cipher.update(buffer), - cipher.final(), - cipher.getAuthTag(), - ]); - - return [encrypted, noncePadding]; - } - case 'aead_xchacha20_poly1305_rtpsize': { - encrypted = - secretbox.methods.crypto_aead_xchacha20poly1305_ietf_encrypt( - buffer, - additionalData, - this._nonceBuffer, - secret_key, - ); - - return [encrypted, noncePadding]; - } - default: { - // This should never happen. Our encryption mode is chosen from a list given to us by the gateway and checked with the ones we support. - throw new RangeError(`Unsupported encryption method: ${mode}`); - } - } - } - - _createPacket(buffer, isLastPacket) { - /* - // Packet is raw rtp from ffmpeg - const rtp = webrtc.RtpPacket.deSerialize(buffer); - if (!rtp.payload) { - console.log('no payload', rtp); - return null; - } - // Header - // https://docs.discord.food/topics/voice-connections#rtp-packet-structure - let rtpHeader = buffer.slice(0, 12); // RTP_HEADER_SIZE - rtpHeader[0] = 0x80; // Version + Flags (1 byte) - rtpHeader[1] = this.payloadType; // Payload Type (1 byte) - if (this.extensionEnabled) { - rtpHeader = Buffer.concat([rtpHeader, this.createHeaderExtension()]); - rtpHeader[0] |= 1 << 4; // 0x90 - } - rtpHeader.writeUIntBE(this.getNewSequence(), 2, 2); - rtpHeader.writeUIntBE(this.timestamp, 4, 4); - rtpHeader.writeUIntBE( - this.player.voiceConnection.authentication.ssrc + Number(this.getTypeDispatcher() === 'video'), - 8, - 4, - ); - */ - // Header - let rtpHeader = Buffer.alloc(12); // RTP_HEADER_SIZE - rtpHeader[0] = 0x80; // Version + Flags (1 byte) - rtpHeader[1] = this.payloadType; // Payload Type (1 byte) - if (this.extensionEnabled) { - rtpHeader = Buffer.concat([rtpHeader, this.createHeaderExtension()]); - rtpHeader[0] |= 1 << 4; // 0x90 - } - if (this.getTypeDispatcher() === 'video' && isLastPacket) { - rtpHeader[1] |= 1 << 7; // Marker bit - } - - rtpHeader.writeUIntBE(this.getNewSequence(), 2, 2); - rtpHeader.writeUIntBE(this.timestamp, 4, 4); - rtpHeader.writeUIntBE( - this.player.voiceConnection.authentication.ssrc + - Number(this.getTypeDispatcher() === 'video'), - 8, - 4, - ); - return Buffer.concat([rtpHeader, ...this._encrypt(buffer, rtpHeader)]); - } - - _sendPacket(packet) { - /** - * Emitted whenever the dispatcher has debug information. - * @event BaseDispatcher#debug - * @param {string} info The debug info - */ - if (this.getTypeDispatcher() === 'audio') { - this._setSpeaking(this.player.isScreenSharing ? 1 << 1 : 1 << 0); // 1 << 0 = SPEAKING, 1 << 1 = SOUND SHARE - } else if (this.getTypeDispatcher() === 'video') { - this._setVideoStatus(true); - this._setStreamStatus(false); - } - if (!this.player.voiceConnection.sockets.udp) { - this.emit('debug', 'Failed to send a packet - no UDP socket'); - return; - } - this.player.voiceConnection.sockets.udp.send(packet).catch((e) => { - if (this.getTypeDispatcher() === 'audio') { - this._setSpeaking(this._setSpeaking(0)); - } else if (this.getTypeDispatcher() === 'video') { - this._setVideoStatus(false); - this._setStreamStatus(true); - } - this.emit('debug', `Failed to send a packet - ${e}`); - }); - } - - _setSpeaking(value) { - if (typeof this.player.voiceConnection !== 'undefined') { - this.player.voiceConnection.setSpeaking(value); - } - /** - * Emitted when the dispatcher starts/stops speaking. - * @event AudioDispatcher#speaking - * @param {boolean} value Whether or not the dispatcher is speaking - */ - this.emit('speaking', value); - } - - _setVideoStatus(value) { - if (typeof this.player.voiceConnection !== 'undefined') { - this.player.voiceConnection.setVideoStatus(value); - } - /** - * Emitted when the dispatcher starts/stops video. - * @event VideoDispatcher#videoStatus - * @param {boolean} value Whether or not the dispatcher is enable video - */ - this.emit('videoStatus', value); - } - - _setStreamStatus(value) { - if ( - typeof this.player.voiceConnection?.sendScreenshareState !== 'undefined' - ) { - this.player.voiceConnection.sendScreenshareState(value); - } - /** - * Emitted when the dispatcher starts/stops video. - * @event VideoDispatcher#streamStatus - * @param {boolean} isPaused Whether or not the dispatcher is pause video - */ - this.emit('streamStatus', value); - } -} - -module.exports = BaseDispatcher; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/dispatcher/VPxDispatcher.js b/vendor/discord.js-selfbot-v13/src/client/voice/dispatcher/VPxDispatcher.js deleted file mode 100644 index 789dd20..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/dispatcher/VPxDispatcher.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -/* -Credit: https://github.com/dank074/Discord-video-stream -The use of video streaming in this library is an incomplete implementation with many bugs, primarily aimed at lazy users. -The video streaming features in this library are sourced from https://github.com/dank074/Discord-video-stream. - -Please use the @dank074/discord-video-stream library to access all advanced and professional features, -along with comprehensive support. I will not actively fix bugs related to streaming and encourage everyone to -use https://github.com/dank074/Discord-video-stream for stable and smooth streaming. - -To reiterate: This is an incomplete implementation of the library https://github.com/dank074/Discord-video-stream. - -Thanks to dank074 and longnguyen2004 for implementing new codecs (H264, H265). -Thanks to mrjvs for discovering how Discord transmits data and the VP8 codec. - -Please use the @dank074/discord-video-stream library for the best support. -*/ - -const { Buffer } = require('node:buffer'); -const VideoDispatcher = require('./VideoDispatcher'); -const Util = require('../../../util/Util'); - -class VP8Dispatcher extends VideoDispatcher { - constructor(player, highWaterMark = 12, streams, fps) { - super(player, highWaterMark, streams, fps, Util.getPayloadType('VP8')); - } - - makeChunk(buffer, isFirstPacket) { - // Vp8 payload descriptor - const payloadDescriptorBuf = Buffer.alloc(2); - payloadDescriptorBuf[0] = 0x80; - payloadDescriptorBuf[1] = 0x80; - if (isFirstPacket) { - payloadDescriptorBuf[0] |= 1 << 4; // Mark S bit, indicates start of frame - } - // Vp8 pictureid payload extension - const pictureIdBuf = Buffer.alloc(2); - pictureIdBuf.writeUintBE(this.count, 0, 2); - pictureIdBuf[0] |= 0x80; - return Buffer.concat([ - this.createPayloadExtension(), - payloadDescriptorBuf, - pictureIdBuf, - buffer, - ]); - } - - _codecCallback(chunk) { - const chunkSplit = this.partitionMtu(chunk).map((c, i) => - this.makeChunk(c, i === 0), - ); - for (let i = 0; i < chunkSplit.length; i++) { - this._playChunk(chunkSplit[i], i + 1 === chunkSplit.length); - } - } -} - -module.exports = { - VP8Dispatcher, -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/dispatcher/VideoDispatcher.js b/vendor/discord.js-selfbot-v13/src/client/voice/dispatcher/VideoDispatcher.js deleted file mode 100644 index 5607e60..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/dispatcher/VideoDispatcher.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -const BaseDispatcher = require('./BaseDispatcher'); - -/** - * The class that sends video packet data to the voice connection. - * ```js - * // Obtained using: - * client.voice.joinChannel(channel).then(connection => { - * // You can play a file or a stream here: - * const dispatcher = connection.playVideo('/home/hydrabolt/video.mp4', { fps: 60, preset: 'ultrafast' }); - * }); - * ``` - * @extends {BaseDispatcher} - */ -class VideoDispatcher extends BaseDispatcher { - constructor(player, highWaterMark = 12, streams, fps, payloadType) { - super(player, highWaterMark, payloadType, true, streams); - /** - * Video FPS - * @type {number} - */ - this.fps = fps; - - this.mtu = 1200; - } - - get TIMESTAMP_INC() { - return 90000 / this.fps; - } - - get FRAME_LENGTH() { - return 1000 / this.fps; - } - - /** - * Get the type of the dispatcher - * @returns {'video'} - */ - getTypeDispatcher() { - return 'video'; - } - - partitionMtu(data) { - const out = []; - const dataLength = data.length; - - for (let i = 0; i < dataLength; i += this.mtu) { - out.push(data.slice(i, i + this.mtu)); - } - - return out; - } - - /** - * Set FPS - * @param {number} value fps - */ - setFPSSource(value) { - this.fps = value; - } - - _codecCallback() { - throw new Error('The _codecCallback method must be implemented'); - } -} - -module.exports = VideoDispatcher; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/networking/VoiceUDPClient.js b/vendor/discord.js-selfbot-v13/src/client/voice/networking/VoiceUDPClient.js deleted file mode 100644 index 71e3e04..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/networking/VoiceUDPClient.js +++ /dev/null @@ -1,186 +0,0 @@ -'use strict'; - -const udp = require('dgram'); -const EventEmitter = require('events'); -const { isIP } = require('net'); -const { Buffer } = require('node:buffer'); -const { Error } = require('../../../errors'); -const { VoiceOpcodes } = require('../../../util/Constants'); -const Util = require('../../../util/Util'); - -/** - * Represents a UDP client for a Voice Connection. - * @extends {EventEmitter} - * @private - */ -class VoiceConnectionUDPClient extends EventEmitter { - constructor(voiceConnection) { - super(); - - /** - * The voice connection that this UDP client serves - * @type {VoiceConnection} - */ - this.voiceConnection = voiceConnection; - - /** - * The UDP socket - * @type {?Socket} - */ - this.socket = null; - - /** - * The address of the Discord voice server - * @type {?string} - */ - this.discordAddress = null; - - /** - * The local IP address - * @type {?string} - */ - this.localAddress = null; - - /** - * The local port - * @type {?string} - */ - this.localPort = null; - - this.voiceConnection.on('closing', this.shutdown.bind(this)); - } - - shutdown() { - this.emit('debug', `[UDP] shutdown requested`); - if (this.socket) { - this.socket.removeAllListeners('message'); - try { - this.socket.close(); - } finally { - this.socket = null; - } - } - } - - /** - * The port of the Discord voice server - * @type {number} - * @readonly - */ - get discordPort() { - return this.voiceConnection.authentication.port; - } - - /** - * Send a packet to the UDP client. - * @param {Object} packet The packet to send - * @returns {Promise} - */ - send(packet) { - return new Promise((resolve, reject) => { - if (!this.socket) throw new Error('UDP_SEND_FAIL'); - if (!this.discordAddress || !this.discordPort) - throw new Error('UDP_ADDRESS_MALFORMED'); - this.socket.send( - packet, - 0, - packet.length, - this.discordPort, - this.discordAddress, - (error) => { - if (error) { - this.emit('debug', `[UDP] >> ERROR: ${error}`); - reject(error); - } else { - resolve(packet); - } - }, - ); - }); - } - - async createUDPSocket(address) { - this.discordAddress = address; - const socket = (this.socket = udp.createSocket('udp4')); - socket.on('error', (e) => { - this.emit('debug', `[UDP] Error: ${e}`); - this.emit('error', e); - }); - socket.on('close', () => { - this.emit('debug', '[UDP] socket closed'); - }); - this.emit('debug', `[UDP] created socket`); - socket.once('message', (message) => { - this.emit('debug', `[UDP] message: [${[...message]}] (${message})`); - if (message.readUInt16BE(0) !== 2) { - throw new Error('UDP_WRONG_HANDSHAKE'); - } - // Stop if the sockets have been deleted because the connection has been closed already - if (!this.voiceConnection.sockets.ws) return; - - const packet = parseLocalPacket(message); - if (packet.error) { - this.emit('debug', `[UDP] ERROR: ${packet.error}`); - this.emit('error', packet.error); - return; - } - - this.emit( - 'debug', - `[UDP] Parse local packet: ${packet.address}:${packet.port}`, - ); - - this.localAddress = packet.address; - this.localPort = packet.port; - - this.voiceConnection.sockets.ws.sendPacket({ - op: VoiceOpcodes.SELECT_PROTOCOL, - d: { - protocol: 'udp', - codecs: Util.getAllPayloadType(), - data: { - address: packet.address, - port: packet.port, - mode: this.voiceConnection.authentication.mode, - }, - }, - }); - - // Write = false - Object.defineProperty(this.voiceConnection, 'videoCodec', { - value: this.voiceConnection.videoCodec, - writable: false, - }); - - this.emit('debug', `[UDP] << ${JSON.stringify(packet)}`); - - socket.on('message', (buffer) => - this.voiceConnection.receiver.packets.push(buffer), - ); - }); - - const blankMessage = Buffer.alloc(74); - blankMessage.writeUInt16BE(1, 0); - blankMessage.writeUInt16BE(70, 2); - blankMessage.writeUInt32BE(this.voiceConnection.authentication.ssrc, 4); - this.emit('debug', `Sending IP discovery packet: [${[...blankMessage]}]`); - await this.send(blankMessage); - this.emit('debug', `Successfully sent IP discovery packet`); - } -} - -function parseLocalPacket(message) { - try { - const packet = Buffer.from(message); - const address = packet.subarray(8, packet.indexOf(0, 8)).toString('utf8'); - if (!isIP(address)) { - throw new Error('UDP_ADDRESS_MALFORMED'); - } - const port = packet.readUInt16BE(packet.length - 2); - return { address, port }; - } catch (error) { - return { error }; - } -} - -module.exports = VoiceConnectionUDPClient; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/networking/VoiceWebSocket.js b/vendor/discord.js-selfbot-v13/src/client/voice/networking/VoiceWebSocket.js deleted file mode 100644 index 15e424f..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/networking/VoiceWebSocket.js +++ /dev/null @@ -1,314 +0,0 @@ -'use strict'; - -const EventEmitter = require('events'); -const { setTimeout, setInterval } = require('node:timers'); -const WebSocket = require('../../../WebSocket'); -const { Error } = require('../../../errors'); -const { Opcodes, VoiceOpcodes } = require('../../../util/Constants'); - -/** - * Represents a Voice Connection's WebSocket. - * @extends {EventEmitter} - * @private - */ -class VoiceWebSocket extends EventEmitter { - constructor(connection) { - super(); - /** - * The Voice Connection that this WebSocket serves - * @type {VoiceConnection} - */ - this.connection = connection; - - /** - * How many connection attempts have been made - * @type {number} - */ - this.attempts = 0; - - this._sequenceNumber = -1; - - this.dead = false; - this.connection.on('closing', this.shutdown.bind(this)); - } - - /** - * The client of this voice WebSocket - * @type {Client} - * @readonly - */ - get client() { - return this.connection.client; - } - - shutdown() { - this.emit('debug', `[WS] shutdown requested`); - this.dead = true; - this.reset(); - } - - /** - * Resets the current WebSocket. - */ - reset() { - this.emit('debug', `[WS] reset requested`); - if (this.ws) { - if (this.ws.readyState !== WebSocket.CLOSED) this.ws.close(); - this.ws = null; - } - this.clearHeartbeat(); - } - - /** - * Starts connecting to the Voice WebSocket Server. - */ - connect() { - this.emit('debug', `[WS] connect requested`); - if (this.dead) return; - if (this.ws) this.reset(); - if (this.attempts >= 5) { - this.emit( - 'debug', - new Error('VOICE_CONNECTION_ATTEMPTS_EXCEEDED', this.attempts), - ); - return; - } - - this.attempts++; - - /** - * The actual WebSocket used to connect to the Voice WebSocket Server. - * @type {WebSocket} - */ - this.ws = WebSocket.create( - `wss://${this.connection.authentication.endpoint}/`, - { v: 8 }, - ); - this.emit( - 'debug', - `[WS] connecting, ${this.attempts} attempts, ${this.ws.url}`, - ); - this.ws.onopen = this.onOpen.bind(this); - this.ws.onmessage = this.onMessage.bind(this); - this.ws.onclose = this.onClose.bind(this); - this.ws.onerror = this.onError.bind(this); - } - - /** - * Sends data to the WebSocket if it is open. - * @param {string} data The data to send to the WebSocket - * @returns {Promise} - */ - send(data) { - this.emit('debug', `[WS] >> ${data}`); - return new Promise((resolve, reject) => { - if (!this.ws || this.ws.readyState !== WebSocket.OPEN) - throw new Error('WS_NOT_OPEN', data); - this.ws.send(data, null, (error) => { - if (error) reject(error); - else resolve(data); - }); - }); - } - - /** - * JSON.stringify's a packet and then sends it to the WebSocket Server. - * @param {Object} packet The packet to send - * @returns {Promise} - */ - async sendPacket(packet) { - packet = JSON.stringify(packet); - return this.send(packet); - } - - /** - * Called whenever the WebSocket opens. - */ - onOpen() { - this.emit( - 'debug', - `[WS] opened at gateway ${this.connection.authentication.endpoint}`, - ); - this.sendPacket({ - op: Opcodes.DISPATCH, - d: { - server_id: - this.connection.serverId || - this.connection.channel.guild?.id || - this.connection.channel.id, - user_id: this.client.user.id, - token: this.connection.authentication.token, - session_id: this.connection.authentication.sessionId, - streams: [{ type: 'screen', rid: '100', quality: 100 }], - video: true, - }, - }).catch(() => { - this.emit('error', new Error('VOICE_JOIN_SOCKET_CLOSED')); - }); - } - - /** - * Called whenever a message is received from the WebSocket. - * @param {MessageEvent} event The message event that was received - * @returns {void} - */ - onMessage(event) { - try { - return this.onPacket(WebSocket.unpack(event.data, 'json')); - } catch (error) { - return this.onError(error); - } - } - - /** - * Called whenever the connection to the WebSocket server is lost. - * @param {CloseEvent} event The WebSocket close event - */ - onClose(event) { - this.emit( - 'debug', - `[WS] closed with code ${event.code} and reason: ${event.reason}`, - ); - if (!this.dead) - setTimeout(this.connect.bind(this), this.attempts * 1000).unref(); - } - - /** - * Called whenever an error occurs with the WebSocket. - * @param {Error} error The error that occurred - */ - onError(error) { - this.emit('debug', `[WS] Error: ${error}`); - this.emit('error', error); - } - - /** - * Called whenever a valid packet is received from the WebSocket. - * @param {Object} packet The received packet - */ - onPacket(packet) { - this.emit('debug', `[WS] << ${JSON.stringify(packet)}`); - if (packet.seq) this._sequenceNumber = packet.seq; - switch (packet.op) { - case VoiceOpcodes.HELLO: - this.setHeartbeat(packet.d.heartbeat_interval); - break; - case VoiceOpcodes.READY: - /** - * Emitted once the voice WebSocket receives the ready packet. - * @param {Object} packet The received packet - * @event VoiceWebSocket#ready - */ - this.emit('ready', packet.d); - this.connection.setVideoStatus(false); - break; - /* eslint-disable no-case-declarations */ - case VoiceOpcodes.SESSION_DESCRIPTION: - packet.d.secret_key = new Uint8Array(packet.d.secret_key); - /** - * Emitted once the Voice Websocket receives a description of this voice session. - * @param {Object} packet The received packet - * @event VoiceWebSocket#sessionDescription - */ - this.emit('sessionDescription', packet.d); - break; - case VoiceOpcodes.CLIENT_CONNECT: - this.connection.ssrcMap.set(+packet.d.audio_ssrc, { - userId: packet.d.user_id, - speaking: 0, - hasVideo: Boolean(packet.d.video_ssrc), - }); - break; - case VoiceOpcodes.CLIENT_DISCONNECT: - const streamInfo = - this.connection.receiver && - this.connection.receiver.packets.streams.get(packet.d.user_id); - if (streamInfo) { - this.connection.receiver.packets.streams.delete(packet.d.user_id); - streamInfo.stream.push(null); - } - break; - case VoiceOpcodes.SPEAKING: - /** - * Emitted whenever a speaking packet is received. - * @param {Object} data - * @event VoiceWebSocket#startSpeaking - */ - this.emit('startSpeaking', packet.d); - break; - case VoiceOpcodes.SOURCES: - /** - * Emitted whenever a streaming packet is received. - * @param {Object} data - * @event VoiceWebSocket#startStreaming - */ - this.emit('startStreaming', packet.d); - break; - default: - /** - * Emitted when an unhandled packet is received. - * @param {Object} packet - * @event VoiceWebSocket#unknownPacket - */ - this.emit('unknownPacket', packet); - break; - } - } - - /** - * Sets an interval at which to send a heartbeat packet to the WebSocket. - * @param {number} interval The interval at which to send a heartbeat packet - */ - setHeartbeat(interval) { - if (!interval || isNaN(interval)) { - this.onError(new Error('VOICE_INVALID_HEARTBEAT')); - return; - } - if (this.heartbeatInterval) { - /** - * Emitted whenever the voice WebSocket encounters a non-fatal error. - * @param {string} warn The warning - * @event VoiceWebSocket#warn - */ - this.emit('warn', 'A voice heartbeat interval is being overwritten'); - clearInterval(this.heartbeatInterval); - } - this.heartbeatInterval = setInterval( - this.sendHeartbeat.bind(this), - interval, - ).unref(); - } - - /** - * Clears a heartbeat interval, if one exists. - */ - clearHeartbeat() { - if (!this.heartbeatInterval) { - this.emit( - 'warn', - 'Tried to clear a heartbeat interval that does not exist', - ); - return; - } - clearInterval(this.heartbeatInterval); - this.heartbeatInterval = null; - } - - /** - * Sends a heartbeat packet. - */ - sendHeartbeat() { - this.sendPacket({ - op: VoiceOpcodes.HEARTBEAT, - d: { - t: Date.now(), - seq_ack: this._sequenceNumber, - }, - }).catch(() => { - this.emit('warn', 'Tried to send heartbeat, but connection is not open'); - this.clearHeartbeat(); - }); - } -} - -module.exports = VoiceWebSocket; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/player/MediaPlayer.js b/vendor/discord.js-selfbot-v13/src/client/voice/player/MediaPlayer.js deleted file mode 100644 index cab2c51..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/player/MediaPlayer.js +++ /dev/null @@ -1,366 +0,0 @@ -'use strict'; - -/* -Credit: https://github.com/dank074/Discord-video-stream -The use of video streaming in this library is an incomplete implementation with many bugs, primarily aimed at lazy users. -The video streaming features in this library are sourced from https://github.com/dank074/Discord-video-stream. - -Please use the @dank074/discord-video-stream library to access all advanced and professional features, -along with comprehensive support. I will not actively fix bugs related to streaming and encourage everyone to -use https://github.com/dank074/Discord-video-stream for stable and smooth streaming. - -To reiterate: This is an incomplete implementation of the library https://github.com/dank074/Discord-video-stream. - -Thanks to dank074 and longnguyen2004 for implementing new codecs (H264, H265). -Thanks to mrjvs for discovering how Discord transmits data and the VP8 codec. - -Please use the @dank074/discord-video-stream library for the best support. -*/ - -const EventEmitter = require('events'); -const { Readable: ReadableStream } = require('stream'); -const prism = require('prism-media'); -const { - H264NalSplitter, - H265NalSplitter, -} = require('./processing/AnnexBNalSplitter'); -const { IvfTransformer } = require('./processing/IvfSplitter'); -const { H264Dispatcher } = require('../dispatcher/AnnexBDispatcher'); -const AudioDispatcher = require('../dispatcher/AudioDispatcher'); -const { VP8Dispatcher } = require('../dispatcher/VPxDispatcher'); - -const FFMPEG_OUTPUT_PREFIX = [ - '-use_wallclock_as_timestamps', - '1', - '-copyts', - '-analyzeduration', - '0', -]; -const FFMPEG_INPUT_PREFIX = [ - '-reconnect', - '1', - '-reconnect_at_eof', - '1', - '-reconnect_streamed', - '1', - '-reconnect_delay_max', - '4294', -]; -const FFMPEG_PCM_ARGUMENTS = ['-f', 's16le', '-ar', '48000', '-ac', '2']; -const FFMPEG_VP8_ARGUMENTS = [ - '-f', - 'ivf', - '-deadline', - 'realtime', - '-c:v', - 'libvpx', -]; -const FFMPEG_H264_ARGUMENTS = (options) => [ - '-c:v', - 'libx264', - '-f', - 'h264', - '-tune', - 'zerolatency', - // '-pix_fmt', - // 'yuv420p', - '-preset', - options?.presetH26x || 'faster', - '-profile:v', - 'baseline', - // '-g', - // `${options?.fps}`, - // '-x264-params', - // `keyint=${options?.fps}:min-keyint=${options?.fps}`, - '-bf', - '0', - '-bsf:v', - 'h264_metadata=aud=insert', -]; - -const FFMPEG_H265_ARGUMENTS = (options) => [ - '-c:v', - 'libx265', - '-f', - 'hevc', - '-preset', - options?.presetH265 || 'faster', - '-profile:v', - 'main', - '-bf', - '0', -]; - -/** - * Player for a Voice Connection. - * @private - * @extends {EventEmitter} - */ -class MediaPlayer extends EventEmitter { - constructor(voiceConnection, isScreenSharing) { - super(); - - this.dispatcher = null; - - this.videoDispatcher = null; - /** - * The voice connection that the player serves - * @type {VoiceConnection} - */ - this.voiceConnection = voiceConnection; - - this.isScreenSharing = isScreenSharing; - } - - destroy() { - this.destroyDispatcher(); - this.destroyVideoDispatcher(); - } - - destroyDispatcher() { - if (this.dispatcher) { - this.dispatcher.destroy(); - this.dispatcher = null; - } - } - - destroyVideoDispatcher() { - if (this.videoDispatcher) { - this.videoDispatcher.destroy(); - this.videoDispatcher = null; - } - } - - playUnknown(input, options, streams = {}) { - this.destroyDispatcher(); - const isStream = input instanceof ReadableStream; - const args = [...FFMPEG_OUTPUT_PREFIX, ...FFMPEG_PCM_ARGUMENTS]; - if (!isStream) args.unshift('-i', input); - if (options.seek) args.unshift('-ss', String(options.seek)); - // Check input - if (typeof input == 'string' && input.startsWith('http')) { - args.unshift(...FFMPEG_INPUT_PREFIX); - } - if (options?.inputFFmpegArgs) { - args.unshift(...options.inputFFmpegArgs); - } - - const ffmpeg = new prism.FFmpeg({ args }); - this.emit( - 'debug', - `[ffmpeg-audio_process] Spawn process with args:\n${args.join(' ')}`, - ); - - ffmpeg.process.stderr.on('data', (data) => { - this.emit('debug', `[ffmpeg-audio_process]: ${data.toString()}`); - }); - - streams.ffmpeg = ffmpeg; - if (isStream) { - streams.input = input; - input.pipe(ffmpeg); - } - return this.playPCMStream(ffmpeg, options, streams); - } - - playPCMStream(stream, options, streams = {}) { - this.destroyDispatcher(); - const opus = (streams.opus = new prism.opus.Encoder({ - channels: 2, - rate: 48000, - frameSize: 960, - })); - if (options && options.volume === false) { - stream.pipe(opus); - return this.playOpusStream(opus, options, streams); - } - streams.volume = new prism.VolumeTransformer({ - type: 's16le', - volume: options ? options.volume : 1, - }); - stream.pipe(streams.volume).pipe(opus); - return this.playOpusStream(opus, options, streams); - } - - playOpusStream(stream, options, streams = {}) { - this.destroyDispatcher(); - streams.opus = stream; - if (options.volume !== false && !streams.input) { - streams.input = stream; - const decoder = new prism.opus.Decoder({ - channels: 2, - rate: 48000, - frameSize: 960, - }); - streams.volume = new prism.VolumeTransformer({ - type: 's16le', - volume: options ? options.volume : 1, - }); - streams.opus = stream - .pipe(decoder) - .pipe(streams.volume) - .pipe( - new prism.opus.Encoder({ channels: 2, rate: 48000, frameSize: 960 }), - ); - } - const dispatcher = this.createDispatcher(options, streams); - streams.opus.pipe(dispatcher); - return dispatcher; - } - - playUnknownVideo(input, options = {}) { - this.destroyVideoDispatcher(); - const isStream = input instanceof ReadableStream; - if (!options?.fps) options.fps = 30; - - const args = [ - '-i', - isStream ? '-' : input, - ...FFMPEG_OUTPUT_PREFIX, - '-flags', - 'low_delay', - '-r', - `${options?.fps}`, - ]; - - if (options?.bitrate && typeof options?.bitrate === 'number') { - args.push('-b:v', `${options?.bitrate}K`); - } - - if (options?.hwAccel === true) { - args.unshift('-hwaccel', 'auto'); - } - - if (options.seek) args.unshift('-ss', String(options.seek)); - - // Check input - if (typeof input == 'string' && input.startsWith('http')) { - args.unshift(...FFMPEG_INPUT_PREFIX); - } - - // Get stream type - if (this.voiceConnection.videoCodec === 'VP8') { - args.push(...FFMPEG_VP8_ARGUMENTS); - // Remove '-speed', '5' bc bad quality - } - - if (this.voiceConnection.videoCodec === 'H264') { - args.push(...FFMPEG_H264_ARGUMENTS(options)); - } - - if (this.voiceConnection.videoCodec === 'H265') { - args.push(...FFMPEG_H265_ARGUMENTS(options)); - } - - args.push('-force_key_frames', '00:02'); - - if (options?.inputFFmpegArgs) { - args.unshift(...options.inputFFmpegArgs); - } - - if (options?.outputFFmpegArgs) { - args.push(...options.outputFFmpegArgs); - } - - const ffmpeg = new prism.FFmpeg({ args }); - const streams = { ffmpeg }; - - if (isStream) { - streams.input = input; - input.pipe(ffmpeg); - } - - this.emit( - 'debug', - `[ffmpeg-video_process] Spawn process with args:\n${args.join(' ')}`, - ); - - ffmpeg.process.stderr.on('data', (data) => { - this.emit('debug', `[ffmpeg-video_process]: ${data.toString()}`); - }); - - switch (this.voiceConnection.videoCodec) { - case 'VP8': { - return this.playIvfVideo(ffmpeg, options, streams); - } - case 'H264': { - return this.playAnnexBVideo(ffmpeg, options, streams, 'H264'); - } - default: { - throw new Error('Invalid codec (Supported: VP8, H264)'); - } - } - } - - playIvfVideo(stream, options, streams) { - this.destroyVideoDispatcher(); - const videoStream = new IvfTransformer(); - stream.pipe(videoStream); - streams.video = videoStream; - const dispatcher = this.createVideoDispatcher(options, streams); - videoStream.pipe(dispatcher); - return dispatcher; - } - - // eslint-disable-next-line no-unused-vars - playAnnexBVideo(stream, options, streams, type) { - this.destroyVideoDispatcher(); - let videoStream; - if (type === 'H264') { - videoStream = new H264NalSplitter(); - } else if (type === 'H265') { - videoStream = new H265NalSplitter(); - } - stream.pipe(videoStream); - streams.video = videoStream; - const dispatcher = this.createVideoDispatcher(options, streams); - videoStream.pipe(dispatcher); - return dispatcher; - } - - createDispatcher(options, streams) { - this.destroyDispatcher(); - const dispatcher = (this.dispatcher = new AudioDispatcher( - this, - options, - streams, - )); - return dispatcher; - } - - /** - * Create - * @private - * @param {Object} options any - * @param {Object} streams any - * @returns {VideoDispatcher} - */ - createVideoDispatcher(options, streams) { - this.destroyVideoDispatcher(); - switch (this.voiceConnection.videoCodec) { - case 'VP8': { - const dispatcher = (this.videoDispatcher = new VP8Dispatcher( - this, - options?.highWaterMark, - streams, - options?.fps, - )); - return dispatcher; - } - case 'H264': { - const dispatcher = (this.videoDispatcher = new H264Dispatcher( - this, - options?.highWaterMark, - streams, - options?.fps, - )); - return dispatcher; - } - default: { - throw new Error('Invalid codec'); - } - } - } -} - -module.exports = MediaPlayer; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/player/processing/AnnexBNalSplitter.js b/vendor/discord.js-selfbot-v13/src/client/voice/player/processing/AnnexBNalSplitter.js deleted file mode 100644 index e85192f..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/player/processing/AnnexBNalSplitter.js +++ /dev/null @@ -1,252 +0,0 @@ -'use strict'; - -/* -Credit: https://github.com/dank074/Discord-video-stream -The use of video streaming in this library is an incomplete implementation with many bugs, primarily aimed at lazy users. -The video streaming features in this library are sourced from https://github.com/dank074/Discord-video-stream. - -Please use the @dank074/discord-video-stream library to access all advanced and professional features, -along with comprehensive support. I will not actively fix bugs related to streaming and encourage everyone to -use https://github.com/dank074/Discord-video-stream for stable and smooth streaming. - -To reiterate: This is an incomplete implementation of the library https://github.com/dank074/Discord-video-stream. - -Thanks to dank074 and longnguyen2004 for implementing new codecs (H264, H265). -Thanks to mrjvs for discovering how Discord transmits data and the VP8 codec. - -Please use the @dank074/discord-video-stream library for the best support. -*/ - -const { Buffer } = require('buffer'); -const { Transform } = require('stream'); - -const H264NalUnitTypes = { - Unspecified: 0, - CodedSliceNonIDR: 1, - CodedSlicePartitionA: 2, - CodedSlicePartitionB: 3, - CodedSlicePartitionC: 4, - CodedSliceIdr: 5, - SEI: 6, - SPS: 7, - PPS: 8, - AccessUnitDelimiter: 9, - EndOfSequence: 10, - EndOfStream: 11, - FillerData: 12, - SEIExtenstion: 13, - PrefixNalUnit: 14, - SubsetSPS: 15, -}; - -const H265NalUnitTypes = { - TRAIL_N: 0, - TRAIL_R: 1, - TSA_N: 2, - TSA_R: 3, - STSA_N: 4, - STSA_R: 5, - RADL_N: 6, - RADL_R: 7, - RASL_N: 8, - RASL_R: 9, - RSV_VCL_N10: 10, - RSV_VCL_R11: 11, - RSV_VCL_N12: 12, - RSV_VCL_R13: 13, - RSV_VCL_N14: 14, - RSV_VCL_R15: 15, - BLA_W_LP: 16, - BLA_W_RADL: 17, - BLA_N_LP: 18, - IDR_W_RADL: 19, - IDR_N_LP: 20, - CRA_NUT: 21, - RSV_IRAP_VCL22: 22, - RSV_IRAP_VCL23: 23, - RSV_VCL24: 24, - RSV_VCL25: 25, - RSV_VCL26: 26, - RSV_VCL27: 27, - RSV_VCL28: 28, - RSV_VCL29: 29, - RSV_VCL30: 30, - RSV_VCL31: 31, - VPS_NUT: 32, - SPS_NUT: 33, - PPS_NUT: 34, - AUD_NUT: 35, - EOS_NUT: 36, - EOB_NUT: 37, - FD_NUT: 38, - PREFIX_SEI_NUT: 39, - SUFFIX_SEI_NUT: 40, - RSV_NVCL41: 41, - RSV_NVCL42: 42, - RSV_NVCL43: 43, - RSV_NVCL44: 44, - RSV_NVCL45: 45, - RSV_NVCL46: 46, - RSV_NVCL47: 47, - UNSPEC48: 48, - UNSPEC49: 49, - UNSPEC50: 50, - UNSPEC51: 51, - UNSPEC52: 52, - UNSPEC53: 53, - UNSPEC54: 54, - UNSPEC55: 55, - UNSPEC56: 56, - UNSPEC57: 57, - UNSPEC58: 58, - UNSPEC59: 59, - UNSPEC60: 60, - UNSPEC61: 61, - UNSPEC62: 62, - UNSPEC63: 63, -}; - -const H264Helpers = { - getUnitType(frame) { - return frame[0] & 0x1f; - }, - splitHeader(frame) { - return [frame.subarray(0, 1), frame.subarray(1)]; - }, - isAUD(unitType) { - return unitType === H264NalUnitTypes.AccessUnitDelimiter; - }, -}; - -const H265Helpers = { - getUnitType(frame) { - return (frame[0] >> 1) & 0x3f; - }, - splitHeader(frame) { - return [frame.subarray(0, 2), frame.subarray(2)]; - }, - isAUD(unitType) { - return unitType === H265NalUnitTypes.AUD_NUT; - }, -}; - -const emptyBuffer = Buffer.allocUnsafe(0); -const epbPrefix = Buffer.from([0x00, 0x00, 0x03]); -const nalSuffix = Buffer.from([0x00, 0x00, 0x01]); - -class AnnexBNalSplitter extends Transform { - constructor(nalFunctions) { - super(); - this._buffer = null; - this._accessUnit = []; - this._nalFunctions = nalFunctions; - } - - rbsp(data) { - const newData = Buffer.allocUnsafe(data.length); - let newLength = 0; - - // eslint-disable-next-line no-constant-condition - while (true) { - const epbsPos = data.indexOf(epbPrefix); - if (epbsPos === -1) { - data.copy(newData, newLength); - newLength += data.length; - break; - } - const copyRange = data[epbsPos + 3] <= 0x03 ? epbsPos + 2 : epbsPos + 3; - data.copy(newData, newLength, 0, copyRange); - newLength += copyRange; - data = data.subarray(epbsPos + 3); - } - - return newData.subarray(0, newLength); - } - - findNalStart(buf) { - const pos = buf.indexOf(nalSuffix); - if (pos === -1) return null; - return pos > 0 && buf[pos - 1] === 0 - ? { index: pos - 1, length: 4 } - : { index: pos, length: 3 }; - } - - processFrame(frame) { - if (frame.length === 0) return; - - const unitType = this._nalFunctions.getUnitType(frame); - if (this._nalFunctions.isAUD(unitType) && this._accessUnit.length > 0) { - const sizeOfAccessUnit = this._accessUnit.reduce( - (acc, nalu) => acc + nalu.length + 4, - 0, - ); - const accessUnitBuf = Buffer.allocUnsafe(sizeOfAccessUnit); - - let offset = 0; - this._accessUnit.forEach((nalu) => { - accessUnitBuf.writeUint32BE(nalu.length, offset); - offset += 4; - nalu.copy(accessUnitBuf, offset); - offset += nalu.length; - }); - - this.push(accessUnitBuf); - this._accessUnit = []; - } else { - this._accessUnit.push(this.removeEpbs(frame, unitType)); - } - } - - _transform(chunk, encoding, callback) { - let nalStart = this.findNalStart(chunk); - if (!this._buffer) { - if (!nalStart) { - callback(); - return; - } - chunk = chunk.subarray(nalStart.index + nalStart.length); - this._buffer = emptyBuffer; - } - - chunk = Buffer.concat([this._buffer, chunk]); - while ((nalStart = this.findNalStart(chunk))) { - const frame = chunk.subarray(0, nalStart.index); - this.processFrame(frame); - chunk = chunk.subarray(nalStart.index + nalStart.length); - } - this._buffer = chunk; - callback(); - } -} - -class H264NalSplitter extends AnnexBNalSplitter { - constructor() { - super(H264Helpers); - } - - removeEpbs(frame, unitType) { - return unitType === H264NalUnitTypes.SPS || - unitType === H264NalUnitTypes.SEI - ? this.rbsp(frame) - : frame; - } -} - -class H265NalSplitter extends AnnexBNalSplitter { - constructor() { - super(H265Helpers); - } - - removeEpbs(frame) { - return frame; // No specific processing for H265 - } -} - -module.exports = { - H264NalUnitTypes, - H265NalUnitTypes, - H264Helpers, - H265Helpers, - H264NalSplitter, - H265NalSplitter, -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/player/processing/IvfSplitter.js b/vendor/discord.js-selfbot-v13/src/client/voice/player/processing/IvfSplitter.js deleted file mode 100644 index ef9f295..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/player/processing/IvfSplitter.js +++ /dev/null @@ -1,108 +0,0 @@ -'use strict'; - -/* -Credit: https://github.com/dank074/Discord-video-stream -The use of video streaming in this library is an incomplete implementation with many bugs, primarily aimed at lazy users. -The video streaming features in this library are sourced from https://github.com/dank074/Discord-video-stream. - -Please use the @dank074/discord-video-stream library to access all advanced and professional features, -along with comprehensive support. I will not actively fix bugs related to streaming and encourage everyone to -use https://github.com/dank074/Discord-video-stream for stable and smooth streaming. - -To reiterate: This is an incomplete implementation of the library https://github.com/dank074/Discord-video-stream. - -Thanks to dank074 and longnguyen2004 for implementing new codecs (H264, H265). -Thanks to mrjvs for discovering how Discord transmits data and the VP8 codec. - -Please use the @dank074/discord-video-stream library for the best support. -*/ - -const { Buffer } = require('buffer'); -const { Transform } = require('stream'); - -class IvfTransformer extends Transform { - constructor(options) { - super(options); - this.headerSize = 32; - this.frameHeaderSize = 12; - - this.header = null; - this.buf = null; - this.retFullFrame = - options && options.fullframe ? options.fullframe : false; - } - - _parseHeader(header) { - this.header = { - signature: header.subarray(0, 4).toString(), - version: header.readUIntLE(4, 2), - headerLength: header.readUIntLE(6, 2), - codec: header.subarray(8, 12).toString(), - width: header.readUIntLE(12, 2), - height: header.readUIntLE(14, 2), - timeDenominator: header.readUIntLE(16, 4), - timeNumerator: header.readUIntLE(20, 4), - frameCount: header.readUIntLE(24, 4), - }; - } - - _getFrameSize(buf) { - return buf.readUIntLE(0, 4); - } - - _parseFrame(frame) { - const size = this._getFrameSize(frame); - - if (this.retFullFrame) return this.push(frame.subarray(0, 12 + size)); - - const out = { - size: size, - timestamp: frame.readBigUInt64LE(4), - data: frame.subarray(12, 12 + size), - }; - - return this.push(out.data); - } - - _appendChunkToBuf(chunk) { - if (this.buf) this.buf = Buffer.concat([this.buf, chunk]); - else this.buf = chunk; - } - - _updateBufLen(size) { - if (this.buf.length > size) - this.buf = this.buf.subarray(size, this.buf.length); - else this.buf = null; - } - - _transform(chunk, encoding, callback) { - this._appendChunkToBuf(chunk); - - if (!this.header) { - if (this.buf.length >= this.headerSize) { - this._parseHeader(this.buf.subarray(0, this.headerSize)); - this._updateBufLen(this.headerSize); - } else { - callback(); - return; - } - } - - while (this.buf && this.buf.length >= this.frameHeaderSize) { - const size = this._getFrameSize(this.buf) + this.frameHeaderSize; - - if (this.buf.length >= size) { - this._parseFrame(this.buf.subarray(0, size)); - this._updateBufLen(size); - } else { - break; - } - } - - callback(); - } -} - -module.exports = { - IvfTransformer, -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/player/processing/PCMInsertSilence.js b/vendor/discord.js-selfbot-v13/src/client/voice/player/processing/PCMInsertSilence.js deleted file mode 100644 index 1a0746a..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/player/processing/PCMInsertSilence.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -const { Buffer } = require('node:buffer'); -const { Transform } = require('node:stream'); - -class PCMInsertSilence extends Transform { - constructor(options) { - super(options); - // 48Khz, 2 channels, 16-bit (2 bytes per channel) - this.sampleRate = 48000; - this.channels = 2; - // 4 bytes per frame (2 channels * 2 bytes) - this.bytesPerFrame = this.channels * 2; - this.lastChunkTime = Date.now(); - this.silenceThresholdMs = 50; - } - - _transform(chunk, encoding, callback) { - const now = Date.now(); - const gap = now - this.lastChunkTime; - - if (gap >= this.silenceThresholdMs) { - const missingFrames = Math.floor((gap / 1000) * this.sampleRate); - const silenceBuffer = Buffer.alloc(missingFrames * this.bytesPerFrame, 0); - this.push(silenceBuffer); - } - - this.lastChunkTime = now; - - this.push(chunk); - callback(); - } -} - -module.exports = { - PCMInsertSilence, -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/receiver/PacketHandler.js b/vendor/discord.js-selfbot-v13/src/client/voice/receiver/PacketHandler.js deleted file mode 100644 index 6e6b5f9..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/receiver/PacketHandler.js +++ /dev/null @@ -1,292 +0,0 @@ -'use strict'; - -const EventEmitter = require('events'); -const { Buffer } = require('node:buffer'); -const crypto = require('node:crypto'); -const { setTimeout } = require('node:timers'); -const { RtpPacket } = require('werift-rtp'); -const Recorder = require('./Recorder'); -const Speaking = require('../../../util/Speaking'); -const Util = require('../../../util/Util'); -const secretbox = require('../util/Secretbox'); -const { SILENCE_FRAME } = require('../util/Silence'); - -// The delay between packets when a user is considered to have stopped speaking -// https://github.com/discordjs/discord.js/issues/3524#issuecomment-540373200 -const DISCORD_SPEAKING_DELAY = 250; - -// Unused: const HEADER_EXTENSION_BYTE = Buffer.from([0xbe, 0xde]); -const UNPADDED_NONCE_LENGTH = 4; -const AUTH_TAG_LENGTH = 16; - -class Readable extends require('stream').Readable { - _read() {} // eslint-disable-line no-empty-function -} - -class PacketHandler extends EventEmitter { - constructor(receiver) { - super(); - this.receiver = receiver; - this.streams = new Map(); - this.videoStreams = new Map(); - this.speakingTimeouts = new Map(); - } - - getNonceBuffer() { - return this.receiver.connection.authentication.mode === - 'aead_aes256_gcm_rtpsize' - ? Buffer.alloc(12) - : Buffer.alloc(24); - } - - get connection() { - return this.receiver.connection; - } - - _stoppedSpeaking(userId) { - const streamInfo = this.streams.get(userId); - if (streamInfo && streamInfo.end === 'silence') { - this.streams.delete(userId); - streamInfo.stream.push(null); - } - } - - makeStream(user, end) { - if (this.streams.has(user)) return this.streams.get(user).stream; - const stream = new Readable(); - stream.on('end', () => this.streams.delete(user)); - this.streams.set(user, { stream, end }); - return stream; - } - - makeVideoStream(user, output) { - if (this.videoStreams.has(user)) return this.videoStreams.get(user); - const stream = new Recorder(this, { - userId: user, - output, - portUdpH264: 65506, - portUdpOpus: 65510, - }); - stream.on('ready', () => { - this.videoStreams.set(user, stream); - }); - return stream; - } - - parseBuffer(buffer) { - const { secret_key, mode } = this.receiver.connection.authentication; - // Open packet - if (!secret_key) return new Error('secret_key cannot be null or undefined'); - const nonce = this.getNonceBuffer(); - // Copy the last 4 bytes of unpadded nonce to the padding of (12 - 4) or (24 - 4) bytes - buffer.copy(nonce, 0, buffer.length - UNPADDED_NONCE_LENGTH); - - let headerSize = 12; - const first = buffer.readUint8(); - if ((first >> 4) & 0x01) headerSize += 4; - - // The unencrypted RTP header contains 12 bytes, HEADER_EXTENSION and the extension size - const header = buffer.slice(0, headerSize); - - // Encrypted contains the extension, if any, the opus packet, and the auth tag - const encrypted = buffer.slice( - headerSize, - buffer.length - AUTH_TAG_LENGTH - UNPADDED_NONCE_LENGTH, - ); - const authTag = buffer.slice( - buffer.length - AUTH_TAG_LENGTH - UNPADDED_NONCE_LENGTH, - buffer.length - UNPADDED_NONCE_LENGTH, - ); - - let packet; - switch (mode) { - case 'aead_aes256_gcm_rtpsize': { - const decipheriv = crypto.createDecipheriv( - 'aes-256-gcm', - secret_key, - nonce, - ); - decipheriv.setAAD(header); - decipheriv.setAuthTag(authTag); - - const updated = decipheriv.update(encrypted); - const final = decipheriv.final(); - packet = final.length === 0 ? updated : Buffer.concat([updated, final]); - break; - } - case 'aead_xchacha20_poly1305_rtpsize': { - // Combined mode expects authtag in the encrypted message - packet = secretbox.methods.crypto_aead_xchacha20poly1305_ietf_decrypt( - buffer.subarray(headerSize, buffer.length - UNPADDED_NONCE_LENGTH), - header, - nonce, - secret_key, - ); - - packet = Buffer.from(packet); - break; - } - default: { - return new RangeError(`Unsupported decryption method: ${mode}`); - } - } - - /* - // Strip decrypted RTP Header Extension if present - if (buffer.slice(12, 14).compare(HEADER_EXTENSION_BYTE) === 0) { - const headerExtensionLength = buffer.slice(14).readUInt16BE(); - packet = packet.subarray(4 * headerExtensionLength); - } - */ - - return RtpPacket.deSerialize(Buffer.concat([header, packet])); - } - - audioReceiver(ssrc, userStat, opusPacket) { - const streamInfo = this.streams.get(userStat.userId); - // If the user is in video, we need to check if the packet is just silence - if (userStat.hasVideo) { - if (opusPacket instanceof Error) { - // Only emit an error if we were actively receiving packets from this user - if (streamInfo) { - this.emit('error', opusPacket); - } - return; - } - // Check payload type - if (opusPacket.header.payloadType !== Util.getPayloadType('opus')) { - return; - } - if (!opusPacket.payload) { - return; - } - if (SILENCE_FRAME.equals(opusPacket.payload)) { - // If this is a silence frame, pretend we never received it - return; - } - } - - let speakingTimeout = this.speakingTimeouts.get(ssrc); - if (typeof speakingTimeout === 'undefined') { - // Ensure at least the speaking bit is set. - // As the object is by reference, it's only needed once per client re-connect. - if (userStat.speaking === 0) { - userStat.speaking = Speaking.FLAGS.SPEAKING; - } - this.connection.onSpeaking({ - user_id: userStat.userId, - ssrc: ssrc, - speaking: userStat.speaking, - }); - speakingTimeout = setTimeout(() => { - try { - this.connection.onSpeaking({ - user_id: userStat.userId, - ssrc: ssrc, - speaking: 0, - }); - clearTimeout(speakingTimeout); - this.speakingTimeouts.delete(ssrc); - } catch { - // Connection already closed, ignore - } - }, DISCORD_SPEAKING_DELAY).unref(); - this.speakingTimeouts.set(ssrc, speakingTimeout); - } else { - speakingTimeout.refresh(); - } - - if (streamInfo) { - const { stream } = streamInfo; - if (opusPacket instanceof Error) { - this.emit('error', opusPacket); - return; - } - if (opusPacket.header.payloadType !== Util.getPayloadType('opus')) { - return; - } - stream.push(opusPacket.payload); - } - } - - audioReceiverForStream(ssrc, userStat, packet) { - const streamInfo = this.videoStreams.get(userStat.userId); - if (!streamInfo) return; - if (packet instanceof Error) { - return; - } - if (packet.header.payloadType !== Util.getPayloadType('opus')) { - return; - } - streamInfo.feed(packet); - } - - /** - * Test - * @param {number} ssrc ssrc - * @param {Object} userStat { userId, hasVideo } - * @param {RtpPacket} packet RtpPacket - * @returns {void} - */ - videoReceiver(ssrc, userStat, packet) { - const streamInfo = this.videoStreams.get(userStat.userId); - // If the user is in video, we need to check if the packet is just silence - if (userStat.hasVideo) { - if (packet instanceof Error) { - return; - } - - if (packet.header.payloadType === Util.getPayloadType('opus')) { - return; - } - - if (streamInfo) { - streamInfo.feed(packet); - } - } - } - - push(buffer) { - const ssrc = buffer.readUInt32BE(8); - let userStat, packet; - if (this.connection.ssrcMap.has(ssrc)) { - userStat = this.connection.ssrcMap.get(ssrc); // Audio_ssrc - packet = this.parseBuffer(buffer); - this.audioReceiver(ssrc, userStat, packet); - this.audioReceiverForStream(ssrc, userStat, packet); - } else if (this.connection.ssrcMap.has(ssrc - 1)) { - userStat = this.connection.ssrcMap.get(ssrc - 1); // Video_ssrc - packet = this.parseBuffer(buffer); - this.videoReceiver(ssrc, userStat, packet); - } - if (userStat && !(packet instanceof Error)) - this.receiver.emit('receiverData', userStat, packet); - } - - // When udp connection is closed (STREAM_DELETE), destroy all streams (Memory leak) - destroyAllStream() { - const audioStreams = this.streams.size; - const videoStreams = this.videoStreams.size; - for (const stream of this.streams.values()) { - stream.stream.destroy(); - } - this.streams.clear(); - for (const stream of this.videoStreams.values()) { - stream.destroy(); - } - this.videoStreams.clear(); - for (const timeout of this.speakingTimeouts.values()) { - clearTimeout(timeout); - } - const speakingTimeouts = this.speakingTimeouts.size; - this.speakingTimeouts.clear(); - this.emit('debug', { - message: 'Destroyed voice receiver streams', - audioStreams, - videoStreams, - speakingTimeouts, - }); - } -} - -module.exports = PacketHandler; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/receiver/Receiver.js b/vendor/discord.js-selfbot-v13/src/client/voice/receiver/Receiver.js deleted file mode 100644 index f68f2d3..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/receiver/Receiver.js +++ /dev/null @@ -1,111 +0,0 @@ -'use strict'; - -const EventEmitter = require('events'); -const prism = require('prism-media'); -const PacketHandler = require('./PacketHandler'); -const { Error } = require('../../../errors'); -const { PCMInsertSilence } = require('../player/processing/PCMInsertSilence'); - -/** - * Receives audio packets from a voice connection. - * @example - * const receiver = connection.createReceiver(); - * // opusStream is a ReadableStream - that means you could play it back to a voice channel if you wanted to! - * const opusStream = receiver.createStream(user); - */ -class VoiceReceiver extends EventEmitter { - constructor(connection) { - super(); - this.connection = connection; - this.packets = new PacketHandler(this); - /** - * Emitted whenever there is a warning - * @event VoiceReceiver#debug - * @param {Error|string} error The error or message to debug - */ - this.packets.on('error', (err) => this.emit('debug', err)); - } - - /** - * Options passed to `VoiceReceiver#createStream`. - * @typedef {Object} ReceiveStreamOptions - * @property {string} [mode='opus'] The mode for audio output. This defaults to opus, meaning discord.js won't decode - * the packets for you. You can set this to 'pcm' so that the stream's output will be 16-bit little-endian stereo - * audio - * @property {string} [end='silence'] When the stream should be destroyed. If `silence`, this will be when the user - * stops talking. Otherwise, if `manual`, this should be handled by you. - * @property {boolean} [paddingSilence=false] Whether to add silence padding - * If 'end' is set to 'silence', this property automatically defaults to `false` - */ - - /** - * Creates a new audio receiving stream. If a stream already exists for a user, then that stream will be returned - * rather than generating a new one. - * @param {UserResolvable} user The user to start listening to. - * @param {ReceiveStreamOptions} options Options. - * @returns {ReadableStream} - */ - createStream( - user, - { mode = 'opus', end = 'silence', paddingSilence = false } = {}, - ) { - user = this.connection.client.users.resolve(user); - if (end === 'silence') paddingSilence = false; - if (!user) throw new Error('VOICE_USER_MISSING'); - const stream = this.packets.makeStream(user.id, end); // Opus stream - if (paddingSilence) { - const decoder = new prism.opus.Decoder({ - channels: 2, - rate: 48000, - frameSize: 960, - }); - const pcmTransformer = new PCMInsertSilence(); - stream.pipe(decoder).pipe(pcmTransformer); - if (mode === 'opus') { - const encoder = new prism.opus.Encoder({ - channels: 2, - rate: 48000, - frameSize: 960, - }); - pcmTransformer.pipe(encoder); - return encoder; - } - return pcmTransformer; - } else { - if (mode === 'pcm') { - const decoder = new prism.opus.Decoder({ - channels: 2, - rate: 48000, - frameSize: 960, - }); - stream.pipe(decoder); - return decoder; - } - return stream; - } - } - - /** - * Creates a new video receiving stream. If a stream already exists for a user, then that stream will be returned - * rather than generating a new one. - * Proof of concept - Requires a very good internet connection - * @param {UserResolvable} user The user to start listening to. - * @param {WritableStream|string} output Output stream or file path to write the video stream to. - * @returns {Recorder} The video stream for the specified user. - */ - createVideoStream(user, output) { - user = this.connection.client.users.resolve(user); - if (!user) throw new Error('VOICE_USER_MISSING'); - const stream = this.packets.makeVideoStream(user.id, output); - return stream; - } - - /** - * Emitted whenever there is a data packet received. - * @event VoiceReceiver#receiverData - * @param {{ userId: Snowflake, hasVideo: boolean }} ssrcData SSRC Data - * @param {RtpPacket} header RTP Packet - */ -} - -module.exports = VoiceReceiver; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/receiver/Recorder.js b/vendor/discord.js-selfbot-v13/src/client/voice/receiver/Recorder.js deleted file mode 100644 index 91f6570..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/receiver/Recorder.js +++ /dev/null @@ -1,182 +0,0 @@ -'use strict'; - -const { spawn } = require('child_process'); -const { createSocket } = require('dgram'); -const { EventEmitter } = require('events'); -const { Buffer } = require('node:buffer'); -const { Writable } = require('stream'); -const find = require('find-process'); -const kill = require('tree-kill'); -const { RtpPacket } = require('werift-rtp'); -const Util = require('../../../util/Util'); -const { randomPorts } = require('../util/Function'); -const { StreamOutput } = require('../util/Socket'); - -/** - * Represents a FFmpeg handler - * @extends {EventEmitter} - */ -class Recorder extends EventEmitter { - constructor(receiver, { userId, portUdpH264, portUdpOpus, output } = {}) { - super(); - - Object.defineProperty(this, 'receiver', { value: receiver }); - - /** - * The user ID - * @type {Snowflake} - */ - this.userId = userId; - - this.portUdpH264 = portUdpH264; - this.portUdpH265 = null; - this.portUdpOpus = portUdpOpus; - - this.promise = null; - - if (!portUdpH264 || !portUdpOpus) { - this.promise = randomPorts(6, 'udp4').then((ports) => { - ports = ports.filter((port) => port % 2 === 0); - this.portUdpH264 ??= ports[0]; - this.portUdpOpus ??= ports[1]; - }); - } - - /** - * The output of the stream - * @type {string|Readable} - */ - this.output = output; - - /** - * The FFmpeg process is ready or not - * @type {boolean} - */ - this.ready = false; - - this.socket = createSocket('udp4'); - - this.init(output); - } - async init(output) { - await this.promise; - const sdpData = Util.getSDPCodecName( - this.portUdpH264, - this.portUdpH265, - this.portUdpOpus, - ); - const isStream = output instanceof Writable; - if (isStream) { - this.outputStream = StreamOutput(output); - } - const stream = spawn('ffmpeg', [ - '-reorder_queue_size', - '500', - '-thread_queue_size', - '500', - '-err_detect', - 'ignore_err', - '-flags2', - '+export_mvs', - '-fflags', - '+genpts+discardcorrupt', - '-use_wallclock_as_timestamps', - '1', - '-f', - 'sdp', - '-analyzeduration', - '1M', - '-probesize', - '1M', - '-protocol_whitelist', - 'file,udp,rtp,pipe,fd', - '-i', - '-', // Read from stdin - '-buffer_size', - '4M', - '-max_delay', - '500000', // 500ms - '-rtbufsize', - '4M', - '-c', - 'copy', - '-y', - '-f', - 'matroska', - isStream ? this.outputStream.url : output, - ]); - - /** - * The FFmpeg process - * @type {ChildProcessWithoutNullStreams} - */ - this.stream = stream; - this.stream.stdin.write(sdpData); - this.stream.stdin.end(); - this.stream.stderr.once('data', (data) => { - this.emit('debug', `stderr: ${data}`); - this.ready = true; - this.emit('ready'); - }); - } - /** - * Send a payload to FFmpeg via UDP - * @param {RtpPacket|string|Buffer} payload The payload - * @param {*} callback Callback - */ - feed( - payload, - callback = (e) => { - if (e) { - console.error('Error sending packet:', e); - } - }, - ) { - if (!(payload instanceof RtpPacket)) { - payload = RtpPacket.deSerialize( - Buffer.isBuffer(payload) ? payload : Buffer.from(payload), - ); - } - const message = payload.serialize(); - // Get port from payloadType - let port; - if (payload.header.payloadType === Util.getPayloadType('opus')) { - port = this.portUdpOpus; - } else if (payload.header.payloadType === Util.getPayloadType('H264')) { - port = this.portUdpH264; - } else if (payload.header.payloadType === Util.getPayloadType('H265')) { - port = this.portUdpH265; - } else { - return; - } - this.socket.send(message, 0, message.length, port, '127.0.0.1', callback); - } - - destroy() { - const ffmpegPid = this.stream.pid; // But it is ppid ;-; - const args = this.stream.spawnargs.slice(1).join(' '); // Skip ffmpeg - find('name', 'ffmpeg', true).then((list) => { - let process = list.find( - (o) => - o.pid === ffmpegPid || o.ppid === ffmpegPid || o.cmd.includes(args), - ); - if (process) { - kill(process.pid); - this.receiver?.videoStreams?.delete(this.userId); - this.emit('closed'); - } - }); - } - - /** - * Emitted when the Recorder becomes ready to start working. - * @event Recorder#ready - */ - - /** - * Emitted when the Recorder is closed. - * @event Recorder#closed - */ -} - -module.exports = Recorder; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/util/Function.js b/vendor/discord.js-selfbot-v13/src/client/voice/util/Function.js deleted file mode 100644 index c89ff03..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/util/Function.js +++ /dev/null @@ -1,120 +0,0 @@ -'use strict'; - -const dgram = require('dgram'); -const { setImmediate } = require('node:timers'); - -/** - * @typedef {Object} InterfaceAddresses - * @property {string} [udp4] - IPv4 address - * @property {string} [udp6] - IPv6 address - */ - -/** - * Get the interface address for a given socket type. - * @param {"udp4"|"udp6"} type - The socket type. - * @param {InterfaceAddresses} [interfaceAddresses] - The interface addresses mapping. - * @returns {string|undefined} The interface address if available. - */ -function interfaceAddress(type, interfaceAddresses) { - return interfaceAddresses ? interfaceAddresses[type] : undefined; -} - -/** - * Get a random available port. - * @param {"udp4"|"udp6"} [protocol="udp4"] - The socket type. - * @param {InterfaceAddresses} [interfaceAddresses] - The interface addresses mapping. - * @returns {Promise} The assigned random port. - */ -async function randomPort(protocol = 'udp4', interfaceAddresses) { - const socket = dgram.createSocket(protocol); - - setImmediate(() => - socket.bind({ - port: 0, - address: interfaceAddress(protocol, interfaceAddresses), - }), - ); - - await new Promise((resolve, reject) => { - socket.once('error', reject); - socket.once('listening', resolve); - }); - - const port = socket.address()?.port; - await new Promise((resolve) => socket.close(resolve)); - return port; -} - -/** - * Get multiple random available ports. - * @param {number} num - Number of ports to find. - * @param {"udp4"|"udp6"} [protocol="udp4"] - The socket type. - * @param {InterfaceAddresses} [interfaceAddresses] - The interface addresses mapping. - * @returns {Promise} An array of assigned random ports. - */ -async function randomPorts(num, protocol = 'udp4', interfaceAddresses) { - return Promise.all( - Array.from({ length: num }).map(() => - randomPort(protocol, interfaceAddresses), - ), - ); -} - -/** - * Find an available port within a given range. - * @param {number} min - The minimum port number. - * @param {number} max - The maximum port number. - * @param {"udp4"|"udp6"} [protocol="udp4"] - The socket type. - * @param {InterfaceAddresses} [interfaceAddresses] - The interface addresses mapping. - * @returns {Promise} The available port within range. - * @throws {Error} If no port is found within the range. - */ -async function findPort(min, max, protocol = 'udp4', interfaceAddresses) { - let port; - - for (let i = min; i <= max; i++) { - const socket = dgram.createSocket(protocol); - - setImmediate(() => - socket.bind({ - port: i, - address: interfaceAddress(protocol, interfaceAddresses), - }), - ); - - const error = await new Promise((resolve) => { - socket.once('error', resolve); - socket.once('listening', () => resolve(null)); - }); - - await new Promise((resolve) => socket.close(resolve)); - - if (error) continue; - - const addressInfo = socket.address(); - if (addressInfo && addressInfo.port >= min && addressInfo.port <= max) { - port = addressInfo.port; - break; - } - } - - if (!port) throw new Error('port not found'); - return port; -} - -function parseStreamKey(key) { - const Arr = key.split(':'); - const type = Arr[0]; - const guildId = type == 'guild' ? Arr[1] : null; - const channelId = type == 'guild' ? Arr[2] : Arr[1]; - const userId = type == 'guild' ? Arr[3] : Arr[2]; - return { type, guildId, channelId, userId }; -} - -module.exports = { - randomPort, - randomPorts, - findPort, - interfaceAddress, - parseStreamKey, -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/util/PlayInterface.js b/vendor/discord.js-selfbot-v13/src/client/voice/util/PlayInterface.js deleted file mode 100644 index 6e1c0d8..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/util/PlayInterface.js +++ /dev/null @@ -1,134 +0,0 @@ -'use strict'; - -const { Readable } = require('stream'); -const prism = require('prism-media'); -const { Error } = require('../../../errors'); - -/** - * Options that can be passed to stream-playing methods: - * @typedef {Object} StreamOptions - * @property {StreamType} [type='unknown'] The type of stream. - * @property {number} [seek=0] The time to seek to, will be ignored when playing `ogg/opus` or `webm/opus` streams - * @property {number|boolean} [volume=1] The volume to play at. Set this to false to disable volume transforms for - * this stream to improve performance. - * @property {number} [plp] Expected packet loss percentage - * @property {boolean} [fec] Enabled forward error correction - * @property {number|string} [bitrate=96] The bitrate (quality) of the audio in kbps. - * If set to 'auto', the voice channel's bitrate will be used - * @property {number} [highWaterMark=12] The maximum number of opus packets to make and store before they are - * actually needed. See https://nodejs.org/en/docs/guides/backpressuring-in-streams/. Setting this value to - * 1 means that changes in volume will be more instant. - */ - -/** - * An option passed as part of `StreamOptions` specifying the type of the stream. - * * `unknown`: The default type, streams/input will be passed through to ffmpeg before encoding. - * Will play most streams. - * * `converted`: Play a stream of 16bit signed stereo PCM data, skipping ffmpeg. - * * `opus`: Play a stream of opus packets, skipping ffmpeg. You lose the ability to alter volume. - * * `ogg/opus`: Play an ogg file with the opus encoding, skipping ffmpeg. You lose the ability to alter volume. - * * `webm/opus`: Play a webm file with opus audio, skipping ffmpeg. You lose the ability to alter volume. - * @typedef {string} StreamType - */ - -/** - * An interface class to allow you to play audio over VoiceConnections. - */ -class PlayInterface { - constructor(player) { - this.player = player; - } - - /** - * Play an audio resource. - * @param {ReadableStream|string} resource The resource to play. - * @param {StreamOptions} [options] The options to play. - * @example - * // Play a local audio file - * connection.playAudio('/home/hydrabolt/audio.mp3', { volume: 0.5 }); - * @example - * // Play a ReadableStream - * connection.playAudio(ytdl('https://www.youtube.com/watch?v=ZlAU_w7-Xp8', { quality: 'highestaudio' })); - * @example - * // Using different protocols: https://ffmpeg.org/ffmpeg-protocols.html - * connection.playAudio('http://www.sample-videos.com/audio/mp3/wave.mp3'); - * @returns {AudioDispatcher} - */ - playAudio(resource, options = {}) { - if (resource instanceof Readable || typeof resource === 'string') { - const type = options.type || 'unknown'; - if (type === 'unknown') { - return this.player.playUnknown(resource, options); - } else if (type === 'converted') { - return this.player.playPCMStream(resource, options); - } else if (type === 'opus') { - return this.player.playOpusStream(resource, options); - } else if (type === 'ogg/opus') { - if (!(resource instanceof Readable)) - throw new Error('VOICE_PRISM_DEMUXERS_NEED_STREAM'); - return this.player.playOpusStream( - resource.pipe(new prism.opus.OggDemuxer()), - options, - ); - } else if (type === 'webm/opus') { - if (!(resource instanceof Readable)) - throw new Error('VOICE_PRISM_DEMUXERS_NEED_STREAM'); - return this.player.playOpusStream( - resource.pipe(new prism.opus.WebmDemuxer()), - options, - ); - } - } - throw new Error('VOICE_PLAY_INTERFACE_BAD_TYPE'); - } - - /** - * Options that can be passed to stream-playing methods: - * @typedef {Object} VideoOptions - * @property {number} [seek=0] The time to seek to - * @property {number} [fps] Video fps - * @property {number} [highWaterMark=12] The maximum number of opus packets to make and store before they are - * actually needed. See https://nodejs.org/en/docs/guides/backpressuring-in-streams/. Setting this value to - * 1 means that changes in volume will be more instant. - * @property {'ultrafast' | 'superfast' | 'veryfast' | 'faster' | 'fast' | 'medium' | 'slow' | 'slower' | 'veryslow'} [presetH26x='veryfast'] ffmpeg preset h264 - * @property {boolean} [hwAccel=false] Enables hardware accelerated video decoding. Enabling this option might result in an exception - * being thrown by Ffmpeg process if your system does not support hardware acceleration - * @property {string[]} [inputFFmpegArgs] input ffmpeg - * Ex: ['-config1', 'value1', '-config2', 'value2'] - * @property {string[]} [outputFFmpegArgs] output ffmpeg - * Ex: ['-config1', 'value1', '-config2', 'value2'] - * @property {number|'auto'} [bitrate=2000] The bitrate (quality) of the video in kbps. - * If set to 'auto', ffmpeg will automatically select - */ - - /** - * Play a video resource. - * @param {ReadableStream|string} resource The resource to play. - * @param {VideoOptions} [options] The options to play. - * @example - * // Play a local video file - * connection.playVideo('/home/hydrabolt/video.mp4'); - * @example - * // Using different protocols: https://ffmpeg.org/ffmpeg-protocols.html - * connection.playVideo('http://www.sample-videos.com/video/mp4/wave.mp4'); - * @returns {VideoDispatcher} - */ - playVideo(resource, options = {}) { - if (resource instanceof Readable || typeof resource === 'string') { - return this.player.playUnknownVideo(resource, options); - } - throw new Error('VOICE_PLAY_INTERFACE_BAD_TYPE'); - } - - static applyToClass(structure) { - for (const prop of ['playAudio', 'playVideo']) { - Object.defineProperty( - structure.prototype, - prop, - Object.getOwnPropertyDescriptor(PlayInterface.prototype, prop), - ); - } - } -} - -module.exports = PlayInterface; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/util/Secretbox.js b/vendor/discord.js-selfbot-v13/src/client/voice/util/Secretbox.js deleted file mode 100644 index 36ff397..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/util/Secretbox.js +++ /dev/null @@ -1,118 +0,0 @@ -'use strict'; - -const libs = { - sodium: (sodium) => ({ - crypto_aead_xchacha20poly1305_ietf_encrypt: ( - plaintext, - additionalData, - nonce, - key, - ) => - sodium.api.crypto_aead_xchacha20poly1305_ietf_encrypt( - plaintext, - additionalData, - null, - nonce, - key, - ), - crypto_aead_xchacha20poly1305_ietf_decrypt: ( - plaintext, - additionalData, - nonce, - key, - ) => - sodium.api.crypto_aead_xchacha20poly1305_ietf_decrypt( - plaintext, - additionalData, - null, - nonce, - key, - ), - }), - 'libsodium-wrappers': (sodium) => ({ - crypto_aead_xchacha20poly1305_ietf_encrypt: ( - plaintext, - additionalData, - nonce, - key, - ) => - sodium.crypto_aead_xchacha20poly1305_ietf_encrypt( - plaintext, - additionalData, - null, - nonce, - key, - ), - crypto_aead_xchacha20poly1305_ietf_decrypt: ( - plaintext, - additionalData, - nonce, - key, - ) => - sodium.crypto_aead_xchacha20poly1305_ietf_decrypt( - null, - plaintext, - additionalData, - nonce, - key, - ), - }), - '@stablelib/xchacha20poly1305': (stablelib) => ({ - crypto_aead_xchacha20poly1305_ietf_encrypt( - cipherText, - additionalData, - nonce, - key, - ) { - const crypto = new stablelib.XChaCha20Poly1305(key); - return crypto.seal(nonce, cipherText, additionalData); - }, - crypto_aead_xchacha20poly1305_ietf_decrypt( - plaintext, - additionalData, - nonce, - key, - ) { - const crypto = new stablelib.XChaCha20Poly1305(key); - return crypto.open(nonce, plaintext, additionalData); - }, - }), -}; - -function NoLib() { - throw new Error( - 'Cannot play audio as no valid encryption package is installed.\n- Install sodium, libsodium-wrappers, or @stablelib/xchacha20poly1305.', - ); -} - -exports.methods = { - crypto_aead_xchacha20poly1305_ietf_encrypt: NoLib, - crypto_aead_xchacha20poly1305_ietf_decrypt: NoLib, -}; - -async function importModule(name, usingImport = false) { - try { - if (usingImport) { - return await import(name); - } else { - return require(name); - } - } catch (e) { - if (e.code == 'ERR_REQUIRE_ESM') { - return importModule(name, true); - } else { - throw e; - } - } -} - -(async () => { - for (const libName of Object.keys(libs)) { - try { - const lib = await importModule(libName); - if (libName === 'libsodium-wrappers' && lib.ready) await lib.ready; // eslint-disable-line no-await-in-loop - exports.methods = libs[libName](lib); - break; - } catch {} // eslint-disable-line no-empty - } -})(); diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/util/Silence.js b/vendor/discord.js-selfbot-v13/src/client/voice/util/Silence.js deleted file mode 100644 index 6c3857a..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/util/Silence.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -const { Buffer } = require('node:buffer'); -const { Readable } = require('stream'); - -const SILENCE_FRAME = Buffer.from([0xf8, 0xff, 0xfe]); - -class Silence extends Readable { - _read() { - this.push(SILENCE_FRAME); - } -} - -Silence.SILENCE_FRAME = SILENCE_FRAME; - -module.exports = Silence; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/util/Socket.js b/vendor/discord.js-selfbot-v13/src/client/voice/util/Socket.js deleted file mode 100644 index 347407d..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/util/Socket.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; - -/* -Credit: https://github.com/dank074/Discord-video-stream -The use of video streaming in this library is an incomplete implementation with many bugs, primarily aimed at lazy users. -The video streaming features in this library are sourced from https://github.com/dank074/Discord-video-stream. - -Please use the @dank074/discord-video-stream library to access all advanced and professional features, -along with comprehensive support. I will not actively fix bugs related to streaming and encourage everyone to -use https://github.com/dank074/Discord-video-stream for stable and smooth streaming. - -To reiterate: This is an incomplete implementation of the library https://github.com/dank074/Discord-video-stream. - -Thanks to dank074 and longnguyen2004 for implementing new codecs (H264, H265). -Thanks to mrjvs for discovering how Discord transmits data and the VP8 codec. - -Please use the @dank074/discord-video-stream library for the best support. -*/ - -const fs = require('fs'); -const net = require('net'); -const path = require('path'); -const process = require('process'); - -let counter = 0; - -class UnixStream { - constructor(stream, onSocket) { - if (process.platform === 'win32') { - const pipePrefix = '\\\\.\\pipe\\'; - const pipeName = `node-webrtc.${++counter}.sock`; - this.socketPath = path.join(pipePrefix, pipeName); - this.url = this.socketPath; - } else { - this.socketPath = `./${++counter}.sock`; - this.url = `unix:${this.socketPath}`; - } - - try { - fs.statSync(this.socketPath); - fs.unlinkSync(this.socketPath); - } catch (err) { - // Null - } - - const server = net.createServer(onSocket); - stream.on('finish', () => { - server.close(); - }); - server.listen(this.socketPath); - } -} - -function StreamInput(stream) { - return new UnixStream(stream, (socket) => stream.pipe(socket)); -} - -function StreamOutput(stream) { - return new UnixStream(stream, (socket) => socket.pipe(stream)); -} - -module.exports = { StreamOutput, StreamInput, UnixStream }; diff --git a/vendor/discord.js-selfbot-v13/src/client/voice/util/VolumeInterface.js b/vendor/discord.js-selfbot-v13/src/client/voice/util/VolumeInterface.js deleted file mode 100644 index ef7c7b4..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/voice/util/VolumeInterface.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; - -const EventEmitter = require('events'); -const { Buffer } = require('node:buffer'); - -/** - * An interface class for volume transformation. - * @extends {EventEmitter} - */ -class VolumeInterface extends EventEmitter { - constructor({ volume = 1 } = {}) { - super(); - this.setVolume(volume); - } - - /** - * Whether or not the volume of this stream is editable - * @type {boolean} - * @readonly - */ - get volumeEditable() { - return true; - } - - /** - * The current volume of the stream - * @type {number} - * @readonly - */ - get volume() { - return this._volume; - } - - /** - * The current volume of the stream in decibels - * @type {number} - * @readonly - */ - get volumeDecibels() { - return Math.log10(this.volume) * 20; - } - - /** - * The current volume of the stream from a logarithmic scale - * @type {number} - * @readonly - */ - get volumeLogarithmic() { - return Math.pow(this.volume, 1 / 1.660964); - } - - applyVolume(buffer, volume) { - volume = volume || this._volume; - if (volume === 1) return buffer; - - const out = Buffer.alloc(buffer.length); - for (let i = 0; i < buffer.length; i += 2) { - if (i >= buffer.length - 1) break; - const uint = Math.min( - 32767, - Math.max(-32767, Math.floor(volume * buffer.readInt16LE(i))), - ); - out.writeInt16LE(uint, i); - } - - return out; - } - - /** - * Sets the volume relative to the input stream - i.e. 1 is normal, 0.5 is half, 2 is double. - * @param {number} volume The volume that you want to set - */ - setVolume(volume) { - /** - * Emitted when the volume of this interface changes. - * @event VolumeInterface#volumeChange - * @param {number} oldVolume The old volume of this interface - * @param {number} newVolume The new volume of this interface - */ - this.emit('volumeChange', this._volume, volume); - this._volume = volume; - } - - /** - * Sets the volume in decibels. - * @param {number} db The decibels - */ - setVolumeDecibels(db) { - this.setVolume(Math.pow(10, db / 20)); - } - - /** - * Sets the volume so that a perceived value of 0.5 is half the perceived volume etc. - * @param {number} value The value for the volume - */ - setVolumeLogarithmic(value) { - this.setVolume(Math.pow(value, 1.660964)); - } -} - -const props = [ - 'volumeDecibels', - 'volumeLogarithmic', - 'setVolumeDecibels', - 'setVolumeLogarithmic', -]; - -exports.applyToClass = function applyToClass(structure) { - for (const prop of props) { - Object.defineProperty( - structure.prototype, - prop, - Object.getOwnPropertyDescriptor(VolumeInterface.prototype, prop), - ); - } -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/WebSocketManager.js b/vendor/discord.js-selfbot-v13/src/client/websocket/WebSocketManager.js deleted file mode 100644 index fd2eb31..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/WebSocketManager.js +++ /dev/null @@ -1,430 +0,0 @@ -'use strict'; - -const EventEmitter = require('node:events'); -const { setImmediate } = require('node:timers'); -const { setTimeout: sleep } = require('node:timers/promises'); -const { Collection } = require('@discordjs/collection'); -const { RPCErrorCodes } = require('discord-api-types/v10'); -const WebSocketShard = require('./WebSocketShard'); -const PacketHandlers = require('./handlers'); -const { Error } = require('../../errors'); -const { - Events, - ShardEvents, - Status, - WSCodes, - WSEvents, -} = require('../../util/Constants'); - -const BeforeReadyWhitelist = [ - WSEvents.READY, - WSEvents.RESUMED, - WSEvents.GUILD_CREATE, - WSEvents.GUILD_DELETE, - WSEvents.GUILD_MEMBERS_CHUNK, - WSEvents.GUILD_MEMBER_ADD, - WSEvents.GUILD_MEMBER_REMOVE, -]; - -const UNRECOVERABLE_CLOSE_CODES = Object.keys(WSCodes).slice(2).map(Number); -const UNRESUMABLE_CLOSE_CODES = [ - RPCErrorCodes.UnknownError, - RPCErrorCodes.InvalidPermissions, - RPCErrorCodes.InvalidClientId, -]; - -/** - * The WebSocket manager for this client. - * This class forwards raw dispatch events, - * read more about it here {@link https://discord.com/developers/docs/topics/gateway} - * @extends {EventEmitter} - */ -class WebSocketManager extends EventEmitter { - constructor(client) { - super(); - - /** - * The client that instantiated this WebSocketManager - * @type {Client} - * @readonly - * @name WebSocketManager#client - */ - Object.defineProperty(this, 'client', { value: client }); - - /** - * The gateway this manager uses - * @type {?string} - */ - this.gateway = null; - - /** - * The amount of shards this manager handles - * @private - * @type {number} - */ - this.totalShards = this.client.options.shards.length; - - /** - * A collection of all shards this manager handles - * @type {Collection} - */ - this.shards = new Collection(); - - /** - * An array of shards to be connected or that need to reconnect - * @type {Set} - * @private - * @name WebSocketManager#shardQueue - */ - Object.defineProperty(this, 'shardQueue', { - value: new Set(), - writable: true, - }); - - /** - * An array of queued events before this WebSocketManager became ready - * @type {Object[]} - * @private - * @name WebSocketManager#packetQueue - */ - Object.defineProperty(this, 'packetQueue', { value: [] }); - - /** - * The current status of this WebSocketManager - * @type {Status} - */ - this.status = Status.IDLE; - - /** - * If this manager was destroyed. It will prevent shards from reconnecting - * @type {boolean} - * @private - */ - this.destroyed = false; - - /** - * If this manager is currently reconnecting one or multiple shards - * @type {boolean} - * @private - */ - this.reconnecting = false; - } - - /** - * The average ping of all WebSocketShards - * @type {number} - * @readonly - */ - get ping() { - const sum = this.shards.reduce((a, b) => a + b.ping, 0); - return sum / this.shards.size; - } - - /** - * Emits a debug message. - * @param {string} message The debug message - * @param {?WebSocketShard} [shard] The shard that emitted this message, if any - * @private - */ - debug(message, shard) { - this.client.emit( - Events.DEBUG, - `[WS => ${shard ? `Shard ${shard.id}` : 'Manager'}] ${message}`, - ); - } - - /** - * Connects this manager to the gateway. - * @private - */ - async connect() { - let gatewayURL = 'wss://gateway.discord.gg'; - await this.client.api.gateway - .get({ auth: false }) - .then((r) => (gatewayURL = r.url)) - .catch(() => {}); - - const total = Infinity; - const remaining = Infinity; - const recommendedShards = 1; - - this.debug(`Fetched Gateway Information - URL: ${gatewayURL} - Recommended Shards: ${recommendedShards}`); - - this.debug(`Session Limit Information - Total: ${total} - Remaining: ${remaining}`); - - this.gateway = `${gatewayURL}/`; - - let { shards } = this.client.options; - - if (shards === 'auto') { - this.debug( - `Using the recommended shard count provided by Discord: ${recommendedShards}`, - ); - this.totalShards = this.client.options.shardCount = recommendedShards; - shards = this.client.options.shards = Array.from( - { length: recommendedShards }, - (_, i) => i, - ); - } - - this.totalShards = shards.length; - this.debug(`Spawning shards: ${shards.join(', ')}`); - this.shardQueue = new Set(shards.map((id) => new WebSocketShard(this, id))); - - return this.createShards(); - } - - /** - * Handles the creation of a shard. - * @returns {Promise} - * @private - */ - async createShards() { - // If we don't have any shards to handle, return - if (!this.shardQueue.size) return false; - - const [shard] = this.shardQueue; - - this.shardQueue.delete(shard); - - if (!shard.eventsAttached) { - shard.on(ShardEvents.ALL_READY, (unavailableGuilds) => { - /** - * Emitted when a shard turns ready. - * @event Client#shardReady - * @param {number} id The shard id that turned ready - * @param {?Set} unavailableGuilds Set of unavailable guild ids, if any - */ - this.client.emit(Events.SHARD_READY, shard.id, unavailableGuilds); - - if (!this.shardQueue.size) this.reconnecting = false; - this.checkShardsReady(); - }); - - shard.on(ShardEvents.CLOSE, (event) => { - if ( - event.code === 1_000 - ? this.destroyed - : UNRECOVERABLE_CLOSE_CODES.includes(event.code) - ) { - /** - * Emitted when a shard's WebSocket disconnects and will no longer reconnect. - * @event Client#shardDisconnect - * @param {CloseEvent} event The WebSocket close event - * @param {number} id The shard id that disconnected - */ - this.client.emit(Events.SHARD_DISCONNECT, event, shard.id); - this.debug(WSCodes[event.code], shard); - return; - } - - if (UNRESUMABLE_CLOSE_CODES.includes(event.code)) { - // These event codes cannot be resumed - shard.sessionId = null; - } - - /** - * Emitted when a shard is attempting to reconnect or re-identify. - * @event Client#shardReconnecting - * @param {number} id The shard id that is attempting to reconnect - */ - this.client.emit(Events.SHARD_RECONNECTING, shard.id); - - this.shardQueue.add(shard); - - if (shard.sessionId) - this.debug( - `Session id is present, attempting an immediate reconnect...`, - shard, - ); - this.reconnect(); - }); - - shard.on(ShardEvents.INVALID_SESSION, () => { - this.client.emit(Events.SHARD_RECONNECTING, shard.id); - }); - - shard.on(ShardEvents.DESTROYED, () => { - this.debug( - 'Shard was destroyed but no WebSocket connection was present! Reconnecting...', - shard, - ); - - this.client.emit(Events.SHARD_RECONNECTING, shard.id); - - this.shardQueue.add(shard); - this.reconnect(); - }); - - shard.eventsAttached = true; - } - - this.shards.set(shard.id, shard); - - try { - await shard.connect(); - } catch (error) { - if (error?.code && UNRECOVERABLE_CLOSE_CODES.includes(error.code)) { - throw new Error(WSCodes[error.code]); - // Undefined if session is invalid, error event for regular closes - } else if (!error || error.code) { - this.debug('Failed to connect to the gateway, requeueing...', shard); - this.shardQueue.add(shard); - } else { - throw error; - } - } - // If we have more shards, add a 5s delay - if (this.shardQueue.size) { - this.debug( - `Shard Queue Size: ${this.shardQueue.size}; continuing in 5 seconds...`, - ); - await sleep(5_000); - return this.createShards(); - } - - return true; - } - - /** - * Handles reconnects for this manager. - * @private - * @returns {Promise} - */ - async reconnect() { - if (this.reconnecting || this.status !== Status.READY) return false; - this.reconnecting = true; - try { - await this.createShards(); - } catch (error) { - this.debug( - `Couldn't reconnect or fetch information about the gateway. ${error}`, - ); - if (error.httpStatus !== 401) { - this.debug(`Possible network error occurred. Retrying in 5s...`); - await sleep(5_000); - this.reconnecting = false; - return this.reconnect(); - } - // If we get an error at this point, it means we cannot reconnect anymore - if (this.client.listenerCount(Events.INVALIDATED)) { - /** - * Emitted when the client's session becomes invalidated. - * You are expected to handle closing the process gracefully and preventing a boot loop - * if you are listening to this event. - * @event Client#invalidated - */ - this.client.emit(Events.INVALIDATED); - // Destroy just the shards. This means you have to handle the cleanup yourself - this.destroy(); - } else { - this.client.destroy(); - } - } finally { - this.reconnecting = false; - } - return true; - } - - /** - * Broadcasts a packet to every shard this manager handles. - * @param {Object} packet The packet to send - * @private - */ - broadcast(packet) { - for (const shard of this.shards.values()) shard.send(packet); - } - - /** - * Destroys this manager and all its shards. - * @private - */ - destroy() { - if (this.destroyed) return; - this.debug( - `Manager was destroyed. Called by:\n${new Error('MANAGER_DESTROYED').stack}`, - ); - this.destroyed = true; - this.shardQueue.clear(); - for (const shard of this.shards.values()) - shard.destroy({ closeCode: 1_000, reset: true, emit: false, log: false }); - } - - /** - * Processes a packet and queues it if this WebSocketManager is not ready. - * @param {Object} [packet] The packet to be handled - * @param {WebSocketShard} [shard] The shard that will handle this packet - * @returns {boolean} - * @private - */ - handlePacket(packet, shard) { - if (packet && this.status !== Status.READY) { - if (!BeforeReadyWhitelist.includes(packet.t)) { - this.packetQueue.push({ packet, shard }); - return false; - } - } - - if (this.packetQueue.length) { - const item = this.packetQueue.shift(); - setImmediate(() => { - this.handlePacket(item.packet, item.shard); - }).unref(); - } - - if (packet && PacketHandlers[packet.t]) { - PacketHandlers[packet.t](this.client, packet, shard); - } else if (packet) { - /** - * Emitted whenever a packet isn't handled. - * @event Client#unhandledPacket - * @param {Object} packet The packet (t: EVENT_NAME, d: any) - * @param {Number} shard The shard that received the packet (Shard 0) - */ - this.client.emit(Events.UNHANDLED_PACKET, packet, shard); - } - - return true; - } - - /** - * Checks whether the client is ready to be marked as ready. - * @private - */ - checkShardsReady() { - if (this.status === Status.READY) return; - if ( - this.shards.size !== this.totalShards || - this.shards.some((s) => s.status !== Status.READY) - ) { - return; - } - - this.triggerClientReady(); - } - - /** - * Causes the client to be marked as ready and emits the ready event. - * @private - */ - triggerClientReady() { - this.status = Status.READY; - - this.client.readyAt = new Date(); - - /** - * Emitted when the client becomes ready to start working. - * @event Client#ready - * @param {Client} client The client - */ - this.client.emit(Events.CLIENT_READY, this.client); - - this.handlePacket(); - } -} - -module.exports = WebSocketManager; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/WebSocketShard.js b/vendor/discord.js-selfbot-v13/src/client/websocket/WebSocketShard.js deleted file mode 100644 index d4e0fef..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/WebSocketShard.js +++ /dev/null @@ -1,1009 +0,0 @@ -'use strict'; - -const EventEmitter = require('node:events'); -const { setTimeout, setInterval, clearTimeout } = require('node:timers'); -const WebSocket = require('../../WebSocket'); -const { - Status, - Events, - ShardEvents, - Opcodes, - WSEvents, - WSCodes, -} = require('../../util/Constants'); -const Intents = require('../../util/Intents'); -const Util = require('../../util/Util'); - -const STATUS_KEYS = Object.keys(Status); -const CONNECTION_STATE = Object.keys(WebSocket.WebSocket); - -let zlib; - -try { - zlib = require('zlib-sync'); -} catch {} // eslint-disable-line no-empty - -/** - * Represents a Shard's WebSocket connection - * @extends {EventEmitter} - */ -class WebSocketShard extends EventEmitter { - constructor(manager, id) { - super(); - - /** - * The WebSocketManager of the shard - * @type {WebSocketManager} - */ - this.manager = manager; - - /** - * The shard's id - * @type {number} - */ - this.id = id; - - /** - * The resume URL for this shard - * @type {?string} - * @private - */ - this.resumeURL = null; - - /** - * The current status of the shard - * @type {Status} - */ - this.status = Status.IDLE; - - /** - * The current sequence of the shard - * @type {number} - * @private - */ - this.sequence = -1; - - /** - * The sequence of the shard after close - * @type {number} - * @private - */ - this.closeSequence = 0; - - /** - * The current session id of the shard - * @type {?string} - * @private - */ - this.sessionId = null; - - /** - * The previous heartbeat ping of the shard - * @type {number} - */ - this.ping = -1; - - /** - * The last time a ping was sent (a timestamp) - * @type {number} - * @private - */ - this.lastPingTimestamp = -1; - - /** - * If we received a heartbeat ack back. Used to identify zombie connections - * @type {boolean} - * @private - */ - this.lastHeartbeatAcked = true; - - /** - * Used to prevent calling {@link WebSocketShard#event:close} twice while closing or terminating the WebSocket. - * @type {boolean} - * @private - */ - this.closeEmitted = false; - - /** - * Contains the rate limit queue and metadata - * @name WebSocketShard#ratelimit - * @type {Object} - * @private - */ - Object.defineProperty(this, 'ratelimit', { - value: { - queue: [], - queueOffset: 0, - total: 120, - remaining: 120, - time: 60e3, - timer: null, - }, - }); - - /** - * The WebSocket connection for the current shard - * @name WebSocketShard#connection - * @type {?WebSocket} - * @private - */ - Object.defineProperty(this, 'connection', { value: null, writable: true }); - - /** - * @external Inflate - * @see {@link https://www.npmjs.com/package/zlib-sync} - */ - - /** - * The compression to use - * @name WebSocketShard#inflate - * @type {?Inflate} - * @private - */ - Object.defineProperty(this, 'inflate', { value: null, writable: true }); - - /** - * The HELLO timeout - * @name WebSocketShard#helloTimeout - * @type {?NodeJS.Timeout} - * @private - */ - Object.defineProperty(this, 'helloTimeout', { - value: null, - writable: true, - }); - - /** - * The WebSocket timeout. - * @name WebSocketShard#wsCloseTimeout - * @type {?NodeJS.Timeout} - * @private - */ - Object.defineProperty(this, 'wsCloseTimeout', { - value: null, - writable: true, - }); - - /** - * If the manager attached its event handlers on the shard - * @name WebSocketShard#eventsAttached - * @type {boolean} - * @private - */ - Object.defineProperty(this, 'eventsAttached', { - value: false, - writable: true, - }); - - /** - * A set of guild ids this shard expects to receive - * @name WebSocketShard#expectedGuilds - * @type {?Set} - * @private - */ - Object.defineProperty(this, 'expectedGuilds', { - value: null, - writable: true, - }); - - /** - * The ready timeout - * @name WebSocketShard#readyTimeout - * @type {?NodeJS.Timeout} - * @private - */ - Object.defineProperty(this, 'readyTimeout', { - value: null, - writable: true, - }); - - /** - * Time when the WebSocket connection was opened - * @name WebSocketShard#connectedAt - * @type {number} - * @private - */ - Object.defineProperty(this, 'connectedAt', { value: 0, writable: true }); - } - - /** - * Emits a debug event. - * @param {string} message The debug message - * @private - */ - debug(message) { - this.manager.debug(message, this); - } - - /** - * Connects the shard to the gateway. - * @private - * @returns {Promise} A promise that will resolve if the shard turns ready successfully, - * or reject if we couldn't connect - */ - connect() { - const { client } = this.manager; - - if ( - this.connection?.readyState === WebSocket.OPEN && - this.status === Status.READY - ) { - return Promise.resolve(); - } - - const gateway = this.resumeURL ?? this.manager.gateway; - - return new Promise((resolve, reject) => { - const cleanup = () => { - this.removeListener(ShardEvents.CLOSE, onClose); - this.removeListener(ShardEvents.READY, onReady); - this.removeListener(ShardEvents.RESUMED, onResumed); - this.removeListener(ShardEvents.INVALID_SESSION, onInvalidOrDestroyed); - this.removeListener(ShardEvents.DESTROYED, onInvalidOrDestroyed); - }; - - const onReady = () => { - cleanup(); - resolve(); - }; - - const onResumed = () => { - cleanup(); - resolve(); - }; - - const onClose = (event) => { - cleanup(); - reject(event); - }; - - const onInvalidOrDestroyed = () => { - cleanup(); - // eslint-disable-next-line prefer-promise-reject-errors - reject(); - }; - - this.once(ShardEvents.READY, onReady); - this.once(ShardEvents.RESUMED, onResumed); - this.once(ShardEvents.CLOSE, onClose); - this.once(ShardEvents.INVALID_SESSION, onInvalidOrDestroyed); - this.once(ShardEvents.DESTROYED, onInvalidOrDestroyed); - - if (this.connection?.readyState === WebSocket.OPEN) { - this.debug( - 'An open connection was found, attempting an immediate identify.', - ); - this.identify(); - return; - } - - if (this.connection) { - this.debug(`A connection object was found. Cleaning up before continuing. - State: ${CONNECTION_STATE[this.connection.readyState]}`); - this.destroy({ emit: false }); - } - - const wsQuery = { v: client.options.ws.version }; - - if (zlib) { - this.inflate = new zlib.Inflate({ - chunkSize: 65535, - flush: zlib.Z_SYNC_FLUSH, - to: WebSocket.encoding === 'json' ? 'string' : '', - }); - wsQuery.compress = 'zlib-stream'; - } - - this.debug( - `[CONNECT] - Gateway : ${gateway} - Version : ${client.options.ws.version} - Encoding : ${WebSocket.encoding} - Compression: ${zlib ? 'zlib-stream' : 'none'} - Agent : ${Util.verifyProxyAgent(client.options.ws.agent)}`, - ); - - this.status = - this.status === Status.DISCONNECTED - ? Status.RECONNECTING - : Status.CONNECTING; - this.setHelloTimeout(); - this.setWsCloseTimeout(-1); - this.connectedAt = Date.now(); - - // Adding a handshake timeout to just make sure no zombie connection appears. - const ws = (this.connection = WebSocket.create(gateway, wsQuery, { - handshakeTimeout: 30_000, - agent: Util.verifyProxyAgent(client.options.ws.agent) - ? client.options.ws.agent - : undefined, - })); - ws.onopen = this.onOpen.bind(this); - ws.onmessage = this.onMessage.bind(this); - ws.onerror = this.onError.bind(this); - ws.onclose = this.onClose.bind(this); - }); - } - - /** - * Called whenever a connection is opened to the gateway. - * @private - */ - onOpen() { - this.debug(`[CONNECTED] Took ${Date.now() - this.connectedAt}ms`); - this.status = Status.NEARLY; - } - - /** - * Called whenever a message is received. - * @param {MessageEvent} event Event received - * @private - */ - onMessage({ data }) { - let raw; - if (data instanceof ArrayBuffer) data = new Uint8Array(data); - if (zlib) { - const l = data.length; - const flush = - l >= 4 && - data[l - 4] === 0x00 && - data[l - 3] === 0x00 && - data[l - 2] === 0xff && - data[l - 1] === 0xff; - - this.inflate.push(data, flush && zlib.Z_SYNC_FLUSH); - if (!flush) return; - raw = this.inflate.result; - } else { - raw = data; - } - let packet; - try { - packet = WebSocket.unpack(raw); - } catch (err) { - this.manager.client.emit(Events.SHARD_ERROR, err, this.id); - return; - } - this.manager.client.emit(Events.RAW, packet, this.id); - if (packet.op === Opcodes.DISPATCH) - this.manager.emit(packet.t, packet.d, this.id); - this.onPacket(packet); - } - - /** - * Called whenever an error occurs with the WebSocket. - * @param {ErrorEvent} event The error that occurred - * @private - */ - onError(event) { - const error = event?.error ?? event; - if (!error) return; - - /** - * Emitted whenever a shard's WebSocket encounters a connection error. - * @event Client#shardError - * @param {Error} error The encountered error - * @param {number} shardId The shard that encountered this error - */ - this.manager.client.emit(Events.SHARD_ERROR, error, this.id); - } - - /** - * @external CloseEvent - * @see {@link https://developer.mozilla.org/docs/Web/API/CloseEvent} - */ - - /** - * @external ErrorEvent - * @see {@link https://developer.mozilla.org/docs/Web/API/ErrorEvent} - */ - - /** - * @external MessageEvent - * @see {@link https://developer.mozilla.org/docs/Web/API/MessageEvent} - */ - - /** - * Called whenever a connection to the gateway is closed. - * @param {CloseEvent} event Close event that was received - * @private - */ - onClose(event) { - this.closeEmitted = true; - if (this.sequence !== -1) this.closeSequence = this.sequence; - this.sequence = -1; - this.setHeartbeatTimer(-1); - this.setHelloTimeout(-1); - // Clearing the WebSocket close timeout as close was emitted. - this.setWsCloseTimeout(-1); - // If we still have a connection object, clean up its listeners - if (this.connection) { - this._cleanupConnection(); - // Having this after _cleanupConnection to just clean up the connection and not listen to ws.onclose - this.destroy({ reset: !this.sessionId, emit: false, log: false }); - } - this.status = Status.DISCONNECTED; - this.emitClose(event); - } - - /** - * This method is responsible to emit close event for this shard. - * This method helps the shard reconnect. - * @param {CloseEvent} [event] Close event that was received - */ - emitClose( - event = { - code: 1011, - reason: WSCodes[1011], - wasClean: false, - }, - ) { - this.debug(`[CLOSE] - Event Code: ${event.code} - Clean : ${event.wasClean} - Reason : ${event.reason ?? 'No reason received'}`); - /** - * Emitted when a shard's WebSocket closes. - * @private - * @event WebSocketShard#close - * @param {CloseEvent} event The received event - */ - this.emit(ShardEvents.CLOSE, event); - } - - /** - * Called whenever a packet is received. - * @param {Object} packet The received packet - * @private - */ - onPacket(packet) { - if (!packet) { - this.debug(`Received broken packet: '${packet}'.`); - return; - } - - switch (packet.t) { - case WSEvents.READY: - /** - * Emitted when the shard receives the READY payload and is now waiting for guilds - * @event WebSocketShard#ready - */ - this.emit(ShardEvents.READY); - - this.resumeURL = packet.d.resume_gateway_url; - this.sessionId = packet.d.session_id; - this.expectedGuilds = new Set( - packet.d.guilds - .filter((d) => d?.unavailable == true) - .map((d) => d.id), - ); - this.status = Status.WAITING_FOR_GUILDS; - this.debug( - `[READY] Session ${this.sessionId} | Resume url ${this.resumeURL}.`, - ); - this.lastHeartbeatAcked = true; - this.sendHeartbeat('ReadyHeartbeat'); - break; - case WSEvents.RESUMED: { - /** - * Emitted when the shard resumes successfully - * @event WebSocketShard#resumed - */ - this.emit(ShardEvents.RESUMED); - - this.status = Status.READY; - const replayed = packet.s - this.closeSequence; - this.debug( - `[RESUMED] Session ${this.sessionId} | Replayed ${replayed} events.`, - ); - this.lastHeartbeatAcked = true; - this.sendHeartbeat('ResumeHeartbeat'); - break; - } - } - - if (packet.s > this.sequence) this.sequence = packet.s; - - switch (packet.op) { - case Opcodes.HELLO: - this.setHelloTimeout(-1); - this.setHeartbeatTimer(packet.d.heartbeat_interval); - this.identify(); - break; - case Opcodes.RECONNECT: - this.debug('[RECONNECT] Discord asked us to reconnect'); - this.destroy({ closeCode: 4_000 }); - break; - case Opcodes.INVALID_SESSION: - this.debug(`[INVALID SESSION] Resumable: ${packet.d}.`); - // If we can resume the session, do so immediately - if (packet.d) { - this.identifyResume(); - return; - } - // Reset the sequence - this.sequence = -1; - // Reset the session id as it's invalid - this.sessionId = null; - // Set the status to reconnecting - this.status = Status.RECONNECTING; - // Finally, emit the INVALID_SESSION event - /** - * Emitted when the session has been invalidated. - * @event WebSocketShard#invalidSession - */ - this.emit(ShardEvents.INVALID_SESSION); - break; - case Opcodes.HEARTBEAT_ACK: - this.ackHeartbeat(); - break; - case Opcodes.HEARTBEAT: - this.sendHeartbeat('HeartbeatRequest', true); - break; - default: - this.manager.handlePacket(packet, this); - if ( - this.status === Status.WAITING_FOR_GUILDS && - packet.t === WSEvents.GUILD_CREATE - ) { - this.expectedGuilds.delete(packet.d.id); - this.checkReady(); - } - } - } - - /** - * Checks if the shard can be marked as ready - * @private - */ - checkReady() { - // Step 0. Clear the ready timeout, if it exists - if (this.readyTimeout) { - clearTimeout(this.readyTimeout); - this.readyTimeout = null; - } - // Step 1. If we don't have any other guilds pending, we are ready - if (!this.expectedGuilds.size) { - this.debug('Shard received all its guilds. Marking as fully ready.'); - this.status = Status.READY; - - /** - * Emitted when the shard is fully ready. - * This event is emitted if: - * * all guilds were received by this shard - * * the ready timeout expired, and some guilds are unavailable - * @event WebSocketShard#allReady - * @param {?Set} unavailableGuilds Set of unavailable guilds, if any - */ - this.emit(ShardEvents.ALL_READY); - return; - } - const hasGuildsIntent = new Intents( - this.manager.client.options.intents, - ).has(Intents.FLAGS.GUILDS); - // Step 2. Create a timeout that will mark the shard as ready if there are still unavailable guilds - // * The timeout is 15 seconds by default - // * This can be optionally changed in the client options via the `waitGuildTimeout` option - // * a timeout time of zero will skip this timeout, which potentially could cause the Client to miss guilds. - - const { waitGuildTimeout } = this.manager.client.options; - - this.readyTimeout = setTimeout( - () => { - this.debug( - `Shard ${hasGuildsIntent ? 'did' : 'will'} not receive any more guild packets` + - `${hasGuildsIntent ? ` in ${waitGuildTimeout} ms` : ''}.\nUnavailable guild count: ${ - this.expectedGuilds.size - }`, - ); - - this.readyTimeout = null; - - this.status = Status.READY; - - this.emit(ShardEvents.ALL_READY, this.expectedGuilds); - }, - hasGuildsIntent ? waitGuildTimeout : 0, - ).unref(); - } - - /** - * Sets the HELLO packet timeout. - * @param {number} [time] If set to -1, it will clear the hello timeout - * @private - */ - setHelloTimeout(time) { - if (time === -1) { - if (this.helloTimeout) { - this.debug('Clearing the HELLO timeout.'); - clearTimeout(this.helloTimeout); - this.helloTimeout = null; - } - return; - } - this.debug('Setting a HELLO timeout for 20s.'); - this.helloTimeout = setTimeout(() => { - this.debug( - 'Did not receive HELLO in time. Destroying and connecting again.', - ); - this.destroy({ reset: true, closeCode: 4009 }); - }, 20_000).unref(); - } - - /** - * Sets the WebSocket Close timeout. - * This method is responsible for detecting any zombie connections if the WebSocket fails to close properly. - * @param {number} [time] If set to -1, it will clear the timeout - * @private - */ - setWsCloseTimeout(time) { - if (this.wsCloseTimeout) { - this.debug('[WebSocket] Clearing the close timeout.'); - clearTimeout(this.wsCloseTimeout); - } - if (time === -1) { - this.wsCloseTimeout = null; - return; - } - this.wsCloseTimeout = setTimeout(() => { - this.setWsCloseTimeout(-1); - - // Check if close event was emitted. - if (this.closeEmitted) { - this.debug( - `[WebSocket] close was already emitted, assuming the connection was closed properly.`, - ); - // Setting the variable false to check for zombie connections. - this.closeEmitted = false; - return; - } - - this.debug( - // eslint-disable-next-line max-len - `[WebSocket] Close Emitted: ${this.closeEmitted} | did not close properly, assuming a zombie connection.\nEmitting close and reconnecting again.`, - ); - - if (this.connection) this._cleanupConnection(); - - this.emitClose({ - code: 4009, - reason: 'Session time out.', - wasClean: false, - }); - }, time); - } - - /** - * Sets the heartbeat timer for this shard. - * @param {number} time If -1, clears the interval, any other number sets an interval - * @private - */ - setHeartbeatTimer(time) { - if (time === -1) { - if (this.heartbeatInterval) { - this.debug('Clearing the heartbeat interval.'); - clearInterval(this.heartbeatInterval); - this.heartbeatInterval = null; - } - return; - } - this.debug(`Setting a heartbeat interval for ${time}ms.`); - // Sanity checks - if (this.heartbeatInterval) clearInterval(this.heartbeatInterval); - this.heartbeatInterval = setInterval( - () => this.sendHeartbeat(), - time, - ).unref(); - } - - /** - * Sends a heartbeat to the WebSocket. - * If this shard didn't receive a heartbeat last time, it will destroy it and reconnect - * @param {string} [tag='HeartbeatTimer'] What caused this heartbeat to be sent - * @param {boolean} [ignoreHeartbeatAck] If we should send the heartbeat forcefully. - * @private - */ - sendHeartbeat( - tag = 'HeartbeatTimer', - ignoreHeartbeatAck = [ - Status.WAITING_FOR_GUILDS, - Status.IDENTIFYING, - Status.RESUMING, - ].includes(this.status), - ) { - if (ignoreHeartbeatAck && !this.lastHeartbeatAcked) { - this.debug( - `[${tag}] Didn't process heartbeat ack yet but we are still connected. Sending one now.`, - ); - } else if (!this.lastHeartbeatAcked) { - this.debug( - `[${tag}] Didn't receive a heartbeat ack last time, assuming zombie connection. Destroying and reconnecting. - Status : ${STATUS_KEYS[this.status]} - Sequence : ${this.sequence} - Connection State: ${this.connection ? CONNECTION_STATE[this.connection.readyState] : 'No Connection??'}`, - ); - this.destroy({ reset: true, closeCode: 4009 }); - return; - } - - this.debug(`[${tag}] Sending a heartbeat.`); - this.lastHeartbeatAcked = false; - this.lastPingTimestamp = Date.now(); - this.send({ op: Opcodes.HEARTBEAT, d: this.sequence }, true); - } - - /** - * Acknowledges a heartbeat. - * @private - */ - ackHeartbeat() { - this.lastHeartbeatAcked = true; - const latency = Date.now() - this.lastPingTimestamp; - this.debug(`Heartbeat acknowledged, latency of ${latency}ms.`); - this.ping = latency; - } - - /** - * Identifies the client on the connection. - * @private - * @returns {void} - */ - identify() { - return this.sessionId ? this.identifyResume() : this.identifyNew(); - } - - /** - * Identifies as a new connection on the gateway. - * @private - */ - identifyNew() { - const { client } = this.manager; - if (!client.token) { - this.debug('[IDENTIFY] No token available to identify a new session.'); - return; - } - - this.status = Status.IDENTIFYING; - - // Patch something - Object.keys(client.options.ws.properties) - .filter((k) => k.startsWith('$')) - .forEach((k) => { - client.options.ws.properties[k.slice(1)] = - client.options.ws.properties[k]; - delete client.options.ws.properties[k]; - }); - - // Clone the identify payload and assign the token and shard info - const d = { - ...client.options.ws, - token: client.token, - }; - - delete d.version; - delete d.agent; - - this.debug(`[IDENTIFY] Shard ${this.id}`); - this.send({ op: Opcodes.IDENTIFY, d }, true); - } - - /** - * Resumes a session on the gateway. - * @private - */ - identifyResume() { - if (!this.sessionId) { - this.debug( - '[RESUME] No session id was present; identifying as a new session.', - ); - this.identifyNew(); - return; - } - - this.status = Status.RESUMING; - - this.debug( - `[RESUME] Session ${this.sessionId}, sequence ${this.closeSequence}`, - ); - - const d = { - token: this.manager.client.token, - session_id: this.sessionId, - seq: this.closeSequence, - }; - - this.send({ op: Opcodes.RESUME, d }, true); - } - - /** - * Adds a packet to the queue to be sent to the gateway. - * If you use this method, make sure you understand that you need to provide - * a full [Payload](https://discord.com/developers/docs/topics/gateway-events#payload-structure). - * Do not use this method if you don't know what you're doing. - * @param {Object} data The full packet to send - * @param {boolean} [important=false] If this packet should be added first in queue - */ - send(data, important = false) { - if (important) { - if (this.ratelimit.queueOffset === 0) { - this.ratelimit.queue.unshift(data); - } else { - this.ratelimit.queue[--this.ratelimit.queueOffset] = data; - } - } else { - this.ratelimit.queue.push(data); - } - this.processQueue(); - } - - /** - * Sends data, bypassing the queue. - * @param {Object} data Packet to send - * @returns {void} - * @private - */ - _send(data) { - if (this.connection?.readyState !== WebSocket.OPEN) { - this.debug( - `Tried to send packet '${JSON.stringify(data)}' but no WebSocket is available!`, - ); - this.destroy({ closeCode: 4_000 }); - return; - } - - this.debug(`[WebSocketShard] send packet '${JSON.stringify(data)}'`); - this.connection.send(WebSocket.pack(data), (err) => { - if (err) this.manager.client.emit(Events.SHARD_ERROR, err, this.id); - }); - } - - /** - * Processes the current WebSocket queue. - * @returns {void} - * @private - */ - processQueue() { - if (this.ratelimit.remaining === 0) return; - if (this.ratelimit.queueOffset >= this.ratelimit.queue.length) return; - if (this.ratelimit.remaining === this.ratelimit.total) { - this.ratelimit.timer = setTimeout(() => { - this.ratelimit.remaining = this.ratelimit.total; - this.processQueue(); - }, this.ratelimit.time).unref(); - } - while (this.ratelimit.remaining > 0) { - const item = this.ratelimit.queue[this.ratelimit.queueOffset++]; - if (!item) { - this._compactQueue(); - return; - } - this._send(item); - this.ratelimit.remaining--; - } - this._compactQueue(); - } - - _compactQueue() { - if (this.ratelimit.queueOffset === 0) return; - if (this.ratelimit.queueOffset >= this.ratelimit.queue.length) { - this.ratelimit.queue.length = 0; - this.ratelimit.queueOffset = 0; - return; - } - if (this.ratelimit.queueOffset > 512) { - this.ratelimit.queue = this.ratelimit.queue.slice(this.ratelimit.queueOffset); - this.ratelimit.queueOffset = 0; - } - } - - /** - * Destroys this shard and closes its WebSocket connection. - * @param {Object} [options={ closeCode: 1000, reset: false, emit: true, log: true }] Options for destroying the shard - * @private - */ - destroy({ closeCode = 1_000, reset = false, emit = true, log = true } = {}) { - if (log) { - this.debug(`[DESTROY] - Close Code : ${closeCode} - Reset : ${reset} - Emit DESTROYED: ${emit}`); - } - - // Step 0: Remove all timers - this.setHeartbeatTimer(-1); - this.setHelloTimeout(-1); - - this.debug( - `[WebSocket] Destroy: Attempting to close the WebSocket. | WS State: ${ - CONNECTION_STATE[this.connection?.readyState ?? WebSocket.CLOSED] - }`, - ); - // Step 1: Close the WebSocket connection, if any, otherwise, emit DESTROYED - if (this.connection) { - // If the connection is currently opened, we will (hopefully) receive close - if (this.connection.readyState === WebSocket.OPEN) { - this.connection.close(closeCode); - this.debug( - `[WebSocket] Close: Tried closing. | WS State: ${CONNECTION_STATE[this.connection.readyState]}`, - ); - } else { - // Connection is not OPEN - this.debug(`WS State: ${CONNECTION_STATE[this.connection.readyState]}`); - // Attempt to close the connection just in case - try { - this.connection.close(closeCode); - } catch (err) { - this.debug( - `[WebSocket] Close: Something went wrong while closing the WebSocket: ${ - err.message || err - }. Forcefully terminating the connection | WS State: ${CONNECTION_STATE[this.connection.readyState]}`, - ); - this.connection.terminate(); - } - // Emit the destroyed event if needed - if (emit) this._emitDestroyed(); - } - } else if (emit) { - // We requested a destroy, but we had no connection. Emit destroyed - this._emitDestroyed(); - } - - this.debug( - `[WebSocket] Adding a WebSocket close timeout to ensure a correct WS reconnect. - Timeout: ${this.manager.client.options.closeTimeout}ms`, - ); - this.setWsCloseTimeout(this.manager.client.options.closeTimeout); - - // Step 2: Null the connection object - this.connection = null; - - // Step 3: Set the shard status to DISCONNECTED - this.status = Status.DISCONNECTED; - - // Step 4: Cache the old sequence (use to attempt a resume) - if (this.sequence !== -1) this.closeSequence = this.sequence; - - // Step 5: Reset the sequence, resume URL and session id if requested - if (reset) { - this.resumeURL = null; - this.sequence = -1; - this.sessionId = null; - } - - // Step 6: reset the rate limit data - this.ratelimit.remaining = this.ratelimit.total; - this.ratelimit.queue.length = 0; - this.ratelimit.queueOffset = 0; - if (this.ratelimit.timer) { - clearTimeout(this.ratelimit.timer); - this.ratelimit.timer = null; - } - } - - /** - * Cleans up the WebSocket connection listeners. - * @private - */ - _cleanupConnection() { - this.connection.onopen = - this.connection.onclose = - this.connection.onmessage = - null; - this.connection.onerror = () => null; - } - - /** - * Emits the DESTROYED event on the shard - * @private - */ - _emitDestroyed() { - /** - * Emitted when a shard is destroyed, but no WebSocket connection was present. - * @private - * @event WebSocketShard#destroyed - */ - this.emit(ShardEvents.DESTROYED); - } -} - -module.exports = WebSocketShard; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/APPLICATION_COMMAND_CREATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/APPLICATION_COMMAND_CREATE.js deleted file mode 100644 index 069794c..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/APPLICATION_COMMAND_CREATE.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -const { Events } = require('../../../util/Constants'); - -module.exports = (client, { d: data }) => { - const commandManager = data.guild_id - ? client.guilds.cache.get(data.guild_id)?.commands - : client.application.commands; - if (!commandManager) return; - - const command = commandManager._add( - data, - data.application_id === client.application.id, - ); - - /** - * Emitted when a guild application command is created. - * @event Client#applicationCommandCreate - * @param {ApplicationCommand} command The command which was created - * @deprecated See {@link https://github.com/discord/discord-api-docs/issues/3690 this issue} for more information. - */ - client.emit(Events.APPLICATION_COMMAND_CREATE, command); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/APPLICATION_COMMAND_DELETE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/APPLICATION_COMMAND_DELETE.js deleted file mode 100644 index 0cbf5be..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/APPLICATION_COMMAND_DELETE.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -const { Events } = require('../../../util/Constants'); - -module.exports = (client, { d: data }) => { - const commandManager = data.guild_id - ? client.guilds.cache.get(data.guild_id)?.commands - : client.application.commands; - if (!commandManager) return; - - const isOwn = data.application_id === client.application.id; - const command = commandManager._add(data, isOwn); - if (isOwn) commandManager.cache.delete(data.id); - - /** - * Emitted when a guild application command is deleted. - * @event Client#applicationCommandDelete - * @param {ApplicationCommand} command The command which was deleted - * @deprecated See {@link https://github.com/discord/discord-api-docs/issues/3690 this issue} for more information. - */ - client.emit(Events.APPLICATION_COMMAND_DELETE, command); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/APPLICATION_COMMAND_PERMISSIONS_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/APPLICATION_COMMAND_PERMISSIONS_UPDATE.js deleted file mode 100644 index 73d4ec4..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/APPLICATION_COMMAND_PERMISSIONS_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.ApplicationCommandPermissionsUpdate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/APPLICATION_COMMAND_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/APPLICATION_COMMAND_UPDATE.js deleted file mode 100644 index 315fff2..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/APPLICATION_COMMAND_UPDATE.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -const { Events } = require('../../../util/Constants'); - -module.exports = (client, { d: data }) => { - const commandManager = data.guild_id - ? client.guilds.cache.get(data.guild_id)?.commands - : client.application.commands; - if (!commandManager) return; - - const oldCommand = commandManager.cache.get(data.id)?._clone() ?? null; - const newCommand = commandManager._add( - data, - data.application_id === client.application.id, - ); - - /** - * Emitted when a guild application command is updated. - * @event Client#applicationCommandUpdate - * @param {?ApplicationCommand} oldCommand The command before the update - * @param {ApplicationCommand} newCommand The command after the update - * @deprecated See {@link https://github.com/discord/discord-api-docs/issues/3690 this issue} for more information. - */ - client.emit(Events.APPLICATION_COMMAND_UPDATE, oldCommand, newCommand); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/AUTO_MODERATION_ACTION_EXECUTION.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/AUTO_MODERATION_ACTION_EXECUTION.js deleted file mode 100644 index 22463b6..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/AUTO_MODERATION_ACTION_EXECUTION.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.AutoModerationActionExecution.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/AUTO_MODERATION_RULE_CREATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/AUTO_MODERATION_RULE_CREATE.js deleted file mode 100644 index af64b9c..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/AUTO_MODERATION_RULE_CREATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.AutoModerationRuleCreate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/AUTO_MODERATION_RULE_DELETE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/AUTO_MODERATION_RULE_DELETE.js deleted file mode 100644 index 56ec504..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/AUTO_MODERATION_RULE_DELETE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.AutoModerationRuleDelete.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/AUTO_MODERATION_RULE_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/AUTO_MODERATION_RULE_UPDATE.js deleted file mode 100644 index 3caf6ba..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/AUTO_MODERATION_RULE_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.AutoModerationRuleUpdate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CALL_CREATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CALL_CREATE.js deleted file mode 100644 index d32888d..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CALL_CREATE.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -const CallState = require('../../../structures/CallState'); -const { Events } = require('../../../util/Constants'); -module.exports = (client, packet) => { - for (const voice of packet.d.voice_states) { - client.actions.VoiceStateUpdate.handle(voice); - } - /** - * Emitted whenever received a call - * @event Client#callCreate - * @param {CallState} call Call - */ - client.emit(Events.CALL_CREATE, new CallState(client, packet.d)); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CALL_DELETE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CALL_DELETE.js deleted file mode 100644 index ccf4711..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CALL_DELETE.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; -const CallState = require('../../../structures/CallState'); -const { Events } = require('../../../util/Constants'); -module.exports = (client, packet) => { - /** - * Emitted whenever delete a call - * @event Client#callDelete - * @param {Call} call Call - */ - client.emit(Events.CALL_DELETE, new CallState(client, packet.d)); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CALL_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CALL_UPDATE.js deleted file mode 100644 index ef72fc0..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CALL_UPDATE.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; -const CallState = require('../../../structures/CallState'); -const { Events } = require('../../../util/Constants'); -module.exports = (client, packet) => { - /** - * Emitted whenever update a call - * @event Client#callUpdate - * @param {Call} call Call - */ - client.emit(Events.CALL_UPDATE, new CallState(client, packet.d)); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_CREATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_CREATE.js deleted file mode 100644 index d6d560d..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_CREATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.ChannelCreate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_DELETE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_DELETE.js deleted file mode 100644 index cb9f3d8..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_DELETE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.ChannelDelete.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js deleted file mode 100644 index 134ed66..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -const { Events } = require('../../../util/Constants'); - -module.exports = (client, { d: data }) => { - const channel = client.channels.cache.get(data.channel_id); - const time = data.last_pin_timestamp - ? new Date(data.last_pin_timestamp).getTime() - : null; - - if (channel) { - // Discord sends null for last_pin_timestamp if the last pinned message was removed - channel.lastPinTimestamp = time; - - /** - * Emitted whenever the pins of a channel are updated. Due to the nature of the WebSocket event, - * not much information can be provided easily here - you need to manually check the pins yourself. - * @event Client#channelPinsUpdate - * @param {TextBasedChannels} channel The channel that the pins update occurred in - * @param {Date} time The time of the pins update - */ - client.emit(Events.CHANNEL_PINS_UPDATE, channel, time); - } -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_RECIPIENT_ADD.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_RECIPIENT_ADD.js deleted file mode 100644 index b89bcbb..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_RECIPIENT_ADD.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; -const { Events, Status } = require('../../../util/Constants'); -module.exports = (client, packet, shard) => { - const channel = client.channels.cache.get(packet.d.channel_id); - if (channel) { - if (!channel._recipients) channel._recipients = []; - channel._recipients.push(packet.d.user); - const user = client.users._add(packet.d.user); - if (shard.status == Status.READY) { - /** - * Emitted whenever a recipient is added from a group DM. - * @event Client#channelRecipientAdd - * @param {GroupDMChannel} channel Group DM channel - * @param {User} user User - */ - client.emit(Events.CHANNEL_RECIPIENT_ADD, channel, user); - } - } -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_RECIPIENT_REMOVE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_RECIPIENT_REMOVE.js deleted file mode 100644 index 37cfc23..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_RECIPIENT_REMOVE.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; -const { Events } = require('../../../util/Constants'); -module.exports = (client, packet) => { - const channel = client.channels.cache.get(packet.d.channel_id); - if (channel) { - if (!channel._recipients) channel._recipients = []; - channel._recipients = channel._recipients.filter( - (u) => u.id !== packet.d.user.id, - ); - /** - * Emitted whenever a recipient is removed from a group DM. - * @event Client#channelRecipientRemove - * @param {GroupDMChannel} channel Group DM channel - * @param {User} user User - */ - client.emit( - Events.CHANNEL_RECIPIENT_REMOVE, - channel, - client.users._add(packet.d.user), - ); - } -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_UPDATE.js deleted file mode 100644 index d441478..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/CHANNEL_UPDATE.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -const { Events } = require('../../../util/Constants'); - -module.exports = (client, packet) => { - const { old, updated } = client.actions.ChannelUpdate.handle(packet.d); - if (old && updated) { - /** - * Emitted whenever a channel is updated - e.g. name change, topic change, channel type change. - * @event Client#channelUpdate - * @param {DMChannel|GuildChannel} oldChannel The channel before the update - * @param {DMChannel|GuildChannel} newChannel The channel after the update - */ - client.emit(Events.CHANNEL_UPDATE, old, updated); - } -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_AUDIT_LOG_ENTRY_CREATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_AUDIT_LOG_ENTRY_CREATE.js deleted file mode 100644 index 8623141..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_AUDIT_LOG_ENTRY_CREATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.GuildAuditLogEntryCreate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_BAN_ADD.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_BAN_ADD.js deleted file mode 100644 index d8dc0f9..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_BAN_ADD.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.GuildBanAdd.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_BAN_REMOVE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_BAN_REMOVE.js deleted file mode 100644 index 8389e46..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_BAN_REMOVE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.GuildBanRemove.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_CREATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_CREATE.js deleted file mode 100644 index ad76f8d..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_CREATE.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -const { Events, Opcodes, Status } = require('../../../util/Constants'); - -const run = (client, guild) => { - const subs = {}; - subs[guild.id] = { - typing: true, - threads: true, - activities: true, - member_updates: true, - thread_member_lists: [], - members: [], - channels: {}, - }; - client.ws.broadcast({ - op: Opcodes.GUILD_SUBSCRIPTIONS_BULK, - d: { - subscriptions: subs, - }, - }); -}; - -module.exports = (client, { d: data }, shard) => { - let guild = client.guilds.cache.get(data.id); - run(client, data); - if (guild) { - if (!guild.available && !data.unavailable) { - // A newly available guild - guild._patch(data); - /** - * Emitted whenever a guild becomes available. - * @event Client#guildAvailable - * @param {Guild} guild The guild that became available - */ - client.emit(Events.GUILD_AVAILABLE, guild); - } - } else { - // A new guild - data.shardId = shard.id; - guild = client.guilds._add(data); - if (client.ws.status === Status.READY) { - /** - * Emitted whenever the client joins a guild. - * @event Client#guildCreate - * @param {Guild} guild The created guild - */ - client.emit(Events.GUILD_CREATE, guild); - run(client, guild); - } - } -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_DELETE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_DELETE.js deleted file mode 100644 index 27a3256..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_DELETE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.GuildDelete.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_EMOJIS_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_EMOJIS_UPDATE.js deleted file mode 100644 index e23b671..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_EMOJIS_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.GuildEmojisUpdate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_INTEGRATIONS_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_INTEGRATIONS_UPDATE.js deleted file mode 100644 index e90a72c..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_INTEGRATIONS_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.GuildIntegrationsUpdate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js deleted file mode 100644 index 860042a..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const { Events } = require('../../../util/Constants'); - -module.exports = (client, { d: data }) => { - const guild = client.guilds.cache.get(data.guild_id); - if (!guild) return; - const members = new Collection(); - - for (const member of data.members) - members.set(member.user.id, guild.members._add(member)); - if (data.presences) { - for (const presence of data.presences) - guild.presences._add(Object.assign(presence, { guild })); - } - - /** - * Represents the properties of a guild members chunk - * @typedef {Object} GuildMembersChunk - * @property {number} index Index of the received chunk - * @property {number} count Number of chunks the client should receive - * @property {?string} nonce Nonce for this chunk - * @property {Array<*>} notFound An array of whatever could not be found - * when using {@link Opcodes.REQUEST_GUILD_MEMBERS} - */ - - /** - * Emitted whenever a chunk of guild members is received (all members come from the same guild). - * @event Client#guildMembersChunk - * @param {Collection} members The members in the chunk - * @param {Guild} guild The guild related to the member chunk - * @param {GuildMembersChunk} chunk Properties of the received chunk - */ - client.emit(Events.GUILD_MEMBERS_CHUNK, members, guild, { - count: data.chunk_count, - index: data.chunk_index, - nonce: data.nonce, - notFound: data.not_found, - }); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_MEMBER_ADD.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_MEMBER_ADD.js deleted file mode 100644 index f6072fe..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_MEMBER_ADD.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -const { Events, Status } = require('../../../util/Constants'); - -module.exports = (client, { d: data }, shard) => { - const guild = client.guilds.cache.get(data.guild_id); - if (guild) { - guild.memberCount++; - const member = guild.members._add(data); - if (shard.status === Status.READY) { - /** - * Emitted whenever a user joins a guild. - * @event Client#guildMemberAdd - * @param {GuildMember} member The member that has joined a guild - * @deprecated See {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/issues/197 this issue} for more information. - */ - client.emit(Events.GUILD_MEMBER_ADD, member); - } - } -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_MEMBER_REMOVE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_MEMBER_REMOVE.js deleted file mode 100644 index 72432af..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_MEMBER_REMOVE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet, shard) => { - client.actions.GuildMemberRemove.handle(packet.d, shard); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_MEMBER_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_MEMBER_UPDATE.js deleted file mode 100644 index cafc6bd..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_MEMBER_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet, shard) => { - client.actions.GuildMemberUpdate.handle(packet.d, shard); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_ROLE_CREATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_ROLE_CREATE.js deleted file mode 100644 index da9e7bc..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_ROLE_CREATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.GuildRoleCreate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_ROLE_DELETE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_ROLE_DELETE.js deleted file mode 100644 index cdc6353..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_ROLE_DELETE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.GuildRoleDelete.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_ROLE_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_ROLE_UPDATE.js deleted file mode 100644 index 3a9b62e..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_ROLE_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.GuildRoleUpdate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_CREATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_CREATE.js deleted file mode 100644 index 04ff2df..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_CREATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.GuildScheduledEventCreate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_DELETE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_DELETE.js deleted file mode 100644 index b660c09..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_DELETE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.GuildScheduledEventDelete.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_UPDATE.js deleted file mode 100644 index 0064708..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.GuildScheduledEventUpdate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_ADD.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_ADD.js deleted file mode 100644 index d5adca2..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_ADD.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.GuildScheduledEventUserAdd.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_REMOVE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_REMOVE.js deleted file mode 100644 index 114df68..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_REMOVE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.GuildScheduledEventUserRemove.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_STICKERS_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_STICKERS_UPDATE.js deleted file mode 100644 index e3aba61..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_STICKERS_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.GuildStickersUpdate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_UPDATE.js deleted file mode 100644 index fd0012a..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/GUILD_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.GuildUpdate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/INTERACTION_MODAL_CREATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/INTERACTION_MODAL_CREATE.js deleted file mode 100644 index 584af85..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/INTERACTION_MODAL_CREATE.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -const Modal = require('../../../structures/Modal'); -const { Events } = require('../../../util/Constants'); - -module.exports = (client, { d: data }) => { - /** - * Emitted whenever client user receive interaction.showModal() - * @event Client#interactionModalCreate - * @param {Modal} modal The modal (extended) - */ - client.emit(Events.INTERACTION_MODAL_CREATE, new Modal(data, client)); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/INVITE_CREATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/INVITE_CREATE.js deleted file mode 100644 index 50a2e72..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/INVITE_CREATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.InviteCreate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/INVITE_DELETE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/INVITE_DELETE.js deleted file mode 100644 index 5971852..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/INVITE_DELETE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.InviteDelete.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_CREATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_CREATE.js deleted file mode 100644 index c9b79a8..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_CREATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.MessageCreate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_DELETE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_DELETE.js deleted file mode 100644 index 85ae2bc..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_DELETE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.MessageDelete.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_DELETE_BULK.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_DELETE_BULK.js deleted file mode 100644 index fbcf80f..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_DELETE_BULK.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.MessageDeleteBulk.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_POLL_VOTE_ADD.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_POLL_VOTE_ADD.js deleted file mode 100644 index 807597b..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_POLL_VOTE_ADD.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.MessagePollVoteAdd.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_POLL_VOTE_REMOVE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_POLL_VOTE_REMOVE.js deleted file mode 100644 index 3dee484..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_POLL_VOTE_REMOVE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.MessagePollVoteRemove.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_REACTION_ADD.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_REACTION_ADD.js deleted file mode 100644 index e219b4a..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_REACTION_ADD.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.MessageReactionAdd.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE.js deleted file mode 100644 index 2980e69..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.MessageReactionRemove.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_ALL.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_ALL.js deleted file mode 100644 index ead80f7..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_ALL.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.MessageReactionRemoveAll.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_EMOJI.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_EMOJI.js deleted file mode 100644 index 579444c..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_EMOJI.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.MessageReactionRemoveEmoji.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_UPDATE.js deleted file mode 100644 index 7428e90..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_UPDATE.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -const { Events } = require('../../../util/Constants'); - -module.exports = (client, packet) => { - const { old, updated } = client.actions.MessageUpdate.handle(packet.d); - if (old && updated) { - /** - * Emitted whenever a message is updated - e.g. embed or content change. - * @event Client#messageUpdate - * @param {Message} oldMessage The message before the update - * @param {Message} newMessage The message after the update - */ - client.emit(Events.MESSAGE_UPDATE, old, updated); - } -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/PRESENCE_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/PRESENCE_UPDATE.js deleted file mode 100644 index bde3629..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/PRESENCE_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.PresenceUpdate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/READY.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/READY.js deleted file mode 100644 index 4e3b219..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/READY.js +++ /dev/null @@ -1,123 +0,0 @@ -'use strict'; - -const USER_REQUIRED_ACTION = require('./USER_REQUIRED_ACTION_UPDATE'); -const { Opcodes } = require('../../../util/Constants'); - -let ClientUser; - -module.exports = (client, { d: data }, shard) => { - // Check - USER_REQUIRED_ACTION(client, { d: data }); - - // Overwrite ClientPresence - client.presence.userId = data.user.id; - - if (client.user) { - client.user._patch(data.user); - } else { - ClientUser ??= require('../../../structures/ClientUser'); - client.user = new ClientUser(client, data.user); - client.users.cache.set(client.user.id, client.user); - } - - for (const private_channel of data.private_channels) { - client.channels._add(private_channel); - } - - for (const guild of data.guilds) { - guild.shardId = shard.id; - client.guilds._add(guild); - } - - // User Notes - client.notes._reload(data.notes); - - // Relationship - client.relationships._setup(data.relationships); - - // ClientSetting - client.settings._patch(data.user_settings); - - // GuildSetting - for (const gSetting of Array.isArray(data.user_guild_settings) - ? data.user_guild_settings - : []) { - const guild = client.guilds.cache.get(gSetting.guild_id); - if (guild) guild.settings._patch(gSetting); - } - // Todo: data.auth_session_id_hash - client.sessions.currentSessionIdHash = data.auth_session_id_hash; - - if (data.guilds.length) { - if (data.guilds.length > 80) { - // Split data bc 15kb - const data1 = data.guilds.slice(0, Math.floor(data.guilds.length / 2)); - const data2 = data.guilds.slice(Math.floor(data.guilds.length / 2)); - client.ws.broadcast({ - op: Opcodes.GUILD_SUBSCRIPTIONS_BULK, - d: { - subscriptions: data1.reduce((accumulator, guild) => { - accumulator[guild.id] = { - typing: true, - threads: true, - activities: true, - member_updates: true, - thread_member_lists: [], - members: [], - channels: {}, - }; - return accumulator; - }, {}), - }, - }); - client.ws.broadcast({ - op: Opcodes.GUILD_SUBSCRIPTIONS_BULK, - d: { - subscriptions: data2.reduce((accumulator, guild) => { - accumulator[guild.id] = { - typing: true, - threads: true, - activities: true, - member_updates: true, - thread_member_lists: [], - members: [], - channels: {}, - }; - return accumulator; - }, {}), - }, - }); - } else { - client.ws.broadcast({ - op: Opcodes.GUILD_SUBSCRIPTIONS_BULK, - d: { - subscriptions: data.guilds.reduce((accumulator, guild) => { - accumulator[guild.id] = { - typing: true, - threads: true, - activities: true, - member_updates: true, - thread_member_lists: [], - members: [], - channels: {}, - }; - return accumulator; - }, {}), - }, - }); - } - } - - Promise.all( - data.private_channels.map(async (c, index) => { - if (client.options.DMChannelVoiceStatusSync < 1) return; - client.ws.broadcast({ - op: Opcodes.DM_UPDATE, - d: { - channel_id: c.id, - }, - }); - await client.sleep(client.options.DMChannelVoiceStatusSync * index); - }), - ).then(() => shard.checkReady()); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/RELATIONSHIP_ADD.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/RELATIONSHIP_ADD.js deleted file mode 100644 index 422ba72..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/RELATIONSHIP_ADD.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -const { Events } = require('../../../util/Constants'); - -module.exports = (client, { d: data }) => { - if (data.user) { - client.users._add(data.user); - } - client.relationships.cache.set(data.id, data.type); - client.relationships.friendNicknames.set(data.id, data.nickname); - client.relationships.sinceCache.set(data.id, new Date(data.since || 0)); - /** - * Emitted when a relationship is created, relevant to the current user. - * @event Client#relationshipAdd - * @param {Snowflake} user Target userId - * @param {boolean} shouldNotify Whether the client should notify the user of this relationship's creation - */ - client.emit(Events.RELATIONSHIP_ADD, data.id, Boolean(data.should_notify)); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/RELATIONSHIP_REMOVE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/RELATIONSHIP_REMOVE.js deleted file mode 100644 index e764089..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/RELATIONSHIP_REMOVE.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -const { Events } = require('../../../util/Constants'); - -module.exports = (client, { d: data }) => { - client.relationships.cache.delete(data.id); - client.relationships.friendNicknames.delete(data.id); - client.relationships.sinceCache.delete(data.id); - /** - * Emitted when a relationship is removed, relevant to the current user. - * @event Client#relationshipRemove - * @param {Snowflake} user The userID that was updated - * @param {RelationshipType} type The type of the old relationship - * @param {string | null} nickname The nickname of the user in this relationship (1-32 characters) - */ - client.emit(Events.RELATIONSHIP_REMOVE, data.id, data.type, data.nickname); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/RELATIONSHIP_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/RELATIONSHIP_UPDATE.js deleted file mode 100644 index ee67789..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/RELATIONSHIP_UPDATE.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -const { Events } = require('../../../util/Constants'); - -module.exports = (client, { d: data }) => { - /** - * @typedef {Object} RelationshipUpdateObject - * @property {RelationshipType} type The type of relationship - * @property {Date} since When the user requested a relationship - * @property {string | null} nickname The nickname of the user in this relationship (1-32 characters) - */ - /** - * Emitted when a relationship is updated, relevant to the current user (e.g. friend nickname changed). - * This is not sent when the type of a relationship changes; see {@link Client#relationshipAdd} and {@link Client#relationshipRemove} for that. - * @event Client#relationshipUpdate - * @param {Snowflake} user The userID that was updated - * @param {RelationshipUpdateObject} oldData Old data - * @param {RelationshipUpdateObject} newData New data - */ - const oldType = client.relationships.cache.get(data.id); - const oldSince = client.relationships.sinceCache.get(data.id); - const oldNickname = client.relationships.friendNicknames.get(data.id); - // Update - if (data.type) client.relationships.cache.set(data.id, data.type); - if (data.nickname) - client.relationships.friendNicknames.set(data.id, data.nickname); - if (data.since) - client.relationships.sinceCache.set(data.id, new Date(data.since || 0)); - client.emit( - Events.RELATIONSHIP_UPDATE, - data.id, - { - type: oldType, - nickname: oldNickname, - since: oldSince, - }, - { - type: data.type, - nickname: data.nickname, - since: new Date(data.since || 0), - }, - ); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/RESUMED.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/RESUMED.js deleted file mode 100644 index bf72d3a..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/RESUMED.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -const { Events } = require('../../../util/Constants'); - -module.exports = (client, packet, shard) => { - const replayed = shard.sequence - shard.closeSequence; - /** - * Emitted when a shard resumes successfully. - * @event Client#shardResume - * @param {number} id The shard id that resumed - * @param {number} replayedEvents The amount of replayed events - */ - client.emit(Events.SHARD_RESUME, shard.id, replayed); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/STAGE_INSTANCE_CREATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/STAGE_INSTANCE_CREATE.js deleted file mode 100644 index 77ae2ff..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/STAGE_INSTANCE_CREATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.StageInstanceCreate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/STAGE_INSTANCE_DELETE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/STAGE_INSTANCE_DELETE.js deleted file mode 100644 index e2bb627..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/STAGE_INSTANCE_DELETE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.StageInstanceDelete.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/STAGE_INSTANCE_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/STAGE_INSTANCE_UPDATE.js deleted file mode 100644 index fabc84a..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/STAGE_INSTANCE_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.StageInstanceUpdate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_CREATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_CREATE.js deleted file mode 100644 index d92cab0..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_CREATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.ThreadCreate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_DELETE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_DELETE.js deleted file mode 100644 index 1140a08..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_DELETE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.ThreadDelete.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_LIST_SYNC.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_LIST_SYNC.js deleted file mode 100644 index 17b173a..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_LIST_SYNC.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.ThreadListSync.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js deleted file mode 100644 index f3c7a73..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.ThreadMembersUpdate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_MEMBER_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_MEMBER_UPDATE.js deleted file mode 100644 index a111b0a..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_MEMBER_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.ThreadMemberUpdate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_UPDATE.js deleted file mode 100644 index 795cb29..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/THREAD_UPDATE.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -const { Events } = require('../../../util/Constants'); - -module.exports = (client, packet) => { - const { old, updated } = client.actions.ChannelUpdate.handle(packet.d); - if (old && updated) { - /** - * Emitted whenever a thread is updated - e.g. name change, archive state change, locked state change. - * @event Client#threadUpdate - * @param {ThreadChannel} oldThread The thread before the update - * @param {ThreadChannel} newThread The thread after the update - */ - client.emit(Events.THREAD_UPDATE, old, updated); - } -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/TYPING_START.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/TYPING_START.js deleted file mode 100644 index 9a56a54..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/TYPING_START.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.TypingStart.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/USER_GUILD_SETTINGS_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/USER_GUILD_SETTINGS_UPDATE.js deleted file mode 100644 index 2b6dec1..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/USER_GUILD_SETTINGS_UPDATE.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = (client, { d: data }) => { - const guild = client.guilds.cache.get(data.guild_id); - if (guild) guild?.settings._patch(data); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/USER_NOTE_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/USER_NOTE_UPDATE.js deleted file mode 100644 index daa1708..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/USER_NOTE_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, { d: data }) => { - client.notes.cache.set(data.id, data.note); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/USER_REQUIRED_ACTION_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/USER_REQUIRED_ACTION_UPDATE.js deleted file mode 100644 index 54863d5..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/USER_REQUIRED_ACTION_UPDATE.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -module.exports = (client, { d: data }) => { - let msg; - switch (data.required_action) { - case undefined: - case null: { - msg = 'All required actions have been completed.'; - break; - } - case 'AGREEMENTS': { - msg = 'You need to accept the new Terms of Service and Privacy Policy.'; - // https://discord.com/api/v9/users/@me/agreements - client.api - .users('@me') - .agreements.patch({ - data: { - terms: true, - privacy: true, - }, - }) - .then(() => { - client.emit( - 'debug', - '[USER_REQUIRED_ACTION] Successfully accepted the new Terms of Service and Privacy Policy.', - ); - }) - .catch((e) => { - client.emit( - 'debug', - `[USER_REQUIRED_ACTION] Failed to accept the new Terms of Service and Privacy Policy: ${e}`, - ); - }); - break; - } - case 'REQUIRE_CAPTCHA': { - msg = 'You need to complete a captcha.'; - break; - } - case 'REQUIRE_VERIFIED_EMAIL': { - msg = 'You need to verify your email.'; - break; - } - case 'REQUIRE_REVERIFIED_EMAIL': { - msg = 'You need to reverify your email.'; - break; - } - case 'REQUIRE_VERIFIED_PHONE': { - msg = 'You need to verify your phone number.'; - break; - } - case 'REQUIRE_REVERIFIED_PHONE': { - msg = 'You need to reverify your phone number.'; - break; - } - case 'REQUIRE_VERIFIED_EMAIL_OR_VERIFIED_PHONE': { - msg = 'You need to verify your email or verify your phone number.'; - break; - } - case 'REQUIRE_REVERIFIED_EMAIL_OR_VERIFIED_PHONE': { - msg = 'You need to reverify your email or verify your phone number.'; - break; - } - case 'REQUIRE_VERIFIED_EMAIL_OR_REVERIFIED_PHONE': { - msg = 'You need to verify your email or reverify your phone number.'; - break; - } - case 'REQUIRE_REVERIFIED_EMAIL_OR_REVERIFIED_PHONE': { - msg = 'You need to reverify your email or reverify your phone number.'; - break; - } - default: { - msg = `Unknown required action: ${data.required_action}`; - break; - } - } - client.emit('debug', `[USER_REQUIRED_ACTION] ${msg}`); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/USER_SETTINGS_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/USER_SETTINGS_UPDATE.js deleted file mode 100644 index b178c14..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/USER_SETTINGS_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, { d: data }) => { - client.settings._patch(data); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/USER_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/USER_UPDATE.js deleted file mode 100644 index a02bf58..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/USER_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.UserUpdate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/VOICE_CHANNEL_EFFECT_SEND.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/VOICE_CHANNEL_EFFECT_SEND.js deleted file mode 100644 index d54051f..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/VOICE_CHANNEL_EFFECT_SEND.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -const VoiceChannelEffect = require('../../../structures/VoiceChannelEffect'); -const { Events } = require('../../../util/Constants'); - -module.exports = (client, { d: data }) => { - const guild = client.guilds.cache.get(data.guild_id); - if (!guild) return; - - /** - * Emmited when someone sends an effect, such as an emoji reaction, in a voice channel the client is connected to. - * @event Client#voiceChannelEffectSend - * @param {VoiceChannelEffect} voiceChannelEffect The sent voice channel effect - */ - client.emit( - Events.VOICE_CHANNEL_EFFECT_SEND, - new VoiceChannelEffect(data, guild), - ); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/VOICE_CHANNEL_STATUS_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/VOICE_CHANNEL_STATUS_UPDATE.js deleted file mode 100644 index 266af47..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/VOICE_CHANNEL_STATUS_UPDATE.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -const { Events } = require('../../../util/Constants'); - -module.exports = (client, { d: data }) => { - const channel = client.channels.cache.get(data.id); - if (channel) { - const old = channel._clone(); - channel.status = data.status; - client.emit(Events.CHANNEL_UPDATE, old, channel); - } -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/VOICE_SERVER_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/VOICE_SERVER_UPDATE.js deleted file mode 100644 index a3feb7b..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/VOICE_SERVER_UPDATE.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.emit( - 'debug', - `[VOICE] received voice server: ${JSON.stringify(packet)}`, - ); - client.voice.onVoiceServer(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/VOICE_STATE_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/VOICE_STATE_UPDATE.js deleted file mode 100644 index dbff6ea..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/VOICE_STATE_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.VoiceStateUpdate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/WEBHOOKS_UPDATE.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/WEBHOOKS_UPDATE.js deleted file mode 100644 index 46cacee..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/WEBHOOKS_UPDATE.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (client, packet) => { - client.actions.WebhooksUpdate.handle(packet.d); -}; diff --git a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/index.js b/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/index.js deleted file mode 100644 index b8e49b6..0000000 --- a/vendor/discord.js-selfbot-v13/src/client/websocket/handlers/index.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -const handlers = Object.fromEntries([ - ['READY', require('./READY')], - ['RESUMED', require('./RESUMED')], - ['APPLICATION_COMMAND_CREATE', require('./APPLICATION_COMMAND_CREATE')], - ['APPLICATION_COMMAND_DELETE', require('./APPLICATION_COMMAND_DELETE')], - ['APPLICATION_COMMAND_UPDATE', require('./APPLICATION_COMMAND_UPDATE')], - [ - 'APPLICATION_COMMAND_PERMISSIONS_UPDATE', - require('./APPLICATION_COMMAND_PERMISSIONS_UPDATE'), - ], - [ - 'AUTO_MODERATION_ACTION_EXECUTION', - require('./AUTO_MODERATION_ACTION_EXECUTION'), - ], - ['AUTO_MODERATION_RULE_CREATE', require('./AUTO_MODERATION_RULE_CREATE')], - ['AUTO_MODERATION_RULE_DELETE', require('./AUTO_MODERATION_RULE_DELETE')], - ['AUTO_MODERATION_RULE_UPDATE', require('./AUTO_MODERATION_RULE_UPDATE')], - ['GUILD_CREATE', require('./GUILD_CREATE')], - ['GUILD_DELETE', require('./GUILD_DELETE')], - ['GUILD_UPDATE', require('./GUILD_UPDATE')], - ['INVITE_CREATE', require('./INVITE_CREATE')], - ['INVITE_DELETE', require('./INVITE_DELETE')], - ['GUILD_MEMBER_ADD', require('./GUILD_MEMBER_ADD')], - ['GUILD_MEMBER_REMOVE', require('./GUILD_MEMBER_REMOVE')], - ['GUILD_MEMBER_UPDATE', require('./GUILD_MEMBER_UPDATE')], - ['GUILD_MEMBERS_CHUNK', require('./GUILD_MEMBERS_CHUNK')], - ['GUILD_INTEGRATIONS_UPDATE', require('./GUILD_INTEGRATIONS_UPDATE')], - ['GUILD_ROLE_CREATE', require('./GUILD_ROLE_CREATE')], - ['GUILD_ROLE_DELETE', require('./GUILD_ROLE_DELETE')], - ['GUILD_ROLE_UPDATE', require('./GUILD_ROLE_UPDATE')], - ['GUILD_BAN_ADD', require('./GUILD_BAN_ADD')], - ['GUILD_BAN_REMOVE', require('./GUILD_BAN_REMOVE')], - ['GUILD_EMOJIS_UPDATE', require('./GUILD_EMOJIS_UPDATE')], - ['CHANNEL_CREATE', require('./CHANNEL_CREATE')], - ['CHANNEL_DELETE', require('./CHANNEL_DELETE')], - ['CHANNEL_UPDATE', require('./CHANNEL_UPDATE')], - ['CHANNEL_PINS_UPDATE', require('./CHANNEL_PINS_UPDATE')], - ['MESSAGE_CREATE', require('./MESSAGE_CREATE')], - ['MESSAGE_DELETE', require('./MESSAGE_DELETE')], - ['MESSAGE_UPDATE', require('./MESSAGE_UPDATE')], - ['MESSAGE_DELETE_BULK', require('./MESSAGE_DELETE_BULK')], - ['MESSAGE_REACTION_ADD', require('./MESSAGE_REACTION_ADD')], - ['MESSAGE_REACTION_REMOVE', require('./MESSAGE_REACTION_REMOVE')], - ['MESSAGE_REACTION_REMOVE_ALL', require('./MESSAGE_REACTION_REMOVE_ALL')], - ['MESSAGE_REACTION_REMOVE_EMOJI', require('./MESSAGE_REACTION_REMOVE_EMOJI')], - ['THREAD_CREATE', require('./THREAD_CREATE')], - ['THREAD_UPDATE', require('./THREAD_UPDATE')], - ['THREAD_DELETE', require('./THREAD_DELETE')], - ['THREAD_LIST_SYNC', require('./THREAD_LIST_SYNC')], - ['THREAD_MEMBER_UPDATE', require('./THREAD_MEMBER_UPDATE')], - ['THREAD_MEMBERS_UPDATE', require('./THREAD_MEMBERS_UPDATE')], - ['USER_UPDATE', require('./USER_UPDATE')], - ['PRESENCE_UPDATE', require('./PRESENCE_UPDATE')], - ['TYPING_START', require('./TYPING_START')], - ['VOICE_CHANNEL_EFFECT_SEND', require('./VOICE_CHANNEL_EFFECT_SEND')], - ['VOICE_STATE_UPDATE', require('./VOICE_STATE_UPDATE')], - ['VOICE_SERVER_UPDATE', require('./VOICE_SERVER_UPDATE')], - ['WEBHOOKS_UPDATE', require('./WEBHOOKS_UPDATE')], - ['STAGE_INSTANCE_CREATE', require('./STAGE_INSTANCE_CREATE')], - ['STAGE_INSTANCE_UPDATE', require('./STAGE_INSTANCE_UPDATE')], - ['STAGE_INSTANCE_DELETE', require('./STAGE_INSTANCE_DELETE')], - ['GUILD_STICKERS_UPDATE', require('./GUILD_STICKERS_UPDATE')], - ['GUILD_SCHEDULED_EVENT_CREATE', require('./GUILD_SCHEDULED_EVENT_CREATE')], - ['GUILD_SCHEDULED_EVENT_UPDATE', require('./GUILD_SCHEDULED_EVENT_UPDATE')], - ['GUILD_SCHEDULED_EVENT_DELETE', require('./GUILD_SCHEDULED_EVENT_DELETE')], - [ - 'GUILD_SCHEDULED_EVENT_USER_ADD', - require('./GUILD_SCHEDULED_EVENT_USER_ADD'), - ], - [ - 'GUILD_SCHEDULED_EVENT_USER_REMOVE', - require('./GUILD_SCHEDULED_EVENT_USER_REMOVE'), - ], - ['GUILD_AUDIT_LOG_ENTRY_CREATE', require('./GUILD_AUDIT_LOG_ENTRY_CREATE')], - // Selfbot - ['RELATIONSHIP_ADD', require('./RELATIONSHIP_ADD')], - ['RELATIONSHIP_REMOVE', require('./RELATIONSHIP_REMOVE')], - ['RELATIONSHIP_UPDATE', require('./RELATIONSHIP_UPDATE')], - ['USER_NOTE_UPDATE', require('./USER_NOTE_UPDATE')], - ['CHANNEL_RECIPIENT_ADD', require('./CHANNEL_RECIPIENT_ADD')], - ['CHANNEL_RECIPIENT_REMOVE', require('./CHANNEL_RECIPIENT_REMOVE')], - ['INTERACTION_MODAL_CREATE', require('./INTERACTION_MODAL_CREATE')], - ['USER_REQUIRED_ACTION_UPDATE', require('./USER_REQUIRED_ACTION_UPDATE')], - ['CALL_CREATE', require('./CALL_CREATE')], - ['CALL_UPDATE', require('./CALL_UPDATE')], - ['CALL_DELETE', require('./CALL_DELETE')], - ['USER_SETTINGS_UPDATE', require('./USER_SETTINGS_UPDATE')], - ['USER_GUILD_SETTINGS_UPDATE', require('./USER_GUILD_SETTINGS_UPDATE')], - ['VOICE_CHANNEL_STATUS_UPDATE', require('./VOICE_CHANNEL_STATUS_UPDATE')], - ['MESSAGE_POLL_VOTE_ADD', require('./MESSAGE_POLL_VOTE_ADD')], - ['MESSAGE_POLL_VOTE_REMOVE', require('./MESSAGE_POLL_VOTE_REMOVE')], -]); - -module.exports = handlers; diff --git a/vendor/discord.js-selfbot-v13/src/errors/DJSError.js b/vendor/discord.js-selfbot-v13/src/errors/DJSError.js deleted file mode 100644 index 5e33367..0000000 --- a/vendor/discord.js-selfbot-v13/src/errors/DJSError.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; - -// Heavily inspired by node's `internal/errors` module - -const kCode = Symbol('code'); -const messages = new Map(); - -/** - * Extend an error of some sort into a DiscordjsError. - * @param {Error} Base Base error to extend - * @returns {DiscordjsError} - */ -function makeDiscordjsError(Base) { - return class DiscordjsError extends Base { - constructor(key, ...args) { - super(message(key, args)); - this[kCode] = key; - if (Error.captureStackTrace) - Error.captureStackTrace(this, DiscordjsError); - } - - get name() { - return `${super.name} [${this[kCode]}]`; - } - - get code() { - return this[kCode]; - } - }; -} - -/** - * Format the message for an error. - * @param {string} key Error key - * @param {Array<*>} args Arguments to pass for util format or as function args - * @returns {string} Formatted string - */ -function message(key, args) { - if (typeof key !== 'string') - throw new Error('Error message key must be a string'); - const msg = messages.get(key); - if (!msg) throw new Error(`An invalid error message key was used: ${key}.`); - if (typeof msg === 'function') return msg(...args); - if (!args?.length) return msg; - args.unshift(msg); - return String(...args); -} - -/** - * Register an error code and message. - * @param {string} sym Unique name for the error - * @param {*} val Value of the error - */ -function register(sym, val) { - messages.set(sym, typeof val === 'function' ? val : String(val)); -} - -module.exports = { - register, - Error: makeDiscordjsError(Error), - TypeError: makeDiscordjsError(TypeError), - RangeError: makeDiscordjsError(RangeError), -}; diff --git a/vendor/discord.js-selfbot-v13/src/errors/Messages.js b/vendor/discord.js-selfbot-v13/src/errors/Messages.js deleted file mode 100644 index 196d680..0000000 --- a/vendor/discord.js-selfbot-v13/src/errors/Messages.js +++ /dev/null @@ -1,267 +0,0 @@ -'use strict'; - -const { register } = require('./DJSError'); - -const Messages = { - CLIENT_INVALID_OPTION: (prop, must) => `The ${prop} option must be ${must}`, - CLIENT_INVALID_PROVIDED_SHARDS: 'None of the provided shards were valid.', - CLIENT_MISSING_INTENTS: 'Valid intents must be provided for the Client.', - CLIENT_NOT_READY: (action) => - `The client needs to be logged in to ${action}.`, - - TOKEN_INVALID: 'An invalid token was provided.', - TOKEN_MISSING: - 'Request to use token, but token was unavailable to the client.', - TOTPKEY_MISSING: - 'Request to use mfa, but TOTPKey was not set in client options.', - - WS_CLOSE_REQUESTED: 'WebSocket closed due to user request.', - WS_CONNECTION_EXISTS: 'There is already an existing WebSocket connection.', - WS_NOT_OPEN: (data = 'data') => `WebSocket not open to send ${data}`, - MANAGER_DESTROYED: 'Manager was destroyed.', - - BITFIELD_INVALID: (bit) => `Invalid bitfield flag or number: ${bit}.`, - - SHARDING_INVALID: '[Bot Token] Invalid shard settings were provided.', - SHARDING_REQUIRED: - '[Bot Token] This session would have handled too many guilds - Sharding is required.', - INVALID_INTENTS: '[Bot Token] Invalid intent provided for WebSocket intents.', - DISALLOWED_INTENTS: - '[Bot Token] Privileged intent provided is not enabled or whitelisted.', - SHARDING_NO_SHARDS: 'No shards have been spawned.', - SHARDING_IN_PROCESS: 'Shards are still being spawned.', - SHARDING_INVALID_EVAL_BROADCAST: 'Script to evaluate must be a function', - SHARDING_SHARD_NOT_FOUND: (id) => `Shard ${id} could not be found.`, - SHARDING_ALREADY_SPAWNED: (count) => `Already spawned ${count} shards.`, - SHARDING_PROCESS_EXISTS: (id) => `Shard ${id} already has an active process.`, - SHARDING_WORKER_EXISTS: (id) => `Shard ${id} already has an active worker.`, - SHARDING_READY_TIMEOUT: (id) => - `Shard ${id}'s Client took too long to become ready.`, - SHARDING_READY_DISCONNECTED: (id) => - `Shard ${id}'s Client disconnected before becoming ready.`, - SHARDING_READY_DIED: (id) => - `Shard ${id}'s process exited before its Client became ready.`, - SHARDING_NO_CHILD_EXISTS: (id) => - `Shard ${id} has no active process or worker.`, - SHARDING_SHARD_MISCALCULATION: (shard, guild, count) => - `Calculated invalid shard ${shard} for guild ${guild} with ${count} shards.`, - - COLOR_RANGE: 'Color must be within the range 0 - 16777215 (0xFFFFFF).', - COLOR_CONVERT: 'Unable to convert color to a number.', - - INVITE_OPTIONS_MISSING_CHANNEL: - 'A valid guild channel must be provided when GuildScheduledEvent is EXTERNAL.', - - EMBED_TITLE: 'MessageEmbed title must be a string.', - EMBED_FIELD_NAME: 'MessageEmbed field names must be non-empty strings.', - EMBED_FIELD_VALUE: 'MessageEmbed field values must be non-empty strings.', - EMBED_FOOTER_TEXT: 'MessageEmbed footer text must be a string.', - EMBED_DESCRIPTION: 'MessageEmbed description must be a string.', - EMBED_AUTHOR_NAME: 'MessageEmbed author name must be a string.', - - BUTTON_LABEL: 'MessageButton label must be a string', - BUTTON_URL: 'MessageButton URL must be a string', - BUTTON_CUSTOM_ID: 'MessageButton customId must be a string', - - SELECT_MENU_CUSTOM_ID: 'MessageSelectMenu customId must be a string', - SELECT_MENU_PLACEHOLDER: 'MessageSelectMenu placeholder must be a string', - SELECT_OPTION_LABEL: 'MessageSelectOption label must be a string', - SELECT_OPTION_VALUE: 'MessageSelectOption value must be a string', - SELECT_OPTION_DESCRIPTION: 'MessageSelectOption description must be a string', - - TEXT_INPUT_CUSTOM_ID: 'TextInputComponent customId must be a string', - TEXT_INPUT_LABEL: 'TextInputComponent label must be a string', - TEXT_INPUT_PLACEHOLDER: 'TextInputComponent placeholder must be a string', - TEXT_INPUT_VALUE: 'TextInputComponent value must be a string', - - MODAL_CUSTOM_ID: 'Modal customId must be a string', - MODAL_TITLE: 'Modal title must be a string', - - INTERACTION_COLLECTOR_ERROR: (reason) => - `Collector received no interactions before ending with reason: ${reason}`, - - FILE_NOT_FOUND: (file) => `File could not be found: ${file}`, - - USER_BANNER_NOT_FETCHED: - "You must fetch this user's banner before trying to generate its URL!", - USER_NO_DM_CHANNEL: 'No DM Channel exists!', - - VOICE_NOT_STAGE_CHANNEL: 'You are only allowed to do this in stage channels.', - - VOICE_STATE_NOT_OWN: - 'You cannot self-deafen/mute/request to speak on VoiceStates that do not belong to the ClientUser.', - VOICE_STATE_INVALID_TYPE: (name) => `${name} must be a boolean.`, - - REQ_RESOURCE_TYPE: - 'The resource must be a string, Buffer or a valid file stream.', - - IMAGE_FORMAT: (format) => `Invalid image format: ${format}`, - IMAGE_SIZE: (size) => `Invalid image size: ${size}`, - - MESSAGE_BULK_DELETE_TYPE: - 'The messages must be an Array, Collection, or number.', - MESSAGE_NONCE_TYPE: 'Message nonce must be an integer or a string.', - MESSAGE_CONTENT_TYPE: 'Message content must be a non-empty string.', - - SPLIT_MAX_LEN: - 'Chunk exceeds the max length and contains no split characters.', - - BAN_RESOLVE_ID: (ban = false) => - `Couldn't resolve the user id to ${ban ? 'ban' : 'unban'}.`, - FETCH_BAN_RESOLVE_ID: "Couldn't resolve the user id to fetch the ban.", - - PRUNE_DAYS_TYPE: 'Days must be a number', - - GUILD_CHANNEL_RESOLVE: 'Could not resolve channel to a guild channel.', - GUILD_VOICE_CHANNEL_RESOLVE: - 'Could not resolve channel to a guild voice channel.', - GUILD_CHANNEL_ORPHAN: 'Could not find a parent to this guild channel.', - GUILD_CHANNEL_UNOWNED: - "The fetched channel does not belong to this manager's guild.", - GUILD_OWNED: 'Guild is owned by the client.', - GUILD_MEMBERS_TIMEOUT: "Members didn't arrive in time.", - GUILD_UNCACHED_ME: 'The client user as a member of this guild is uncached.', - CHANNEL_NOT_CACHED: - 'Could not find the channel where this message came from in the cache!', - STAGE_CHANNEL_RESOLVE: 'Could not resolve channel to a stage channel.', - GUILD_SCHEDULED_EVENT_RESOLVE: 'Could not resolve the guild scheduled event.', - - INVALID_TYPE: (name, expected, an = false) => - `Supplied ${name} is not a${an ? 'n' : ''} ${expected}.`, - INVALID_ELEMENT: (type, name, elem) => - `Supplied ${type} ${name} includes an invalid element: ${elem}`, - - MESSAGE_THREAD_PARENT: - 'The message was not sent in a guild text or news channel', - MESSAGE_EXISTING_THREAD: 'The message already has a thread', - THREAD_INVITABLE_TYPE: (type) => `Invitable cannot be edited on ${type}`, - - WEBHOOK_MESSAGE: 'The message was not sent by a webhook.', - WEBHOOK_TOKEN_UNAVAILABLE: - 'This action requires a webhook token, but none is available.', - WEBHOOK_URL_INVALID: 'The provided webhook URL is not valid.', - WEBHOOK_APPLICATION: - 'This message webhook belongs to an application and cannot be fetched.', - MESSAGE_REFERENCE_MISSING: 'The message does not reference another message', - - EMOJI_TYPE: 'Emoji must be a string or GuildEmoji/ReactionEmoji', - EMOJI_MANAGED: 'Emoji is managed and has no Author.', - MISSING_MANAGE_EMOJIS_AND_STICKERS_PERMISSION: (guild) => - `Client must have Manage Emojis and Stickers permission in guild ${guild} to see emoji authors.`, - NOT_GUILD_STICKER: - 'Sticker is a standard (non-guild) sticker and has no author.', - - REACTION_RESOLVE_USER: - "Couldn't resolve the user id to remove from the reaction.", - - VANITY_URL: 'This guild does not have the VANITY_URL feature enabled.', - - INVITE_RESOLVE_CODE: 'Could not resolve the code to fetch the invite.', - - INVITE_NOT_FOUND: 'Could not find the requested invite.', - - DELETE_GROUP_DM_CHANNEL: - "Bots don't have access to Group DM Channels and cannot delete them", - FETCH_GROUP_DM_CHANNEL: - "Bots don't have access to Group DM Channels and cannot fetch them", - - MEMBER_FETCH_NONCE_LENGTH: 'Nonce length must not exceed 32 characters.', - - GLOBAL_COMMAND_PERMISSIONS: - 'Permissions for global commands may only be fetched or modified by providing a GuildResolvable ' + - "or from a guild's application command manager.", - GUILD_UNCACHED_ROLE_RESOLVE: - 'Cannot resolve roles from an arbitrary guild, provide an id instead', - - INTERACTION_ALREADY_REPLIED: - 'The reply to this interaction has already been sent or deferred.', - INTERACTION_NOT_REPLIED: - 'The reply to this interaction has not been sent or deferred.', - - COMMAND_INTERACTION_OPTION_NOT_FOUND: (name) => - `Required option "${name}" not found.`, - COMMAND_INTERACTION_OPTION_TYPE: (name, type, expected) => - `Option "${name}" is of type: ${type}; expected ${expected}.`, - COMMAND_INTERACTION_OPTION_EMPTY: (name, type) => - `Required option "${name}" is of type: ${type}; expected a non-empty value.`, - COMMAND_INTERACTION_OPTION_NO_SUB_COMMAND: - 'No subcommand specified for interaction.', - COMMAND_INTERACTION_OPTION_NO_SUB_COMMAND_GROUP: - 'No subcommand group specified for interaction.', - AUTOCOMPLETE_INTERACTION_OPTION_NO_FOCUSED_OPTION: - 'No focused option for autocomplete interaction.', - - MODAL_SUBMIT_INTERACTION_FIELD_NOT_FOUND: (customId) => - `Required field with custom id "${customId}" not found.`, - MODAL_SUBMIT_INTERACTION_FIELD_TYPE: (customId, type, expected) => - `Field with custom id "${customId}" is of type: ${type}; expected ${expected}.`, - - INVITE_MISSING_SCOPES: - 'At least one valid scope must be provided for the invite', - - NOT_IMPLEMENTED: (what, name) => `Method ${what} not implemented on ${name}.`, - - SWEEP_FILTER_RETURN: - 'The return value of the sweepFilter function was not false or a Function', - - GUILD_FORUM_MESSAGE_REQUIRED: - 'You must provide a message to create a guild forum thread', - - // Selfbot - INVALID_USER_API: 'User accounts cannot use this endpoint', - INVALID_APPLICATION_COMMAND: (id) => - `Could not find a valid command for this bot: ${id}`, - INVALID_COMMAND_NAME: (allCMD) => - `Could not parse subGroupCommand and subCommand due to too long: ${allCMD.join(' ')}`, - INVALID_SLASH_COMMAND_CHOICES: (parentOptions, value) => - `${value} is not a valid choice for this option (${parentOptions})`, - SLASH_COMMAND_REQUIRED_OPTIONS_MISSING: (req, opt) => - `Value required (${req}) missing (Options: ${opt})`, - SLASH_COMMAND_SUB_COMMAND_GROUP_INVALID: (n) => - `${n} is not a valid sub command group`, - SLASH_COMMAND_SUB_COMMAND_INVALID: (n) => `${n} is not a valid sub command`, - INTERACTION_FAILED: 'No responsed from Application', - USER_NOT_STREAMING: 'User is not streaming', - BULK_BAN_USERS_OPTION_EMPTY: 'Option "users" array or collection is empty', - - // Djs v12 - VOICE_INVALID_HEARTBEAT: - 'Tried to set voice heartbeat but no valid interval was specified.', - VOICE_USER_MISSING: "Couldn't resolve the user to create stream.", - VOICE_JOIN_CHANNEL: (full = false) => - `You do not have permission to join this voice channel${full ? '; it is full.' : '.'}`, - VOICE_CONNECTION_TIMEOUT: 'Connection not established within 15 seconds.', - VOICE_TOKEN_ABSENT: 'Token not provided from voice server packet.', - VOICE_SESSION_ABSENT: 'Session ID not supplied.', - VOICE_INVALID_ENDPOINT: 'Invalid endpoint received.', - VOICE_NO_BROWSER: 'Voice connections are not available in browsers.', - VOICE_CONNECTION_ATTEMPTS_EXCEEDED: (attempts) => - `Too many connection attempts (${attempts}).`, - VOICE_JOIN_SOCKET_CLOSED: - 'Tried to send join packet, but the WebSocket is not open.', - VOICE_PLAY_INTERFACE_NO_BROADCAST: - 'A broadcast cannot be played in this context.', - VOICE_PLAY_INTERFACE_BAD_TYPE: 'Unknown stream type', - VOICE_PRISM_DEMUXERS_NEED_STREAM: - 'To play a webm/ogg stream, you need to pass a ReadableStream.', - - VOICE_STATE_UNCACHED_MEMBER: 'The member of this voice state is uncached.', - - UDP_SEND_FAIL: - 'Tried to send a UDP packet, but there is no socket available.', - UDP_ADDRESS_MALFORMED: 'Malformed UDP address or port.', - UDP_CONNECTION_EXISTS: 'There is already an existing UDP connection.', - UDP_WRONG_HANDSHAKE: 'Wrong handshake packet for UDP', - - INVALID_VIDEO_CODEC: (codecs) => - `Only these codecs are supported: ${codecs.join(', ')}`, - - STREAM_CONNECTION_READONLY: 'Cannot send data to a read-only stream', - STREAM_CANNOT_JOIN: 'Cannot join a stream to itself', - VOICE_USER_NOT_STREAMING: 'User is not streaming', - POLL_ALREADY_EXPIRED: 'This poll has already expired.', - METHOD_WARNING: - 'This method is flagged as it may lead to a temporary or permanent account ban. Do not use until further notice.', -}; - -for (const [name, message] of Object.entries(Messages)) register(name, message); diff --git a/vendor/discord.js-selfbot-v13/src/errors/index.js b/vendor/discord.js-selfbot-v13/src/errors/index.js deleted file mode 100644 index c94ddc7..0000000 --- a/vendor/discord.js-selfbot-v13/src/errors/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -module.exports = require('./DJSError'); -module.exports.Messages = require('./Messages'); diff --git a/vendor/discord.js-selfbot-v13/src/index.js b/vendor/discord.js-selfbot-v13/src/index.js deleted file mode 100644 index 61c63e3..0000000 --- a/vendor/discord.js-selfbot-v13/src/index.js +++ /dev/null @@ -1,174 +0,0 @@ -'use strict'; - -// "Root" classes (starting points) -exports.BaseClient = require('./client/BaseClient'); -exports.Client = require('./client/Client'); -/** @deprecated This will be removed in the next major version */ -exports.Shard = require('./sharding/Shard'); -/** @deprecated This will be removed in the next major version */ -exports.ShardClientUtil = require('./sharding/ShardClientUtil'); -/** @deprecated This will be removed in the next major version */ -exports.ShardingManager = require('./sharding/ShardingManager'); -exports.WebhookClient = require('./client/WebhookClient'); - -// Utilities -exports.ActivityFlags = require('./util/ActivityFlags'); -exports.ApplicationFlags = require('./util/ApplicationFlags'); -exports.AttachmentFlags = require('./util/AttachmentFlags'); -exports.BaseManager = require('./managers/BaseManager'); -exports.BitField = require('./util/BitField'); -exports.Collection = require('@discordjs/collection').Collection; -exports.Constants = require('./util/Constants'); -exports.DataResolver = require('./util/DataResolver'); -exports.DiscordAPIError = require('./rest/DiscordAPIError'); -exports.Formatters = require('./util/Formatters'); -exports.GuildMemberFlags = require('./util/GuildMemberFlags'); -exports.HTTPError = require('./rest/HTTPError'); -exports.Intents = require('./util/Intents'); -exports.LimitedCollection = require('./util/LimitedCollection'); -exports.MessageFlags = require('./util/MessageFlags'); -exports.Options = require('./util/Options'); -exports.Permissions = require('./util/Permissions'); -exports.RateLimitError = require('./rest/RateLimitError'); -exports.RoleFlags = require('./util/RoleFlags'); -exports.SnowflakeUtil = require('./util/SnowflakeUtil'); -exports.Sweepers = require('./util/Sweepers'); -exports.SystemChannelFlags = require('./util/SystemChannelFlags'); -exports.ThreadMemberFlags = require('./util/ThreadMemberFlags'); -exports.UserFlags = require('./util/UserFlags'); -exports.Util = require('./util/Util'); -exports.version = require('../package.json').version; - -// Managers -exports.ApplicationCommandManager = require('./managers/ApplicationCommandManager'); -exports.ApplicationCommandPermissionsManager = require('./managers/ApplicationCommandPermissionsManager'); -exports.AutoModerationRuleManager = require('./managers/AutoModerationRuleManager'); -exports.BaseGuildEmojiManager = require('./managers/BaseGuildEmojiManager'); -exports.CachedManager = require('./managers/CachedManager'); -exports.ChannelManager = require('./managers/ChannelManager'); -exports.ClientVoiceManager = require('./client/voice/ClientVoiceManager'); -exports.DataManager = require('./managers/DataManager'); -exports.GuildBanManager = require('./managers/GuildBanManager'); -exports.GuildChannelManager = require('./managers/GuildChannelManager'); -exports.GuildEmojiManager = require('./managers/GuildEmojiManager'); -exports.GuildEmojiRoleManager = require('./managers/GuildEmojiRoleManager'); -exports.GuildInviteManager = require('./managers/GuildInviteManager'); -exports.GuildManager = require('./managers/GuildManager'); -exports.GuildMemberManager = require('./managers/GuildMemberManager'); -exports.GuildMemberRoleManager = require('./managers/GuildMemberRoleManager'); -exports.GuildScheduledEventManager = require('./managers/GuildScheduledEventManager'); -exports.GuildStickerManager = require('./managers/GuildStickerManager'); -exports.MessageManager = require('./managers/MessageManager'); -exports.PermissionOverwriteManager = require('./managers/PermissionOverwriteManager'); -exports.PresenceManager = require('./managers/PresenceManager'); -exports.ReactionManager = require('./managers/ReactionManager'); -exports.ReactionUserManager = require('./managers/ReactionUserManager'); -exports.RoleManager = require('./managers/RoleManager'); -exports.SessionManager = require('./managers/SessionManager'); -exports.StageInstanceManager = require('./managers/StageInstanceManager'); -exports.ThreadManager = require('./managers/ThreadManager'); -exports.ThreadMemberManager = require('./managers/ThreadMemberManager'); -exports.UserManager = require('./managers/UserManager'); -exports.VoiceStateManager = require('./managers/VoiceStateManager'); -exports.WebSocketManager = require('./client/websocket/WebSocketManager'); -exports.WebSocketShard = require('./client/websocket/WebSocketShard'); -exports.RelationshipManager = require('./managers/RelationshipManager'); -exports.UserNoteManager = require('./managers/UserNoteManager'); - -// Structures -exports.Activity = require('./structures/Presence').Activity; -exports.AnonymousGuild = require('./structures/AnonymousGuild'); -exports.Application = require('./structures/interfaces/Application'); -exports.ApplicationCommand = require('./structures/ApplicationCommand'); -exports.ApplicationRoleConnectionMetadata = - require('./structures/ApplicationRoleConnectionMetadata').ApplicationRoleConnectionMetadata; -exports.AutoModerationActionExecution = require('./structures/AutoModerationActionExecution'); -exports.AutoModerationRule = require('./structures/AutoModerationRule'); -exports.Base = require('./structures/Base'); -exports.BaseGuild = require('./structures/BaseGuild'); -exports.BaseGuildEmoji = require('./structures/BaseGuildEmoji'); -exports.BaseGuildTextChannel = require('./structures/BaseGuildTextChannel'); -exports.BaseGuildVoiceChannel = require('./structures/BaseGuildVoiceChannel'); -exports.CategoryChannel = require('./structures/CategoryChannel'); -exports.Channel = require('./structures/Channel').Channel; -exports.ClientPresence = require('./structures/ClientPresence'); -exports.ClientUser = require('./structures/ClientUser'); -exports.Collector = require('./structures/interfaces/Collector'); -exports.DirectoryChannel = require('./structures/DirectoryChannel'); -exports.DMChannel = require('./structures/DMChannel'); -exports.Emoji = require('./structures/Emoji').Emoji; -exports.ForumChannel = require('./structures/ForumChannel'); -exports.Guild = require('./structures/Guild').Guild; -exports.GuildAuditLogs = require('./structures/GuildAuditLogs'); -exports.GuildAuditLogsEntry = require('./structures/GuildAuditLogs').Entry; -exports.GuildBan = require('./structures/GuildBan'); -exports.GuildChannel = require('./structures/GuildChannel'); -exports.GuildEmoji = require('./structures/GuildEmoji'); -exports.GuildMember = require('./structures/GuildMember').GuildMember; -exports.GuildPreview = require('./structures/GuildPreview'); -exports.GuildPreviewEmoji = require('./structures/GuildPreviewEmoji'); -exports.GuildScheduledEvent = - require('./structures/GuildScheduledEvent').GuildScheduledEvent; -exports.GuildTemplate = require('./structures/GuildTemplate'); -exports.Integration = require('./structures/Integration'); -exports.IntegrationApplication = require('./structures/IntegrationApplication'); -exports.Invite = require('./structures/Invite'); -exports.InviteStageInstance = require('./structures/InviteStageInstance'); -exports.InviteGuild = require('./structures/InviteGuild'); -exports.MediaChannel = require('./structures/MediaChannel'); -exports.Message = require('./structures/Message').Message; -exports.MessageActionRow = require('./structures/MessageActionRow'); -exports.MessageAttachment = require('./structures/MessageAttachment'); -exports.MessageButton = require('./structures/MessageButton'); -exports.MessageCollector = require('./structures/MessageCollector'); -exports.MessageEmbed = require('./structures/MessageEmbed'); -exports.MessageMentions = require('./structures/MessageMentions'); -exports.MessagePayload = require('./structures/MessagePayload'); -exports.MessageReaction = require('./structures/MessageReaction'); -exports.Modal = require('./structures/Modal'); -exports.NewsChannel = require('./structures/NewsChannel'); -exports.OAuth2Guild = require('./structures/OAuth2Guild'); -exports.GroupDMChannel = require('./structures/GroupDMChannel'); -exports.PermissionOverwrites = require('./structures/PermissionOverwrites'); -exports.Presence = require('./structures/Presence').Presence; -exports.ReactionCollector = require('./structures/ReactionCollector'); -exports.ReactionEmoji = require('./structures/ReactionEmoji'); -exports.RichPresenceAssets = - require('./structures/Presence').RichPresenceAssets; -exports.Role = require('./structures/Role').Role; -exports.Session = require('./structures/Session'); -exports.StageChannel = require('./structures/StageChannel'); -exports.StageInstance = require('./structures/StageInstance').StageInstance; -exports.Sticker = require('./structures/Sticker').Sticker; -exports.StickerPack = require('./structures/StickerPack'); -exports.StoreChannel = require('./structures/StoreChannel'); -exports.Team = require('./structures/Team'); -exports.TeamMember = require('./structures/TeamMember'); -exports.TextChannel = require('./structures/TextChannel'); -exports.TextInputComponent = require('./structures/TextInputComponent'); -exports.ThreadChannel = require('./structures/ThreadChannel'); -exports.ThreadOnlyChannel = require('./structures/ThreadOnlyChannel'); -exports.ThreadMember = require('./structures/ThreadMember'); -exports.Typing = require('./structures/Typing'); -exports.User = require('./structures/User'); -exports.VoiceChannel = require('./structures/VoiceChannel'); -exports.VoiceChannelEffect = require('./structures/VoiceChannelEffect'); -exports.VoiceRegion = require('./structures/VoiceRegion'); -exports.VoiceState = require('./structures/VoiceState'); -exports.Webhook = require('./structures/Webhook'); -exports.Widget = require('./structures/Widget'); -exports.WidgetMember = require('./structures/WidgetMember'); -exports.WelcomeChannel = require('./structures/WelcomeChannel'); -exports.WelcomeScreen = require('./structures/WelcomeScreen'); - -exports.WebSocket = require('./WebSocket'); - -exports.CustomStatus = require('./structures/Presence').CustomStatus; -exports.RichPresence = require('./structures/Presence').RichPresence; -exports.SpotifyRPC = require('./structures/Presence').SpotifyRPC; -exports.WebEmbed = require('./structures/WebEmbed'); -exports.DiscordAuthWebsocket = require('./util/RemoteAuth'); -exports.PurchasedFlags = require('./util/PurchasedFlags'); -exports.Poll = require('./structures/Poll').Poll; -exports.PollAnswer = require('./structures/PollAnswer').PollAnswer; -exports.Recorder = require('./client/voice/receiver/Recorder'); diff --git a/vendor/discord.js-selfbot-v13/src/managers/ApplicationCommandManager.js b/vendor/discord.js-selfbot-v13/src/managers/ApplicationCommandManager.js deleted file mode 100644 index 967ce67..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/ApplicationCommandManager.js +++ /dev/null @@ -1,300 +0,0 @@ -'use strict'; - -const { isJSONEncodable } = require('@discordjs/builders'); -const { Collection } = require('@discordjs/collection'); -const ApplicationCommandPermissionsManager = require('./ApplicationCommandPermissionsManager'); -const CachedManager = require('./CachedManager'); -const { TypeError } = require('../errors'); -const ApplicationCommand = require('../structures/ApplicationCommand'); -const { ApplicationCommandTypes } = require('../util/Constants'); -const Permissions = require('../util/Permissions'); - -/** - * Manages API methods for application commands and stores their cache. - * @extends {CachedManager} - */ -class ApplicationCommandManager extends CachedManager { - constructor(client, iterable) { - super(client, ApplicationCommand, iterable); - - /** - * The manager for permissions of arbitrary commands on arbitrary guilds - * @type {ApplicationCommandPermissionsManager} - */ - this.permissions = new ApplicationCommandPermissionsManager(this); - } - - /** - * The cache of this manager - * @type {Collection} - * @name ApplicationCommandManager#cache - */ - - _add(data, cache, guildId) { - return super._add(data, cache, { extras: [this.guild, guildId] }); - } - - /** - * The APIRouter path to the commands - * @param {Snowflake} [options.id] The application command's id - * @param {Snowflake} [options.guildId] The guild's id to use in the path, - * ignored when using a {@link GuildApplicationCommandManager} - * @returns {Object} - * @private - */ - commandPath({ id, guildId } = {}) { - let path = this.client.api.applications(this.client.application.id); - if (this.guild ?? guildId) path = path.guilds(this.guild?.id ?? guildId); - return id ? path.commands(id) : path.commands; - } - - /** - * Data that resolves to give an ApplicationCommand object. This can be: - * * An ApplicationCommand object - * * A Snowflake - * @typedef {ApplicationCommand|Snowflake} ApplicationCommandResolvable - */ - - /* eslint-disable max-len */ - /** - * Data that resolves to the data of an ApplicationCommand - * @typedef {ApplicationCommandData|APIApplicationCommand|SlashCommandBuilder|ContextMenuCommandBuilder} ApplicationCommandDataResolvable - */ - /* eslint-enable max-len */ - - /** - * Options used to fetch data from Discord - * @typedef {Object} BaseFetchOptions - * @property {boolean} [cache=true] Whether to cache the fetched data if it wasn't already - * @property {boolean} [force=false] Whether to skip the cache check and request the API - */ - - /** - * Options used to fetch Application Commands from Discord - * @typedef {BaseFetchOptions} FetchApplicationCommandOptions - * @property {Snowflake} [guildId] The guild's id to fetch commands for, for when the guild is not cached - * @property {LocaleString} [locale] The locale to use when fetching this command - * @property {boolean} [withLocalizations] Whether to fetch all localization data - */ - - /** - * Obtains one or multiple application commands from Discord, or the cache if it's already available. - * @param {Snowflake} [id] The application command's id - * @param {FetchApplicationCommandOptions} [options] Additional options for this fetch - * @returns {Promise>} - * @example - * // Fetch a single command - * client.application.commands.fetch('123456789012345678') - * .then(command => console.log(`Fetched command ${command.name}`)) - * .catch(console.error); - * @example - * // Fetch all commands - * guild.commands.fetch() - * .then(commands => console.log(`Fetched ${commands.size} commands`)) - * .catch(console.error); - */ - async fetch( - id, - { guildId, cache = true, force = false, locale, withLocalizations } = {}, - ) { - if (typeof id === 'object') { - ({ guildId, cache = true, locale, withLocalizations } = id); - } else if (id) { - if (!force) { - const existing = this.cache.get(id); - if (existing) return existing; - } - const command = await this.commandPath({ id, guildId }).get(); - return this._add(command, cache); - } - - const data = await this.commandPath({ guildId }).get({ - headers: { - 'X-Discord-Locale': locale, - }, - query: - typeof withLocalizations === 'boolean' - ? { with_localizations: withLocalizations } - : undefined, - }); - return data.reduce( - (coll, command) => - coll.set(command.id, this._add(command, cache, guildId)), - new Collection(), - ); - } - - /** - * Creates an application command. - * @param {ApplicationCommandDataResolvable} command The command - * @param {Snowflake} [guildId] The guild's id to create this command in, - * ignored when using a {@link GuildApplicationCommandManager} - * @returns {Promise} - * @example - * // Create a new command - * client.application.commands.create({ - * name: 'test', - * description: 'A test command', - * }) - * .then(console.log) - * .catch(console.error); - */ - async create(command, guildId) { - const data = await this.commandPath({ guildId }).post({ - data: this.constructor.transformCommand(command), - }); - return this._add(data, true, guildId); - } - - /** - * Sets all the commands for this application or guild. - * @param {ApplicationCommandDataResolvable[]} commands The commands - * @param {Snowflake} [guildId] The guild's id to create the commands in, - * ignored when using a {@link GuildApplicationCommandManager} - * @returns {Promise>} - * @example - * // Set all commands to just this one - * client.application.commands.set([ - * { - * name: 'test', - * description: 'A test command', - * }, - * ]) - * .then(console.log) - * .catch(console.error); - * @example - * // Remove all commands - * guild.commands.set([]) - * .then(console.log) - * .catch(console.error); - */ - async set(commands, guildId) { - const data = await this.commandPath({ guildId }).put({ - data: commands.map((c) => this.constructor.transformCommand(c)), - }); - return data.reduce( - (coll, command) => - coll.set(command.id, this._add(command, true, guildId)), - new Collection(), - ); - } - - /** - * Edits an application command. - * @param {ApplicationCommandResolvable} command The command to edit - * @param {Partial} data The data to update the command with - * @param {Snowflake} [guildId] The guild's id where the command registered, - * ignored when using a {@link GuildApplicationCommandManager} - * @returns {Promise} - * @example - * // Edit an existing command - * client.application.commands.edit('123456789012345678', { - * description: 'New description', - * }) - * .then(console.log) - * .catch(console.error); - */ - async edit(command, data, guildId) { - const id = this.resolveId(command); - if (!id) - throw new TypeError( - 'INVALID_TYPE', - 'command', - 'ApplicationCommandResolvable', - ); - - const patched = await this.commandPath({ id, guildId }).patch({ - data: this.constructor.transformCommand(data), - }); - return this._add(patched, true, guildId); - } - - /** - * Deletes an application command. - * @param {ApplicationCommandResolvable} command The command to delete - * @param {Snowflake} [guildId] The guild's id where the command is registered, - * ignored when using a {@link GuildApplicationCommandManager} - * @returns {Promise} - * @example - * // Delete a command - * guild.commands.delete('123456789012345678') - * .then(console.log) - * .catch(console.error); - */ - async delete(command, guildId) { - const id = this.resolveId(command); - if (!id) - throw new TypeError( - 'INVALID_TYPE', - 'command', - 'ApplicationCommandResolvable', - ); - - await this.commandPath({ id, guildId }).delete(); - - const cached = this.cache.get(id); - this.cache.delete(id); - return cached ?? null; - } - - /** - * Transforms an {@link ApplicationCommandData} object into something that can be used with the API. - * @param {ApplicationCommandDataResolvable} command The command to transform - * @returns {APIApplicationCommand} - * @private - */ - static transformCommand(command) { - if (isJSONEncodable(command)) return command.toJSON(); - - let default_member_permissions; - - if ('default_member_permissions' in command) { - default_member_permissions = command.default_member_permissions - ? new Permissions( - BigInt(command.default_member_permissions), - ).bitfield.toString() - : command.default_member_permissions; - } - - if ('defaultMemberPermissions' in command) { - default_member_permissions = - command.defaultMemberPermissions !== null - ? new Permissions( - command.defaultMemberPermissions, - ).bitfield.toString() - : command.defaultMemberPermissions; - } - - return { - name: command.name, - name_localizations: - command.nameLocalizations ?? command.name_localizations, - description: command.description, - description_localizations: - command.descriptionLocalizations ?? command.description_localizations, - type: - typeof command.type === 'number' - ? command.type - : ApplicationCommandTypes[command.type], - options: command.options?.map((o) => - ApplicationCommand.transformOption(o), - ), - default_permission: - command.defaultPermission ?? command.default_permission, - default_member_permissions, - dm_permission: command.dmPermission ?? command.dm_permission, - }; - } -} - -module.exports = ApplicationCommandManager; - -/** - * @external SlashCommandBuilder - * @see {@link https://discord.js.org/docs/packages/builders/stable/SlashCommandBuilder:Class} - */ - -/** - * @external ContextMenuCommandBuilder - * @see {@link https://discord.js.org/docs/packages/builders/stable/ContextMenuCommandBuilder:Class} - */ diff --git a/vendor/discord.js-selfbot-v13/src/managers/ApplicationCommandPermissionsManager.js b/vendor/discord.js-selfbot-v13/src/managers/ApplicationCommandPermissionsManager.js deleted file mode 100644 index ad4ad68..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/ApplicationCommandPermissionsManager.js +++ /dev/null @@ -1,508 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const BaseManager = require('./BaseManager'); -const { Error, TypeError } = require('../errors'); -const { - ApplicationCommandPermissionTypes, - APIErrors, -} = require('../util/Constants'); - -/** - * Manages API methods for permissions of Application Commands. - * @extends {BaseManager} - */ -class ApplicationCommandPermissionsManager extends BaseManager { - constructor(manager) { - super(manager.client); - - /** - * The manager or command that this manager belongs to - * @type {ApplicationCommandManager|ApplicationCommand} - * @private - */ - this.manager = manager; - - /** - * The guild that this manager acts on - * @type {?Guild} - */ - this.guild = manager.guild ?? null; - - /** - * The id of the guild that this manager acts on - * @type {?Snowflake} - */ - this.guildId = manager.guildId ?? manager.guild?.id ?? null; - - /** - * The id of the command this manager acts on - * @type {?Snowflake} - */ - this.commandId = manager.id ?? null; - } - - /** - * The APIRouter path to the commands - * @param {Snowflake} guildId The guild's id to use in the path, - * @param {Snowflake} [commandId] The application command's id - * @returns {Object} - * @private - */ - permissionsPath(guildId, commandId) { - return this.client.api - .applications(this.client.application.id) - .guilds(guildId) - .commands(commandId).permissions; - } - - /** - * Data for setting the permissions of an application command. - * @typedef {Object} ApplicationCommandPermissionData - * @property {Snowflake} id The role or user's id - * @property {ApplicationCommandPermissionType|number} type Whether this permission is for a role or a user - * @property {boolean} permission Whether the role or user has the permission to use this command - */ - - /** - * The object returned when fetching permissions for an application command. - * @typedef {Object} ApplicationCommandPermissions - * @property {Snowflake} id The role or user's id - * @property {ApplicationCommandPermissionType} type Whether this permission is for a role or a user - * @property {boolean} permission Whether the role or user has the permission to use this command - */ - - /** - * Options for managing permissions for one or more Application Commands - * When passing these options to a manager where `guildId` is `null`, - * `guild` is a required parameter - * @typedef {Object} BaseApplicationCommandPermissionsOptions - * @property {GuildResolvable} [guild] The guild to modify / check permissions for - * Ignored when the manager has a non-null `guildId` property - * @property {ApplicationCommandResolvable} [command] The command to modify / check permissions for - * Ignored when the manager has a non-null `commandId` property - */ - - /** - * Fetches the permissions for one or multiple commands. - * @param {BaseApplicationCommandPermissionsOptions} [options] Options used to fetch permissions - * @returns {Promise>} - * @example - * // Fetch permissions for one command - * guild.commands.permissions.fetch({ command: '123456789012345678' }) - * .then(perms => console.log(`Fetched permissions for ${perms.length} users`)) - * .catch(console.error); - * @example - * // Fetch permissions for all commands in a guild - * client.application.commands.permissions.fetch({ guild: '123456789012345678' }) - * .then(perms => console.log(`Fetched permissions for ${perms.size} commands`)) - * .catch(console.error); - */ - async fetch({ guild, command } = {}) { - const { guildId, commandId } = this._validateOptions(guild, command); - if (commandId) { - const data = await this.permissionsPath(guildId, commandId).get(); - return data.permissions.map((perm) => - this.constructor.transformPermissions(perm, true), - ); - } - - const data = await this.permissionsPath(guildId).get(); - return data.reduce( - (coll, perm) => - coll.set( - perm.id, - perm.permissions.map((p) => - this.constructor.transformPermissions(p, true), - ), - ), - new Collection(), - ); - } - - /** - * Data used for overwriting the permissions for all application commands in a guild. - * @typedef {Object} GuildApplicationCommandPermissionData - * @property {Snowflake} id The command's id - * @property {ApplicationCommandPermissionData[]} permissions The permissions for this command - */ - - /** - * Options used to set permissions for one or more Application Commands in a guild - * One of `command` AND `permissions`, OR `fullPermissions` is required. - * `fullPermissions` is not a valid option when passing to a manager where `commandId` is non-null - * @typedef {BaseApplicationCommandPermissionsOptions} SetApplicationCommandPermissionsOptions - * @property {ApplicationCommandPermissionData[]} [permissions] The new permissions for the command - * @property {GuildApplicationCommandPermissionData[]} [fullPermissions] The new permissions for all commands - * in a guild When this parameter is set, `permissions` and `command` are ignored - */ - - /** - * Sets the permissions for one or more commands. - * @param {SetApplicationCommandPermissionsOptions} options Options used to set permissions - * @returns {Promise>} - * @example - * // Set the permissions for one command - * client.application.commands.permissions.set({ guild: '892455839386304532', command: '123456789012345678', - * permissions: [ - * { - * id: '876543210987654321', - * type: 'USER', - * permission: false, - * }, - * ]}) - * .then(console.log) - * .catch(console.error); - * @example - * // Set the permissions for all commands - * guild.commands.permissions.set({ fullPermissions: [ - * { - * id: '123456789012345678', - * permissions: [{ - * id: '876543210987654321', - * type: 'USER', - * permission: false, - * }], - * }, - * ]}) - * .then(console.log) - * .catch(console.error); - */ - async set({ guild, command, permissions, fullPermissions } = {}) { - const { guildId, commandId } = this._validateOptions(guild, command); - - if (commandId) { - if (!Array.isArray(permissions)) { - throw new TypeError( - 'INVALID_TYPE', - 'permissions', - 'Array of ApplicationCommandPermissionData', - true, - ); - } - const data = await this.permissionsPath(guildId, commandId).put({ - data: { - permissions: permissions.map((perm) => - this.constructor.transformPermissions(perm), - ), - }, - }); - return data.permissions.map((perm) => - this.constructor.transformPermissions(perm, true), - ); - } - - if (!Array.isArray(fullPermissions)) { - throw new TypeError( - 'INVALID_TYPE', - 'fullPermissions', - 'Array of GuildApplicationCommandPermissionData', - true, - ); - } - - const APIPermissions = []; - for (const perm of fullPermissions) { - if (!Array.isArray(perm.permissions)) - throw new TypeError( - 'INVALID_ELEMENT', - 'Array', - 'fullPermissions', - perm, - ); - APIPermissions.push({ - id: perm.id, - permissions: perm.permissions.map((p) => - this.constructor.transformPermissions(p), - ), - }); - } - const data = await this.permissionsPath(guildId).put({ - data: APIPermissions, - }); - return data.reduce( - (coll, perm) => - coll.set( - perm.id, - perm.permissions.map((p) => - this.constructor.transformPermissions(p, true), - ), - ), - new Collection(), - ); - } - - /** - * Options used to add permissions to a command - * The `command` parameter is not optional when the managers `commandId` is `null` - * @typedef {BaseApplicationCommandPermissionsOptions} AddApplicationCommandPermissionsOptions - * @property {ApplicationCommandPermissionData[]} permissions The permissions to add to the command - */ - - /** - * Add permissions to a command. - * @param {AddApplicationCommandPermissionsOptions} options Options used to add permissions - * @returns {Promise} - * @example - * // Block a role from the command permissions - * guild.commands.permissions.add({ command: '123456789012345678', permissions: [ - * { - * id: '876543211234567890', - * type: 'ROLE', - * permission: false - * }, - * ]}) - * .then(console.log) - * .catch(console.error); - */ - async add({ guild, command, permissions }) { - const { guildId, commandId } = this._validateOptions(guild, command); - if (!commandId) - throw new TypeError( - 'INVALID_TYPE', - 'command', - 'ApplicationCommandResolvable', - ); - if (!Array.isArray(permissions)) { - throw new TypeError( - 'INVALID_TYPE', - 'permissions', - 'Array of ApplicationCommandPermissionData', - true, - ); - } - - let existing = []; - try { - existing = await this.fetch({ guild: guildId, command: commandId }); - } catch (error) { - if (error.code !== APIErrors.UNKNOWN_APPLICATION_COMMAND_PERMISSIONS) - throw error; - } - - const newPermissions = permissions.slice(); - for (const perm of existing) { - if (!newPermissions.some((x) => x.id === perm.id)) { - newPermissions.push(perm); - } - } - - return this.set({ - guild: guildId, - command: commandId, - permissions: newPermissions, - }); - } - - /** - * Options used to remove permissions from a command - * The `command` parameter is not optional when the managers `commandId` is `null` - * @typedef {BaseApplicationCommandPermissionsOptions} RemoveApplicationCommandPermissionsOptions - * @property {UserResolvable|UserResolvable[]} [users] The user(s) to remove from the command permissions - * One of `users` or `roles` is required - * @property {RoleResolvable|RoleResolvable[]} [roles] The role(s) to remove from the command permissions - * One of `users` or `roles` is required - */ - - /** - * Remove permissions from a command. - * @param {RemoveApplicationCommandPermissionsOptions} options Options used to remove permissions - * @returns {Promise} - * @example - * // Remove a user permission from this command - * guild.commands.permissions.remove({ command: '123456789012345678', users: '876543210123456789' }) - * .then(console.log) - * .catch(console.error); - * @example - * // Remove multiple roles from this command - * guild.commands.permissions.remove({ - * command: '123456789012345678', roles: ['876543210123456789', '765432101234567890'] - * }) - * .then(console.log) - * .catch(console.error); - */ - async remove({ guild, command, users, roles }) { - const { guildId, commandId } = this._validateOptions(guild, command); - if (!commandId) - throw new TypeError( - 'INVALID_TYPE', - 'command', - 'ApplicationCommandResolvable', - ); - - if (!users && !roles) - throw new TypeError( - 'INVALID_TYPE', - 'users OR roles', - 'Array or Resolvable', - true, - ); - - let resolvedIds = []; - if (Array.isArray(users)) { - users.forEach((user) => { - const userId = this.client.users.resolveId(user); - if (!userId) - throw new TypeError('INVALID_ELEMENT', 'Array', 'users', user); - resolvedIds.push(userId); - }); - } else if (users) { - const userId = this.client.users.resolveId(users); - if (!userId) { - throw new TypeError('INVALID_TYPE', 'users', 'Array or UserResolvable'); - } - resolvedIds.push(userId); - } - - if (Array.isArray(roles)) { - roles.forEach((role) => { - if (typeof role === 'string') { - resolvedIds.push(role); - return; - } - if (!this.guild) throw new Error('GUILD_UNCACHED_ROLE_RESOLVE'); - const roleId = this.guild.roles.resolveId(role); - if (!roleId) - throw new TypeError('INVALID_ELEMENT', 'Array', 'users', role); - resolvedIds.push(roleId); - }); - } else if (roles) { - if (typeof roles === 'string') { - resolvedIds.push(roles); - } else { - if (!this.guild) throw new Error('GUILD_UNCACHED_ROLE_RESOLVE'); - const roleId = this.guild.roles.resolveId(roles); - if (!roleId) { - throw new TypeError( - 'INVALID_TYPE', - 'users', - 'Array or RoleResolvable', - ); - } - resolvedIds.push(roleId); - } - } - - let existing = []; - try { - existing = await this.fetch({ guild: guildId, command: commandId }); - } catch (error) { - if (error.code !== APIErrors.UNKNOWN_APPLICATION_COMMAND_PERMISSIONS) - throw error; - } - - const permissions = existing.filter( - (perm) => !resolvedIds.includes(perm.id), - ); - - return this.set({ guild: guildId, command: commandId, permissions }); - } - - /** - * Options used to check the existence of permissions on a command - * The `command` parameter is not optional when the managers `commandId` is `null` - * @typedef {BaseApplicationCommandPermissionsOptions} HasApplicationCommandPermissionsOptions - * @property {UserResolvable|RoleResolvable} permissionId The user or role to check if a permission exists for - * on this command. - */ - - /** - * Check whether a permission exists for a user or role - * @param {AddApplicationCommandPermissionsOptions} options Options used to check permissions - * @returns {Promise} - * @example - * // Check whether a user has permission to use a command - * guild.commands.permissions.has({ command: '123456789012345678', permissionId: '876543210123456789' }) - * .then(console.log) - * .catch(console.error); - */ - async has({ guild, command, permissionId }) { - const { guildId, commandId } = this._validateOptions(guild, command); - if (!commandId) - throw new TypeError( - 'INVALID_TYPE', - 'command', - 'ApplicationCommandResolvable', - ); - - if (!permissionId) - throw new TypeError( - 'INVALID_TYPE', - 'permissionId', - 'UserResolvable or RoleResolvable', - ); - let resolvedId = permissionId; - if (typeof permissionId !== 'string') { - resolvedId = this.client.users.resolveId(permissionId); - if (!resolvedId) { - if (!this.guild) throw new Error('GUILD_UNCACHED_ROLE_RESOLVE'); - resolvedId = this.guild.roles.resolveId(permissionId); - } - if (!resolvedId) { - throw new TypeError( - 'INVALID_TYPE', - 'permissionId', - 'UserResolvable or RoleResolvable', - ); - } - } - - let existing = []; - try { - existing = await this.fetch({ guild: guildId, command: commandId }); - } catch (error) { - if (error.code !== APIErrors.UNKNOWN_APPLICATION_COMMAND_PERMISSIONS) - throw error; - } - - return existing.some((perm) => perm.id === resolvedId); - } - - _validateOptions(guild, command) { - const guildId = this.guildId ?? this.client.guilds.resolveId(guild); - if (!guildId) throw new Error('GLOBAL_COMMAND_PERMISSIONS'); - let commandId = this.commandId; - if (command && !commandId) { - commandId = this.manager.resolveId?.(command); - if (!commandId && this.guild) { - commandId = this.guild.commands.resolveId(command); - } - commandId ??= this.client.application?.commands.resolveId(command); - if (!commandId) { - throw new TypeError( - 'INVALID_TYPE', - 'command', - 'ApplicationCommandResolvable', - true, - ); - } - } - return { guildId, commandId }; - } - - /** - * Transforms an {@link ApplicationCommandPermissionData} object into something that can be used with the API. - * @param {ApplicationCommandPermissionData} permissions The permissions to transform - * @param {boolean} [received] Whether these permissions have been received from Discord - * @returns {APIApplicationCommandPermissions} - * @private - */ - static transformPermissions(permissions, received) { - return { - id: permissions.id, - permission: permissions.permission, - type: - typeof permissions.type === 'number' && !received - ? permissions.type - : ApplicationCommandPermissionTypes[permissions.type], - }; - } -} - -module.exports = ApplicationCommandPermissionsManager; - -/* eslint-disable max-len */ -/** - * @external APIApplicationCommandPermissions - * @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-structure} - */ diff --git a/vendor/discord.js-selfbot-v13/src/managers/AutoModerationRuleManager.js b/vendor/discord.js-selfbot-v13/src/managers/AutoModerationRuleManager.js deleted file mode 100644 index 972fdeb..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/AutoModerationRuleManager.js +++ /dev/null @@ -1,358 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const CachedManager = require('./CachedManager'); -const AutoModerationRule = require('../structures/AutoModerationRule'); -const { - AutoModerationRuleEventTypes, - AutoModerationRuleTriggerTypes, - AutoModerationActionTypes, - AutoModerationRuleKeywordPresetTypes, -} = require('../util/Constants'); - -/** - * Manages API methods for auto moderation rules and stores their cache. - * @extends {CachedManager} - */ -class AutoModerationRuleManager extends CachedManager { - constructor(guild, iterable) { - super(guild.client, AutoModerationRule, iterable); - - /** - * The guild this manager belongs to. - * @type {Guild} - */ - this.guild = guild; - } - - /** - * Resolves an {@link AutoModerationRuleResolvable} to an {@link AutoModerationRule} object. - * @method resolve - * @memberof AutoModerationRuleManager - * @instance - * @param {AutoModerationRuleResolvable} autoModerationRule The AutoModerationRule resolvable to resolve - * @returns {?AutoModerationRule} - */ - - /** - * Resolves an {@link AutoModerationRuleResolvable} to a {@link AutoModerationRule} id. - * @method resolveId - * @memberof AutoModerationRuleManager - * @instance - * @param {AutoModerationRuleResolvable} autoModerationRule The AutoModerationRule resolvable to resolve - * @returns {?Snowflake} - */ - - _add(data, cache) { - return super._add(data, cache, { extras: [this.guild] }); - } - - /** - * Options used to set the trigger metadata of an auto moderation rule. - * @typedef {Object} AutoModerationTriggerMetadataOptions - * @property {string[]} [keywordFilter] The substrings that will be searched for in the content - * @property {string[]} [regexPatterns] The regular expression patterns which will be matched against the content - * Only Rust-flavored regular expressions are supported. - * @property {AutoModerationRuleKeywordPresetType[]} [presets] - * The internally pre-defined wordsets which will be searched for in the content - * @property {string[]} [allowList] The substrings that will be exempt from triggering - * {@link AutoModerationRuleTriggerType.KEYWORD} and {@link AutoModerationRuleTriggerType.KEYWORD_PRESET} - * @property {?number} [mentionTotalLimit] The total number of role & user mentions allowed per message - * @property {boolean} [mentionRaidProtectionEnabled] Whether to automatically detect mention raids - */ - - /** - * Options used to set the actions of an auto moderation rule. - * @typedef {Object} AutoModerationActionOptions - * @property {AutoModerationActionType} type The type of this auto moderation rule action - * @property {AutoModerationActionMetadataOptions} [metadata] Additional metadata needed during execution - * This property is required if using a `type` of - * {@link AutoModerationActionType.SEND_ALERT_MESSAGE} or {@link AutoModerationActionType.TIMEOUT}. - */ - - /** - * Options used to set the metadata of an auto moderation rule action. - * @typedef {Object} AutoModerationActionMetadataOptions - * @property {GuildTextChannelResolvable|ThreadChannel} [channel] The channel to which content will be logged - * @property {number} [durationSeconds] The timeout duration in seconds - * @property {string} [customMessage] The custom message that is shown whenever a message is blocked - */ - - /** - * Options used to create an auto moderation rule. - * @typedef {Object} AutoModerationRuleCreateOptions - * @property {string} name The name of the auto moderation rule - * @property {AutoModerationRuleEventType} eventType The event type of the auto moderation rule - * @property {AutoModerationRuleTriggerType} triggerType The trigger type of the auto moderation rule - * @property {AutoModerationTriggerMetadataOptions} [triggerMetadata] The trigger metadata of the auto moderation rule - * This property is required if the following `triggerType`s are used: - * * {@link AutoModerationRuleTriggerType.KEYWORD KEYWORD} - * * {@link AutoModerationRuleTriggerType.KEYWORD_PRESET KEYWORD_PRESET} - * * {@link AutoModerationRuleTriggerType.MENTION_SPAM MENTION_SPAM} - * - * @property {AutoModerationActionOptions[]} actions - * The actions that will execute when the auto moderation rule is triggered - * @property {boolean} [enabled] Whether the auto moderation rule should be enabled - * @property {Collection|RoleResolvable[]} [exemptRoles] - * The roles that should not be affected by the auto moderation rule - * @property {Collection|GuildChannelResolvable[]} [exemptChannels] - * The channels that should not be affected by the auto moderation rule - * @property {string} [reason] The reason for creating the auto moderation rule - */ - - /** - * Creates a new auto moderation rule. - * @param {AutoModerationRuleCreateOptions} options Options for creating the auto moderation rule - * @returns {Promise} - */ - async create({ - name, - eventType, - triggerType, - triggerMetadata, - actions, - enabled, - exemptRoles, - exemptChannels, - reason, - }) { - const data = await this.client.api - .guilds(this.guild.id) - ['auto-moderation'].rules.post({ - data: { - name, - event_type: - typeof eventType === 'number' - ? eventType - : AutoModerationRuleEventTypes[eventType], - trigger_type: - typeof triggerType === 'number' - ? triggerType - : AutoModerationRuleTriggerTypes[triggerType], - trigger_metadata: triggerMetadata && { - keyword_filter: triggerMetadata.keywordFilter, - regex_patterns: triggerMetadata.regexPatterns, - presets: triggerMetadata.presets?.map((preset) => - typeof preset === 'number' - ? preset - : AutoModerationRuleKeywordPresetTypes[preset], - ), - allow_list: triggerMetadata.allowList, - mention_total_limit: triggerMetadata.mentionTotalLimit, - mention_raid_protection_enabled: - triggerMetadata.mentionRaidProtectionEnabled, - }, - actions: actions.map((action) => ({ - type: - typeof action.type === 'number' - ? action.type - : AutoModerationActionTypes[action.type], - metadata: { - duration_seconds: action.metadata?.durationSeconds, - channel_id: - action.metadata?.channel && - this.guild.channels.resolveId(action.metadata.channel), - custom_message: action.metadata?.customMessage, - }, - })), - enabled, - exempt_roles: exemptRoles?.map((exemptRole) => - this.guild.roles.resolveId(exemptRole), - ), - exempt_channels: exemptChannels?.map((exemptChannel) => - this.guild.channels.resolveId(exemptChannel), - ), - }, - reason, - }); - - return this._add(data); - } - - /** - * Options used to edit an auto moderation rule. - * @typedef {Object} AutoModerationRuleEditOptions - * @property {string} [name] The name of the auto moderation rule - * @property {AutoModerationRuleEventType} [eventType] The event type of the auto moderation rule - * @property {AutoModerationTriggerMetadataOptions} [triggerMetadata] The trigger metadata of the auto moderation rule - * @property {AutoModerationActionOptions[]} [actions] - * The actions that will execute when the auto moderation rule is triggered - * @property {boolean} [enabled] Whether the auto moderation rule should be enabled - * @property {Collection|RoleResolvable[]} [exemptRoles] - * The roles that should not be affected by the auto moderation rule - * @property {Collection|GuildChannelResolvable[]} [exemptChannels] - * The channels that should not be affected by the auto moderation rule - * @property {string} [reason] The reason for creating the auto moderation rule - */ - - /** - * Edits an auto moderation rule. - * @param {AutoModerationRuleResolvable} autoModerationRule The auto moderation rule to edit - * @param {AutoModerationRuleEditOptions} options Options for editing the auto moderation rule - * @returns {Promise} - */ - async edit( - autoModerationRule, - { - name, - eventType, - triggerMetadata, - actions, - enabled, - exemptRoles, - exemptChannels, - reason, - }, - ) { - const autoModerationRuleId = this.resolveId(autoModerationRule); - - const data = await this.client.api - .guilds(this.guild.id)('auto-moderation') - .rules(autoModerationRuleId) - .patch({ - data: { - name, - event_type: - typeof eventType === 'number' - ? eventType - : AutoModerationRuleEventTypes[eventType], - trigger_metadata: triggerMetadata && { - keyword_filter: triggerMetadata.keywordFilter, - regex_patterns: triggerMetadata.regexPatterns, - presets: triggerMetadata.presets?.map((preset) => - typeof preset === 'number' - ? preset - : AutoModerationRuleKeywordPresetTypes[preset], - ), - allow_list: triggerMetadata.allowList, - mention_total_limit: triggerMetadata.mentionTotalLimit, - mention_raid_protection_enabled: - triggerMetadata.mentionRaidProtectionEnabled, - }, - actions: actions?.map((action) => ({ - type: - typeof action.type === 'number' - ? action.type - : AutoModerationActionTypes[action.type], - metadata: { - duration_seconds: action.metadata?.durationSeconds, - channel_id: - action.metadata?.channel && - this.guild.channels.resolveId(action.metadata.channel), - custom_message: action.metadata?.customMessage, - }, - })), - enabled, - exempt_roles: exemptRoles?.map((exemptRole) => - this.guild.roles.resolveId(exemptRole), - ), - exempt_channels: exemptChannels?.map((exemptChannel) => - this.guild.channels.resolveId(exemptChannel), - ), - }, - reason, - }); - - return this._add(data); - } - - /** - * Data that can be resolved to give an AutoModerationRule object. This can be: - * * An AutoModerationRule - * * A Snowflake - * @typedef {AutoModerationRule|Snowflake} AutoModerationRuleResolvable - */ - - /** - * Options used to fetch a single auto moderation rule from a guild. - * @typedef {BaseFetchOptions} FetchAutoModerationRuleOptions - * @property {AutoModerationRuleResolvable} autoModerationRule The auto moderation rule to fetch - */ - - /** - * Options used to fetch all auto moderation rules from a guild. - * @typedef {Object} FetchAutoModerationRulesOptions - * @property {boolean} [cache] Whether to cache the fetched auto moderation rules - */ - - /** - * Fetches auto moderation rules from Discord. - * @param {AutoModerationRuleResolvable|FetchAutoModerationRuleOptions|FetchAutoModerationRulesOptions} [options] - * Options for fetching auto moderation rule(s) - * @returns {Promise>} - * @example - * // Fetch all auto moderation rules from a guild without caching - * guild.autoModerationRules.fetch({ cache: false }) - * .then(console.log) - * .catch(console.error); - * @example - * // Fetch a single auto moderation rule - * guild.autoModerationRules.fetch('979083472868098119') - * .then(console.log) - * .catch(console.error); - * @example - * // Fetch a single auto moderation rule without checking cache and without caching - * guild.autoModerationRules.fetch({ autoModerationRule: '979083472868098119', cache: false, force: true }) - * .then(console.log) - * .catch(console.error) - */ - fetch(options) { - if (!options) return this._fetchMany(); - const { autoModerationRule, cache, force } = options; - const resolvedAutoModerationRule = this.resolveId( - autoModerationRule ?? options, - ); - if (resolvedAutoModerationRule) { - return this._fetchSingle({ - autoModerationRule: resolvedAutoModerationRule, - cache, - force, - }); - } - return this._fetchMany(options); - } - - async _fetchSingle({ autoModerationRule, cache, force = false }) { - if (!force) { - const existing = this.cache.get(autoModerationRule); - if (existing) return existing; - } - - const data = await this.client.api - .guilds(this.guild.id)('auto-moderation') - .rules(autoModerationRule) - .get(); - return this._add(data, cache); - } - - async _fetchMany(options = {}) { - const data = await this.client.api - .guilds(this.guild.id)('auto-moderation') - .rules.get(); - - return data.reduce( - (col, autoModerationRule) => - col.set( - autoModerationRule.id, - this._add(autoModerationRule, options.cache), - ), - new Collection(), - ); - } - - /** - * Deletes an auto moderation rule. - * @param {AutoModerationRuleResolvable} autoModerationRule The auto moderation rule to delete - * @param {string} [reason] The reason for deleting the auto moderation rule - * @returns {Promise} - */ - async delete(autoModerationRule, reason) { - const autoModerationRuleId = this.resolveId(autoModerationRule); - await this.client.api - .guilds(this.guild.id)('auto-moderation') - .rules(autoModerationRuleId) - .delete({ reason }); - } -} - -module.exports = AutoModerationRuleManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/BaseGuildEmojiManager.js b/vendor/discord.js-selfbot-v13/src/managers/BaseGuildEmojiManager.js deleted file mode 100644 index a613074..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/BaseGuildEmojiManager.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict'; - -const CachedManager = require('./CachedManager'); -const GuildEmoji = require('../structures/GuildEmoji'); -const ReactionEmoji = require('../structures/ReactionEmoji'); -const { parseEmoji } = require('../util/Util'); - -/** - * Holds methods to resolve GuildEmojis and stores their cache. - * @extends {CachedManager} - */ -class BaseGuildEmojiManager extends CachedManager { - constructor(client, iterable) { - super(client, GuildEmoji, iterable); - } - - /** - * The cache of GuildEmojis - * @type {Collection} - * @name BaseGuildEmojiManager#cache - */ - - /** - * Data that can be resolved into a GuildEmoji object. This can be: - * * A Snowflake - * * A GuildEmoji object - * * A ReactionEmoji object - * @typedef {Snowflake|GuildEmoji|ReactionEmoji} EmojiResolvable - */ - - /** - * Resolves an EmojiResolvable to an Emoji object. - * @param {EmojiResolvable} emoji The Emoji resolvable to identify - * @returns {?GuildEmoji} - */ - resolve(emoji) { - if (emoji instanceof ReactionEmoji) return this.cache.get(emoji.id) ?? null; - return super.resolve(emoji); - } - - /** - * Resolves an EmojiResolvable to an Emoji id string. - * @param {EmojiResolvable} emoji The Emoji resolvable to identify - * @returns {?Snowflake} - */ - resolveId(emoji) { - if (emoji instanceof ReactionEmoji) return emoji.id; - return super.resolveId(emoji); - } - - /** - * Data that can be resolved to give an emoji identifier. This can be: - * * An EmojiResolvable - * * The ``, `<:name:id>`, `a:name:id` or `name:id` emoji identifier string of an emoji - * * The Unicode representation of an emoji - * @typedef {string|EmojiResolvable} EmojiIdentifierResolvable - */ - - /** - * Resolves an EmojiResolvable to an emoji identifier. - * @param {EmojiIdentifierResolvable} emoji The emoji resolvable to resolve - * @returns {?string} - */ - resolveIdentifier(emoji) { - const emojiResolvable = this.resolve(emoji); - if (emojiResolvable) return emojiResolvable.identifier; - if (emoji instanceof ReactionEmoji) return emoji.identifier; - if (typeof emoji === 'string') { - const res = parseEmoji(emoji); - if (res?.name.length) { - emoji = `${res.animated ? 'a:' : ''}${res.name}${res.id ? `:${res.id}` : ''}`; - } - if (!emoji.includes('%')) return encodeURIComponent(emoji); - return emoji; - } - return null; - } -} - -module.exports = BaseGuildEmojiManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/BaseManager.js b/vendor/discord.js-selfbot-v13/src/managers/BaseManager.js deleted file mode 100644 index 0651401..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/BaseManager.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -/** - * Manages the API methods of a data model. - * @abstract - */ -class BaseManager { - constructor(client) { - /** - * The client that instantiated this Manager - * @name BaseManager#client - * @type {Client} - * @readonly - */ - Object.defineProperty(this, 'client', { value: client }); - } -} - -module.exports = BaseManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/BillingManager.js b/vendor/discord.js-selfbot-v13/src/managers/BillingManager.js deleted file mode 100644 index b6d9c59..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/BillingManager.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const BaseManager = require('./BaseManager'); -const GuildBoost = require('../structures/GuildBoost'); - -/** - * Manages the API methods of a data model. - * @extends {CachedManager} - */ -class BillingManager extends BaseManager { - constructor(client) { - super(client); - /** - * All the payment sources of the client - * @type {Collection} - */ - this.paymentSources = new Collection(); - /** - * All the guild boosts of the client - * @type {Collection} - */ - this.guildBoosts = new Collection(); - /** - * The current subscription of the client - * @type {Collection} - */ - this.currentSubscription = new Collection(); - } - - /** - * Fetches all the payment sources of the client - * @returns {Collection} - */ - async fetchPaymentSources() { - // https://discord.com/api/v9/users/@me/billing/payment-sources - const d = await this.client.api - .users('@me') - .billing['payment-sources'].get(); - // ! TODO: Create a PaymentSource class - this.paymentSources = new Collection(d.map((s) => [s.id, s])); - return this.paymentSources; - } - - /** - * Fetches all the guild boosts of the client - * @returns {Collection} - */ - async fetchGuildBoosts() { - // https://discord.com/api/v9/users/@me/guilds/premium/subscription-slots - const d = await this.client.api - .users('@me') - .guilds.premium['subscription-slots'].get(); - this.guildBoosts = new Collection( - d.map((s) => [s.id, new GuildBoost(this.client, s)]), - ); - return this.guildBoosts; - } - - /** - * Fetches the current subscription of the client - * @returns {Collection} - */ - async fetchCurrentSubscription() { - // https://discord.com/api/v9/users/@me/billing/subscriptions - const d = await this.client.api.users('@me').billing.subscriptions.get(); - this.currentSubscription = new Collection(d.map((s) => [s.id, s])); - return this.currentSubscription; - } -} - -module.exports = BillingManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/CachedManager.js b/vendor/discord.js-selfbot-v13/src/managers/CachedManager.js deleted file mode 100644 index 8485a61..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/CachedManager.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -const DataManager = require('./DataManager'); -const { _cleanupSymbol } = require('../util/Constants'); - -/** - * Manages the API methods of a data model with a mutable cache of instances. - * @extends {DataManager} - * @abstract - */ -class CachedManager extends DataManager { - constructor(client, holds, iterable) { - super(client, holds); - - /** - * The private cache of items for this manager. - * @type {Collection} - * @private - * @readonly - * @name CachedManager#_cache - */ - Object.defineProperty(this, '_cache', { - value: this.client.options.makeCache(this.constructor, this.holds), - }); - - let cleanup = this._cache[_cleanupSymbol]?.(); - if (cleanup) { - cleanup = cleanup.bind(this._cache); - client._cleanups.add(cleanup); - client._finalizers.register(this, { - cleanup, - message: - `Garbage collection completed on ${this.constructor.name}, ` + - `which had a ${this._cache.constructor.name} of ${this.holds.name}.`, - name: this.constructor.name, - }); - } - - if (iterable) { - for (const item of iterable) { - this._add(item); - } - } - } - - /** - * The cache of items for this manager. - * @type {Collection} - * @abstract - */ - get cache() { - return this._cache; - } - - _add(data, cache = true, { id, extras = [] } = {}) { - const existing = this.cache.get(id ?? data.id); - if (existing) { - if (cache) { - existing._patch(data); - return existing; - } - const clone = existing._clone(); - clone._patch(data); - return clone; - } - - const entry = this.holds - ? new this.holds(this.client, data, ...extras) - : data; - if (cache) this.cache.set(id ?? entry.id, entry); - return entry; - } -} - -module.exports = CachedManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/ChannelManager.js b/vendor/discord.js-selfbot-v13/src/managers/ChannelManager.js deleted file mode 100644 index 293bc03..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/ChannelManager.js +++ /dev/null @@ -1,170 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const CachedManager = require('./CachedManager'); -const { Channel } = require('../structures/Channel'); -const { - Events, - ThreadChannelTypes, - RelationshipTypes, -} = require('../util/Constants'); - -let cacheWarningEmitted = false; - -/** - * A manager of channels belonging to a client - * @extends {CachedManager} - */ -class ChannelManager extends CachedManager { - constructor(client, iterable) { - super(client, Channel, iterable); - const defaultCaching = - this._cache.constructor.name === 'Collection' || - ((this._cache.maxSize === undefined || - this._cache.maxSize === Infinity) && - (this._cache.sweepFilter === undefined || - this._cache.sweepFilter.isDefault)); - if (!cacheWarningEmitted && !defaultCaching) { - cacheWarningEmitted = true; - process.emitWarning( - `Overriding the cache handling for ${this.constructor.name} is unsupported and breaks functionality.`, - 'UnsupportedCacheOverwriteWarning', - ); - } - } - - /** - * The cache of Channels - * @type {Collection} - * @name ChannelManager#cache - */ - - _add(data, guild, { cache = true, allowUnknownGuild = false } = {}) { - const existing = this.cache.get(data.id); - if (existing) { - if (cache) existing._patch(data); - guild?.channels?._add(existing); - if (ThreadChannelTypes.includes(existing.type)) { - existing.parent?.threads?._add(existing); - } - return existing; - } - - const channel = Channel.create(this.client, data, guild, { - allowUnknownGuild, - }); - - if (!channel) { - this.client.emit( - Events.DEBUG, - `Failed to find guild, or unknown type for channel ${data.id} ${data.type}`, - ); - return null; - } - - if (cache && !allowUnknownGuild) this.cache.set(channel.id, channel); - - return channel; - } - - _remove(id) { - const channel = this.cache.get(id); - channel?.guild?.channels.cache.delete(id); - for (const [code, invite] of channel?.guild?.invites.cache ?? []) { - if (invite.channelId === id) channel.guild.invites.cache.delete(code); - } - channel?.parent?.threads?.cache.delete(id); - this.cache.delete(id); - if (channel?.threads) { - for (const threadId of channel.threads.cache.keys()) { - this.cache.delete(threadId); - channel.guild?.channels.cache.delete(threadId); - } - } - } - - /** - * Data that can be resolved to give a Channel object. This can be: - * * A Channel object - * * A Snowflake - * @typedef {Channel|Snowflake} ChannelResolvable - */ - - /** - * Resolves a ChannelResolvable to a Channel object. - * @method resolve - * @memberof ChannelManager - * @instance - * @param {ChannelResolvable} channel The channel resolvable to resolve - * @returns {?Channel} - */ - - /** - * Resolves a ChannelResolvable to a channel id string. - * @method resolveId - * @memberof ChannelManager - * @instance - * @param {ChannelResolvable} channel The channel resolvable to resolve - * @returns {?Snowflake} - */ - - /** - * Options for fetching a channel from Discord - * @typedef {BaseFetchOptions} FetchChannelOptions - * @property {boolean} [allowUnknownGuild=false] Allows the channel to be returned even if the guild is not in cache, - * it will not be cached. Many of the properties and methods on the returned channel will throw errors - */ - - /** - * Obtains a channel from Discord, or the channel cache if it's already available. - * @param {Snowflake} id The channel's id - * @param {FetchChannelOptions} [options] Additional options for this fetch - * @returns {Promise} - * @example - * // Fetch a channel by its id - * client.channels.fetch('222109930545610754') - * .then(channel => console.log(channel.name)) - * .catch(console.error); - */ - async fetch( - id, - { allowUnknownGuild = false, cache = true, force = false } = {}, - ) { - if (!force) { - const existing = this.cache.get(id); - if (existing && !existing.partial) return existing; - } - - const data = await this.client.api.channels(id).get(); - return this._add(data, null, { cache, allowUnknownGuild }); - } - - /** - * Create Group DM - * @param {UserResolvable[]} [recipients=[]] Array of recipients - * @returns {Promise} Channel - * @example - * client.channels.createGroupDM(); - */ - async createGroupDM(recipients = []) { - if (!Array.isArray(recipients)) - throw new Error( - `Expected an array of recipients (got ${typeof recipients})`, - ); - recipients = recipients - .map((r) => this.client.users.resolveId(r)) - .filter( - (r) => - r && - this.client.relationships.cache.get(r) == RelationshipTypes.FRIEND, - ); - if (recipients.length == 1 || recipients.length > 9) - throw new Error('Invalid Users length (max=9)'); - const data = await this.client.api.users['@me'].channels.post({ - data: { recipients }, - }); - return this._add(data, null, { cache: true, allowUnknownGuild: true }); - } -} - -module.exports = ChannelManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/ClientUserSettingManager.js b/vendor/discord.js-selfbot-v13/src/managers/ClientUserSettingManager.js deleted file mode 100644 index 8905599..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/ClientUserSettingManager.js +++ /dev/null @@ -1,392 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const BaseManager = require('./BaseManager'); -const { TypeError } = require('../errors/DJSError'); -const { CustomStatus } = require('../structures/Presence'); -const { ActivityTypes } = require('../util/Constants'); - -/** - * Manages API methods for users and stores their cache. - * @extends {BaseManager} - * @see {@link https://luna.gitlab.io/discord-unofficial-docs/user_settings.html} - */ -class ClientUserSettingManager extends BaseManager { - #rawSetting = {}; - constructor(client) { - super(client); - /** - * WHO CAN ADD YOU AS A FRIEND ? - * @type {?object} - * @see {@link https://luna.gitlab.io/discord-unofficial-docs/user_settings.html#friend-source-flags-structure} - */ - this.addFriendFrom = { - all: null, - mutual_friends: null, - mutual_guilds: null, - }; - } - /** - * Patch data file - * https://luna.gitlab.io/discord-unofficial-docs/docs/user_settings - * @private - * @param {Object} data Raw Data to patch - */ - _patch(data = {}) { - this.#rawSetting = Object.assign(this.#rawSetting, data); - this.client.emit('debug', `[SETTING > ClientUser] Sync setting`); - if ('locale' in data) { - /** - * The user's chosen language option - * @type {?string} - * @see {@link https://discord.com/developers/docs/reference#locales} - */ - this.locale = data.locale; - } - if ('show_current_game' in data) { - /** - * Show playing status for detected/added games - * Setting => ACTIVITY SETTINGS => Activity Status => Display current activity as a status message - * @type {?boolean} - */ - this.activityDisplay = data.show_current_game; - } - if ('default_guilds_restricted' in data) { - /** - * Allow DMs from guild members by default on guild join - * @type {?boolean} - */ - this.allowDMsFromGuild = data.default_guilds_restricted; - } - if ('inline_attachment_media' in data) { - /** - * Display images and video when uploaded directly - * @type {?boolean} - */ - this.displayImage = data.inline_attachment_media; - } - if ('inline_embed_media' in data) { - /** - * Display images and video when linked - * @type {?boolean} - */ - this.linkedImageDisplay = data.inline_embed_media; - } - if ('gif_auto_play' in data) { - /** - * Play GIFs without hovering over them - * Setting => APP SETTINGS => Accessibility => Automatically play GIFs when Discord is focused. - * @type {?boolean} - */ - this.autoplayGIF = data.gif_auto_play; - } - if ('render_embeds' in data) { - /** - * Show embeds and preview website links pasted into chat - * @type {?boolean} - */ - this.previewLink = data.render_embeds; - } - if ('animate_emoji' in data) { - /** - * Play animated emoji without hovering over them - * Setting => APP SETTINGS => Accessibility => Play Animated Emojis - * @type {?boolean} - */ - this.animatedEmoji = data.animate_emoji; - } - if ('enable_tts_command' in data) { - /** - * Enable /tts command and playback - * Setting => APP SETTINGS => Accessibility => Text-to-speech => Allow playback - * @type {?boolean} - */ - this.allowTTS = data.enable_tts_command; - } - if ('message_display_compact' in data) { - /** - * Use compact mode - * Setting => APP SETTINGS => Appearance => Message Display => Compact Mode - * @type {?boolean} - */ - this.compactMode = data.message_display_compact; - } - if ('convert_emoticons' in data) { - /** - * Convert "old fashioned" emoticons to emojis - * Setting => APP SETTINGS => Text & Images => Emoji => Convert Emoticons - * @type {?boolean} - */ - this.convertEmoticons = data.convert_emoticons; - } - if ('explicit_content_filter' in data) { - /** - * Content filter level - * - * * `0`: Off - * * `1`: Friends excluded - * * `2`: Scan everyone - * - * @type {?number} - */ - this.DMScanLevel = data.explicit_content_filter; - } - if ('theme' in data) { - /** - * Client theme - * Setting => APP SETTINGS => Appearance => Theme - * * `dark` - * * `light` - * - * @type {?string} - */ - this.theme = data.theme; - } - if ('developer_mode' in data) { - /** - * Show the option to copy ids in right click menus - * @type {?boolean} - */ - this.developerMode = data.developer_mode; - } - if ('afk_timeout' in data) { - /** - * How many seconds being idle before the user is marked as "AFK"; this handles when push notifications are sent - * @type {?number} - */ - this.afkTimeout = data.afk_timeout; - } - if ('animate_stickers' in data) { - /** - * When stickers animate - * - * * `0`: Always - * * `1`: On hover/focus - * * `2`: Never - * - * @type {?number} - */ - this.stickerAnimationMode = data.animate_stickers; - } - if ('render_reactions' in data) { - /** - * Display reactions - * Setting => APP SETTINGS => Text & Images => Emoji => Show emoji reactions - * @type {?boolean} - */ - this.showEmojiReactions = data.render_reactions; - } - if ('status' in data) { - this.client.presence.status = data.status; - if (!('custom_status' in data)) { - this.client.emit('debug', '[SETTING > ClientUser] Sync status'); - this.client.user.setStatus(data.status); - } - } - if ('custom_status' in data) { - this.customStatus = data.custom_status; - const activities = this.client.presence.activities.filter( - (a) => ![ActivityTypes.CUSTOM, 'CUSTOM'].includes(a.type), - ); - if (data.custom_status) { - const custom = new CustomStatus(this.client); - custom.setState(data.custom_status.text); - let emoji; - if (data.custom_status.emoji_id) { - emoji = this.client.emojis.cache.get(data.custom_status.emoji_id); - } else if (data.custom_status.emoji_name) { - emoji = `:${data.custom_status.emoji_name}:`; - } - if (emoji) custom.setEmoji(emoji); - activities.push(custom); - } - this.client.emit( - 'debug', - '[SETTING > ClientUser] Sync activities & status', - ); - this.client.user.setPresence({ activities }); - } - if ('friend_source_flags' in data) { - // Todo - } - if ('restricted_guilds' in data) { - /** - * Disable Direct Message from servers - * @type {Collection} - */ - this.disableDMfromGuilds = new Collection( - data.restricted_guilds.map((guildId) => [ - guildId, - this.client.guilds.cache.get(guildId), - ]), - ); - } - } - - /** - * Raw data - * @type {Object} - */ - get raw() { - return this.#rawSetting; - } - - async fetch() { - const data = await this.client.api.users('@me').settings.get(); - this._patch(data); - return this; - } - - /** - * Edit data - * @param {any} data Data to edit - */ - async edit(data) { - const res = await this.client.api.users('@me').settings.patch({ data }); - this._patch(res); - return this; - } - - /** - * Toggle compact mode - * @returns {Promise} - */ - toggleCompactMode() { - return this.edit({ message_display_compact: !this.compactMode }); - } - /** - * Discord Theme - * @param {string} value Theme to set (dark | light) - * @returns {Promise} - */ - setTheme(value) { - const validValues = ['dark', 'light']; - if (!validValues.includes(value)) { - throw new TypeError('INVALID_TYPE', 'value', 'dark | light', true); - } - return this.edit({ theme: value }); - } - - /** - * CustomStatus Object - * @typedef {Object} CustomStatusOption - * @property {string | null} text Text to set - * @property {string | null} status The status to set: 'online', 'idle', 'dnd', 'invisible' or null. - * @property {EmojiResolvable | null} emoji UnicodeEmoji, DiscordEmoji, or null. - * @property {number | null} expires The number of seconds until the status expires, or null. - */ - - /** - * Set custom status - * @param {?CustomStatus | CustomStatusOption} options CustomStatus - * @returns {Promise} - */ - setCustomStatus(options) { - if (typeof options !== 'object') { - return this.edit({ custom_status: null }); - } else if (options instanceof CustomStatus) { - options = options.toJSON(); - let data = { - emoji_name: null, - expires_at: null, - text: null, - }; - if (typeof options.state === 'string') { - data.text = options.state; - } - if (options.emoji) { - if (options.emoji?.id) { - data.emoji_name = options.emoji?.name; - data.emoji_id = options.emoji?.id; - } else { - data.emoji_name = - typeof options.emoji?.name === 'string' - ? options.emoji?.name - : null; - } - } - return this.edit({ custom_status: data }); - } else { - let data = { - emoji_name: null, - expires_at: null, - text: null, - }; - if (typeof options.text === 'string') { - if (options.text.length > 128) { - throw new RangeError( - '[INVALID_VALUE] Custom status text must be less than 128 characters', - ); - } - data.text = options.text; - } - if (options.emoji) { - const emoji = this.client.emojis.resolve(options.emoji); - if (emoji) { - data.emoji_name = emoji.name; - data.emoji_id = emoji.id; - } else { - data.emoji_name = - typeof options.emoji === 'string' ? options.emoji : null; - } - } - if (typeof options.expires === 'number') { - if (options.expires < Date.now()) { - throw new RangeError( - `[INVALID_VALUE] Custom status expiration must be greater than ${Date.now()}`, - ); - } - data.expires_at = new Date(options.expires).toISOString(); - } - if (['online', 'idle', 'dnd', 'invisible'].includes(options.status)) - this.edit({ status: options.status }); - return this.edit({ custom_status: data }); - } - } - - /** - * Restricted guilds setting - * @param {boolean} status Restricted status - * @returns {Promise} - */ - restrictedGuilds(status) { - if (typeof status !== 'boolean') { - throw new TypeError('INVALID_TYPE', 'status', 'boolean', true); - } - return this.edit({ - default_guilds_restricted: status, - restricted_guilds: status - ? this.client.guilds.cache.map((v) => v.id) - : [], - }); - } - /** - * Add a guild to the list of restricted guilds. - * @param {GuildIDResolve} guildId The guild to add - * @returns {Promise} - */ - addRestrictedGuild(guildId) { - const temp = Object.assign( - [], - this.disableDMfromServer.map((v, k) => k), - ); - if (temp.includes(guildId)) throw new Error('Guild is already restricted'); - temp.push(guildId); - return this.edit({ restricted_guilds: temp }); - } - - /** - * Remove a guild from the list of restricted guilds. - * @param {GuildIDResolve} guildId The guild to remove - * @returns {Promise} - */ - removeRestrictedGuild(guildId) { - if (!this.disableDMfromServer.delete(guildId)) - throw new Error('Guild is already restricted'); - return this.edit({ - restricted_guilds: this.disableDMfromServer.map((v, k) => k), - }); - } -} - -module.exports = ClientUserSettingManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/DataManager.js b/vendor/discord.js-selfbot-v13/src/managers/DataManager.js deleted file mode 100644 index b577fc2..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/DataManager.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; - -const BaseManager = require('./BaseManager'); -const { Error } = require('../errors'); - -/** - * Manages the API methods of a data model along with a collection of instances. - * @extends {BaseManager} - * @abstract - */ -class DataManager extends BaseManager { - constructor(client, holds) { - super(client); - - /** - * The data structure belonging to this manager. - * @name DataManager#holds - * @type {Function} - * @private - * @readonly - */ - Object.defineProperty(this, 'holds', { value: holds }); - } - - /** - * The cache of items for this manager. - * @type {Collection} - * @abstract - */ - get cache() { - throw new Error('NOT_IMPLEMENTED', 'get cache', this.constructor.name); - } - - /** - * Resolves a data entry to a data Object. - * @param {string|Object} idOrInstance The id or instance of something in this Manager - * @returns {?Object} An instance from this Manager - */ - resolve(idOrInstance) { - if (idOrInstance instanceof this.holds) return idOrInstance; - if (typeof idOrInstance === 'string') - return this.cache.get(idOrInstance) ?? null; - return null; - } - - /** - * Resolves a data entry to an instance id. - * @param {string|Object} idOrInstance The id or instance of something in this Manager - * @returns {?Snowflake} - */ - resolveId(idOrInstance) { - if (idOrInstance instanceof this.holds) return idOrInstance.id; - if (typeof idOrInstance === 'string') return idOrInstance; - return null; - } - - valueOf() { - return this.cache; - } -} - -module.exports = DataManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/GuildBanManager.js b/vendor/discord.js-selfbot-v13/src/managers/GuildBanManager.js deleted file mode 100644 index 337246b..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/GuildBanManager.js +++ /dev/null @@ -1,271 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const { Collection } = require('@discordjs/collection'); -const CachedManager = require('./CachedManager'); -const { TypeError, Error } = require('../errors'); -const GuildBan = require('../structures/GuildBan'); -const { GuildMember } = require('../structures/GuildMember'); - -let deprecationEmittedForDays = false; - -/** - * Manages API methods for GuildBans and stores their cache. - * @extends {CachedManager} - */ -class GuildBanManager extends CachedManager { - constructor(guild, iterable) { - super(guild.client, GuildBan, iterable); - - /** - * The guild this Manager belongs to - * @type {Guild} - */ - this.guild = guild; - } - - /** - * The cache of this Manager - * @type {Collection} - * @name GuildBanManager#cache - */ - - _add(data, cache) { - return super._add(data, cache, { id: data.user.id, extras: [this.guild] }); - } - - /** - * Data that resolves to give a GuildBan object. This can be: - * * A GuildBan object - * * A User resolvable - * @typedef {GuildBan|UserResolvable} GuildBanResolvable - */ - - /** - * Resolves a GuildBanResolvable to a GuildBan object. - * @param {GuildBanResolvable} ban The ban that is in the guild - * @returns {?GuildBan} - */ - resolve(ban) { - return ( - super.resolve(ban) ?? super.resolve(this.client.users.resolveId(ban)) - ); - } - - /** - * Options used to fetch a single ban from a guild. - * @typedef {BaseFetchOptions} FetchBanOptions - * @property {UserResolvable} user The ban to fetch - */ - - /** - * Options used to fetch multiple bans from a guild. - * @typedef {Object} FetchBansOptions - * @property {number} [limit] The maximum number of bans to return - * @property {Snowflake} [before] Consider only bans before this id - * @property {Snowflake} [after] Consider only bans after this id - * @property {boolean} [cache] Whether to cache the fetched bans - */ - - /** - * Fetches ban(s) from Discord. - * @param {UserResolvable|FetchBanOptions|FetchBansOptions} [options] Options for fetching guild ban(s) - * @returns {Promise>} - * @example - * // Fetch multiple bans from a guild - * guild.bans.fetch() - * .then(console.log) - * .catch(console.error); - * @example - * // Fetch a maximum of 5 bans from a guild without caching - * guild.bans.fetch({ limit: 5, cache: false }) - * .then(console.log) - * .catch(console.error); - * @example - * // Fetch a single ban - * guild.bans.fetch('351871113346809860') - * .then(console.log) - * .catch(console.error); - * @example - * // Fetch a single ban without checking cache - * guild.bans.fetch({ user, force: true }) - * .then(console.log) - * .catch(console.error) - * @example - * // Fetch a single ban without caching - * guild.bans.fetch({ user, cache: false }) - * .then(console.log) - * .catch(console.error); - */ - async fetch(options) { - if (!options) return this._fetchMany(); - const { user, cache, force, limit, before, after } = options; - const resolvedUser = this.client.users.resolveId(user ?? options); - if (resolvedUser) - return this._fetchSingle({ user: resolvedUser, cache, force }); - - if (!before && !after && !limit && typeof cache === 'undefined') { - throw new Error('FETCH_BAN_RESOLVE_ID'); - } - - return this._fetchMany(options); - } - - async _fetchSingle({ user, cache, force = false }) { - if (!force) { - const existing = this.cache.get(user); - if (existing && !existing.partial) return existing; - } - - const data = await this.client.api.guilds(this.guild.id).bans(user).get(); - return this._add(data, cache); - } - - async _fetchMany(options = {}) { - const data = await this.client.api.guilds(this.guild.id).bans.get({ - query: options, - }); - - return data.reduce( - (col, ban) => col.set(ban.user.id, this._add(ban, options.cache)), - new Collection(), - ); - } - /** - * Options used to ban a user from a guild. - * @typedef {Object} BanOptions - * @property {number} [days=0] Number of days of messages to delete, must be between 0 and 7, inclusive - * This property is deprecated. Use `deleteMessageSeconds` instead. - * @property {number} [deleteMessageSeconds] Number of seconds of messages to delete, - * must be between 0 and 604800 (7 days), inclusive - * @property {string} [reason] The reason for the ban - */ - - /** - * Bans a user from the guild. - * @param {UserResolvable} user The user to ban - * @param {BanOptions} [options] Options for the ban - * @returns {Promise} Result object will be resolved as specifically as possible. - * If the GuildMember cannot be resolved, the User will instead be attempted to be resolved. If that also cannot - * be resolved, the user id will be the result. - * @example - * // Ban a user by id (or with a user/guild member object) - * guild.bans.create('84484653687267328') - * .then(banInfo => console.log(`Banned ${banInfo.user?.tag ?? banInfo.tag ?? banInfo}`)) - * .catch(console.error); - */ - async create(user, options = {}) { - if (typeof options !== 'object') - throw new TypeError('INVALID_TYPE', 'options', 'object', true); - const id = this.client.users.resolveId(user); - if (!id) throw new Error('BAN_RESOLVE_ID', true); - - if (typeof options.days !== 'undefined' && !deprecationEmittedForDays) { - process.emitWarning( - 'The days option for GuildBanManager#create() is deprecated. Use the deleteMessageSeconds option instead.', - 'DeprecationWarning', - ); - - deprecationEmittedForDays = true; - } - - await this.client.api - .guilds(this.guild.id) - .bans(id) - .put({ - data: { - delete_message_seconds: - typeof options.deleteMessageSeconds !== 'undefined' - ? options.deleteMessageSeconds - : (options.days ?? 0) * 24 * 60 * 60, - }, - reason: options.reason, - }); - if (user instanceof GuildMember) return user; - const _user = this.client.users.cache.get(id); - if (_user) { - return this.guild.members.resolve(_user) ?? _user; - } - return id; - } - - /** - * Unbans a user from the guild. - * @param {UserResolvable} user The user to unban - * @param {string} [reason] Reason for unbanning user - * @returns {Promise} - * @example - * // Unban a user by id (or with a user/guild member object) - * guild.bans.remove('84484653687267328') - * .then(user => console.log(`Unbanned ${user.username} from ${guild.name}`)) - * .catch(console.error); - */ - async remove(user, reason) { - const id = this.client.users.resolveId(user); - if (!id) throw new Error('BAN_RESOLVE_ID'); - await this.client.api.guilds(this.guild.id).bans(id).delete({ reason }); - return this.client.users.resolve(user); - } - - /** - * Options used for bulk banning users from a guild. - * @typedef {Object} BulkBanOptions - * @property {number} [deleteMessageSeconds] Number of seconds of messages to delete, - * must be between 0 and 604800 (7 days), inclusive - * @property {string} [reason] The reason for the bans - */ - - /** - * Result of bulk banning users from a guild. - * @typedef {Object} BulkBanResult - * @property {Snowflake[]} bannedUsers IDs of the banned users - * @property {Snowflake[]} failedUsers IDs of the users that could not be banned or were already banned - */ - - /** - * Bulk ban users from a guild, and optionally delete previous messages sent by them. - * @param {Collection|UserResolvable[]} users The users to ban - * @param {BulkBanOptions} [options] The options for bulk banning users - * @returns {Promise} Returns an object with `bannedUsers` key containing the IDs of the banned users - * and the key `failedUsers` with the IDs that could not be banned or were already banned. - * @example - * // Bulk ban users by ids (or with user/guild member objects) and delete all their messages from the past 7 days - * guild.bans.bulkCreate(['84484653687267328'], { deleteMessageSeconds: 7 * 24 * 60 * 60 }) - * .then(result => { - * console.log(`Banned ${result.bannedUsers.length} users, failed to ban ${result.failedUsers.length} users.`) - * }) - * .catch(console.error); - * @deprecated This method will not be usable until an effective MFA implementation is in place. - */ - async bulkCreate(users, options = {}) { - if (!users || !(Array.isArray(users) || users instanceof Collection)) { - throw new TypeError( - 'INVALID_TYPE', - 'users', - 'Array or Collection of UserResolvable', - true, - ); - } - if (typeof options !== 'object') - throw new TypeError('INVALID_TYPE', 'options', 'object', true); - - const userIds = users.map((user) => this.client.users.resolveId(user)); - if (userIds.length === 0) throw new Error('BULK_BAN_USERS_OPTION_EMPTY'); - - const result = await this.client.api - .guilds(this.guild.id) - ['bulk-ban'].post({ - data: { - delete_message_days: options.deleteMessageSeconds, - user_ids: userIds, - }, - reason: options.reason, - }); - return { - bannedUsers: result.banned_users, - failedUsers: result.failed_users, - }; - } -} - -module.exports = GuildBanManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/GuildChannelManager.js b/vendor/discord.js-selfbot-v13/src/managers/GuildChannelManager.js deleted file mode 100644 index bb1c1ef..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/GuildChannelManager.js +++ /dev/null @@ -1,546 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const { Collection } = require('@discordjs/collection'); -const CachedManager = require('./CachedManager'); -const { Error, TypeError } = require('../errors'); -const GuildChannel = require('../structures/GuildChannel'); -const PermissionOverwrites = require('../structures/PermissionOverwrites'); -const ThreadChannel = require('../structures/ThreadChannel'); -const Webhook = require('../structures/Webhook'); -const ChannelFlags = require('../util/ChannelFlags'); -const { - ThreadChannelTypes, - ChannelTypes, - VideoQualityModes, - SortOrderTypes, - ForumLayoutTypes, -} = require('../util/Constants'); -const DataResolver = require('../util/DataResolver'); -const Util = require('../util/Util'); -const { - resolveAutoArchiveMaxLimit, - transformGuildForumTag, - transformGuildDefaultReaction, -} = require('../util/Util'); - -let cacheWarningEmitted = false; -let storeChannelDeprecationEmitted = false; - -/** - * Manages API methods for GuildChannels and stores their cache. - * @extends {CachedManager} - */ -class GuildChannelManager extends CachedManager { - constructor(guild, iterable) { - super(guild.client, GuildChannel, iterable); - const defaultCaching = - this._cache.constructor.name === 'Collection' || - ((this._cache.maxSize === undefined || - this._cache.maxSize === Infinity) && - (this._cache.sweepFilter === undefined || - this._cache.sweepFilter.isDefault)); - if (!cacheWarningEmitted && !defaultCaching) { - cacheWarningEmitted = true; - process.emitWarning( - `Overriding the cache handling for ${this.constructor.name} is unsupported and breaks functionality.`, - 'UnsupportedCacheOverwriteWarning', - ); - } - - /** - * The guild this Manager belongs to - * @type {Guild} - */ - this.guild = guild; - } - - /** - * The number of channels in this managers cache excluding thread channels - * that do not count towards a guild's maximum channels restriction. - * @type {number} - * @readonly - */ - get channelCountWithoutThreads() { - return this.cache.reduce((acc, channel) => { - if (ThreadChannelTypes.includes(channel.type)) return acc; - return ++acc; - }, 0); - } - - /** - * The cache of this Manager - * @type {Collection} - * @name GuildChannelManager#cache - */ - - _add(channel) { - const existing = this.cache.get(channel.id); - if (existing) return existing; - this.cache.set(channel.id, channel); - return channel; - } - - /** - * Data that can be resolved to give a Guild Channel object. This can be: - * * A GuildChannel object - * * A ThreadChannel object - * * A Snowflake - * @typedef {GuildChannel|ThreadChannel|Snowflake} GuildChannelResolvable - */ - - /** - * Resolves a GuildChannelResolvable to a Channel object. - * @param {GuildChannelResolvable} channel The GuildChannel resolvable to resolve - * @returns {?(GuildChannel|ThreadChannel)} - */ - resolve(channel) { - if (channel instanceof ThreadChannel) - return this.cache.get(channel.id) ?? null; - return super.resolve(channel); - } - - /** - * Resolves a GuildChannelResolvable to a channel id. - * @param {GuildChannelResolvable} channel The GuildChannel resolvable to resolve - * @returns {?Snowflake} - */ - resolveId(channel) { - if (channel instanceof ThreadChannel) return super.resolveId(channel.id); - return super.resolveId(channel); - } - - /** - * Options used to create a new channel in a guild. - * @typedef {CategoryCreateChannelOptions} GuildChannelCreateOptions - * @property {CategoryChannelResolvable} [parent] Parent of the new channel - */ - - /** - * Creates a new channel in the guild. - * @param {string} name The name of the new channel - * @param {GuildChannelCreateOptions} [options={}] Options for creating the new channel - * @returns {Promise} - * @example - * // Create a new text channel - * guild.channels.create('new-general', { reason: 'Needed a cool new channel' }) - * .then(console.log) - * .catch(console.error); - * @example - * // Create a new channel with permission overwrites - * guild.channels.create('new-voice', { - * type: 'GUILD_VOICE', - * permissionOverwrites: [ - * { - * id: message.author.id, - * deny: [Permissions.FLAGS.VIEW_CHANNEL], - * }, - * ], - * }) - */ - async create( - name, - { - type, - topic, - nsfw, - bitrate, - userLimit, - parent, - permissionOverwrites, - position, - rateLimitPerUser, - rtcRegion, - videoQualityMode, - availableTags, - defaultReactionEmoji, - defaultSortOrder, - defaultForumLayout, - defaultThreadRateLimitPerUser, - reason, - } = {}, - ) { - parent &&= this.client.channels.resolveId(parent); - permissionOverwrites &&= permissionOverwrites.map((o) => - PermissionOverwrites.resolve(o, this.guild), - ); - const intType = - typeof type === 'number' - ? type - : (ChannelTypes[type] ?? ChannelTypes.GUILD_TEXT); - - const videoMode = - typeof videoQualityMode === 'number' - ? videoQualityMode - : VideoQualityModes[videoQualityMode]; - - const sortMode = - typeof defaultSortOrder === 'number' - ? defaultSortOrder - : SortOrderTypes[defaultSortOrder]; - - const layoutMode = - typeof defaultForumLayout === 'number' - ? defaultForumLayout - : ForumLayoutTypes[defaultForumLayout]; - - if ( - intType === ChannelTypes.GUILD_STORE && - !storeChannelDeprecationEmitted - ) { - storeChannelDeprecationEmitted = true; - process.emitWarning( - // eslint-disable-next-line max-len - 'Creating store channels is deprecated by Discord and will stop working in March 2022. Check the docs for more info.', - 'DeprecationWarning', - ); - } - - const data = await this.client.api.guilds(this.guild.id).channels.post({ - data: { - name, - topic, - type: intType, - nsfw, - bitrate, - user_limit: userLimit, - parent_id: parent, - position, - permission_overwrites: permissionOverwrites, - rate_limit_per_user: rateLimitPerUser, - rtc_region: rtcRegion, - video_quality_mode: videoMode, - available_tags: availableTags?.map((availableTag) => - transformGuildForumTag(availableTag), - ), - default_reaction_emoji: - defaultReactionEmoji && - transformGuildDefaultReaction(defaultReactionEmoji), - default_sort_order: sortMode, - default_forum_layout: layoutMode, - default_thread_rate_limit_per_user: defaultThreadRateLimitPerUser, - }, - reason, - }); - return this.client.actions.ChannelCreate.handle(data).channel; - } - - /** - * Creates a webhook for the channel. - * @param {GuildChannelResolvable} channel The channel to create the webhook for - * @param {string} name The name of the webhook - * @param {ChannelWebhookCreateOptions} [options] Options for creating the webhook - * @returns {Promise} Returns the created Webhook - * @example - * // Create a webhook for the current channel - * guild.channels.createWebhook('222197033908436994', 'Snek', { - * avatar: 'https://i.imgur.com/mI8XcpG.jpg', - * reason: 'Needed a cool new Webhook' - * }) - * .then(console.log) - * .catch(console.error) - */ - async createWebhook(channel, name, { avatar, reason } = {}) { - const id = this.resolveId(channel); - if (!id) - throw new TypeError('INVALID_TYPE', 'channel', 'GuildChannelResolvable'); - - const resolvedImage = await DataResolver.resolveImage(avatar); - - const data = await this.client.api.channels[id].webhooks.post({ - data: { - name, - avatar: resolvedImage, - }, - reason, - }); - return new Webhook(this.client, data); - } - - /** - * Adds the target channel to a channel's followers. - * @param {NewsChannel|Snowflake} channel The channel to follow - * @param {TextChannelResolvable} targetChannel The channel where published announcements will be posted at - * @param {string} [reason] Reason for creating the webhook - * @returns {Promise} Returns created target webhook id. - */ - async addFollower(channel, targetChannel, reason) { - const channelId = this.resolveId(channel); - const targetChannelId = this.resolveId(targetChannel); - if (!channelId || !targetChannelId) - throw new Error('GUILD_CHANNEL_RESOLVE'); - const { webhook_id } = await this.client.api.channels[ - channelId - ].followers.post({ - data: { webhook_channel_id: targetChannelId }, - reason, - }); - return webhook_id; - } - - /** - * The data for a guild channel. - * @typedef {Object} ChannelData - * @property {string} [name] The name of the channel - * @property {ChannelType} [type] The type of the channel (only conversion between text and news is supported) - * @property {number} [position] The position of the channel - * @property {string} [topic] The topic of the text channel - * @property {boolean} [nsfw] Whether the channel is NSFW - * @property {number} [bitrate] The bitrate of the voice channel - * @property {number} [userLimit] The user limit of the voice channel - * @property {?CategoryChannelResolvable} [parent] The parent of the channel - * @property {boolean} [lockPermissions] - * Lock the permissions of the channel to what the parent's permissions are - * @property {OverwriteResolvable[]|Collection} [permissionOverwrites] - * Permission overwrites for the channel - * @property {number} [rateLimitPerUser] The rate limit per user (slowmode) for the channel in seconds - * @property {ThreadAutoArchiveDuration} [defaultAutoArchiveDuration] - * The default auto archive duration for all new threads in this channel - * @property {?string} [rtcRegion] The RTC region of the channel - * @property {?VideoQualityMode|number} [videoQualityMode] The camera video quality mode of the channel - * @property {ChannelFlagsResolvable} [flags] The flags to set on the channel - * @property {GuildForumTagData[]} [availableTags] The tags to set as available in a forum channel - * @property {?DefaultReactionEmoji} [defaultReactionEmoji] The emoji to set as the default reaction emoji - * @property {number} [defaultThreadRateLimitPerUser] The rate limit per user (slowmode) to set on forum posts - * @property {?SortOrderType} [defaultSortOrder] The default sort order mode to set on the channel - */ - - /** - * Edits the channel. - * @param {GuildChannelResolvable} channel The channel to edit - * @param {ChannelData} data The new data for the channel - * @param {string} [reason] Reason for editing this channel - * @returns {Promise} - * @example - * // Edit a channel - * guild.channels.edit('222197033908436994', { name: 'new-channel' }) - * .then(console.log) - * .catch(console.error); - */ - async edit(channel, data, reason) { - channel = this.resolve(channel); - if (!channel) - throw new TypeError('INVALID_TYPE', 'channel', 'GuildChannelResolvable'); - - const parentId = data.parent && this.client.channels.resolveId(data.parent); - - if (typeof data.position !== 'undefined') - await this.setPosition(channel, data.position, { reason }); - - let permission_overwrites = data.permissionOverwrites?.map((o) => - PermissionOverwrites.resolve(o, this.guild), - ); - - if (data.lockPermissions) { - if (parentId) { - const newParent = this.cache.get(parentId); - if (newParent?.type === 'GUILD_CATEGORY') { - permission_overwrites = newParent.permissionOverwrites.cache.map( - (o) => PermissionOverwrites.resolve(o, this.guild), - ); - } - } else if (channel.parent) { - permission_overwrites = channel.parent.permissionOverwrites.cache.map( - (o) => PermissionOverwrites.resolve(o, this.guild), - ); - } - } - - let defaultAutoArchiveDuration = data.defaultAutoArchiveDuration; - if (defaultAutoArchiveDuration === 'MAX') - defaultAutoArchiveDuration = resolveAutoArchiveMaxLimit(this.guild); - - const newData = await this.client.api.channels(channel.id).patch({ - data: { - name: (data.name ?? channel.name).trim(), - type: data.type, - topic: data.topic, - nsfw: data.nsfw, - bitrate: data.bitrate ?? channel.bitrate, - user_limit: data.userLimit ?? channel.userLimit, - rtc_region: 'rtcRegion' in data ? data.rtcRegion : channel.rtcRegion, - video_quality_mode: - typeof data.videoQualityMode === 'string' - ? VideoQualityModes[data.videoQualityMode] - : data.videoQualityMode, - parent_id: parentId, - lock_permissions: data.lockPermissions, - rate_limit_per_user: data.rateLimitPerUser, - default_auto_archive_duration: defaultAutoArchiveDuration, - permission_overwrites, - available_tags: data.availableTags?.map((availableTag) => - transformGuildForumTag(availableTag), - ), - default_reaction_emoji: - data.defaultReactionEmoji && - transformGuildDefaultReaction(data.defaultReactionEmoji), - default_thread_rate_limit_per_user: data.defaultThreadRateLimitPerUser, - flags: 'flags' in data ? ChannelFlags.resolve(data.flags) : undefined, - default_sort_order: - typeof data.defaultSortOrder === 'string' - ? SortOrderTypes[data.defaultSortOrder] - : data.defaultSortOrder, - }, - reason, - }); - - return this.client.actions.ChannelUpdate.handle(newData).updated; - } - - /** - * Sets a new position for the guild channel. - * @param {GuildChannelResolvable} channel The channel to set the position for - * @param {number} position The new position for the guild channel - * @param {SetChannelPositionOptions} [options] Options for setting position - * @returns {Promise} - * @example - * // Set a new channel position - * guild.channels.setPosition('222078374472843266', 2) - * .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`)) - * .catch(console.error); - */ - async setPosition(channel, position, { relative, reason } = {}) { - channel = this.resolve(channel); - if (!channel) - throw new TypeError('INVALID_TYPE', 'channel', 'GuildChannelResolvable'); - const updatedChannels = await Util.setPosition( - channel, - position, - relative, - this.guild._sortedChannels(channel), - this.client.api.guilds(this.guild.id).channels, - reason, - ); - - this.client.actions.GuildChannelsPositionUpdate.handle({ - guild_id: this.guild.id, - channels: updatedChannels, - }); - return channel; - } - - /** - * Obtains one or more guild channels from Discord, or the channel cache if they're already available. - * @param {Snowflake} [id] The channel's id - * @param {BaseFetchOptions} [options] Additional options for this fetch - * @returns {Promise>} - * @example - * // Fetch all channels from the guild (excluding threads) - * message.guild.channels.fetch() - * .then(channels => console.log(`There are ${channels.size} channels.`)) - * .catch(console.error); - * @example - * // Fetch a single channel - * message.guild.channels.fetch('222197033908436994') - * .then(channel => console.log(`The channel name is: ${channel.name}`)) - * .catch(console.error); - */ - async fetch(id, { cache = true, force = false } = {}) { - if (id && !force) { - const existing = this.cache.get(id); - if (existing) return existing; - } - - if (id) { - const data = await this.client.api.channels(id).get(); - // Since this is the guild manager, throw if on a different guild - if (this.guild.id !== data.guild_id) - throw new Error('GUILD_CHANNEL_UNOWNED'); - return this.client.channels._add(data, this.guild, { cache }); - } - - const data = await this.client.api.guilds(this.guild.id).channels.get(); - const channels = new Collection(); - for (const channel of data) - channels.set( - channel.id, - this.client.channels._add(channel, this.guild, { cache }), - ); - return channels; - } - - /** - * Fetches all webhooks for the channel. - * @param {GuildChannelResolvable} channel The channel to fetch webhooks for - * @returns {Promise>} - * @example - * // Fetch webhooks - * guild.channels.fetchWebhooks('769862166131245066') - * .then(hooks => console.log(`This channel has ${hooks.size} hooks`)) - * .catch(console.error); - */ - async fetchWebhooks(channel) { - const id = this.resolveId(channel); - if (!id) - throw new TypeError('INVALID_TYPE', 'channel', 'GuildChannelResolvable'); - const data = await this.client.api.channels[id].webhooks.get(); - return data.reduce( - (hooks, hook) => hooks.set(hook.id, new Webhook(this.client, hook)), - new Collection(), - ); - } - - /** - * Data that can be resolved to give a Category Channel object. This can be: - * * A CategoryChannel object - * * A Snowflake - * @typedef {CategoryChannel|Snowflake} CategoryChannelResolvable - */ - - /** - * The data needed for updating a channel's position. - * @typedef {Object} ChannelPosition - * @property {GuildChannel|Snowflake} channel Channel to update - * @property {number} [position] New position for the channel - * @property {CategoryChannelResolvable} [parent] Parent channel for this channel - * @property {boolean} [lockPermissions] If the overwrites should be locked to the parents overwrites - */ - - /** - * Batch-updates the guild's channels' positions. - * Only one channel's parent can be changed at a time - * @param {ChannelPosition[]} channelPositions Channel positions to update - * @returns {Promise} - * @example - * guild.channels.setPositions([{ channel: channelId, position: newChannelIndex }]) - * .then(guild => console.log(`Updated channel positions for ${guild}`)) - * .catch(console.error); - */ - async setPositions(channelPositions) { - channelPositions = channelPositions.map((r) => ({ - id: this.client.channels.resolveId(r.channel), - position: r.position, - lock_permissions: r.lockPermissions, - parent_id: - typeof r.parent !== 'undefined' ? this.resolveId(r.parent) : undefined, - })); - - await this.client.api - .guilds(this.guild.id) - .channels.patch({ data: channelPositions }); - return this.client.actions.GuildChannelsPositionUpdate.handle({ - guild_id: this.guild.id, - channels: channelPositions, - }).guild; - } - - /** - * Deletes the channel. - * @param {GuildChannelResolvable} channel The channel to delete - * @param {string} [reason] Reason for deleting this channel - * @returns {Promise} - * @example - * // Delete the channel - * guild.channels.delete('858850993013260338', 'making room for new channels') - * .then(console.log) - * .catch(console.error); - */ - async delete(channel, reason) { - const id = this.resolveId(channel); - if (!id) - throw new TypeError('INVALID_TYPE', 'channel', 'GuildChannelResolvable'); - await this.client.api.channels(id).delete({ reason }); - } -} - -module.exports = GuildChannelManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/GuildEmojiManager.js b/vendor/discord.js-selfbot-v13/src/managers/GuildEmojiManager.js deleted file mode 100644 index c989e6c..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/GuildEmojiManager.js +++ /dev/null @@ -1,196 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const BaseGuildEmojiManager = require('./BaseGuildEmojiManager'); -const { Error, TypeError } = require('../errors'); -const DataResolver = require('../util/DataResolver'); -const Permissions = require('../util/Permissions'); - -/** - * Manages API methods for GuildEmojis and stores their cache. - * @extends {BaseGuildEmojiManager} - */ -class GuildEmojiManager extends BaseGuildEmojiManager { - constructor(guild, iterable) { - super(guild.client, iterable); - - /** - * The guild this manager belongs to - * @type {Guild} - */ - this.guild = guild; - } - - _add(data, cache) { - return super._add(data, cache, { extras: [this.guild] }); - } - - /** - * Options used for creating an emoji in a guild. - * @typedef {Object} GuildEmojiCreateOptions - * @property {Collection|RoleResolvable[]} [roles] The roles to limit the emoji to - * @property {string} [reason] The reason for creating the emoji - */ - - /** - * Creates a new custom emoji in the guild. - * @param {BufferResolvable|Base64Resolvable} attachment The image for the emoji - * @param {string} name The name for the emoji - * @param {GuildEmojiCreateOptions} [options] Options for creating the emoji - * @returns {Promise} The created emoji - * @example - * // Create a new emoji from a URL - * guild.emojis.create('https://i.imgur.com/w3duR07.png', 'rip') - * .then(emoji => console.log(`Created new emoji with name ${emoji.name}!`)) - * .catch(console.error); - * @example - * // Create a new emoji from a file on your computer - * guild.emojis.create('./memes/banana.png', 'banana') - * .then(emoji => console.log(`Created new emoji with name ${emoji.name}!`)) - * .catch(console.error); - */ - async create(attachment, name, { roles, reason } = {}) { - attachment = await DataResolver.resolveImage(attachment); - if (!attachment) throw new TypeError('REQ_RESOURCE_TYPE'); - - const data = { image: attachment, name }; - if (roles) { - if (!Array.isArray(roles) && !(roles instanceof Collection)) { - throw new TypeError( - 'INVALID_TYPE', - 'options.roles', - 'Array or Collection of Roles or Snowflakes', - true, - ); - } - data.roles = []; - for (const role of roles.values()) { - const resolvedRole = this.guild.roles.resolveId(role); - if (!resolvedRole) - throw new TypeError( - 'INVALID_ELEMENT', - 'Array or Collection', - 'options.roles', - role, - ); - data.roles.push(resolvedRole); - } - } - - const emoji = await this.client.api - .guilds(this.guild.id) - .emojis.post({ data, reason }); - return this.client.actions.GuildEmojiCreate.handle(this.guild, emoji).emoji; - } - - /** - * Obtains one or more emojis from Discord, or the emoji cache if they're already available. - * @param {Snowflake} [id] The emoji's id - * @param {BaseFetchOptions} [options] Additional options for this fetch - * @returns {Promise>} - * @example - * // Fetch all emojis from the guild - * message.guild.emojis.fetch() - * .then(emojis => console.log(`There are ${emojis.size} emojis.`)) - * .catch(console.error); - * @example - * // Fetch a single emoji - * message.guild.emojis.fetch('222078108977594368') - * .then(emoji => console.log(`The emoji name is: ${emoji.name}`)) - * .catch(console.error); - */ - async fetch(id, { cache = true, force = false } = {}) { - if (id) { - if (!force) { - const existing = this.cache.get(id); - if (existing) return existing; - } - const emoji = await this.client.api - .guilds(this.guild.id) - .emojis(id) - .get(); - return this._add(emoji, cache); - } - - const data = await this.client.api.guilds(this.guild.id).emojis.get(); - const emojis = new Collection(); - for (const emoji of data) emojis.set(emoji.id, this._add(emoji, cache)); - return emojis; - } - - /** - * Deletes an emoji. - * @param {EmojiResolvable} emoji The Emoji resolvable to delete - * @param {string} [reason] Reason for deleting the emoji - * @returns {Promise} - */ - async delete(emoji, reason) { - const id = this.resolveId(emoji); - if (!id) - throw new TypeError('INVALID_TYPE', 'emoji', 'EmojiResolvable', true); - await this.client.api.guilds(this.guild.id).emojis(id).delete({ reason }); - } - - /** - * Edits an emoji. - * @param {EmojiResolvable} emoji The Emoji resolvable to edit - * @param {GuildEmojiEditData} data The new data for the emoji - * @param {string} [reason] Reason for editing this emoji - * @returns {Promise} - */ - async edit(emoji, data, reason) { - const id = this.resolveId(emoji); - if (!id) - throw new TypeError('INVALID_TYPE', 'emoji', 'EmojiResolvable', true); - const roles = data.roles?.map((r) => this.guild.roles.resolveId(r)); - const newData = await this.client.api - .guilds(this.guild.id) - .emojis(id) - .patch({ - data: { - name: data.name, - roles, - }, - reason, - }); - const existing = this.cache.get(id); - if (existing) { - const clone = existing._clone(); - clone._patch(newData); - return clone; - } - return this._add(newData); - } - - /** - * Fetches the author for this emoji - * @param {EmojiResolvable} emoji The emoji to fetch the author of - * @returns {Promise} - */ - async fetchAuthor(emoji) { - emoji = this.resolve(emoji); - if (!emoji) - throw new TypeError('INVALID_TYPE', 'emoji', 'EmojiResolvable', true); - if (emoji.managed) { - throw new Error('EMOJI_MANAGED'); - } - - const { me } = this.guild.members; - if (!me) throw new Error('GUILD_UNCACHED_ME'); - if (!me.permissions.has(Permissions.FLAGS.MANAGE_EMOJIS_AND_STICKERS)) { - throw new Error( - 'MISSING_MANAGE_EMOJIS_AND_STICKERS_PERMISSION', - this.guild, - ); - } - - const data = await this.client.api - .guilds(this.guild.id) - .emojis(emoji.id) - .get(); - emoji._patch(data); - return emoji.author; - } -} - -module.exports = GuildEmojiManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/GuildEmojiRoleManager.js b/vendor/discord.js-selfbot-v13/src/managers/GuildEmojiRoleManager.js deleted file mode 100644 index 9391f99..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/GuildEmojiRoleManager.js +++ /dev/null @@ -1,134 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const DataManager = require('./DataManager'); -const { TypeError } = require('../errors'); -const { Role } = require('../structures/Role'); - -/** - * Manages API methods for roles belonging to emojis and stores their cache. - * @extends {DataManager} - */ -class GuildEmojiRoleManager extends DataManager { - constructor(emoji) { - super(emoji.client, Role); - - /** - * The emoji belonging to this manager - * @type {GuildEmoji} - */ - this.emoji = emoji; - /** - * The guild belonging to this manager - * @type {Guild} - */ - this.guild = emoji.guild; - } - - /** - * The cache of roles belonging to this emoji - * @type {Collection} - * @readonly - */ - get cache() { - return this.guild.roles.cache.filter((role) => - this.emoji._roles.includes(role.id), - ); - } - - /** - * Adds a role (or multiple roles) to the list of roles that can use this emoji. - * @param {RoleResolvable|RoleResolvable[]|Collection} roleOrRoles The role or roles to add - * @returns {Promise} - */ - async add(roleOrRoles) { - if (!Array.isArray(roleOrRoles) && !(roleOrRoles instanceof Collection)) - roleOrRoles = [roleOrRoles]; - - const resolvedRoles = []; - for (const role of roleOrRoles.values()) { - const resolvedRole = this.guild.roles.resolveId(role); - if (!resolvedRole) { - throw new TypeError( - 'INVALID_ELEMENT', - 'Array or Collection', - 'roles', - role, - ); - } - resolvedRoles.push(resolvedRole); - } - - const newRoles = [...new Set(resolvedRoles.concat(...this.cache.keys()))]; - return this.set(newRoles); - } - - /** - * Removes a role (or multiple roles) from the list of roles that can use this emoji. - * @param {RoleResolvable|RoleResolvable[]|Collection} roleOrRoles The role or roles to remove - * @returns {Promise} - */ - async remove(roleOrRoles) { - if (!Array.isArray(roleOrRoles) && !(roleOrRoles instanceof Collection)) - roleOrRoles = [roleOrRoles]; - - const resolvedRoleIds = []; - for (const role of roleOrRoles.values()) { - const roleId = this.guild.roles.resolveId(role); - if (!roleId) { - throw new TypeError( - 'INVALID_ELEMENT', - 'Array or Collection', - 'roles', - role, - ); - } - resolvedRoleIds.push(roleId); - } - - const newRoles = [...this.cache.keys()].filter( - (id) => !resolvedRoleIds.includes(id), - ); - return this.set(newRoles); - } - - /** - * Sets the role(s) that can use this emoji. - * @param {Collection|RoleResolvable[]} roles The roles or role ids to apply - * @returns {Promise} - * @example - * // Set the emoji's roles to a single role - * guildEmoji.roles.set(['391156570408615936']) - * .then(console.log) - * .catch(console.error); - * @example - * // Remove all roles from an emoji - * guildEmoji.roles.set([]) - * .then(console.log) - * .catch(console.error); - */ - set(roles) { - return this.emoji.edit({ roles }); - } - - clone() { - const clone = new this.constructor(this.emoji); - clone._patch([...this.cache.keys()]); - return clone; - } - - /** - * Patches the roles for this manager's cache - * @param {Snowflake[]} roles The new roles - * @private - */ - _patch(roles) { - this.emoji._roles = roles; - } - - valueOf() { - return this.cache; - } -} - -module.exports = GuildEmojiRoleManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/GuildForumThreadManager.js b/vendor/discord.js-selfbot-v13/src/managers/GuildForumThreadManager.js deleted file mode 100644 index cc205c6..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/GuildForumThreadManager.js +++ /dev/null @@ -1,115 +0,0 @@ -'use strict'; - -const ThreadManager = require('./ThreadManager'); -const { TypeError } = require('../errors'); -const MessagePayload = require('../structures/MessagePayload'); -const { - resolveAutoArchiveMaxLimit, - getUploadURL, - uploadFile, -} = require('../util/Util'); - -/** - * Manages API methods for threads in forum channels and stores their cache. - * @extends {ThreadManager} - */ -class GuildForumThreadManager extends ThreadManager { - /** - * The channel this Manager belongs to - * @name GuildForumThreadManager#channel - * @type {ForumChannel|MediaChannel} - */ - - /** - * @typedef {BaseMessageOptions} GuildForumThreadMessageCreateOptions - * @property {StickerResolvable} [stickers] The stickers to send with the message - * @property {BitFieldResolvable} [flags] The flags to send with the message. - * Only `SUPPRESS_EMBEDS` and `SUPPRESS_NOTIFICATIONS` can be set. - */ - - /** - * Options for creating a thread. - * @typedef {StartThreadOptions} GuildForumThreadCreateOptions - * @property {GuildForumThreadMessageCreateOptions|MessagePayload} message The message associated with the thread post - * @property {Snowflake[]} [appliedTags] The tags to apply to the thread - */ - - /** - * Creates a new thread in the channel. - * @param {GuildForumThreadCreateOptions} [options] Options to create a new thread - * @returns {Promise} - * @example - * // Create a new forum post - * forum.threads - * .create({ - * name: 'Food Talk', - * autoArchiveDuration: 60, - * message: { - * content: 'Discuss your favorite food!', - * }, - * reason: 'Needed a separate thread for food', - * }) - * .then(threadChannel => console.log(threadChannel)) - * .catch(console.error); - */ - async create({ - name, - autoArchiveDuration = this.channel.defaultAutoArchiveDuration, - message, - reason, - rateLimitPerUser, - appliedTags, - } = {}) { - if (!message) { - throw new TypeError('GUILD_FORUM_MESSAGE_REQUIRED'); - } - - let messagePayload; - - if (message instanceof MessagePayload) { - messagePayload = message.resolveData(); - } else { - messagePayload = MessagePayload.create(this, message).resolveData(); - } - - const { data: body, files } = await messagePayload.resolveFiles(); - - // New API - const attachments = await getUploadURL(this.client, this.channel.id, files); - const requestPromises = attachments.map(async (attachment) => { - await uploadFile(files[attachment.id].file, attachment.upload_url); - return { - id: attachment.id, - filename: files[attachment.id].name, - uploaded_filename: attachment.upload_filename, - description: files[attachment.id].description, - duration_secs: files[attachment.id].duration_secs, - waveform: files[attachment.id].waveform, - }; - }); - const attachmentsData = await Promise.all(requestPromises); - attachmentsData.sort((a, b) => parseInt(a.id) - parseInt(b.id)); - - if (autoArchiveDuration === 'MAX') - autoArchiveDuration = resolveAutoArchiveMaxLimit(this.channel.guild); - - const post_data = await this.client.api - .channels(this.channel.id) - .threads.post({ - data: { - name, - auto_archive_duration: autoArchiveDuration, - rate_limit_per_user: rateLimitPerUser, - applied_tags: appliedTags, - message: body, - attachments: attachmentsData, - }, - files: [], - reason, - }); - - return this.client.actions.ThreadCreate.handle(post_data).thread; - } -} - -module.exports = GuildForumThreadManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/GuildInviteManager.js b/vendor/discord.js-selfbot-v13/src/managers/GuildInviteManager.js deleted file mode 100644 index 916dff3..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/GuildInviteManager.js +++ /dev/null @@ -1,231 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const CachedManager = require('./CachedManager'); -const { Error } = require('../errors'); -const Invite = require('../structures/Invite'); -const DataResolver = require('../util/DataResolver'); - -/** - * Manages API methods for GuildInvites and stores their cache. - * @extends {CachedManager} - */ -class GuildInviteManager extends CachedManager { - constructor(guild, iterable) { - super(guild.client, Invite, iterable); - - /** - * The guild this Manager belongs to - * @type {Guild} - */ - this.guild = guild; - } - - /** - * The cache of this Manager - * @type {Collection} - * @name GuildInviteManager#cache - */ - - _add(data, cache) { - return super._add(data, cache, { id: data.code, extras: [this.guild] }); - } - - /** - * Data that resolves to give an Invite object. This can be: - * * An invite code - * * An invite URL - * @typedef {string} InviteResolvable - */ - - /** - * Data that can be resolved to a channel that an invite can be created on. This can be: - * * TextChannel - * * VoiceChannel - * * NewsChannel - * * StoreChannel - * * StageChannel - * * Snowflake - * @typedef {TextChannel|VoiceChannel|NewsChannel|StoreChannel|StageChannel|Snowflake} - * GuildInvitableChannelResolvable - */ - - /** - * Resolves an InviteResolvable to an Invite object. - * @method resolve - * @memberof GuildInviteManager - * @instance - * @param {InviteResolvable} invite The invite resolvable to resolve - * @returns {?Invite} - */ - - /** - * Resolves an InviteResolvable to an invite code string. - * @method resolveId - * @memberof GuildInviteManager - * @instance - * @param {InviteResolvable} invite The invite resolvable to resolve - * @returns {?string} - */ - - /** - * Options used to fetch a single invite from a guild. - * @typedef {Object} FetchInviteOptions - * @property {InviteResolvable} code The invite to fetch - * @property {boolean} [cache=true] Whether or not to cache the fetched invite - * @property {boolean} [force=false] Whether to skip the cache check and request the API - */ - - /** - * Options used to fetch all invites from a guild. - * @typedef {Object} FetchInvitesOptions - * @property {GuildInvitableChannelResolvable} [channelId] - * The channel to fetch all invites from - * @property {boolean} [cache=true] Whether or not to cache the fetched invites - */ - - /** - * Fetches invite(s) from Discord. - * @param {InviteResolvable|FetchInviteOptions|FetchInvitesOptions} [options] Options for fetching guild invite(s) - * @returns {Promise>} - * @example - * // Fetch all invites from a guild - * guild.invites.fetch() - * .then(console.log) - * .catch(console.error); - * @example - * // Fetch all invites from a guild without caching - * guild.invites.fetch({ cache: false }) - * .then(console.log) - * .catch(console.error); - * @example - * // Fetch all invites from a channel - * guild.invites.fetch({ channelId: '222197033908436994' }) - * .then(console.log) - * .catch(console.error); - * @example - * // Fetch a single invite - * guild.invites.fetch('bRCvFy9') - * .then(console.log) - * .catch(console.error); - * @example - * // Fetch a single invite without checking cache - * guild.invites.fetch({ code: 'bRCvFy9', force: true }) - * .then(console.log) - * .catch(console.error) - * @example - * // Fetch a single invite without caching - * guild.invites.fetch({ code: 'bRCvFy9', cache: false }) - * .then(console.log) - * .catch(console.error); - */ - async fetch(options) { - if (!options) return this._fetchMany(); - if (typeof options === 'string') { - const code = DataResolver.resolveInviteCode(options); - if (!code) throw new Error('INVITE_RESOLVE_CODE'); - return this._fetchSingle({ code, cache: true }); - } - if (!options.code) { - if (options.channelId) { - const id = this.guild.channels.resolveId(options.channelId); - if (!id) throw new Error('GUILD_CHANNEL_RESOLVE'); - return this._fetchChannelMany(id, options.cache); - } - - if ('cache' in options) return this._fetchMany(options.cache); - throw new Error('INVITE_RESOLVE_CODE'); - } - return this._fetchSingle({ - ...options, - code: DataResolver.resolveInviteCode(options.code), - }); - } - - async _fetchSingle({ code, cache, force = false }) { - if (!force) { - const existing = this.cache.get(code); - if (existing) return existing; - } - - const invites = await this._fetchMany(cache); - const invite = invites.get(code); - if (!invite) throw new Error('INVITE_NOT_FOUND'); - return invite; - } - - async _fetchMany(cache) { - const data = await this.client.api.guilds(this.guild.id).invites.get(); - return data.reduce( - (col, invite) => col.set(invite.code, this._add(invite, cache)), - new Collection(), - ); - } - - async _fetchChannelMany(channelId, cache) { - const data = await this.client.api.channels(channelId).invites.get(); - return data.reduce( - (col, invite) => col.set(invite.code, this._add(invite, cache)), - new Collection(), - ); - } - - /** - * Create an invite to the guild from the provided channel. - * @param {GuildInvitableChannelResolvable} channel The options for creating the invite from a channel. - * @param {CreateInviteOptions} [options={}] The options for creating the invite from a channel. - * @returns {Promise} - * @example - * // Create an invite to a selected channel - * guild.invites.create('599942732013764608') - * .then(console.log) - * .catch(console.error); - */ - async create( - channel, - { - temporary = false, - maxAge = 86400, - maxUses = 0, - unique, - targetUser, - targetApplication, - targetType, - reason, - } = {}, - ) { - const id = this.guild.channels.resolveId(channel); - if (!id) throw new Error('GUILD_CHANNEL_RESOLVE'); - - const invite = await this.client.api.channels(id).invites.post({ - data: { - temporary, - max_age: maxAge, - max_uses: maxUses, - unique, - target_user_id: this.client.users.resolveId(targetUser), - target_application_id: - targetApplication?.id ?? - targetApplication?.applicationId ?? - targetApplication, - target_type: targetType, - }, - reason, - }); - return new Invite(this.client, invite); - } - - /** - * Deletes an invite. - * @param {InviteResolvable} invite The invite to delete - * @param {string} [reason] Reason for deleting the invite - * @returns {Promise} - */ - async delete(invite, reason) { - const code = DataResolver.resolveInviteCode(invite); - - await this.client.api.invites(code).delete({ reason }); - } -} - -module.exports = GuildInviteManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/GuildManager.js b/vendor/discord.js-selfbot-v13/src/managers/GuildManager.js deleted file mode 100644 index a867d06..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/GuildManager.js +++ /dev/null @@ -1,353 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const { setTimeout } = require('node:timers'); -const { Collection } = require('@discordjs/collection'); -const CachedManager = require('./CachedManager'); -const { Guild } = require('../structures/Guild'); -const GuildChannel = require('../structures/GuildChannel'); -const GuildEmoji = require('../structures/GuildEmoji'); -const { GuildMember } = require('../structures/GuildMember'); -const Invite = require('../structures/Invite'); -const OAuth2Guild = require('../structures/OAuth2Guild'); -const { Role } = require('../structures/Role'); -const { - ChannelTypes, - Events, - OverwriteTypes, - VerificationLevels, - DefaultMessageNotificationLevels, - ExplicitContentFilterLevels, - VideoQualityModes, -} = require('../util/Constants'); -const DataResolver = require('../util/DataResolver'); -const Permissions = require('../util/Permissions'); -const SystemChannelFlags = require('../util/SystemChannelFlags'); -const { resolveColor } = require('../util/Util'); -const Util = require('../util/Util'); - -let cacheWarningEmitted = false; - -/** - * Manages API methods for Guilds and stores their cache. - * @extends {CachedManager} - */ -class GuildManager extends CachedManager { - constructor(client, iterable) { - super(client, Guild, iterable); - if (!cacheWarningEmitted && this._cache.constructor.name !== 'Collection') { - cacheWarningEmitted = true; - process.emitWarning( - `Overriding the cache handling for ${this.constructor.name} is unsupported and breaks functionality.`, - 'UnsupportedCacheOverwriteWarning', - ); - } - } - - /** - * The cache of this Manager - * @type {Collection} - * @name GuildManager#cache - */ - - /** - * Data that resolves to give a Guild object. This can be: - * * A Guild object - * * A GuildChannel object - * * A GuildEmoji object - * * A Role object - * * A Snowflake - * * An Invite object - * @typedef {Guild|GuildChannel|GuildMember|GuildEmoji|Role|Snowflake|Invite} GuildResolvable - */ - - /** - * Partial data for a Role. - * @typedef {Object} PartialRoleData - * @property {Snowflake|number} [id] The role's id, used to set channel overrides, - * this is a placeholder and will be replaced by the API after consumption - * @property {string} [name] The name of the role - * @property {ColorResolvable} [color] The color of the role, either a hex string or a base 10 number - * @property {boolean} [hoist] Whether or not the role should be hoisted - * @property {number} [position] The position of the role - * @property {PermissionResolvable} [permissions] The permissions of the role - * @property {boolean} [mentionable] Whether or not the role should be mentionable - */ - - /** - * Partial overwrite data. - * @typedef {Object} PartialOverwriteData - * @property {Snowflake|number} id The id of the {@link Role} or {@link User} this overwrite belongs to - * @property {OverwriteType} [type] The type of this overwrite - * @property {PermissionResolvable} [allow] The permissions to allow - * @property {PermissionResolvable} [deny] The permissions to deny - */ - - /** - * Partial data for a Channel. - * @typedef {Object} PartialChannelData - * @property {Snowflake|number} [id] The channel's id, used to set its parent, - * this is a placeholder and will be replaced by the API after consumption - * @property {Snowflake|number} [parentId] The parent id for this channel - * @property {ChannelType|number} [type] The type of the channel - * @property {string} name The name of the channel - * @property {string} [topic] The topic of the text channel - * @property {boolean} [nsfw] Whether the channel is NSFW - * @property {number} [bitrate] The bitrate of the voice channel - * @property {number} [userLimit] The user limit of the channel - * @property {?string} [rtcRegion] The RTC region of the channel - * @property {VideoQualityMode|number} [videoQualityMode] The camera video quality mode of the channel - * @property {PartialOverwriteData[]} [permissionOverwrites] - * Overwrites of the channel - * @property {number} [rateLimitPerUser] The rate limit per user (slowmode) of the channel in seconds - */ - - /** - * Resolves a GuildResolvable to a Guild object. - * @method resolve - * @memberof GuildManager - * @instance - * @param {GuildResolvable} guild The guild resolvable to identify - * @returns {?Guild} - */ - resolve(guild) { - if ( - guild instanceof GuildChannel || - guild instanceof GuildMember || - guild instanceof GuildEmoji || - guild instanceof Role || - (guild instanceof Invite && guild.guild) - ) { - return super.resolve(guild.guild); - } - return super.resolve(guild); - } - - /** - * Resolves a {@link GuildResolvable} to a {@link Guild} id string. - * @method resolveId - * @memberof GuildManager - * @instance - * @param {GuildResolvable} guild The guild resolvable to identify - * @returns {?Snowflake} - */ - resolveId(guild) { - if ( - guild instanceof GuildChannel || - guild instanceof GuildMember || - guild instanceof GuildEmoji || - guild instanceof Role || - (guild instanceof Invite && guild.guild) - ) { - return super.resolveId(guild.guild.id); - } - return super.resolveId(guild); - } - - /** - * Options used to create a guild. - * @typedef {Object} GuildCreateOptions - * @property {Snowflake|number} [afkChannelId] The AFK channel's id - * @property {number} [afkTimeout] The AFK timeout in seconds - * @property {PartialChannelData[]} [channels=[]] The channels for this guild - * @property {DefaultMessageNotificationLevel|number} [defaultMessageNotifications] The default message notifications - * for the guild - * @property {ExplicitContentFilterLevel} [explicitContentFilter] The explicit content filter level for the guild - * @property {?(BufferResolvable|Base64Resolvable)} [icon=null] The icon for the guild - * @property {PartialRoleData[]} [roles=[]] The roles for this guild, - * the first element of this array is used to change properties of the guild's everyone role. - * @property {Snowflake|number} [systemChannelId] The system channel's id - * @property {SystemChannelFlagsResolvable} [systemChannelFlags] The flags of the system channel - * @property {VerificationLevel} [verificationLevel] The verification level for the guild - */ - - /** - * Creates a guild. - * @param {string} name The name of the guild - * @param {GuildCreateOptions} [options] Options for creating the guild - * @returns {Promise} The guild that was created - */ - async create( - name, - { - afkChannelId, - afkTimeout, - channels = [], - defaultMessageNotifications, - explicitContentFilter, - icon = null, - roles = [], - systemChannelId, - systemChannelFlags, - verificationLevel, - } = {}, - ) { - icon = await DataResolver.resolveImage(icon); - if (typeof verificationLevel === 'string') { - verificationLevel = VerificationLevels[verificationLevel]; - } - if (typeof defaultMessageNotifications === 'string') { - defaultMessageNotifications = - DefaultMessageNotificationLevels[defaultMessageNotifications]; - } - if (typeof explicitContentFilter === 'string') { - explicitContentFilter = - ExplicitContentFilterLevels[explicitContentFilter]; - } - for (const channel of channels) { - channel.type &&= - typeof channel.type === 'number' - ? channel.type - : ChannelTypes[channel.type]; - channel.parent_id = channel.parentId; - delete channel.parentId; - channel.user_limit = channel.userLimit; - delete channel.userLimit; - channel.rate_limit_per_user = channel.rateLimitPerUser; - delete channel.rateLimitPerUser; - channel.rtc_region = channel.rtcRegion; - delete channel.rtcRegion; - channel.video_quality_mode = - typeof channel.videoQualityMode === 'string' - ? VideoQualityModes[channel.videoQualityMode] - : channel.videoQualityMode; - delete channel.videoQualityMode; - - if (!channel.permissionOverwrites) continue; - for (const overwrite of channel.permissionOverwrites) { - if (typeof overwrite.type === 'string') { - overwrite.type = OverwriteTypes[overwrite.type]; - } - overwrite.allow &&= Permissions.resolve(overwrite.allow).toString(); - overwrite.deny &&= Permissions.resolve(overwrite.deny).toString(); - } - channel.permission_overwrites = channel.permissionOverwrites; - delete channel.permissionOverwrites; - } - for (const role of roles) { - role.color &&= resolveColor(role.color); - role.permissions &&= Permissions.resolve(role.permissions).toString(); - } - systemChannelFlags &&= SystemChannelFlags.resolve(systemChannelFlags); - - const data = await this.client.api.guilds.post({ - data: { - name, - icon, - verification_level: verificationLevel, - default_message_notifications: defaultMessageNotifications, - explicit_content_filter: explicitContentFilter, - roles, - channels, - afk_channel_id: afkChannelId, - afk_timeout: afkTimeout, - system_channel_id: systemChannelId, - system_channel_flags: systemChannelFlags, - guild_template_code: '2TffvPucqHkN', // From Discord - }, - }); - - if (this.client.guilds.cache.has(data.id)) - return this.client.guilds.cache.get(data.id); - - return new Promise((resolve) => { - const handleGuild = (guild) => { - if (guild.id === data.id) { - clearTimeout(timeout); - this.client.removeListener(Events.GUILD_CREATE, handleGuild); - this.client.decrementMaxListeners(); - resolve(guild); - } - }; - this.client.incrementMaxListeners(); - this.client.on(Events.GUILD_CREATE, handleGuild); - - const timeout = setTimeout(() => { - this.client.removeListener(Events.GUILD_CREATE, handleGuild); - this.client.decrementMaxListeners(); - resolve(this.client.guilds._add(data)); - }, 10_000).unref(); - }); - } - - /** - * Options used to fetch a single guild. - * @typedef {BaseFetchOptions} FetchGuildOptions - * @property {GuildResolvable} guild The guild to fetch - * @property {boolean} [withCounts=true] Whether the approximate member and presence counts should be returned - */ - - /** - * Options used to fetch multiple guilds. - * @typedef {Object} FetchGuildsOptions - * @property {Snowflake} [before] Get guilds before this guild id - * @property {Snowflake} [after] Get guilds after this guild id - * @property {number} [limit=200] Maximum number of guilds to request (1-200) - */ - - /** - * Obtains one or multiple guilds from Discord, or the guild cache if it's already available. - * @param {GuildResolvable|FetchGuildOptions|FetchGuildsOptions} [options] The guild's id or options - * @returns {Promise>} - */ - async fetch(options = {}) { - const id = this.resolveId(options) ?? this.resolveId(options.guild); - - if (id) { - if (!options.force) { - const existing = this.cache.get(id); - if (existing) return existing; - } - - const data = await this.client.api - .guilds(id) - .get({ query: { with_counts: options.withCounts ?? true } }); - return this._add(data, options.cache); - } - - const data = await this.client.api - .users('@me') - .guilds.get({ query: options }); - return data.reduce( - (coll, guild) => coll.set(guild.id, new OAuth2Guild(this.client, guild)), - new Collection(), - ); - } - - /** - * Options used to set incident actions. Supplying `null` to any option will disable the action. - * @typedef {Object} IncidentActionsEditOptions - * @property {?DateResolvable} [invitesDisabledUntil] When invites should be enabled again - * @property {?DateResolvable} [dmsDisabledUntil] When direct messages should be enabled again - */ - - /** - * Sets the incident actions for a guild. - * @param {GuildResolvable} guild The guild - * @param {IncidentActionsEditOptions} incidentActions The incident actions to set - * @returns {Promise} - */ - async setIncidentActions(guild, { invitesDisabledUntil, dmsDisabledUntil }) { - const guildId = this.resolveId(guild); - - const data = await this.client.api.guilds(guildId)['incident-actions'].put({ - data: { - invites_disabled_until: - invitesDisabledUntil && new Date(invitesDisabledUntil).toISOString(), - dms_disabled_until: - dmsDisabledUntil && new Date(dmsDisabledUntil).toISOString(), - }, - }); - - const parsedData = Util.transformAPIIncidentsData(data); - const resolvedGuild = this.resolve(guild); - - if (resolvedGuild) { - resolvedGuild.incidentsData = parsedData; - } - - return parsedData; - } -} - -module.exports = GuildManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/GuildMemberManager.js b/vendor/discord.js-selfbot-v13/src/managers/GuildMemberManager.js deleted file mode 100644 index 3766619..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/GuildMemberManager.js +++ /dev/null @@ -1,654 +0,0 @@ -/* eslint-disable newline-per-chained-call */ -'use strict'; - -const { Buffer } = require('node:buffer'); -const { setTimeout } = require('node:timers'); -const { Collection } = require('@discordjs/collection'); -const CachedManager = require('./CachedManager'); -const { Error, TypeError, RangeError } = require('../errors'); -const BaseGuildVoiceChannel = require('../structures/BaseGuildVoiceChannel'); -const { GuildMember } = require('../structures/GuildMember'); -const { Role } = require('../structures/Role'); -const { Events, Opcodes } = require('../util/Constants'); -const { PartialTypes } = require('../util/Constants'); -const DataResolver = require('../util/DataResolver'); -const GuildMemberFlags = require('../util/GuildMemberFlags'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); - -/** - * Manages API methods for GuildMembers and stores their cache. - * @extends {CachedManager} - */ -class GuildMemberManager extends CachedManager { - constructor(guild, iterable) { - super(guild.client, GuildMember, iterable); - - /** - * The guild this manager belongs to - * @type {Guild} - */ - this.guild = guild; - } - - /** - * The cache of this Manager - * @type {Collection} - * @name GuildMemberManager#cache - */ - - _add(data, cache = true) { - return super._add(data, cache, { id: data.user.id, extras: [this.guild] }); - } - - /** - * Data that resolves to give a GuildMember object. This can be: - * * A GuildMember object - * * A User resolvable - * @typedef {GuildMember|UserResolvable} GuildMemberResolvable - */ - - /** - * Resolves a {@link GuildMemberResolvable} to a {@link GuildMember} object. - * @param {GuildMemberResolvable} member The user that is part of the guild - * @returns {?GuildMember} - */ - resolve(member) { - const memberResolvable = super.resolve(member); - if (memberResolvable) return memberResolvable; - const userId = this.client.users.resolveId(member); - if (userId) return this.cache.get(userId) ?? null; - return null; - } - - /** - * Resolves a {@link GuildMemberResolvable} to a member id. - * @param {GuildMemberResolvable} member The user that is part of the guild - * @returns {?Snowflake} - */ - resolveId(member) { - const memberResolvable = super.resolveId(member); - if (memberResolvable) return memberResolvable; - const userId = this.client.users.resolveId(member); - return this.cache.has(userId) ? userId : null; - } - - /** - * Options used to add a user to a guild using OAuth2. - * @typedef {Object} AddGuildMemberOptions - * @property {string} accessToken An OAuth2 access token for the user with the `guilds.join` scope granted to the - * bot's application - * @property {string} [nick] The nickname to give to the member (requires `MANAGE_NICKNAMES`) - * @property {Collection|RoleResolvable[]} [roles] The roles to add to the member - * (requires `MANAGE_ROLES`) - * @property {boolean} [mute] Whether the member should be muted (requires `MUTE_MEMBERS`) - * @property {boolean} [deaf] Whether the member should be deafened (requires `DEAFEN_MEMBERS`) - * @property {boolean} [force] Whether to skip the cache check and call the API directly - * @property {boolean} [fetchWhenExisting=true] Whether to fetch the user if not cached and already a member - */ - - /** - * Adds a user to the guild using OAuth2. Requires the `CREATE_INSTANT_INVITE` permission. - * @param {UserResolvable} user The user to add to the guild - * @param {AddGuildMemberOptions} options Options for adding the user to the guild - * @returns {Promise} - */ - async add(user, options) { - const userId = this.client.users.resolveId(user); - if (!userId) throw new TypeError('INVALID_TYPE', 'user', 'UserResolvable'); - if (!options.force) { - const cachedUser = this.cache.get(userId); - if (cachedUser) return cachedUser; - } - const resolvedOptions = { - access_token: options.accessToken, - nick: options.nick, - mute: options.mute, - deaf: options.deaf, - }; - if (options.roles) { - if ( - !Array.isArray(options.roles) && - !(options.roles instanceof Collection) - ) { - throw new TypeError( - 'INVALID_TYPE', - 'options.roles', - 'Array or Collection of Roles or Snowflakes', - true, - ); - } - const resolvedRoles = []; - for (const role of options.roles.values()) { - const resolvedRole = this.guild.roles.resolveId(role); - if (!resolvedRole) - throw new TypeError( - 'INVALID_ELEMENT', - 'Array or Collection', - 'options.roles', - role, - ); - resolvedRoles.push(resolvedRole); - } - resolvedOptions.roles = resolvedRoles; - } - const data = await this.client.api - .guilds(this.guild.id) - .members(userId) - .put({ data: resolvedOptions }); - // Data is an empty buffer if the member is already part of the guild. - return data instanceof Buffer - ? options.fetchWhenExisting === false - ? null - : this.fetch(userId) - : this._add(data); - } - - /** - * The client user as a GuildMember of this guild - * @type {?GuildMember} - * @readonly - */ - get me() { - return ( - this.cache.get(this.client.user.id) ?? - (this.client.options.partials.includes(PartialTypes.GUILD_MEMBER) - ? this._add({ user: { id: this.client.user.id } }, true) - : null) - ); - } - - /** - * Options used to fetch a single member from a guild. - * @typedef {BaseFetchOptions} FetchMemberOptions - * @property {UserResolvable} user The user to fetch - */ - - /** - * Options used to fetch multiple members from a guild. - * @typedef {Object} FetchMembersOptions - * @property {UserResolvable|UserResolvable[]} user The user(s) to fetch - * @property {?string} query Limit fetch to members with similar usernames - * @property {number} [limit=0] Maximum number of members to request - * @property {boolean} [withPresences=false] Whether or not to include the presences - * @property {number} [time=120e3] Timeout for receipt of members - * @property {?string} nonce Nonce for this request (32 characters max - default to base 16 now timestamp) - * @property {boolean} [force=false] Whether to skip the cache check and request the API - */ - - /** - * Fetches member(s) from Discord, even if they're offline. - * @param {UserResolvable|FetchMemberOptions|FetchMembersOptions} [options] If a UserResolvable, the user to fetch. - * If undefined, fetches all members. - * If a query, it limits the results to users with similar usernames. - * @returns {Promise>} - * @example - * // Fetch all members from a guild - * guild.members.fetch() - * .then(console.log) - * .catch(console.error); - * @example - * // Fetch a single member - * guild.members.fetch('66564597481480192') - * .then(console.log) - * .catch(console.error); - * @example - * // Fetch a single member without checking cache - * guild.members.fetch({ user, force: true }) - * .then(console.log) - * .catch(console.error) - * @example - * // Fetch a single member without caching - * guild.members.fetch({ user, cache: false }) - * .then(console.log) - * .catch(console.error); - * @example - * // Fetch by an array of users including their presences - * guild.members.fetch({ user: ['66564597481480192', '191615925336670208'], withPresences: true }) - * .then(console.log) - * .catch(console.error); - * @example - * // Fetch by query - * guild.members.fetch({ query: 'hydra', limit: 1 }) - * .then(console.log) - * .catch(console.error); - */ - fetch(options) { - if (!options) { - if ( - this.me.permissions.has('KICK_MEMBERS') || - this.me.permissions.has('BAN_MEMBERS') || - this.me.permissions.has('MANAGE_ROLES') - ) { - return this._fetchMany(); - } else { - return this.fetchByMemberSafety(); - } - } - const user = this.client.users.resolveId(options); - if (user) return this._fetchSingle({ user, cache: true }); - if (options.user) { - if (Array.isArray(options.user)) { - options.user = options.user.map((u) => this.client.users.resolveId(u)); - return this._fetchMany(options); - } else { - options.user = this.client.users.resolveId(options.user); - } - if (!options.limit && !options.withPresences) - return this._fetchSingle(options); - } - return this._fetchMany(options); - } - - /** - * Fetches the client user as a GuildMember of the guild. - * @param {BaseFetchOptions} [options] The options for fetching the member - * @returns {Promise} - */ - fetchMe(options) { - return this.fetch({ ...options, user: this.client.user.id }); - } - - /** - * Options used for searching guild members. - * @typedef {Object} GuildSearchMembersOptions - * @property {string} query Filter members whose username or nickname start with this query - * @property {number} [limit=1] Maximum number of members to search - * @property {boolean} [cache=true] Whether or not to cache the fetched member(s) - */ - - /** - * Searches for members in the guild based on a query. - * @param {GuildSearchMembersOptions} options Options for searching members - * @returns {Promise>} - */ - async search({ query, limit = 1, cache = true } = {}) { - const data = await this.client.api - .guilds(this.guild.id) - .members.search.get({ query: { query, limit } }); - return data.reduce( - (col, member) => col.set(member.user.id, this._add(member, cache)), - new Collection(), - ); - } - - /** - * The data for editing a guild member. - * @typedef {Object} GuildMemberEditData - * @property {?string} [nick] The nickname to set for the member - * @property {Collection|RoleResolvable[]} [roles] The roles or role ids to apply - * @property {boolean} [mute] Whether or not the member should be muted - * @property {boolean} [deaf] Whether or not the member should be deafened - * @property {GuildVoiceChannelResolvable|null} [channel] Channel to move the member to - * (if they are connected to voice), or `null` if you want to disconnect them from voice - * @property {DateResolvable|null} [communicationDisabledUntil] The date or timestamp - * for the member's communication to be disabled until. Provide `null` to enable communication again. - * @property {GuildMemberFlagsResolvable} [flags] The flags to set for the member - * @property {?(BufferResolvable|Base64Resolvable)} [avatar] The new guild avatar - * @property {?(BufferResolvable|Base64Resolvable)} [banner] The new guild banner - * @property {?string} [bio] The new guild about me - */ - - /** - * Edits a member of the guild. - * The user must be a member of the guild - * @param {UserResolvable} user The member to edit - * @param {GuildMemberEditData} data The data to edit the member with - * @param {string} [reason] Reason for editing this user - * @returns {Promise} - */ - async edit(user, data, reason) { - const id = this.client.users.resolveId(user); - if (!id) throw new TypeError('INVALID_TYPE', 'user', 'UserResolvable'); - - // Clone the data object for immutability - const _data = { ...data }; - if (_data.channel) { - _data.channel = this.guild.channels.resolve(_data.channel); - if (!(_data.channel instanceof BaseGuildVoiceChannel)) { - throw new Error('GUILD_VOICE_CHANNEL_RESOLVE'); - } - _data.channel_id = _data.channel.id; - _data.channel = undefined; - } else if (_data.channel === null) { - _data.channel_id = null; - _data.channel = undefined; - } - _data.roles &&= _data.roles.map((role) => - role instanceof Role ? role.id : role, - ); - - _data.communication_disabled_until = - _data.communicationDisabledUntil && - new Date(_data.communicationDisabledUntil).toISOString(); - - _data.flags = _data.flags && GuildMemberFlags.resolve(_data.flags); - - // Avatar, banner, bio - if (typeof _data.avatar !== 'undefined') { - _data.avatar = await DataResolver.resolveImage(_data.avatar); - } - if (typeof _data.banner !== 'undefined') { - _data.banner = await DataResolver.resolveImage(_data.banner); - } - - let endpoint = this.client.api.guilds(this.guild.id); - if (id === this.client.user.id) { - const keys = Object.keys(data); - if ( - keys.length === 1 && - ['nick', 'avatar', 'banner', 'bio'].includes(keys[0]) - ) { - endpoint = endpoint.members('@me'); - } else { - endpoint = endpoint.members(id); - } - } else { - endpoint = endpoint.members(id); - } - const d = await endpoint.patch({ data: _data, reason }); - - const clone = this.cache.get(id)?._clone(); - clone?._patch(d); - return clone ?? this._add(d, false); - } - - /** - * Options used for pruning guild members. - * It's recommended to set {@link GuildPruneMembersOptions#count options.count} - * to `false` for large guilds. - * @typedef {Object} GuildPruneMembersOptions - * @property {number} [days=7] Number of days of inactivity required to kick - * @property {boolean} [dry=false] Get the number of users that will be kicked, without actually kicking them - * @property {boolean} [count=true] Whether or not to return the number of users that have been kicked. - * @property {RoleResolvable[]} [roles] Array of roles to bypass the "...and no roles" constraint when pruning - * @property {string} [reason] Reason for this prune - */ - - /** - * Prunes members from the guild based on how long they have been inactive. - * @param {GuildPruneMembersOptions} [options] Options for pruning - * @returns {Promise} The number of members that were/will be kicked - * @example - * // See how many members will be pruned - * guild.members.prune({ dry: true }) - * .then(pruned => console.log(`This will prune ${pruned} people!`)) - * .catch(console.error); - * @example - * // Actually prune the members - * guild.members.prune({ days: 1, reason: 'too many people!' }) - * .then(pruned => console.log(`I just pruned ${pruned} people!`)) - * .catch(console.error); - * @example - * // Include members with a specified role - * guild.members.prune({ days: 7, roles: ['657259391652855808'] }) - * .then(pruned => console.log(`I just pruned ${pruned} people!`)) - * .catch(console.error); - */ - async prune({ - days = 7, - dry = false, - count: compute_prune_count = true, - roles = [], - reason, - } = {}) { - if (typeof days !== 'number') throw new TypeError('PRUNE_DAYS_TYPE'); - - const query = { days }; - const resolvedRoles = []; - - for (const role of roles) { - const resolvedRole = this.guild.roles.resolveId(role); - if (!resolvedRole) { - throw new TypeError('INVALID_ELEMENT', 'Array', 'options.roles', role); - } - resolvedRoles.push(resolvedRole); - } - - if (resolvedRoles.length) { - query.include_roles = dry ? resolvedRoles.join(',') : resolvedRoles; - } - - const endpoint = this.client.api.guilds(this.guild.id).prune; - - const { pruned } = await (dry - ? endpoint.get({ query, reason }) - : endpoint.post({ data: { ...query, compute_prune_count }, reason })); - - return pruned; - } - - /** - * Kicks a user from the guild. - * The user must be a member of the guild - * @param {UserResolvable} user The member to kick - * @param {string} [reason] Reason for kicking - * @returns {Promise} Result object will be resolved as specifically as possible. - * If the GuildMember cannot be resolved, the User will instead be attempted to be resolved. If that also cannot - * be resolved, the user's id will be the result. - * @example - * // Kick a user by id (or with a user/guild member object) - * guild.members.kick('84484653687267328') - * .then(kickInfo => console.log(`Kicked ${kickInfo.user?.tag ?? kickInfo.tag ?? kickInfo}`)) - * .catch(console.error); - */ - async kick(user, reason) { - const id = this.client.users.resolveId(user); - if (!id) throw new TypeError('INVALID_TYPE', 'user', 'UserResolvable'); - - await this.client.api.guilds(this.guild.id).members(id).delete({ reason }); - - return this.resolve(user) ?? this.client.users.resolve(user) ?? id; - } - - /** - * Bans a user from the guild. - * @param {UserResolvable} user The user to ban - * @param {BanOptions} [options] Options for the ban - * @returns {Promise} Result object will be resolved as specifically as possible. - * If the GuildMember cannot be resolved, the User will instead be attempted to be resolved. If that also cannot - * be resolved, the user id will be the result. - * Internally calls the GuildBanManager#create method. - * @example - * // Ban a user by id (or with a user/guild member object) - * guild.members.ban('84484653687267328') - * .then(banInfo => console.log(`Banned ${banInfo.user?.tag ?? banInfo.tag ?? banInfo}`)) - * .catch(console.error); - */ - ban(user, options) { - return this.guild.bans.create(user, options); - } - - /** - * Unbans a user from the guild. Internally calls the {@link GuildBanManager#remove} method. - * @param {UserResolvable} user The user to unban - * @param {string} [reason] Reason for unbanning user - * @returns {Promise} The user that was unbanned - * @example - * // Unban a user by id (or with a user/guild member object) - * guild.members.unban('84484653687267328') - * .then(user => console.log(`Unbanned ${user.username} from ${guild.name}`)) - * .catch(console.error); - */ - unban(user, reason) { - return this.guild.bans.remove(user, reason); - } - - async _fetchSingle({ user, cache, force = false }) { - if (!force) { - const existing = this.cache.get(user); - if (existing && !existing.partial) return existing; - } - - const data = await this.client.api - .guilds(this.guild.id) - .members(user) - .get(); - return this._add(data, cache); - } - - /** - * Adds a role to a member. - * @param {GuildMemberResolvable} user The user to add the role from - * @param {RoleResolvable} role The role to add - * @param {string} [reason] Reason for adding the role - * @returns {Promise} - */ - async addRole(user, role, reason) { - const userId = this.resolveId(user); - const roleId = this.guild.roles.resolveId(role); - - await this.client.api - .guilds(this.guild.id) - .members(userId) - .roles(roleId) - .put({ reason }); - - return this.resolve(user) ?? this.client.users.resolve(user) ?? userId; - } - - /** - * Removes a role from a member. - * @param {UserResolvable} user The user to remove the role from - * @param {RoleResolvable} role The role to remove - * @param {string} [reason] Reason for removing the role - * @returns {Promise} - */ - async removeRole(user, role, reason) { - const userId = this.resolveId(user); - const roleId = this.guild.roles.resolveId(role); - - await this.client.api - .guilds(this.guild.id) - .members(userId) - .roles(roleId) - .delete({ reason }); - - return this.resolve(user) ?? this.client.users.resolve(user) ?? userId; - } - - /** - * Experimental method to fetch members from the guild. - * Lists up to 10000 members of the guild. - * @param {number} [timeout=15_000] Timeout for receipt of members in ms - * @returns {Promise>} - */ - fetchByMemberSafety(timeout = 15_000) { - return new Promise((resolve) => { - const nonce = SnowflakeUtil.generate(); - const fetchedMembers = new Collection(); - let timeout_ = setTimeout(() => { - this.client.removeListener(Events.GUILD_MEMBERS_CHUNK, handler); - resolve(fetchedMembers); - }, timeout).unref(); - const handler = (members, guild, chunk) => { - if (guild.id == this.guild.id && chunk.nonce == nonce) { - if (members.size > 0) { - for (const member of members.values()) { - fetchedMembers.set(member.id, member); - } - this.client.ws.broadcast({ - op: Opcodes.SEARCH_RECENT_MEMBERS, - d: { - guild_id: this.guild.id, - query: '', - continuation_token: members.first()?.id, - nonce, - }, - }); - } else { - clearTimeout(timeout_); - this.client.removeListener(Events.GUILD_MEMBERS_CHUNK, handler); - resolve(fetchedMembers); - } - } - }; - this.client.on(Events.GUILD_MEMBERS_CHUNK, handler); - this.client.ws.broadcast({ - op: Opcodes.SEARCH_RECENT_MEMBERS, - d: { - guild_id: this.guild.id, - query: '', - continuation_token: null, - nonce, - }, - }); - }); - } - - _fetchMany({ - limit = 0, - withPresences: presences = true, - user: user_ids, - query, - time = 120e3, - nonce = SnowflakeUtil.generate(), - } = {}) { - return new Promise((resolve, reject) => { - if (!query && !user_ids) query = ''; - if (nonce.length > 32) throw new RangeError('MEMBER_FETCH_NONCE_LENGTH'); - this.guild.shard.send({ - op: Opcodes.REQUEST_GUILD_MEMBERS, - d: { - guild_id: this.guild.id, - presences, - user_ids, - query, - nonce, - limit, - }, - }); - const fetchedMembers = new Collection(); - let i = 0; - const handler = (members, _, chunk) => { - timeout.refresh(); - if (chunk.nonce !== nonce) return; - i++; - for (const member of members.values()) { - fetchedMembers.set(member.id, member); - } - if ( - members.size < 1_000 || - (limit && fetchedMembers.size >= limit) || - i === chunk.count - ) { - clearTimeout(timeout); - this.client.removeListener(Events.GUILD_MEMBERS_CHUNK, handler); - this.client.decrementMaxListeners(); - let fetched = fetchedMembers; - if (user_ids && !Array.isArray(user_ids) && fetched.size) - fetched = fetched.first(); - resolve(fetched); - } - }; - const timeout = setTimeout(() => { - this.client.removeListener(Events.GUILD_MEMBERS_CHUNK, handler); - this.client.decrementMaxListeners(); - reject(new Error('GUILD_MEMBERS_TIMEOUT')); - }, time).unref(); - this.client.incrementMaxListeners(); - this.client.on(Events.GUILD_MEMBERS_CHUNK, handler); - }); - } - - /** - * Bulk ban users from a guild, and optionally delete previous messages sent by them. - * @param {Collection|UserResolvable[]} users The users to ban - * @param {BulkBanOptions} [options] The options for bulk banning users - * @returns {Promise} Returns an object with `bannedUsers` key containing the IDs of the banned users - * and the key `failedUsers` with the IDs that could not be banned or were already banned. - * Internally calls the GuildBanManager#bulkCreate method. - * @example - * // Bulk ban users by ids (or with user/guild member objects) and delete all their messages from the past 7 days - * guild.members.bulkBan(['84484653687267328'], { deleteMessageSeconds: 7 * 24 * 60 * 60 }) - * .then(result => { - * console.log(`Banned ${result.bannedUsers.length} users, failed to ban ${result.failedUsers.length} users.`) - * }) - * .catch(console.error); - * @deprecated This method will not be usable until an effective MFA implementation is in place. - */ - bulkBan(users, options = {}) { - return this.guild.bans.bulkCreate(users, options); - } -} - -module.exports = GuildMemberManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/GuildMemberRoleManager.js b/vendor/discord.js-selfbot-v13/src/managers/GuildMemberRoleManager.js deleted file mode 100644 index 2ff37cb..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/GuildMemberRoleManager.js +++ /dev/null @@ -1,237 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const DataManager = require('./DataManager'); -const { TypeError } = require('../errors'); -const { Role } = require('../structures/Role'); - -/** - * Manages API methods for roles of a GuildMember and stores their cache. - * @extends {DataManager} - */ -class GuildMemberRoleManager extends DataManager { - constructor(member) { - super(member.client, Role); - - /** - * The GuildMember this manager belongs to - * @type {GuildMember} - */ - this.member = member; - - /** - * The Guild this manager belongs to - * @type {Guild} - */ - this.guild = member.guild; - } - - /** - * The roles of this member - * @type {Collection} - * @readonly - */ - get cache() { - const everyone = this.guild.roles.everyone; - return this.guild.roles.cache - .filter((role) => this.member._roles.includes(role.id)) - .set(everyone.id, everyone); - } - - /** - * The role of the member used to hoist them in a separate category in the users list - * @type {?Role} - * @readonly - */ - get hoist() { - const hoistedRoles = this.cache.filter((role) => role.hoist); - if (!hoistedRoles.size) return null; - return hoistedRoles.reduce((prev, role) => - role.comparePositionTo(prev) > 0 ? role : prev, - ); - } - - /** - * The role of the member used to set their role icon - * @type {?Role} - * @readonly - */ - get icon() { - const iconRoles = this.cache.filter( - (role) => role.icon || role.unicodeEmoji, - ); - if (!iconRoles.size) return null; - return iconRoles.reduce((prev, role) => - role.comparePositionTo(prev) > 0 ? role : prev, - ); - } - - /** - * The role of the member used to set their color - * @type {?Role} - * @readonly - */ - get color() { - const coloredRoles = this.cache.filter((role) => role.colors.primaryColor); - if (!coloredRoles.size) return null; - return coloredRoles.reduce((prev, role) => - role.comparePositionTo(prev) > 0 ? role : prev, - ); - } - - /** - * The role of the member with the highest position - * @type {Role} - * @readonly - */ - get highest() { - return this.cache.reduce( - (prev, role) => (role.comparePositionTo(prev) > 0 ? role : prev), - this.cache.first(), - ); - } - - /** - * The premium subscriber role of the guild, if present on the member - * @type {?Role} - * @readonly - */ - get premiumSubscriberRole() { - return this.cache.find((role) => role.tags?.premiumSubscriberRole) ?? null; - } - - /** - * The managed role this member created when joining the guild, if any - * Only ever available on bots - * @type {?Role} - * @readonly - */ - get botRole() { - if (!this.member.user.bot) return null; - return ( - this.cache.find((role) => role.tags?.botId === this.member.user.id) ?? - null - ); - } - - /** - * Adds a role (or multiple roles) to the member. - * - * Uses the idempotent PUT route for singular roles, otherwise PATCHes the underlying guild member - * @param {RoleResolvable|RoleResolvable[]|Collection} roleOrRoles The role or roles to add - * @param {string} [reason] Reason for adding the role(s) - * @returns {Promise} - */ - async add(roleOrRoles, reason) { - if (roleOrRoles instanceof Collection || Array.isArray(roleOrRoles)) { - const resolvedRoles = []; - for (const role of roleOrRoles.values()) { - const resolvedRole = this.guild.roles.resolveId(role); - if (!resolvedRole) - throw new TypeError( - 'INVALID_ELEMENT', - 'Array or Collection', - 'roles', - role, - ); - resolvedRoles.push(resolvedRole); - } - - const newRoles = [...new Set(resolvedRoles.concat(...this.cache.keys()))]; - return this.set(newRoles, reason); - } else { - roleOrRoles = this.guild.roles.resolveId(roleOrRoles); - if (roleOrRoles === null) { - throw new TypeError( - 'INVALID_TYPE', - 'roles', - 'Role, Snowflake or Array or Collection of Roles or Snowflakes', - ); - } - - await this.client.api.guilds[this.guild.id].members[this.member.id].roles[ - roleOrRoles - ].put({ reason }); - - const clone = this.member._clone(); - clone._roles = [...this.cache.keys(), roleOrRoles]; - return clone; - } - } - - /** - * Removes a role (or multiple roles) from the member. - * - * Uses the idempotent DELETE route for singular roles, otherwise PATCHes the underlying guild member - * @param {RoleResolvable|RoleResolvable[]|Collection} roleOrRoles The role or roles to remove - * @param {string} [reason] Reason for removing the role(s) - * @returns {Promise} - */ - async remove(roleOrRoles, reason) { - if (roleOrRoles instanceof Collection || Array.isArray(roleOrRoles)) { - const resolvedRoles = []; - for (const role of roleOrRoles.values()) { - const resolvedRole = this.guild.roles.resolveId(role); - if (!resolvedRole) - throw new TypeError( - 'INVALID_ELEMENT', - 'Array or Collection', - 'roles', - role, - ); - resolvedRoles.push(resolvedRole); - } - - const newRoles = this.cache.filter( - (role) => !resolvedRoles.includes(role.id), - ); - return this.set(newRoles, reason); - } else { - roleOrRoles = this.guild.roles.resolveId(roleOrRoles); - if (roleOrRoles === null) { - throw new TypeError( - 'INVALID_TYPE', - 'roles', - 'Role, Snowflake or Array or Collection of Roles or Snowflakes', - ); - } - - await this.client.api.guilds[this.guild.id].members[this.member.id].roles[ - roleOrRoles - ].delete({ reason }); - - const clone = this.member._clone(); - const newRoles = this.cache.filter((role) => role.id !== roleOrRoles); - clone._roles = [...newRoles.keys()]; - return clone; - } - } - - /** - * Sets the roles applied to the member. - * @param {Collection|RoleResolvable[]} roles The roles or role ids to apply - * @param {string} [reason] Reason for applying the roles - * @returns {Promise} - * @example - * // Set the member's roles to a single role - * guildMember.roles.set(['391156570408615936']) - * .then(console.log) - * .catch(console.error); - * @example - * // Remove all the roles from a member - * guildMember.roles.set([]) - * .then(member => console.log(`Member roles is now of ${member.roles.cache.size} size`)) - * .catch(console.error); - */ - set(roles, reason) { - return this.member.edit({ roles }, reason); - } - - clone() { - const clone = new this.constructor(this.member); - clone.member._roles = [...this.cache.keys()]; - return clone; - } -} - -module.exports = GuildMemberRoleManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/GuildScheduledEventManager.js b/vendor/discord.js-selfbot-v13/src/managers/GuildScheduledEventManager.js deleted file mode 100644 index 9964c87..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/GuildScheduledEventManager.js +++ /dev/null @@ -1,355 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const CachedManager = require('./CachedManager'); -const { TypeError, Error } = require('../errors'); -const { GuildScheduledEvent } = require('../structures/GuildScheduledEvent'); -const { - PrivacyLevels, - GuildScheduledEventEntityTypes, - GuildScheduledEventStatuses, -} = require('../util/Constants'); -const DataResolver = require('../util/DataResolver'); -const Util = require('../util/Util'); - -/** - * Manages API methods for GuildScheduledEvents and stores their cache. - * @extends {CachedManager} - */ -class GuildScheduledEventManager extends CachedManager { - constructor(guild, iterable) { - super(guild.client, GuildScheduledEvent, iterable); - - /** - * The guild this manager belongs to - * @type {Guild} - */ - this.guild = guild; - } - - /** - * The cache of this manager - * @type {Collection} - * @name GuildScheduledEventManager#cache - */ - - /** - * Data that resolves to give a GuildScheduledEvent object. This can be: - * * A Snowflake - * * A GuildScheduledEvent object - * @typedef {Snowflake|GuildScheduledEvent} GuildScheduledEventResolvable - */ - - /** - * Options for setting a recurrence rule for a guild scheduled event. - * @typedef {Object} GuildScheduledEventRecurrenceRuleOptions - * @property {DateResolvable} startAt The time the recurrence rule interval starts at - * @property {GuildScheduledEventRecurrenceRuleFrequency} frequency How often the event occurs - * @property {number} interval The spacing between the events - * @property {?GuildScheduledEventRecurrenceRuleWeekday[]} byWeekday The days within a week to recur on - * @property {?GuildScheduledEventRecurrenceRuleNWeekday[]} byNWeekday The days within a week to recur on - * @property {?GuildScheduledEventRecurrenceRuleMonth[]} byMonth The months to recur on - * @property {?number[]} byMonthDay The days within a month to recur on - */ - - /** - * Options used to create a guild scheduled event. - * @typedef {Object} GuildScheduledEventCreateOptions - * @property {string} name The name of the guild scheduled event - * @property {DateResolvable} scheduledStartTime The time to schedule the event at - * @property {DateResolvable} [scheduledEndTime] The time to end the event at - * This is required if `entityType` is 'EXTERNAL' - * @property {PrivacyLevel|number} privacyLevel The privacy level of the guild scheduled event - * @property {GuildScheduledEventEntityType|number} entityType The scheduled entity type of the event - * @property {string} [description] The description of the guild scheduled event - * @property {GuildVoiceChannelResolvable} [channel] The channel of the guild scheduled event - * This is required if `entityType` is 'STAGE_INSTANCE' or `VOICE` - * @property {GuildScheduledEventEntityMetadataOptions} [entityMetadata] The entity metadata of the - * guild scheduled event - * This is required if `entityType` is 'EXTERNAL' - * @property {?(BufferResolvable|Base64Resolvable)} [image] The cover image of the guild scheduled event - * @property {string} [reason] The reason for creating the guild scheduled event - * @property {GuildScheduledEventRecurrenceRuleOptions} [recurrenceRule] - * The recurrence rule of the guild scheduled event - */ - - /** - * Options used to set entity metadata of a guild scheduled event. - * @typedef {Object} GuildScheduledEventEntityMetadataOptions - * @property {string} [location] The location of the guild scheduled event - * This is required if `entityType` is 'EXTERNAL' - */ - - /** - * Creates a new guild scheduled event. - * @param {GuildScheduledEventCreateOptions} options Options for creating the guild scheduled event - * @returns {Promise} - */ - async create(options) { - if (typeof options !== 'object') - throw new TypeError('INVALID_TYPE', 'options', 'object', true); - let { - privacyLevel, - entityType, - channel, - name, - scheduledStartTime, - description, - scheduledEndTime, - entityMetadata, - reason, - image, - recurrenceRule, - } = options; - - if (typeof privacyLevel === 'string') - privacyLevel = PrivacyLevels[privacyLevel]; - if (typeof entityType === 'string') - entityType = GuildScheduledEventEntityTypes[entityType]; - - let entity_metadata, channel_id; - if (entityType === GuildScheduledEventEntityTypes.EXTERNAL) { - channel_id = typeof channel === 'undefined' ? channel : null; - entity_metadata = { location: entityMetadata?.location }; - } else { - channel_id = this.guild.channels.resolveId(channel); - if (!channel_id) throw new Error('GUILD_VOICE_CHANNEL_RESOLVE'); - entity_metadata = - typeof entityMetadata === 'undefined' ? entityMetadata : null; - } - - const data = await this.client.api - .guilds(this.guild.id, 'scheduled-events') - .post({ - data: { - channel_id, - name, - privacy_level: privacyLevel, - scheduled_start_time: new Date(scheduledStartTime).toISOString(), - scheduled_end_time: scheduledEndTime - ? new Date(scheduledEndTime).toISOString() - : scheduledEndTime, - description, - image: image && (await DataResolver.resolveImage(image)), - entity_type: entityType, - entity_metadata, - recurrence_rule: - recurrenceRule && - Util.transformGuildScheduledEventRecurrenceRule(recurrenceRule), - }, - reason, - }); - - return this._add(data); - } - - /** - * Options used to fetch a single guild scheduled event from a guild. - * @typedef {BaseFetchOptions} FetchGuildScheduledEventOptions - * @property {GuildScheduledEventResolvable} guildScheduledEvent The guild scheduled event to fetch - * @property {boolean} [withUserCount=true] Whether to fetch the number of users subscribed to the scheduled event - */ - - /** - * Options used to fetch multiple guild scheduled events from a guild. - * @typedef {Object} FetchGuildScheduledEventsOptions - * @property {boolean} [cache] Whether or not to cache the fetched guild scheduled events - * @property {boolean} [withUserCount=true] Whether to fetch the number of users subscribed to each scheduled event - * should be returned - */ - - /** - * Obtains one or more guild scheduled events from Discord, or the guild cache if it's already available. - * @param {GuildScheduledEventResolvable|FetchGuildScheduledEventOptions|FetchGuildScheduledEventsOptions} [options] - * The id of the guild scheduled event or options - * @returns {Promise>} - */ - async fetch(options = {}) { - const id = this.resolveId(options.guildScheduledEvent ?? options); - - if (id) { - if (!options.force) { - const existing = this.cache.get(id); - if (existing) return existing; - } - - const data = await this.client.api - .guilds(this.guild.id, 'scheduled-events', id) - .get({ query: { with_user_count: options.withUserCount ?? true } }); - return this._add(data, options.cache); - } - - const data = await this.client.api - .guilds(this.guild.id, 'scheduled-events') - .get({ query: { with_user_count: options.withUserCount ?? true } }); - - return data.reduce( - (coll, rawGuildScheduledEventData) => - coll.set( - rawGuildScheduledEventData.id, - this._add(rawGuildScheduledEventData, options.cache), - ), - new Collection(), - ); - } - - /** - * Options used to edit a guild scheduled event. - * @typedef {Object} GuildScheduledEventEditOptions - * @property {string} [name] The name of the guild scheduled event - * @property {DateResolvable} [scheduledStartTime] The time to schedule the event at - * @property {DateResolvable} [scheduledEndTime] The time to end the event at - * @property {PrivacyLevel|number} [privacyLevel] The privacy level of the guild scheduled event - * @property {GuildScheduledEventEntityType|number} [entityType] The scheduled entity type of the event - * @property {string} [description] The description of the guild scheduled event - * @property {?GuildVoiceChannelResolvable} [channel] The channel of the guild scheduled event - * @property {GuildScheduledEventStatus|number} [status] The status of the guild scheduled event - * @property {GuildScheduledEventEntityMetadataOptions} [entityMetadata] The entity metadata of the - * guild scheduled event - * This can be modified only if `entityType` of the `GuildScheduledEvent` to be edited is 'EXTERNAL' - * @property {?(BufferResolvable|Base64Resolvable)} [image] The cover image of the guild scheduled event - * @property {string} [reason] The reason for editing the guild scheduled event - * @property {?GuildScheduledEventRecurrenceRuleOptions} [recurrenceRule] - * The recurrence rule of the guild scheduled event - */ - - /** - * Edits a guild scheduled event. - * @param {GuildScheduledEventResolvable} guildScheduledEvent The guild scheduled event to edit - * @param {GuildScheduledEventEditOptions} options Options to edit the guild scheduled event - * @returns {Promise} - */ - async edit(guildScheduledEvent, options) { - const guildScheduledEventId = this.resolveId(guildScheduledEvent); - if (!guildScheduledEventId) - throw new Error('GUILD_SCHEDULED_EVENT_RESOLVE'); - - if (typeof options !== 'object') - throw new TypeError('INVALID_TYPE', 'options', 'object', true); - let { - privacyLevel, - entityType, - channel, - status, - name, - scheduledStartTime, - description, - scheduledEndTime, - entityMetadata, - reason, - image, - recurrenceRule, - } = options; - - if (typeof privacyLevel === 'string') - privacyLevel = PrivacyLevels[privacyLevel]; - if (typeof entityType === 'string') - entityType = GuildScheduledEventEntityTypes[entityType]; - if (typeof status === 'string') - status = GuildScheduledEventStatuses[status]; - - let entity_metadata; - if (entityMetadata) { - entity_metadata = { - location: entityMetadata.location, - }; - } - - const data = await this.client.api - .guilds(this.guild.id, 'scheduled-events', guildScheduledEventId) - .patch({ - data: { - channel_id: - typeof channel === 'undefined' - ? channel - : this.guild.channels.resolveId(channel), - name, - privacy_level: privacyLevel, - scheduled_start_time: scheduledStartTime - ? new Date(scheduledStartTime).toISOString() - : undefined, - scheduled_end_time: scheduledEndTime - ? new Date(scheduledEndTime).toISOString() - : scheduledEndTime, - description, - entity_type: entityType, - status, - image: image && (await DataResolver.resolveImage(image)), - entity_metadata, - recurrence_rule: - recurrenceRule && - Util.transformGuildScheduledEventRecurrenceRule(recurrenceRule), - }, - reason, - }); - - return this._add(data); - } - - /** - * Deletes a guild scheduled event. - * @param {GuildScheduledEventResolvable} guildScheduledEvent The guild scheduled event to delete - * @returns {Promise} - */ - async delete(guildScheduledEvent) { - const guildScheduledEventId = this.resolveId(guildScheduledEvent); - if (!guildScheduledEventId) - throw new Error('GUILD_SCHEDULED_EVENT_RESOLVE'); - - await this.client.api - .guilds(this.guild.id, 'scheduled-events', guildScheduledEventId) - .delete(); - } - - /** - * Options used to fetch subscribers of a guild scheduled event - * @typedef {Object} FetchGuildScheduledEventSubscribersOptions - * @property {number} [limit] The maximum numbers of users to fetch - * @property {boolean} [withMember] Whether to fetch guild member data of the users - * @property {Snowflake} [before] Consider only users before this user id - * @property {Snowflake} [after] Consider only users after this user id - * If both `before` and `after` are provided, only `before` is respected - */ - - /** - * Represents a subscriber of a {@link GuildScheduledEvent} - * @typedef {Object} GuildScheduledEventUser - * @property {Snowflake} guildScheduledEventId The id of the guild scheduled event which the user subscribed to - * @property {User} user The user that subscribed to the guild scheduled event - * @property {?GuildMember} member The guild member associated with the user, if any - */ - - /** - * Fetches subscribers of a guild scheduled event. - * @param {GuildScheduledEventResolvable} guildScheduledEvent The guild scheduled event to fetch subscribers of - * @param {FetchGuildScheduledEventSubscribersOptions} [options={}] Options for fetching the subscribers - * @returns {Promise>} - */ - async fetchSubscribers(guildScheduledEvent, options = {}) { - const guildScheduledEventId = this.resolveId(guildScheduledEvent); - if (!guildScheduledEventId) - throw new Error('GUILD_SCHEDULED_EVENT_RESOLVE'); - - let { limit, withMember, before, after } = options; - - const data = await this.client.api - .guilds(this.guild.id, 'scheduled-events', guildScheduledEventId) - .users.get({ - query: { limit, with_member: withMember, before, after }, - }); - - return data.reduce( - (coll, rawData) => - coll.set(rawData.user.id, { - guildScheduledEventId: rawData.guild_scheduled_event_id, - user: this.client.users._add(rawData.user), - member: rawData.member - ? this.guild.members._add({ ...rawData.member, user: rawData.user }) - : null, - }), - new Collection(), - ); - } -} - -module.exports = GuildScheduledEventManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/GuildSettingManager.js b/vendor/discord.js-selfbot-v13/src/managers/GuildSettingManager.js deleted file mode 100644 index 7ab70db..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/GuildSettingManager.js +++ /dev/null @@ -1,155 +0,0 @@ -'use strict'; - -const BaseManager = require('./BaseManager'); -/** - * Manages API methods for users and stores their cache. - * @extends {BaseManager} - * @see {@link https://luna.gitlab.io/discord-unofficial-docs/user_settings.html} - */ -class GuildSettingManager extends BaseManager { - #rawSetting = {}; - constructor(guild) { - super(guild.client); - /** - * Guild Id - * @type {?Snowflake} - */ - this.guildId = guild.id; - } - - /** - * Raw data - * @type {Object} - */ - get raw() { - return this.#rawSetting; - } - - /** - * Get the guild - * @type {?Guild} - * @readonly - */ - get guild() { - return this.client.guilds.cache.get(this.guildId); - } - - /** - * Patch data file - * @private - * @param {Object} data Raw Data to patch - */ - _patch(data = {}) { - this.#rawSetting = Object.assign(this.#rawSetting, data); - this.client.emit('debug', `[SETTING > Guild ${this.guildId}] Sync setting`); - if ('suppress_everyone' in data) { - /** - * Notification setting > Suppress `@everyone` and `@here` - * @type {?boolean} - */ - this.suppressEveryone = data.suppress_everyone; - } - if ('suppress_roles' in data) { - /** - * Notification setting > Suppress all role `@mention` - * @type {?boolean} - */ - this.suppressRoles = data.suppress_roles; - } - if ('mute_scheduled_events' in data) { - /** - * Notification setting > Mute new events - * @type {?boolean} - */ - this.muteScheduledEvents = data.mute_scheduled_events; - } - if ('message_notifications' in data) { - /** - * Notification setting > Message notifications - * * `0`: All messages - * * `1`: Only @mentions - * * `2`: Nothing - * @type {?number} - */ - this.messageNotifications = data.message_notifications; - } - if ('flags' in data) { - /** - * Flags (unknown) - * @type {?number} - */ - this.flags = data.flags; - } - if ('mobile_push' in data) { - /** - * Notification setting > Mobile push notifications - * @type {?boolean} - */ - this.mobilePush = data.mobile_push; - } - if ('muted' in data) { - /** - * Mute server - * @type {?boolean} - */ - this.muted = data.muted; - } - if ('mute_config' in data && data.mute_config !== null) { - /** - * Mute config (muted = true) - * * `muteConfig.endTime`: End time (Date) - * * `muteConfig.selectedTimeWindow`: Selected time window (seconds) (number) - * @type {?Object} - */ - this.muteConfig = { - endTime: new Date(data.mute_config.end_time), - selectedTimeWindow: data.mute_config.selected_time_window, - }; - } else { - this.muteConfig = null; - } - if ('hide_muted_channels' in data) { - /** - * Hide muted channels - * @type {?boolean} - */ - this.hideMutedChannels = data.hide_muted_channels; - } - if ('channel_overrides' in data) { - /** - * Channel overrides (unknown) - * @type {?Array} - */ - this.channelOverrides = data.channel_overrides; - } - if ('notify_highlights' in data) { - /** - * Notification setting > Suppress highlights - * * `0`: ??? (unknown) - * * `1`: Enable - * * `2`: Disable - * @type {?number} - */ - this.notifyHighlights = data.notify_highlights; - } - if ('version' in data) { - /** - * Version (unknown) - * @type {?number} - */ - this.version = data.version; - } - } - /** - * Edit guild settings - * @param {Object} data Data to edit - * @returns {Promise} - */ - async edit(data) { - const data_ = await this.client.api.users('@me').settings.patch(data); - this._patch(data_); - return this; - } -} - -module.exports = GuildSettingManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/GuildStickerManager.js b/vendor/discord.js-selfbot-v13/src/managers/GuildStickerManager.js deleted file mode 100644 index 202b1e1..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/GuildStickerManager.js +++ /dev/null @@ -1,197 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const CachedManager = require('./CachedManager'); -const { TypeError } = require('../errors'); -const MessagePayload = require('../structures/MessagePayload'); -const { Sticker } = require('../structures/Sticker'); - -/** - * Manages API methods for Guild Stickers and stores their cache. - * @extends {CachedManager} - */ -class GuildStickerManager extends CachedManager { - constructor(guild, iterable) { - super(guild.client, Sticker, iterable); - - /** - * The guild this manager belongs to - * @type {Guild} - */ - this.guild = guild; - } - - /** - * The cache of Guild Stickers - * @type {Collection} - * @name GuildStickerManager#cache - */ - - _add(data, cache) { - return super._add(data, cache, { extras: [this.guild] }); - } - - /** - * Options for creating a guild sticker. - * @typedef {Object} GuildStickerCreateOptions - * @property {?string} [description] The description for the sticker - * @property {string} [reason] Reason for creating the sticker - */ - - /** - * Creates a new custom sticker in the guild. - * @param {BufferResolvable|Stream|FileOptions|MessageAttachment} file The file for the sticker - * @param {string} name The name for the sticker - * @param {string} tags The Discord name of a unicode emoji representing the sticker's expression - * @param {GuildStickerCreateOptions} [options] Options - * @returns {Promise} The created sticker - * @example - * // Create a new sticker from a URL - * guild.stickers.create('https://i.imgur.com/w3duR07.png', 'rip', 'headstone') - * .then(sticker => console.log(`Created new sticker with name ${sticker.name}!`)) - * .catch(console.error); - * @example - * // Create a new sticker from a file on your computer - * guild.stickers.create('./memes/banana.png', 'banana', 'banana') - * .then(sticker => console.log(`Created new sticker with name ${sticker.name}!`)) - * .catch(console.error); - */ - async create(file, name, tags, { description, reason } = {}) { - const resolvedFile = await MessagePayload.resolveFile(file); - if (!resolvedFile) throw new TypeError('REQ_RESOURCE_TYPE'); - file = { ...resolvedFile, key: 'file' }; - - const data = { name, tags, description: description ?? '' }; - - const sticker = await this.client.api - .guilds(this.guild.id) - .stickers.post({ data, files: [file], reason, dontUsePayloadJSON: true }); - return this.client.actions.GuildStickerCreate.handle(this.guild, sticker) - .sticker; - } - - /** - * Data that resolves to give a Sticker object. This can be: - * * A Sticker object - * * A Snowflake - * @typedef {Sticker|Snowflake} StickerResolvable - */ - - /** - * Resolves a StickerResolvable to a Sticker object. - * @method resolve - * @memberof GuildStickerManager - * @instance - * @param {StickerResolvable} sticker The Sticker resolvable to identify - * @returns {?Sticker} - */ - - /** - * Resolves a StickerResolvable to a Sticker id string. - * @method resolveId - * @memberof GuildStickerManager - * @instance - * @param {StickerResolvable} sticker The Sticker resolvable to identify - * @returns {?Snowflake} - */ - - /** - * Edits a sticker. - * @param {StickerResolvable} sticker The sticker to edit - * @param {GuildStickerEditData} [data] The new data for the sticker - * @param {string} [reason] Reason for editing this sticker - * @returns {Promise} - */ - async edit(sticker, data, reason) { - const stickerId = this.resolveId(sticker); - if (!stickerId) - throw new TypeError('INVALID_TYPE', 'sticker', 'StickerResolvable'); - - const d = await this.client.api - .guilds(this.guild.id) - .stickers(stickerId) - .patch({ - data, - reason, - }); - - const existing = this.cache.get(stickerId); - if (existing) { - const clone = existing._clone(); - clone._patch(d); - return clone; - } - return this._add(d); - } - - /** - * Deletes a sticker. - * @param {StickerResolvable} sticker The sticker to delete - * @param {string} [reason] Reason for deleting this sticker - * @returns {Promise} - */ - async delete(sticker, reason) { - sticker = this.resolveId(sticker); - if (!sticker) - throw new TypeError('INVALID_TYPE', 'sticker', 'StickerResolvable'); - - await this.client.api - .guilds(this.guild.id) - .stickers(sticker) - .delete({ reason }); - } - - /** - * Obtains one or more stickers from Discord, or the sticker cache if they're already available. - * @param {Snowflake} [id] The Sticker's id - * @param {BaseFetchOptions} [options] Additional options for this fetch - * @returns {Promise>} - * @example - * // Fetch all stickers from the guild - * message.guild.stickers.fetch() - * .then(stickers => console.log(`There are ${stickers.size} stickers.`)) - * .catch(console.error); - * @example - * // Fetch a single sticker - * message.guild.stickers.fetch('222078108977594368') - * .then(sticker => console.log(`The sticker name is: ${sticker.name}`)) - * .catch(console.error); - */ - async fetch(id, { cache = true, force = false } = {}) { - if (id) { - if (!force) { - const existing = this.cache.get(id); - if (existing) return existing; - } - const sticker = await this.client.api - .guilds(this.guild.id) - .stickers(id) - .get(); - return this._add(sticker, cache); - } - - const data = await this.client.api.guilds(this.guild.id).stickers.get(); - return new Collection( - data.map((sticker) => [sticker.id, this._add(sticker, cache)]), - ); - } - - /** - * Fetches the user who uploaded this sticker, if this is a guild sticker. - * @param {StickerResolvable} sticker The sticker to fetch the user for - * @returns {Promise} - */ - async fetchUser(sticker) { - sticker = this.resolve(sticker); - if (!sticker) - throw new TypeError('INVALID_TYPE', 'sticker', 'StickerResolvable'); - const data = await this.client.api - .guilds(this.guild.id) - .stickers(sticker.id) - .get(); - sticker._patch(data); - return sticker.user; - } -} - -module.exports = GuildStickerManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/GuildTextThreadManager.js b/vendor/discord.js-selfbot-v13/src/managers/GuildTextThreadManager.js deleted file mode 100644 index 95336ab..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/GuildTextThreadManager.js +++ /dev/null @@ -1,114 +0,0 @@ -'use strict'; - -const ThreadManager = require('./ThreadManager'); -const { TypeError } = require('../errors'); -const { ChannelTypes } = require('../util/Constants'); -const { resolveAutoArchiveMaxLimit } = require('../util/Util'); - -/** - * Manages API methods for {@link ThreadChannel} objects and stores their cache. - * @extends {ThreadManager} - */ -class GuildTextThreadManager extends ThreadManager { - /** - * The channel this Manager belongs to - * @name GuildTextThreadManager#channel - * @type {TextChannel|NewsChannel} - */ - - /** - * Options for creating a thread. Only one of `startMessage` or `type` can be defined. - * @typedef {StartThreadOptions} GuildTextThreadCreateOptions - * @property {MessageResolvable} [startMessage] The message to start a thread from. If this is defined then type - * of thread gets automatically defined and cannot be changed. The provided `type` field will be ignored - * @property {ThreadChannelTypes|number} [type] The type of thread to create. Defaults to `GUILD_PUBLIC_THREAD` if - * created in a {@link TextChannel} When creating threads in a {@link NewsChannel} this is ignored and is always - * `GUILD_NEWS_THREAD` - * @property {boolean} [invitable] Whether non-moderators can add other non-moderators to the thread - * Can only be set when type will be `GUILD_PRIVATE_THREAD` - * @property {number} [rateLimitPerUser] The rate limit per user (slowmode) for the new channel in seconds - */ - - /** - * Creates a new thread in the channel. - * @param {GuildTextThreadCreateOptions} [options] Options to create a new thread - * @returns {Promise} - * @example - * // Create a new public thread - * channel.threads - * .create({ - * name: 'food-talk', - * autoArchiveDuration: 60, - * reason: 'Needed a separate thread for food', - * }) - * .then(threadChannel => console.log(threadChannel)) - * .catch(console.error); - * @example - * // Create a new private thread - * channel.threads - * .create({ - * name: 'mod-talk', - * autoArchiveDuration: 60, - * type: 'GUILD_PRIVATE_THREAD', - * reason: 'Needed a separate thread for moderation', - * }) - * .then(threadChannel => console.log(threadChannel)) - * .catch(console.error); - */ - async create({ - name, - autoArchiveDuration = this.channel.defaultAutoArchiveDuration, - startMessage, - type, - invitable, - reason, - rateLimitPerUser, - } = {}) { - let path = this.client.api.channels(this.channel.id); - if (type && typeof type !== 'string' && typeof type !== 'number') { - throw new TypeError( - 'INVALID_TYPE', - 'type', - 'ThreadChannelType or Number', - ); - } - let resolvedType = - this.channel.type === 'GUILD_NEWS' - ? ChannelTypes.GUILD_NEWS_THREAD - : ChannelTypes.GUILD_PUBLIC_THREAD; - if (startMessage) { - const startMessageId = this.channel.messages.resolveId(startMessage); - if (!startMessageId) - throw new TypeError( - 'INVALID_TYPE', - 'startMessage', - 'MessageResolvable', - ); - path = path.messages(startMessageId); - } else if (this.channel.type !== 'GUILD_NEWS') { - resolvedType = - typeof type === 'string' ? ChannelTypes[type] : (type ?? resolvedType); - } - - if (autoArchiveDuration === 'MAX') - autoArchiveDuration = resolveAutoArchiveMaxLimit(this.channel.guild); - - const data = await path.threads.post({ - data: { - name, - auto_archive_duration: autoArchiveDuration, - type: resolvedType, - invitable: - resolvedType === ChannelTypes.GUILD_PRIVATE_THREAD - ? invitable - : undefined, - rate_limit_per_user: rateLimitPerUser, - }, - reason, - }); - - return this.client.actions.ThreadCreate.handle(data).thread; - } -} - -module.exports = GuildTextThreadManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/InteractionManager.js b/vendor/discord.js-selfbot-v13/src/managers/InteractionManager.js deleted file mode 100644 index 98e11b9..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/InteractionManager.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -const CachedManager = require('./CachedManager'); -const InteractionResponse = require('../structures/InteractionResponse'); - -/** - * Manages API methods for InteractionResponse and holds their cache. - * @extends {CachedManager} - */ -class InteractionManager extends CachedManager { - constructor(channel, iterable) { - super(channel.client, InteractionResponse, iterable); - - /** - * The channel that the messages belong to - * @type {TextBasedChannels} - */ - this.channel = channel; - } - - /** - * The cache of InteractionResponse - * @type {Collection} - * @name InteractionManager#cache - */ - - _add(data, cache) { - data = { - ...data, - channelId: this.channel.id, - guildId: this.channel.guild?.id, - }; - if (!data.id) return; - // eslint-disable-next-line consistent-return - return super._add(data, cache); - } -} - -module.exports = InteractionManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/MessageManager.js b/vendor/discord.js-selfbot-v13/src/managers/MessageManager.js deleted file mode 100644 index 6f679ae..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/MessageManager.js +++ /dev/null @@ -1,500 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const CachedManager = require('./CachedManager'); -const { TypeError } = require('../errors'); -const { Message } = require('../structures/Message'); -const MessagePayload = require('../structures/MessagePayload'); -const Util = require('../util/Util'); - -/** - * Manages API methods for Messages and holds their cache. - * @extends {CachedManager} - */ -class MessageManager extends CachedManager { - constructor(channel, iterable) { - super(channel.client, Message, iterable); - - /** - * The channel that the messages belong to - * @type {TextBasedChannels} - */ - this.channel = channel; - } - - /** - * The cache of Messages - * @type {Collection} - * @name MessageManager#cache - */ - - _add(data, cache) { - return super._add(data, cache); - } - - /** - * The parameters to pass in when requesting previous messages from a channel. `around`, `before` and - * `after` are mutually exclusive. All the parameters are optional. - * @typedef {Object} ChannelLogsQueryOptions - * @property {number} [limit=50] Number of messages to acquire - * @property {Snowflake} [before] The message's id to get the messages that were posted before it - * @property {Snowflake} [after] The message's id to get the messages that were posted after it - * @property {Snowflake} [around] The message's id to get the messages that were posted around it - */ - - /** - * Gets a message, or messages, from this channel. - * The returned Collection does not contain reaction users of the messages if they were not cached. - * Those need to be fetched separately in such a case. - * @param {Snowflake|ChannelLogsQueryOptions} [message] The id of the message to fetch, or query parameters. - * @param {BaseFetchOptions} [options] Additional options for this fetch - * @returns {Promise>} - * @example - * // Get message - * channel.messages.fetch('99539446449315840') - * .then(message => console.log(message.content)) - * .catch(console.error); - * @example - * // Get messages - * channel.messages.fetch({ limit: 10 }) - * .then(messages => console.log(`Received ${messages.size} messages`)) - * .catch(console.error); - * @example - * // Get messages and filter by user id - * channel.messages.fetch() - * .then(messages => console.log(`${messages.filter(m => m.author.id === '84484653687267328').size} messages`)) - * .catch(console.error); - */ - fetch(message, { cache = true, force = false } = {}) { - return typeof message === 'string' - ? this._fetchId(message, cache, force) - : this._fetchMany(message, cache); - } - - /** - * Fetches the pinned messages of this channel and returns a collection of them. - * The returned Collection does not contain any reaction data of the messages. - * Those need to be fetched separately. - * @param {boolean} [cache=true] Whether to cache the message(s) - * @returns {Promise>} - * @example - * // Get pinned messages - * channel.messages.fetchPinned() - * .then(messages => console.log(`Received ${messages.size} messages`)) - * .catch(console.error); - */ - async fetchPinned(cache = true) { - const data = await this.client.api.channels[ - this.channel.id - ].messages.pins.get({ - query: { limit: 50 }, - }); - const messages = new Collection(); - for (const message of data?.items || []) - messages.set(message.id, this._add(message, cache)); - return messages; - } - - /** - * Data that can be resolved to a Message object. This can be: - * * A Message - * * A Snowflake - * @typedef {Message|Snowflake} MessageResolvable - */ - - /** - * Resolves a {@link MessageResolvable} to a {@link Message} object. - * @method resolve - * @memberof MessageManager - * @instance - * @param {MessageResolvable} message The message resolvable to resolve - * @returns {?Message} - */ - - /** - * Resolves a {@link MessageResolvable} to a {@link Message} id. - * @method resolveId - * @memberof MessageManager - * @instance - * @param {MessageResolvable} message The message resolvable to resolve - * @returns {?Snowflake} - */ - - /** - * Edits a message, even if it's not cached. - * @param {MessageResolvable} message The message to edit - * @param {string|MessageEditOptions|MessagePayload} options The options to edit the message - * @returns {Promise} - */ - async edit(message, options) { - const messageId = this.resolveId(message); - if (!messageId) - throw new TypeError('INVALID_TYPE', 'message', 'MessageResolvable'); - - const { data, files } = await (options instanceof MessagePayload - ? options - : MessagePayload.create( - message instanceof Message ? message : this, - options, - ) - ) - .resolveData() - .resolveFiles(); - - // New API - const attachments = await Util.getUploadURL( - this.client, - this.channel.id, - files, - ); - const requestPromises = attachments.map(async (attachment) => { - await Util.uploadFile(files[attachment.id].file, attachment.upload_url); - return { - id: attachment.id, - filename: files[attachment.id].name, - uploaded_filename: attachment.upload_filename, - description: files[attachment.id].description, - duration_secs: files[attachment.id].duration_secs, - waveform: files[attachment.id].waveform, - }; - }); - const attachmentsData = await Promise.all(requestPromises); - attachmentsData.sort((a, b) => parseInt(a.id) - parseInt(b.id)); - data.attachments = attachmentsData; - // Empty Files - - const d = await this.client.api.channels[this.channel.id].messages[ - messageId - ].patch({ data }); - - const existing = this.cache.get(messageId); - if (existing) { - const clone = existing._clone(); - clone._patch(d); - return clone; - } - return this._add(d); - } - - /** - * Publishes a message in an announcement channel to all channels following it, even if it's not cached. - * @param {MessageResolvable} message The message to publish - * @returns {Promise} - */ - async crosspost(message) { - message = this.resolveId(message); - if (!message) - throw new TypeError('INVALID_TYPE', 'message', 'MessageResolvable'); - - const data = await this.client.api - .channels(this.channel.id) - .messages(message) - .crosspost.post(); - return this.cache.get(data.id) ?? this._add(data); - } - - /** - * Pins a message to the channel's pinned messages, even if it's not cached. - * @param {MessageResolvable} message The message to pin - * @param {string} [reason] Reason for pinning - * @returns {Promise} - */ - async pin(message, reason) { - message = this.resolveId(message); - if (!message) - throw new TypeError('INVALID_TYPE', 'message', 'MessageResolvable'); - - await this.client.api - .channels(this.channel.id) - .messages.pins(message) - .put({ reason }); - } - - /** - * Unpins a message from the channel's pinned messages, even if it's not cached. - * @param {MessageResolvable} message The message to unpin - * @param {string} [reason] Reason for unpinning - * @returns {Promise} - */ - async unpin(message, reason) { - message = this.resolveId(message); - if (!message) - throw new TypeError('INVALID_TYPE', 'message', 'MessageResolvable'); - - await this.client.api - .channels(this.channel.id) - .messages.pins(message) - .delete({ reason }); - } - - /** - * Adds a reaction to a message, even if it's not cached. - * @param {MessageResolvable} message The message to react to - * @param {EmojiIdentifierResolvable} emoji The emoji to react with - * @param {boolean} [burst=false] Super Reactions (Discord Nitro only) - * @returns {Promise} - */ - async react(message, emoji, burst = false) { - message = this.resolveId(message); - if (!message) - throw new TypeError('INVALID_TYPE', 'message', 'MessageResolvable'); - - emoji = Util.resolvePartialEmoji(emoji); - if (!emoji) - throw new TypeError('EMOJI_TYPE', 'emoji', 'EmojiIdentifierResolvable'); - - const emojiId = emoji.id - ? `${emoji.animated ? 'a:' : ''}${emoji.name}:${emoji.id}` - : encodeURIComponent(emoji.name); - - // eslint-disable-next-line newline-per-chained-call - await this.client.api - .channels(this.channel.id) - .messages(message) - .reactions(emojiId, '@me') - .put({ - query: { - type: burst ? 1 : 0, - }, - }); - } - - /** - * Deletes a message, even if it's not cached. - * @param {MessageResolvable} message The message to delete - * @returns {Promise} - */ - async delete(message) { - message = this.resolveId(message); - if (!message) - throw new TypeError('INVALID_TYPE', 'message', 'MessageResolvable'); - - await this.client.api.channels(this.channel.id).messages(message).delete(); - } - - _fetchId(messageId, cache, force) { - if (!force) { - const existing = this.cache.get(messageId); - if (existing && !existing.partial) return existing; - } - - // https://discord.com/api/v9/channels/:id/messages?limit=50&around=:msgid - return new Promise((resolve, reject) => { - this._fetchMany( - { - around: messageId, - limit: 50, - }, - cache, - ) - .then((data_) => - data_.has(messageId) - ? resolve(data_.get(messageId)) - : reject(new Error('MESSAGE_ID_NOT_FOUND')), - ) - .catch(reject); - }); - } - - /** - * @typedef {object} MessageSearchOptions - * @property {Array} [authors] An array of author to filter by - * @property {Array} [mentions] An array of user (mentioned) to filter by - * @property {string} [content] A messageContent to filter by - * @property {Snowflake} [maxId] The maximum Message ID to filter by - * @property {Snowflake} [minId] The minimum Message ID to filter by - * @property {Array} [channels] An array of channel to filter by - * @property {boolean} [pinned] Whether to filter by pinned messages - * @property {Array} [has] Message has: `link`, `embed`, `file`, `video`, `image`, or `sound` - * @property {boolean} [nsfw=false] Whether to filter by NSFW channels - * @property {number} [offset=0] The number of messages to skip (for pagination, 25 results per page) - * @property {number} [limit=25] The number of messages to fetch - * The maximum limit allowed is 25. - * @property {string} [sortBy] The order to sort by (`timestamp` or `relevance`) - * @property {string} [sortOrder] The order to return results in (`asc` or `desc`) - * The default sort is timestamp in descending order desc (newest first). - */ - - /** - * @typedef {object} MessageSearchResult - * @property {Collection} messages A collection of found messages - * @property {number} total The total number of messages that match the search criteria - */ - - /** - * Search Messages in the channel. - * @param {MessageSearchOptions} options Performs a search within the channel. - * @returns {MessageSearchResult} - */ - async search(options = {}) { - // eslint-disable-next-line no-unused-vars - let { - authors, - content, - mentions, - has, - maxId, - minId, - channels, - pinned, - nsfw, - offset, - limit, - sortBy, - sortOrder, - } = Object.assign( - { - authors: [], - content: '', - mentions: [], - has: [], - maxId: null, - minId: null, - channels: [], - pinned: false, - nsfw: false, - offset: 0, - limit: 25, - sortBy: 'timestamp', - sortOrder: 'desc', - }, - options, - ); - // Validate - if (authors.length > 0) - authors = authors.map((u) => this.client.users.resolveId(u)); - if (mentions.length > 0) - mentions = mentions.map((u) => this.client.users.resolveId(u)); - if (channels.length > 0) { - channels = channels - .map((c) => this.client.channels.resolveId(c)) - .filter((id) => { - if (this.channel.guildId) { - const c = this.channel.guild.channels.cache.get(id); - if (!c || !c.messages) return false; - const perm = c.permissionsFor(this.client.user); - if (!perm.has('READ_MESSAGE_HISTORY') || !perm.has('VIEW_CHANNEL')) - return false; - return true; - } else { - return true; - } - }); - } - if (limit && limit > 25) throw new RangeError('MESSAGE_SEARCH_LIMIT'); - let stringQuery = []; - const result = new Collection(); - let data; - if (authors.length > 0) - stringQuery.push(authors.map((id) => `author_id=${id}`).join('&')); - if (content && content.length) - stringQuery.push(`content=${encodeURIComponent(content)}`); - if (mentions.length > 0) - stringQuery.push(mentions.map((id) => `mentions=${id}`).join('&')); - has = has.filter((v) => - ['link', 'embed', 'file', 'video', 'image', 'sound', 'sticker'].includes( - v, - ), - ); - if (has.length > 0) stringQuery.push(has.map((v) => `has=${v}`).join('&')); - if (maxId) stringQuery.push(`max_id=${maxId}`); - if (minId) stringQuery.push(`min_id=${minId}`); - if (nsfw) stringQuery.push('include_nsfw=true'); - if (offset !== 0) stringQuery.push(`offset=${offset}`); - if (limit !== 25) stringQuery.push(`limit=${limit}`); - if (['timestamp', 'relevance'].includes(options.sortBy)) { - stringQuery.push(`sort_by=${options.sortBy}`); - } else { - stringQuery.push('sort_by=timestamp'); - } - if (['asc', 'desc'].includes(options.sortOrder)) { - stringQuery.push(`sort_order=${options.sortOrder}`); - } else { - stringQuery.push('sort_order=desc'); - } - if (this.channel.guildId && channels.length > 0) { - stringQuery.push(channels.map((id) => `channel_id=${id}`).join('&')); - } - if (typeof pinned == 'boolean') stringQuery.push(`pinned=${pinned}`); - // Main - if (!stringQuery.length) { - return { - messages: result, - total: 0, - }; - } - if (this.channel.guildId) { - data = - await this.client.api.guilds[this.channel.guildId].messages[ - `search?${stringQuery.join('&')}` - ].get(); - } else { - stringQuery = stringQuery.filter( - (v) => !v.startsWith('channel_id') && !v.startsWith('include_nsfw'), - ); - data = - await this.client.api.channels[this.channel.id].messages[ - `search?${stringQuery.join('&')}` - ].get(); - } - - for await (const message of data.messages) - result.set(message[0].id, new Message(this.client, message[0])); - return { - messages: result, - total: data.total_results, - }; - } - - async _fetchMany(options = {}, cache) { - const data = await this.client.api.channels[this.channel.id].messages.get({ - query: options, - }); - const messages = new Collection(); - for (const message of data) - messages.set(message.id, this._add(message, cache)); - return messages; - } - - /** - * Ends a poll. - * @param {Snowflake} messageId The id of the message - * @returns {Promise} - */ - async endPoll(messageId) { - const message = await this.client.api - .channels(this.channel.id) - .polls(messageId) - .expire.post(); - return this._add(message, false); - } - - /** - * Options used for fetching voters of an answer in a poll. - * @typedef {BaseFetchPollAnswerVotersOptions} FetchPollAnswerVotersOptions - * @param {Snowflake} messageId The id of the message - * @param {number} answerId The id of the answer - */ - - /** - * Fetches the users that voted for a poll answer. - * @param {FetchPollAnswerVotersOptions} options The options for fetching the poll answer voters - * @returns {Promise>} - */ - async fetchPollAnswerVoters({ messageId, answerId, after, limit }) { - const voters = await this.client - .channels(this.channel.id) - .polls(messageId) - .answers(answerId) - .get({ - query: { limit, after }, - }); - - return voters.users.reduce( - (acc, user) => acc.set(user.id, this.client.users._add(user, false)), - new Collection(), - ); - } -} - -module.exports = MessageManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/PermissionOverwriteManager.js b/vendor/discord.js-selfbot-v13/src/managers/PermissionOverwriteManager.js deleted file mode 100644 index 8c74a38..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/PermissionOverwriteManager.js +++ /dev/null @@ -1,187 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const { Collection } = require('@discordjs/collection'); -const CachedManager = require('./CachedManager'); -const { TypeError } = require('../errors'); -const PermissionOverwrites = require('../structures/PermissionOverwrites'); -const { Role } = require('../structures/Role'); -const { OverwriteTypes } = require('../util/Constants'); - -let cacheWarningEmitted = false; - -/** - * Manages API methods for guild channel permission overwrites and stores their cache. - * @extends {CachedManager} - */ -class PermissionOverwriteManager extends CachedManager { - constructor(channel, iterable) { - super(channel.client, PermissionOverwrites); - if (!cacheWarningEmitted && this._cache.constructor.name !== 'Collection') { - cacheWarningEmitted = true; - process.emitWarning( - `Overriding the cache handling for ${this.constructor.name} is unsupported and breaks functionality.`, - 'UnsupportedCacheOverwriteWarning', - ); - } - - /** - * The channel of the permission overwrite this manager belongs to - * @type {GuildChannel} - */ - this.channel = channel; - - if (iterable) { - for (const item of iterable) { - this._add(item); - } - } - } - - /** - * The cache of this Manager - * @type {Collection} - * @name PermissionOverwriteManager#cache - */ - - _add(data, cache) { - return super._add(data, cache, { extras: [this.channel] }); - } - - /** - * Replaces the permission overwrites in this channel. - * @param {OverwriteResolvable[]|Collection} overwrites - * Permission overwrites the channel gets updated with - * @param {string} [reason] Reason for updating the channel overwrites - * @returns {Promise} - * @example - * message.channel.permissionOverwrites.set([ - * { - * id: message.author.id, - * deny: [Permissions.FLAGS.VIEW_CHANNEL], - * }, - * ], 'Needed to change permissions'); - */ - async set(overwrites, reason) { - if (!Array.isArray(overwrites) && !(overwrites instanceof Collection)) { - throw new TypeError( - 'INVALID_TYPE', - 'overwrites', - 'Array or Collection of Permission Overwrites', - true, - ); - } - return this.channel.edit({ permissionOverwrites: overwrites, reason }); - } - - /** - * Extra information about the overwrite - * @typedef {Object} GuildChannelOverwriteOptions - * @property {string} [reason] Reason for creating/editing this overwrite - * @property {number} [type] The type of overwrite, either `0` for a role or `1` for a member. Use this to bypass - * automatic resolution of type that results in an error for uncached structure - */ - - /** - * Creates or edits permission overwrites for a user or role in this channel. - * @param {RoleResolvable|UserResolvable} userOrRole The user or role to update - * @param {PermissionOverwriteOptions} options The options for the update - * @param {GuildChannelOverwriteOptions} [overwriteOptions] The extra information for the update - * @param {PermissionOverwrites} [existing] The existing overwrites to merge with this update - * @returns {Promise} - * @private - */ - async upsert(userOrRole, options, overwriteOptions = {}, existing) { - let userOrRoleId = - this.channel.guild.roles.resolveId(userOrRole) ?? - this.client.users.resolveId(userOrRole); - let { type, reason } = overwriteOptions; - if (typeof type !== 'number') { - userOrRole = - this.channel.guild.roles.resolve(userOrRole) ?? - this.client.users.resolve(userOrRole); - if (!userOrRole) - throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role'); - type = - userOrRole instanceof Role - ? OverwriteTypes.role - : OverwriteTypes.member; - } - - const { allow, deny } = PermissionOverwrites.resolveOverwriteOptions( - options, - existing, - ); - - await this.client.api - .channels(this.channel.id) - .permissions(userOrRoleId) - .put({ - data: { id: userOrRoleId, type, allow, deny }, - reason, - }); - return this.channel; - } - - /** - * Creates permission overwrites for a user or role in this channel, or replaces them if already present. - * @param {RoleResolvable|UserResolvable} userOrRole The user or role to update - * @param {PermissionOverwriteOptions} options The options for the update - * @param {GuildChannelOverwriteOptions} [overwriteOptions] The extra information for the update - * @returns {Promise} - * @example - * // Create or Replace permission overwrites for a message author - * message.channel.permissionOverwrites.create(message.author, { - * SEND_MESSAGES: false - * }) - * .then(channel => console.log(channel.permissionOverwrites.cache.get(message.author.id))) - * .catch(console.error); - */ - create(userOrRole, options, overwriteOptions) { - return this.upsert(userOrRole, options, overwriteOptions); - } - - /** - * Edits permission overwrites for a user or role in this channel, or creates an entry if not already present. - * @param {RoleResolvable|UserResolvable} userOrRole The user or role to update - * @param {PermissionOverwriteOptions} options The options for the update - * @param {GuildChannelOverwriteOptions} [overwriteOptions] The extra information for the update - * @returns {Promise} - * @example - * // Edit or Create permission overwrites for a message author - * message.channel.permissionOverwrites.edit(message.author, { - * SEND_MESSAGES: false - * }) - * .then(channel => console.log(channel.permissionOverwrites.cache.get(message.author.id))) - * .catch(console.error); - */ - edit(userOrRole, options, overwriteOptions) { - const existing = this.cache.get( - this.channel.guild.roles.resolveId(userOrRole) ?? - this.client.users.resolveId(userOrRole), - ); - return this.upsert(userOrRole, options, overwriteOptions, existing); - } - - /** - * Deletes permission overwrites for a user or role in this channel. - * @param {UserResolvable|RoleResolvable} userOrRole The user or role to delete - * @param {string} [reason] The reason for deleting the overwrite - * @returns {Promise} - */ - async delete(userOrRole, reason) { - const userOrRoleId = - this.channel.guild.roles.resolveId(userOrRole) ?? - this.client.users.resolveId(userOrRole); - if (!userOrRoleId) - throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role'); - - await this.client.api - .channels(this.channel.id) - .permissions(userOrRoleId) - .delete({ reason }); - return this.channel; - } -} - -module.exports = PermissionOverwriteManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/PresenceManager.js b/vendor/discord.js-selfbot-v13/src/managers/PresenceManager.js deleted file mode 100644 index 014b906..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/PresenceManager.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict'; - -const CachedManager = require('./CachedManager'); -const { Presence } = require('../structures/Presence'); - -/** - * Manages API methods for Presences and holds their cache. - * @extends {CachedManager} - */ -class PresenceManager extends CachedManager { - constructor(client, iterable) { - super(client, Presence, iterable); - } - - /** - * The cache of Presences - * @type {Collection} - * @name PresenceManager#cache - */ - - _add(data, cache) { - return super._add(data, cache, { id: data.user.id }); - } - - /** - * Data that can be resolved to a Presence object. This can be: - * * A Presence - * * A UserResolvable - * * A Snowflake - * @typedef {Presence|UserResolvable|Snowflake} PresenceResolvable - */ - - /** - * Resolves a {@link PresenceResolvable} to a {@link Presence} object. - * @param {PresenceResolvable} presence The presence resolvable to resolve - * @returns {?Presence} - */ - resolve(presence) { - const presenceResolvable = super.resolve(presence); - if (presenceResolvable) return presenceResolvable; - const userId = this.client.users.resolveId(presence); - return this.cache.get(userId) ?? null; - } - - /** - * Resolves a {@link PresenceResolvable} to a {@link Presence} id. - * @param {PresenceResolvable} presence The presence resolvable to resolve - * @returns {?Snowflake} - */ - resolveId(presence) { - const presenceResolvable = super.resolveId(presence); - if (presenceResolvable) return presenceResolvable; - const userId = this.client.users.resolveId(presence); - return this.cache.has(userId) ? userId : null; - } - - /** - * Fetches the overall user presence for all of the user's non-offline friends and implicit relationships. - * @returns {Promise>} - */ - async fetch() { - const data = await this.client.api.presences.get(); - // https://docs.discord.food/resources/presence#endpoints - data.presences.forEach((presence) => { - this._add(presence, true); - }); - return this.cache; - } -} - -module.exports = PresenceManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/ReactionManager.js b/vendor/discord.js-selfbot-v13/src/managers/ReactionManager.js deleted file mode 100644 index fdf74c7..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/ReactionManager.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; - -const CachedManager = require('./CachedManager'); -const MessageReaction = require('../structures/MessageReaction'); - -/** - * Manages API methods for reactions and holds their cache. - * @extends {CachedManager} - */ -class ReactionManager extends CachedManager { - constructor(message, iterable) { - super(message.client, MessageReaction, iterable); - - /** - * The message that this manager belongs to - * @type {Message} - */ - this.message = message; - } - - _add(data, cache) { - return super._add(data, cache, { - id: data.emoji.id ?? data.emoji.name, - extras: [this.message], - }); - } - - /** - * The reaction cache of this manager - * @type {Collection} - * @name ReactionManager#cache - */ - - /** - * Data that can be resolved to a MessageReaction object. This can be: - * * A MessageReaction - * * A Snowflake - * * The Unicode representation of an emoji - * @typedef {MessageReaction|Snowflake} MessageReactionResolvable - */ - - /** - * Resolves a {@link MessageReactionResolvable} to a {@link MessageReaction} object. - * @method resolve - * @memberof ReactionManager - * @instance - * @param {MessageReactionResolvable} reaction The MessageReaction to resolve - * @returns {?MessageReaction} - */ - - /** - * Resolves a {@link MessageReactionResolvable} to a {@link MessageReaction} id. - * @method resolveId - * @memberof ReactionManager - * @instance - * @param {MessageReactionResolvable} reaction The MessageReaction to resolve - * @returns {?Snowflake} - */ - - /** - * Removes all reactions from a message. - * @returns {Promise} - */ - async removeAll() { - await this.client.api - .channels(this.message.channelId) - .messages(this.message.id) - .reactions.delete(); - return this.message; - } -} - -module.exports = ReactionManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/ReactionUserManager.js b/vendor/discord.js-selfbot-v13/src/managers/ReactionUserManager.js deleted file mode 100644 index 3073237..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/ReactionUserManager.js +++ /dev/null @@ -1,81 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const CachedManager = require('./CachedManager'); -const { Error } = require('../errors'); -const User = require('../structures/User'); -const { ReactionTypes } = require('../util/Constants'); - -/** - * Manages API methods for users who reacted to a reaction and stores their cache. - * @extends {CachedManager} - */ -class ReactionUserManager extends CachedManager { - constructor(reaction, iterable) { - super(reaction.client, User, iterable); - - /** - * The reaction that this manager belongs to - * @type {MessageReaction} - */ - this.reaction = reaction; - } - - /** - * The cache of this manager - * @type {Collection} - * @name ReactionUserManager#cache - */ - - /** - * Options used to fetch users who gave a reaction. - * @typedef {Object} FetchReactionUsersOptions - * @property {ReactionType} [type='NORMAL'] The reaction type to fetch - * @property {number} [limit=100] The maximum amount of users to fetch, defaults to `100` - * @property {Snowflake} [after] Limit fetching users to those with an id greater than the supplied id - */ - - /** - * Fetches all the users that gave this reaction. Resolves with a collection of users, mapped by their ids. - * @param {FetchReactionUsersOptions} [options] Options for fetching the users - * @returns {Promise>} - */ - async fetch({ limit = 100, after, type = 'NORMAL' } = {}) { - const message = this.reaction.message; - const data = await this.client.api.channels[message.channelId].messages[ - message.id - ].reactions[this.reaction.emoji.identifier].get({ - query: { - limit, - after, - type: typeof type == 'number' ? type : ReactionTypes[type], - }, - }); - const users = new Collection(); - for (const rawUser of data) { - const user = this.client.users._add(rawUser); - this.cache.set(user.id, user); - users.set(user.id, user); - } - return users; - } - - /** - * Removes a user from this reaction. - * @param {UserResolvable} [user=this.client.user] The user to remove the reaction of - * @returns {Promise} - */ - async remove(user = this.client.user) { - const userId = this.client.users.resolveId(user); - if (!userId) throw new Error('REACTION_RESOLVE_USER'); - const message = this.reaction.message; - await this.client.api.channels[message.channelId].messages[ - message.id - ].reactions[this.reaction.emoji.identifier][ - userId === this.client.user.id ? '@me' : userId - ].delete(); - return this.reaction; - } -} - -module.exports = ReactionUserManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/RelationshipManager.js b/vendor/discord.js-selfbot-v13/src/managers/RelationshipManager.js deleted file mode 100644 index 5cc3d38..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/RelationshipManager.js +++ /dev/null @@ -1,284 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const BaseManager = require('./BaseManager'); -const { GuildMember } = require('../structures/GuildMember'); -const { Message } = require('../structures/Message'); -const ThreadMember = require('../structures/ThreadMember'); -const User = require('../structures/User'); -const { RelationshipTypes } = require('../util/Constants'); - -/** - * Manages API methods for Relationships and stores their cache. - */ -class RelationshipManager extends BaseManager { - constructor(client, users) { - super(client); - /** - * A collection of users this manager is caching. (Type: Number) - * @type {Collection} - */ - this.cache = new Collection(); - /** - * @type {Collection} - */ - this.friendNicknames = new Collection(); - /** - * @type {Collection} - */ - this.sinceCache = new Collection(); - this._setup(users); - } - - /** - * Get all friends - * @type {Collection} - * @readonly - */ - get friendCache() { - const users = this.cache - .filter((value) => value === RelationshipTypes.FRIEND) - .map((_, key) => [key, this.client.users.cache.get(key)]); - return new Collection(users); - } - - /** - * Get all blocked users - * @type {Collection} - * @readonly - */ - get blockedCache() { - const users = this.cache - .filter((value) => value === RelationshipTypes.BLOCKED) - .map((_, key) => [key, this.client.users.cache.get(key)]); - return new Collection(users); - } - - /** - * Get all incoming friend requests - * @type {Collection} - * @readonly - */ - get incomingCache() { - const users = this.cache - .filter((value) => value === RelationshipTypes.PENDING_INCOMING) - .map((_, key) => [key, this.client.users.cache.get(key)]); - return new Collection(users); - } - - /** - * Get all outgoing friend requests - * @type {Collection} - * @readonly - */ - get outgoingCache() { - const users = this.cache - .filter((value) => value === RelationshipTypes.PENDING_OUTGOING) - .map((_, key) => [key, this.client.users.cache.get(key)]); - return new Collection(users); - } - - /** - * @typedef {Object} RelationshipJSONData - * @property {Snowflake} id The ID of the target user - * @property {RelationshipType} type The type of relationship - * @property {string | null} nickname The nickname of the user in this relationship (1-32 characters) - * @property {string} since When the user requested a relationship (ISO8601 timestamp) - */ - - /** - * Return array of cache - * @returns {RelationshipJSONData[]} - */ - toJSON() { - return this.cache.map((value, key) => ({ - id: key, - type: RelationshipTypes[value], - nickname: this.friendNicknames.get(key), - since: this.sinceCache.get(key).toISOString(), - })); - } - - /** - * @private - * @param {Array} users An array of users to add to the cache - * @returns {void} - */ - _setup(users) { - if (!Array.isArray(users)) return; - for (const relationShip of users) { - this.friendNicknames.set(relationShip.id, relationShip.nickname); - this.cache.set(relationShip.id, relationShip.type); - this.sinceCache.set(relationShip.id, new Date(relationShip.since || 0)); - } - } - - /** - * Resolves a {@link UserResolvable} to a {@link User} id. - * @param {UserResolvable} user The UserResolvable to identify - * @returns {?Snowflake} - */ - resolveId(user) { - if (user instanceof ThreadMember) return user.id; - if (user instanceof GuildMember) return user.user.id; - if (user instanceof Message) return user.author.id; - if (user instanceof User) return user.id; - return user.match(/\d{17,19}/)?.[0] || null; - } - - /** - * Resolves a {@link UserResolvable} to a {@link User} username. - * @param {UserResolvable} user The UserResolvable to identify - * @returns {?string} - */ - resolveUsername(user) { - if (user instanceof ThreadMember) return user.member.user.username; - if (user instanceof GuildMember) return user.user.username; - if (user instanceof Message) return user.author.username; - if (user instanceof User) return user.username; - return user; - } - - /** - * Obtains a user from Discord, or the user cache if it's already available. - * @param {UserResolvable} [user] The user to fetch - * @param {BaseFetchOptions} [options] Additional options for this fetch - * @returns {Promise} - */ - async fetch(user, { force = false } = {}) { - if (user) { - const id = this.resolveId(user); - if (!force) { - const existing = this.cache.get(id); - if (existing && !existing.partial) return existing; - } - const data = await this.client.api.users['@me'].relationships.get(); - await this._setup(data); - return this.cache.get(id); - } else { - const data = await this.client.api.users['@me'].relationships.get(); - await this._setup(data); - return this; - } - } - - /** - * Deletes a friend / blocked relationship with a client user or cancels a friend request. - * @param {UserResolvable} user Target - * @returns {Promise} - */ - async deleteRelationship(user) { - throw new Error('Risky action, not finished yet.'); - // eslint-disable-next-line no-unreachable - const id = this.resolveId(user); - if ( - ![ - RelationshipTypes.FRIEND, - RelationshipTypes.BLOCKED, - RelationshipTypes.PENDING_OUTGOING, - ].includes(this.cache.get(id)) - ) { - return Promise.resolve(false); - } - await this.client.api.users['@me'].relationships[id].delete({ - DiscordContext: { location: 'ContextMenu' }, - }); - return true; - } - - /** - * Sends a friend request. - * @param {UserResolvable} options Target (User Object, Username, User Id) - * @returns {Promise} - */ - async sendFriendRequest(options) { - throw new Error('Risky action, not finished yet.'); - // eslint-disable-next-line no-unreachable - const id = this.resolveId(options); - if (id) { - await this.client.api.users['@me'].relationships[id].put({ - data: {}, - DiscordContext: { location: 'ContextMenu' }, - }); - } else { - const username = this.resolveUsername(options); - await this.client.api.users['@me'].relationships.post({ - versioned: true, - data: { - username, - discriminator: null, - }, - DiscordContext: { location: 'Add Friend' }, - }); - } - return true; - } - - /** - * Accepts a friend request. - * @param {UserResolvable} user The user to add as a friend - * @returns {Promise} - */ - async addFriend(user) { - throw new Error('Risky action, not finished yet.'); - // eslint-disable-next-line no-unreachable - const id = this.resolveId(user); - // Check if already friends - if (this.cache.get(id) === RelationshipTypes.FRIEND) - return Promise.resolve(false); - // Check if outgoing request - if (this.cache.get(id) === RelationshipTypes.PENDING_OUTGOING) - return Promise.resolve(false); - await this.client.api.users['@me'].relationships[id].put({ - data: { confirm_stranger_request: true }, - DiscordContext: { location: 'Friends' }, - }); - return true; - } - - /** - * Changes the nickname of a friend. - * @param {UserResolvable} user The user to change the nickname - * @param {?string} nickname New nickname - * @returns {Promise} - */ - async setNickname(user, nickname = null) { - const id = this.resolveId(user); - if (this.cache.get(id) !== RelationshipTypes.FRIEND) - return Promise.resolve(false); - await this.client.api.users['@me'].relationships[id].patch({ - data: { - nickname: typeof nickname === 'string' ? nickname : null, - }, - }); - if (nickname) { - this.friendNicknames.set(id, nickname); - } else { - this.friendNicknames.delete(id); - } - return true; - } - - /** - * Blocks a user. - * @param {UserResolvable} user User to block - * @returns {Promise} - */ - async addBlocked(user) { - throw new Error('Risky action, not finished yet.'); - // eslint-disable-next-line no-unreachable - const id = this.resolveId(user); - // Check - if (this.cache.get(id) === RelationshipTypes.BLOCKED) - return Promise.resolve(false); - await this.client.api.users['@me'].relationships[id].put({ - data: { - type: RelationshipTypes.BLOCKED, - }, - DiscordContext: { location: 'ContextMenu' }, - }); - return true; - } -} - -module.exports = RelationshipManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/RoleManager.js b/vendor/discord.js-selfbot-v13/src/managers/RoleManager.js deleted file mode 100644 index ceb7df1..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/RoleManager.js +++ /dev/null @@ -1,484 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const { Collection } = require('@discordjs/collection'); -const CachedManager = require('./CachedManager'); -const { TypeError } = require('../errors'); -const { Role } = require('../structures/Role'); -const DataResolver = require('../util/DataResolver'); -const Permissions = require('../util/Permissions'); -const { resolveColor } = require('../util/Util'); -const Util = require('../util/Util'); - -let cacheWarningEmitted = false; -let deprecationEmittedForCreate = false; -let deprecationEmittedForEdit = false; - -/** - * Manages API methods for roles and stores their cache. - * @extends {CachedManager} - */ -class RoleManager extends CachedManager { - constructor(guild, iterable) { - super(guild.client, Role, iterable); - if (!cacheWarningEmitted && this._cache.constructor.name !== 'Collection') { - cacheWarningEmitted = true; - process.emitWarning( - `Overriding the cache handling for ${this.constructor.name} is unsupported and breaks functionality.`, - 'UnsupportedCacheOverwriteWarning', - ); - } - - /** - * The guild belonging to this manager - * @type {Guild} - */ - this.guild = guild; - } - - /** - * The role cache of this manager - * @type {Collection} - * @name RoleManager#cache - */ - - _add(data, cache) { - return super._add(data, cache, { extras: [this.guild] }); - } - - /** - * Obtains a role from Discord, or the role cache if they're already available. - * @param {Snowflake} [id] The role's id - * @param {BaseFetchOptions} [options] Additional options for this fetch - * @returns {Promise>} - * @example - * // Fetch all roles from the guild - * message.guild.roles.fetch() - * .then(roles => console.log(`There are ${roles.size} roles.`)) - * .catch(console.error); - * @example - * // Fetch a single role - * message.guild.roles.fetch('222078108977594368') - * .then(role => console.log(`The role color is: ${role.colors.primaryColor}`)) - * .catch(console.error); - */ - async fetch(id, { cache = true, force = false } = {}) { - if (id && !force) { - const existing = this.cache.get(id); - if (existing) return existing; - } - - // We cannot fetch a single role, as of this commit's date, Discord API throws with 405 - const data = await this.client.api.guilds(this.guild.id).roles.get(); - const roles = new Collection(); - for (const role of data) roles.set(role.id, this._add(role, cache)); - return id ? (roles.get(id) ?? null) : roles; - } - - /** - * Fetches the member counts for each role in the guild. - * @returns {Promise>} - */ - async fetchMemberCounts() { - const data = await this.client.api - .guilds(this.guild.id) - .roles('member-counts') - .get(); - - return data; - } - - /** - * Fetches the member ids for a role in the guild. - * This only returns 100 member ids - * @param {RoleResolvable} role The role to fetch member ids for - * @returns {Promise} - */ - async fetchMemberIds(role) { - const id = this.resolveId(role); - if (!id) throw new TypeError('INVALID_TYPE', 'role', 'RoleResolvable'); - - const data = await this.client.api - .guilds(this.guild.id) - .roles(id, 'member-ids') - .get(); - - return data; - } - - /** - * Data that can be resolved to a Role object. This can be: - * * A Role - * * A Snowflake - * @typedef {Role|Snowflake} RoleResolvable - */ - - /** - * Resolves a {@link RoleResolvable} to a {@link Role} object. - * @method resolve - * @memberof RoleManager - * @instance - * @param {RoleResolvable} role The role resolvable to resolve - * @returns {?Role} - */ - - /** - * Resolves a {@link RoleResolvable} to a {@link Role} id. - * @method resolveId - * @memberof RoleManager - * @instance - * @param {RoleResolvable} role The role resolvable to resolve - * @returns {?Snowflake} - */ - - /** - * @typedef {Object} RoleColorsResolvable - * @property {ColorResolvable} primaryColor The primary color of the role - * @property {ColorResolvable} [secondaryColor] The secondary color of the role. - * This will make the role a gradient between the other provided colors - * @property {ColorResolvable} [tertiaryColor] The tertiary color of the role. - * When sending `tertiaryColor` the API enforces the role color to be a holographic style - * with values of `primaryColor = 11127295`, `secondaryColor = 16759788`, and `tertiaryColor = 16761760`. - * These values are available as a constant: `Constants.HolographicStyle` - */ - - /** - * Options used to create a new role. - * @typedef {Object} CreateRoleOptions - * @property {string} [name] The name of the new role - * @property {ColorResolvable} [color] The data to create the role with - * This property is deprecated. Use `colors` instead. - * @property {RoleColorsResolvable} [colors] The colors to create the role with - * @property {boolean} [hoist] Whether or not the new role should be hoisted - * @property {PermissionResolvable} [permissions] The permissions for the new role - * @property {number} [position] The position of the new role - * @property {boolean} [mentionable] Whether or not the new role should be mentionable - * @property {?(BufferResolvable|Base64Resolvable|EmojiResolvable)} [icon] The icon for the role - * The `EmojiResolvable` should belong to the same guild as the role. - * If not, pass the emoji's URL directly - * @property {?string} [unicodeEmoji] The unicode emoji for the role - * @property {string} [reason] The reason for creating this role - */ - - /** - * Creates a new role in the guild with given information. - * The position will silently reset to 1 if an invalid one is provided, or none. - * @param {CreateRoleOptions} [options] Options for creating the new role - * @returns {Promise} - * @example - * // Create a new role - * guild.roles.create() - * .then(console.log) - * .catch(console.error); - * @example - * // Create a new role with data and a reason - * guild.roles.create({ - * name: 'Super Cool Blue People', - * colors: { - * primaryColor: 'BLUE', - * }, - * reason: 'we needed a role for Super Cool People', - * }) - * .then(console.log) - * .catch(console.error); - * @example - * // Create a role with holographic colors - * guild.roles.create({ - * name: 'Holographic Role', - * reason: 'Creating a role with holographic effect', - * colors: { - * primaryColor: Constants.HolographicStyles.PRIMARY, - * secondaryColor: Constants.HolographicStyles.SECONDARY, - * tertiaryColor: Constants.HolographicStyles.TERTIARY, - * }, - * }) - * .then(console.log) - * .catch(console.error); - */ - async create(options = {}) { - let { permissions, icon } = options; - const { name, color, hoist, position, mentionable, reason, unicodeEmoji } = - options; - - if (typeof permissions !== 'undefined') - permissions = new Permissions(permissions); - if (icon) { - const guildEmojiURL = this.guild.emojis.resolve(icon)?.url; - icon = guildEmojiURL - ? await DataResolver.resolveImage(guildEmojiURL) - : await DataResolver.resolveImage(icon); - if (typeof icon !== 'string') icon = undefined; - } - - let colors = options.colors && { - primary_color: resolveColor(options.colors.primaryColor), - secondary_color: - options.colors.secondaryColor && - resolveColor(options.colors.secondaryColor), - tertiary_color: - options.colors.tertiaryColor && - resolveColor(options.colors.tertiaryColor), - }; - - if (color !== undefined) { - if (!deprecationEmittedForCreate) { - process.emitWarning( - `Passing "color" to RoleManager#create() is deprecated. Use "colors" instead.`, - ); - } - - deprecationEmittedForCreate = true; - - colors = { - primary_color: resolveColor(color), - secondary_color: null, - tertiary_color: null, - }; - } - - const data = await this.client.api.guilds(this.guild.id).roles.post({ - data: { - name, - colors, - hoist, - permissions, - mentionable, - icon, - unicode_emoji: unicodeEmoji, - }, - reason, - }); - const { role } = this.client.actions.GuildRoleCreate.handle({ - guild_id: this.guild.id, - role: data, - }); - if (position) return this.setPosition(role, position, { reason }); - return role; - } - - /** - * Edits a role of the guild. - * @param {RoleResolvable} role The role to edit - * @param {RoleData} data The new data for the role - * @param {string} [reason] Reason for editing this role - * @returns {Promise} - * @example - * // Edit a role - * guild.roles.edit('222079219327434752', { name: 'buddies' }) - * .then(updated => console.log(`Edited role name to ${updated.name}`)) - * .catch(console.error); - */ - async edit(role, data, reason) { - role = this.resolve(role); - if (!role) throw new TypeError('INVALID_TYPE', 'role', 'RoleResolvable'); - - if (typeof data.position === 'number') - await this.setPosition(role, data.position, { reason }); - - let icon = data.icon; - if (icon) { - const guildEmojiURL = this.guild.emojis.resolve(icon)?.url; - icon = guildEmojiURL - ? await DataResolver.resolveImage(guildEmojiURL) - : await DataResolver.resolveImage(icon); - if (typeof icon !== 'string') icon = undefined; - } - - let colors = data.colors && { - primary_color: resolveColor(data.colors.primaryColor), - secondary_color: - data.colors.secondaryColor && resolveColor(data.colors.secondaryColor), - tertiary_color: - data.colors.tertiaryColor && resolveColor(data.colors.tertiaryColor), - }; - - if (data.color !== undefined) { - if (!deprecationEmittedForEdit) { - process.emitWarning( - `Passing "color" to RoleManager#edit() is deprecated. Use "colors" instead.`, - ); - } - - deprecationEmittedForEdit = true; - - colors = { - primary_color: resolveColor(data.color), - secondary_color: null, - tertiary_color: null, - }; - } - - const _data = { - name: data.name, - colors, - hoist: data.hoist, - permissions: - typeof data.permissions === 'undefined' - ? undefined - : new Permissions(data.permissions), - mentionable: data.mentionable, - icon, - unicode_emoji: data.unicodeEmoji, - }; - - const d = await this.client.api - .guilds(this.guild.id) - .roles(role.id) - .patch({ data: _data, reason }); - - const clone = role._clone(); - clone._patch(d); - return clone; - } - - /** - * Deletes a role. - * @param {RoleResolvable} role The role to delete - * @param {string} [reason] Reason for deleting the role - * @returns {Promise} - * @example - * // Delete a role - * guild.roles.delete('222079219327434752', 'The role needed to go') - * .then(() => console.log('Deleted the role.')) - * .catch(console.error); - */ - async delete(role, reason) { - const id = this.resolveId(role); - await this.client.api.guilds[this.guild.id].roles[id].delete({ reason }); - this.client.actions.GuildRoleDelete.handle({ - guild_id: this.guild.id, - role_id: id, - }); - } - - /** - * Sets the new position of the role. - * @param {RoleResolvable} role The role to change the position of - * @param {number} position The new position for the role - * @param {SetRolePositionOptions} [options] Options for setting the position - * @returns {Promise} - * @example - * // Set the position of the role - * guild.roles.setPosition('222197033908436994', 1) - * .then(updated => console.log(`Role position: ${updated.position}`)) - * .catch(console.error); - */ - async setPosition(role, position, { relative, reason } = {}) { - role = this.resolve(role); - if (!role) throw new TypeError('INVALID_TYPE', 'role', 'RoleResolvable'); - const updatedRoles = await Util.setPosition( - role, - position, - relative, - this.guild._sortedRoles(), - this.client.api.guilds(this.guild.id).roles, - reason, - ); - - this.client.actions.GuildRolesPositionUpdate.handle({ - guild_id: this.guild.id, - roles: updatedRoles, - }); - return role; - } - - /** - * The data needed for updating a guild role's position - * @typedef {Object} GuildRolePosition - * @property {RoleResolvable} role The role's id - * @property {number} position The position to update - */ - - /** - * Batch-updates the guild's role positions - * @param {GuildRolePosition[]} rolePositions Role positions to update - * @returns {Promise} - * @example - * guild.roles.setPositions([{ role: roleId, position: updatedRoleIndex }]) - * .then(guild => console.log(`Role positions updated for ${guild}`)) - * .catch(console.error); - */ - async setPositions(rolePositions) { - // Make sure rolePositions are prepared for API - rolePositions = rolePositions.map((o) => ({ - id: this.resolveId(o.role), - position: o.position, - })); - - // Call the API to update role positions - await this.client.api.guilds(this.guild.id).roles.patch({ - data: rolePositions, - }); - return this.client.actions.GuildRolesPositionUpdate.handle({ - guild_id: this.guild.id, - roles: rolePositions, - }).guild; - } - - /** - * Compares the positions of two roles. - * @param {RoleResolvable} role1 First role to compare - * @param {RoleResolvable} role2 Second role to compare - * @returns {number} Negative number if the first role's position is lower (second role's is higher), - * positive number if the first's is higher (second's is lower), 0 if equal - */ - comparePositions(role1, role2) { - const resolvedRole1 = this.resolve(role1); - const resolvedRole2 = this.resolve(role2); - if (!resolvedRole1 || !resolvedRole2) - throw new TypeError('INVALID_TYPE', 'role', 'Role nor a Snowflake'); - - const role1Position = resolvedRole1.position; - const role2Position = resolvedRole2.position; - - if (role1Position === role2Position) { - return Number(BigInt(resolvedRole2.id) - BigInt(resolvedRole1.id)); - } - - return role1Position - role2Position; - } - - /** - * Gets the managed role a user created when joining the guild, if any - * Only ever available for bots - * @param {UserResolvable} user The user to access the bot role for - * @returns {?Role} - */ - botRoleFor(user) { - const userId = this.client.users.resolveId(user); - if (!userId) return null; - return this.cache.find((role) => role.tags?.botId === userId) ?? null; - } - - /** - * The `@everyone` role of the guild - * @type {Role} - * @readonly - */ - get everyone() { - return this.cache.get(this.guild.id); - } - - /** - * The premium subscriber role of the guild, if any - * @type {?Role} - * @readonly - */ - get premiumSubscriberRole() { - return this.cache.find((role) => role.tags?.premiumSubscriberRole) ?? null; - } - - /** - * The role with the highest position in the cache - * @type {Role} - * @readonly - */ - get highest() { - return this.cache.reduce( - (prev, role) => (role.comparePositionTo(prev) > 0 ? role : prev), - this.cache.first(), - ); - } -} - -module.exports = RoleManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/SessionManager.js b/vendor/discord.js-selfbot-v13/src/managers/SessionManager.js deleted file mode 100644 index d6cf046..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/SessionManager.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict'; - -const CachedManager = require('./CachedManager'); -const Session = require('../structures/Session'); - -/** - * Manages API methods for users and stores their cache. - * @extends {CachedManager} - */ -class SessionManager extends CachedManager { - constructor(client, iterable) { - super(client, Session, iterable); - - /** - * The current session ID hash of the client. - * @type {string} - */ - this.currentSessionIdHash = null; - } - /** - * The cache of Sessions - * @type {Collection} - * @name SessionManager#cache - */ - - /** - * Fetch all sessions of the client. - * @returns {Promise>} - */ - fetch() { - return this.client.api.auth.sessions.get().then((data) => { - const allData = data.user_sessions; - this.cache.clear(); - for (const session of allData) { - this._add(session, true, { id: session.id_hash }); - } - return this.cache; - }); - } - - /** - * Logout all client (remote). - * @returns {Promise} - */ - logoutAllDevices() { - return this.client.api.auth.sessions.logout({ - data: { - session_id_hashes: this.cache.map((session) => session.id), - }, - }); - } - - /** - * Get the current session of the client. - * You must call `fetch()` first to populate the cache. - * @type {?Session} - */ - get currentSession() { - if (!this.currentSessionIdHash) { - return null; - } - return this.cache.get(this.currentSessionIdHash) || null; - } -} - -module.exports = SessionManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/StageInstanceManager.js b/vendor/discord.js-selfbot-v13/src/managers/StageInstanceManager.js deleted file mode 100644 index 897d661..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/StageInstanceManager.js +++ /dev/null @@ -1,174 +0,0 @@ -'use strict'; - -const CachedManager = require('./CachedManager'); -const { TypeError, Error } = require('../errors'); -const { StageInstance } = require('../structures/StageInstance'); -const { PrivacyLevels } = require('../util/Constants'); - -/** - * Manages API methods for {@link StageInstance} objects and holds their cache. - * @extends {CachedManager} - */ -class StageInstanceManager extends CachedManager { - constructor(guild, iterable) { - super(guild.client, StageInstance, iterable); - - /** - * The guild this manager belongs to - * @type {Guild} - */ - this.guild = guild; - } - - /** - * The cache of this Manager - * @type {Collection} - * @name StageInstanceManager#cache - */ - - /** - * Options used to create a stage instance. - * @typedef {Object} StageInstanceCreateOptions - * @property {string} topic The topic of the stage instance - * @property {PrivacyLevel|number} [privacyLevel] The privacy level of the stage instance - * @property {boolean} [sendStartNotification] Whether to notify `@everyone` that the stage instance has started - * @property {GuildScheduledEventResolvable} [guildScheduledEvent] - * The guild scheduled event associated with the stage instance - */ - - /** - * Data that can be resolved to a Stage Channel object. This can be: - * * A StageChannel - * * A Snowflake - * @typedef {StageChannel|Snowflake} StageChannelResolvable - */ - - /** - * Creates a new stage instance. - * @param {StageChannelResolvable} channel The stage channel to associate the created stage instance to - * @param {StageInstanceCreateOptions} options The options to create the stage instance - * @returns {Promise} - * @example - * // Create a stage instance - * guild.stageInstances.create('1234567890123456789', { - * topic: 'A very creative topic', - * privacyLevel: 'GUILD_ONLY' - * }) - * .then(stageInstance => console.log(stageInstance)) - * .catch(console.error); - */ - async create(channel, options) { - const channelId = this.guild.channels.resolveId(channel); - if (!channelId) throw new Error('STAGE_CHANNEL_RESOLVE'); - if (typeof options !== 'object') - throw new TypeError('INVALID_TYPE', 'options', 'object', true); - let { guildScheduledEvent, topic, privacyLevel, sendStartNotification } = - options; - - privacyLevel &&= - typeof privacyLevel === 'number' - ? privacyLevel - : PrivacyLevels[privacyLevel]; - const guildScheduledEventId = - guildScheduledEvent && this.resolveId(guildScheduledEvent); - - const data = await this.client.api['stage-instances'].post({ - data: { - channel_id: channelId, - topic, - privacy_level: privacyLevel, - send_start_notification: sendStartNotification, - guild_scheduled_event_id: guildScheduledEventId, - }, - }); - - return this._add(data); - } - - /** - * Fetches the stage instance associated with a stage channel, if it exists. - * @param {StageChannelResolvable} channel The stage channel whose associated stage instance is to be fetched - * @param {BaseFetchOptions} [options] Additional options for this fetch - * @returns {Promise} - * @example - * // Fetch a stage instance - * guild.stageInstances.fetch('1234567890123456789') - * .then(stageInstance => console.log(stageInstance)) - * .catch(console.error); - */ - async fetch(channel, { cache = true, force = false } = {}) { - const channelId = this.guild.channels.resolveId(channel); - if (!channelId) throw new Error('STAGE_CHANNEL_RESOLVE'); - - if (!force) { - const existing = this.cache.find( - (stageInstance) => stageInstance.channelId === channelId, - ); - if (existing) return existing; - } - - const data = await this.client.api('stage-instances', channelId).get(); - return this._add(data, cache); - } - - /** - * Options used to edit an existing stage instance. - * @typedef {Object} StageInstanceEditOptions - * @property {string} [topic] The new topic of the stage instance - * @property {PrivacyLevel|number} [privacyLevel] The new privacy level of the stage instance - */ - - /** - * Edits an existing stage instance. - * @param {StageChannelResolvable} channel The stage channel whose associated stage instance is to be edited - * @param {StageInstanceEditOptions} options The options to edit the stage instance - * @returns {Promise} - * @example - * // Edit a stage instance - * guild.stageInstances.edit('1234567890123456789', { topic: 'new topic' }) - * .then(stageInstance => console.log(stageInstance)) - * .catch(console.error); - */ - async edit(channel, options) { - if (typeof options !== 'object') - throw new TypeError('INVALID_TYPE', 'options', 'object', true); - const channelId = this.guild.channels.resolveId(channel); - if (!channelId) throw new Error('STAGE_CHANNEL_RESOLVE'); - - let { topic, privacyLevel } = options; - - privacyLevel &&= - typeof privacyLevel === 'number' - ? privacyLevel - : PrivacyLevels[privacyLevel]; - - const data = await this.client.api('stage-instances', channelId).patch({ - data: { - topic, - privacy_level: privacyLevel, - }, - }); - - if (this.cache.has(data.id)) { - const clone = this.cache.get(data.id)._clone(); - clone._patch(data); - return clone; - } - - return this._add(data); - } - - /** - * Deletes an existing stage instance. - * @param {StageChannelResolvable} channel The stage channel whose associated stage instance is to be deleted - * @returns {Promise} - */ - async delete(channel) { - const channelId = this.guild.channels.resolveId(channel); - if (!channelId) throw new Error('STAGE_CHANNEL_RESOLVE'); - - await this.client.api('stage-instances', channelId).delete(); - } -} - -module.exports = StageInstanceManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/ThreadManager.js b/vendor/discord.js-selfbot-v13/src/managers/ThreadManager.js deleted file mode 100644 index 7286c8c..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/ThreadManager.js +++ /dev/null @@ -1,183 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const CachedManager = require('./CachedManager'); -const ThreadChannel = require('../structures/ThreadChannel'); - -/** - * Manages API methods for {@link ThreadChannel} objects and stores their cache. - * @extends {CachedManager} - */ -class ThreadManager extends CachedManager { - constructor(channel, iterable) { - super(channel.client, ThreadChannel, iterable); - - /** - * The channel this Manager belongs to - * @type {NewsChannel|TextChannel} - */ - this.channel = channel; - } - - /** - * The cache of this Manager - * @type {Collection} - * @name ThreadManager#cache - */ - - _add(thread) { - const existing = this.cache.get(thread.id); - if (existing) return existing; - this.cache.set(thread.id, thread); - return thread; - } - - /** - * Data that can be resolved to a Thread Channel object. This can be: - * * A ThreadChannel object - * * A Snowflake - * @typedef {ThreadChannel|Snowflake} ThreadChannelResolvable - */ - - /** - * Resolves a {@link ThreadChannelResolvable} to a {@link ThreadChannel} object. - * @method resolve - * @memberof ThreadManager - * @instance - * @param {ThreadChannelResolvable} thread The ThreadChannel resolvable to resolve - * @returns {?ThreadChannel} - */ - - /** - * Resolves a {@link ThreadChannelResolvable} to a {@link ThreadChannel} id. - * @method resolveId - * @memberof ThreadManager - * @instance - * @param {ThreadChannelResolvable} thread The ThreadChannel resolvable to resolve - * @returns {?Snowflake} - */ - - /** - * Options for fetching multiple threads. - * @typedef {Object} FetchThreadsOptions - * @property {FetchArchivedThreadOptions} [archived] The options used to fetch archived threads - */ - - /** - * Obtains a thread from Discord, or the channel cache if it's already available. - * @param {ThreadChannelResolvable|FetchChannelThreadsOptions|FetchThreadsOptions} [options] The options to fetch threads. If it is a - * ThreadChannelResolvable then the specified thread will be fetched. Fetches all active threads if `undefined` - * @param {BaseFetchOptions} [cacheOptions] Additional options for this fetch. The `force` field gets ignored - * if `options` is not a {@link ThreadChannelResolvable} - * @returns {Promise} - * @example - * // Fetch a thread by its id - * channel.threads.fetch('831955138126104859') - * .then(channel => console.log(channel.name)) - * .catch(console.error); - */ - fetch(options, { cache, force } = {}) { - if (!options) return this.fetchActive(cache); - const channel = this.client.channels.resolveId(options); - if (channel) return this.client.channels.fetch(channel, { cache, force }); - if (options.archived) { - return this.fetchArchived(options.archived, cache); - } - return this.fetchActive(cache); - } - - /** - * Data that can be resolved to a Date object. This can be: - * * A Date object - * * A number representing a timestamp - * * An [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) string - * @typedef {Date|number|string} DateResolvable - */ - - /** - * The options used to fetch archived threads. - * @typedef {Object} FetchArchivedThreadOptions - * @property {string} [type='public'] The type of threads to fetch, either `public` or `private` - * @property {boolean} [fetchAll=false] Whether to fetch **all** archived threads when type is `private`. - * Requires `MANAGE_THREADS` if true - * @property {DateResolvable|ThreadChannelResolvable} [before] Only return threads that were archived before this Date - * or Snowflake. Must be a {@link ThreadChannelResolvable} when type is `private` and fetchAll is `false` - * @property {number} [limit] Maximum number of threads to return - */ - - /** - * The data returned from a thread fetch that returns multiple threads. - * @typedef {Object} FetchedThreads - * @property {Collection} threads The threads that were fetched, with any members returned - * @property {?boolean} hasMore Whether there are potentially additional threads that require a subsequent call - */ - - /** - * Obtains a set of archived threads from Discord, requires `READ_MESSAGE_HISTORY` in the parent channel. - * @param {FetchChannelThreadsOptions} [options] The options to fetch archived threads - * @param {boolean} [cache=true] Whether to cache the new thread objects if they aren't already - * @returns {Promise} - */ - fetchArchived(options = {}, cache = true) { - return this.fetchActive(cache, { archived: true, ...options }); - } - - /** - * Discord.js self-bot specific options field for fetching active threads. - * @typedef {Object} FetchChannelThreadsOptions - * @property {boolean} [archived] Whether to fetch archived threads (default is false) - * @property {string} [sortBy] The order in which the threads should be fetched in (default is last_message_time) - * @property {string} [sortOrder] How the threads should be ordered (default is desc) - * @property {number} [limit] The maximum number of threads to return (default is 25) - * @property {number} [offset] The number of threads to offset fetching (useful when making multiple fetches) (default is 0) - */ - - /** - * Obtains the accessible active threads from Discord, requires `READ_MESSAGE_HISTORY` in the parent channel. - * @param {boolean} [cache=true] Whether to cache the new thread objects if they aren't already - * @param {FetchChannelThreadsOptions} [options] Options for self-bots where advanced users can specify further options - * @returns {Promise} - */ - async fetchActive(cache = true, options = {}) { - const raw = await this.client.api - .channels(this.channel.id) - .threads.search.get({ - query: { - archived: options?.archived ?? false, - limit: options?.limit ?? 25, - offset: options?.offset ?? 0, - sort_by: options?.sortBy ?? 'last_message_time', - sort_order: options?.sortOrder ?? 'desc', - }, - }); - - return this.constructor._mapThreads(raw, this.client, { - parent: this.channel, - cache, - }); - } - - static _mapThreads(rawThreads, client, { parent, guild, cache }) { - const threads = rawThreads.threads.reduce((coll, raw) => { - const thread = client.channels._add(raw, guild ?? parent?.guild, { - cache, - }); - if (parent && thread.parentId !== parent.id) return coll; - return coll.set(thread.id, thread); - }, new Collection()); - // Discord sends the thread id as id in this object - for (const rawMember of rawThreads.members) - client.channels.cache.get(rawMember.id)?.members._add(rawMember); - // Patch firstMessage - // According to https://github.com/aiko-chan-ai/discord.js-selfbot-v13/issues/1502, rawThreads.first_messages could be null. - for (const rawMessage of rawThreads?.first_messages || []) { - client.channels.cache.get(rawMessage.id)?.messages._add(rawMessage); - } - return { - threads, - hasMore: rawThreads.has_more ?? false, - }; - } -} - -module.exports = ThreadManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/ThreadMemberManager.js b/vendor/discord.js-selfbot-v13/src/managers/ThreadMemberManager.js deleted file mode 100644 index 19c06cb..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/ThreadMemberManager.js +++ /dev/null @@ -1,199 +0,0 @@ -'use strict'; -const process = require('node:process'); - -const { Collection } = require('@discordjs/collection'); -const CachedManager = require('./CachedManager'); -const { TypeError } = require('../errors'); -const ThreadMember = require('../structures/ThreadMember'); - -let deprecationEmittedForPassingBoolean = false; - -/** - * Manages API methods for GuildMembers and stores their cache. - * @extends {CachedManager} - */ -class ThreadMemberManager extends CachedManager { - constructor(thread, iterable) { - super(thread.client, ThreadMember, iterable); - - /** - * The thread this manager belongs to - * @type {ThreadChannel} - */ - this.thread = thread; - } - - /** - * The cache of this Manager - * @type {Collection} - * @name ThreadMemberManager#cache - */ - - _add(data, cache = true) { - const existing = this.cache.get(data.user_id); - if (cache) existing?._patch(data, { cache }); - if (existing) return existing; - - const member = new ThreadMember(this.thread, data, { cache }); - if (cache) this.cache.set(data.user_id, member); - return member; - } - - /** - * Fetches the client user as a ThreadMember of the thread. - * @param {BaseFetchOptions} [options] The options for fetching the member - * @returns {Promise} - */ - fetchMe(options) { - return this.fetch(this.client.user.id, options); - } - - /** - * The client user as a ThreadMember of this ThreadChannel - * @type {?ThreadMember} - * @readonly - */ - get me() { - return this.cache.get(this.client.user.id) ?? null; - } - - /** - * Data that resolves to give a ThreadMember object. This can be: - * * A ThreadMember object - * * A User resolvable - * @typedef {ThreadMember|UserResolvable} ThreadMemberResolvable - */ - - /** - * Resolves a {@link ThreadMemberResolvable} to a {@link ThreadMember} object. - * @param {ThreadMemberResolvable} member The user that is part of the thread - * @returns {?GuildMember} - */ - resolve(member) { - const memberResolvable = super.resolve(member); - if (memberResolvable) return memberResolvable; - const userId = this.client.users.resolveId(member); - if (userId) return this.cache.get(userId) ?? null; - return null; - } - - /** - * Resolves a {@link ThreadMemberResolvable} to a {@link ThreadMember} id string. - * @param {ThreadMemberResolvable} member The user that is part of the guild - * @returns {?Snowflake} - */ - resolveId(member) { - const memberResolvable = super.resolveId(member); - if (memberResolvable) return memberResolvable; - const userResolvable = this.client.users.resolveId(member); - return this.cache.has(userResolvable) ? userResolvable : null; - } - - /** - * Adds a member to the thread. - * @param {UserResolvable|'@me'} member The member to add - * @param {string} [reason] The reason for adding this member - * @returns {Promise} - */ - async add(member, reason) { - const id = member === '@me' ? member : this.client.users.resolveId(member); - if (!id) throw new TypeError('INVALID_TYPE', 'member', 'UserResolvable'); - await this.client.api - .channels(this.thread.id, 'thread-members', id) - .put({ reason }); - return id; - } - - /** - * Remove a user from the thread. - * @param {Snowflake|'@me'} id The id of the member to remove - * @param {string} [reason] The reason for removing this member from the thread - * @returns {Promise} - */ - async remove(id, reason) { - await this.client.api - .channels(this.thread.id, 'thread-members', id) - .delete({ reason }); - return id; - } - - async _fetchOne(memberId, { cache, force = false, withMember }) { - if (!force) { - const existing = this.cache.get(memberId); - if (existing) return existing; - } - - const data = await this.client.api - .channels(this.thread.id, 'thread-members', memberId) - .get({ - query: { with_member: withMember }, - }); - return this._add(data, cache); - } - - async _fetchMany({ cache, limit, after, withMember } = {}) { - const raw = await this.client.api - .channels(this.thread.id, 'thread-members') - .get({ - query: { with_member: withMember, limit, after }, - }); - return raw.reduce( - (col, member) => col.set(member.user_id, this._add(member, cache)), - new Collection(), - ); - } - - /** - * Options used to fetch a thread member. - * @typedef {BaseFetchOptions} FetchThreadMemberOptions - * @property {boolean} [withMember] Whether to also return the guild member associated with this thread member - */ - - /** - * Options used to fetch multiple thread members with guild member data. - * With `withMember` set to `true`, pagination is enabled. - * @typedef {Object} FetchThreadMembersWithGuildMemberDataOptions - * @property {true} withMember Whether to also return the guild member data - * @property {Snowflake} [after] Consider only thread members after this id - * @property {number} [limit] The maximum number of thread members to return - * @property {boolean} [cache] Whether to cache the fetched thread members and guild members - */ - - /** - * Options used to fetch multiple thread members without guild member data. - * @typedef {Object} FetchThreadMembersWithoutGuildMemberDataOptions - * @property {false} [withMember] Whether to also return the guild member data - * @property {boolean} [cache] Whether to cache the fetched thread members - */ - - /** - * Options used to fetch multiple thread members. - * @typedef {FetchThreadMembersWithGuildMemberDataOptions| - * FetchThreadMembersWithoutGuildMemberDataOptions} FetchThreadMembersOptions - */ - - /** - * Fetches member(s) for the thread from Discord. - * @param {UserResolvable|FetchThreadMembersOptions|boolean} [member] The member to fetch. If `undefined`, all members - * in the thread are fetched, and will be cached based on `options.cache`. - * @param {FetchThreadMemberOptions|FetchThreadMembersOptions} [options] Additional options for this fetch - * @returns {Promise>} - */ - fetch(member, options = { cache: true, force: false }) { - if (typeof member === 'boolean' && !deprecationEmittedForPassingBoolean) { - process.emitWarning( - 'Passing boolean to member option is deprecated, use cache property instead.', - 'DeprecationWarning', - ); - deprecationEmittedForPassingBoolean = true; - } - const id = this.resolveId(member); - return id - ? this._fetchOne(id, options) - : this._fetchMany( - typeof member === 'boolean' ? { ...options, cache: member } : options, - ); - } -} - -module.exports = ThreadMemberManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/UserManager.js b/vendor/discord.js-selfbot-v13/src/managers/UserManager.js deleted file mode 100644 index 37d14a2..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/UserManager.js +++ /dev/null @@ -1,141 +0,0 @@ -'use strict'; - -const CachedManager = require('./CachedManager'); -const { Error } = require('../errors'); -const { GuildMember } = require('../structures/GuildMember'); -const { Message } = require('../structures/Message'); -const ThreadMember = require('../structures/ThreadMember'); -const User = require('../structures/User'); - -/** - * Manages API methods for users and stores their cache. - * @extends {CachedManager} - */ -class UserManager extends CachedManager { - constructor(client, iterable) { - super(client, User, iterable); - } - - /** - * The cache of this manager - * @type {Collection} - * @name UserManager#cache - */ - - /** - * Data that resolves to give a User object. This can be: - * * A User object - * * A Snowflake - * * A Message object (resolves to the message author) - * * A GuildMember object - * * A ThreadMember object - * @typedef {User|Snowflake|Message|GuildMember|ThreadMember} UserResolvable - */ - - /** - * The DM between the client's user and a user - * @param {Snowflake} userId The user id - * @returns {?DMChannel} - * @private - */ - dmChannel(userId) { - return ( - this.client.channels.cache.find( - (c) => c.type === 'DM' && c.recipient.id === userId, - ) ?? null - ); - } - - /** - * Creates a {@link DMChannel} between the client and a user. - * @param {UserResolvable} user The UserResolvable to identify - * @param {BaseFetchOptions} [options] Additional options for this fetch - * @returns {Promise} - */ - async createDM(user, { cache = true, force = false } = {}) { - const id = this.resolveId(user); - - if (!force) { - const dmChannel = this.dmChannel(id); - if (dmChannel && !dmChannel.partial) return dmChannel; - } - - const data = await this.client.api.users['@me'].channels.post({ - data: { - recipients: [id], - }, - DiscordContext: {}, - }); - - const dm_channel = await this.client.channels._add(data, null, { cache }); - dm_channel.sync(); - return dm_channel; - } - - /** - * Deletes a {@link DMChannel} (if one exists) between the client and a user. Resolves with the channel if successful. - * @param {UserResolvable} user The UserResolvable to identify - * @returns {Promise} - */ - async deleteDM(user) { - const id = this.resolveId(user); - const dmChannel = this.dmChannel(id); - if (!dmChannel) throw new Error('USER_NO_DM_CHANNEL'); - await this.client.api.channels(dmChannel.id).delete(); - this.client.channels._remove(dmChannel.id); - return dmChannel; - } - - /** - * Obtains a user from Discord, or the user cache if it's already available. - * @param {UserResolvable} user The user to fetch - * @param {BaseFetchOptions} [options] Additional options for this fetch - * @returns {Promise} - */ - async fetch(user, { cache = true, force = false } = {}) { - const id = this.resolveId(user); - if (!force) { - const existing = this.cache.get(id); - if (existing && !existing.partial) return existing; - } - - const data = await this.client.api.users(id).get(); - return this._add(data, cache); - } - - /** - * Sends a message to a user. - * @param {UserResolvable} user The UserResolvable to identify - * @param {string|MessagePayload|MessageOptions} options The options to provide - * @returns {Promise} - */ - async send(user, options) { - return (await this.createDM(user)).send(options); - } - - /** - * Resolves a {@link UserResolvable} to a {@link User} object. - * @param {UserResolvable} user The UserResolvable to identify - * @returns {?User} - */ - resolve(user) { - if (user instanceof GuildMember || user instanceof ThreadMember) - return user.user; - if (user instanceof Message) return user.author; - return super.resolve(user); - } - - /** - * Resolves a {@link UserResolvable} to a {@link User} id. - * @param {UserResolvable} user The UserResolvable to identify - * @returns {?Snowflake} - */ - resolveId(user) { - if (user instanceof ThreadMember) return user.id; - if (user instanceof GuildMember) return user.user.id; - if (user instanceof Message) return user.author.id; - return super.resolveId(user); - } -} - -module.exports = UserManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/UserNoteManager.js b/vendor/discord.js-selfbot-v13/src/managers/UserNoteManager.js deleted file mode 100644 index 645b321..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/UserNoteManager.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const BaseManager = require('./BaseManager'); - -/** - * Manages API methods for Client and stores their cache. - * @extends {BaseManager} - */ -class UserNoteManager extends BaseManager { - constructor(client, data = {}) { - super(client); - /** - * Cache User Note - * @type {Collection} - */ - this.cache = new Collection(Object.entries(data)); - } - - _reload(data = {}) { - this.cache = new Collection(Object.entries(data)); - return this; - } - - async updateNote(id, note = null) { - await this.client.api.users['@me'].notes(id).put({ data: { note } }); - if (!note) this.cache.delete(id, note); - else this.cache.set(id, note); - return this; - } - - /** - * Obtains a user from Discord, or the user cache if it's already available. - * @param {UserResolvable} user The user to fetch - * @param {BaseFetchOptions} [options] Additional options for this fetch - * @returns {Promise} - */ - async fetch(user, { cache = true, force = false } = {}) { - const id = this.resolveId(user); - if (!force) { - const existing = this.cache.get(id); - if (existing) return existing; - } - const data = await this.client.api.users['@me'].notes[id] - .get() - .then((d) => d.note) - .catch(() => ''); - if (cache) this.cache.set(id, data); - return data; - } -} - -module.exports = UserNoteManager; diff --git a/vendor/discord.js-selfbot-v13/src/managers/VoiceStateManager.js b/vendor/discord.js-selfbot-v13/src/managers/VoiceStateManager.js deleted file mode 100644 index 12604fb..0000000 --- a/vendor/discord.js-selfbot-v13/src/managers/VoiceStateManager.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -const CachedManager = require('./CachedManager'); -const VoiceState = require('../structures/VoiceState'); - -/** - * Manages API methods for VoiceStates and stores their cache. - * @extends {CachedManager} - */ -class VoiceStateManager extends CachedManager { - constructor(guild, iterable) { - super(guild.client, VoiceState, iterable); - - /** - * The guild this manager belongs to - * @type {Guild} - */ - this.guild = guild; - } - - /** - * The cache of this manager - * @type {Collection} - * @name VoiceStateManager#cache - */ - - _add(data, cache = true) { - const existing = this.cache.get(data.user_id); - if (existing) return existing._patch(data); - - const entry = new this.holds(this.guild, data); - if (cache) this.cache.set(data.user_id, entry); - return entry; - } - - /** - * Obtains a user's voice state from discord or from the cache if it's already available. - * @param {GuildMemberResolvable|'@me'} member The member whose voice state is to be fetched - * @param {BaseFetchOptions} [options] Additional options for this fetch - * @returns {Promise} - * @example - * // Fetch a member's voice state - * guild.voiceStates.fetch("66564597481480192") - * .then(console.log) - * .catch(console.error); - */ - async fetch(member, { cache = true, force = false } = {}) { - if (!this.guild?.id) throw new Error('Guild is not defined'); - const id = member === '@me' ? member : this.guild.members.resolveId(member); - if (!force) { - const existing = this.cache.get(id === '@me' ? this.client.user.id : id); - if (existing) return existing; - } - const data = await this.client.api - .guilds(this.guild.id) - ['voice-states'][id].get(); - return this._add(data, cache); - } -} - -module.exports = VoiceStateManager; diff --git a/vendor/discord.js-selfbot-v13/src/rest/APIRequest.js b/vendor/discord.js-selfbot-v13/src/rest/APIRequest.js deleted file mode 100644 index 7c80b9e..0000000 --- a/vendor/discord.js-selfbot-v13/src/rest/APIRequest.js +++ /dev/null @@ -1,146 +0,0 @@ -'use strict'; - -const Buffer = require('node:buffer').Buffer; -const { setTimeout } = require('node:timers'); -const { FormData } = require('undici'); - -class APIRequest { - constructor(rest, method, path, options) { - this.rest = rest; - this.client = rest.client; - this.method = method; - this.route = options.route; - this.options = options; - this.retries = 0; - - this.fullUserAgent = this.client.options.http.headers['User-Agent']; - - this.client.options.ws.properties.browser_user_agent = this.fullUserAgent; - - let queryString = ''; - if (options.query) { - const query = Object.entries(options.query) - .filter(([, value]) => value !== null && typeof value !== 'undefined') - .flatMap(([key, value]) => - Array.isArray(value) ? value.map((v) => [key, v]) : [[key, value]], - ); - queryString = new URLSearchParams(query).toString(); - } - this.path = `${path}${queryString && `?${queryString}`}`; - } - - make(captchaKey, captchaRqToken) { - const API = - this.options.versioned === false - ? this.client.options.http.api - : `${this.client.options.http.api}/v${this.client.options.http.version}`; - const url = API + this.path; - - let headers = { - accept: '*/*', - 'accept-language': 'en-US', - priority: 'u=1, i', - referer: 'https://discord.com/channels/@me', - 'sec-ch-ua': '"Not:A-Brand";v="24", "Chromium";v="134"', - 'sec-ch-ua-mobile': '?0', - 'sec-ch-ua-platform': '"Windows"', - 'sec-fetch-dest': 'empty', - 'sec-fetch-mode': 'cors', - 'sec-fetch-site': 'same-origin', - 'x-discord-locale': 'en-US', - 'x-discord-timezone': Intl.DateTimeFormat().resolvedOptions().timeZone, - 'x-super-properties': this.rest.getSuperPropertiesHeader(), - origin: 'https://discord.com', - 'x-debug-options': 'bugReporterEnabled', - ...this.client.options.http.headers, - 'User-Agent': this.fullUserAgent, - }; - - if (this.options.auth !== false) - headers.Authorization = this.rest.getAuth(); - if (this.options.reason) - headers['X-Audit-Log-Reason'] = encodeURIComponent(this.options.reason); - if (this.options.headers) - headers = Object.assign(headers, this.options.headers); - - // Delete all headers if undefined - for (const [key, value] of Object.entries(headers)) { - if (value === undefined) delete headers[key]; - } - if (this.options.webhook === true) { - headers = { - 'User-Agent': this.client.options.http.headers['User-Agent'], - }; - } - - // Some options - if (this.options.DiscordContext) { - headers['X-Context-Properties'] = Buffer.from( - JSON.stringify(this.options.DiscordContext), - 'utf8', - ).toString('base64'); - } - - if (this.options.mfaToken) { - headers['X-Discord-Mfa-Authorization'] = this.options.mfaToken; - } - - // Captcha - if (captchaKey && typeof captchaKey == 'string') - headers['X-Captcha-Key'] = captchaKey; - if (captchaRqToken && typeof captchaRqToken == 'string') - headers['X-Captcha-Rqtoken'] = captchaRqToken; - - let body; - if (this.options.files?.length) { - body = new FormData(); - for (const [index, file] of this.options.files.entries()) { - // Why undici#FormData doesn't support file stream? - // Hacky way to support file stream - if (file?.file) { - body.set(file.key ?? `files[${index}]`, { - [Symbol.toStringTag]: 'File', - name: file.name, - stream: () => file.file, - }); - } - } - if (typeof this.options.data !== 'undefined') { - if (this.options.dontUsePayloadJSON) { - for (const [key, value] of Object.entries(this.options.data)) - body.append(key, value); - } else { - body.append('payload_json', JSON.stringify(this.options.data)); - } - } - // eslint-disable-next-line eqeqeq - } else if (this.options.data != null) { - if (this.options.usePayloadJSON) { - body = new FormData(); - body.append('payload_json', JSON.stringify(this.options.data)); - } else { - body = JSON.stringify(this.options.data); - headers['Content-Type'] = 'application/json'; - } - } - - const controller = new AbortController(); - const timeout = setTimeout( - () => controller.abort(), - this.client.options.restRequestTimeout, - ).unref(); - return this.rest - .fetch(url, { - method: this.method.toUpperCase(), // Undici doesn't normalize "patch" into "PATCH" (which surprisingly follows the spec). - headers, - body, - signal: controller.signal, - redirect: 'follow', - dispatcher: this.rest.getDispatcher(), - credentials: 'include', - }) - .finally(() => clearTimeout(timeout)); - } -} - -module.exports = APIRequest; diff --git a/vendor/discord.js-selfbot-v13/src/rest/APIRouter.js b/vendor/discord.js-selfbot-v13/src/rest/APIRouter.js deleted file mode 100644 index 773b50b..0000000 --- a/vendor/discord.js-selfbot-v13/src/rest/APIRouter.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -const noop = () => {}; // eslint-disable-line no-empty-function -const methods = ['get', 'post', 'delete', 'patch', 'put']; -const reflectors = [ - 'toString', - 'valueOf', - 'inspect', - 'constructor', - Symbol.toPrimitive, - Symbol.for('nodejs.util.inspect.custom'), -]; - -function buildRoute(manager) { - const route = ['']; - const handler = { - get(target, name) { - if (reflectors.includes(name)) return () => route.join('/'); - if (methods.includes(name)) { - const routeBucket = []; - for (let i = 0; i < route.length; i++) { - // Reactions routes and sub-routes all share the same bucket - if (route[i - 1] === 'reactions') break; - // Literal ids should only be taken account if they are the Major id (the Channel/Guild id) - if ( - /\d{16,19}/g.test(route[i]) && - !/channels|guilds/.test(route[i - 1]) - ) - routeBucket.push(':id'); - // All other parts of the route should be considered as part of the bucket identifier - else routeBucket.push(route[i]); - } - return (options) => - manager.request( - name, - route.join('/'), - Object.assign( - { - versioned: manager.versioned, - route: routeBucket.join('/'), - }, - options, - ), - ); - } - route.push(name); - return new Proxy(noop, handler); - }, - apply(target, _, args) { - route.push(...args.filter((x) => x != null)); // eslint-disable-line eqeqeq - return new Proxy(noop, handler); - }, - }; - return new Proxy(noop, handler); -} - -module.exports = buildRoute; diff --git a/vendor/discord.js-selfbot-v13/src/rest/DiscordAPIError.js b/vendor/discord.js-selfbot-v13/src/rest/DiscordAPIError.js deleted file mode 100644 index 8e5030f..0000000 --- a/vendor/discord.js-selfbot-v13/src/rest/DiscordAPIError.js +++ /dev/null @@ -1,126 +0,0 @@ -'use strict'; - -/** - * Represents an error from the Discord API. - * @extends Error - */ -class DiscordAPIError extends Error { - constructor(error, status, request) { - super(); - const flattened = this.constructor - .flattenErrors(error.errors ?? error) - .join('\n'); - this.name = 'DiscordAPIError'; - this.message = - error.message && flattened - ? `${error.message}\n${flattened}` - : (error.message ?? flattened); - - /** - * The HTTP method used for the request - * @type {string} - */ - this.method = request.method; - - /** - * The path of the request relative to the HTTP endpoint - * @type {string} - */ - this.path = request.path; - - /** - * HTTP error code returned by Discord - * @type {number} - */ - this.code = error.code; - - /** - * The HTTP status code - * @type {number} - */ - this.httpStatus = status; - - /** - * The data associated with the request that caused this error - * @type {HTTPErrorData} - */ - this.requestData = { - json: request.options.data, - files: request.options.files ?? [], - headers: request.options.headers, - }; - - /** - * The number of times this request has been retried - * @type {number} - */ - this.retries = request.retries; - - /** - * @typedef {Object} Captcha - * @property {Array} captcha_key ['message'] - * @property {string} captcha_sitekey Captcha sitekey (hcaptcha) - * @property {string} captcha_service hcaptcha - * @property {string} [captcha_rqdata] - * @property {string} [captcha_rqtoken] - */ - - /** - * Captcha response data if the request requires a captcha - * @type {Captcha | null} - */ - this.captcha = error?.captcha_service ? error : null; - } - - /** - * A special `40333` JSON error code is returned if your request is blocked by Cloudflare. - * This may be due to a malformed request or improper user agent. - * The response resembles a normal error structure: - * @type {boolean} - * @example - * { - * "message": "internal network error", - * "code": 40333 - * } - */ - get isBlockedByCloudflare() { - return this.code === 40333; - } - - /** - * Flattens an errors object returned from the API into an array. - * @param {APIError} obj Discord errors object - * @param {string} [key] Used internally to determine key names of nested fields - * @returns {string[]} - * @private - */ - static flattenErrors(obj, key = '') { - let messages = []; - - for (const [k, v] of Object.entries(obj)) { - if (k === 'message') continue; - const newKey = key ? (isNaN(k) ? `${key}.${k}` : `${key}[${k}]`) : k; - - if (v._errors) { - messages.push( - `${newKey}: ${v._errors.map((e) => e.message).join(' ')}`, - ); - } else if (v.code ?? v.message) { - messages.push(`${v.code ? `${v.code}: ` : ''}${v.message}`.trim()); - } else if (typeof v === 'string') { - messages.push(v); - } else { - messages = messages.concat(this.flattenErrors(v, newKey)); - } - } - - return messages; - } -} - -module.exports = DiscordAPIError; - -/** - * @external APIError - * @see {@link https://discord.com/developers/docs/reference#error-messages} - */ diff --git a/vendor/discord.js-selfbot-v13/src/rest/HTTPError.js b/vendor/discord.js-selfbot-v13/src/rest/HTTPError.js deleted file mode 100644 index 7d07e3a..0000000 --- a/vendor/discord.js-selfbot-v13/src/rest/HTTPError.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; - -/** - * Represents an HTTP error from a request. - * @extends Error - */ -class HTTPError extends Error { - constructor(message, name, code, request) { - super(message); - - /** - * The name of the error - * @type {string} - */ - this.name = name; - - /** - * HTTP error code returned from the request - * @type {number} - */ - this.code = code ?? 500; - - /** - * The HTTP method used for the request - * @type {string} - */ - this.method = request.method; - - /** - * The path of the request relative to the HTTP endpoint - * @type {string} - */ - this.path = request.path; - - /** - * The HTTP data that was sent to Discord - * @typedef {Object} HTTPErrorData - * @property {*} json The JSON data that was sent - * @property {HTTPAttachmentData[]} files The files that were sent with this request, if any - */ - - /** - * The attachment data that is sent to Discord - * @typedef {Object} HTTPAttachmentData - * @property {string|Buffer|Stream} attachment The source of this attachment data - * @property {string} name The file name - * @property {Buffer|Stream} file The file buffer - */ - - /** - * The data associated with the request that caused this error - * @type {HTTPErrorData} - */ - this.requestData = { - json: request.options.data, - files: request.options.files ?? [], - headers: request.options.headers, - }; - } -} - -module.exports = HTTPError; diff --git a/vendor/discord.js-selfbot-v13/src/rest/RESTManager.js b/vendor/discord.js-selfbot-v13/src/rest/RESTManager.js deleted file mode 100644 index 48ede04..0000000 --- a/vendor/discord.js-selfbot-v13/src/rest/RESTManager.js +++ /dev/null @@ -1,106 +0,0 @@ -'use strict'; - -const { setInterval } = require('node:timers'); -const { Collection } = require('@discordjs/collection'); -const makeFetchCookie = require('fetch-cookie'); -const { CookieJar } = require('tough-cookie'); -const { - buildConnector, - Client: UndiciClient, - ProxyAgent, - fetch: fetchOriginal, -} = require('undici'); -const APIRequest = require('./APIRequest'); -const routeBuilder = require('./APIRouter'); -const RequestHandler = require('./RequestHandler'); -const { Error } = require('../errors'); -const { ciphers, Endpoints } = require('../util/Constants'); -const Util = require('../util/Util'); - -class RESTManager { - constructor(client) { - this.client = client; - this.handlers = new Collection(); - this.versioned = true; - this.globalLimit = - client.options.restGlobalRateLimit > 0 - ? client.options.restGlobalRateLimit - : Infinity; - this.globalRemaining = this.globalLimit; - this.globalReset = null; - this.globalDelay = null; - this.cookieJar = new CookieJar(); - this.fetch = makeFetchCookie.default(fetchOriginal, this.cookieJar); - this.dispatcher = null; - this.superPropertiesSource = null; - this.superPropertiesHeader = null; - if (client.options.restSweepInterval > 0) { - this.sweepInterval = setInterval(() => { - this.handlers.sweep((handler) => handler._inactive); - }, client.options.restSweepInterval * 1_000).unref(); - } - } - - get api() { - return routeBuilder(this); - } - - getAuth() { - const token = this.client.token ?? this.client.accessToken; - if (token) return token?.replace(/Bot /g, ''); - throw new Error('TOKEN_MISSING'); - } - - get cdn() { - return Endpoints.CDN(this.client.options.http.cdn); - } - - getDispatcher() { - if (this.dispatcher) return this.dispatcher; - - const proxy = Util.checkUndiciProxyAgent(this.client.options.http.agent); - if (proxy) { - this.dispatcher = new ProxyAgent({ - ...proxy, - ciphers: ciphers.join(':'), - }); - } else { - this.dispatcher = new UndiciClient('https://discord.com', { - connect: buildConnector({ ciphers: ciphers.join(':') }), - }); - } - - return this.dispatcher; - } - - getSuperPropertiesHeader() { - const source = JSON.stringify(this.client.options.ws.properties); - if (source !== this.superPropertiesSource) { - this.superPropertiesSource = source; - this.superPropertiesHeader = Buffer.from(source, 'ascii').toString('base64'); - } - return this.superPropertiesHeader; - } - - request(method, url, options = {}) { - const apiRequest = new APIRequest(this, method, url, options); - let handler = this.handlers.get(apiRequest.route); - - if (!handler) { - handler = new RequestHandler(this); - this.handlers.set(apiRequest.route, handler); - } - - return handler.push(apiRequest); - } - - get endpoint() { - return this.client.options.http.api; - } - - set endpoint(endpoint) { - this.client.options.http.api = endpoint; - } -} - -module.exports = RESTManager; diff --git a/vendor/discord.js-selfbot-v13/src/rest/RateLimitError.js b/vendor/discord.js-selfbot-v13/src/rest/RateLimitError.js deleted file mode 100644 index 2b3f3a8..0000000 --- a/vendor/discord.js-selfbot-v13/src/rest/RateLimitError.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -/** - * Represents a RateLimit error from a request. - * @extends Error - */ -class RateLimitError extends Error { - constructor({ timeout, limit, method, path, route, global }) { - super(`A ${global ? 'global ' : ''}rate limit was hit on route ${route}`); - - /** - * The name of the error - * @type {string} - */ - this.name = 'RateLimitError'; - - /** - * Time until this rate limit ends, in milliseconds - * @type {number} - */ - this.timeout = timeout; - - /** - * The HTTP method used for the request - * @type {string} - */ - this.method = method; - - /** - * The path of the request relative to the HTTP endpoint - * @type {string} - */ - this.path = path; - - /** - * The route of the request relative to the HTTP endpoint - * @type {string} - */ - this.route = route; - - /** - * Whether this rate limit is global - * @type {boolean} - */ - this.global = global; - - /** - * The maximum amount of requests of this endpoint - * @type {number} - */ - this.limit = limit; - } -} - -module.exports = RateLimitError; diff --git a/vendor/discord.js-selfbot-v13/src/rest/RequestHandler.js b/vendor/discord.js-selfbot-v13/src/rest/RequestHandler.js deleted file mode 100644 index 7d55938..0000000 --- a/vendor/discord.js-selfbot-v13/src/rest/RequestHandler.js +++ /dev/null @@ -1,538 +0,0 @@ -'use strict'; - -const { setTimeout } = require('node:timers'); -const { setTimeout: sleep } = require('node:timers/promises'); -const { AsyncQueue } = require('@sapphire/async-queue'); -const DiscordAPIError = require('./DiscordAPIError'); -const HTTPError = require('./HTTPError'); -const RateLimitError = require('./RateLimitError'); -const { - Events: { - DEBUG, - RATE_LIMIT, - INVALID_REQUEST_WARNING, - API_RESPONSE, - API_REQUEST, - }, -} = require('../util/Constants'); - -const captchaMessage = [ - 'incorrect-captcha', - 'response-already-used', - 'captcha-required', - 'invalid-input-response', - 'invalid-response', - 'You need to update your app', - 'response-already-used-error', - 'rqkey-mismatch', - 'sitekey-secret-mismatch', -]; - -function parseResponse(res) { - if (res.headers.get('content-type')?.startsWith('application/json')) - return res.json(); - return res.arrayBuffer(); -} - -function getAPIOffset(serverDate) { - return new Date(serverDate).getTime() - Date.now(); -} - -function calculateReset(reset, resetAfter, serverDate) { - // Use direct reset time when available, server date becomes irrelevant in this case - if (resetAfter) { - return Date.now() + Number(resetAfter) * 1_000; - } - return new Date(Number(reset) * 1_000).getTime() - getAPIOffset(serverDate); -} - -function calculateRetryDelay(retryCount, random = Math.random) { - const base = 250; - const max = 5_000; - const exponential = Math.min(max, base * 2 ** Math.max(0, retryCount - 1)); - return exponential + Math.floor(random() * base); -} - -/* Invalid request limiting is done on a per-IP basis, not a per-token basis. - * The best we can do is track invalid counts process-wide (on the theory that - * users could have multiple bots run from one process) rather than per-bot. - * Therefore, store these at file scope here rather than in the client's - * RESTManager object. - */ -let invalidCount = 0; -let invalidCountResetTime = null; - -class RequestHandler { - constructor(manager) { - this.manager = manager; - this.queue = new AsyncQueue(); - this.reset = -1; - this.remaining = -1; - this.limit = -1; - } - - async push(request) { - await this.queue.wait(); - try { - return await this.execute(request); - } finally { - this.queue.shift(); - } - } - - get globalLimited() { - return ( - this.manager.globalRemaining <= 0 && Date.now() < this.manager.globalReset - ); - } - - get localLimited() { - return this.remaining <= 0 && Date.now() < this.reset; - } - - get limited() { - return this.globalLimited || this.localLimited; - } - - get _inactive() { - return this.queue.remaining === 0 && !this.limited; - } - - globalDelayFor(ms) { - return new Promise((resolve) => { - setTimeout(() => { - this.manager.globalDelay = null; - resolve(); - }, ms).unref(); - }); - } - - /* - * Determines whether the request should be queued or whether a RateLimitError should be thrown - */ - async onRateLimit(request, limit, timeout, isGlobal) { - const { options } = this.manager.client; - if (!options.rejectOnRateLimit) return; - - const rateLimitData = { - timeout, - limit, - method: request.method, - path: request.path, - route: request.route, - global: isGlobal, - }; - const shouldThrow = - typeof options.rejectOnRateLimit === 'function' - ? await options.rejectOnRateLimit(rateLimitData) - : options.rejectOnRateLimit.some((route) => - rateLimitData.route.startsWith(route.toLowerCase()), - ); - if (shouldThrow) { - throw new RateLimitError(rateLimitData); - } - } - - async execute(request, captchaKey, captchaToken) { - /* - * After calculations have been done, pre-emptively stop further requests - * Potentially loop until this task can run if e.g. the global rate limit is hit twice - */ - while (this.limited) { - const isGlobal = this.globalLimited; - let limit, timeout, delayPromise; - - if (isGlobal) { - // Set the variables based on the global rate limit - limit = this.manager.globalLimit; - timeout = - this.manager.globalReset + - this.manager.client.options.restTimeOffset - - Date.now(); - } else { - // Set the variables based on the route-specific rate limit - limit = this.limit; - timeout = - this.reset + this.manager.client.options.restTimeOffset - Date.now(); - } - - if (this.manager.client.listenerCount(RATE_LIMIT)) { - /** - * Emitted when the client hits a rate limit while making a request - * @event BaseClient#rateLimit - * @param {RateLimitData} rateLimitData Object containing the rate limit info - */ - this.manager.client.emit(RATE_LIMIT, { - timeout, - limit, - method: request.method, - path: request.path, - route: request.route, - global: isGlobal, - }); - } - - if (isGlobal) { - // If this is the first task to reach the global timeout, set the global delay - if (!this.manager.globalDelay) { - // The global delay function should clear the global delay state when it is resolved - this.manager.globalDelay = this.globalDelayFor(timeout); - } - delayPromise = this.manager.globalDelay; - } else { - delayPromise = sleep(timeout); - } - - // Determine whether a RateLimitError should be thrown - await this.onRateLimit(request, limit, timeout, isGlobal); // eslint-disable-line no-await-in-loop - - // Wait for the timeout to expire in order to avoid an actual 429 - await delayPromise; // eslint-disable-line no-await-in-loop - } - - // As the request goes out, update the global usage information - if (!this.manager.globalReset || this.manager.globalReset < Date.now()) { - this.manager.globalReset = Date.now() + 1_000; - this.manager.globalRemaining = this.manager.globalLimit; - } - this.manager.globalRemaining--; - - /** - * Represents a request that will or has been made to the Discord API - * @typedef {Object} APIRequest - * @property {HTTPMethod} method The HTTP method used in this request - * @property {string} path The full path used to make the request - * @property {string} route The API route identifying the rate limit for this request - * @property {Object} options Additional options for this request - * @property {number} retries The number of times this request has been attempted - */ - - if (this.manager.client.listenerCount(API_REQUEST)) { - /** - * Emitted before every API request. - * This event can emit several times for the same request, e.g. when hitting a rate limit. - * This is an informational event that is emitted quite frequently, - * it is highly recommended to check `request.path` to filter the data. - * @event BaseClient#apiRequest - * @param {APIRequest} request The request that is about to be sent - */ - this.manager.client.emit(API_REQUEST, { - method: request.method, - path: request.path, - route: request.route, - options: request.options, - retries: request.retries, - }); - } - - // Perform the request - let res; - try { - res = await request.make(captchaKey, captchaToken); - } catch (error) { - // Retry the specified number of times for request abortions - if (request.retries === this.manager.client.options.retryLimit) { - throw new HTTPError( - error.message, - error.constructor.name, - error.status, - request, - ); - } - - request.retries++; - const delay = calculateRetryDelay(request.retries); - this.manager.client.emit( - DEBUG, - `[Request Handler] Retrying failed request after ${delay}ms.\n Method : ${request.method}\n Path : ${request.path}\n Route : ${request.route}\n Retry : ${request.retries}`, - ); - await sleep(delay); - return this.execute(request); - } - - if (this.manager.client.listenerCount(API_RESPONSE)) { - /** - * Emitted after every API request has received a response. - * This event does not necessarily correlate to completion of the request, e.g. when hitting a rate limit. - * This is an informational event that is emitted quite frequently, - * it is highly recommended to check `request.path` to filter the data. - * @event BaseClient#apiResponse - * @param {APIRequest} request The request that triggered this response - * @param {Response} response The response received from the Discord API - */ - this.manager.client.emit( - API_RESPONSE, - { - method: request.method, - path: request.path, - route: request.route, - options: request.options, - retries: request.retries, - }, - res.clone(), - ); - } - - let sublimitTimeout; - if (res.headers) { - const serverDate = res.headers.get('date'); - const limit = res.headers.get('x-ratelimit-limit'); - const remaining = res.headers.get('x-ratelimit-remaining'); - const reset = res.headers.get('x-ratelimit-reset'); - const resetAfter = res.headers.get('x-ratelimit-reset-after'); - this.limit = limit ? Number(limit) : Infinity; - this.remaining = remaining ? Number(remaining) : 1; - - this.reset = - reset || resetAfter - ? calculateReset(reset, resetAfter, serverDate) - : Date.now(); - - // https://github.com/discord/discord-api-docs/issues/182 - if (!resetAfter && request.route.includes('reactions')) { - this.reset = - new Date(serverDate).getTime() - getAPIOffset(serverDate) + 250; - } - - // Handle retryAfter, which means we have actually hit a rate limit - let retryAfter = res.headers.get('retry-after'); - retryAfter = retryAfter ? Number(retryAfter) * 1_000 : -1; - if (retryAfter > 0) { - // If the global rate limit header is set, that means we hit the global rate limit - if (res.headers.get('x-ratelimit-global')) { - this.manager.globalRemaining = 0; - this.manager.globalReset = Date.now() + retryAfter; - } else if (!this.localLimited) { - /* - * This is a sublimit (e.g. 2 channel name changes/10 minutes) since the headers don't indicate a - * route-wide rate limit. Don't update remaining or reset to avoid rate limiting the whole - * endpoint, just set a reset time on the request itself to avoid retrying too soon. - */ - sublimitTimeout = retryAfter; - } - } - } - - // Count the invalid requests - if (res.status === 401 || res.status === 403 || res.status === 429) { - if (!invalidCountResetTime || invalidCountResetTime < Date.now()) { - invalidCountResetTime = Date.now() + 1_000 * 60 * 10; - invalidCount = 0; - } - invalidCount++; - - const emitInvalid = - this.manager.client.listenerCount(INVALID_REQUEST_WARNING) && - this.manager.client.options.invalidRequestWarningInterval > 0 && - invalidCount % - this.manager.client.options.invalidRequestWarningInterval === - 0; - if (emitInvalid) { - /** - * @typedef {Object} InvalidRequestWarningData - * @property {number} count Number of invalid requests that have been made in the window - * @property {number} remainingTime Time in milliseconds remaining before the count resets - */ - - /** - * Emitted periodically when the process sends invalid requests to let users avoid the - * 10k invalid requests in 10 minutes threshold that causes a ban - * @event BaseClient#invalidRequestWarning - * @param {InvalidRequestWarningData} invalidRequestWarningData Object containing the invalid request info - */ - this.manager.client.emit(INVALID_REQUEST_WARNING, { - count: invalidCount, - remainingTime: invalidCountResetTime - Date.now(), - }); - } - } - - // Handle 2xx and 3xx responses - if (res.ok) { - // Nothing wrong with the request, proceed with the next one - return parseResponse(res); - } - - // Handle 4xx responses - if (res.status >= 400 && res.status < 500) { - // Handle ratelimited requests - if (res.status === 429) { - const isGlobal = this.globalLimited; - let limit, timeout; - if (isGlobal) { - // Set the variables based on the global rate limit - limit = this.manager.globalLimit; - timeout = - this.manager.globalReset + - this.manager.client.options.restTimeOffset - - Date.now(); - } else { - // Set the variables based on the route-specific rate limit - limit = this.limit; - timeout = - this.reset + - this.manager.client.options.restTimeOffset - - Date.now(); - } - - this.manager.client.emit( - DEBUG, - `[Request Handler] Hit a 429 while executing a request. - Global : ${isGlobal} - Method : ${request.method} - Path : ${request.path} - Route : ${request.route} - Limit : ${limit} - Timeout : ${timeout}ms - Sublimit: ${sublimitTimeout ? `${sublimitTimeout}ms` : 'None'}`, - ); - - await this.onRateLimit(request, limit, timeout, isGlobal); - - // If caused by a sublimit, wait it out here so other requests on the route can be handled - if (sublimitTimeout) { - await sleep(sublimitTimeout); - } - return this.execute(request); - } - - // Handle possible malformed requests - let data; - try { - data = await parseResponse(res); - // Captcha - if ( - data?.captcha_service && - typeof this.manager.client.options.captchaSolver == 'function' && - request.retries < this.manager.client.options.captchaRetryLimit && - captchaMessage.some((s) => data.captcha_key[0].includes(s)) - ) { - // Retry the request after a captcha is solved - this.manager.client.emit( - DEBUG, - `[Request Handler] Hit a captcha while executing a request (${data.captcha_key.join(', ')}) - Method : ${request.method} - Path : ${request.path} - Route : ${request.route} - Sitekey : ${data.captcha_sitekey} - rqToken : ${data.captcha_rqtoken}`, - ); - const captcha = await this.manager.client.options.captchaSolver( - data, - request.fullUserAgent, - ); - this.manager.client.emit( - DEBUG, - `[Request Handler] Captcha details: - Method : ${request.method} - Path : ${request.path} - Route : ${request.route} - Key : ${captcha ? `${captcha.slice(0, 120)}...` : '[Captcha not solved]'} - rqToken : ${data.captcha_rqtoken}`, - ); - request.retries++; - return this.execute(request, captcha, data.captcha_rqtoken); - } - // Two factor handling - if ( - data?.code && - data.code == 60003 && - request.options.auth !== false && - request.retries < 1 - ) { - // https://gist.github.com/Dziurwa14/de2498e5ee28d2089f095aa037957cbb - // 60003: Two factor is required for this operation - /** - * { - * message: "Two factor is required for this operation"; - * code: 60003; - * mfa: { - * ticket: string; - * methods: { - * type: "password" | "totp" | "sms" | "backup" | "webauthn"; - * backup_codes_allowed?: boolean; - * }[]; - * }; - * }; - */ - if ( - data.mfa.methods.find((o) => o.type === 'totp') && - typeof this.manager.client.options.TOTPKey === 'string' - ) { - // Get mfa code - const otp = this.manager.client.authenticator.generate( - this.manager.client.options.TOTPKey, - ); - this.manager.client.emit( - DEBUG, - `[Request Handler] ${data.message} - Method : ${request.method} - Path : ${request.path} - Route : ${request.route} - mfaCode : ${otp}`, - ); - // Get ticket - const mfaData = data.mfa; - const mfaPost = await this.manager.client.api.mfa.finish.post({ - data: { - ticket: mfaData.ticket, - data: otp, - mfa_type: 'totp', - }, - }); - request.options.mfaToken = mfaPost.token; - request.retries++; - return this.execute(request); - } - } - } catch (err) { - throw new HTTPError( - err.message, - err.constructor.name, - err.status, - request, - ); - } - - throw new DiscordAPIError(data, res.status, request); - } - - // Handle 5xx responses - if (res.status >= 500 && res.status < 600) { - // Retry the specified number of times for possible serverside issues - if (request.retries === this.manager.client.options.retryLimit) { - throw new HTTPError( - res.statusText, - res.constructor.name, - res.status, - request, - ); - } - - request.retries++; - const delay = calculateRetryDelay(request.retries); - this.manager.client.emit( - DEBUG, - `[Request Handler] Retrying server error after ${delay}ms.\n Method : ${request.method}\n Path : ${request.path}\n Route : ${request.route}\n Status : ${res.status}\n Retry : ${request.retries}`, - ); - await sleep(delay); - return this.execute(request); - } - - // Fallback in the rare case a status code outside the range 200..=599 is returned - return null; - } -} - -module.exports = RequestHandler; -module.exports.calculateRetryDelay = calculateRetryDelay; - -/** - * @external HTTPMethod - * @see {@link https://developer.mozilla.org/docs/Web/HTTP/Methods} - */ - -/** - * @external Response - * @see {@link https://developer.mozilla.org/docs/Web/API/Response} - */ diff --git a/vendor/discord.js-selfbot-v13/src/sharding/Shard.js b/vendor/discord.js-selfbot-v13/src/sharding/Shard.js deleted file mode 100644 index 500e463..0000000 --- a/vendor/discord.js-selfbot-v13/src/sharding/Shard.js +++ /dev/null @@ -1,465 +0,0 @@ -'use strict'; - -const EventEmitter = require('node:events'); -const path = require('node:path'); -const process = require('node:process'); -const { setTimeout } = require('node:timers'); -const { setTimeout: sleep } = require('node:timers/promises'); -const { Error } = require('../errors'); -const Util = require('../util/Util'); -let childProcess = null; -let Worker = null; - -/** - * A self-contained shard created by the {@link ShardingManager}. Each one has a {@link ChildProcess} that contains - * an instance of the bot and its {@link Client}. When its child process/worker exits for any reason, the shard will - * spawn a new one to replace it as necessary. - * @extends {EventEmitter} - * @deprecated - */ -class Shard extends EventEmitter { - constructor(manager, id) { - super(); - - if (manager.mode === 'process') - childProcess = require('node:child_process'); - else if (manager.mode === 'worker') - Worker = require('node:worker_threads').Worker; - - /** - * Manager that created the shard - * @type {ShardingManager} - */ - this.manager = manager; - - /** - * The shard's id in the manager - * @type {number} - */ - this.id = id; - - /** - * Arguments for the shard's process (only when {@link ShardingManager#mode} is `process`) - * @type {string[]} - */ - this.args = manager.shardArgs ?? []; - - /** - * Arguments for the shard's process executable (only when {@link ShardingManager#mode} is `process`) - * @type {string[]} - */ - this.execArgv = manager.execArgv; - - /** - * Environment variables for the shard's process, or workerData for the shard's worker - * @type {Object} - */ - this.env = Object.assign({}, process.env, { - SHARDING_MANAGER: true, - SHARDS: this.id, - SHARD_COUNT: this.manager.totalShards, - DISCORD_TOKEN: this.manager.token, - }); - - /** - * Whether the shard's {@link Client} is ready - * @type {boolean} - */ - this.ready = false; - - /** - * Process of the shard (if {@link ShardingManager#mode} is `process`) - * @type {?ChildProcess} - */ - this.process = null; - - /** - * Worker of the shard (if {@link ShardingManager#mode} is `worker`) - * @type {?Worker} - */ - this.worker = null; - - /** - * Ongoing promises for calls to {@link Shard#eval}, mapped by the `script` they were called with - * @type {Map} - * @private - */ - this._evals = new Map(); - - /** - * Ongoing promises for calls to {@link Shard#fetchClientValue}, mapped by the `prop` they were called with - * @type {Map} - * @private - */ - this._fetches = new Map(); - - /** - * Listener function for the {@link ChildProcess}' `exit` event - * @type {Function} - * @private - */ - this._exitListener = null; - } - - /** - * Forks a child process or creates a worker thread for the shard. - * You should not need to call this manually. - * @param {number} [timeout=30000] The amount in milliseconds to wait until the {@link Client} has become ready - * before resolving (`-1` or `Infinity` for no wait) - * @returns {Promise} - */ - spawn(timeout = 30_000) { - if (this.process) throw new Error('SHARDING_PROCESS_EXISTS', this.id); - if (this.worker) throw new Error('SHARDING_WORKER_EXISTS', this.id); - - this._exitListener = this._handleExit.bind(this, undefined, timeout); - - if (this.manager.mode === 'process') { - this.process = childProcess - .fork(path.resolve(this.manager.file), this.args, { - env: this.env, - execArgv: this.execArgv, - }) - .on('message', this._handleMessage.bind(this)) - .on('exit', this._exitListener); - } else if (this.manager.mode === 'worker') { - this.worker = new Worker(path.resolve(this.manager.file), { - workerData: this.env, - }) - .on('message', this._handleMessage.bind(this)) - .on('exit', this._exitListener); - } - - this._evals.clear(); - this._fetches.clear(); - - const child = this.process ?? this.worker; - - /** - * Emitted upon the creation of the shard's child process/worker. - * @event Shard#spawn - * @param {ChildProcess|Worker} process Child process/worker that was created - */ - this.emit('spawn', child); - - if (timeout === -1 || timeout === Infinity) return Promise.resolve(child); - return new Promise((resolve, reject) => { - const cleanup = () => { - clearTimeout(spawnTimeoutTimer); - this.off('ready', onReady); - this.off('disconnect', onDisconnect); - this.off('death', onDeath); - }; - - const onReady = () => { - cleanup(); - resolve(child); - }; - - const onDisconnect = () => { - cleanup(); - reject(new Error('SHARDING_READY_DISCONNECTED', this.id)); - }; - - const onDeath = () => { - cleanup(); - reject(new Error('SHARDING_READY_DIED', this.id)); - }; - - const onTimeout = () => { - cleanup(); - reject(new Error('SHARDING_READY_TIMEOUT', this.id)); - }; - - const spawnTimeoutTimer = setTimeout(onTimeout, timeout); - this.once('ready', onReady); - this.once('disconnect', onDisconnect); - this.once('death', onDeath); - }); - } - - /** - * Immediately kills the shard's process/worker and does not restart it. - */ - kill() { - if (this.process) { - this.process.removeListener('exit', this._exitListener); - this.process.kill(); - } else { - this.worker.removeListener('exit', this._exitListener); - this.worker.terminate(); - } - - this._handleExit(false); - } - - /** - * Options used to respawn a shard. - * @typedef {Object} ShardRespawnOptions - * @property {number} [delay=500] How long to wait between killing the process/worker and - * restarting it (in milliseconds) - * @property {number} [timeout=30000] The amount in milliseconds to wait until the {@link Client} - * has become ready before resolving (`-1` or `Infinity` for no wait) - */ - - /** - * Kills and restarts the shard's process/worker. - * @param {ShardRespawnOptions} [options] Options for respawning the shard - * @returns {Promise} - */ - async respawn({ delay = 500, timeout = 30_000 } = {}) { - this.kill(); - if (delay > 0) await sleep(delay); - return this.spawn(timeout); - } - - /** - * Sends a message to the shard's process/worker. - * @param {*} message Message to send to the shard - * @returns {Promise} - */ - send(message) { - return new Promise((resolve, reject) => { - if (this.process) { - this.process.send(message, (err) => { - if (err) reject(err); - else resolve(this); - }); - } else { - this.worker.postMessage(message); - resolve(this); - } - }); - } - - /** - * Fetches a client property value of the shard. - * @param {string} prop Name of the client property to get, using periods for nesting - * @returns {Promise<*>} - * @example - * shard.fetchClientValue('guilds.cache.size') - * .then(count => console.log(`${count} guilds in shard ${shard.id}`)) - * .catch(console.error); - */ - async fetchClientValue(prop) { - // Shard is dead (maybe respawning), don't cache anything and error immediately - if (!this.process && !this.worker) - throw new Error('SHARDING_NO_CHILD_EXISTS', this.id); - - // Cached promise from previous call - if (this._fetches.has(prop)) return this._fetches.get(prop); - - const promise = new Promise((resolve, reject) => { - const child = this.process ?? this.worker; - - const listener = (message) => { - if (message?._fetchProp !== prop) return; - child.removeListener('message', listener); - this.decrementMaxListeners(child); - this._fetches.delete(prop); - if (!message._error) resolve(message._result); - else reject(Util.makeError(message._error)); - }; - - this.incrementMaxListeners(child); - child.on('message', listener); - - this.send({ _fetchProp: prop }).catch((err) => { - child.removeListener('message', listener); - this.decrementMaxListeners(child); - this._fetches.delete(prop); - reject(err); - }); - }); - - this._fetches.set(prop, promise); - return promise; - } - - /** - * Evaluates a script or function on the shard, in the context of the {@link Client}. - * @param {string|Function} script JavaScript to run on the shard - * @param {*} [context] The context for the eval - * @returns {Promise<*>} Result of the script execution - */ - async eval(script, context) { - // Stringify the script if it's a Function - const _eval = - typeof script === 'function' - ? `(${script})(this, ${JSON.stringify(context)})` - : script; - - // Shard is dead (maybe respawning), don't cache anything and error immediately - if (!this.process && !this.worker) - throw new Error('SHARDING_NO_CHILD_EXISTS', this.id); - - // Cached promise from previous call - if (this._evals.has(_eval)) return this._evals.get(_eval); - - const promise = new Promise((resolve, reject) => { - const child = this.process ?? this.worker; - - const listener = (message) => { - if (message?._eval !== _eval) return; - child.removeListener('message', listener); - this.decrementMaxListeners(child); - this._evals.delete(_eval); - if (!message._error) resolve(message._result); - else reject(Util.makeError(message._error)); - }; - - this.incrementMaxListeners(child); - child.on('message', listener); - - this.send({ _eval }).catch((err) => { - child.removeListener('message', listener); - this.decrementMaxListeners(child); - this._evals.delete(_eval); - reject(err); - }); - }); - - this._evals.set(_eval, promise); - return promise; - } - - /** - * Handles a message received from the child process/worker. - * @param {*} message Message received - * @private - */ - _handleMessage(message) { - if (message) { - // Shard is ready - if (message._ready) { - this.ready = true; - /** - * Emitted upon the shard's {@link Client#event:shardReady} event. - * @event Shard#ready - */ - this.emit('ready'); - return; - } - - // Shard has disconnected - if (message._disconnect) { - this.ready = false; - /** - * Emitted upon the shard's {@link Client#event:shardDisconnect} event. - * @event Shard#disconnect - */ - this.emit('disconnect'); - return; - } - - // Shard is attempting to reconnect - if (message._reconnecting) { - this.ready = false; - /** - * Emitted upon the shard's {@link Client#event:shardReconnecting} event. - * @event Shard#reconnecting - */ - this.emit('reconnecting'); - return; - } - - // Shard is requesting a property fetch - if (message._sFetchProp) { - const resp = { - _sFetchProp: message._sFetchProp, - _sFetchPropShard: message._sFetchPropShard, - }; - this.manager - .fetchClientValues(message._sFetchProp, message._sFetchPropShard) - .then( - (results) => this.send({ ...resp, _result: results }), - (err) => this.send({ ...resp, _error: Util.makePlainError(err) }), - ); - return; - } - - // Shard is requesting an eval broadcast - if (message._sEval) { - const resp = { - _sEval: message._sEval, - _sEvalShard: message._sEvalShard, - }; - this.manager - ._performOnShards('eval', [message._sEval], message._sEvalShard) - .then( - (results) => this.send({ ...resp, _result: results }), - (err) => this.send({ ...resp, _error: Util.makePlainError(err) }), - ); - return; - } - - // Shard is requesting a respawn of all shards - if (message._sRespawnAll) { - const { shardDelay, respawnDelay, timeout } = message._sRespawnAll; - this.manager - .respawnAll({ shardDelay, respawnDelay, timeout }) - .catch(() => { - // Do nothing - }); - return; - } - } - - /** - * Emitted upon receiving a message from the child process/worker. - * @event Shard#message - * @param {*} message Message that was received - */ - this.emit('message', message); - } - - /** - * Handles the shard's process/worker exiting. - * @param {boolean} [respawn=this.manager.respawn] Whether to spawn the shard again - * @param {number} [timeout] The amount in milliseconds to wait until the {@link Client} - * has become ready (`-1` or `Infinity` for no wait) - * @private - */ - _handleExit(respawn = this.manager.respawn, timeout) { - /** - * Emitted upon the shard's child process/worker exiting. - * @event Shard#death - * @param {ChildProcess|Worker} process Child process/worker that exited - */ - this.emit('death', this.process ?? this.worker); - - this.ready = false; - this.process = null; - this.worker = null; - this._evals.clear(); - this._fetches.clear(); - - if (respawn) this.spawn(timeout).catch((err) => this.emit('error', err)); - } - - /** - * Increments max listeners by one for a given emitter, if they are not zero. - * @param {EventEmitter|process} emitter The emitter that emits the events. - * @private - */ - incrementMaxListeners(emitter) { - const maxListeners = emitter.getMaxListeners(); - if (maxListeners !== 0) { - emitter.setMaxListeners(maxListeners + 1); - } - } - - /** - * Decrements max listeners by one for a given emitter, if they are not zero. - * @param {EventEmitter|process} emitter The emitter that emits the events. - * @private - */ - decrementMaxListeners(emitter) { - const maxListeners = emitter.getMaxListeners(); - if (maxListeners !== 0) { - emitter.setMaxListeners(maxListeners - 1); - } - } -} - -module.exports = Shard; diff --git a/vendor/discord.js-selfbot-v13/src/sharding/ShardClientUtil.js b/vendor/discord.js-selfbot-v13/src/sharding/ShardClientUtil.js deleted file mode 100644 index cc2f86a..0000000 --- a/vendor/discord.js-selfbot-v13/src/sharding/ShardClientUtil.js +++ /dev/null @@ -1,305 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const { Error } = require('../errors'); -const { Events } = require('../util/Constants'); -const Util = require('../util/Util'); - -/** - * Helper class for sharded clients spawned as a child process/worker, such as from a {@link ShardingManager}. - * Utilizes IPC to send and receive data to/from the master process and other shards. - * @deprecated - */ -class ShardClientUtil { - constructor(client, mode) { - /** - * Client for the shard - * @type {Client} - */ - this.client = client; - - /** - * Mode the shard was spawned with - * @type {ShardingManagerMode} - */ - this.mode = mode; - - /** - * Message port for the master process (only when {@link ShardClientUtil#mode} is `worker`) - * @type {?MessagePort} - */ - this.parentPort = null; - - if (mode === 'process') { - process.on('message', this._handleMessage.bind(this)); - client.on('ready', () => { - process.send({ _ready: true }); - }); - client.on('disconnect', () => { - process.send({ _disconnect: true }); - }); - client.on('reconnecting', () => { - process.send({ _reconnecting: true }); - }); - } else if (mode === 'worker') { - this.parentPort = require('node:worker_threads').parentPort; - this.parentPort.on('message', this._handleMessage.bind(this)); - client.on('ready', () => { - this.parentPort.postMessage({ _ready: true }); - }); - client.on('disconnect', () => { - this.parentPort.postMessage({ _disconnect: true }); - }); - client.on('reconnecting', () => { - this.parentPort.postMessage({ _reconnecting: true }); - }); - } - } - - /** - * Array of shard ids of this client - * @type {number[]} - * @readonly - */ - get ids() { - return this.client.options.shards; - } - - /** - * Total number of shards - * @type {number} - * @readonly - */ - get count() { - return this.client.options.shardCount; - } - - /** - * Sends a message to the master process. - * @param {*} message Message to send - * @returns {Promise} - * @emits Shard#message - */ - send(message) { - return new Promise((resolve, reject) => { - if (this.mode === 'process') { - process.send(message, (err) => { - if (err) reject(err); - else resolve(); - }); - } else if (this.mode === 'worker') { - this.parentPort.postMessage(message); - resolve(); - } - }); - } - - /** - * Fetches a client property value of each shard, or a given shard. - * @param {string} prop Name of the client property to get, using periods for nesting - * @param {number} [shard] Shard to fetch property from, all if undefined - * @returns {Promise<*|Array<*>>} - * @example - * client.shard.fetchClientValues('guilds.cache.size') - * .then(results => console.log(`${results.reduce((prev, val) => prev + val, 0)} total guilds`)) - * .catch(console.error); - * @see {@link ShardingManager#fetchClientValues} - */ - fetchClientValues(prop, shard) { - return new Promise((resolve, reject) => { - const parent = this.parentPort ?? process; - - const listener = (message) => { - if (message?._sFetchProp !== prop || message._sFetchPropShard !== shard) - return; - parent.removeListener('message', listener); - this.decrementMaxListeners(parent); - if (!message._error) resolve(message._result); - else reject(Util.makeError(message._error)); - }; - this.incrementMaxListeners(parent); - parent.on('message', listener); - - this.send({ _sFetchProp: prop, _sFetchPropShard: shard }).catch((err) => { - parent.removeListener('message', listener); - this.decrementMaxListeners(parent); - reject(err); - }); - }); - } - - /** - * Evaluates a script or function on all shards, or a given shard, in the context of the {@link Client}s. - * @param {Function} script JavaScript to run on each shard - * @param {BroadcastEvalOptions} [options={}] The options for the broadcast - * @returns {Promise<*|Array<*>>} Results of the script execution - * @example - * client.shard.broadcastEval(client => client.guilds.cache.size) - * .then(results => console.log(`${results.reduce((prev, val) => prev + val, 0)} total guilds`)) - * .catch(console.error); - * @see {@link ShardingManager#broadcastEval} - */ - broadcastEval(script, options = {}) { - return new Promise((resolve, reject) => { - const parent = this.parentPort ?? process; - if (typeof script !== 'function') { - reject(new TypeError('SHARDING_INVALID_EVAL_BROADCAST')); - return; - } - script = `(${script})(this, ${JSON.stringify(options.context)})`; - - const listener = (message) => { - if (message?._sEval !== script || message._sEvalShard !== options.shard) - return; - parent.removeListener('message', listener); - this.decrementMaxListeners(parent); - if (!message._error) resolve(message._result); - else reject(Util.makeError(message._error)); - }; - this.incrementMaxListeners(parent); - parent.on('message', listener); - this.send({ _sEval: script, _sEvalShard: options.shard }).catch((err) => { - parent.removeListener('message', listener); - this.decrementMaxListeners(parent); - reject(err); - }); - }); - } - - /** - * Requests a respawn of all shards. - * @param {MultipleShardRespawnOptions} [options] Options for respawning shards - * @returns {Promise} Resolves upon the message being sent - * @see {@link ShardingManager#respawnAll} - */ - respawnAll({ - shardDelay = 5_000, - respawnDelay = 500, - timeout = 30_000, - } = {}) { - return this.send({ _sRespawnAll: { shardDelay, respawnDelay, timeout } }); - } - - /** - * Handles an IPC message. - * @param {*} message Message received - * @private - */ - async _handleMessage(message) { - if (!message) return; - if (message._fetchProp) { - try { - const props = message._fetchProp.split('.'); - let value = this.client; - for (const prop of props) value = value[prop]; - this._respond('fetchProp', { - _fetchProp: message._fetchProp, - _result: value, - }); - } catch (err) { - this._respond('fetchProp', { - _fetchProp: message._fetchProp, - _error: Util.makePlainError(err), - }); - } - } else if (message._eval) { - try { - this._respond('eval', { - _eval: message._eval, - _result: await this.client._eval(message._eval), - }); - } catch (err) { - this._respond('eval', { - _eval: message._eval, - _error: Util.makePlainError(err), - }); - } - } - } - - /** - * Sends a message to the master process, emitting an error from the client upon failure. - * @param {string} type Type of response to send - * @param {*} message Message to send - * @private - */ - _respond(type, message) { - this.send(message).catch((err) => { - const error = new Error( - `Error when sending ${type} response to master process: ${err.message}`, - ); - error.stack = err.stack; - /** - * Emitted when the client encounters an error. - * Errors thrown within this event do not have a catch handler, it is - * recommended to not use async functions as `error` event handlers. See the - * [Node.js docs](https://nodejs.org/api/events.html#capture-rejections-of-promises) for details. - * @event Client#error - * @param {Error} error The error encountered - */ - this.client.emit(Events.ERROR, error); - }); - } - - /** - * Creates/gets the singleton of this class. - * @param {Client} client The client to use - * @param {ShardingManagerMode} mode Mode the shard was spawned with - * @returns {ShardClientUtil} - */ - static singleton(client, mode) { - if (!this._singleton) { - this._singleton = new this(client, mode); - } else { - client.emit( - Events.WARN, - 'Multiple clients created in child process/worker; only the first will handle sharding helpers.', - ); - } - return this._singleton; - } - - /** - * Get the shard id for a given guild id. - * @param {Snowflake} guildId Snowflake guild id to get shard id for - * @param {number} shardCount Number of shards - * @returns {number} - */ - static shardIdForGuildId(guildId, shardCount) { - const shard = Number(BigInt(guildId) >> 22n) % shardCount; - if (shard < 0) - throw new Error( - 'SHARDING_SHARD_MISCALCULATION', - shard, - guildId, - shardCount, - ); - return shard; - } - - /** - * Increments max listeners by one for a given emitter, if they are not zero. - * @param {EventEmitter|process} emitter The emitter that emits the events. - * @private - */ - incrementMaxListeners(emitter) { - const maxListeners = emitter.getMaxListeners(); - if (maxListeners !== 0) { - emitter.setMaxListeners(maxListeners + 1); - } - } - - /** - * Decrements max listeners by one for a given emitter, if they are not zero. - * @param {EventEmitter|process} emitter The emitter that emits the events. - * @private - */ - decrementMaxListeners(emitter) { - const maxListeners = emitter.getMaxListeners(); - if (maxListeners !== 0) { - emitter.setMaxListeners(maxListeners - 1); - } - } -} - -module.exports = ShardClientUtil; diff --git a/vendor/discord.js-selfbot-v13/src/sharding/ShardingManager.js b/vendor/discord.js-selfbot-v13/src/sharding/ShardingManager.js deleted file mode 100644 index 8518819..0000000 --- a/vendor/discord.js-selfbot-v13/src/sharding/ShardingManager.js +++ /dev/null @@ -1,386 +0,0 @@ -'use strict'; - -const EventEmitter = require('node:events'); -const fs = require('node:fs'); -const path = require('node:path'); -const process = require('node:process'); -const { setTimeout: sleep } = require('node:timers/promises'); -const { Collection } = require('@discordjs/collection'); -const Shard = require('./Shard'); -const { Error, TypeError, RangeError } = require('../errors'); -const Util = require('../util/Util'); - -/** - * This is a utility class that makes multi-process sharding of a bot an easy and painless experience. - * It works by spawning a self-contained {@link ChildProcess} or {@link Worker} for each individual shard, each - * containing its own instance of your bot's {@link Client}. They all have a line of communication with the master - * process, and there are several useful methods that utilize it in order to simplify tasks that are normally difficult - * with sharding. It can spawn a specific number of shards or the amount that Discord suggests for the bot, and takes a - * path to your main bot script to launch for each one. - * @extends {EventEmitter} - * @deprecated - */ -class ShardingManager extends EventEmitter { - /** - * The mode to spawn shards with for a {@link ShardingManager}. Can be either one of: - * * 'process' to use child processes - * * 'worker' to use [Worker threads](https://nodejs.org/api/worker_threads.html) - * @typedef {string} ShardingManagerMode - */ - - /** - * The options to spawn shards with for a {@link ShardingManager}. - * @typedef {Object} ShardingManagerOptions - * @property {string|number} [totalShards='auto'] Number of total shards of all shard managers or "auto" - * @property {string|number[]} [shardList='auto'] List of shards to spawn or "auto" - * @property {ShardingManagerMode} [mode='process'] Which mode to use for shards - * @property {boolean} [respawn=true] Whether shards should automatically respawn upon exiting - * @property {string[]} [shardArgs=[]] Arguments to pass to the shard script when spawning - * (only available when mode is set to 'process') - * @property {string[]} [execArgv=[]] Arguments to pass to the shard script executable when spawning - * (only available when mode is set to 'process') - * @property {string} [token] Token to use for automatic shard count and passing to shards - */ - - /** - * @param {string} file Path to your shard script file - * @param {ShardingManagerOptions} [options] Options for the sharding manager - */ - constructor(file, options = {}) { - super(); - options = Util.mergeDefault( - { - totalShards: 'auto', - mode: 'process', - respawn: true, - shardArgs: [], - execArgv: [], - token: process.env.DISCORD_TOKEN, - }, - options, - ); - - /** - * Path to the shard script file - * @type {string} - */ - this.file = file; - if (!file) throw new Error('CLIENT_INVALID_OPTION', 'File', 'specified.'); - if (!path.isAbsolute(file)) this.file = path.resolve(process.cwd(), file); - const stats = fs.statSync(this.file); - if (!stats.isFile()) - throw new Error('CLIENT_INVALID_OPTION', 'File', 'a file'); - - /** - * List of shards this sharding manager spawns - * @type {string|number[]} - */ - this.shardList = options.shardList ?? 'auto'; - if (this.shardList !== 'auto') { - if (!Array.isArray(this.shardList)) { - throw new TypeError('CLIENT_INVALID_OPTION', 'shardList', 'an array.'); - } - this.shardList = [...new Set(this.shardList)]; - if (this.shardList.length < 1) - throw new RangeError( - 'CLIENT_INVALID_OPTION', - 'shardList', - 'at least 1 id.', - ); - if ( - this.shardList.some( - (shardId) => - typeof shardId !== 'number' || - isNaN(shardId) || - !Number.isInteger(shardId) || - shardId < 0, - ) - ) { - throw new TypeError( - 'CLIENT_INVALID_OPTION', - 'shardList', - 'an array of positive integers.', - ); - } - } - - /** - * Amount of shards that all sharding managers spawn in total - * @type {number} - */ - this.totalShards = options.totalShards || 'auto'; - if (this.totalShards !== 'auto') { - if (typeof this.totalShards !== 'number' || isNaN(this.totalShards)) { - throw new TypeError( - 'CLIENT_INVALID_OPTION', - 'Amount of shards', - 'a number.', - ); - } - if (this.totalShards < 1) - throw new RangeError( - 'CLIENT_INVALID_OPTION', - 'Amount of shards', - 'at least 1.', - ); - if (!Number.isInteger(this.totalShards)) { - throw new RangeError( - 'CLIENT_INVALID_OPTION', - 'Amount of shards', - 'an integer.', - ); - } - } - - /** - * Mode for shards to spawn with - * @type {ShardingManagerMode} - */ - this.mode = options.mode; - if (this.mode !== 'process' && this.mode !== 'worker') { - throw new RangeError( - 'CLIENT_INVALID_OPTION', - 'Sharding mode', - '"process" or "worker"', - ); - } - - /** - * Whether shards should automatically respawn upon exiting - * @type {boolean} - */ - this.respawn = options.respawn; - - /** - * An array of arguments to pass to shards (only when {@link ShardingManager#mode} is `process`) - * @type {string[]} - */ - this.shardArgs = options.shardArgs; - - /** - * An array of arguments to pass to the executable (only when {@link ShardingManager#mode} is `process`) - * @type {string[]} - */ - this.execArgv = options.execArgv; - - /** - * Token to use for obtaining the automatic shard count, and passing to shards - * @type {?string} - */ - this.token = options.token?.replace(/^Bot\s*/i, '') ?? null; - - /** - * A collection of shards that this manager has spawned - * @type {Collection} - */ - this.shards = new Collection(); - - process.env.SHARDING_MANAGER = true; - process.env.SHARDING_MANAGER_MODE = this.mode; - process.env.DISCORD_TOKEN = this.token; - } - - /** - * Creates a single shard. - * Using this method is usually not necessary if you use the spawn method. - * @param {number} [id=this.shards.size] Id of the shard to create - * This is usually not necessary to manually specify. - * @returns {Shard} Note that the created shard needs to be explicitly spawned using its spawn method. - */ - createShard(id = this.shards.size) { - const shard = new Shard(this, id); - this.shards.set(id, shard); - /** - * Emitted upon creating a shard. - * @event ShardingManager#shardCreate - * @param {Shard} shard Shard that was created - */ - this.emit('shardCreate', shard); - return shard; - } - - /** - * Options used to spawn multiple shards. - * @typedef {Object} MultipleShardSpawnOptions - * @property {number|string} [amount=this.totalShards] Number of shards to spawn - * @property {number} [delay=5500] How long to wait in between spawning each shard (in milliseconds) - * @property {number} [timeout=30000] The amount in milliseconds to wait until the {@link Client} has become ready - */ - - /** - * Spawns multiple shards. - * @param {MultipleShardSpawnOptions} [options] Options for spawning shards - * @returns {Promise>} - */ - async spawn({ - amount = this.totalShards, - delay = 5500, - timeout = 30_000, - } = {}) { - // Obtain/verify the number of shards to spawn - if (amount === 'auto') { - amount = 1; - } else { - if (typeof amount !== 'number' || isNaN(amount)) { - throw new TypeError( - 'CLIENT_INVALID_OPTION', - 'Amount of shards', - 'a number.', - ); - } - if (amount < 1) - throw new RangeError( - 'CLIENT_INVALID_OPTION', - 'Amount of shards', - 'at least 1.', - ); - if (!Number.isInteger(amount)) { - throw new TypeError( - 'CLIENT_INVALID_OPTION', - 'Amount of shards', - 'an integer.', - ); - } - } - - // Make sure this many shards haven't already been spawned - if (this.shards.size >= amount) - throw new Error('SHARDING_ALREADY_SPAWNED', this.shards.size); - if ( - this.shardList === 'auto' || - this.totalShards === 'auto' || - this.totalShards !== amount - ) { - this.shardList = [...Array(amount).keys()]; - } - if (this.totalShards === 'auto' || this.totalShards !== amount) { - this.totalShards = amount; - } - - if (this.shardList.some((shardId) => shardId >= amount)) { - throw new RangeError( - 'CLIENT_INVALID_OPTION', - 'Amount of shards', - 'bigger than the highest shardId in the shardList option.', - ); - } - - // Spawn the shards - for (const shardId of this.shardList) { - const promises = []; - const shard = this.createShard(shardId); - promises.push(shard.spawn(timeout)); - if (delay > 0 && this.shards.size !== this.shardList.length) - promises.push(sleep(delay)); - await Promise.all(promises); // eslint-disable-line no-await-in-loop - } - - return this.shards; - } - - /** - * Sends a message to all shards. - * @param {*} message Message to be sent to the shards - * @returns {Promise} - */ - broadcast(message) { - const promises = []; - for (const shard of this.shards.values()) - promises.push(shard.send(message)); - return Promise.all(promises); - } - - /** - * Options for {@link ShardingManager#broadcastEval} and {@link ShardClientUtil#broadcastEval}. - * @typedef {Object} BroadcastEvalOptions - * @property {number} [shard] Shard to run script on, all if undefined - * @property {*} [context] The JSON-serializable values to call the script with - */ - - /** - * Evaluates a script on all shards, or a given shard, in the context of the {@link Client}s. - * @param {Function} script JavaScript to run on each shard - * @param {BroadcastEvalOptions} [options={}] The options for the broadcast - * @returns {Promise<*|Array<*>>} Results of the script execution - */ - async broadcastEval(script, options = {}) { - if (typeof script !== 'function') - throw new TypeError('SHARDING_INVALID_EVAL_BROADCAST'); - return this._performOnShards( - 'eval', - [`(${script})(this, ${JSON.stringify(options.context)})`], - options.shard, - ); - } - - /** - * Fetches a client property value of each shard, or a given shard. - * @param {string} prop Name of the client property to get, using periods for nesting - * @param {number} [shard] Shard to fetch property from, all if undefined - * @returns {Promise<*|Array<*>>} - * @example - * manager.fetchClientValues('guilds.cache.size') - * .then(results => console.log(`${results.reduce((prev, val) => prev + val, 0)} total guilds`)) - * .catch(console.error); - */ - fetchClientValues(prop, shard) { - return this._performOnShards('fetchClientValue', [prop], shard); - } - - /** - * Runs a method with given arguments on all shards, or a given shard. - * @param {string} method Method name to run on each shard - * @param {Array<*>} args Arguments to pass through to the method call - * @param {number} [shard] Shard to run on, all if undefined - * @returns {Promise<*|Array<*>>} Results of the method execution - * @private - */ - async _performOnShards(method, args, shard) { - if (this.shards.size === 0) throw new Error('SHARDING_NO_SHARDS'); - - if (typeof shard === 'number') { - if (this.shards.has(shard)) - return this.shards.get(shard)[method](...args); - throw new Error('SHARDING_SHARD_NOT_FOUND', shard); - } - - if (this.shards.size !== this.shardList.length) - throw new Error('SHARDING_IN_PROCESS'); - - const promises = []; - for (const sh of this.shards.values()) promises.push(sh[method](...args)); - return Promise.all(promises); - } - - /** - * Options used to respawn all shards. - * @typedef {Object} MultipleShardRespawnOptions - * @property {number} [shardDelay=5000] How long to wait between shards (in milliseconds) - * @property {number} [respawnDelay=500] How long to wait between killing a shard's process and restarting it - * (in milliseconds) - * @property {number} [timeout=30000] The amount in milliseconds to wait for a shard to become ready before - * continuing to another (`-1` or `Infinity` for no wait) - */ - - /** - * Kills all running shards and respawns them. - * @param {MultipleShardRespawnOptions} [options] Options for respawning shards - * @returns {Promise>} - */ - async respawnAll({ - shardDelay = 5_000, - respawnDelay = 500, - timeout = 30_000, - } = {}) { - let s = 0; - for (const shard of this.shards.values()) { - const promises = [shard.respawn({ delay: respawnDelay, timeout })]; - if (++s < this.shards.size && shardDelay > 0) - promises.push(sleep(shardDelay)); - await Promise.all(promises); // eslint-disable-line no-await-in-loop - } - return this.shards; - } -} - -module.exports = ShardingManager; diff --git a/vendor/discord.js-selfbot-v13/src/structures/AnonymousGuild.js b/vendor/discord.js-selfbot-v13/src/structures/AnonymousGuild.js deleted file mode 100644 index 37e54ee..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/AnonymousGuild.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -const BaseGuild = require('./BaseGuild'); -const { VerificationLevels, NSFWLevels } = require('../util/Constants'); - -/** - * Bundles common attributes and methods between {@link Guild} and {@link InviteGuild} - * @extends {BaseGuild} - * @abstract - */ -class AnonymousGuild extends BaseGuild { - constructor(client, data, immediatePatch = true) { - super(client, data); - if (immediatePatch) this._patch(data); - } - - _patch(data) { - if ('features' in data) this.features = data.features; - - if ('splash' in data) { - /** - * The hash of the guild invite splash image - * @type {?string} - */ - this.splash = data.splash; - } - - if ('banner' in data) { - /** - * The hash of the guild banner - * @type {?string} - */ - this.banner = data.banner; - } - - if ('description' in data) { - /** - * The description of the guild, if any - * @type {?string} - */ - this.description = data.description; - } - - if ('verification_level' in data) { - /** - * The verification level of the guild - * @type {VerificationLevel} - */ - this.verificationLevel = VerificationLevels[data.verification_level]; - } - - if ('vanity_url_code' in data) { - /** - * The vanity invite code of the guild, if any - * @type {?string} - */ - this.vanityURLCode = data.vanity_url_code; - } - - if ('nsfw_level' in data) { - /** - * The NSFW level of this guild - * @type {NSFWLevel} - */ - this.nsfwLevel = NSFWLevels[data.nsfw_level]; - } - - if ('premium_subscription_count' in data) { - /** - * The total number of boosts for this server - * @type {?number} - */ - this.premiumSubscriptionCount = data.premium_subscription_count; - } else { - this.premiumSubscriptionCount ??= null; - } - } - - /** - * The URL to this guild's banner. - * @param {StaticImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - bannerURL({ format, size } = {}) { - return ( - this.banner && - this.client.rest.cdn.Banner(this.id, this.banner, format, size) - ); - } - - /** - * The URL to this guild's invite splash image. - * @param {StaticImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - splashURL({ format, size } = {}) { - return ( - this.splash && - this.client.rest.cdn.Splash(this.id, this.splash, format, size) - ); - } -} - -module.exports = AnonymousGuild; diff --git a/vendor/discord.js-selfbot-v13/src/structures/ApplicationCommand.js b/vendor/discord.js-selfbot-v13/src/structures/ApplicationCommand.js deleted file mode 100644 index e205add..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/ApplicationCommand.js +++ /dev/null @@ -1,650 +0,0 @@ -'use strict'; - -const Base = require('./Base'); -const ApplicationCommandPermissionsManager = require('../managers/ApplicationCommandPermissionsManager'); -const { - ApplicationCommandOptionTypes, - ApplicationCommandTypes, - ChannelTypes, -} = require('../util/Constants'); -const Permissions = require('../util/Permissions'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); - -/** - * Represents an application command. - * @extends {Base} - */ -class ApplicationCommand extends Base { - constructor(client, data, guild, guildId) { - super(client); - - /** - * The command's id - * @type {Snowflake} - */ - this.id = data.id; - - /** - * The parent application's id - * @type {Snowflake} - */ - this.applicationId = data.application_id; - - /** - * The guild this command is part of - * @type {?Guild} - */ - this.guild = guild ?? null; - - /** - * The guild's id this command is part of, this may be non-null when `guild` is `null` if the command - * was fetched from the `ApplicationCommandManager` - * @type {?Snowflake} - */ - this.guildId = guild?.id ?? guildId ?? null; - - /** - * The manager for permissions of this command on its guild or arbitrary guilds when the command is global - * @type {ApplicationCommandPermissionsManager} - */ - this.permissions = new ApplicationCommandPermissionsManager(this); - - /** - * The type of this application command - * @type {ApplicationCommandType} - */ - this.type = ApplicationCommandTypes[data.type]; - - this._patch(data); - } - - _patch(data) { - if ('name' in data) { - /** - * The name of this command - * @type {string} - */ - this.name = data.name; - } - - if ('name_localizations' in data) { - /** - * The name localizations for this command - * @type {?Object} - */ - this.nameLocalizations = data.name_localizations; - } else { - this.nameLocalizations ??= null; - } - - if ('name_localized' in data) { - /** - * The localized name for this command - * @type {?string} - */ - this.nameLocalized = data.name_localized; - } else { - this.nameLocalized ??= null; - } - - if ('description' in data) { - /** - * The description of this command - * @type {string} - */ - this.description = data.description; - } - - if ('description_localizations' in data) { - /** - * The description localizations for this command - * @type {?Object} - */ - this.descriptionLocalizations = data.description_localizations; - } else { - this.descriptionLocalizations ??= null; - } - - if ('description_localized' in data) { - /** - * The localized description for this command - * @type {?string} - */ - this.descriptionLocalized = data.description_localized; - } else { - this.descriptionLocalized ??= null; - } - - if ('options' in data) { - /** - * The options of this command - * @type {ApplicationCommandOption[]} - */ - this.options = data.options.map((o) => - this.constructor.transformOption(o, true), - ); - } else { - this.options ??= []; - } - - /* eslint-disable max-len */ - if ('default_permission' in data) { - /** - * Whether the command is enabled by default when the app is added to a guild - * @type {boolean} - * @deprecated Use {@link ApplicationCommand.defaultMemberPermissions} and {@link ApplicationCommand.dmPermission} instead. - */ - this.defaultPermission = data.default_permission; - } - /* eslint-disable max-len */ - - if ('default_member_permissions' in data) { - /** - * The default bitfield used to determine whether this command be used in a guild - * @type {?Readonly} - */ - this.defaultMemberPermissions = data.default_member_permissions - ? new Permissions(BigInt(data.default_member_permissions)).freeze() - : null; - } else { - this.defaultMemberPermissions ??= null; - } - - if ('dm_permission' in data) { - /** - * Whether the command can be used in DMs - * This property is always `null` on guild commands - * @type {?boolean} - */ - this.dmPermission = data.dm_permission; - } else { - this.dmPermission ??= null; - } - - if ('version' in data) { - /** - * Autoincrementing version identifier updated during substantial record changes - * @type {Snowflake} - */ - this.version = data.version; - } - } - - /** - * The timestamp the command was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return SnowflakeUtil.timestampFrom(this.id); - } - - /** - * The time the command was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * The manager that this command belongs to - * @type {ApplicationCommandManager} - * @readonly - */ - get manager() { - return (this.guild ?? this.client.application).commands; - } - - /** - * Data for creating or editing an application command. - * @typedef {Object} ApplicationCommandData - * @property {string} name The name of the command - * @property {Object} [nameLocalizations] The localizations for the command name - * @property {string} description The description of the command - * @property {Object} [descriptionLocalizations] The localizations for the command description - * @property {ApplicationCommandType} [type] The type of the command - * @property {ApplicationCommandOptionData[]} [options] Options for the command - * @property {boolean} [defaultPermission] Whether the command is enabled by default when the app is added to a guild - * @property {?PermissionResolvable} [defaultMemberPermissions] The bitfield used to determine the default permissions - * a member needs in order to run the command - * @property {boolean} [dmPermission] Whether the command is enabled in DMs - */ - - /** - * An option for an application command or subcommand. - * In addition to the listed properties, when used as a parameter, - * API style `snake_case` properties can be used for compatibility with generators like `@discordjs/builders`. - * Note that providing a value for the `camelCase` counterpart for any `snake_case` property - * will discard the provided `snake_case` property. - * @typedef {Object} ApplicationCommandOptionData - * @property {ApplicationCommandOptionType|number} type The type of the option - * @property {string} name The name of the option - * @property {Object} [nameLocalizations] The name localizations for the option - * @property {string} description The description of the option - * @property {Object} [descriptionLocalizations] The description localizations for the option - * @property {boolean} [autocomplete] Whether the option is an autocomplete option - * @property {boolean} [required] Whether the option is required - * @property {ApplicationCommandOptionChoiceData[]} [choices] The choices of the option for the user to pick from - * @property {ApplicationCommandOptionData[]} [options] Additional options if this option is a subcommand (group) - * @property {ChannelType[]|number[]} [channelTypes] When the option type is channel, - * the allowed types of channels that can be selected - * @property {number} [minValue] The minimum value for an `INTEGER` or `NUMBER` option - * @property {number} [maxValue] The maximum value for an `INTEGER` or `NUMBER` option - * @property {number} [minLength] The minimum length for a `STRING` option - * (maximum of `6000`) - * @property {number} [maxLength] The maximum length for a `STRING` option - * (maximum of `6000`) - */ - - /** - * @typedef {Object} ApplicationCommandOptionChoiceData - * @property {string} name The name of the choice - * @property {Object} [nameLocalizations] The localized names for this choice - * @property {string|number} value The value of the choice - */ - - /** - * Edits this application command. - * @param {Partial} data The data to update the command with - * @returns {Promise} - * @example - * // Edit the description of this command - * command.edit({ - * description: 'New description', - * }) - * .then(console.log) - * .catch(console.error); - */ - edit(data) { - return this.manager.edit(this, data, this.guildId); - } - - /** - * Edits the name of this ApplicationCommand - * @param {string} name The new name of the command - * @returns {Promise} - */ - setName(name) { - return this.edit({ name }); - } - - /** - * Edits the localized names of this ApplicationCommand - * @param {Object} nameLocalizations The new localized names for the command - * @returns {Promise} - * @example - * // Edit the name localizations of this command - * command.setLocalizedNames({ - * 'en-GB': 'test', - * 'pt-BR': 'teste', - * }) - * .then(console.log) - * .catch(console.error) - */ - setNameLocalizations(nameLocalizations) { - return this.edit({ nameLocalizations }); - } - - /** - * Edits the description of this ApplicationCommand - * @param {string} description The new description of the command - * @returns {Promise} - */ - setDescription(description) { - return this.edit({ description }); - } - - /** - * Edits the localized descriptions of this ApplicationCommand - * @param {Object} descriptionLocalizations The new localized descriptions for the command - * @returns {Promise} - * @example - * // Edit the description localizations of this command - * command.setLocalizedDescriptions({ - * 'en-GB': 'A test command', - * 'pt-BR': 'Um comando de teste', - * }) - * .then(console.log) - * .catch(console.error) - */ - setDescriptionLocalizations(descriptionLocalizations) { - return this.edit({ descriptionLocalizations }); - } - - /* eslint-disable max-len */ - /** - * Edits the default permission of this ApplicationCommand - * @param {boolean} [defaultPermission=true] The default permission for this command - * @returns {Promise} - * @deprecated Use {@link ApplicationCommand#setDefaultMemberPermissions} and {@link ApplicationCommand#setDMPermission} instead. - */ - setDefaultPermission(defaultPermission = true) { - return this.edit({ defaultPermission }); - } - /* eslint-enable max-len */ - - /** - * Edits the default member permissions of this ApplicationCommand - * @param {?PermissionResolvable} defaultMemberPermissions The default member permissions required to run this command - * @returns {Promise} - */ - setDefaultMemberPermissions(defaultMemberPermissions) { - return this.edit({ defaultMemberPermissions }); - } - - /** - * Edits the DM permission of this ApplicationCommand - * @param {boolean} [dmPermission=true] Whether the command can be used in DMs - * @returns {Promise} - */ - setDMPermission(dmPermission = true) { - return this.edit({ dmPermission }); - } - - /** - * Edits the options of this ApplicationCommand - * @param {ApplicationCommandOptionData[]} options The options to set for this command - * @returns {Promise} - */ - setOptions(options) { - return this.edit({ options }); - } - - /** - * Deletes this command. - * @returns {Promise} - * @example - * // Delete this command - * command.delete() - * .then(console.log) - * .catch(console.error); - */ - delete() { - return this.manager.delete(this, this.guildId); - } - - /** - * Whether this command equals another command. It compares all properties, so for most operations - * it is advisable to just compare `command.id === command2.id` as it is much faster and is often - * what most users need. - * @param {ApplicationCommand|ApplicationCommandData|APIApplicationCommand} command The command to compare with - * @param {boolean} [enforceOptionOrder=false] Whether to strictly check that options and choices are in the same - * order in the array The client may not always respect this ordering! - * @returns {boolean} - */ - equals(command, enforceOptionOrder = false) { - // If given an id, check if the id matches - if (command.id && this.id !== command.id) return false; - - let defaultMemberPermissions = null; - let dmPermission = command.dmPermission ?? command.dm_permission; - - if ('default_member_permissions' in command) { - defaultMemberPermissions = command.default_member_permissions - ? new Permissions(BigInt(command.default_member_permissions)).bitfield - : null; - } - - if ('defaultMemberPermissions' in command) { - defaultMemberPermissions = - command.defaultMemberPermissions !== null - ? new Permissions(command.defaultMemberPermissions).bitfield - : null; - } - - // Check top level parameters - const commandType = - typeof command.type === 'string' - ? command.type - : ApplicationCommandTypes[command.type]; - if ( - command.name !== this.name || - ('description' in command && command.description !== this.description) || - ('version' in command && command.version !== this.version) || - ('autocomplete' in command && - command.autocomplete !== this.autocomplete) || - (commandType && commandType !== this.type) || - defaultMemberPermissions !== - (this.defaultMemberPermissions?.bitfield ?? null) || - (typeof dmPermission !== 'undefined' && - dmPermission !== this.dmPermission) || - // Future proof for options being nullable - // TODO: remove ?? 0 on each when nullable - (command.options?.length ?? 0) !== (this.options?.length ?? 0) || - (command.defaultPermission ?? command.default_permission ?? true) !== - this.defaultPermission - ) { - return false; - } - - if (command.options) { - return this.constructor.optionsEqual( - this.options, - command.options, - enforceOptionOrder, - ); - } - return true; - } - - /** - * Recursively checks that all options for an {@link ApplicationCommand} are equal to the provided options. - * In most cases it is better to compare using {@link ApplicationCommand#equals} - * @param {ApplicationCommandOptionData[]} existing The options on the existing command, - * should be {@link ApplicationCommand#options} - * @param {ApplicationCommandOptionData[]|APIApplicationCommandOption[]} options The options to compare against - * @param {boolean} [enforceOptionOrder=false] Whether to strictly check that options and choices are in the same - * order in the array The client may not always respect this ordering! - * @returns {boolean} - */ - static optionsEqual(existing, options, enforceOptionOrder = false) { - if (existing.length !== options.length) return false; - if (enforceOptionOrder) { - return existing.every((option, index) => - this._optionEquals(option, options[index], enforceOptionOrder), - ); - } - const newOptions = new Map(options.map((option) => [option.name, option])); - for (const option of existing) { - const foundOption = newOptions.get(option.name); - if (!foundOption || !this._optionEquals(option, foundOption)) - return false; - } - return true; - } - - /** - * Checks that an option for an {@link ApplicationCommand} is equal to the provided option - * In most cases it is better to compare using {@link ApplicationCommand#equals} - * @param {ApplicationCommandOptionData} existing The option on the existing command, - * should be from {@link ApplicationCommand#options} - * @param {ApplicationCommandOptionData|APIApplicationCommandOption} option The option to compare against - * @param {boolean} [enforceOptionOrder=false] Whether to strictly check that options or choices are in the same - * order in their array The client may not always respect this ordering! - * @returns {boolean} - * @private - */ - static _optionEquals(existing, option, enforceOptionOrder = false) { - const optionType = - typeof option.type === 'string' - ? option.type - : ApplicationCommandOptionTypes[option.type]; - if ( - option.name !== existing.name || - optionType !== existing.type || - option.description !== existing.description || - option.autocomplete !== existing.autocomplete || - (option.required ?? - (['SUB_COMMAND', 'SUB_COMMAND_GROUP'].includes(optionType) - ? undefined - : false)) !== existing.required || - option.choices?.length !== existing.choices?.length || - option.options?.length !== existing.options?.length || - (option.channelTypes ?? option.channel_types)?.length !== - existing.channelTypes?.length || - (option.minValue ?? option.min_value) !== existing.minValue || - (option.maxValue ?? option.max_value) !== existing.maxValue || - (option.minLength ?? option.min_length) !== existing.minLength || - (option.maxLength ?? option.max_length) !== existing.maxLength - ) { - return false; - } - - if (existing.choices) { - if ( - enforceOptionOrder && - !existing.choices.every( - (choice, index) => - choice.name === option.choices[index].name && - choice.value === option.choices[index].value, - ) - ) { - return false; - } - if (!enforceOptionOrder) { - const newChoices = new Map( - option.choices.map((choice) => [choice.name, choice]), - ); - for (const choice of existing.choices) { - const foundChoice = newChoices.get(choice.name); - if (!foundChoice || foundChoice.value !== choice.value) return false; - } - } - } - - if (existing.channelTypes) { - const newTypes = (option.channelTypes ?? option.channel_types).map( - (type) => (typeof type === 'number' ? ChannelTypes[type] : type), - ); - for (const type of existing.channelTypes) { - if (!newTypes.includes(type)) return false; - } - } - - if (existing.options) { - return this.optionsEqual( - existing.options, - option.options, - enforceOptionOrder, - ); - } - return true; - } - - /** - * An option for an application command or subcommand. - * @typedef {Object} ApplicationCommandOption - * @property {ApplicationCommandOptionType} type The type of the option - * @property {string} name The name of the option - * @property {Object} [nameLocalizations] The localizations for the option name - * @property {string} [nameLocalized] The localized name for this option - * @property {string} description The description of the option - * @property {Object} [descriptionLocalizations] The localizations for the option description - * @property {string} [descriptionLocalized] The localized description for this option - * @property {boolean} [required] Whether the option is required - * @property {boolean} [autocomplete] Whether the option is an autocomplete option - * @property {ApplicationCommandOptionChoice[]} [choices] The choices of the option for the user to pick from - * @property {ApplicationCommandOption[]} [options] Additional options if this option is a subcommand (group) - * @property {ChannelType[]} [channelTypes] When the option type is channel, - * the allowed types of channels that can be selected - * @property {number} [minValue] The minimum value for an `INTEGER` or `NUMBER` option - * @property {number} [maxValue] The maximum value for an `INTEGER` or `NUMBER` option - * @property {number} [minLength] The minimum length for a `STRING` option - * (maximum of `6000`) - * @property {number} [maxLength] The maximum length for a `STRING` option - * (maximum of `6000`) - */ - - /** - * A choice for an application command option. - * @typedef {Object} ApplicationCommandOptionChoice - * @property {string} name The name of the choice - * @property {?string} nameLocalized The localized name of the choice in the provided locale, if any - * @property {?Object} [nameLocalizations] The localized names for this choice - * @property {string|number} value The value of the choice - */ - - /** - * Transforms an {@link ApplicationCommandOptionData} object into something that can be used with the API. - * @param {ApplicationCommandOptionData|ApplicationCommandOption} option The option to transform - * @param {boolean} [received] Whether this option has been received from Discord - * @returns {APIApplicationCommandOption} - * @private - */ - static transformOption(option, received) { - const stringType = - typeof option.type === 'string' - ? option.type - : ApplicationCommandOptionTypes[option.type]; - const channelTypesKey = received ? 'channelTypes' : 'channel_types'; - const minValueKey = received ? 'minValue' : 'min_value'; - const maxValueKey = received ? 'maxValue' : 'max_value'; - const minLengthKey = received ? 'minLength' : 'min_length'; - const maxLengthKey = received ? 'maxLength' : 'max_length'; - const nameLocalizationsKey = received - ? 'nameLocalizations' - : 'name_localizations'; - const nameLocalizedKey = received ? 'nameLocalized' : 'name_localized'; - const descriptionLocalizationsKey = received - ? 'descriptionLocalizations' - : 'description_localizations'; - const descriptionLocalizedKey = received - ? 'descriptionLocalized' - : 'description_localized'; - return { - type: - typeof option.type === 'number' && !received - ? option.type - : ApplicationCommandOptionTypes[option.type], - name: option.name, - [nameLocalizationsKey]: - option.nameLocalizations ?? option.name_localizations, - [nameLocalizedKey]: option.nameLocalized ?? option.name_localized, - description: option.description, - [descriptionLocalizationsKey]: - option.descriptionLocalizations ?? option.description_localizations, - [descriptionLocalizedKey]: - option.descriptionLocalized ?? option.description_localized, - required: - option.required ?? - (stringType === 'SUB_COMMAND' || stringType === 'SUB_COMMAND_GROUP' - ? undefined - : false), - autocomplete: option.autocomplete, - choices: option.choices?.map((choice) => ({ - name: choice.name, - [nameLocalizedKey]: choice.nameLocalized ?? choice.name_localized, - [nameLocalizationsKey]: - choice.nameLocalizations ?? choice.name_localizations, - value: choice.value, - })), - options: option.options?.map((o) => this.transformOption(o, received)), - [channelTypesKey]: received - ? option.channel_types?.map((type) => ChannelTypes[type]) - : (option.channelTypes?.map((type) => - typeof type === 'string' ? ChannelTypes[type] : type, - ) ?? - // When transforming to API data, accept API data - option.channel_types), - [minValueKey]: option.minValue ?? option.min_value, - [maxValueKey]: option.maxValue ?? option.max_value, - [minLengthKey]: option.minLength ?? option.min_length, - [maxLengthKey]: option.maxLength ?? option.max_length, - }; - } -} - -module.exports = ApplicationCommand; - -/* eslint-disable max-len */ -/** - * @external APIApplicationCommand - * @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure} - */ - -/** - * @external APIApplicationCommandOption - * @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure} - */ diff --git a/vendor/discord.js-selfbot-v13/src/structures/ApplicationRoleConnectionMetadata.js b/vendor/discord.js-selfbot-v13/src/structures/ApplicationRoleConnectionMetadata.js deleted file mode 100644 index a1c8a6d..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/ApplicationRoleConnectionMetadata.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -const { ApplicationRoleConnectionMetadataTypes } = require('../util/Constants'); - -/** - * Role connection metadata object for an application. - */ -class ApplicationRoleConnectionMetadata { - constructor(data) { - /** - * The name of this metadata field - * @type {string} - */ - this.name = data.name; - - /** - * The name localizations for this metadata field - * @type {?Object} - */ - this.nameLocalizations = data.name_localizations ?? null; - - /** - * The description of this metadata field - * @type {string} - */ - this.description = data.description; - - /** - * The description localizations for this metadata field - * @type {?Object} - */ - this.descriptionLocalizations = data.description_localizations ?? null; - - /** - * The dictionary key for this metadata field - * @type {string} - */ - this.key = data.key; - - /** - * The type of this metadata field - * @type {ApplicationRoleConnectionMetadataType} - */ - this.type = - typeof data.type === 'number' - ? ApplicationRoleConnectionMetadataTypes[data.type] - : data.type; - } -} - -exports.ApplicationRoleConnectionMetadata = ApplicationRoleConnectionMetadata; diff --git a/vendor/discord.js-selfbot-v13/src/structures/AutoModerationActionExecution.js b/vendor/discord.js-selfbot-v13/src/structures/AutoModerationActionExecution.js deleted file mode 100644 index a5efa95..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/AutoModerationActionExecution.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict'; - -const { AutoModerationRuleTriggerTypes } = require('../util/Constants'); - -/** - * Represents the structure of an executed action when an {@link AutoModerationRule} is triggered. - */ -class AutoModerationActionExecution { - constructor(data, guild) { - /** - * The guild where this action was executed from. - * @type {Guild} - */ - this.guild = guild; - - /** - * The action that was executed. - * @type {AutoModerationAction} - */ - this.action = data.action; - - /** - * The id of the auto moderation rule this action belongs to. - * @type {Snowflake} - */ - this.ruleId = data.rule_id; - - /** - * The trigger type of the auto moderation rule which was triggered. - * @type {AutoModerationRuleTriggerType} - */ - this.ruleTriggerType = - AutoModerationRuleTriggerTypes[data.rule_trigger_type]; - - /** - * The id of the user that triggered this action. - * @type {Snowflake} - */ - this.userId = data.user_id; - - /** - * The id of the channel where this action was triggered from. - * @type {?Snowflake} - */ - this.channelId = data.channel_id ?? null; - - /** - * The id of the message that triggered this action. - * @type {?Snowflake} - * This will not be present if the message was blocked or the content was not part of any message. - */ - this.messageId = data.message_id ?? null; - - /** - * The id of any system auto moderation messages posted as a result of this action. - * @type {?Snowflake} - */ - this.alertSystemMessageId = data.alert_system_message_id ?? null; - - /** - * The content that triggered this action. - * This property requires the {@link Intents.FLAGS.MESSAGE_CONTENT} privileged gateway intent. - * @type {string} - */ - this.content = data.content; - - /** - * The word or phrase configured in the rule that triggered this action. - * @type {?string} - */ - this.matchedKeyword = data.matched_keyword ?? null; - - /** - * The substring in content that triggered this action. - * @type {?string} - */ - this.matchedContent = data.matched_content ?? null; - } - - /** - * The auto moderation rule this action belongs to. - * @type {?AutoModerationRule} - * @readonly - */ - get autoModerationRule() { - return this.guild.autoModerationRules.cache.get(this.ruleId) ?? null; - } -} - -module.exports = AutoModerationActionExecution; diff --git a/vendor/discord.js-selfbot-v13/src/structures/AutoModerationRule.js b/vendor/discord.js-selfbot-v13/src/structures/AutoModerationRule.js deleted file mode 100644 index e075d32..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/AutoModerationRule.js +++ /dev/null @@ -1,325 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const Base = require('./Base'); -const { - AutoModerationRuleKeywordPresetTypes, - AutoModerationRuleTriggerTypes, - AutoModerationRuleEventTypes, - AutoModerationActionTypes, -} = require('../util/Constants'); - -/** - * Represents an auto moderation rule. - * @extends {Base} - */ -class AutoModerationRule extends Base { - constructor(client, data, guild) { - super(client); - - /** - * The id of this auto moderation rule. - * @type {Snowflake} - */ - this.id = data.id; - - /** - * The guild this auto moderation rule is for. - * @type {Guild} - */ - this.guild = guild; - - /** - * The user that created this auto moderation rule. - * @type {Snowflake} - */ - this.creatorId = data.creator_id; - - /** - * The trigger type of this auto moderation rule. - * @type {AutoModerationRuleTriggerType} - */ - this.triggerType = AutoModerationRuleTriggerTypes[data.trigger_type]; - - this._patch(data); - } - - _patch(data) { - if ('name' in data) { - /** - * The name of this auto moderation rule. - * @type {string} - */ - this.name = data.name; - } - - if ('event_type' in data) { - /** - * The event type of this auto moderation rule. - * @type {AutoModerationRuleEventType} - */ - this.eventType = AutoModerationRuleEventTypes[data.event_type]; - } - - if ('trigger_metadata' in data) { - /** - * Additional data used to determine whether an auto moderation rule should be triggered. - * @typedef {Object} AutoModerationTriggerMetadata - * @property {string[]} keywordFilter The substrings that will be searched for in the content - * @property {string[]} regexPatterns The regular expression patterns which will be matched against the content - * Only Rust-flavored regular expressions are supported. - * @property {AutoModerationRuleKeywordPresetType[]} presets - * The internally pre-defined wordsets which will be searched for in the content - * @property {string[]} allowList The substrings that will be exempt from triggering - * {@link AutoModerationRuleTriggerType.KEYWORD} and {@link AutoModerationRuleTriggerType.KEYWORD_PRESET} - * @property {?number} mentionTotalLimit The total number of role & user mentions allowed per message - * @property {boolean} mentionRaidProtectionEnabled Whether mention raid protection is enabled - */ - - /** - * The trigger metadata of the rule. - * @type {AutoModerationTriggerMetadata} - */ - this.triggerMetadata = { - keywordFilter: data.trigger_metadata.keyword_filter ?? [], - regexPatterns: data.trigger_metadata.regex_patterns ?? [], - presets: - data.trigger_metadata.presets?.map( - (preset) => AutoModerationRuleKeywordPresetTypes[preset], - ) ?? [], - allowList: data.trigger_metadata.allow_list ?? [], - mentionTotalLimit: data.trigger_metadata.mention_total_limit ?? null, - mentionRaidProtectionEnabled: - data.trigger_metadata.mention_raid_protection_enabled ?? false, - }; - } - - if ('actions' in data) { - /** - * An object containing information about an auto moderation rule action. - * @typedef {Object} AutoModerationAction - * @property {AutoModerationActionType} type The type of this auto moderation rule action - * @property {AutoModerationActionMetadata} metadata Additional metadata needed during execution - */ - - /** - * Additional data used when an auto moderation rule is executed. - * @typedef {Object} AutoModerationActionMetadata - * @property {?Snowflake} channelId The id of the channel to which content will be logged - * @property {?number} durationSeconds The timeout duration in seconds - * @property {?string} customMessage The custom message that is shown whenever a message is blocked - */ - - /** - * The actions of this auto moderation rule. - * @type {AutoModerationAction[]} - */ - this.actions = data.actions.map((action) => ({ - type: AutoModerationActionTypes[action.type], - metadata: { - durationSeconds: action.metadata.duration_seconds ?? null, - channelId: action.metadata.channel_id ?? null, - customMessage: action.metadata.custom_message ?? null, - }, - })); - } - - if ('enabled' in data) { - /** - * Whether this auto moderation rule is enabled. - * @type {boolean} - */ - this.enabled = data.enabled; - } - - if ('exempt_roles' in data) { - /** - * The roles exempt by this auto moderation rule. - * @type {Collection} - */ - this.exemptRoles = new Collection( - data.exempt_roles.map((exemptRole) => [ - exemptRole, - this.guild.roles.cache.get(exemptRole), - ]), - ); - } - - if ('exempt_channels' in data) { - /** - * The channels exempt by this auto moderation rule. - * @type {Collection} - */ - this.exemptChannels = new Collection( - data.exempt_channels.map((exemptChannel) => [ - exemptChannel, - this.guild.channels.cache.get(exemptChannel), - ]), - ); - } - } - - /** - * Edits this auto moderation rule. - * @param {AutoModerationRuleEditOptions} options Options for editing this auto moderation rule - * @returns {Promise} - */ - edit(options) { - return this.guild.autoModerationRules.edit(this.id, options); - } - - /** - * Deletes this auto moderation rule. - * @param {string} [reason] The reason for deleting this auto moderation rule - * @returns {Promise} - */ - delete(reason) { - return this.guild.autoModerationRules.delete(this.id, reason); - } - - /** - * Sets the name for this auto moderation rule. - * @param {string} name The name of this auto moderation rule - * @param {string} [reason] The reason for changing the name of this auto moderation rule - * @returns {Promise} - */ - setName(name, reason) { - return this.edit({ name, reason }); - } - - /** - * Sets the event type for this auto moderation rule. - * @param {AutoModerationRuleEventType} eventType The event type of this auto moderation rule - * @param {string} [reason] The reason for changing the event type of this auto moderation rule - * @returns {Promise} - */ - setEventType(eventType, reason) { - return this.edit({ eventType, reason }); - } - - /** - * Sets the keyword filter for this auto moderation rule. - * @param {string[]} keywordFilter The keyword filter of this auto moderation rule - * @param {string} [reason] The reason for changing the keyword filter of this auto moderation rule - * @returns {Promise} - */ - setKeywordFilter(keywordFilter, reason) { - return this.edit({ - triggerMetadata: { ...this.triggerMetadata, keywordFilter }, - reason, - }); - } - - /** - * Sets the regular expression patterns for this auto moderation rule. - * @param {string[]} regexPatterns The regular expression patterns of this auto moderation rule - * Only Rust-flavored regular expressions are supported. - * @param {string} [reason] The reason for changing the regular expression patterns of this auto moderation rule - * @returns {Promise} - */ - setRegexPatterns(regexPatterns, reason) { - return this.edit({ - triggerMetadata: { ...this.triggerMetadata, regexPatterns }, - reason, - }); - } - - /** - * Sets the presets for this auto moderation rule. - * @param {AutoModerationRuleKeywordPresetType[]} presets The presets of this auto moderation rule - * @param {string} [reason] The reason for changing the presets of this auto moderation rule - * @returns {Promise} - */ - setPresets(presets, reason) { - return this.edit({ - triggerMetadata: { ...this.triggerMetadata, presets }, - reason, - }); - } - - /** - * Sets the allow list for this auto moderation rule. - * @param {string[]} allowList The allow list of this auto moderation rule - * @param {string} [reason] The reason for changing the allow list of this auto moderation rule - * @returns {Promise} - */ - setAllowList(allowList, reason) { - return this.edit({ - triggerMetadata: { ...this.triggerMetadata, allowList }, - reason, - }); - } - - /** - * Sets the mention total limit for this auto moderation rule. - * @param {number} mentionTotalLimit The mention total limit of this auto moderation rule - * @param {string} [reason] The reason for changing the mention total limit of this auto moderation rule - * @returns {Promise} - */ - setMentionTotalLimit(mentionTotalLimit, reason) { - return this.edit({ - triggerMetadata: { ...this.triggerMetadata, mentionTotalLimit }, - reason, - }); - } - - /** - * Sets whether to enable mention raid protection for this auto moderation rule. - * @param {boolean} mentionRaidProtectionEnabled - * Whether to enable mention raid protection for this auto moderation rule - * @param {string} [reason] The reason for changing the mention raid protection of this auto moderation rule - * @returns {Promise} - */ - setMentionRaidProtectionEnabled(mentionRaidProtectionEnabled, reason) { - return this.edit({ - triggerMetadata: { - ...this.triggerMetadata, - mentionRaidProtectionEnabled, - }, - reason, - }); - } - - /** - * Sets the actions for this auto moderation rule. - * @param {AutoModerationActionOptions[]} actions The actions of this auto moderation rule - * @param {string} [reason] The reason for changing the actions of this auto moderation rule - * @returns {Promise} - */ - setActions(actions, reason) { - return this.edit({ actions, reason }); - } - - /** - * Sets whether this auto moderation rule should be enabled. - * @param {boolean} [enabled=true] Whether to enable this auto moderation rule - * @param {string} [reason] The reason for enabling or disabling this auto moderation rule - * @returns {Promise} - */ - setEnabled(enabled = true, reason) { - return this.edit({ enabled, reason }); - } - - /** - * Sets the exempt roles for this auto moderation rule. - * @param {Collection|RoleResolvable[]} [exemptRoles] The exempt roles of this auto moderation rule - * @param {string} [reason] The reason for changing the exempt roles of this auto moderation rule - * @returns {Promise} - */ - setExemptRoles(exemptRoles, reason) { - return this.edit({ exemptRoles, reason }); - } - - /** - * Sets the exempt channels for this auto moderation rule. - * @param {Collection|GuildChannelResolvable[]} [exemptChannels] - * The exempt channels of this auto moderation rule - * @param {string} [reason] The reason for changing the exempt channels of this auto moderation rule - * @returns {Promise} - */ - setExemptChannels(exemptChannels, reason) { - return this.edit({ exemptChannels, reason }); - } -} - -module.exports = AutoModerationRule; diff --git a/vendor/discord.js-selfbot-v13/src/structures/AutocompleteInteraction.js b/vendor/discord.js-selfbot-v13/src/structures/AutocompleteInteraction.js deleted file mode 100644 index f95ee34..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/AutocompleteInteraction.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict'; - -const CommandInteractionOptionResolver = require('./CommandInteractionOptionResolver'); -const Interaction = require('./Interaction'); -const { Error } = require('../errors'); -const { - InteractionResponseTypes, - ApplicationCommandOptionTypes, -} = require('../util/Constants'); - -/** - * Represents an autocomplete interaction. - * @extends {Interaction} - */ -class AutocompleteInteraction extends Interaction { - constructor(client, data) { - super(client, data); - - /** - * The id of the channel this interaction was sent in - * @type {Snowflake} - * @name AutocompleteInteraction#channelId - */ - - /** - * The invoked application command's id - * @type {Snowflake} - */ - this.commandId = data.data.id; - - /** - * The invoked application command's name - * @type {string} - */ - this.commandName = data.data.name; - - /** - * Whether this interaction has already received a response - * @type {boolean} - */ - this.responded = false; - - /** - * The options passed to the command - * @type {CommandInteractionOptionResolver} - */ - this.options = new CommandInteractionOptionResolver( - this.client, - data.data.options?.map((option) => - this.transformOption(option, data.data.resolved), - ) ?? [], - ); - } - - /** - * The invoked application command, if it was fetched before - * @type {?ApplicationCommand} - */ - get command() { - const id = this.commandId; - return ( - this.guild?.commands.cache.get(id) ?? - this.client.application.commands.cache.get(id) ?? - null - ); - } - - /** - * Transforms an option received from the API. - * @param {APIApplicationCommandOption} option The received option - * @returns {CommandInteractionOption} - * @private - */ - transformOption(option) { - const result = { - name: option.name, - type: ApplicationCommandOptionTypes[option.type], - }; - - if ('value' in option) result.value = option.value; - if ('options' in option) - result.options = option.options.map((opt) => this.transformOption(opt)); - if ('focused' in option) result.focused = option.focused; - - return result; - } - - /** - * Sends results for the autocomplete of this interaction. - * @param {ApplicationCommandOptionChoiceData[]} options The options for the autocomplete - * @returns {Promise} - * @example - * // respond to autocomplete interaction - * interaction.respond([ - * { - * name: 'Option 1', - * value: 'option1', - * }, - * ]) - * .then(console.log) - * .catch(console.error); - */ - async respond(options) { - if (this.responded) throw new Error('INTERACTION_ALREADY_REPLIED'); - - await this.client.api.interactions(this.id, this.token).callback.post({ - data: { - type: InteractionResponseTypes.APPLICATION_COMMAND_AUTOCOMPLETE_RESULT, - data: { - choices: options.map((choice) => ({ - ...choice, - name_localizations: options.nameLocalizations, - })), - }, - }, - auth: false, - }); - this.responded = true; - } -} - -module.exports = AutocompleteInteraction; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Base.js b/vendor/discord.js-selfbot-v13/src/structures/Base.js deleted file mode 100644 index cd43bf7..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Base.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -const Util = require('../util/Util'); - -/** - * Represents a data model that is identifiable by a Snowflake (i.e. Discord API data models). - * @abstract - */ -class Base { - constructor(client) { - /** - * The client that instantiated this - * @name Base#client - * @type {Client} - * @readonly - */ - Object.defineProperty(this, 'client', { value: client }); - } - - _clone() { - return Object.assign(Object.create(this), this); - } - - _patch(data) { - return data; - } - - _update(data) { - const clone = this._clone(); - this._patch(data); - return clone; - } - - toJSON(...props) { - return Util.flatten(this, ...props); - } - - valueOf() { - return this.id; - } -} - -module.exports = Base; diff --git a/vendor/discord.js-selfbot-v13/src/structures/BaseCommandInteraction.js b/vendor/discord.js-selfbot-v13/src/structures/BaseCommandInteraction.js deleted file mode 100644 index 9833895..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/BaseCommandInteraction.js +++ /dev/null @@ -1,253 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const Interaction = require('./Interaction'); -const InteractionWebhook = require('./InteractionWebhook'); -const MessageAttachment = require('./MessageAttachment'); -const InteractionResponses = require('./interfaces/InteractionResponses'); -const { ApplicationCommandOptionTypes } = require('../util/Constants'); - -/** - * Represents a command interaction. - * @extends {Interaction} - * @implements {InteractionResponses} - * @abstract - */ -class BaseCommandInteraction extends Interaction { - constructor(client, data) { - super(client, data); - - /** - * The id of the channel this interaction was sent in - * @type {Snowflake} - * @name BaseCommandInteraction#channelId - */ - - /** - * The invoked application command's id - * @type {Snowflake} - */ - this.commandId = data.data.id; - - /** - * The invoked application command's name - * @type {string} - */ - this.commandName = data.data.name; - - /** - * Whether the reply to this interaction has been deferred - * @type {boolean} - */ - this.deferred = false; - - /** - * Whether this interaction has already been replied to - * @type {boolean} - */ - this.replied = false; - - /** - * Whether the reply to this interaction is ephemeral - * @type {?boolean} - */ - this.ephemeral = null; - - /** - * An associated interaction webhook, can be used to further interact with this interaction - * @type {InteractionWebhook} - */ - this.webhook = new InteractionWebhook( - this.client, - this.applicationId, - this.token, - ); - } - - /** - * The invoked application command, if it was fetched before - * @type {?ApplicationCommand} - */ - get command() { - const id = this.commandId; - return ( - this.guild?.commands.cache.get(id) ?? - this.client.application.commands.cache.get(id) ?? - null - ); - } - - /** - * Represents the resolved data of a received command interaction. - * @typedef {Object} CommandInteractionResolvedData - * @property {Collection} [users] The resolved users - * @property {Collection} [members] The resolved guild members - * @property {Collection} [roles] The resolved roles - * @property {Collection} [channels] The resolved channels - * @property {Collection} [messages] The resolved messages - * @property {Collection} [attachments] The resolved attachments - */ - - /** - * Transforms the resolved received from the API. - * @param {APIInteractionDataResolved} resolved The received resolved objects - * @returns {CommandInteractionResolvedData} - * @private - */ - transformResolved({ - members, - users, - channels, - roles, - messages, - attachments, - }) { - const result = {}; - - if (members) { - result.members = new Collection(); - for (const [id, member] of Object.entries(members)) { - const user = users[id]; - result.members.set( - id, - this.guild?.members._add({ user, ...member }) ?? member, - ); - } - } - - if (users) { - result.users = new Collection(); - for (const user of Object.values(users)) { - result.users.set(user.id, this.client.users._add(user)); - } - } - - if (roles) { - result.roles = new Collection(); - for (const role of Object.values(roles)) { - result.roles.set(role.id, this.guild?.roles._add(role) ?? role); - } - } - - if (channels) { - result.channels = new Collection(); - for (const channel of Object.values(channels)) { - result.channels.set( - channel.id, - this.client.channels._add(channel, this.guild) ?? channel, - ); - } - } - - if (messages) { - result.messages = new Collection(); - for (const message of Object.values(messages)) { - result.messages.set( - message.id, - this.channel?.messages?._add(message) ?? message, - ); - } - } - - if (attachments) { - result.attachments = new Collection(); - for (const attachment of Object.values(attachments)) { - const patched = new MessageAttachment( - attachment.url, - attachment.filename, - attachment, - ); - result.attachments.set(attachment.id, patched); - } - } - - return result; - } - - /** - * Represents an option of a received command interaction. - * @typedef {Object} CommandInteractionOption - * @property {string} name The name of the option - * @property {ApplicationCommandOptionType} type The type of the option - * @property {boolean} [autocomplete] Whether the option is an autocomplete option - * @property {string|number|boolean} [value] The value of the option - * @property {CommandInteractionOption[]} [options] Additional options if this option is a - * subcommand (group) - * @property {User} [user] The resolved user - * @property {GuildMember|APIGuildMember} [member] The resolved member - * @property {GuildChannel|ThreadChannel|APIChannel} [channel] The resolved channel - * @property {Role|APIRole} [role] The resolved role - * @property {MessageAttachment} [attachment] The resolved attachment - */ - - /** - * Transforms an option received from the API. - * @param {APIApplicationCommandOption} option The received option - * @param {APIInteractionDataResolved} resolved The resolved interaction data - * @returns {CommandInteractionOption} - * @private - */ - transformOption(option, resolved) { - const result = { - name: option.name, - type: ApplicationCommandOptionTypes[option.type], - }; - - if ('value' in option) result.value = option.value; - if ('options' in option) - result.options = option.options.map((opt) => - this.transformOption(opt, resolved), - ); - - if (resolved) { - const user = resolved.users?.[option.value]; - if (user) result.user = this.client.users._add(user); - - const member = resolved.members?.[option.value]; - if (member) - result.member = this.guild?.members._add({ user, ...member }) ?? member; - - const channel = resolved.channels?.[option.value]; - if (channel) - result.channel = - this.client.channels._add(channel, this.guild) ?? channel; - - const role = resolved.roles?.[option.value]; - if (role) result.role = this.guild?.roles._add(role) ?? role; - - const attachment = resolved.attachments?.[option.value]; - if (attachment) - result.attachment = new MessageAttachment( - attachment.url, - attachment.filename, - attachment, - ); - } - - return result; - } - - // These are here only for documentation purposes - they are implemented by InteractionResponses - /* eslint-disable no-empty-function */ - deferReply() {} - reply() {} - fetchReply() {} - editReply() {} - deleteReply() {} - followUp() {} - showModal() {} - awaitModalSubmit() {} -} - -InteractionResponses.applyToClass(BaseCommandInteraction, [ - 'deferUpdate', - 'update', -]); - -module.exports = BaseCommandInteraction; - -/* eslint-disable max-len */ -/** - * @external APIInteractionDataResolved - * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure} - */ diff --git a/vendor/discord.js-selfbot-v13/src/structures/BaseGuild.js b/vendor/discord.js-selfbot-v13/src/structures/BaseGuild.js deleted file mode 100644 index 656da7b..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/BaseGuild.js +++ /dev/null @@ -1,118 +0,0 @@ -'use strict'; - -const Base = require('./Base'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); - -/** - * The base class for {@link Guild}, {@link OAuth2Guild} and {@link InviteGuild}. - * @extends {Base} - * @abstract - */ -class BaseGuild extends Base { - constructor(client, data) { - super(client); - - /** - * The guild's id - * @type {Snowflake} - */ - this.id = data.id; - - /** - * The name of this guild - * @type {string} - */ - this.name = data.name; - - /** - * The icon hash of this guild - * @type {?string} - */ - this.icon = data.icon ?? null; - - /** - * An array of features available to this guild - * @type {Features[]} - */ - this.features = data.features; - } - - /** - * The timestamp this guild was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return SnowflakeUtil.timestampFrom(this.id); - } - - /** - * The time this guild was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * The acronym that shows up in place of a guild icon - * @type {string} - * @readonly - */ - get nameAcronym() { - return this.name - .replace(/'s /g, ' ') - .replace(/\w+/g, (e) => e[0]) - .replace(/\s/g, ''); - } - - /** - * Whether this guild is partnered - * @type {boolean} - * @readonly - */ - get partnered() { - return this.features.includes('PARTNERED'); - } - - /** - * Whether this guild is verified - * @type {boolean} - * @readonly - */ - get verified() { - return this.features.includes('VERIFIED'); - } - - /** - * The URL to this guild's icon. - * @param {ImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - iconURL({ format, size, dynamic } = {}) { - if (!this.icon) return null; - return this.client.rest.cdn.Icon(this.id, this.icon, format, size, dynamic); - } - - /** - * Fetches this guild. - * @returns {Promise} - */ - async fetch() { - const data = await this.client.api - .guilds(this.id) - .get({ query: { with_counts: true } }); - return this.client.guilds._add(data); - } - - /** - * When concatenated with a string, this automatically returns the guild's name instead of the Guild object. - * @returns {string} - */ - toString() { - return this.name; - } -} - -module.exports = BaseGuild; diff --git a/vendor/discord.js-selfbot-v13/src/structures/BaseGuildEmoji.js b/vendor/discord.js-selfbot-v13/src/structures/BaseGuildEmoji.js deleted file mode 100644 index 5a12bd9..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/BaseGuildEmoji.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -const { Emoji } = require('./Emoji'); - -/** - * Parent class for {@link GuildEmoji} and {@link GuildPreviewEmoji}. - * @extends {Emoji} - * @abstract - */ -class BaseGuildEmoji extends Emoji { - constructor(client, data, guild) { - super(client, data); - - /** - * The guild this emoji is a part of - * @type {Guild|GuildPreview} - */ - this.guild = guild; - - this.requiresColons = null; - this.managed = null; - this.available = null; - - this._patch(data); - } - - _patch(data) { - if ('name' in data) this.name = data.name; - - if ('require_colons' in data) { - /** - * Whether or not this emoji requires colons surrounding it - * @type {?boolean} - */ - this.requiresColons = data.require_colons; - } - - if ('managed' in data) { - /** - * Whether this emoji is managed by an external service - * @type {?boolean} - */ - this.managed = data.managed; - } - - if ('available' in data) { - /** - * Whether this emoji is available - * @type {?boolean} - */ - this.available = data.available; - } - } -} - -module.exports = BaseGuildEmoji; diff --git a/vendor/discord.js-selfbot-v13/src/structures/BaseGuildTextChannel.js b/vendor/discord.js-selfbot-v13/src/structures/BaseGuildTextChannel.js deleted file mode 100644 index a779797..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/BaseGuildTextChannel.js +++ /dev/null @@ -1,194 +0,0 @@ -'use strict'; - -const GuildChannel = require('./GuildChannel'); -const TextBasedChannel = require('./interfaces/TextBasedChannel'); -const GuildTextThreadManager = require('../managers/GuildTextThreadManager'); -const MessageManager = require('../managers/MessageManager'); - -/** - * Represents a text-based guild channel on Discord. - * @extends {GuildChannel} - * @implements {TextBasedChannel} - */ -class BaseGuildTextChannel extends GuildChannel { - constructor(guild, data, client) { - super(guild, data, client, false); - - /** - * A manager of the messages sent to this channel - * @type {MessageManager} - */ - this.messages = new MessageManager(this); - - /** - * A manager of the threads belonging to this channel - * @type {GuildTextThreadManager} - */ - this.threads = new GuildTextThreadManager(this); - - /** - * If the guild considers this channel NSFW - * @type {boolean} - */ - this.nsfw = Boolean(data.nsfw); - - this._patch(data); - } - - _patch(data) { - super._patch(data); - - if ('topic' in data) { - /** - * The topic of the text channel - * @type {?string} - */ - this.topic = data.topic; - } - - if ('nsfw' in data) { - this.nsfw = Boolean(data.nsfw); - } - - if ('last_message_id' in data) { - /** - * The last message id sent in the channel, if one was sent - * @type {?Snowflake} - */ - this.lastMessageId = data.last_message_id; - } - - if ('last_pin_timestamp' in data) { - /** - * The timestamp when the last pinned message was pinned, if there was one - * @type {?number} - */ - this.lastPinTimestamp = data.last_pin_timestamp - ? new Date(data.last_pin_timestamp).getTime() - : null; - } - - if ('default_auto_archive_duration' in data) { - /** - * The default auto archive duration for newly created threads in this channel - * @type {?number} - */ - this.defaultAutoArchiveDuration = data.default_auto_archive_duration; - } - - if ('default_thread_rate_limit_per_user' in data) { - /** - * The initial rate limit per user (slowmode) to set on newly created threads in a channel. - * @type {?number} - */ - this.defaultThreadRateLimitPerUser = - data.default_thread_rate_limit_per_user; - } else { - this.defaultThreadRateLimitPerUser ??= null; - } - - if ('messages' in data) { - for (const message of data.messages) this.messages._add(message); - } - } - - /** - * Sets the default auto archive duration for all newly created threads in this channel. - * @param {ThreadAutoArchiveDuration} defaultAutoArchiveDuration The new default auto archive duration - * @param {string} [reason] Reason for changing the channel's default auto archive duration - * @returns {Promise} - */ - setDefaultAutoArchiveDuration(defaultAutoArchiveDuration, reason) { - return this.edit({ defaultAutoArchiveDuration }, reason); - } - - /** - * Sets the type of this channel (only conversion between text and news is supported) - * @param {string} type The new channel type - * @param {string} [reason] Reason for changing the channel's type - * @returns {Promise} - */ - setType(type, reason) { - return this.edit({ type }, reason); - } - - /** - * Sets a new topic for the guild channel. - * @param {?string} topic The new topic for the guild channel - * @param {string} [reason] Reason for changing the guild channel's topic - * @returns {Promise} - * @example - * // Set a new channel topic - * channel.setTopic('needs more rate limiting') - * .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`)) - * .catch(console.error); - */ - setTopic(topic, reason) { - return this.edit({ topic }, reason); - } - - /** - * Data that can be resolved to an Application. This can be: - * * An Application - * * An Activity with associated Application - * * A Snowflake - * @typedef {Application|Snowflake} ApplicationResolvable - */ - - /** - * Options used to create an invite to a guild channel. - * @typedef {Object} CreateInviteOptions - * @property {boolean} [temporary=false] Whether members that joined via the invite should be automatically - * kicked after 24 hours if they have not yet received a role - * @property {number} [maxAge=86400] How long the invite should last (in seconds, 0 for forever) - * @property {number} [maxUses=0] Maximum number of uses - * @property {boolean} [unique=false] Create a unique invite, or use an existing one with similar settings - * @property {UserResolvable} [targetUser] The user whose stream to display for this invite, - * required if `targetType` is 1, the user must be streaming in the channel - * @property {ApplicationResolvable} [targetApplication] The embedded application to open for this invite, - * required if `targetType` is 2, the application must have the `EMBEDDED` flag - * @property {TargetType} [targetType] The type of the target for this voice channel invite - * @property {string} [reason] The reason for creating the invite - */ - - /** - * Creates an invite to this guild channel. - * @param {CreateInviteOptions} [options={}] The options for creating the invite - * @returns {Promise} - * @example - * // Create an invite to a channel - * channel.createInvite() - * .then(invite => console.log(`Created an invite with a code of ${invite.code}`)) - * .catch(console.error); - */ - createInvite(options) { - return this.guild.invites.create(this.id, options); - } - - /** - * Fetches a collection of invites to this guild channel. - * Resolves with a collection mapping invites by their codes. - * @param {boolean} [cache=true] Whether or not to cache the fetched invites - * @returns {Promise>} - */ - fetchInvites(cache = true) { - return this.guild.invites.fetch({ channelId: this.id, cache }); - } - - // These are here only for documentation purposes - they are implemented by TextBasedChannel - /* eslint-disable no-empty-function */ - get lastMessage() {} - get lastPinAt() {} - send() {} - sendTyping() {} - createMessageCollector() {} - awaitMessages() {} - fetchWebhooks() {} - createWebhook() {} - setRateLimitPerUser() {} - setNSFW() {} -} - -TextBasedChannel.applyToClass(BaseGuildTextChannel, true); - -module.exports = BaseGuildTextChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/BaseGuildVoiceChannel.js b/vendor/discord.js-selfbot-v13/src/structures/BaseGuildVoiceChannel.js deleted file mode 100644 index f48f0de..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/BaseGuildVoiceChannel.js +++ /dev/null @@ -1,241 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const GuildChannel = require('./GuildChannel'); -const TextBasedChannel = require('./interfaces/TextBasedChannel'); -const MessageManager = require('../managers/MessageManager'); -const { VideoQualityModes } = require('../util/Constants'); -const Permissions = require('../util/Permissions'); - -/** - * Represents a voice-based guild channel on Discord. - * @extends {GuildChannel} - * @implements {TextBasedChannel} - */ -class BaseGuildVoiceChannel extends GuildChannel { - constructor(guild, data, client) { - super(guild, data, client, false); - /** - * A manager of the messages sent to this channel - * @type {MessageManager} - */ - this.messages = new MessageManager(this); - - /** - * If the guild considers this channel NSFW - * @type {boolean} - */ - this.nsfw = Boolean(data.nsfw); - - this._patch(data); - } - - _patch(data) { - super._patch(data); - - if ('bitrate' in data) { - /** - * The bitrate of this voice-based channel - * @type {number} - */ - this.bitrate = data.bitrate; - } - - if ('rtc_region' in data) { - /** - * The RTC region for this voice-based channel. This region is automatically selected if `null`. - * @type {?string} - */ - this.rtcRegion = data.rtc_region; - } - - if ('user_limit' in data) { - /** - * The maximum amount of users allowed in this channel. - * @type {number} - */ - this.userLimit = data.user_limit; - } - - if ('video_quality_mode' in data) { - /** - * The camera video quality mode of the channel. - * @type {?VideoQualityMode} - */ - this.videoQualityMode = VideoQualityModes[data.video_quality_mode]; - } else { - this.videoQualityMode ??= null; - } - - if ('last_message_id' in data) { - /** - * The last message id sent in the channel, if one was sent - * @type {?Snowflake} - */ - this.lastMessageId = data.last_message_id; - } - - if ('messages' in data) { - for (const message of data.messages) this.messages._add(message); - } - - if ('rate_limit_per_user' in data) { - /** - * The rate limit per user (slowmode) for this channel in seconds - * @type {number} - */ - this.rateLimitPerUser = data.rate_limit_per_user; - } - - if ('nsfw' in data) { - this.nsfw = data.nsfw; - } - - if ('status' in data) { - /** - * The status of the voice channel (max 500 characters) - * @type {?string} - */ - this.status = data.status; - } - } - - /** - * The members in this voice-based channel - * @type {Collection} - * @readonly - */ - get members() { - const coll = new Collection(); - for (const state of this.guild.voiceStates.cache.values()) { - if (state.channelId === this.id && state.member) { - coll.set(state.id, state.member); - } - } - return coll; - } - - /** - * Checks if the voice-based channel is full - * @type {boolean} - * @readonly - */ - get full() { - return this.userLimit > 0 && this.members.size >= this.userLimit; - } - - /** - * Whether the channel is joinable by the client user - * @type {boolean} - * @readonly - */ - get joinable() { - if (!this.viewable) return false; - const permissions = this.permissionsFor(this.client.user); - if (!permissions) return false; - - // This flag allows joining even if timed out - if (permissions.has(Permissions.FLAGS.ADMINISTRATOR, false)) return true; - - return ( - this.guild.members.me.communicationDisabledUntilTimestamp < Date.now() && - permissions.has(Permissions.FLAGS.CONNECT, false) - ); - } - - /** - * Creates an invite to this guild channel. - * @param {CreateInviteOptions} [options={}] The options for creating the invite - * @returns {Promise} - * @example - * // Create an invite to a channel - * channel.createInvite() - * .then(invite => console.log(`Created an invite with a code of ${invite.code}`)) - * .catch(console.error); - */ - createInvite(options) { - return this.guild.invites.create(this.id, options); - } - - /** - * Fetches a collection of invites to this guild channel. - * Resolves with a collection mapping invites by their codes. - * @param {boolean} [cache=true] Whether or not to cache the fetched invites - * @returns {Promise>} - */ - fetchInvites(cache = true) { - return this.guild.invites.fetch({ channelId: this.id, cache }); - } - - /** - * Sets the bitrate of the channel. - * @param {number} bitrate The new bitrate - * @param {string} [reason] Reason for changing the channel's bitrate - * @returns {Promise} - * @example - * // Set the bitrate of a voice channel - * channel.setBitrate(48_000) - * .then(channel => console.log(`Set bitrate to ${channel.bitrate}bps for ${channel.name}`)) - * .catch(console.error); - */ - setBitrate(bitrate, reason) { - return this.edit({ bitrate }, reason); - } - - /** - * Sets the RTC region of the channel. - * @param {?string} rtcRegion The new region of the channel. Set to `null` to remove a specific region for the channel - * @param {string} [reason] The reason for modifying this region. - * @returns {Promise} - * @example - * // Set the RTC region to sydney - * channel.setRTCRegion('sydney'); - * @example - * // Remove a fixed region for this channel - let Discord decide automatically - * channel.setRTCRegion(null, 'We want to let Discord decide.'); - */ - setRTCRegion(rtcRegion, reason) { - return this.edit({ rtcRegion }, reason); - } - - /** - * Sets the user limit of the channel. - * @param {number} userLimit The new user limit - * @param {string} [reason] Reason for changing the user limit - * @returns {Promise} - * @example - * // Set the user limit of a voice channel - * channel.setUserLimit(42) - * .then(channel => console.log(`Set user limit to ${channel.userLimit} for ${channel.name}`)) - * .catch(console.error); - */ - setUserLimit(userLimit, reason) { - return this.edit({ userLimit }, reason); - } - - /** - * Sets the camera video quality mode of the channel. - * @param {VideoQualityMode|number} videoQualityMode The new camera video quality mode. - * @param {string} [reason] Reason for changing the camera video quality mode. - * @returns {Promise} - */ - setVideoQualityMode(videoQualityMode, reason) { - return this.edit({ videoQualityMode }, reason); - } - - // These are here only for documentation purposes - they are implemented by TextBasedChannel - /* eslint-disable no-empty-function */ - get lastMessage() {} - send() {} - sendTyping() {} - createMessageCollector() {} - awaitMessages() {} - fetchWebhooks() {} - createWebhook() {} - setRateLimitPerUser() {} - setNSFW() {} -} - -TextBasedChannel.applyToClass(BaseGuildVoiceChannel, true, ['lastPinAt']); - -module.exports = BaseGuildVoiceChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/BaseMessageComponent.js b/vendor/discord.js-selfbot-v13/src/structures/BaseMessageComponent.js deleted file mode 100644 index 38167fa..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/BaseMessageComponent.js +++ /dev/null @@ -1,218 +0,0 @@ -'use strict'; - -const { TypeError } = require('../errors'); -const { MessageComponentTypes, Events } = require('../util/Constants'); - -/** - * Represents an interactive component of a Message or Modal. It should not be necessary to construct this directly. - * See {@link MessageComponent} - */ -class BaseMessageComponent { - /** - * Options for a BaseMessageComponent - * @typedef {Object} BaseMessageComponentOptions - * @property {MessageComponentTypeResolvable} type The type of this component - */ - - /** - * Data that can be resolved into options for a component. This can be: - * * MessageActionRowOptions - * * MessageButtonOptions - * * MessageSelectMenuOptions - * * TextInputComponentOptions - * @typedef {MessageActionRowOptions|MessageButtonOptions|MessageSelectMenuOptions} MessageComponentOptions - */ - - /** - * Components that can be sent in a payload. These can be: - * * MessageActionRow - * * MessageButton - * * MessageSelectMenu - * * TextInputComponent - * @typedef {MessageActionRow|MessageButton|MessageSelectMenu} MessageComponent - * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object-component-types} - */ - - /** - * Data that can be resolved to a MessageComponentType. This can be: - * * MessageComponentType - * * string - * * number - * @typedef {string|number|MessageComponentType} MessageComponentTypeResolvable - */ - - /** - * @param {BaseMessageComponent|BaseMessageComponentOptions} [data={}] The options for this component - */ - constructor(data) { - /** - * The type of this component - * @type {?MessageComponentType} - */ - this.type = - 'type' in data ? BaseMessageComponent.resolveType(data.type) : null; - } - - setup(data) { - /** - * The data for this component - * @type {MessageComponentOptions} - */ - this.data = data; - } - - /** - * The id of this component - * @type {number} - * @readonly - */ - get id() { - return this.data.id; - } - - /** - * Constructs a component based on the type of the incoming data - * @param {MessageComponentOptions} data Data for a MessageComponent - * @param {Client|WebhookClient} [client] Client constructing this component - * @returns {?(MessageComponent|ModalComponent)} - * @private - */ - static create(data, client) { - let component; - let type = data.type; - - if (typeof type === 'string') type = MessageComponentTypes[type]; - - switch (type) { - case MessageComponentTypes.ACTION_ROW: { - const MessageActionRow = require('./MessageActionRow'); - component = - data instanceof MessageActionRow - ? data - : new MessageActionRow(data, client); - break; - } - case MessageComponentTypes.BUTTON: { - const MessageButton = require('./MessageButton'); - component = - data instanceof MessageButton ? data : new MessageButton(data); - break; - } - case MessageComponentTypes.STRING_SELECT: - case MessageComponentTypes.USER_SELECT: - case MessageComponentTypes.ROLE_SELECT: - case MessageComponentTypes.MENTIONABLE_SELECT: - case MessageComponentTypes.CHANNEL_SELECT: { - const MessageSelectMenu = require('./MessageSelectMenu'); - component = - data instanceof MessageSelectMenu - ? data - : new MessageSelectMenu(data); - break; - } - case MessageComponentTypes.TEXT_INPUT: { - const TextInputComponent = require('./TextInputComponent'); - component = - data instanceof TextInputComponent - ? data - : new TextInputComponent(data); - break; - } - case MessageComponentTypes.SECTION: { - const SectionComponent = require('./SectionComponent'); - component = - data instanceof SectionComponent ? data : new SectionComponent(data); - break; - } - case MessageComponentTypes.TEXT_DISPLAY: { - const TextDisplayComponent = require('./TextDisplayComponent'); - component = - data instanceof TextDisplayComponent - ? data - : new TextDisplayComponent(data); - break; - } - case MessageComponentTypes.THUMBNAIL: { - const ThumbnailComponent = require('./ThumbnailComponent'); - component = - data instanceof ThumbnailComponent - ? data - : new ThumbnailComponent(data); - break; - } - case MessageComponentTypes.MEDIA_GALLERY: { - const MediaGalleryComponent = require('./MediaGalleryComponent'); - component = - data instanceof MediaGalleryComponent - ? data - : new MediaGalleryComponent(data); - break; - } - case MessageComponentTypes.FILE: { - const FileComponent = require('./FileComponent'); - component = - data instanceof FileComponent ? data : new FileComponent(data); - break; - } - case MessageComponentTypes.SEPARATOR: { - const SeparatorComponent = require('./SeparatorComponent'); - component = - data instanceof SeparatorComponent - ? data - : new SeparatorComponent(data); - break; - } - case MessageComponentTypes.CONTAINER: { - const ContainerComponent = require('./ContainerComponent'); - component = - data instanceof ContainerComponent - ? data - : new ContainerComponent(data); - break; - } - default: - if (client) { - client.emit( - Events.DEBUG, - `[BaseMessageComponent] Received component with unknown type: ${data.type}`, - ); - } else { - throw new TypeError( - 'INVALID_TYPE', - 'data.type', - 'valid MessageComponentType', - ); - } - } - return component; - } - - /** - * Resolves the type of a component - * @param {MessageComponentTypeResolvable} type The type to resolve - * @returns {MessageComponentType} - * @private - */ - static resolveType(type) { - return typeof type === 'string' ? type : MessageComponentTypes[type]; - } - - static extractInteractiveComponents(component) { - let type = component.type; - if (typeof type === 'string') type = MessageComponentTypes[type]; - switch (type) { - case MessageComponentTypes.ACTION_ROW: - return component.components; - case MessageComponentTypes.SECTION: - return [...component.components, component.accessory]; - case MessageComponentTypes.CONTAINER: - return component.components.flatMap( - BaseMessageComponent.extractInteractiveComponents, - ); - default: - return [component]; - } - } -} - -module.exports = BaseMessageComponent; diff --git a/vendor/discord.js-selfbot-v13/src/structures/ButtonInteraction.js b/vendor/discord.js-selfbot-v13/src/structures/ButtonInteraction.js deleted file mode 100644 index db57592..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/ButtonInteraction.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const MessageComponentInteraction = require('./MessageComponentInteraction'); - -/** - * Represents a button interaction. - * @extends {MessageComponentInteraction} - */ -class ButtonInteraction extends MessageComponentInteraction {} - -module.exports = ButtonInteraction; diff --git a/vendor/discord.js-selfbot-v13/src/structures/CallState.js b/vendor/discord.js-selfbot-v13/src/structures/CallState.js deleted file mode 100644 index 78b2f29..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/CallState.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const Base = require('./Base'); - -/** - * Represents a call - * @extends {Base} - */ -class CallState extends Base { - constructor(client, data) { - super(client); - /** - * The channel ID of the call - * @type {Snowflake} - */ - this.channelId = data.channel_id; - - this._ringing = []; - - this._patch(data); - } - - _patch(data) { - if ('region' in data) { - /** - * The region of the call - * @type {string} - */ - this.region = data.region; - } - if ('ringing' in data) { - this._ringing = data.ringing; - } - } - - /** - * The channel of the call - * @type {?DMChannel|GroupDMChannel} - */ - get channel() { - return this.client.channels.cache.get(this.channelId); - } - - /** - * Sets the voice region of the call - * @param {string} region Region of the call - * @returns {Promise} - */ - setRTCRegion(region) { - return this.client.api - .channels(this.channelId) - .call.patch({ data: { region } }); - } - - /** - * The list of user ID who is ringing - * @type {Collection} - */ - get ringing() { - return new Collection( - this._ringing.map((id) => [id, this.client.users.cache.get(id)]), - ); - } -} - -module.exports = CallState; diff --git a/vendor/discord.js-selfbot-v13/src/structures/CategoryChannel.js b/vendor/discord.js-selfbot-v13/src/structures/CategoryChannel.js deleted file mode 100644 index 80cf459..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/CategoryChannel.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; - -const GuildChannel = require('./GuildChannel'); - -/** - * Represents a guild category channel on Discord. - * @extends {GuildChannel} - */ -class CategoryChannel extends GuildChannel { - /** - * The id of the parent of this channel. - * @name CategoryChannel#parentId - * @type {null} - */ - - /** - * The parent of this channel. - * @name CategoryChannel#parent - * @type {null} - * @readonly - */ - - /** - * Channels that are a part of this category - * @type {Collection} - * @readonly - */ - get children() { - return this.guild.channels.cache.filter((c) => c.parentId === this.id); - } - - /** - * Sets the category parent of this channel. - * It is not possible to set the parent of a CategoryChannel. - * @method setParent - * @memberof CategoryChannel - * @instance - * @param {?CategoryChannelResolvable} channel The channel to set as parent - * @param {SetParentOptions} [options={}] The options for setting the parent - * @returns {Promise} - */ - - /** - * Options for creating a channel using {@link CategoryChannel#createChannel}. - * @typedef {Object} CategoryCreateChannelOptions - * @property {string} [name] The name of the new channel - * @property {ChannelType|number} [type='GUILD_TEXT'] The type of the new channel. - * @property {number} [position] Position of the new channel - * @property {string} [topic] The topic for the new channel - * @property {boolean} [nsfw] Whether the new channel is NSFW - * @property {number} [bitrate] Bitrate of the new channel in bits (only voice) - * @property {number} [userLimit] Maximum amount of users allowed in the new channel (only voice) - * @property {OverwriteResolvable[]|Collection} [permissionOverwrites] - * Permission overwrites of the new channel - * @property {number} [rateLimitPerUser] The rate limit per user (slowmode) for the new channel in seconds - * @property {ThreadAutoArchiveDuration} [defaultAutoArchiveDuration] - * The default auto archive duration for all new threads in this channel - * @property {?string} [rtcRegion] The specific region of the new channel - * @property {?VideoQualityMode|number} [videoQualityMode] The camera video quality mode of the new channel - * @property {ChannelFlagsResolvable} [flags] The flags to set on the new channel - * @property {GuildForumTagData[]} [availableTags] The tags to set as available in a forum channel - * @property {?DefaultReactionEmoji} [defaultReactionEmoji] The emoji to set as the default reaction emoji - * @property {number} [defaultThreadRateLimitPerUser] The rate limit per user (slowmode) to set on forum posts - * @property {?SortOrderType} [defaultSortOrder] The default sort order mode to set on the new channel - * @property {number} [defaultThreadRateLimitPerUser] The initial rate limit per user (slowmode) - * to set on newly created threads in a channel. - * @property {string} [reason] Reason for creating the new channel - */ - - /** - * Creates a new channel within this category. - * You cannot create a channel of type `GUILD_CATEGORY` inside a CategoryChannel. - * @param {string} name The name of the new channel - * @param {CategoryCreateChannelOptions} options Options for creating the new channel - * @returns {Promise} - */ - createChannel(name, options) { - return this.guild.channels.create(name, { - ...options, - parent: this.id, - }); - } -} - -module.exports = CategoryChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Channel.js b/vendor/discord.js-selfbot-v13/src/structures/Channel.js deleted file mode 100644 index 47e2f99..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Channel.js +++ /dev/null @@ -1,293 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const Base = require('./Base'); -let CategoryChannel; -let DMChannel; -let NewsChannel; -let StageChannel; -let StoreChannel; -let TextChannel; -let ThreadChannel; -let VoiceChannel; -let DirectoryChannel; -let ForumChannel; -let MediaChannel; -const ChannelFlags = require('../util/ChannelFlags'); -const { - ChannelTypes, - ThreadChannelTypes, - VoiceBasedChannelTypes, -} = require('../util/Constants'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); - -/** - * @type {WeakSet} - * @private - * @internal - */ -const deletedChannels = new WeakSet(); -let deprecationEmittedForDeleted = false; - -/** - * Represents any channel on Discord. - * @extends {Base} - * @abstract - */ -class Channel extends Base { - constructor(client, data, immediatePatch = true) { - super(client); - - const type = ChannelTypes[data?.type]; - /** - * The type of the channel - * @type {ChannelType} - */ - this.type = type ?? 'UNKNOWN'; - - if (data && immediatePatch) this._patch(data); - } - - _patch(data) { - /** - * The channel's id - * @type {Snowflake} - */ - this.id = data.id; - - if ('flags' in data) { - /** - * The flags that are applied to the channel. - * @type {?Readonly} - */ - this.flags = new ChannelFlags(data.flags).freeze(); - } else { - this.flags ??= new ChannelFlags().freeze(); - } - } - - /** - * The timestamp the channel was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return SnowflakeUtil.timestampFrom(this.id); - } - - /** - * The time the channel was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * Whether or not the structure has been deleted - * @type {boolean} - * @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 - */ - get deleted() { - if (!deprecationEmittedForDeleted) { - deprecationEmittedForDeleted = true; - process.emitWarning( - 'Channel#deleted is deprecated, see https://github.com/discordjs/discord.js/issues/7091.', - 'DeprecationWarning', - ); - } - - return deletedChannels.has(this); - } - - set deleted(value) { - if (!deprecationEmittedForDeleted) { - deprecationEmittedForDeleted = true; - process.emitWarning( - 'Channel#deleted is deprecated, see https://github.com/discordjs/discord.js/issues/7091.', - 'DeprecationWarning', - ); - } - - if (value) deletedChannels.add(this); - else deletedChannels.delete(this); - } - - /** - * Whether this Channel is a partial - * This is always false outside of DM channels. - * @type {boolean} - * @readonly - */ - get partial() { - return false; - } - - /** - * When concatenated with a string, this automatically returns the channel's mention instead of the Channel object. - * @returns {string} - * @example - * // Logs: Hello from <#123456789012345678>! - * console.log(`Hello from ${channel}!`); - */ - toString() { - return `<#${this.id}>`; - } - - /** - * Deletes this channel. - * @returns {Promise} - * @example - * // Delete the channel - * channel.delete() - * .then(console.log) - * .catch(console.error); - */ - async delete() { - await this.client.api.channels(this.id).delete(); - return this; - } - - /** - * Fetches this channel. - * @param {boolean} [force=true] Whether to skip the cache check and request the API - * @returns {Promise} - */ - fetch(force = true) { - return this.client.channels.fetch(this.id, { force }); - } - - /** - * Indicates whether this channel is {@link TextBasedChannels text-based}. - * @returns {boolean} - */ - isText() { - return 'messages' in this; - } - - /** - * Indicates whether this channel is {@link BaseGuildVoiceChannel voice-based}. - * @returns {boolean} - */ - isVoice() { - return VoiceBasedChannelTypes.includes(this.type); - } - - /** - * Indicates whether this channel is a {@link ThreadChannel}. - * @returns {boolean} - */ - isThread() { - return ThreadChannelTypes.includes(this.type); - } - - /** - * Indicates whether this channel is {@link ThreadOnlyChannel}. - * @returns {boolean} - */ - isThreadOnly() { - return 'availableTags' in this; - } - - /** - * Indicates whether this channel is a {@link DirectoryChannel} - * @returns {boolean} - */ - isDirectory() { - return this.type === 'GUILD_DIRECTORY'; - } - - static create(client, data, guild, { allowUnknownGuild } = {}) { - CategoryChannel ??= require('./CategoryChannel'); - DMChannel ??= require('./DMChannel'); - NewsChannel ??= require('./NewsChannel'); - StageChannel ??= require('./StageChannel'); - StoreChannel ??= require('./StoreChannel'); - TextChannel ??= require('./TextChannel'); - ThreadChannel ??= require('./ThreadChannel'); - VoiceChannel ??= require('./VoiceChannel'); - DirectoryChannel ??= require('./DirectoryChannel'); - ForumChannel ??= require('./ForumChannel'); - MediaChannel ??= require('./MediaChannel'); - - let channel; - if (!data.guild_id && !guild) { - if ( - (data.recipients && data.type !== ChannelTypes.GROUP_DM) || - data.type === ChannelTypes.DM - ) { - channel = new DMChannel(client, data); - } else if (data.type === ChannelTypes.GROUP_DM) { - const GroupDMChannel = require('./GroupDMChannel'); - channel = new GroupDMChannel(client, data); - } - } else { - guild ??= client.guilds.cache.get(data.guild_id); - - if (guild || allowUnknownGuild) { - switch (data.type) { - case ChannelTypes.GUILD_TEXT: { - channel = new TextChannel(guild, data, client); - break; - } - case ChannelTypes.GUILD_VOICE: { - channel = new VoiceChannel(guild, data, client); - break; - } - case ChannelTypes.GUILD_CATEGORY: { - channel = new CategoryChannel(guild, data, client); - break; - } - case ChannelTypes.GUILD_NEWS: { - channel = new NewsChannel(guild, data, client); - break; - } - case ChannelTypes.GUILD_STORE: { - channel = new StoreChannel(guild, data, client); - break; - } - case ChannelTypes.GUILD_STAGE_VOICE: { - channel = new StageChannel(guild, data, client); - break; - } - case ChannelTypes.GUILD_NEWS_THREAD: - case ChannelTypes.GUILD_PUBLIC_THREAD: - case ChannelTypes.GUILD_PRIVATE_THREAD: { - channel = new ThreadChannel(guild, data, client); - if (!allowUnknownGuild) - channel.parent?.threads.cache.set(channel.id, channel); - break; - } - - case ChannelTypes.GUILD_DIRECTORY: - channel = new DirectoryChannel(client, data); - break; - - case ChannelTypes.GUILD_FORUM: - channel = new ForumChannel(guild, data, client); - break; - - case ChannelTypes.GUILD_MEDIA: - channel = new MediaChannel(guild, data, client); - break; - } - if (channel && !allowUnknownGuild) - guild.channels?.cache.set(channel.id, channel); - } - } - return channel; - } - - toJSON(...props) { - return super.toJSON({ createdTimestamp: true }, ...props); - } -} - -exports.Channel = Channel; -exports.deletedChannels = deletedChannels; - -/** - * @external APIChannel - * @see {@link https://discord.com/developers/docs/resources/channel#channel-object} - */ diff --git a/vendor/discord.js-selfbot-v13/src/structures/ClientPresence.js b/vendor/discord.js-selfbot-v13/src/structures/ClientPresence.js deleted file mode 100644 index 85a258d..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/ClientPresence.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict'; - -const { Presence } = require('./Presence'); -const { TypeError } = require('../errors'); -const { ActivityTypes, Opcodes } = require('../util/Constants'); - -const CustomStatusActivityTypes = [ - ActivityTypes.CUSTOM, - ActivityTypes[ActivityTypes.CUSTOM], -]; - -/** - * Represents the client's presence. - * @extends {Presence} - */ -class ClientPresence extends Presence { - constructor(client, data = {}) { - super( - client, - Object.assign(data, { - status: data.status ?? 'online', - user: { id: null }, - }), - ); - } - - /** - * Sets the client's presence - * @param {PresenceData} presence The data to set the presence to - * @returns {ClientPresence} - */ - set(presence) { - const packet = this._parse(presence); - this._patch(packet); - packet.activities = this.activities.map((a) => a.toJSON()); - this.client.ws.broadcast({ op: Opcodes.STATUS_UPDATE, d: packet }); - return this; - } - - /** - * Parses presence data into a packet ready to be sent to Discord - * @param {PresenceData} presence The data to parse - * @returns {APIPresence} - * @private - */ - _parse({ status, since, afk, activities }) { - const data = { - activities: [], - afk: typeof afk === 'boolean' ? afk : this.afk, - since: typeof since === 'number' && !Number.isNaN(since) ? this.since : 0, - status: status ?? this.status, - }; - if (activities?.length) { - for (const [i, activity] of activities.entries()) { - if (typeof activity.name !== 'string') - throw new TypeError( - 'INVALID_TYPE', - `activities[${i}].name`, - 'string', - ); - - activity.type ??= ActivityTypes.PLAYING; - if (typeof activity.type === 'string') - activity.type = ActivityTypes[activity.type]; - - if ( - CustomStatusActivityTypes.includes(activity.type) && - !activity.state - ) { - activity.state = activity.name; - activity.name = 'Custom Status'; - } - - data.activities.push(activity); - } - } else if ( - !activities && - (status || afk || since) && - this.activities.length - ) { - data.activities.push( - ...this.activities.map((a) => { - if (typeof a.type === 'string') a.type = ActivityTypes[a.type]; - return a; - }), - ); - } - - return data; - } -} - -module.exports = ClientPresence; - -/* eslint-disable max-len */ -/** - * @external APIPresence - * @see {@link https://discord.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields} - */ diff --git a/vendor/discord.js-selfbot-v13/src/structures/ClientUser.js b/vendor/discord.js-selfbot-v13/src/structures/ClientUser.js deleted file mode 100644 index 4be9189..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/ClientUser.js +++ /dev/null @@ -1,474 +0,0 @@ -'use strict'; - -const { setInterval } = require('node:timers'); -const { Collection } = require('@discordjs/collection'); -const Invite = require('./Invite'); -const User = require('./User'); -const DataResolver = require('../util/DataResolver'); -const PremiumUsageFlags = require('../util/PremiumUsageFlags'); -const PurchasedFlags = require('../util/PurchasedFlags'); -const Util = require('../util/Util'); - -/** - * Represents the logged in client's Discord user. - * @extends {User} - */ -class ClientUser extends User { - #packageName = null; - #intervalSamsungPresence = setInterval( - () => { - this.client.emit( - 'debug', - `[UPDATE] Samsung Presence: ${this.#packageName}`, - ); - if (!this.#packageName) return; - this.setSamsungActivity(this.#packageName, 'UPDATE'); - }, - 1000 * 60 * 10, - ).unref(); - - _patch(data) { - super._patch(data); - - if ('verified' in data) { - /** - * Whether or not this account has been verified - * @type {boolean} - */ - this.verified = data.verified; - } - - if ('mfa_enabled' in data) { - /** - * If the bot's {@link Application#owner Owner} has MFA enabled on their account - * @type {?boolean} - */ - this.mfaEnabled = - typeof data.mfa_enabled === 'boolean' ? data.mfa_enabled : null; - } else { - this.mfaEnabled ??= null; - } - - if ('token' in data) this.client.token = data.token; - - if ('purchased_flags' in data) { - /** - * Purchased state of the client user. - * @type {Readonly} - */ - this.purchasedFlags = new PurchasedFlags( - data.purchased_flags || 0, - ).freeze(); - } else { - this.purchasedFlags = new PurchasedFlags().freeze(); - } - - if ('premium_usage_flags' in data) { - /** - * Premium usage state of the client user. - * @type {Readonly} - */ - this.premiumUsageFlags = new PremiumUsageFlags( - data.premium_usage_flags || 0, - ); - } else { - this.premiumUsageFlags = new PremiumUsageFlags().freeze(); - } - - if ('phone' in data) { - /** - * Phone number of the client user. - * @type {?string} - */ - this.phone = data.phone; - } - - if ('nsfw_allowed' in data) { - /** - * Whether or not the client user is allowed to send NSFW messages [iOS device]. - * @type {?boolean} - */ - this.nsfwAllowed = data.nsfw_allowed; - } - - if ('email' in data) { - /** - * Email address of the client user. - * @type {?string} - */ - this.email = data.email; - } - - if ('bio' in data) { - /** - * About me (User) - * The user must be force fetched for this property to be present or be updated - * @type {?string} - */ - this.bio = data.bio; - } - - if ('pronouns' in data) { - /** - * Pronouns (User) - * The user must be force fetched for this property to be present or be updated - * @type {?string} - */ - this.pronouns = data.pronouns; - } - - if ('premium_type' in data) { - /** - * Premium types denote the level of premium a user has. - * @type {number} - * @see {@link https://discord-userdoccers.vercel.app/resources/user#premium-type} - */ - this.premiumType = data.premium_type; - } - } - - /** - * Represents the client user's presence - * @type {ClientPresence} - * @readonly - */ - get presence() { - return this.client.presence; - } - - /** - * Data used to edit the logged in client - * @typedef {Object} ClientUserEditData - * @property {string} [username] The new username - * @property {?(BufferResolvable|Base64Resolvable)} [avatar] The new avatar - * @property {?(BufferResolvable|Base64Resolvable)} [banner] The new banner - * @property {?string} [bio] The new bio - */ - - /** - * Edits the logged in client. - * @param {ClientUserEditData} options The new data - * @returns {Promise} - */ - async edit(options = {}) { - const data = await this.client.api.users('@me').patch({ data: options }); - const { updated } = this.client.actions.UserUpdate.handle(data); - return updated ?? this; - } - - /** - * Sets the username of the logged in client. - * Changing usernames in Discord is heavily rate limited, with only 2 requests - * every hour. Use this sparingly! - * @param {string} username The new username - * @param {string} password Current Password - * @returns {Promise} - * @example - * // Set username - * client.user.setUsername('discordjs', 'passw@rd') - * .then(user => console.log(`My new username is ${user.username}`)) - * .catch(console.error); - */ - setUsername(username, password) { - return this.edit({ username, password }); - } - - /** - * Sets the avatar of the logged in client. - * @param {?(BufferResolvable|Base64Resolvable)} avatar The new avatar - * @returns {Promise} - * @example - * // Set avatar - * client.user.setAvatar('./avatar.png') - * .then(user => console.log(`New avatar set!`)) - * .catch(console.error); - */ - async setAvatar(avatar) { - avatar = avatar && (await DataResolver.resolveImage(avatar)); - return this.edit({ avatar }); - } - - /** - * Options for setting activities - * @typedef {Object} ActivitiesOptions - * @property {string} name Name of the activity - * @property {string} [state] State of the activity - * @property {ActivityType|number} [type] Type of the activity - * @property {string} [url] Twitch / YouTube stream URL - */ - - /** - * Data resembling a raw Discord presence. - * @typedef {Object} PresenceData - * @property {PresenceStatusData} [status] Status of the user - * @property {boolean} [afk] Whether the user is AFK - * @property {ActivitiesOptions[]|CustomStatus[]|RichPresence[]|SpotifyRPC[]} [activities] Activity the user is playing - * @property {number|number[]} [shardId] Shard id(s) to have the activity set on - */ - - /** - * Sets the full presence of the client user. - * @param {PresenceData} data Data for the presence - * @returns {ClientPresence} - * @example - * // Set the client user's presence - * client.user.setPresence({ activities: [{ name: 'with discord.js' }], status: 'idle' }); - * @see {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Document/RichPresence.md} - */ - setPresence(data) { - return this.client.presence.set(data); - } - - /** - * A user's status. Must be one of: - * * `online` - * * `idle` - * * `invisible` - * * `dnd` (do not disturb) - * @typedef {string} PresenceStatusData - */ - - /** - * Sets the status of the client user. - * @param {PresenceStatusData} status Status to change to - * @param {number|number[]} [shardId] Shard id(s) to have the activity set on - * @returns {ClientPresence} - * @example - * // Set the client user's status - * client.user.setStatus('idle'); - */ - setStatus(status, shardId) { - return this.setPresence({ status, shardId }); - } - - /** - * Options for setting an activity. - * @typedef {Object} ActivityOptions - * @property {string} name Name of the activity - * @property {string} [url] Twitch / YouTube stream URL - * @property {ActivityType|number} [type] Type of the activity - * @property {number|number[]} [shardId] Shard Id(s) to have the activity set on - */ - - /** - * Sets the activity the client user is playing. - * @param {string|ActivityOptions} name Activity being played, or options for setting the activity - * @param {ActivityOptions} [options] Options for setting the activity - * @returns {ClientPresence} - * @example - * // Set the client user's activity - * client.user.setActivity('discord.js', { type: 'WATCHING' }); - * @see {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Document/RichPresence.md} - */ - setActivity(name, options = {}) { - if (!name) - return this.setPresence({ activities: [], shardId: options.shardId }); - - const activity = Object.assign( - {}, - options, - typeof name === 'object' ? name : { name }, - ); - return this.setPresence({ - activities: [activity], - shardId: activity.shardId, - }); - } - - /** - * Sets/removes the AFK flag for the client user. - * @param {boolean} [afk=true] Whether or not the user is AFK - * @param {number|number[]} [shardId] Shard Id(s) to have the AFK flag set on - * @returns {ClientPresence} - */ - setAFK(afk = true, shardId) { - return this.setPresence({ afk, shardId }); - } - - /** - * Sets the banner of the logged in client. - * @param {?(BufferResolvable|Base64Resolvable)} banner The new banner - * @returns {Promise} - * @example - * // Set banner - * client.user.setBanner('./banner.png') - * .then(user => console.log(`New banner set!`)) - * .catch(console.error); - */ - async setBanner(banner) { - banner = banner && (await DataResolver.resolveImage(banner)); - return this.edit({ banner }); - } - - /** - * Set HyperSquad House - * @param {string|number} type - * * `LEAVE`: 0 - * * `HOUSE_BRAVERY`: 1 - * * `HOUSE_BRILLIANCE`: 2 - * * `HOUSE_BALANCE`: 3 - * @returns {Promise} - * @example - * // Set HyperSquad HOUSE_BRAVERY - * client.user.setHypeSquad(1); || client.user.setHypeSquad('HOUSE_BRAVERY'); - * // Leave - * client.user.setHypeSquad(0); - */ - setHypeSquad(type) { - switch (type) { - case 'LEAVE': { - type = 0; - break; - } - case 'HOUSE_BRAVERY': { - type = 1; - break; - } - case 'HOUSE_BRILLIANCE': { - type = 2; - break; - } - case 'HOUSE_BALANCE': { - type = 3; - break; - } - } - if (type == 0) { - return this.client.api.hypesquad.online.delete(); - } else { - return this.client.api.hypesquad.online.post({ - data: { house_id: type }, - }); - } - } - - /** - * Set Accent color - * @param {ColorResolvable} color Color to set - * @returns {Promise} - */ - setAccentColor(color = null) { - return this.edit({ accent_color: color ? Util.resolveColor(color) : null }); - } - - /** - * Set About me - * @param {string} [bio=null] Bio to set - * @returns {Promise} - */ - setAboutMe(bio = null) { - return this.edit({ bio }); - } - - /** - * Create an invite [Friend Invites] - * maxAge: 604800 | maxUses: 1 - * @returns {Promise} - * @see {@link https://github.com/13-05/hidden-disc-docs#js-snippet-for-creating-friend-invites} - * @example - * // Options not working - * client.user.createFriendInvite(); - * .then(console.log) - * .catch(console.error); - */ - async createFriendInvite() { - const data = await this.client.api.users['@me'].invites.post({ - data: {}, - }); - return new Invite(this.client, data); - } - - /** - * Get all friend invites - * @returns {Promise>} - */ - async getAllFriendInvites() { - const data = await this.client.api.users['@me'].invites.get(); - const collection = new Collection(); - for (const invite of data) { - collection.set(invite.code, new Invite(this.client, invite)); - } - return collection; - } - - /** - * Revoke all friend invites - * @returns {Promise} - */ - revokeAllFriendInvites() { - return this.client.api.users['@me'].invites.delete(); - } - - /** - * Sets Discord Playing status to "Playing on Samsung Galaxy". Only selected gamss from discords database works - * @param {string} packageName Android package name - * @param {?string} type Must be START, UPDATE, or STOP - * @returns {Promise} - * @example - * // Set the client user's status - * client.user.setSamsungActivity('com.YostarJP.BlueArchive', 'START'); - * // Update - * client.user.setSamsungActivity('com.miHoYo.bh3oversea', 'UPDATE'); - * // Stop - * client.user.setSamsungActivity('com.miHoYo.GenshinImpact', 'STOP'); - */ - async setSamsungActivity(packageName, type = 'START') { - type = type.toUpperCase(); - if (!packageName || typeof packageName !== 'string') - throw new Error('Package name is required.'); - if (!['START', 'UPDATE', 'STOP'].includes(type)) - throw new Error('Invalid type (Must be START, UPDATE, or STOP)'); - await this.client.api.presences.post({ - data: { - package_name: packageName, - update: type, - }, - }); - if (type !== 'STOP') this.#packageName = packageName; - else this.#packageName = null; - return this; - } - - /** - * Stop ringing - * @param {ChannelResolvable} channel DMChannel | GroupDMChannel - * @returns {Promise} - */ - stopRinging(channel) { - return this.client.api - .channels(this.client.channels.resolveId(channel)) - .call['stop-ringing'].post({ - data: {}, - }); - } - - /** - * Super Reactions - * @returns {Promise} - */ - fetchBurstCredit() { - return this.client.api.users['@me']['burst-credits'] - .get() - .then((d) => d.amount); - } - - /** - * Set global display name - * @param {string} globalName The new display name - * @returns {Promise} - */ - setGlobalName(globalName = '') { - return this.edit({ global_name: globalName }); - } - - /** - * Set pronouns - * @param {?string} pronouns Your pronouns - * @returns {Promise} - */ - setPronouns(pronouns = '') { - return this.edit({ pronouns }); - } -} - -module.exports = ClientUser; diff --git a/vendor/discord.js-selfbot-v13/src/structures/CommandInteraction.js b/vendor/discord.js-selfbot-v13/src/structures/CommandInteraction.js deleted file mode 100644 index ecf7315..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/CommandInteraction.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -const BaseCommandInteraction = require('./BaseCommandInteraction'); -const CommandInteractionOptionResolver = require('./CommandInteractionOptionResolver'); - -/** - * Represents a command interaction. - * @extends {BaseCommandInteraction} - */ -class CommandInteraction extends BaseCommandInteraction { - constructor(client, data) { - super(client, data); - - /** - * The options passed to the command. - * @type {CommandInteractionOptionResolver} - */ - this.options = new CommandInteractionOptionResolver( - this.client, - data.data.options?.map((option) => - this.transformOption(option, data.data.resolved), - ) ?? [], - this.transformResolved(data.data.resolved ?? {}), - ); - } - - /** - * Returns a string representation of the command interaction. - * This can then be copied by a user and executed again in a new command while keeping the option order. - * @returns {string} - */ - toString() { - const properties = [ - this.commandName, - this.options._group, - this.options._subcommand, - ...this.options._hoistedOptions.map((o) => `${o.name}:${o.value}`), - ]; - return `/${properties.filter(Boolean).join(' ')}`; - } -} - -module.exports = CommandInteraction; diff --git a/vendor/discord.js-selfbot-v13/src/structures/CommandInteractionOptionResolver.js b/vendor/discord.js-selfbot-v13/src/structures/CommandInteractionOptionResolver.js deleted file mode 100644 index 7dfde36..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/CommandInteractionOptionResolver.js +++ /dev/null @@ -1,306 +0,0 @@ -'use strict'; - -const { TypeError } = require('../errors'); - -/** - * A resolver for command interaction options. - */ -class CommandInteractionOptionResolver { - constructor(client, options, resolved) { - /** - * The client that instantiated this. - * @name CommandInteractionOptionResolver#client - * @type {Client} - * @readonly - */ - Object.defineProperty(this, 'client', { value: client }); - - /** - * The name of the subcommand group. - * @type {?string} - * @private - */ - this._group = null; - - /** - * The name of the subcommand. - * @type {?string} - * @private - */ - this._subcommand = null; - - /** - * The bottom-level options for the interaction. - * If there is a subcommand (or subcommand and group), this is the options for the subcommand. - * @type {CommandInteractionOption[]} - * @private - */ - this._hoistedOptions = options; - - // Hoist subcommand group if present - if (this._hoistedOptions[0]?.type === 'SUB_COMMAND_GROUP') { - this._group = this._hoistedOptions[0].name; - this._hoistedOptions = this._hoistedOptions[0].options ?? []; - } - // Hoist subcommand if present - if (this._hoistedOptions[0]?.type === 'SUB_COMMAND') { - this._subcommand = this._hoistedOptions[0].name; - this._hoistedOptions = this._hoistedOptions[0].options ?? []; - } - - /** - * The interaction options array. - * @name CommandInteractionOptionResolver#data - * @type {ReadonlyArray} - * @readonly - */ - Object.defineProperty(this, 'data', { value: Object.freeze([...options]) }); - - /** - * The interaction resolved data - * @name CommandInteractionOptionResolver#resolved - * @type {Readonly} - */ - Object.defineProperty(this, 'resolved', { value: Object.freeze(resolved) }); - } - - /** - * Gets an option by its name. - * @param {string} name The name of the option. - * @param {boolean} [required=false] Whether to throw an error if the option is not found. - * @returns {?CommandInteractionOption} The option, if found. - */ - get(name, required = false) { - const option = this._hoistedOptions.find((opt) => opt.name === name); - if (!option) { - if (required) { - throw new TypeError('COMMAND_INTERACTION_OPTION_NOT_FOUND', name); - } - return null; - } - return option; - } - - /** - * Gets an option by name and property and checks its type. - * @param {string} name The name of the option. - * @param {ApplicationCommandOptionType} type The type of the option. - * @param {string[]} properties The properties to check for for `required`. - * @param {boolean} required Whether to throw an error if the option is not found. - * @returns {?CommandInteractionOption} The option, if found. - * @private - */ - _getTypedOption(name, type, properties, required) { - const option = this.get(name, required); - if (!option) { - return null; - } else if (option.type !== type) { - throw new TypeError( - 'COMMAND_INTERACTION_OPTION_TYPE', - name, - option.type, - type, - ); - } else if ( - required && - properties.every( - (prop) => option[prop] === null || typeof option[prop] === 'undefined', - ) - ) { - throw new TypeError( - 'COMMAND_INTERACTION_OPTION_EMPTY', - name, - option.type, - ); - } - return option; - } - - /** - * Gets the selected subcommand. - * @param {boolean} [required=true] Whether to throw an error if there is no subcommand. - * @returns {?string} The name of the selected subcommand, or null if not set and not required. - */ - getSubcommand(required = true) { - if (required && !this._subcommand) { - throw new TypeError('COMMAND_INTERACTION_OPTION_NO_SUB_COMMAND'); - } - return this._subcommand; - } - - /** - * Gets the selected subcommand group. - * @param {boolean} [required=true] Whether to throw an error if there is no subcommand group. - * @returns {?string} The name of the selected subcommand group, or null if not set and not required. - */ - getSubcommandGroup(required = true) { - if (required && !this._group) { - throw new TypeError('COMMAND_INTERACTION_OPTION_NO_SUB_COMMAND_GROUP'); - } - return this._group; - } - - /** - * Gets a boolean option. - * @param {string} name The name of the option. - * @param {boolean} [required=false] Whether to throw an error if the option is not found. - * @returns {?boolean} The value of the option, or null if not set and not required. - */ - getBoolean(name, required = false) { - const option = this._getTypedOption(name, 'BOOLEAN', ['value'], required); - return option?.value ?? null; - } - - /** - * Gets a channel option. - * @param {string} name The name of the option. - * @param {boolean} [required=false] Whether to throw an error if the option is not found. - * @returns {?(GuildChannel|ThreadChannel|APIChannel)} - * The value of the option, or null if not set and not required. - */ - getChannel(name, required = false) { - const option = this._getTypedOption(name, 'CHANNEL', ['channel'], required); - return option?.channel ?? null; - } - - /** - * Gets a string option. - * @param {string} name The name of the option. - * @param {boolean} [required=false] Whether to throw an error if the option is not found. - * @returns {?string} The value of the option, or null if not set and not required. - */ - getString(name, required = false) { - const option = this._getTypedOption(name, 'STRING', ['value'], required); - return option?.value ?? null; - } - - /** - * Gets an integer option. - * @param {string} name The name of the option. - * @param {boolean} [required=false] Whether to throw an error if the option is not found. - * @returns {?number} The value of the option, or null if not set and not required. - */ - getInteger(name, required = false) { - const option = this._getTypedOption(name, 'INTEGER', ['value'], required); - return option?.value ?? null; - } - - /** - * Gets a number option. - * @param {string} name The name of the option. - * @param {boolean} [required=false] Whether to throw an error if the option is not found. - * @returns {?number} The value of the option, or null if not set and not required. - */ - getNumber(name, required = false) { - const option = this._getTypedOption(name, 'NUMBER', ['value'], required); - return option?.value ?? null; - } - - /** - * Gets a user option. - * @param {string} name The name of the option. - * @param {boolean} [required=false] Whether to throw an error if the option is not found. - * @returns {?User} The value of the option, or null if not set and not required. - */ - getUser(name, required = false) { - const option = this._getTypedOption(name, 'USER', ['user'], required); - return option?.user ?? null; - } - - /** - * Gets a member option. - * @param {string} name The name of the option. - * @param {boolean} [required=false] Whether to throw an error if the option is not found. - * @returns {?(GuildMember|APIGuildMember)} - * The value of the option, or null if not set and not required. - */ - getMember(name, required = false) { - const option = this._getTypedOption(name, 'USER', ['member'], required); - return option?.member ?? null; - } - - /** - * Gets a role option. - * @param {string} name The name of the option. - * @param {boolean} [required=false] Whether to throw an error if the option is not found. - * @returns {?(Role|APIRole)} The value of the option, or null if not set and not required. - */ - getRole(name, required = false) { - const option = this._getTypedOption(name, 'ROLE', ['role'], required); - return option?.role ?? null; - } - - /** - * Gets a mentionable option. - * @param {string} name The name of the option. - * @param {boolean} [required=false] Whether to throw an error if the option is not found. - * @returns {?(User|GuildMember|APIGuildMember|Role|APIRole)} - * The value of the option, or null if not set and not required. - */ - getMentionable(name, required = false) { - const option = this._getTypedOption( - name, - 'MENTIONABLE', - ['user', 'member', 'role'], - required, - ); - return option?.member ?? option?.user ?? option?.role ?? null; - } - - /** - * Gets a message option. - * @param {string} name The name of the option. - * @param {boolean} [required=false] Whether to throw an error if the option is not found. - * @returns {?(Message|APIMessage)} - * The value of the option, or null if not set and not required. - */ - getMessage(name, required = false) { - const option = this._getTypedOption( - name, - '_MESSAGE', - ['message'], - required, - ); - return option?.message ?? null; - } - - /** - * The full autocomplete option object. - * @typedef {Object} AutocompleteFocusedOption - * @property {string} name The name of the option - * @property {ApplicationCommandOptionType} type The type of the application command option - * @property {string} value The value of the option - * @property {boolean} focused Whether this option is currently in focus for autocomplete - */ - - /** - * Gets the focused option. - * @param {boolean} [getFull=false] Whether to get the full option object - * @returns {string|AutocompleteFocusedOption} - * The value of the option, or the whole option if getFull is true - */ - getFocused(getFull = false) { - const focusedOption = this._hoistedOptions.find((option) => option.focused); - if (!focusedOption) - throw new TypeError('AUTOCOMPLETE_INTERACTION_OPTION_NO_FOCUSED_OPTION'); - return getFull ? focusedOption : focusedOption.value; - } - - /** - * Gets an attachment option. - * @param {string} name The name of the option. - * @param {boolean} [required=false] Whether to throw an error if the option is not found. - * @returns {?MessageAttachment} The value of the option, or null if not set and not required. - */ - getAttachment(name, required = false) { - const option = this._getTypedOption( - name, - 'ATTACHMENT', - ['attachment'], - required, - ); - return option?.attachment ?? null; - } -} - -module.exports = CommandInteractionOptionResolver; diff --git a/vendor/discord.js-selfbot-v13/src/structures/ContainerComponent.js b/vendor/discord.js-selfbot-v13/src/structures/ContainerComponent.js deleted file mode 100644 index 2c7c971..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/ContainerComponent.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; - -const BaseMessageComponent = require('./BaseMessageComponent'); -const { MessageComponentTypes } = require('../util/Constants'); - -class ContainerComponent extends BaseMessageComponent { - /** - * @typedef {MessageActionRow|TextDisplayComponent|SectionComponent|MediaGalleryComponent|SeparatorComponent|FileComponent} ContainerComponents - * @property {ContainerComponents[]} [components] Components of the type action row, text display, section, media gallery, separator, or file - * @property {Number} [accent_color] Color for the accent on the container as RGB from 0x000000 to 0xFFFFFF - * @property {Boolean} [spoiler] Whether the container should be a spoiler (or blurred out). Defaults to false. - */ - - /** - * @param {ContainerComponent | APIContainerComponent} [data={}] The data - */ - constructor(data = {}) { - super({ type: 'CONTAINER' }); - - this.setup(data); - } - - setup(data) { - super.setup(data); - /** - * Components of the type action row, text display, section, media gallery, separator, or file - * @type {ContainerComponents[]} - */ - this.components = - data.components?.map((c) => BaseMessageComponent.create(c)) ?? []; - - /** - * Color for the accent on the container as RGB from 0x000000 to 0xFFFFFF - * @type {Number} - */ - this.accentColor = data.accent_color ?? null; - - /** - * Whether the container should be a spoiler (or blurred out). Defaults to false. - * @type {Boolean} - */ - this.spoiler = data.spoiler ?? false; - } - - /** - * The hex accent color of this container - * @type {?string} - * @readonly - */ - get hexAccentColor() { - return typeof this.accentColor === 'number' - ? `#${this.accentColor.toString(16).padStart(6, '0')}` - : (this.accentColor ?? null); - } - - /** - * @returns {APIContainerComponent} - */ - toJSON() { - return { - type: MessageComponentTypes[this.type], - components: this.components.map((c) => c.toJSON()), - accent_color: this.accent_color, - spoiler: this.spoiler, - }; - } -} - -module.exports = ContainerComponent; diff --git a/vendor/discord.js-selfbot-v13/src/structures/ContextMenuInteraction.js b/vendor/discord.js-selfbot-v13/src/structures/ContextMenuInteraction.js deleted file mode 100644 index 6300ad5..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/ContextMenuInteraction.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; - -const BaseCommandInteraction = require('./BaseCommandInteraction'); -const CommandInteractionOptionResolver = require('./CommandInteractionOptionResolver'); -const { - ApplicationCommandOptionTypes, - ApplicationCommandTypes, -} = require('../util/Constants'); - -/** - * Represents a context menu interaction. - * @extends {BaseCommandInteraction} - */ -class ContextMenuInteraction extends BaseCommandInteraction { - constructor(client, data) { - super(client, data); - /** - * The target of the interaction, parsed into options - * @type {CommandInteractionOptionResolver} - */ - this.options = new CommandInteractionOptionResolver( - this.client, - this.resolveContextMenuOptions(data.data), - this.transformResolved(data.data.resolved), - ); - - /** - * The id of the target of this interaction - * @type {Snowflake} - */ - this.targetId = data.data.target_id; - - /** - * The type of the target of the interaction; either USER or MESSAGE - * @type {ApplicationCommandType} - */ - this.targetType = ApplicationCommandTypes[data.data.type]; - } - - /** - * Resolves and transforms options received from the API for a context menu interaction. - * @param {APIApplicationCommandInteractionData} data The interaction data - * @returns {CommandInteractionOption[]} - * @private - */ - resolveContextMenuOptions({ target_id, resolved }) { - const result = []; - - if (resolved.users?.[target_id]) { - result.push( - this.transformOption( - { - name: 'user', - type: ApplicationCommandOptionTypes.USER, - value: target_id, - }, - resolved, - ), - ); - } - - if (resolved.messages?.[target_id]) { - result.push({ - name: 'message', - type: '_MESSAGE', - value: target_id, - message: - this.channel?.messages._add(resolved.messages[target_id]) ?? - resolved.messages[target_id], - }); - } - - return result; - } -} - -module.exports = ContextMenuInteraction; diff --git a/vendor/discord.js-selfbot-v13/src/structures/DMChannel.js b/vendor/discord.js-selfbot-v13/src/structures/DMChannel.js deleted file mode 100644 index 0bed735..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/DMChannel.js +++ /dev/null @@ -1,232 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const { Channel } = require('./Channel'); -const TextBasedChannel = require('./interfaces/TextBasedChannel'); -const MessageManager = require('../managers/MessageManager'); -const { Opcodes, Status } = require('../util/Constants'); - -/** - * Represents a direct message channel between two users. - * @extends {Channel} - * @implements {TextBasedChannel} - */ -class DMChannel extends Channel { - constructor(client, data) { - super(client, data); - - // Override the channel type so partials have a known type - this.type = 'DM'; - - /** - * A manager of the messages belonging to this channel - * @type {MessageManager} - */ - this.messages = new MessageManager(this); - } - - _patch(data) { - super._patch(data); - - if (data.recipients) { - /** - * The recipient on the other end of the DM - * @type {User} - */ - this.recipient = this.client.users._add(data.recipients[0]); - } - - if ('last_message_id' in data) { - /** - * The channel's last message id, if one was sent - * @type {?Snowflake} - */ - this.lastMessageId = data.last_message_id; - } - - if ('last_pin_timestamp' in data) { - /** - * The timestamp when the last pinned message was pinned, if there was one - * @type {?number} - */ - this.lastPinTimestamp = data.last_pin_timestamp - ? Date.parse(data.last_pin_timestamp) - : null; - } else { - this.lastPinTimestamp ??= null; - } - - if ('is_message_request' in data) { - /** - * Whether the channel is a message request - * @type {?boolean} - */ - this.messageRequest = data.is_message_request; - } - - if ('is_message_request_timestamp' in data) { - /** - * The timestamp when the message request was created - * @type {?number} - */ - this.messageRequestTimestamp = data.is_message_request_timestamp - ? Date.parse(data.is_message_request_timestamp) - : null; - } - } - - /** - * Accept this DMChannel. - * @returns {Promise} - */ - async acceptMessageRequest() { - if (!this.messageRequest) { - throw new Error( - 'NOT_MESSAGE_REQUEST', - 'This channel is not a message request', - ); - } - const c = await this.client.api.channels[this.id].recipients['@me'].put({ - data: { - consent_status: 2, - }, - }); - this.messageRequest = false; - return this.client.channels._add(c); - } - - /** - * Cancel this DMChannel. - * @returns {Promise} - */ - async cancelMessageRequest() { - if (!this.messageRequest) { - throw new Error( - 'NOT_MESSAGE_REQUEST', - 'This channel is not a message request', - ); - } - await this.client.api.channels[this.id].recipients['@me'].delete(); - return this; - } - - /** - * Whether this DMChannel is a partial - * @type {boolean} - * @readonly - */ - get partial() { - return typeof this.lastMessageId === 'undefined'; - } - - /** - * Fetch this DMChannel. - * @param {boolean} [force=true] Whether to skip the cache check and request the API - * @returns {Promise} - */ - fetch(force = true) { - return this.recipient.createDM(force); - } - - /** - * When concatenated with a string, this automatically returns the recipient's mention instead of the - * DMChannel object. - * @returns {string} - * @example - * // Logs: Hello from <@123456789012345678>! - * console.log(`Hello from ${channel}!`); - */ - toString() { - return this.recipient.toString(); - } - - /** - * Sync VoiceState of this DMChannel. - * @returns {undefined} - */ - sync() { - this.client.ws.broadcast({ - op: Opcodes.DM_UPDATE, - d: { - channel_id: this.id, - }, - }); - } - - /** - * Ring the user's phone / PC (call) - * @returns {Promise} - */ - ring() { - return this.client.api.channels(this.id).call.ring.post({ - data: { - recipients: null, - }, - }); - } - - /** - * The user in this voice-based channel - * @type {Collection} - * @readonly - */ - get voiceUsers() { - const coll = new Collection(); - for (const state of this.client.voiceStates.cache.values()) { - if (state.channelId === this.id && state.user) { - coll.set(state.id, state.user); - } - } - return coll; - } - - /** - * Get current shard - * @type {WebSocketShard} - * @readonly - */ - get shard() { - return this.client.ws.shards.first(); - } - - /** - * The voice state adapter for this client that can be used with @discordjs/voice to play audio in DM / Group DM channels. - * @type {?Function} - * @readonly - */ - get voiceAdapterCreator() { - return (methods) => { - this.client.voice.adapters.set(this.id, methods); - return { - sendPayload: (data) => { - if (this.shard.status !== Status.READY) return false; - this.shard.send(data); - return true; - }, - destroy: () => { - this.client.voice.adapters.delete(this.id); - }, - }; - }; - } - - // These are here only for documentation purposes - they are implemented by TextBasedChannel - /* eslint-disable no-empty-function */ - get lastMessage() {} - get lastPinAt() {} - send() {} - sendTyping() {} - createMessageCollector() {} - awaitMessages() {} - // Doesn't work on DM channels; setRateLimitPerUser() {} - // Doesn't work on DM channels; setNSFW() {} -} - -TextBasedChannel.applyToClass(DMChannel, true, [ - 'fetchWebhooks', - 'createWebhook', - 'setRateLimitPerUser', - 'setNSFW', -]); - -module.exports = DMChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/DirectoryChannel.js b/vendor/discord.js-selfbot-v13/src/structures/DirectoryChannel.js deleted file mode 100644 index ba13f85..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/DirectoryChannel.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -const { Channel } = require('./Channel'); - -/** - * Represents a channel that displays a directory of guilds. - * @extends {Channel} - */ -class DirectoryChannel extends Channel { - _patch(data) { - super._patch(data); - /** - * The channel's name - * @type {string} - */ - this.name = data.name; - } -} - -module.exports = DirectoryChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Emoji.js b/vendor/discord.js-selfbot-v13/src/structures/Emoji.js deleted file mode 100644 index b39270d..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Emoji.js +++ /dev/null @@ -1,153 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const Base = require('./Base'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); - -/** - * @type {WeakSet} - * @private - * @internal - */ -const deletedEmojis = new WeakSet(); -let deprecationEmittedForDeleted = false; - -/** - * Represents raw emoji data from the API - * @typedef {APIEmoji} RawEmoji - * @property {?Snowflake} id The emoji's id - * @property {?string} name The emoji's name - * @property {?boolean} animated Whether the emoji is animated - */ - -/** - * Represents an emoji, see {@link GuildEmoji} and {@link ReactionEmoji}. - * @extends {Base} - */ -class Emoji extends Base { - constructor(client, emoji) { - super(client); - /** - * Whether or not the emoji is animated - * @type {?boolean} - */ - this.animated = emoji.animated ?? null; - - /** - * The emoji's name - * @type {?string} - */ - this.name = emoji.name ?? null; - - /** - * The emoji's id - * @type {?Snowflake} - */ - this.id = emoji.id ?? null; - } - - /** - * Whether or not the structure has been deleted - * @type {boolean} - * @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 - */ - get deleted() { - if (!deprecationEmittedForDeleted) { - deprecationEmittedForDeleted = true; - process.emitWarning( - 'Emoji#deleted is deprecated, see https://github.com/discordjs/discord.js/issues/7091.', - 'DeprecationWarning', - ); - } - - return deletedEmojis.has(this); - } - - set deleted(value) { - if (!deprecationEmittedForDeleted) { - deprecationEmittedForDeleted = true; - process.emitWarning( - 'Emoji#deleted is deprecated, see https://github.com/discordjs/discord.js/issues/7091.', - 'DeprecationWarning', - ); - } - - if (value) deletedEmojis.add(this); - else deletedEmojis.delete(this); - } - - /** - * The identifier of this emoji, used for message reactions - * @type {string} - * @readonly - */ - get identifier() { - if (this.id) return `${this.animated ? 'a:' : ''}${this.name}:${this.id}`; - return encodeURIComponent(this.name); - } - - /** - * The URL to the emoji file if it's a custom emoji - * @type {?string} - * @readonly - */ - get url() { - return ( - this.id && - this.client.rest.cdn.Emoji(this.id, this.animated ? 'gif' : 'png') - ); - } - - /** - * The timestamp the emoji was created at, or null if unicode - * @type {?number} - * @readonly - */ - get createdTimestamp() { - return this.id && SnowflakeUtil.timestampFrom(this.id); - } - - /** - * The time the emoji was created at, or null if unicode - * @type {?Date} - * @readonly - */ - get createdAt() { - return this.id && new Date(this.createdTimestamp); - } - - /** - * When concatenated with a string, this automatically returns the text required to form a graphical emoji on Discord - * instead of the Emoji object. - * @returns {string} - * @example - * // Send a custom emoji from a guild: - * const emoji = guild.emojis.cache.first(); - * msg.channel.send(`Hello! ${emoji}`); - * @example - * // Send the emoji used in a reaction to the channel the reaction is part of - * reaction.message.channel.send(`The emoji used was: ${reaction.emoji}`); - */ - toString() { - return this.id - ? `<${this.animated ? 'a' : ''}:${this.name}:${this.id}>` - : this.name; - } - - toJSON() { - return super.toJSON({ - guild: 'guildId', - createdTimestamp: true, - url: true, - identifier: true, - }); - } -} - -exports.Emoji = Emoji; -exports.deletedEmojis = deletedEmojis; - -/** - * @external APIEmoji - * @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object} - */ diff --git a/vendor/discord.js-selfbot-v13/src/structures/FileComponent.js b/vendor/discord.js-selfbot-v13/src/structures/FileComponent.js deleted file mode 100644 index 66f95ab..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/FileComponent.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; - -const BaseMessageComponent = require('./BaseMessageComponent'); -const UnfurledMediaItem = require('./UnfurledMediaItem'); -const { MessageComponentTypes } = require('../util/Constants'); - -class FileComponent extends BaseMessageComponent { - /** - * @property {UnfurledMediaItem} [file] This unfurled media item is unique in that it only supports attachment references using the attachment:// syntax - * @property {Boolean} [spoiler] Whether the container should be a spoiler (or blurred out). Defaults to false. - */ - - /** - * @param {FileComponent | APIFileComponent} [data={}] The data - */ - constructor(data = {}) { - super({ type: 'FILE' }); - - this.setup(data); - } - - setup(data) { - super.setup(data); - /** - * This unfurled media item is unique in that it only supports attachment references using the attachment:// syntax - * @type {UnfurledMediaItem} - */ - this.file = new UnfurledMediaItem(data.file); - - /** - * Whether the container should be a spoiler (or blurred out). Defaults to false. - * @type {Boolean} - */ - this.spoiler = data.spoiler ?? false; - } - - /** - * @returns {APIFileComponent} - */ - toJSON() { - return { - type: MessageComponentTypes[this.type], - file: this.content, - spoiler: this.spoiler, - }; - } -} - -module.exports = FileComponent; diff --git a/vendor/discord.js-selfbot-v13/src/structures/ForumChannel.js b/vendor/discord.js-selfbot-v13/src/structures/ForumChannel.js deleted file mode 100644 index 42363a5..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/ForumChannel.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -const ThreadOnlyChannel = require('./ThreadOnlyChannel'); -const { ForumLayoutTypes } = require('../util/Constants'); - -/** - * Represents a forum channel. - * @extends {ThreadOnlyChannel} - */ -class ForumChannel extends ThreadOnlyChannel { - _patch(data) { - super._patch(data); - /** - * The default layout type used to display posts - * @type {ForumLayoutType} - */ - this.defaultForumLayout = ForumLayoutTypes[data.default_forum_layout]; - } - - /** - * Sets the default forum layout type used to display posts - * @param {ForumLayoutType} defaultForumLayout The default forum layout type to set on this channel - * @param {string} [reason] Reason for changing the default forum layout - * @returns {Promise} - */ - setDefaultForumLayout(defaultForumLayout, reason) { - return this.edit({ defaultForumLayout }, reason); - } -} - -module.exports = ForumChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/GroupDMChannel.js b/vendor/discord.js-selfbot-v13/src/structures/GroupDMChannel.js deleted file mode 100644 index 19d85f9..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/GroupDMChannel.js +++ /dev/null @@ -1,405 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const { Channel } = require('./Channel'); -const Invite = require('./Invite'); -const TextBasedChannel = require('./interfaces/TextBasedChannel'); -const MessageManager = require('../managers/MessageManager'); -const { Status, Opcodes } = require('../util/Constants'); -const DataResolver = require('../util/DataResolver'); - -/** - * Represents a Group DM Channel on Discord. - * @extends {Channel} - * @implements {TextBasedChannel} - */ -class GroupDMChannel extends Channel { - constructor(client, data) { - super(client, data); - // Override the channel type so partials have a known type - this.type = 'GROUP_DM'; - - /** - * A manager of the messages belonging to this channel - * @type {MessageManager} - */ - this.messages = new MessageManager(this); - } - - _patch(data) { - super._patch(data); - - if ('recipients' in data && Array.isArray(data.recipients)) { - this._recipients = data.recipients; - data.recipients.forEach((u) => this.client.users._add(u)); - } else { - this._recipients = []; - } - - if ('owner_id' in data) { - /** - * The user id of the owner of this Group DM Channel - * @type {?Snowflake} - */ - this.ownerId = data.owner_id; - } else { - this.ownerId ??= null; - } - - if ('last_message_id' in data) { - /** - * The channel's last message id, if one was sent - * @type {?Snowflake} - */ - this.lastMessageId = data.last_message_id; - } else { - this.lastMessageId ??= null; - } - - if ('last_pin_timestamp' in data) { - /** - * The timestamp when the last pinned message was pinned, if there was one - * @type {?number} - */ - this.lastPinTimestamp = data.last_pin_timestamp - ? Date.parse(data.last_pin_timestamp) - : null; - } else { - this.lastPinTimestamp ??= null; - } - - if ('name' in data) { - /** - * The name of this Group DM Channel - * @type {?string} - */ - this.name = data.name; - } - - if ('icon' in data) { - /** - * The hash of the channel icon - * @type {?string} - */ - this.icon = data.icon ?? null; - } - } - - /** - * The URL to this channel's icon. - * @param {StaticImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - iconURL({ format, size } = {}) { - return ( - this.icon && - this.client.rest.cdn.GDMIcon(this.id, this.icon, format, size) - ); - } - - /** - * The recipients of this Group DM Channel. - * @type {Collection} - * @readonly - */ - get recipients() { - const collect = new Collection(); - this._recipients.map((recipient) => - collect.set(recipient.id, this.client.users.cache.get(recipient.id)), - ); - collect.set(this.client.user.id, this.client.user); - return collect; - } - - /** - * The owner of this Group DM Channel - * @type {?User} - * @readonly - */ - get owner() { - return this.client.users.cache.get(this.ownerId); - } - - /** - * Whether this DMChannel is a partial - * @type {boolean} - * @readonly - */ - get partial() { - return typeof this.lastMessageId === 'undefined'; - } - - /** - * Leave this Group DM Channel. - * @param {?boolean} slient Leave without notifying other members - * @returns {Promise} - * @example - * // Delete the channel - * channel.delete() - * .then(console.log) - * .catch(console.error); - */ - async delete(slient = false) { - if (typeof slient === 'boolean' && slient) { - await this.client.api.channels[this.id].delete({ - query: { - silent: true, - }, - }); - } else { - await this.client.api.channels[this.id].delete(); - } - return this; - } - - /** - * When concatenated with a string, this automatically returns the recipient's mention instead of the - * GroupDMChannel object. - * @returns {string} - * @example - * // Logs: Hello from Group Test! - * console.log(`Hello from ${channel}!`); - */ - toString() { - return ( - this.name ?? - this._recipients - .filter((user) => user.id !== this.client.user.id) - .map((user) => user.username) - .join(', ') - ); - } - - toJSON() { - const json = super.toJSON({ - createdTimestamp: true, - }); - json.iconURL = this.iconURL(); - return json; - } - - /** - * The data for editing a channe;. - * @typedef {Object} GroupDMChannelEditData - * @property {string} [name] The name of the channel - * @property {?(BufferResolvable|Base64Resolvable)} [icon] The icon of the channel - * @property {GuildMemberResolvable} [owner] The owner of the channel - */ - - /** - * Edit channel data - * @param {GroupDMChannelEditData} data Data - * @returns {Promise} - * @example - * // Set the channel name - * channel.edit({ - * name: 'Group Test', - * }) - * .then(updated => console.log(`New channel name ${updated}`)) - * .catch(console.error); - */ - async edit(data) { - const _data = {}; - if ('name' in data) _data.name = data.name?.trim() ?? null; - if (typeof data.icon !== 'undefined') { - _data.icon = await DataResolver.resolveImage(data.icon); - } - if ('owner' in data) { - _data.owner = data.owner; - } - const newData = await this.client.api.channels[this.id].patch({ - data: _data, - }); - - return this.client.actions.ChannelUpdate.handle(newData).updated; - } - - /** - * Renames this Group DM Channel. - * @param {?string} name Name of the channel - * @returns {Promise} - */ - setName(name) { - return this.edit({ name }); - } - - /** - * Sets the icon of this Group DM Channel. - * @param {?(Base64Resolvable|BufferResolvable)} icon Icon of the channel - * @returns {Promise} - */ - setIcon(icon) { - return this.edit({ icon }); - } - - /** - * Changes the owner of this Group DM Channel. - * @param {UserResolvable} user User to transfer ownership to - * @returns {Promise} - */ - setOwner(user) { - const id = this.client.users.resolveId(user); - if (this.ownerId === id) { - return Promise.resolve(this); - } - return this.edit({ owner: id }); - } - - /** - * Adds a user to this Group DM Channel. - * @param {UserResolvable} user User to add to the group - * @returns {Promise} - */ - async addUser(user) { - user = this.client.users.resolveId(user); - await this.client.api.channels[this.id].recipients[user].put(); - return this; - } - - /** - * Removes a user from this Group DM Channel. - * @param {UserResolvable} user User to remove from the group - * @returns {Promise} - */ - async removeUser(user) { - user = this.client.users.resolveId(user); - await this.client.api.channels[this.id].recipients[user].delete(); - return this; - } - - /** - * Gets the invite for this Group DM Channel. - * @returns {Promise} - */ - async getInvite() { - const inviteCode = await this.client.api.channels(this.id).invites.post({ - data: { - max_age: 86400, - }, - }); - return new Invite(this.client, inviteCode); - } - - /** - * Get all the invites for this Group DM Channel. - * @returns {Promise>} - */ - async fetchAllInvite() { - const invites = await this.client.api.channels(this.id).invites.get(); - return new Collection( - invites.map((invite) => [invite.code, new Invite(this.client, invite)]), - ); - } - - /** - * Delete invites from this Group DM Channel. - * @param {InviteResolvable} invite Invite to add to the channel - * @returns {Promise} - */ - async removeInvite(invite) { - // Resolve - let code = invite?.code; - if (!code && URL.canParse(invite)) code = new URL(invite).pathname.slice(1); - else code = invite; - await this.client.api.channels(this.id).invites[invite].delete(); - return this; - } - - /** - * Ring the user's phone / PC (call) - * @param {UserResolvable[]} [recipients] Array of recipients - * @returns {Promise} - */ - ring(recipients) { - if (!recipients || !Array.isArray(recipients) || recipients.length == 0) { - recipients = null; - } else { - recipients = recipients - .map((r) => this.client.users.resolveId(r)) - .filter((r) => r && this.recipients.get(r)); - } - return this.client.api.channels(this.id).call.ring.post({ - data: { - recipients, - }, - }); - } - - /** - * Sync VoiceState of this Group DMChannel. - * @returns {undefined} - */ - sync() { - this.client.ws.broadcast({ - op: Opcodes.DM_UPDATE, - d: { - channel_id: this.id, - }, - }); - } - - /** - * The user in this voice-based channel - * @type {Collection} - * @readonly - */ - get voiceUsers() { - const coll = new Collection(); - for (const state of this.client.voiceStates.cache.values()) { - if (state.channelId === this.id && state.user) { - coll.set(state.id, state.user); - } - } - return coll; - } - - /** - * Get current shard - * @type {WebSocketShard} - * @readonly - */ - get shard() { - return this.client.ws.shards.first(); - } - - /** - * The voice state adapter for this client that can be used with @discordjs/voice to play audio in DM / Group DM channels. - * @type {?Function} - * @readonly - */ - get voiceAdapterCreator() { - return (methods) => { - this.client.voice.adapters.set(this.id, methods); - return { - sendPayload: (data) => { - if (this.shard.status !== Status.READY) return false; - this.shard.send(data); - return true; - }, - destroy: () => { - this.client.voice.adapters.delete(this.id); - }, - }; - }; - } - - // These are here only for documentation purposes - they are implemented by TextBasedChannel - /* eslint-disable no-empty-function */ - get lastMessage() {} - get lastPinAt() {} - send() {} - sendTyping() {} - createMessageCollector() {} - awaitMessages() {} - // Doesn't work on DM channels; setRateLimitPerUser() {} - // Doesn't work on DM channels; setNSFW() {} -} - -TextBasedChannel.applyToClass(GroupDMChannel, true, [ - 'fetchWebhooks', - 'createWebhook', - 'setRateLimitPerUser', - 'setNSFW', -]); - -module.exports = GroupDMChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Guild.js b/vendor/discord.js-selfbot-v13/src/structures/Guild.js deleted file mode 100644 index e95e6ad..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Guild.js +++ /dev/null @@ -1,1697 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const { Collection } = require('@discordjs/collection'); -const AnonymousGuild = require('./AnonymousGuild'); -const GuildAuditLogs = require('./GuildAuditLogs'); -const GuildPreview = require('./GuildPreview'); -const GuildTemplate = require('./GuildTemplate'); -const Integration = require('./Integration'); -const Webhook = require('./Webhook'); -const WelcomeScreen = require('./WelcomeScreen'); -const { Error } = require('../errors'); -const AutoModerationRuleManager = require('../managers/AutoModerationRuleManager'); -const GuildBanManager = require('../managers/GuildBanManager'); -const GuildChannelManager = require('../managers/GuildChannelManager'); -const GuildEmojiManager = require('../managers/GuildEmojiManager'); -const GuildInviteManager = require('../managers/GuildInviteManager'); -const GuildMemberManager = require('../managers/GuildMemberManager'); -const GuildScheduledEventManager = require('../managers/GuildScheduledEventManager'); -const GuildSettingManager = require('../managers/GuildSettingManager'); -const GuildStickerManager = require('../managers/GuildStickerManager'); -const PresenceManager = require('../managers/PresenceManager'); -const RoleManager = require('../managers/RoleManager'); -const StageInstanceManager = require('../managers/StageInstanceManager'); -const VoiceStateManager = require('../managers/VoiceStateManager'); -const { - ChannelTypes, - DefaultMessageNotificationLevels, - VerificationLevels, - ExplicitContentFilterLevels, - Status, - MFALevels, - PremiumTiers, -} = require('../util/Constants'); -const DataResolver = require('../util/DataResolver'); -const SystemChannelFlags = require('../util/SystemChannelFlags'); -const Util = require('../util/Util'); - -let deprecationEmittedForSetChannelPositions = false; -let deprecationEmittedForSetRolePositions = false; -let deprecationEmittedForDeleted = false; -let deprecationEmittedForMe = false; - -/** - * @type {WeakSet} - * @private - * @internal - */ -const deletedGuilds = new WeakSet(); - -/** - * Represents a guild (or a server) on Discord. - * It's recommended to see if a guild is available before performing operations or reading data from it. You can - * check this with {@link Guild#available}. - * @extends {AnonymousGuild} - */ -class Guild extends AnonymousGuild { - constructor(client, data) { - super(client, data, false); - - /** - * A manager of the members belonging to this guild - * @type {GuildMemberManager} - */ - this.members = new GuildMemberManager(this); - - /** - * A manager of the channels belonging to this guild - * @type {GuildChannelManager} - */ - this.channels = new GuildChannelManager(this); - - /** - * A manager of the bans belonging to this guild - * @type {GuildBanManager} - */ - this.bans = new GuildBanManager(this); - - /** - * A manager of the roles belonging to this guild - * @type {RoleManager} - */ - this.roles = new RoleManager(this); - - /** - * A manager of the presences belonging to this guild - * @type {PresenceManager} - */ - this.presences = new PresenceManager(this.client); - - /** - * A manager of the voice states of this guild - * @type {VoiceStateManager} - */ - this.voiceStates = new VoiceStateManager(this); - - /** - * A manager of the stage instances of this guild - * @type {StageInstanceManager} - */ - this.stageInstances = new StageInstanceManager(this); - - /** - * A manager of the invites of this guild - * @type {GuildInviteManager} - */ - this.invites = new GuildInviteManager(this); - - /** - * A manager of the scheduled events of this guild - * @type {GuildScheduledEventManager} - */ - this.scheduledEvents = new GuildScheduledEventManager(this); - - /** - * A manager of the auto moderation rules of this guild. - * @type {AutoModerationRuleManager} - */ - this.autoModerationRules = new AutoModerationRuleManager(this); - - /** - * All of the settings {@link Object} - * @type {GuildSettingManager} - */ - this.settings = new GuildSettingManager(this); - - if (!data) return; - if (data.unavailable) { - /** - * Whether the guild is available to access. If it is not available, it indicates a server outage - * @type {boolean} - */ - this.available = false; - } else { - this._patch(data); - if (!data.channels) this.available = false; - } - - /** - * The id of the shard this Guild belongs to. - * @type {number} - */ - this.shardId = data.shardId; - } - - /** - * Whether or not the structure has been deleted - * @type {boolean} - * @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 - */ - get deleted() { - if (!deprecationEmittedForDeleted) { - deprecationEmittedForDeleted = true; - process.emitWarning( - 'Guild#deleted is deprecated, see https://github.com/discordjs/discord.js/issues/7091.', - 'DeprecationWarning', - ); - } - - return deletedGuilds.has(this); - } - - set deleted(value) { - if (!deprecationEmittedForDeleted) { - deprecationEmittedForDeleted = true; - process.emitWarning( - 'Guild#deleted is deprecated, see https://github.com/discordjs/discord.js/issues/7091.', - 'DeprecationWarning', - ); - } - - if (value) deletedGuilds.add(this); - else deletedGuilds.delete(this); - } - - /** - * The Shard this Guild belongs to. - * @type {WebSocketShard} - * @readonly - */ - get shard() { - return this.client.ws.shards.get(this.shardId); - } - - _patch(data) { - super._patch(data); - this.id = data.id; - if ('name' in data) this.name = data.name; - if ('icon' in data) this.icon = data.icon; - if ('unavailable' in data) { - this.available = !data.unavailable; - } else { - this.available ??= true; - } - - if ('discovery_splash' in data) { - /** - * The hash of the guild discovery splash image - * @type {?string} - */ - this.discoverySplash = data.discovery_splash; - } - - if ('member_count' in data) { - /** - * The full amount of members in this guild - * @type {number} - */ - this.memberCount = data.member_count; - } - - if ('large' in data) { - /** - * Whether the guild is "large" (has more than {@link WebsocketOptions large_threshold} members, 50 by default) - * @type {boolean} - */ - this.large = Boolean(data.large); - } - - if ('premium_progress_bar_enabled' in data) { - /** - * Whether this guild has its premium (boost) progress bar enabled - * @type {boolean} - */ - this.premiumProgressBarEnabled = data.premium_progress_bar_enabled; - } - - /** - * An array of enabled guild features, here are the possible values: - * * ANIMATED_ICON - * * AUTO_MODERATION - * * BANNER - * * COMMERCE - * * COMMUNITY - * * CREATOR_MONETIZABLE_PROVISIONAL - * * CREATOR_STORE_PAGE - * * DISCOVERABLE - * * FEATURABLE - * * INVITES_DISABLED - * * INVITE_SPLASH - * * MEMBER_VERIFICATION_GATE_ENABLED - * * NEWS - * * PARTNERED - * * PREVIEW_ENABLED - * * VANITY_URL - * * VERIFIED - * * VIP_REGIONS - * * WELCOME_SCREEN_ENABLED - * * TICKETED_EVENTS_ENABLED - * * MONETIZATION_ENABLED - * `MONETIZATION_ENABLED` has been replaced. - * See [this pull request](https://github.com/discord/discord-api-docs/pull/5724) for more information. - * * MORE_STICKERS - * * THREE_DAY_THREAD_ARCHIVE - * * SEVEN_DAY_THREAD_ARCHIVE - * * PRIVATE_THREADS - * * ROLE_ICONS - * * RAID_ALERTS_DISABLED - * * ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE - * * ROLE_SUBSCRIPTIONS_ENABLED - * @typedef {string} Features - * @see {@link https://discord.com/developers/docs/resources/guild#guild-object-guild-features} - */ - - if ('application_id' in data) { - /** - * The id of the application that created this guild (if applicable) - * @type {?Snowflake} - */ - this.applicationId = data.application_id; - } - - if ('afk_timeout' in data) { - /** - * The time in seconds before a user is counted as "away from keyboard" - * @type {?number} - */ - this.afkTimeout = data.afk_timeout; - } - - if ('afk_channel_id' in data) { - /** - * The id of the voice channel where AFK members are moved - * @type {?Snowflake} - */ - this.afkChannelId = data.afk_channel_id; - } - - if ('system_channel_id' in data) { - /** - * The system channel's id - * @type {?Snowflake} - */ - this.systemChannelId = data.system_channel_id; - } - - if ('premium_tier' in data) { - /** - * The premium tier of this guild - * @type {PremiumTier} - */ - this.premiumTier = PremiumTiers[data.premium_tier]; - } - - if ('widget_enabled' in data) { - /** - * Whether widget images are enabled on this guild - * @type {?boolean} - */ - this.widgetEnabled = data.widget_enabled; - } - - if ('widget_channel_id' in data) { - /** - * The widget channel's id, if enabled - * @type {?string} - */ - this.widgetChannelId = data.widget_channel_id; - } - - if ('explicit_content_filter' in data) { - /** - * The explicit content filter level of the guild - * @type {ExplicitContentFilterLevel} - */ - this.explicitContentFilter = - ExplicitContentFilterLevels[data.explicit_content_filter]; - } - - if ('mfa_level' in data) { - /** - * The required MFA level for this guild - * @type {MFALevel} - */ - this.mfaLevel = MFALevels[data.mfa_level]; - } - - if ('joined_at' in data) { - /** - * The timestamp the client user joined the guild at - * @type {number} - */ - this.joinedTimestamp = new Date(data.joined_at).getTime(); - } - - if ('default_message_notifications' in data) { - /** - * The default message notification level of the guild - * @type {DefaultMessageNotificationLevel} - */ - this.defaultMessageNotifications = - DefaultMessageNotificationLevels[data.default_message_notifications]; - } - - if ('system_channel_flags' in data) { - /** - * The value set for the guild's system channel flags - * @type {Readonly} - */ - this.systemChannelFlags = new SystemChannelFlags( - data.system_channel_flags, - ).freeze(); - } - - if ('max_members' in data) { - /** - * The maximum amount of members the guild can have - * @type {?number} - */ - this.maximumMembers = data.max_members; - } else { - this.maximumMembers ??= null; - } - - if ('max_presences' in data) { - /** - * The maximum amount of presences the guild can have - * You will need to fetch the guild using {@link Guild#fetch} if you want to receive this parameter - * @type {?number} - */ - this.maximumPresences = data.max_presences ?? 25_000; - } else { - this.maximumPresences ??= null; - } - - if ('max_video_channel_users' in data) { - /** - * The maximum amount of users allowed in a video channel. - * @type {?number} - */ - this.maxVideoChannelUsers = data.max_video_channel_users; - } else { - this.maxVideoChannelUsers ??= null; - } - - if ('max_stage_video_channel_users' in data) { - /** - * The maximum amount of users allowed in a stage video channel. - * @type {?number} - */ - this.maxStageVideoChannelUsers = data.max_stage_video_channel_users; - } else { - this.maxStageVideoChannelUsers ??= null; - } - - if ('approximate_member_count' in data) { - /** - * The approximate amount of members the guild has - * You will need to fetch the guild using {@link Guild#fetch} if you want to receive this parameter - * @type {?number} - */ - this.approximateMemberCount = data.approximate_member_count; - } else { - this.approximateMemberCount ??= null; - } - - if ('approximate_presence_count' in data) { - /** - * The approximate amount of presences the guild has - * You will need to fetch the guild using {@link Guild#fetch} if you want to receive this parameter - * @type {?number} - */ - this.approximatePresenceCount = data.approximate_presence_count; - } else { - this.approximatePresenceCount ??= null; - } - - /** - * The use count of the vanity URL code of the guild, if any - * You will need to fetch this parameter using {@link Guild#fetchVanityData} if you want to receive it - * @type {?number} - */ - this.vanityURLUses ??= null; - - if ('rules_channel_id' in data) { - /** - * The rules channel's id for the guild - * @type {?Snowflake} - */ - this.rulesChannelId = data.rules_channel_id; - } - - if ('public_updates_channel_id' in data) { - /** - * The community updates channel's id for the guild - * @type {?Snowflake} - */ - this.publicUpdatesChannelId = data.public_updates_channel_id; - } - - if ('preferred_locale' in data) { - /** - * The preferred locale of the guild, defaults to `en-US` - * @type {Locale} - * @see {@link https://discord.com/developers/docs/reference#locales} - */ - this.preferredLocale = data.preferred_locale; - } - - if ('safety_alerts_channel_id' in data) { - /** - * The safety alerts channel's id for the guild - * @type {?Snowflake} - */ - this.safetyAlertsChannelId = data.safety_alerts_channel_id; - } else { - this.safetyAlertsChannelId ??= null; - } - - if (data.channels) { - this.channels.cache.clear(); - for (const rawChannel of data.channels) { - this.client.channels._add(rawChannel, this); - } - } - - if (data.threads) { - for (const rawThread of data.threads) { - this.client.channels._add(rawThread, this); - } - } - - if (data.roles) { - this.roles.cache.clear(); - for (const role of data.roles) this.roles._add(role); - } - - if (data.members) { - this.members.cache.clear(); - for (const guildUser of data.members) this.members._add(guildUser); - } - - if ('owner_id' in data) { - /** - * The user id of this guild's owner - * @type {Snowflake} - */ - this.ownerId = data.owner_id; - } - - if (data.presences) { - for (const presence of data.presences) { - this.presences._add(Object.assign(presence, { guild: this })); - } - } - - if (data.stage_instances) { - this.stageInstances.cache.clear(); - for (const stageInstance of data.stage_instances) { - this.stageInstances._add(stageInstance); - } - } - - if (data.guild_scheduled_events) { - this.scheduledEvents.cache.clear(); - for (const scheduledEvent of data.guild_scheduled_events) { - this.scheduledEvents._add(scheduledEvent); - } - } - - if (data.voice_states) { - this.voiceStates.cache.clear(); - for (const voiceState of data.voice_states) { - this.voiceStates._add(voiceState); - } - } - - if (!this.emojis) { - /** - * A manager of the emojis belonging to this guild - * @type {GuildEmojiManager} - */ - this.emojis = new GuildEmojiManager(this); - if (data.emojis) for (const emoji of data.emojis) this.emojis._add(emoji); - } else if (data.emojis) { - this.client.actions.GuildEmojisUpdate.handle({ - guild_id: this.id, - emojis: data.emojis, - }); - } - - if (!this.stickers) { - /** - * A manager of the stickers belonging to this guild - * @type {GuildStickerManager} - */ - this.stickers = new GuildStickerManager(this); - if (data.stickers) - for (const sticker of data.stickers) this.stickers._add(sticker); - } else if (data.stickers) { - this.client.actions.GuildStickersUpdate.handle({ - guild_id: this.id, - stickers: data.stickers, - }); - } - - if ('incidents_data' in data) { - /** - * Incident actions of a guild. - * @typedef {Object} IncidentActions - * @property {?Date} invitesDisabledUntil When invites would be enabled again - * @property {?Date} dmsDisabledUntil When direct messages would be enabled again - * @property {?Date} dmSpamDetectedAt When direct message spam was detected - * @property {?Date} raidDetectedAt When a raid was detected - */ - - /** - * The incidents data of this guild. - * You will need to fetch the guild using {@link BaseGuild#fetch} if you want to receive - * this property. - * @type {?IncidentActions} - */ - this.incidentsData = - data.incidents_data && - Util.transformAPIIncidentsData(data.incidents_data); - } else { - this.incidentsData ??= null; - } - } - - /** - * The time the client user joined the guild - * @type {Date} - * @readonly - */ - get joinedAt() { - return new Date(this.joinedTimestamp); - } - - /** - * The URL to this guild's discovery splash image. - * @param {StaticImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - discoverySplashURL({ format, size } = {}) { - return ( - this.discoverySplash && - this.client.rest.cdn.DiscoverySplash( - this.id, - this.discoverySplash, - format, - size, - ) - ); - } - - /** - * Fetches the owner of the guild. - * If the member object isn't needed, use {@link Guild#ownerId} instead. - * @param {BaseFetchOptions} [options] The options for fetching the member - * @returns {Promise} - */ - fetchOwner(options) { - return this.members.fetch({ ...options, user: this.ownerId }); - } - - /** - * AFK voice channel for this guild - * @type {?VoiceChannel} - * @readonly - */ - get afkChannel() { - return this.client.channels.resolve(this.afkChannelId); - } - - /** - * System channel for this guild - * @type {?TextChannel} - * @readonly - */ - get systemChannel() { - return this.client.channels.resolve(this.systemChannelId); - } - - /** - * Safety alerts channel for this guild - * @type {?TextChannel} - * @readonly - */ - get safetyAlertsChannel() { - return this.client.channels.resolve(this.safetyAlertsChannelId); - } - - /** - * Widget channel for this guild - * @type {?(TextChannel|NewsChannel|VoiceChannel|StageChannel|ForumChannel|MediaChannel)} - * @readonly - */ - get widgetChannel() { - return this.client.channels.resolve(this.widgetChannelId); - } - - /** - * Rules channel for this guild - * @type {?TextChannel} - * @readonly - */ - get rulesChannel() { - return this.client.channels.resolve(this.rulesChannelId); - } - - /** - * Public updates channel for this guild - * @type {?TextChannel} - * @readonly - */ - get publicUpdatesChannel() { - return this.client.channels.resolve(this.publicUpdatesChannelId); - } - - /** - * The client user as a GuildMember of this guild - * @type {?GuildMember} - * @deprecated Use {@link GuildMemberManager#me} instead. - * @readonly - */ - get me() { - if (!deprecationEmittedForMe) { - process.emitWarning( - 'Guild#me is deprecated. Use Guild#members#me instead.', - 'DeprecationWarning', - ); - deprecationEmittedForMe = true; - } - - return this.members.me; - } - - /** - * The maximum bitrate available for this guild - * @type {number} - * @readonly - */ - get maximumBitrate() { - if (this.features.includes('VIP_REGIONS')) { - return 384_000; - } - - switch (PremiumTiers[this.premiumTier]) { - case PremiumTiers.TIER_1: - return 128_000; - case PremiumTiers.TIER_2: - return 256_000; - case PremiumTiers.TIER_3: - return 384_000; - default: - return 96_000; - } - } - - /** - * Fetches a collection of integrations to this guild. - * Resolves with a collection mapping integrations by their ids. - * @returns {Promise>} - * @example - * // Fetch integrations - * guild.fetchIntegrations() - * .then(integrations => console.log(`Fetched ${integrations.size} integrations`)) - * .catch(console.error); - */ - async fetchIntegrations() { - const data = await this.client.api.guilds(this.id).integrations.get(); - return data.reduce( - (collection, integration) => - collection.set( - integration.id, - new Integration(this.client, integration, this), - ), - new Collection(), - ); - } - - /** - * Fetches a collection of templates from this guild. - * Resolves with a collection mapping templates by their codes. - * @returns {Promise>} - */ - async fetchTemplates() { - const templates = await this.client.api.guilds(this.id).templates.get(); - return templates.reduce( - (col, data) => col.set(data.code, new GuildTemplate(this.client, data)), - new Collection(), - ); - } - - /** - * Fetches the welcome screen for this guild. - * @returns {Promise} - */ - async fetchWelcomeScreen() { - const data = await this.client.api.guilds(this.id, 'welcome-screen').get(); - return new WelcomeScreen(this, data); - } - - /** - * Creates a template for the guild. - * @param {string} name The name for the template - * @param {string} [description] The description for the template - * @returns {Promise} - */ - async createTemplate(name, description) { - const data = await this.client.api - .guilds(this.id) - .templates.post({ data: { name, description } }); - return new GuildTemplate(this.client, data); - } - - /** - * Obtains a guild preview for this guild from Discord. - * @returns {Promise} - */ - async fetchPreview() { - const data = await this.client.api.guilds(this.id).preview.get(); - return new GuildPreview(this.client, data); - } - - /** - * An object containing information about a guild's vanity invite. - * @typedef {Object} Vanity - * @property {?string} code Vanity invite code - * @property {number} uses How many times this invite has been used - */ - - /** - * Fetches the vanity URL invite object to this guild. - * Resolves with an object containing the vanity URL invite code and the use count - * @returns {Promise} - * @example - * // Fetch invite data - * guild.fetchVanityData() - * .then(res => { - * console.log(`Vanity URL: https://discord.gg/${res.code} with ${res.uses} uses`); - * }) - * .catch(console.error); - */ - async fetchVanityData() { - const data = await this.client.api.guilds(this.id, 'vanity-url').get(); - this.vanityURLCode = data.code; - this.vanityURLUses = data.uses; - - return data; - } - - /** - * Fetches all webhooks for the guild. - * @returns {Promise>} - * @example - * // Fetch webhooks - * guild.fetchWebhooks() - * .then(webhooks => console.log(`Fetched ${webhooks.size} webhooks`)) - * .catch(console.error); - */ - async fetchWebhooks() { - const apiHooks = await this.client.api.guilds(this.id).webhooks.get(); - const hooks = new Collection(); - for (const hook of apiHooks) - hooks.set(hook.id, new Webhook(this.client, hook)); - return hooks; - } - - /** - * Fetches the guild widget data, requires the widget to be enabled. - * @returns {Promise} - * @example - * // Fetches the guild widget data - * guild.fetchWidget() - * .then(widget => console.log(`The widget shows ${widget.channels.size} channels`)) - * .catch(console.error); - */ - fetchWidget() { - return this.client.fetchGuildWidget(this.id); - } - - /** - * Data for the Guild Widget Settings object - * @typedef {Object} GuildWidgetSettings - * @property {boolean} enabled Whether the widget is enabled - * @property {?GuildChannel} channel The widget invite channel - */ - - /** - * The Guild Widget Settings object - * @typedef {Object} GuildWidgetSettingsData - * @property {boolean} enabled Whether the widget is enabled - * @property {?GuildChannelResolvable} channel The widget invite channel - */ - - /** - * Fetches the guild widget settings. - * @returns {Promise} - * @example - * // Fetches the guild widget settings - * guild.fetchWidgetSettings() - * .then(widget => console.log(`The widget is ${widget.enabled ? 'enabled' : 'disabled'}`)) - * .catch(console.error); - */ - async fetchWidgetSettings() { - const data = await this.client.api.guilds(this.id).widget.get(); - this.widgetEnabled = data.enabled; - this.widgetChannelId = data.channel_id; - return { - enabled: data.enabled, - channel: data.channel_id - ? this.channels.cache.get(data.channel_id) - : null, - }; - } - - /** - * Options used to fetch audit logs. - * @typedef {Object} GuildAuditLogsFetchOptions - * @property {Snowflake|GuildAuditLogsEntry} [before] Consider only entries before this entry - * @property {Snowflake|GuildAuditLogsEntry} [after] Consider only entries after this entry - * @property {number} [limit] The number of entries to return - * @property {UserResolvable} [user] Only return entries for actions made by this user - * @property {AuditLogAction|number} [type] Only return entries for this action type - */ - - /** - * Fetches audit logs for this guild. - * @param {GuildAuditLogsFetchOptions} [options={}] Options for fetching audit logs - * @returns {Promise} - * @example - * // Output audit log entries - * guild.fetchAuditLogs() - * .then(audit => console.log(audit.entries.first())) - * .catch(console.error); - */ - async fetchAuditLogs({ before, after, limit, user, type } = {}) { - const data = await this.client.api.guilds(this.id)['audit-logs'].get({ - query: { - before: before?.id ?? before, - after: after?.id ?? after, - limit, - user_id: this.client.users.resolveId(user), - action_type: - typeof type === 'string' ? GuildAuditLogs.Actions[type] : type, - }, - }); - - return GuildAuditLogs.build(this, data); - } - - /** - * The data for editing a guild. - * @typedef {Object} GuildEditData - * @property {string} [name] The name of the guild - * @property {?(VerificationLevel|number)} [verificationLevel] The verification level of the guild - * @property {?(ExplicitContentFilterLevel|number)} [explicitContentFilter] The level of the explicit content filter - * @property {?VoiceChannelResolvable} [afkChannel] The AFK channel of the guild - * @property {?TextChannelResolvable} [systemChannel] The system channel of the guild - * @property {number} [afkTimeout] The AFK timeout of the guild - * @property {?(BufferResolvable|Base64Resolvable)} [icon] The icon of the guild - * @property {GuildMemberResolvable} [owner] The owner of the guild - * @property {?(BufferResolvable|Base64Resolvable)} [splash] The invite splash image of the guild - * @property {?(BufferResolvable|Base64Resolvable)} [discoverySplash] The discovery splash image of the guild - * @property {?(BufferResolvable|Base64Resolvable)} [banner] The banner of the guild - * @property {?(DefaultMessageNotificationLevel|number)} [defaultMessageNotifications] The default message - * notification level of the guild - * @property {SystemChannelFlagsResolvable} [systemChannelFlags] The system channel flags of the guild - * @property {?TextChannelResolvable} [rulesChannel] The rules channel of the guild - * @property {?TextChannelResolvable} [publicUpdatesChannel] The community updates channel of the guild - * @property {?string} [preferredLocale] The preferred locale of the guild - * @property {?TextChannelResolvable} [safetyAlertsChannel] The safety alerts channel of the guild - * @property {boolean} [premiumProgressBarEnabled] Whether the guild's premium progress bar is enabled - * @property {?string} [description] The discovery description of the guild - * @property {Features[]} [features] The features of the guild - */ - - /** - * Data that can be resolved to a Text Channel object. This can be: - * * A TextChannel - * * A Snowflake - * @typedef {TextChannel|Snowflake} TextChannelResolvable - */ - - /** - * Data that can be resolved to a Voice Channel object. This can be: - * * A VoiceChannel - * * A Snowflake - * @typedef {VoiceChannel|Snowflake} VoiceChannelResolvable - */ - - /** - * Updates the guild with new information - e.g. a new name. - * @param {GuildEditData} data The data to update the guild with - * @param {string} [reason] Reason for editing this guild - * @returns {Promise} - * @example - * // Set the guild name - * guild.edit({ - * name: 'Discord Guild', - * }) - * .then(updated => console.log(`New guild name ${updated}`)) - * .catch(console.error); - */ - async edit(data, reason) { - const _data = {}; - if (data.name) _data.name = data.name; - if (typeof data.verificationLevel !== 'undefined') { - _data.verification_level = - typeof data.verificationLevel === 'number' - ? data.verificationLevel - : VerificationLevels[data.verificationLevel]; - } - if (typeof data.afkChannel !== 'undefined') { - _data.afk_channel_id = this.client.channels.resolveId(data.afkChannel); - } - if (typeof data.systemChannel !== 'undefined') { - _data.system_channel_id = this.client.channels.resolveId( - data.systemChannel, - ); - } - if (data.afkTimeout) _data.afk_timeout = Number(data.afkTimeout); - if (typeof data.icon !== 'undefined') - _data.icon = await DataResolver.resolveImage(data.icon); - if (data.owner) _data.owner_id = this.client.users.resolveId(data.owner); - if (typeof data.splash !== 'undefined') - _data.splash = await DataResolver.resolveImage(data.splash); - if (typeof data.discoverySplash !== 'undefined') { - _data.discovery_splash = await DataResolver.resolveImage( - data.discoverySplash, - ); - } - if (typeof data.banner !== 'undefined') - _data.banner = await DataResolver.resolveImage(data.banner); - if (typeof data.explicitContentFilter !== 'undefined') { - _data.explicit_content_filter = - typeof data.explicitContentFilter === 'number' - ? data.explicitContentFilter - : ExplicitContentFilterLevels[data.explicitContentFilter]; - } - if (typeof data.defaultMessageNotifications !== 'undefined') { - _data.default_message_notifications = - typeof data.defaultMessageNotifications === 'number' - ? data.defaultMessageNotifications - : DefaultMessageNotificationLevels[data.defaultMessageNotifications]; - } - if (typeof data.systemChannelFlags !== 'undefined') { - _data.system_channel_flags = SystemChannelFlags.resolve( - data.systemChannelFlags, - ); - } - if (typeof data.rulesChannel !== 'undefined') { - _data.rules_channel_id = this.client.channels.resolveId( - data.rulesChannel, - ); - } - if (typeof data.publicUpdatesChannel !== 'undefined') { - _data.public_updates_channel_id = this.client.channels.resolveId( - data.publicUpdatesChannel, - ); - } - if (typeof data.features !== 'undefined') { - _data.features = data.features; - } - if (typeof data.description !== 'undefined') { - _data.description = data.description; - } - if (typeof data.preferredLocale !== 'undefined') - _data.preferred_locale = data.preferredLocale; - if (typeof data.safetyAlertsChannel !== 'undefined') { - _data.safety_alerts_channel_id = this.client.channels.resolveId( - data.safetyAlertsChannel, - ); - } - if ('premiumProgressBarEnabled' in data) - _data.premium_progress_bar_enabled = data.premiumProgressBarEnabled; - const newData = await this.client.api - .guilds(this.id) - .patch({ data: _data, reason }); - return this.client.actions.GuildUpdate.handle(newData).updated; - } - - /** - * Welcome channel data - * @typedef {Object} WelcomeChannelData - * @property {string} description The description to show for this welcome channel - * @property {TextChannel|NewsChannel|StoreChannel|Snowflake} channel The channel to link for this welcome channel - * @property {EmojiIdentifierResolvable} [emoji] The emoji to display for this welcome channel - */ - - /** - * Welcome screen edit data - * @typedef {Object} WelcomeScreenEditData - * @property {boolean} [enabled] Whether the welcome screen is enabled - * @property {string} [description] The description for the welcome screen - * @property {WelcomeChannelData[]} [welcomeChannels] The welcome channel data for the welcome screen - */ - - /** - * Data that can be resolved to a GuildTextChannel object. This can be: - * * A TextChannel - * * A NewsChannel - * * A Snowflake - * @typedef {TextChannel|NewsChannel|Snowflake} GuildTextChannelResolvable - */ - - /** - * Data that can be resolved to a GuildVoiceChannel object. This can be: - * * A VoiceChannel - * * A StageChannel - * * A Snowflake - * @typedef {VoiceChannel|StageChannel|Snowflake} GuildVoiceChannelResolvable - */ - - /** - * Updates the guild's welcome screen - * @param {WelcomeScreenEditData} data Data to edit the welcome screen with - * @returns {Promise} - * @example - * guild.editWelcomeScreen({ - * description: 'Hello World', - * enabled: true, - * welcomeChannels: [ - * { - * description: 'foobar', - * channel: '222197033908436994', - * } - * ], - * }) - */ - async editWelcomeScreen(data) { - const { enabled, description, welcomeChannels } = data; - const welcome_channels = welcomeChannels?.map((welcomeChannelData) => { - const emoji = this.emojis.resolve(welcomeChannelData.emoji); - return { - emoji_id: emoji?.id, - emoji_name: emoji?.name ?? welcomeChannelData.emoji, - channel_id: this.channels.resolveId(welcomeChannelData.channel), - description: welcomeChannelData.description, - }; - }); - - const patchData = await this.client.api - .guilds(this.id, 'welcome-screen') - .patch({ - data: { - welcome_channels, - description, - enabled, - }, - }); - return new WelcomeScreen(this, patchData); - } - - /** - * Edits the level of the explicit content filter. - * @param {?(ExplicitContentFilterLevel|number)} explicitContentFilter The new level of the explicit content filter - * @param {string} [reason] Reason for changing the level of the guild's explicit content filter - * @returns {Promise} - */ - setExplicitContentFilter(explicitContentFilter, reason) { - return this.edit({ explicitContentFilter }, reason); - } - - /* eslint-disable max-len */ - /** - * Edits the setting of the default message notifications of the guild. - * @param {?(DefaultMessageNotificationLevel|number)} defaultMessageNotifications The new default message notification level of the guild - * @param {string} [reason] Reason for changing the setting of the default message notifications - * @returns {Promise} - */ - setDefaultMessageNotifications(defaultMessageNotifications, reason) { - return this.edit({ defaultMessageNotifications }, reason); - } - /* eslint-enable max-len */ - - /** - * Edits the flags of the default message notifications of the guild. - * @param {SystemChannelFlagsResolvable} systemChannelFlags The new flags for the default message notifications - * @param {string} [reason] Reason for changing the flags of the default message notifications - * @returns {Promise} - */ - setSystemChannelFlags(systemChannelFlags, reason) { - return this.edit({ systemChannelFlags }, reason); - } - - /** - * Edits the name of the guild. - * @param {string} name The new name of the guild - * @param {string} [reason] Reason for changing the guild's name - * @returns {Promise} - * @example - * // Edit the guild name - * guild.setName('Discord Guild') - * .then(updated => console.log(`Updated guild name to ${updated.name}`)) - * .catch(console.error); - */ - setName(name, reason) { - return this.edit({ name }, reason); - } - - /** - * Edits the verification level of the guild. - * @param {?(VerificationLevel|number)} verificationLevel The new verification level of the guild - * @param {string} [reason] Reason for changing the guild's verification level - * @returns {Promise} - * @example - * // Edit the guild verification level - * guild.setVerificationLevel(1) - * .then(updated => console.log(`Updated guild verification level to ${guild.verificationLevel}`)) - * .catch(console.error); - */ - setVerificationLevel(verificationLevel, reason) { - return this.edit({ verificationLevel }, reason); - } - - /** - * Edits the AFK channel of the guild. - * @param {?VoiceChannelResolvable} afkChannel The new AFK channel - * @param {string} [reason] Reason for changing the guild's AFK channel - * @returns {Promise} - * @example - * // Edit the guild AFK channel - * guild.setAFKChannel(channel) - * .then(updated => console.log(`Updated guild AFK channel to ${guild.afkChannel.name}`)) - * .catch(console.error); - */ - setAFKChannel(afkChannel, reason) { - return this.edit({ afkChannel }, reason); - } - - /** - * Edits the system channel of the guild. - * @param {?TextChannelResolvable} systemChannel The new system channel - * @param {string} [reason] Reason for changing the guild's system channel - * @returns {Promise} - * @example - * // Edit the guild system channel - * guild.setSystemChannel(channel) - * .then(updated => console.log(`Updated guild system channel to ${guild.systemChannel.name}`)) - * .catch(console.error); - */ - setSystemChannel(systemChannel, reason) { - return this.edit({ systemChannel }, reason); - } - - /** - * Edits the AFK timeout of the guild. - * @param {number} afkTimeout The time in seconds that a user must be idle to be considered AFK - * @param {string} [reason] Reason for changing the guild's AFK timeout - * @returns {Promise} - * @example - * // Edit the guild AFK channel - * guild.setAFKTimeout(60) - * .then(updated => console.log(`Updated guild AFK timeout to ${guild.afkTimeout}`)) - * .catch(console.error); - */ - setAFKTimeout(afkTimeout, reason) { - return this.edit({ afkTimeout }, reason); - } - - /** - * Sets a new guild icon. - * @param {?(Base64Resolvable|BufferResolvable)} icon The new icon of the guild - * @param {string} [reason] Reason for changing the guild's icon - * @returns {Promise} - * @example - * // Edit the guild icon - * guild.setIcon('./icon.png') - * .then(updated => console.log('Updated the guild icon')) - * .catch(console.error); - */ - setIcon(icon, reason) { - return this.edit({ icon }, reason); - } - - /** - * Sets a new owner of the guild. - * @param {GuildMemberResolvable} owner The new owner of the guild - * @param {string} [reason] Reason for setting the new owner - * @returns {Promise} - * @example - * // Edit the guild owner - * guild.setOwner(guild.members.cache.first()) - * .then(guild => guild.fetchOwner()) - * .then(owner => console.log(`Updated the guild owner to ${owner.displayName}`)) - * .catch(console.error); - */ - setOwner(owner, reason) { - return this.edit({ owner }, reason); - } - - /** - * Sets a new guild invite splash image. - * @param {?(Base64Resolvable|BufferResolvable)} splash The new invite splash image of the guild - * @param {string} [reason] Reason for changing the guild's invite splash image - * @returns {Promise} - * @example - * // Edit the guild splash - * guild.setSplash('./splash.png') - * .then(updated => console.log('Updated the guild splash')) - * .catch(console.error); - */ - setSplash(splash, reason) { - return this.edit({ splash }, reason); - } - - /** - * Sets a new guild discovery splash image. - * @param {?(Base64Resolvable|BufferResolvable)} discoverySplash The new discovery splash image of the guild - * @param {string} [reason] Reason for changing the guild's discovery splash image - * @returns {Promise} - * @example - * // Edit the guild discovery splash - * guild.setDiscoverySplash('./discoverysplash.png') - * .then(updated => console.log('Updated the guild discovery splash')) - * .catch(console.error); - */ - setDiscoverySplash(discoverySplash, reason) { - return this.edit({ discoverySplash }, reason); - } - - /** - * Sets a new guild banner. - * @param {?(Base64Resolvable|BufferResolvable)} banner The new banner of the guild - * @param {string} [reason] Reason for changing the guild's banner - * @returns {Promise} - * @example - * guild.setBanner('./banner.png') - * .then(updated => console.log('Updated the guild banner')) - * .catch(console.error); - */ - setBanner(banner, reason) { - return this.edit({ banner }, reason); - } - - /** - * Edits the rules channel of the guild. - * @param {?TextChannelResolvable} rulesChannel The new rules channel - * @param {string} [reason] Reason for changing the guild's rules channel - * @returns {Promise} - * @example - * // Edit the guild rules channel - * guild.setRulesChannel(channel) - * .then(updated => console.log(`Updated guild rules channel to ${guild.rulesChannel.name}`)) - * .catch(console.error); - */ - setRulesChannel(rulesChannel, reason) { - return this.edit({ rulesChannel }, reason); - } - - /** - * Edits the community updates channel of the guild. - * @param {?TextChannelResolvable} publicUpdatesChannel The new community updates channel - * @param {string} [reason] Reason for changing the guild's community updates channel - * @returns {Promise} - * @example - * // Edit the guild community updates channel - * guild.setPublicUpdatesChannel(channel) - * .then(updated => console.log(`Updated guild community updates channel to ${guild.publicUpdatesChannel.name}`)) - * .catch(console.error); - */ - setPublicUpdatesChannel(publicUpdatesChannel, reason) { - return this.edit({ publicUpdatesChannel }, reason); - } - - /** - * Edits the preferred locale of the guild. - * @param {?string} preferredLocale The new preferred locale of the guild - * @param {string} [reason] Reason for changing the guild's preferred locale - * @returns {Promise} - * @example - * // Edit the guild preferred locale - * guild.setPreferredLocale('en-US') - * .then(updated => console.log(`Updated guild preferred locale to ${guild.preferredLocale}`)) - * .catch(console.error); - */ - setPreferredLocale(preferredLocale, reason) { - return this.edit({ preferredLocale }, reason); - } - - /** - * Edits the safety alerts channel of the guild. - * @param {?TextChannelResolvable} safetyAlertsChannel The new safety alerts channel - * @param {string} [reason] Reason for changing the guild's safety alerts channel - * @returns {Promise} - * @example - * // Edit the guild safety alerts channel - * guild.setSafetyAlertsChannel(channel) - * .then(updated => console.log(`Updated guild safety alerts channel to ${updated.safetyAlertsChannel.name}`)) - * .catch(console.error); - */ - setSafetyAlertsChannel(safetyAlertsChannel, reason) { - return this.edit({ safetyAlertsChannel }, reason); - } - - /** - * Edits the enabled state of the guild's premium progress bar - * @param {boolean} [enabled=true] The new enabled state of the guild's premium progress bar - * @param {string} [reason] Reason for changing the state of the guild's premium progress bar - * @returns {Promise} - */ - setPremiumProgressBarEnabled(enabled = true, reason) { - return this.edit({ premiumProgressBarEnabled: enabled }, reason); - } - - /** - * Data that can be resolved to give a Category Channel object. This can be: - * * A CategoryChannel object - * * A Snowflake - * @typedef {CategoryChannel|Snowflake} CategoryChannelResolvable - */ - - /** - * The data needed for updating a channel's position. - * @typedef {Object} ChannelPosition - * @property {GuildChannel|Snowflake} channel Channel to update - * @property {number} [position] New position for the channel - * @property {CategoryChannelResolvable} [parent] Parent channel for this channel - * @property {boolean} [lockPermissions] If the overwrites should be locked to the parents overwrites - */ - - /** - * Batch-updates the guild's channels' positions. - * Only one channel's parent can be changed at a time - * @param {ChannelPosition[]} channelPositions Channel positions to update - * @returns {Promise} - * @deprecated Use {@link GuildChannelManager#setPositions} instead - * @example - * guild.setChannelPositions([{ channel: channelId, position: newChannelIndex }]) - * .then(guild => console.log(`Updated channel positions for ${guild}`)) - * .catch(console.error); - */ - setChannelPositions(channelPositions) { - if (!deprecationEmittedForSetChannelPositions) { - process.emitWarning( - 'The Guild#setChannelPositions method is deprecated. Use GuildChannelManager#setPositions instead.', - 'DeprecationWarning', - ); - - deprecationEmittedForSetChannelPositions = true; - } - - return this.channels.setPositions(channelPositions); - } - - /** - * The data needed for updating a guild role's position - * @typedef {Object} GuildRolePosition - * @property {RoleResolvable} role The role's id - * @property {number} position The position to update - */ - - /** - * Batch-updates the guild's role positions - * @param {GuildRolePosition[]} rolePositions Role positions to update - * @returns {Promise} - * @deprecated Use {@link RoleManager#setPositions} instead - * @example - * guild.setRolePositions([{ role: roleId, position: updatedRoleIndex }]) - * .then(guild => console.log(`Role positions updated for ${guild}`)) - * .catch(console.error); - */ - setRolePositions(rolePositions) { - if (!deprecationEmittedForSetRolePositions) { - process.emitWarning( - 'The Guild#setRolePositions method is deprecated. Use RoleManager#setPositions instead.', - 'DeprecationWarning', - ); - - deprecationEmittedForSetRolePositions = true; - } - - return this.roles.setPositions(rolePositions); - } - - /** - * Edits the guild's widget settings. - * @param {GuildWidgetSettingsData} settings The widget settings for the guild - * @param {string} [reason] Reason for changing the guild's widget settings - * @returns {Promise} - */ - async setWidgetSettings(settings, reason) { - await this.client.api.guilds(this.id).widget.patch({ - data: { - enabled: settings.enabled, - channel_id: this.channels.resolveId(settings.channel), - }, - reason, - }); - return this; - } - - /** - * Sets whether this guild's invites are disabled. - * @param {boolean} [disabled=true] Whether the invites are disabled - * @returns {Promise} - */ - disableInvites(disabled = true) { - const features = this.features.filter( - (feature) => feature !== 'INVITES_DISABLED', - ); - if (disabled) features.push('INVITES_DISABLED'); - return this.edit({ features }); - } - - /** - * Sets the incident actions for a guild. - * @param {IncidentActionsEditOptions} incidentActions The incident actions to set - * @returns {Promise} - */ - setIncidentActions(incidentActions) { - return this.client.guilds.setIncidentActions(this.id, incidentActions); - } - - /** - * Leaves the guild. - * @returns {Promise} - * @example - * // Leave a guild - * guild.leave() - * .then(guild => console.log(`Left the guild: ${guild.name}`)) - * .catch(console.error); - */ - async leave() { - if (this.ownerId === this.client.user.id) throw new Error('GUILD_OWNED'); - await this.client.api.users('@me').guilds(this.id).delete(); - return this.client.actions.GuildDelete.handle({ id: this.id }).guild; - } - - /** - * Deletes the guild. - * @returns {Promise} - * @example - * // Delete a guild - * guild.delete() - * .then(g => console.log(`Deleted the guild ${g}`)) - * .catch(console.error); - */ - async delete() { - await this.client.api.guilds(this.id).delete(); - return this.client.actions.GuildDelete.handle({ id: this.id }).guild; - } - - /** - * Whether this guild equals another guild. It compares all properties, so for most operations - * it is advisable to just compare `guild.id === guild2.id` as it is much faster and is often - * what most users need. - * @param {Guild} guild The guild to compare with - * @returns {boolean} - */ - equals(guild) { - return ( - guild && - guild instanceof this.constructor && - this.id === guild.id && - this.available === guild.available && - this.splash === guild.splash && - this.discoverySplash === guild.discoverySplash && - this.name === guild.name && - this.memberCount === guild.memberCount && - this.large === guild.large && - this.icon === guild.icon && - this.ownerId === guild.ownerId && - this.verificationLevel === guild.verificationLevel && - (this.features === guild.features || - (this.features.length === guild.features.length && - this.features.every((feat, i) => feat === guild.features[i]))) - ); - } - - toJSON() { - const json = super.toJSON({ - available: false, - createdTimestamp: true, - nameAcronym: true, - presences: false, - voiceStates: false, - }); - json.iconURL = this.iconURL(); - json.splashURL = this.splashURL(); - json.discoverySplashURL = this.discoverySplashURL(); - json.bannerURL = this.bannerURL(); - return json; - } - - /** - * Marks the guild as read. - * @returns {Promise} - * @example - * const guild = client.guilds.cache.get('id'); - * guild.markAsRead(); - */ - markAsRead() { - return this.client.api.guilds(this.id).ack.post(); - } - - /** - * Set Community Feature. - * @param {boolean} stats True / False to enable / disable Community Feature - * @param {GuildTextChannelResolvable} [publicUpdatesChannel] The community updates channel of the guild - * @param {GuildTextChannelResolvable} [rulesChannel] The new rules channel - * @param {string} [reason] Reason for changing the community feature - * @returns {Promise} - */ - async setCommunity(stats = true, publicUpdatesChannel, rulesChannel, reason) { - if (stats) { - // Check everyone role - const everyoneRole = this.roles.everyone; - if (everyoneRole.mentionable) { - await everyoneRole.setMentionable(false, reason); - } - // Setting - return this.edit( - { - defaultMessageNotifications: 'ONLY_MENTIONS', - explicitContentFilter: 'ALL_MEMBERS', - features: [...this.features, 'COMMUNITY'], - publicUpdatesChannel: - this.channels.resolveId(publicUpdatesChannel) || '1', - rulesChannel: this.channels.resolveId(rulesChannel) || '1', - verificationLevel: - VerificationLevels[this.verificationLevel] < 1 - ? 'LOW' - : this.verificationLevel, // Email - }, - reason, - ); - } else { - return this.edit( - { - publicUpdatesChannel: null, - rulesChannel: null, - features: this.features.filter((f) => f !== 'COMMUNITY'), - preferredLocale: this.preferredLocale, - description: this.description, - }, - reason, - ); - } - } - - /** - * Get the top emojis of this guild. - * @returns {Promise>} - */ - topEmojis() { - return new Promise((resolve, reject) => { - this.client.api - .guilds(this.id) - ['top-emojis'].get() - .then((data) => { - const emojis = new Collection(); - for (const emoji of data.items) { - emojis.set(emoji.emoji_rank, this.emojis.cache.get(emoji.emoji_id)); - } - resolve(emojis); - }) - .catch(reject); - }); - } - - /** - * Set the vanity URL to this guild. - * Resolves with an object containing the vanity URL invite code and the use count. - * @param {string} [code=''] Vanity URL code - * @returns {Promise} - * @example - * // Set invite code - * guild.setVanityCode('elysia', '123456') - * .then(res => { - * console.log(`Vanity URL: https://discord.gg/${res.code} with ${res.uses} uses`); - * }) - * .catch(console.error); - */ - async setVanityCode(code = '') { - if (typeof code !== 'string') - throw new TypeError('INVALID_VANITY_URL_CODE'); - const data = await this.client.api.guilds(this.id, 'vanity-url').patch({ - data: { code }, - }); - this.vanityURLCode = data.code; - this.vanityURLUses = data.uses; - - return data; - } - - /** - * The voice state adapter for this guild that can be used with @discordjs/voice to play audio in voice - * and stage channels. - * @type {Function} - * @readonly - */ - get voiceAdapterCreator() { - return (methods) => { - this.client.voice.adapters.set(this.id, methods); - return { - sendPayload: (data) => { - if (this.shard.status !== Status.READY) return false; - this.shard.send(data); - return true; - }, - destroy: () => { - this.client.voice.adapters.delete(this.id); - }, - }; - }; - } - - /** - * Creates a collection of this guild's roles, sorted by their position and ids. - * @returns {Collection} - * @private - */ - _sortedRoles() { - return Util.discordSort(this.roles.cache); - } - - /** - * Creates a collection of this guild's or a specific category's channels, sorted by their position and ids. - * @param {GuildChannel} [channel] Category to get the channels of - * @returns {Collection} - * @private - */ - _sortedChannels(channel) { - const category = channel.type === ChannelTypes.GUILD_CATEGORY; - return Util.discordSort( - this.channels.cache.filter( - (c) => - (['GUILD_TEXT', 'GUILD_NEWS', 'GUILD_STORE'].includes(channel.type) - ? ['GUILD_TEXT', 'GUILD_NEWS', 'GUILD_STORE'].includes(c.type) - : c.type === channel.type) && - (category || c.parent === channel.parent), - ), - ); - } -} - -exports.Guild = Guild; -exports.deletedGuilds = deletedGuilds; - -/** - * @external APIGuild - * @see {@link https://discord.com/developers/docs/resources/guild#guild-object} - */ diff --git a/vendor/discord.js-selfbot-v13/src/structures/GuildAuditLogs.js b/vendor/discord.js-selfbot-v13/src/structures/GuildAuditLogs.js deleted file mode 100644 index 8439a06..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/GuildAuditLogs.js +++ /dev/null @@ -1,784 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const ApplicationCommand = require('./ApplicationCommand'); -const AutoModerationRule = require('./AutoModerationRule'); -const { GuildScheduledEvent } = require('./GuildScheduledEvent'); -const Integration = require('./Integration'); -const Invite = require('./Invite'); -const { StageInstance } = require('./StageInstance'); -const { Sticker } = require('./Sticker'); -const Webhook = require('./Webhook'); -const { - OverwriteTypes, - PartialTypes, - AutoModerationRuleTriggerTypes, -} = require('../util/Constants'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); -const Util = require('../util/Util'); - -/** - * The target type of an entry. Here are the available types: - * * GUILD - * * CHANNEL - * * USER - * * ROLE - * * INVITE - * * WEBHOOK - * * EMOJI - * * MESSAGE - * * INTEGRATION - * * STAGE_INSTANCE - * * STICKER - * * THREAD - * * GUILD_SCHEDULED_EVENT - * * APPLICATION_COMMAND - * * AUTO_MODERATION - * @typedef {string} AuditLogTargetType - */ - -/** - * Key mirror of all available audit log targets. - * @name GuildAuditLogs.Targets - * @type {Object} - */ -const Targets = { - ALL: 'ALL', - GUILD: 'GUILD', - GUILD_SCHEDULED_EVENT: 'GUILD_SCHEDULED_EVENT', - CHANNEL: 'CHANNEL', - USER: 'USER', - ROLE: 'ROLE', - INVITE: 'INVITE', - WEBHOOK: 'WEBHOOK', - EMOJI: 'EMOJI', - MESSAGE: 'MESSAGE', - INTEGRATION: 'INTEGRATION', - STAGE_INSTANCE: 'STAGE_INSTANCE', - STICKER: 'STICKER', - THREAD: 'THREAD', - APPLICATION_COMMAND: 'APPLICATION_COMMAND', - AUTO_MODERATION: 'AUTO_MODERATION', - SOUNDBOARD_SOUND: 'SOUNDBOARD_SOUND', - GUILD_ONBOARDING_PROMPT: 'GUILD_ONBOARDING_PROMPT', - GUILD_ONBOARDING: 'GUILD_ONBOARDING', - UNKNOWN: 'UNKNOWN', -}; - -/** - * The action of an entry. Here are the available actions: - * * ALL: null - * * GUILD_UPDATE: 1 - * * CHANNEL_CREATE: 10 - * * CHANNEL_UPDATE: 11 - * * CHANNEL_DELETE: 12 - * * CHANNEL_OVERWRITE_CREATE: 13 - * * CHANNEL_OVERWRITE_UPDATE: 14 - * * CHANNEL_OVERWRITE_DELETE: 15 - * * MEMBER_KICK: 20 - * * MEMBER_PRUNE: 21 - * * MEMBER_BAN_ADD: 22 - * * MEMBER_BAN_REMOVE: 23 - * * MEMBER_UPDATE: 24 - * * MEMBER_ROLE_UPDATE: 25 - * * MEMBER_MOVE: 26 - * * MEMBER_DISCONNECT: 27 - * * BOT_ADD: 28, - * * ROLE_CREATE: 30 - * * ROLE_UPDATE: 31 - * * ROLE_DELETE: 32 - * * INVITE_CREATE: 40 - * * INVITE_UPDATE: 41 - * * INVITE_DELETE: 42 - * * WEBHOOK_CREATE: 50 - * * WEBHOOK_UPDATE: 51 - * * WEBHOOK_DELETE: 52 - * * EMOJI_CREATE: 60 - * * EMOJI_UPDATE: 61 - * * EMOJI_DELETE: 62 - * * MESSAGE_DELETE: 72 - * * MESSAGE_BULK_DELETE: 73 - * * MESSAGE_PIN: 74 - * * MESSAGE_UNPIN: 75 - * * INTEGRATION_CREATE: 80 - * * INTEGRATION_UPDATE: 81 - * * INTEGRATION_DELETE: 82 - * * STAGE_INSTANCE_CREATE: 83 - * * STAGE_INSTANCE_UPDATE: 84 - * * STAGE_INSTANCE_DELETE: 85 - * * STICKER_CREATE: 90 - * * STICKER_UPDATE: 91 - * * STICKER_DELETE: 92 - * * GUILD_SCHEDULED_EVENT_CREATE: 100 - * * GUILD_SCHEDULED_EVENT_UPDATE: 101 - * * GUILD_SCHEDULED_EVENT_DELETE: 102 - * * THREAD_CREATE: 110 - * * THREAD_UPDATE: 111 - * * THREAD_DELETE: 112 - * * APPLICATION_COMMAND_PERMISSION_UPDATE: 121 - * * AUTO_MODERATION_RULE_CREATE: 140 - * * AUTO_MODERATION_RULE_UPDATE: 141 - * * AUTO_MODERATION_RULE_DELETE: 142 - * * AUTO_MODERATION_BLOCK_MESSAGE: 143 - * * AUTO_MODERATION_FLAG_TO_CHANNEL: 144 - * * AUTO_MODERATION_USER_COMMUNICATION_DISABLED: 145 - * @typedef {?(number|string)} AuditLogAction - * @see {@link https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events} - */ - -/** - * All available actions keyed under their names to their numeric values. - * @name GuildAuditLogs.Actions - * @type {Object} - */ -const Actions = { - ALL: null, - GUILD_UPDATE: 1, - CHANNEL_CREATE: 10, - CHANNEL_UPDATE: 11, - CHANNEL_DELETE: 12, - CHANNEL_OVERWRITE_CREATE: 13, - CHANNEL_OVERWRITE_UPDATE: 14, - CHANNEL_OVERWRITE_DELETE: 15, - MEMBER_KICK: 20, - MEMBER_PRUNE: 21, - MEMBER_BAN_ADD: 22, - MEMBER_BAN_REMOVE: 23, - MEMBER_UPDATE: 24, - MEMBER_ROLE_UPDATE: 25, - MEMBER_MOVE: 26, - MEMBER_DISCONNECT: 27, - BOT_ADD: 28, - ROLE_CREATE: 30, - ROLE_UPDATE: 31, - ROLE_DELETE: 32, - INVITE_CREATE: 40, - INVITE_UPDATE: 41, - INVITE_DELETE: 42, - WEBHOOK_CREATE: 50, - WEBHOOK_UPDATE: 51, - WEBHOOK_DELETE: 52, - EMOJI_CREATE: 60, - EMOJI_UPDATE: 61, - EMOJI_DELETE: 62, - MESSAGE_DELETE: 72, - MESSAGE_BULK_DELETE: 73, - MESSAGE_PIN: 74, - MESSAGE_UNPIN: 75, - INTEGRATION_CREATE: 80, - INTEGRATION_UPDATE: 81, - INTEGRATION_DELETE: 82, - STAGE_INSTANCE_CREATE: 83, - STAGE_INSTANCE_UPDATE: 84, - STAGE_INSTANCE_DELETE: 85, - STICKER_CREATE: 90, - STICKER_UPDATE: 91, - STICKER_DELETE: 92, - GUILD_SCHEDULED_EVENT_CREATE: 100, - GUILD_SCHEDULED_EVENT_UPDATE: 101, - GUILD_SCHEDULED_EVENT_DELETE: 102, - THREAD_CREATE: 110, - THREAD_UPDATE: 111, - THREAD_DELETE: 112, - APPLICATION_COMMAND_PERMISSION_UPDATE: 121, - AUTO_MODERATION_RULE_CREATE: 140, - AUTO_MODERATION_RULE_UPDATE: 141, - AUTO_MODERATION_RULE_DELETE: 142, - AUTO_MODERATION_BLOCK_MESSAGE: 143, - AUTO_MODERATION_FLAG_TO_CHANNEL: 144, - AUTO_MODERATION_USER_COMMUNICATION_DISABLED: 145, -}; - -/** - * Audit logs entries are held in this class. - */ -class GuildAuditLogs { - constructor(guild, data) { - if (data.users) - for (const user of data.users) guild.client.users._add(user); - if (data.threads) - for (const thread of data.threads) - guild.client.channels._add(thread, guild); - /** - * Cached webhooks - * @type {Collection} - * @private - */ - this.webhooks = new Collection(); - if (data.webhooks) { - for (const hook of data.webhooks) { - this.webhooks.set(hook.id, new Webhook(guild.client, hook)); - } - } - - /** - * Cached integrations - * @type {Collection} - * @private - */ - this.integrations = new Collection(); - if (data.integrations) { - for (const integration of data.integrations) { - this.integrations.set( - integration.id, - new Integration(guild.client, integration, guild), - ); - } - } - - /** - * Cached application commands, includes application commands from other applications - * @type {Collection} - * @private - */ - this.applicationCommands = new Collection(); - if (data.application_commands) { - for (const command of data.application_commands) { - this.applicationCommands.set( - command.id, - new ApplicationCommand(guild.client, command, guild), - ); - } - } - /** - * Cached auto moderation rules. - * @type {Collection} - * @private - */ - this.autoModerationRules = data.auto_moderation_rules.reduce( - (autoModerationRules, autoModerationRule) => - autoModerationRules.set( - autoModerationRule.id, - guild.autoModerationRules._add(autoModerationRule), - ), - new Collection(), - ); - - /** - * The entries for this guild's audit logs - * @type {Collection} - */ - this.entries = new Collection(); - for (const item of data.audit_log_entries) { - const entry = new GuildAuditLogsEntry(guild, item, this); - this.entries.set(entry.id, entry); - } - } - - /** - * Handles possible promises for entry targets. - * @returns {Promise} - */ - static async build(...args) { - const logs = new GuildAuditLogs(...args); - await Promise.all(logs.entries.map((e) => e.target)); - return logs; - } - - /** - * The target of an entry. It can be one of: - * * A guild - * * A channel - * * A user - * * A role - * * An invite - * * A webhook - * * An emoji - * * A message - * * An integration - * * A stage instance - * * A sticker - * * A guild scheduled event - * * A thread - * * An application command - * * An auto moderation rule - * * An object with an id key if target was deleted - * * An object where the keys represent either the new value or the old value - * @typedef {?(Object|Guild|Channel|User|Role|Invite|Webhook|GuildEmoji|Message|Integration|StageInstance|Sticker| - * GuildScheduledEvent|ApplicationCommand|AutoModerationRule)} AuditLogEntryTarget - */ - - /** - * Finds the target type from the entry action. - * @param {AuditLogAction} target The action target - * @returns {AuditLogTargetType} - */ - static targetType(target) { - if (target < 10) return Targets.GUILD; - if (target < 20) return Targets.CHANNEL; - if (target < 30) return Targets.USER; - if (target < 40) return Targets.ROLE; - if (target < 50) return Targets.INVITE; - if (target < 60) return Targets.WEBHOOK; - if (target < 70) return Targets.EMOJI; - if (target < 80) return Targets.MESSAGE; - if (target < 83) return Targets.INTEGRATION; - if (target < 86) return Targets.STAGE_INSTANCE; - if (target < 100) return Targets.STICKER; - if (target < 110) return Targets.GUILD_SCHEDULED_EVENT; - if (target < 120) return Targets.THREAD; - if (target < 130) return Targets.APPLICATION_COMMAND; - if (target < 140) return Targets.SOUNDBOARD_SOUND; // !Todo - if (target < 143) return Targets.AUTO_MODERATION; - if (target < 146) return Targets.USER; - if (target >= 163 && target <= 165) return Targets.GUILD_ONBOARDING_PROMPT; // !Todo - if (target >= 160 && target < 170) return Targets.GUILD_ONBOARDING; // !Todo - return Targets.UNKNOWN; - } - - /** - * The action type of an entry, e.g. `CREATE`. Here are the available types: - * * CREATE - * * DELETE - * * UPDATE - * * ALL - * @typedef {string} AuditLogActionType - */ - - /** - * Finds the action type from the entry action. - * @param {AuditLogAction} action The action target - * @returns {AuditLogActionType} - */ - static actionType(action) { - if ( - [ - Actions.CHANNEL_CREATE, - Actions.CHANNEL_OVERWRITE_CREATE, - Actions.MEMBER_BAN_REMOVE, - Actions.BOT_ADD, - Actions.ROLE_CREATE, - Actions.INVITE_CREATE, - Actions.WEBHOOK_CREATE, - Actions.EMOJI_CREATE, - Actions.MESSAGE_PIN, - Actions.INTEGRATION_CREATE, - Actions.STAGE_INSTANCE_CREATE, - Actions.STICKER_CREATE, - Actions.GUILD_SCHEDULED_EVENT_CREATE, - Actions.THREAD_CREATE, - Actions.AUTO_MODERATION_RULE_CREATE, - Actions.AUTO_MODERATION_BLOCK_MESSAGE, - ].includes(action) - ) { - return 'CREATE'; - } - - if ( - [ - Actions.CHANNEL_DELETE, - Actions.CHANNEL_OVERWRITE_DELETE, - Actions.MEMBER_KICK, - Actions.MEMBER_PRUNE, - Actions.MEMBER_BAN_ADD, - Actions.MEMBER_DISCONNECT, - Actions.ROLE_DELETE, - Actions.INVITE_DELETE, - Actions.WEBHOOK_DELETE, - Actions.EMOJI_DELETE, - Actions.MESSAGE_DELETE, - Actions.MESSAGE_BULK_DELETE, - Actions.MESSAGE_UNPIN, - Actions.INTEGRATION_DELETE, - Actions.STAGE_INSTANCE_DELETE, - Actions.STICKER_DELETE, - Actions.GUILD_SCHEDULED_EVENT_DELETE, - Actions.THREAD_DELETE, - Actions.AUTO_MODERATION_RULE_DELETE, - ].includes(action) - ) { - return 'DELETE'; - } - - if ( - [ - Actions.GUILD_UPDATE, - Actions.CHANNEL_UPDATE, - Actions.CHANNEL_OVERWRITE_UPDATE, - Actions.MEMBER_UPDATE, - Actions.MEMBER_ROLE_UPDATE, - Actions.MEMBER_MOVE, - Actions.ROLE_UPDATE, - Actions.INVITE_UPDATE, - Actions.WEBHOOK_UPDATE, - Actions.EMOJI_UPDATE, - Actions.INTEGRATION_UPDATE, - Actions.STAGE_INSTANCE_UPDATE, - Actions.STICKER_UPDATE, - Actions.GUILD_SCHEDULED_EVENT_UPDATE, - Actions.THREAD_UPDATE, - Actions.APPLICATION_COMMAND_PERMISSION_UPDATE, - Actions.AUTO_MODERATION_RULE_UPDATE, - ].includes(action) - ) { - return 'UPDATE'; - } - - return 'ALL'; - } - - toJSON() { - return Util.flatten(this); - } -} - -/** - * Audit logs entry. - */ -class GuildAuditLogsEntry { - constructor(guild, data, logs) { - const targetType = GuildAuditLogs.targetType(data.action_type); - /** - * The target type of this entry - * @type {AuditLogTargetType} - */ - this.targetType = targetType; - - /** - * The action type of this entry - * @type {AuditLogActionType} - */ - this.actionType = GuildAuditLogs.actionType(data.action_type); - - /** - * Specific action type of this entry in its string presentation - * @type {AuditLogAction} - */ - this.action = Object.keys(Actions).find( - (k) => Actions[k] === data.action_type, - ); - - /** - * The reason of this entry - * @type {?string} - */ - this.reason = data.reason ?? null; - - /** - * The id of the user that executed this entry - * @type {?Snowflake} - */ - this.executorId = data.user_id; - - /** - * The user that executed this entry - * @type {?User} - */ - this.executor = data.user_id - ? guild.client.options.partials.includes(PartialTypes.USER) - ? guild.client.users._add({ id: data.user_id }) - : (guild.client.users.cache.get(data.user_id) ?? null) - : null; - - /** - * An entry in the audit log representing a specific change. - * @typedef {Object} AuditLogChange - * @property {string} key The property that was changed, e.g. `nick` for nickname changes - * @property {*} [old] The old value of the change, e.g. for nicknames, the old nickname - * @property {*} [new] The new value of the change, e.g. for nicknames, the new nickname - */ - - /** - * Specific property changes - * @type {AuditLogChange[]} - */ - this.changes = - data.changes?.map((change) => ({ - key: change.key, - ...('old_value' in change ? { old: change.old_value } : {}), - ...('new_value' in change ? { new: change.new_value } : {}), - })) ?? []; - - /** - * The entry's id - * @type {Snowflake} - */ - this.id = data.id; - - /** - * Any extra data from the entry - * @type {?(Object|Role|GuildMember)} - */ - this.extra = null; - switch (data.action_type) { - case Actions.MEMBER_PRUNE: - this.extra = { - removed: Number(data.options.members_removed), - days: Number(data.options.delete_member_days), - }; - break; - - case Actions.MEMBER_MOVE: - case Actions.MESSAGE_DELETE: - this.extra = { - channel: guild.channels.cache.get(data.options.channel_id) ?? { - id: data.options.channel_id, - }, - count: Number(data.options.count), - }; - break; - case Actions.MESSAGE_PIN: - case Actions.MESSAGE_UNPIN: - this.extra = { - channel: guild.client.channels.cache.get(data.options.channel_id) ?? { - id: data.options.channel_id, - }, - messageId: data.options.message_id, - }; - break; - - case Actions.MESSAGE_BULK_DELETE: - case Actions.MEMBER_DISCONNECT: - this.extra = { - count: Number(data.options.count), - }; - break; - - case Actions.CHANNEL_OVERWRITE_CREATE: - case Actions.CHANNEL_OVERWRITE_UPDATE: - case Actions.CHANNEL_OVERWRITE_DELETE: - switch (Number(data.options.type)) { - case OverwriteTypes.role: - this.extra = guild.roles.cache.get(data.options.id) ?? { - id: data.options.id, - name: data.options.role_name, - type: OverwriteTypes[OverwriteTypes.role], - }; - break; - - case OverwriteTypes.member: - this.extra = guild.members.cache.get(data.options.id) ?? { - id: data.options.id, - type: OverwriteTypes[OverwriteTypes.member], - }; - break; - - default: - break; - } - break; - - case Actions.STAGE_INSTANCE_CREATE: - case Actions.STAGE_INSTANCE_DELETE: - case Actions.STAGE_INSTANCE_UPDATE: - this.extra = { - channel: guild.client.channels.cache.get( - data.options?.channel_id, - ) ?? { id: data.options?.channel_id }, - }; - break; - case Actions.APPLICATION_COMMAND_PERMISSION_UPDATE: - this.extra = { - applicationId: data.options.application_id, - }; - break; - case Actions.AUTO_MODERATION_BLOCK_MESSAGE: - case Actions.AUTO_MODERATION_FLAG_TO_CHANNEL: - case Actions.AUTO_MODERATION_USER_COMMUNICATION_DISABLED: - this.extra = { - autoModerationRuleName: data.options.auto_moderation_rule_name, - autoModerationRuleTriggerType: - AutoModerationRuleTriggerTypes[ - data.options.auto_moderation_rule_trigger_type - ], - channel: guild.client.channels.cache.get( - data.options?.channel_id, - ) ?? { id: data.options?.channel_id }, - }; - break; - default: - break; - } - - /** - * The id of the target of this entry - * @type {?Snowflake} - */ - this.targetId = data.target_id; - - /** - * The target of this entry - * @type {?AuditLogEntryTarget} - */ - this.target = null; - if (targetType === Targets.UNKNOWN) { - this.target = this.changes.reduce((o, c) => { - o[c.key] = c.new ?? c.old; - return o; - }, {}); - this.target.id = data.target_id; - // MEMBER_DISCONNECT and similar types do not provide a target_id. - } else if (targetType === Targets.USER && data.target_id) { - this.target = guild.client.options.partials.includes(PartialTypes.USER) - ? guild.client.users._add({ id: data.target_id }) - : (guild.client.users.cache.get(data.target_id) ?? null); - } else if (targetType === Targets.GUILD) { - this.target = guild.client.guilds.cache.get(data.target_id); - } else if (targetType === Targets.WEBHOOK) { - this.target = - logs?.webhooks.get(data.target_id) ?? - new Webhook( - guild.client, - this.changes.reduce( - (o, c) => { - o[c.key] = c.new ?? c.old; - return o; - }, - { - id: data.target_id, - guild_id: guild.id, - }, - ), - ); - } else if (targetType === Targets.INVITE) { - let change = this.changes.find((c) => c.key === 'code'); - change = change.new ?? change.old; - - this.target = - guild.invites.cache.get(change) ?? - new Invite( - guild.client, - this.changes.reduce( - (o, c) => { - o[c.key] = c.new ?? c.old; - return o; - }, - { guild }, - ), - ); - } else if (targetType === Targets.MESSAGE) { - // Discord sends a channel id for the MESSAGE_BULK_DELETE action type. - this.target = - data.action_type === Actions.MESSAGE_BULK_DELETE - ? (guild.channels.cache.get(data.target_id) ?? { id: data.target_id }) - : (guild.client.users.cache.get(data.target_id) ?? null); - } else if (targetType === Targets.INTEGRATION) { - this.target = - logs?.integrations.get(data.target_id) ?? - new Integration( - guild.client, - this.changes.reduce( - (o, c) => { - o[c.key] = c.new ?? c.old; - return o; - }, - { id: data.target_id }, - ), - guild, - ); - } else if ( - targetType === Targets.CHANNEL || - targetType === Targets.THREAD - ) { - this.target = - guild.channels.cache.get(data.target_id) ?? - this.changes.reduce( - (o, c) => { - o[c.key] = c.new ?? c.old; - return o; - }, - { id: data.target_id }, - ); - } else if (targetType === Targets.STAGE_INSTANCE) { - this.target = - guild.stageInstances.cache.get(data.target_id) ?? - new StageInstance( - guild.client, - this.changes.reduce( - (o, c) => { - o[c.key] = c.new ?? c.old; - return o; - }, - { - id: data.target_id, - channel_id: data.options?.channel_id, - guild_id: guild.id, - }, - ), - ); - } else if (targetType === Targets.STICKER) { - this.target = - guild.stickers.cache.get(data.target_id) ?? - new Sticker( - guild.client, - this.changes.reduce( - (o, c) => { - o[c.key] = c.new ?? c.old; - return o; - }, - { id: data.target_id }, - ), - ); - } else if (targetType === Targets.GUILD_SCHEDULED_EVENT) { - this.target = - guild.scheduledEvents.cache.get(data.target_id) ?? - new GuildScheduledEvent( - guild.client, - this.changes.reduce( - (o, c) => { - o[c.key] = c.new ?? c.old; - return o; - }, - { id: data.target_id, guild_id: guild.id }, - ), - ); - } else if (targetType === Targets.APPLICATION_COMMAND) { - this.target = logs?.applicationCommands.get(data.target_id) ?? { - id: data.target_id, - }; - } else if (targetType === Targets.AUTO_MODERATION) { - this.target = - guild.autoModerationRules.cache.get(data.target_id) ?? - new AutoModerationRule( - guild.client, - this.changes.reduce( - (o, c) => { - o[c.key] = c.new ?? c.old; - return o; - }, - { id: data.target_id, guild_id: guild.id }, - ), - guild, - ); - } else if (targetType === Targets.ROLE) { - this.target = guild.roles.cache.get(data.target_id) ?? { - id: data.target_id, - }; - } else if (targetType === Targets.EMOJI) { - this.target = guild.emojis.cache.get(data.target_id) ?? { - id: data.target_id, - }; - } else if (data.target_id) { - // Missing SoundboardSound & Onboarding - this.target = { id: data.target_id }; - } - } - - /** - * The timestamp this entry was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return SnowflakeUtil.timestampFrom(this.id); - } - - /** - * The time this entry was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - toJSON() { - return Util.flatten(this, { createdTimestamp: true }); - } -} - -GuildAuditLogs.Actions = Actions; -GuildAuditLogs.Targets = Targets; -GuildAuditLogs.Entry = GuildAuditLogsEntry; - -module.exports = GuildAuditLogs; diff --git a/vendor/discord.js-selfbot-v13/src/structures/GuildBan.js b/vendor/discord.js-selfbot-v13/src/structures/GuildBan.js deleted file mode 100644 index 9c5a10e..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/GuildBan.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -const Base = require('./Base'); - -/** - * Represents a ban in a guild on Discord. - * @extends {Base} - */ -class GuildBan extends Base { - constructor(client, data, guild) { - super(client); - - /** - * The guild in which the ban is - * @type {Guild} - */ - this.guild = guild; - - this._patch(data); - } - - _patch(data) { - if ('user' in data) { - /** - * The user this ban applies to - * @type {User} - */ - this.user = this.client.users._add(data.user, true); - } - - if ('reason' in data) { - /** - * The reason for the ban - * @type {?string} - */ - this.reason = data.reason; - } - } - - /** - * Whether this GuildBan is partial. If the reason is not provided the value is null - * @type {boolean} - * @readonly - */ - get partial() { - return !('reason' in this); - } - - /** - * Fetches this GuildBan. - * @param {boolean} [force=true] Whether to skip the cache check and request the API - * @returns {Promise} - */ - fetch(force = true) { - return this.guild.bans.fetch({ user: this.user, cache: true, force }); - } -} - -module.exports = GuildBan; diff --git a/vendor/discord.js-selfbot-v13/src/structures/GuildBoost.js b/vendor/discord.js-selfbot-v13/src/structures/GuildBoost.js deleted file mode 100644 index dacc52f..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/GuildBoost.js +++ /dev/null @@ -1,115 +0,0 @@ -'use strict'; - -const Base = require('./Base'); - -/** - * Represents a guild boost in a guild on Discord. - * @extends {Base} - */ -class GuildBoost extends Base { - constructor(client, data) { - super(client); - this._patch(data); - } - - _patch(data) { - if ('id' in data) { - /** - * The id of the guild boost - * @type {Snowflake} - */ - this.id = data.id; - } - if ('subscription_id' in data) { - /** - * The id of the subscription - * @type {Snowflake} - */ - this.subscriptionId = data.subscription_id; - } - if ( - typeof data.premium_guild_subscription === 'object' && - data.premium_guild_subscription !== null - ) { - /** - * The premium guild subscription id - * @type {?Snowflake} - */ - this.premiumGuildSubscriptionId = data.premium_guild_subscription.id; - /** - * Guild id - * @type {?Snowflake} - */ - this.guildId = data.premium_guild_subscription.guild_id; - /** - * Ended ??? - * @type {?boolean} - */ - this.ended = data.premium_guild_subscription.ended; - } - if ('canceled' in data) { - /** - * Whether the subscription is canceled - * @type {boolean} - */ - this.canceled = data.canceled; - } - if ('cooldown_ends_at' in data) { - /** - * The cooldown end date - * @type {Date} - */ - this.cooldownEndsAt = new Date(data.cooldown_ends_at); - } - } - /** - * The guild of the boost - * @type {?Guild} - * @readonly - */ - get guilld() { - return this.client.guilds.cache.get(this.guildId); - } - - /** - * Cancel the boost - * @returns {Promise} - */ - async unsubscribe() { - // https://discord.com/api/v9/guilds/:id/premium/subscriptions/:id - if (!this.guildId) throw new Error('BOOST_UNUSED'); - if (!this.premiumGuildSubscriptionId) throw new Error('BOOST_UNCACHED'); - await this.client.api - .guilds(this.guildId) - .premium.subscriptions(this.premiumGuildSubscriptionId) - .delete(); - this.guildId = null; - this.premiumGuildSubscriptionId = null; - this.ended = null; - return this; - } - - /** - * Use the boost - * @param {GuildResolvable} guild The guild to use the boost on - * @returns {Promise} - */ - async subscribe(guild) { - // https://discord.com/api/v9/guilds/:id/premium/subscriptions - if (this.guildId || this.premiumGuildSubscriptionId) - throw new Error('BOOST_USED'); - const id = this.client.guilds.resolveId(guild); - if (!id) throw new Error('UNKNOWN_GUILD'); - const d = await this.client.api.guilds(id).premium.subscriptions.put({ - data: { - user_premium_guild_subscription_slot_ids: [this.id], - }, - }); - this._patch({ - premium_guild_subscription: d, - }); - return this; - } -} - -module.exports = GuildBoost; diff --git a/vendor/discord.js-selfbot-v13/src/structures/GuildChannel.js b/vendor/discord.js-selfbot-v13/src/structures/GuildChannel.js deleted file mode 100644 index b03f673..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/GuildChannel.js +++ /dev/null @@ -1,498 +0,0 @@ -'use strict'; - -const { Channel } = require('./Channel'); -const { Error } = require('../errors'); -const PermissionOverwriteManager = require('../managers/PermissionOverwriteManager'); -const { VoiceBasedChannelTypes } = require('../util/Constants'); -const Permissions = require('../util/Permissions'); -const Util = require('../util/Util'); - -/** - * Represents a guild channel from any of the following: - * - {@link TextChannel} - * - {@link VoiceChannel} - * - {@link CategoryChannel} - * - {@link NewsChannel} - * - {@link StoreChannel} - * - {@link StageChannel} - * - {@link ForumChannel} - * - {@link MediaChannel} - * @extends {Channel} - * @abstract - */ -class GuildChannel extends Channel { - constructor(guild, data, client, immediatePatch = true) { - super(guild?.client ?? client, data, false); - - /** - * The guild the channel is in - * @type {Guild} - */ - this.guild = guild; - - /** - * The id of the guild the channel is in - * @type {Snowflake} - */ - this.guildId = guild?.id ?? data.guild_id; - - this.parentId = this.parentId ?? null; - /** - * A manager of permission overwrites that belong to this channel - * @type {PermissionOverwriteManager} - */ - this.permissionOverwrites = new PermissionOverwriteManager(this); - - if (data && immediatePatch) this._patch(data); - } - - _patch(data) { - super._patch(data); - - if ('name' in data) { - /** - * The name of the guild channel - * @type {string} - */ - this.name = data.name; - } - - if ('position' in data) { - /** - * The raw position of the channel from Discord - * @type {number} - */ - this.rawPosition = data.position; - } - - if ('guild_id' in data) { - this.guildId = data.guild_id; - } - - if ('parent_id' in data) { - /** - * The id of the category parent of this channel - * @type {?Snowflake} - */ - this.parentId = data.parent_id; - } - - if ('permission_overwrites' in data) { - this.permissionOverwrites.cache.clear(); - for (const overwrite of data.permission_overwrites) { - this.permissionOverwrites._add(overwrite); - } - } - } - - _clone() { - const clone = super._clone(); - clone.permissionOverwrites = new PermissionOverwriteManager( - clone, - this.permissionOverwrites.cache.values(), - ); - return clone; - } - - /** - * The category parent of this channel - * @type {?CategoryChannel} - * @readonly - */ - get parent() { - return this.guild.channels.resolve(this.parentId); - } - - /** - * If the permissionOverwrites match the parent channel, null if no parent - * @type {?boolean} - * @readonly - */ - get permissionsLocked() { - if (!this.parent) return null; - - // Get all overwrites - const overwriteIds = new Set([ - ...this.permissionOverwrites.cache.keys(), - ...this.parent.permissionOverwrites.cache.keys(), - ]); - - // Compare all overwrites - return [...overwriteIds].every((key) => { - const channelVal = this.permissionOverwrites.cache.get(key); - const parentVal = this.parent.permissionOverwrites.cache.get(key); - - // Handle empty overwrite - if ( - (!channelVal && - parentVal.deny.bitfield === Permissions.defaultBit && - parentVal.allow.bitfield === Permissions.defaultBit) || - (!parentVal && - channelVal.deny.bitfield === Permissions.defaultBit && - channelVal.allow.bitfield === Permissions.defaultBit) - ) { - return true; - } - - // Compare overwrites - return ( - typeof channelVal !== 'undefined' && - typeof parentVal !== 'undefined' && - channelVal.deny.bitfield === parentVal.deny.bitfield && - channelVal.allow.bitfield === parentVal.allow.bitfield - ); - }); - } - - /** - * The position of the channel - * @type {number} - * @readonly - */ - get position() { - const selfIsCategory = this.type === 'GUILD_CATEGORY'; - const types = Util.getSortableGroupTypes(this.type); - - let count = 0; - for (const channel of this.guild.channels.cache.values()) { - if (!types.includes(channel.type)) continue; - if (!selfIsCategory && channel.parentId !== this.parentId) continue; - if (this.rawPosition === channel.rawPosition) { - if (BigInt(channel.id) < BigInt(this.id)) count++; - } else if (this.rawPosition > channel.rawPosition) { - count++; - } - } - - return count; - } - - /** - * Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites. - * @param {GuildMemberResolvable|RoleResolvable} memberOrRole The member or role to obtain the overall permissions for - * @param {boolean} [checkAdmin=true] Whether having `ADMINISTRATOR` will return all permissions - * @returns {?Readonly} - */ - permissionsFor(memberOrRole, checkAdmin = true) { - const member = this.guild.members.resolve(memberOrRole); - if (member) return this.memberPermissions(member, checkAdmin); - const role = this.guild.roles.resolve(memberOrRole); - return role && this.rolePermissions(role, checkAdmin); - } - - overwritesFor(member, verified = false, roles = null) { - if (!verified) member = this.guild.members.resolve(member); - if (!member) return []; - - roles ??= member.roles.cache; - const roleOverwrites = []; - let memberOverwrites; - let everyoneOverwrites; - - for (const overwrite of this.permissionOverwrites.cache.values()) { - if (overwrite.id === this.guild.id) { - everyoneOverwrites = overwrite; - } else if (roles.has(overwrite.id)) { - roleOverwrites.push(overwrite); - } else if (overwrite.id === member.id) { - memberOverwrites = overwrite; - } - } - - return { - everyone: everyoneOverwrites, - roles: roleOverwrites, - member: memberOverwrites, - }; - } - - /** - * Gets the overall set of permissions for a member in this channel, taking into account channel overwrites. - * @param {GuildMember} member The member to obtain the overall permissions for - * @param {boolean} checkAdmin=true Whether having `ADMINISTRATOR` will return all permissions - * @returns {Readonly} - * @private - */ - memberPermissions(member, checkAdmin) { - if (checkAdmin && member.id === this.guild.ownerId) - return new Permissions(Permissions.ALL).freeze(); - - const roles = member.roles.cache; - const permissions = new Permissions(roles.map((role) => role.permissions)); - - if (checkAdmin && permissions.has(Permissions.FLAGS.ADMINISTRATOR)) { - return new Permissions(Permissions.ALL).freeze(); - } - - const overwrites = this.overwritesFor(member, true, roles); - - return permissions - .remove(overwrites.everyone?.deny ?? Permissions.defaultBit) - .add(overwrites.everyone?.allow ?? Permissions.defaultBit) - .remove( - overwrites.roles.length > 0 - ? overwrites.roles.map((role) => role.deny) - : Permissions.defaultBit, - ) - .add( - overwrites.roles.length > 0 - ? overwrites.roles.map((role) => role.allow) - : Permissions.defaultBit, - ) - .remove(overwrites.member?.deny ?? Permissions.defaultBit) - .add(overwrites.member?.allow ?? Permissions.defaultBit) - .freeze(); - } - - /** - * Gets the overall set of permissions for a role in this channel, taking into account channel overwrites. - * @param {Role} role The role to obtain the overall permissions for - * @param {boolean} checkAdmin Whether having `ADMINISTRATOR` will return all permissions - * @returns {Readonly} - * @private - */ - rolePermissions(role, checkAdmin) { - if (checkAdmin && role.permissions.has(Permissions.FLAGS.ADMINISTRATOR)) { - return new Permissions(Permissions.ALL).freeze(); - } - - const basePermissions = new Permissions([ - role.permissions, - role.guild.roles.everyone.permissions, - ]); - const everyoneOverwrites = this.permissionOverwrites.cache.get( - this.guild.id, - ); - const roleOverwrites = this.permissionOverwrites.cache.get(role.id); - - return basePermissions - .remove(everyoneOverwrites?.deny ?? Permissions.defaultBit) - .add(everyoneOverwrites?.allow ?? Permissions.defaultBit) - .remove(roleOverwrites?.deny ?? Permissions.defaultBit) - .add(roleOverwrites?.allow ?? Permissions.defaultBit) - .freeze(); - } - - /** - * Locks in the permission overwrites from the parent channel. - * @returns {Promise} - */ - async lockPermissions() { - if (!this.parent) throw new Error('GUILD_CHANNEL_ORPHAN'); - const permissionOverwrites = this.parent.permissionOverwrites.cache.map( - (overwrite) => overwrite.toJSON(), - ); - return this.edit({ permissionOverwrites }); - } - - /** - * A collection of cached members of this channel, mapped by their ids. - * Members that can view this channel, if the channel is text-based. - * Members in the channel, if the channel is voice-based. - * @type {Collection} - * @readonly - */ - get members() { - return this.guild.members.cache.filter((m) => - this.permissionsFor(m).has(Permissions.FLAGS.VIEW_CHANNEL, false), - ); - } - - /** - * Edits the channel. - * @param {ChannelData} data The new data for the channel - * @param {string} [reason] Reason for editing this channel - * @returns {Promise} - * @example - * // Edit a channel - * channel.edit({ name: 'new-channel' }) - * .then(console.log) - * .catch(console.error); - */ - edit(data, reason) { - return this.guild.channels.edit(this, data, reason); - } - - /** - * Sets a new name for the guild channel. - * @param {string} name The new name for the guild channel - * @param {string} [reason] Reason for changing the guild channel's name - * @returns {Promise} - * @example - * // Set a new channel name - * channel.setName('not_general') - * .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`)) - * .catch(console.error); - */ - setName(name, reason) { - return this.edit({ name }, reason); - } - - /** - * Options used to set the parent of a channel. - * @typedef {Object} SetParentOptions - * @property {boolean} [lockPermissions=true] Whether to lock the permissions to what the parent's permissions are - * @property {string} [reason] The reason for modifying the parent of the channel - */ - - /** - * Sets the parent of this channel. - * @param {?CategoryChannelResolvable} channel The category channel to set as the parent - * @param {SetParentOptions} [options={}] The options for setting the parent - * @returns {Promise} - * @example - * // Add a parent to a channel - * message.channel.setParent('355908108431917066', { lockPermissions: false }) - * .then(channel => console.log(`New parent of ${message.channel.name}: ${channel.name}`)) - * .catch(console.error); - */ - setParent(channel, { lockPermissions = true, reason } = {}) { - return this.edit( - { - parent: channel ?? null, - lockPermissions, - }, - reason, - ); - } - - /** - * Options used to set the position of a channel. - * @typedef {Object} SetChannelPositionOptions - * @property {boolean} [relative=false] Whether or not to change the position relative to its current value - * @property {string} [reason] The reason for changing the position - */ - - /** - * Sets a new position for the guild channel. - * @param {number} position The new position for the guild channel - * @param {SetChannelPositionOptions} [options] Options for setting position - * @returns {Promise} - * @example - * // Set a new channel position - * channel.setPosition(2) - * .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`)) - * .catch(console.error); - */ - setPosition(position, options = {}) { - return this.guild.channels.setPosition(this, position, options); - } - - /** - * Options used to clone a guild channel. - * @typedef {GuildChannelCreateOptions} GuildChannelCloneOptions - * @property {string} [name=this.name] Name of the new channel - */ - - /** - * Clones this channel. - * @param {GuildChannelCloneOptions} [options] The options for cloning this channel - * @returns {Promise} - */ - clone(options = {}) { - return this.guild.channels.create(options.name ?? this.name, { - permissionOverwrites: this.permissionOverwrites.cache, - topic: this.topic, - type: this.type, - nsfw: this.nsfw, - parent: this.parent, - bitrate: this.bitrate, - userLimit: this.userLimit, - rateLimitPerUser: this.rateLimitPerUser, - position: this.rawPosition, - reason: null, - ...options, - }); - } - - /** - * Checks if this channel has the same type, topic, position, name, overwrites, and id as another channel. - * In most cases, a simple `channel.id === channel2.id` will do, and is much faster too. - * @param {GuildChannel} channel Channel to compare with - * @returns {boolean} - */ - equals(channel) { - let equal = - channel && - this.id === channel.id && - this.type === channel.type && - this.topic === channel.topic && - this.position === channel.position && - this.name === channel.name; - - if (equal) { - if (this.permissionOverwrites && channel.permissionOverwrites) { - equal = this.permissionOverwrites.cache.equals( - channel.permissionOverwrites.cache, - ); - } else { - equal = !this.permissionOverwrites && !channel.permissionOverwrites; - } - } - - return equal; - } - - /** - * Whether the channel is deletable by the client user - * @type {boolean} - * @readonly - */ - get deletable() { - return ( - this.manageable && - this.guild.rulesChannelId !== this.id && - this.guild.publicUpdatesChannelId !== this.id - ); - } - - /** - * Whether the channel is manageable by the client user - * @type {boolean} - * @readonly - */ - get manageable() { - if (this.client.user.id === this.guild.ownerId) return true; - const permissions = this.permissionsFor(this.client.user); - if (!permissions) return false; - - // This flag allows managing even if timed out - if (permissions.has(Permissions.FLAGS.ADMINISTRATOR, false)) return true; - if (this.guild.members.me.communicationDisabledUntilTimestamp > Date.now()) - return false; - - const bitfield = VoiceBasedChannelTypes.includes(this.type) - ? Permissions.FLAGS.MANAGE_CHANNELS | Permissions.FLAGS.CONNECT - : Permissions.FLAGS.VIEW_CHANNEL | Permissions.FLAGS.MANAGE_CHANNELS; - return permissions.has(bitfield, false); - } - - /** - * Whether the channel is viewable by the client user - * @type {boolean} - * @readonly - */ - get viewable() { - if (this.client.user.id === this.guild.ownerId) return true; - const permissions = this.permissionsFor(this.client.user); - if (!permissions) return false; - return permissions.has(Permissions.FLAGS.VIEW_CHANNEL, false); - } - - /** - * Deletes this channel. - * @param {string} [reason] Reason for deleting this channel - * @returns {Promise} - * @example - * // Delete the channel - * channel.delete('making room for new channels') - * .then(console.log) - * .catch(console.error); - */ - async delete(reason) { - await this.guild.channels.delete(this.id, reason); - return this; - } -} - -module.exports = GuildChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/GuildEmoji.js b/vendor/discord.js-selfbot-v13/src/structures/GuildEmoji.js deleted file mode 100644 index 5d153d9..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/GuildEmoji.js +++ /dev/null @@ -1,166 +0,0 @@ -'use strict'; - -const BaseGuildEmoji = require('./BaseGuildEmoji'); -const { Error } = require('../errors'); -const GuildEmojiRoleManager = require('../managers/GuildEmojiRoleManager'); -const Permissions = require('../util/Permissions'); - -/** - * Represents a custom emoji. - * @extends {BaseGuildEmoji} - */ -class GuildEmoji extends BaseGuildEmoji { - constructor(client, data, guild) { - super(client, data, guild); - - /** - * The user who created this emoji - * @type {?User} - */ - this.author = null; - - /** - * Array of role ids this emoji is active for - * @name GuildEmoji#_roles - * @type {Snowflake[]} - * @private - */ - Object.defineProperty(this, '_roles', { value: [], writable: true }); - - this._patch(data); - } - - /** - * The guild this emoji is part of - * @type {Guild} - * @name GuildEmoji#guild - */ - - _clone() { - const clone = super._clone(); - clone._roles = this._roles.slice(); - return clone; - } - - _patch(data) { - super._patch(data); - - if (data.user) this.author = this.client.users._add(data.user); - if (data.roles) this._roles = data.roles; - } - - /** - * Whether the emoji is deletable by the client user - * @type {boolean} - * @readonly - */ - get deletable() { - if (!this.guild.members.me) throw new Error('GUILD_UNCACHED_ME'); - return ( - !this.managed && - this.guild.members.me.permissions.has( - Permissions.FLAGS.MANAGE_EMOJIS_AND_STICKERS, - ) - ); - } - - /** - * A manager for roles this emoji is active for. - * @type {GuildEmojiRoleManager} - * @readonly - */ - get roles() { - return new GuildEmojiRoleManager(this); - } - - /** - * Fetches the author for this emoji - * @returns {Promise} - */ - fetchAuthor() { - return this.guild.emojis.fetchAuthor(this); - } - - /** - * Data for editing an emoji. - * @typedef {Object} GuildEmojiEditData - * @property {string} [name] The name of the emoji - * @property {Collection|RoleResolvable[]} [roles] Roles to restrict emoji to - */ - - /** - * Edits the emoji. - * @param {GuildEmojiEditData} data The new data for the emoji - * @param {string} [reason] Reason for editing this emoji - * @returns {Promise} - * @example - * // Edit an emoji - * emoji.edit({ name: 'newemoji' }) - * .then(e => console.log(`Edited emoji ${e}`)) - * .catch(console.error); - */ - async edit(data, reason) { - const roles = data.roles?.map((r) => r.id ?? r); - const newData = await this.client.api - .guilds(this.guild.id) - .emojis(this.id) - .patch({ - data: { - name: data.name, - roles, - }, - reason, - }); - const clone = this._clone(); - clone._patch(newData); - return clone; - } - - /** - * Sets the name of the emoji. - * @param {string} name The new name for the emoji - * @param {string} [reason] Reason for changing the emoji's name - * @returns {Promise} - */ - setName(name, reason) { - return this.edit({ name }, reason); - } - - /** - * Deletes the emoji. - * @param {string} [reason] Reason for deleting the emoji - * @returns {Promise} - */ - async delete(reason) { - await this.guild.emojis.delete(this, reason); - return this; - } - - /** - * Whether this emoji is the same as another one. - * @param {GuildEmoji|APIEmoji} other The emoji to compare it to - * @returns {boolean} - */ - equals(other) { - if (other instanceof GuildEmoji) { - return ( - other.id === this.id && - other.name === this.name && - other.managed === this.managed && - other.available === this.available && - other.requiresColons === this.requiresColons && - other.roles.cache.size === this.roles.cache.size && - other.roles.cache.every((role) => this.roles.cache.has(role.id)) - ); - } else { - return ( - other.id === this.id && - other.name === this.name && - other.roles.length === this.roles.cache.size && - other.roles.every((role) => this.roles.cache.has(role)) - ); - } - } -} - -module.exports = GuildEmoji; diff --git a/vendor/discord.js-selfbot-v13/src/structures/GuildMember.js b/vendor/discord.js-selfbot-v13/src/structures/GuildMember.js deleted file mode 100644 index ddab4e8..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/GuildMember.js +++ /dev/null @@ -1,686 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const Base = require('./Base'); -const VoiceState = require('./VoiceState'); -const TextBasedChannel = require('./interfaces/TextBasedChannel'); -const { Error } = require('../errors'); -const GuildMemberRoleManager = require('../managers/GuildMemberRoleManager'); -const GuildMemberFlags = require('../util/GuildMemberFlags'); -const Permissions = require('../util/Permissions'); - -/** - * @type {WeakSet} - * @private - * @internal - */ -const deletedGuildMembers = new WeakSet(); -let deprecationEmittedForDeleted = false; - -/** - * Represents a member of a guild on Discord. - * @implements {TextBasedChannel} - * @extends {Base} - */ -class GuildMember extends Base { - constructor(client, data, guild) { - super(client); - - /** - * The guild that this member is part of - * @type {Guild} - */ - this.guild = guild; - - /** - * The timestamp the member joined the guild at - * @type {?number} - */ - this.joinedTimestamp = null; - - /** - * The last timestamp this member started boosting the guild - * @type {?number} - */ - this.premiumSinceTimestamp = null; - - /** - * The nickname of this member, if they have one - * @type {?string} - */ - this.nickname = null; - - /** - * Whether this member has yet to pass the guild's membership gate - * @type {boolean} - */ - this.pending = false; - - /** - * The timestamp this member's timeout will be removed - * @type {?number} - */ - this.communicationDisabledUntilTimestamp = null; - - /** - * The role ids of the member - * @type {Snowflake[]} - * @private - */ - this._roles = []; - if (data) this._patch(data); - } - - _patch(data) { - if ('user' in data) { - /** - * The user that this guild member instance represents - * @type {?User} - */ - this.user = this.client.users._add(data.user, true); - } - - if ('nick' in data) this.nickname = data.nick; - if ('avatar' in data) { - /** - * The guild member's avatar hash - * @type {?string} - */ - this.avatar = data.avatar; - } else if (typeof this.avatar !== 'string') { - this.avatar = null; - } - if ('banner' in data) { - /** - * The guild member's banner hash. - * @type {?string} - */ - this.banner = data.banner; - } else { - this.banner ??= null; - } - - if ('joined_at' in data) - this.joinedTimestamp = new Date(data.joined_at).getTime(); - if ('premium_since' in data) { - this.premiumSinceTimestamp = data.premium_since - ? new Date(data.premium_since).getTime() - : null; - } - if ('roles' in data) this._roles = data.roles; - this.pending = data.pending ?? false; - - if ('communication_disabled_until' in data) { - this.communicationDisabledUntilTimestamp = - data.communication_disabled_until && - Date.parse(data.communication_disabled_until); - } - if ('flags' in data) { - /** - * The flags of this member - * @type {Readonly} - */ - this.flags = new GuildMemberFlags(data.flags).freeze(); - } else { - this.flags ??= new GuildMemberFlags().freeze(); - } - - if (data.avatar_decoration_data) { - /** - * The member avatar decoration's data - * @type {?AvatarDecorationData} - */ - this.avatarDecorationData = { - asset: data.avatar_decoration_data.asset, - skuId: data.avatar_decoration_data.sku_id, - }; - } else { - this.avatarDecorationData = null; - } - } - - _clone() { - const clone = super._clone(); - clone._roles = this._roles.slice(); - return clone; - } - - /** - * Whether or not the structure has been deleted - * @type {boolean} - * @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 - */ - get deleted() { - if (!deprecationEmittedForDeleted) { - deprecationEmittedForDeleted = true; - process.emitWarning( - 'GuildMember#deleted is deprecated, see https://github.com/discordjs/discord.js/issues/7091.', - 'DeprecationWarning', - ); - } - - return deletedGuildMembers.has(this); - } - - set deleted(value) { - if (!deprecationEmittedForDeleted) { - deprecationEmittedForDeleted = true; - process.emitWarning( - 'GuildMember#deleted is deprecated, see https://github.com/discordjs/discord.js/issues/7091.', - 'DeprecationWarning', - ); - } - - if (value) deletedGuildMembers.add(this); - else deletedGuildMembers.delete(this); - } - - /** - * Whether this GuildMember is a partial - * @type {boolean} - * @readonly - */ - get partial() { - return this.joinedTimestamp === null; - } - - /** - * A manager for the roles belonging to this member - * @type {GuildMemberRoleManager} - * @readonly - */ - get roles() { - return new GuildMemberRoleManager(this); - } - - /** - * The voice state of this member - * @type {VoiceState} - * @readonly - */ - get voice() { - return ( - this.guild.voiceStates.cache.get(this.id) ?? - new VoiceState(this.guild, { user_id: this.id }) - ); - } - - /** - * A link to the user's avatar decoration. - * @returns {?string} - */ - avatarDecorationURL() { - if (!this.avatarDecorationData) return null; - return this.client.rest.cdn.AvatarDecoration( - this.avatarDecorationData.asset, - ); - } - - /** - * A link to the member's guild avatar. - * @param {ImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - avatarURL({ format, size, dynamic } = {}) { - if (!this.avatar) return null; - return this.client.rest.cdn.GuildMemberAvatar( - this.guild.id, - this.id, - this.avatar, - format, - size, - dynamic, - ); - } - - /** - * A link to the member's banner. - * @param {ImageURLOptions} [options={}] Options for the banner URL - * @returns {?string} - */ - bannerURL({ format, size, dynamic } = {}) { - return ( - this.banner && - this.client.rest.cdn.GuildMemberBanner( - this.guild.id, - this.id, - this.banner, - format, - size, - dynamic, - ) - ); - } - - /** - * A link to the member's guild avatar decoration if they have one. - * Otherwise, a link to their {@link User#avatarDecorationURL} will be returned. - * @returns {?string} - */ - displayAvatarDecorationURL() { - return this.avatarDecorationURL() ?? this.user.avatarDecorationURL(); - } - - /** - * A link to the member's guild avatar if they have one. - * Otherwise, a link to their {@link User#displayAvatarURL} will be returned. - * @param {ImageURLOptions} [options={}] Options for the Image URL - * @returns {string} - */ - displayAvatarURL(options) { - return this.avatarURL(options) ?? this.user.displayAvatarURL(options); - } - - /** - * A link to the member's guild banner if they have one. - * Otherwise, a link to their {@link User#bannerURL} will be returned. - * @param {ImageURLOptions} [options={}] Options for the image URL - * @returns {?string} - */ - displayBannerURL(options) { - return this.bannerURL(options) ?? this.user.bannerURL(options); - } - - /** - * The time this member joined the guild - * @type {?Date} - * @readonly - */ - get joinedAt() { - return this.joinedTimestamp ? new Date(this.joinedTimestamp) : null; - } - - /** - * The time this member's timeout will be removed - * @type {?Date} - * @readonly - */ - get communicationDisabledUntil() { - return ( - this.communicationDisabledUntilTimestamp && - new Date(this.communicationDisabledUntilTimestamp) - ); - } - - /** - * The last time this member started boosting the guild - * @type {?Date} - * @readonly - */ - get premiumSince() { - return this.premiumSinceTimestamp - ? new Date(this.premiumSinceTimestamp) - : null; - } - - /** - * The presence of this guild member - * @type {?Presence} - * @readonly - */ - get presence() { - return this.guild.presences.cache.get(this.id) ?? null; - } - - /** - * The displayed color of this member in base 10 - * @type {number} - * @readonly - */ - get displayColor() { - return this.roles.color?.colors.primaryColor ?? 0; - } - - /** - * The displayed color of this member in hexadecimal - * @type {string} - * @readonly - */ - get displayHexColor() { - return this.roles.color?.hexColor ?? '#000000'; - } - - /** - * The member's id - * @type {Snowflake} - * @readonly - */ - get id() { - return this.user.id; - } - - /** - * The nickname of this member, or their user display name if they don't have one - * @type {?string} - * @readonly - */ - get displayName() { - return this.nickname ?? this.user.displayName; - } - - /** - * The overall set of permissions for this member, taking only roles and owner status into account - * @type {Readonly} - * @readonly - */ - get permissions() { - if (this.user.id === this.guild.ownerId) - return new Permissions(Permissions.ALL).freeze(); - return new Permissions( - this.roles.cache.map((role) => role.permissions), - ).freeze(); - } - - /** - * Whether the client user is above this user in the hierarchy, according to role position and guild ownership. - * This is a prerequisite for many moderative actions. - * @type {boolean} - * @readonly - */ - get manageable() { - if (this.user.id === this.guild.ownerId) return false; - if (this.user.id === this.client.user.id) return false; - if (this.client.user.id === this.guild.ownerId) return true; - if (!this.guild.members.me) throw new Error('GUILD_UNCACHED_ME'); - return ( - this.guild.members.me.roles.highest.comparePositionTo( - this.roles.highest, - ) > 0 - ); - } - - /** - * Whether this member is kickable by the client user - * @type {boolean} - * @readonly - */ - get kickable() { - return ( - this.manageable && - this.guild.members.me.permissions.has(Permissions.FLAGS.KICK_MEMBERS) - ); - } - - /** - * Whether this member is bannable by the client user - * @type {boolean} - * @readonly - */ - get bannable() { - return ( - this.manageable && - this.guild.members.me.permissions.has(Permissions.FLAGS.BAN_MEMBERS) - ); - } - - /** - * Whether this member is moderatable by the client user - * @type {boolean} - * @readonly - */ - get moderatable() { - return ( - !this.permissions.has(Permissions.FLAGS.ADMINISTRATOR) && - this.manageable && - (this.guild.members.me?.permissions.has( - Permissions.FLAGS.MODERATE_MEMBERS, - ) ?? - false) - ); - } - - /** - * Whether this member is currently timed out - * @returns {boolean} - */ - isCommunicationDisabled() { - return this.communicationDisabledUntilTimestamp > Date.now(); - } - - /** - * Returns `channel.permissionsFor(guildMember)`. Returns permissions for a member in a guild channel, - * taking into account roles and permission overwrites. - * @param {GuildChannelResolvable} channel The guild channel to use as context - * @returns {Readonly} - */ - permissionsIn(channel) { - channel = this.guild.channels.resolve(channel); - if (!channel) throw new Error('GUILD_CHANNEL_RESOLVE'); - return channel.permissionsFor(this); - } - - /** - * Edits this member. - * @param {GuildMemberEditData} data The data to edit the member with - * @param {string} [reason] Reason for editing this user - * @returns {Promise} - */ - edit(data, reason) { - return this.guild.members.edit(this, data, reason); - } - - /** - * Sets the nickname for this member. - * @param {?string} nick The nickname for the guild member, or `null` if you want to reset their nickname - * @param {string} [reason] Reason for setting the nickname - * @returns {Promise} - * @example - * // Set a nickname for a guild member - * guildMember.setNickname('cool nickname', 'Needed a new nickname') - * .then(member => console.log(`Set nickname of ${member.user.username}`)) - * .catch(console.error); - * @example - * // Remove a nickname for a guild member - * guildMember.setNickname(null, 'No nicknames allowed!') - * .then(member => console.log(`Removed nickname for ${member.user.username}`)) - * .catch(console.error); - */ - setNickname(nick, reason) { - return this.edit({ nick }, reason); - } - - /** - * Sets the flags for this member. - * @param {GuildMemberFlagsResolvable} flags The flags to set - * @param {string} [reason] Reason for setting the flags - * @returns {Promise} - */ - setFlags(flags, reason) { - return this.edit({ flags, reason }); - } - - /** - * Creates a DM channel between the client and this member. - * @param {boolean} [force=false] Whether to skip the cache check and request the API - * @returns {Promise} - */ - createDM(force = false) { - return this.user.createDM(force); - } - - /** - * Deletes any DMs with this member. - * @returns {Promise} - */ - deleteDM() { - return this.user.deleteDM(); - } - - /** - * Kicks this member from the guild. - * @param {string} [reason] Reason for kicking user - * @returns {Promise} - */ - kick(reason) { - return this.guild.members.kick(this, reason); - } - - /** - * Bans this guild member. - * @param {BanOptions} [options] Options for the ban - * @returns {Promise} - * @example - * // Ban a guild member, deleting a week's worth of messages - * guildMember.ban({ deleteMessageSeconds: 60 * 60 * 24 * 7, reason: 'They deserved it' }) - * .then(console.log) - * .catch(console.error); - */ - ban(options) { - return this.guild.bans.create(this, options); - } - - /** - * Times this guild member out. - * @param {DateResolvable|null} communicationDisabledUntil The date or timestamp - * for the member's communication to be disabled until. Provide `null` to remove the timeout. - * @param {string} [reason] The reason for this timeout. - * @returns {Promise} - * @example - * // Time a guild member out for 5 minutes - * guildMember.disableCommunicationUntil(Date.now() + (5 * 60 * 1000), 'They deserved it') - * .then(console.log) - * .catch(console.error); - * @example - * // Remove the timeout of a guild member - * guildMember.disableCommunicationUntil(null) - * .then(member => console.log(`Removed timeout for ${member.displayName}`)) - * .catch(console.error); - */ - disableCommunicationUntil(communicationDisabledUntil, reason) { - return this.edit({ communicationDisabledUntil }, reason); - } - - /** - * Times this guild member out. - * @param {number|null} timeout The time in milliseconds - * for the member's communication to be disabled until. Provide `null` to remove the timeout. - * @param {string} [reason] The reason for this timeout. - * @returns {Promise} - * @example - * // Time a guild member out for 5 minutes - * guildMember.timeout(5 * 60 * 1000, 'They deserved it') - * .then(console.log) - * .catch(console.error); - */ - timeout(timeout, reason) { - return this.disableCommunicationUntil( - timeout && Date.now() + timeout, - reason, - ); - } - - /** - * Fetches this GuildMember. - * @param {boolean} [force=true] Whether to skip the cache check and request the API - * @returns {Promise} - */ - fetch(force = true) { - return this.guild.members.fetch({ user: this.id, cache: true, force }); - } - - /** - * Whether this guild member equals another guild member. It compares all properties, so for most - * comparison it is advisable to just compare `member.id === member2.id` as it is significantly faster - * and is often what most users need. - * @param {GuildMember} member The member to compare with - * @returns {boolean} - */ - equals(member) { - return ( - member instanceof this.constructor && - this.id === member.id && - this.partial === member.partial && - this.guild.id === member.guild.id && - this.joinedTimestamp === member.joinedTimestamp && - this.nickname === member.nickname && - this.avatar === member.avatar && - this.banner === member.banner && - this.pending === member.pending && - this.communicationDisabledUntilTimestamp === - member.communicationDisabledUntilTimestamp && - this.flags.equals(member.flags) && - (this._roles === member._roles || - (this._roles.length === member._roles.length && - this._roles.every((role, i) => role === member._roles[i]))) && - this.avatarDecorationData?.asset === member.avatarDecorationData?.asset && - this.avatarDecorationData?.skuId === member.avatarDecorationData?.skuId - ); - } - - /** - * When concatenated with a string, this automatically returns the user's mention instead of the GuildMember object. - * @returns {string} - * @example - * // Logs: Hello from <@123456789012345678>! - * console.log(`Hello from ${member}!`); - */ - toString() { - return `<@${this.nickname ? '!' : ''}${this.user.id}>`; - } - - toJSON() { - const json = super.toJSON({ - guild: 'guildId', - user: 'userId', - displayName: true, - roles: true, - }); - json.avatarURL = this.avatarURL(); - json.bannerURL = this.bannerURL(); - json.displayAvatarURL = this.displayAvatarURL(); - json.displayBannerURL = this.displayBannerURL(); - json.avatarDecorationURL = this.avatarDecorationURL(); - return json; - } - - /** - * Sets the guild avatar of the logged in client. - * @param {?(BufferResolvable|Base64Resolvable)} avatar The new avatar - * @returns {Promise} - */ - setAvatar(avatar) { - return this.edit({ avatar }); - } - - /** - * Sets the guild banner of the logged in client. - * @param {?(BufferResolvable|Base64Resolvable)} banner The new banner - * @returns {Promise} - */ - setBanner(banner) { - return this.edit({ banner }); - } - - /** - * Set Guild About me - * @param {string | null} bio Bio to set - * @returns {Promise} - */ - setAboutMe(bio = null) { - return this.edit({ bio }); - } -} - -/** - * Sends a message to this user. - * @method send - * @memberof GuildMember - * @instance - * @param {string|MessagePayload|MessageOptions} options The options to provide - * @returns {Promise} - * @example - * // Send a direct message - * guildMember.send('Hello!') - * .then(message => console.log(`Sent message: ${message.content} to ${guildMember.displayName}`)) - * .catch(console.error); - */ - -TextBasedChannel.applyToClass(GuildMember); - -exports.GuildMember = GuildMember; -exports.deletedGuildMembers = deletedGuildMembers; - -/** - * @external APIGuildMember - * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object} - */ diff --git a/vendor/discord.js-selfbot-v13/src/structures/GuildPreview.js b/vendor/discord.js-selfbot-v13/src/structures/GuildPreview.js deleted file mode 100644 index 763afe4..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/GuildPreview.js +++ /dev/null @@ -1,209 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const Base = require('./Base'); -const GuildPreviewEmoji = require('./GuildPreviewEmoji'); -const { Sticker } = require('./Sticker'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); - -/** - * Represents the data about the guild any bot can preview, connected to the specified guild. - * @extends {Base} - */ -class GuildPreview extends Base { - constructor(client, data) { - super(client); - - if (!data) return; - - this._patch(data); - } - - _patch(data) { - /** - * The id of this guild - * @type {string} - */ - this.id = data.id; - - if ('name' in data) { - /** - * The name of this guild - * @type {string} - */ - this.name = data.name; - } - - if ('icon' in data) { - /** - * The icon of this guild - * @type {?string} - */ - this.icon = data.icon; - } - - if ('splash' in data) { - /** - * The splash icon of this guild - * @type {?string} - */ - this.splash = data.splash; - } - - if ('discovery_splash' in data) { - /** - * The discovery splash icon of this guild - * @type {?string} - */ - this.discoverySplash = data.discovery_splash; - } - - if ('features' in data) { - /** - * An array of enabled guild features - * @type {Features[]} - */ - this.features = data.features; - } - - if ('approximate_member_count' in data) { - /** - * The approximate count of members in this guild - * @type {number} - */ - this.approximateMemberCount = data.approximate_member_count; - } - - if ('approximate_presence_count' in data) { - /** - * The approximate count of online members in this guild - * @type {number} - */ - this.approximatePresenceCount = data.approximate_presence_count; - } - - if ('description' in data) { - /** - * The description for this guild - * @type {?string} - */ - this.description = data.description; - } else { - this.description ??= null; - } - - if (!this.emojis) { - /** - * Collection of emojis belonging to this guild - * @type {Collection} - */ - this.emojis = new Collection(); - } else { - this.emojis.clear(); - } - for (const emoji of data.emojis) { - this.emojis.set( - emoji.id, - new GuildPreviewEmoji(this.client, emoji, this), - ); - } - - /** - * Collection of stickers belonging to this guild - * @type {Collection} - */ - this.stickers = data.stickers.reduce( - (stickers, sticker) => - stickers.set(sticker.id, new Sticker(this.client, sticker)), - new Collection(), - ); - } - /** - * The timestamp this guild was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return SnowflakeUtil.timestampFrom(this.id); - } - - /** - * The time this guild was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * The URL to this guild's splash. - * @param {StaticImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - splashURL({ format, size } = {}) { - return ( - this.splash && - this.client.rest.cdn.Splash(this.id, this.splash, format, size) - ); - } - - /** - * The URL to this guild's discovery splash. - * @param {StaticImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - discoverySplashURL({ format, size } = {}) { - return ( - this.discoverySplash && - this.client.rest.cdn.DiscoverySplash( - this.id, - this.discoverySplash, - format, - size, - ) - ); - } - - /** - * The URL to this guild's icon. - * @param {ImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - iconURL({ format, size, dynamic } = {}) { - return ( - this.icon && - this.client.rest.cdn.Icon(this.id, this.icon, format, size, dynamic) - ); - } - - /** - * Fetches this guild. - * @returns {Promise} - */ - async fetch() { - const data = await this.client.api.guilds(this.id).preview.get(); - this._patch(data); - return this; - } - - /** - * When concatenated with a string, this automatically returns the guild's name instead of the Guild object. - * @returns {string} - * @example - * // Logs: Hello from My Guild! - * console.log(`Hello from ${previewGuild}!`); - */ - toString() { - return this.name; - } - - toJSON() { - const json = super.toJSON(); - json.iconURL = this.iconURL(); - json.splashURL = this.splashURL(); - return json; - } -} - -module.exports = GuildPreview; diff --git a/vendor/discord.js-selfbot-v13/src/structures/GuildPreviewEmoji.js b/vendor/discord.js-selfbot-v13/src/structures/GuildPreviewEmoji.js deleted file mode 100644 index 144b41d..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/GuildPreviewEmoji.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -const BaseGuildEmoji = require('./BaseGuildEmoji'); - -/** - * Represents an instance of an emoji belonging to a public guild obtained through Discord's preview endpoint. - * @extends {BaseGuildEmoji} - */ -class GuildPreviewEmoji extends BaseGuildEmoji { - /** - * The public guild this emoji is part of - * @type {GuildPreview} - * @name GuildPreviewEmoji#guild - */ - - constructor(client, data, guild) { - super(client, data, guild); - - /** - * The roles this emoji is active for - * @type {Snowflake[]} - */ - this.roles = data.roles; - } -} - -module.exports = GuildPreviewEmoji; diff --git a/vendor/discord.js-selfbot-v13/src/structures/GuildScheduledEvent.js b/vendor/discord.js-selfbot-v13/src/structures/GuildScheduledEvent.js deleted file mode 100644 index f6ab0e6..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/GuildScheduledEvent.js +++ /dev/null @@ -1,573 +0,0 @@ -'use strict'; - -const Base = require('./Base'); -const { Error } = require('../errors'); -const { - GuildScheduledEventEntityTypes, - GuildScheduledEventStatuses, - GuildScheduledEventPrivacyLevels, - Endpoints, -} = require('../util/Constants'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); - -/** - * Represents a scheduled event in a {@link Guild}. - * @extends {Base} - */ -class GuildScheduledEvent extends Base { - constructor(client, data) { - super(client); - - /** - * The id of the guild scheduled event - * @type {Snowflake} - */ - this.id = data.id; - - /** - * The id of the guild this guild scheduled event belongs to - * @type {Snowflake} - */ - this.guildId = data.guild_id; - - this._patch(data); - } - - _patch(data) { - if ('channel_id' in data) { - /** - * The channel id in which the scheduled event will be hosted, or `null` if entity type is `EXTERNAL` - * @type {?Snowflake} - */ - this.channelId = data.channel_id; - } else { - this.channelId ??= null; - } - - if ('creator_id' in data) { - /** - * The id of the user that created this guild scheduled event - * @type {?Snowflake} - */ - this.creatorId = data.creator_id; - } else { - this.creatorId ??= null; - } - - if ('name' in data) { - /** - * The name of the guild scheduled event - * @type {?string} - */ - this.name = data.name; - } else { - // Only if partial. - this.name ??= null; - } - - if ('description' in data) { - /** - * The description of the guild scheduled event - * @type {?string} - */ - this.description = data.description; - } else { - this.description ??= null; - } - - if ('scheduled_start_time' in data) { - /** - * The timestamp the guild scheduled event will start at - * This can be potentially `null` only when it's an {@link AuditLogEntryTarget} - * @type {?number} - */ - this.scheduledStartTimestamp = Date.parse(data.scheduled_start_time); - } else { - this.scheduledStartTimestamp ??= null; - } - - if ('scheduled_end_time' in data) { - /** - * The timestamp the guild scheduled event will end at - * or `null` if the event does not have a scheduled time to end - * @type {?number} - */ - this.scheduledEndTimestamp = data.scheduled_end_time - ? Date.parse(data.scheduled_end_time) - : null; - } else { - this.scheduledEndTimestamp ??= null; - } - - if ('privacy_level' in data) { - /** - * The privacy level of the guild scheduled event - * @type {PrivacyLevel} - */ - this.privacyLevel = GuildScheduledEventPrivacyLevels[data.privacy_level]; - } else { - // Only if partial. - this.privacyLevel ??= null; - } - - if ('status' in data) { - /** - * The status of the guild scheduled event - * @type {GuildScheduledEventStatus} - */ - this.status = GuildScheduledEventStatuses[data.status]; - } else { - // Only if partial. - this.status ??= null; - } - - if ('entity_type' in data) { - /** - * The type of hosting entity associated with the scheduled event - * @type {GuildScheduledEventEntityType} - */ - this.entityType = GuildScheduledEventEntityTypes[data.entity_type]; - } else { - // Only if partial. - this.entityType ??= null; - } - - if ('entity_id' in data) { - /** - * The id of the hosting entity associated with the scheduled event - * @type {?Snowflake} - */ - this.entityId = data.entity_id; - } else { - this.entityId ??= null; - } - - if ('user_count' in data) { - /** - * The number of users who are subscribed to this guild scheduled event - * @type {?number} - */ - this.userCount = data.user_count; - } else { - this.userCount ??= null; - } - - if ('creator' in data) { - /** - * The user that created this guild scheduled event - * @type {?User} - */ - this.creator = this.client.users._add(data.creator); - } else { - this.creator ??= this.client.users.resolve(this.creatorId); - } - - /* eslint-disable max-len */ - /** - * Represents the additional metadata for a {@link GuildScheduledEvent} - * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata} - * @typedef {Object} GuildScheduledEventEntityMetadata - * @property {?string} location The location of the guild scheduled event - */ - /* eslint-enable max-len */ - - if ('entity_metadata' in data) { - if (data.entity_metadata) { - /** - * Additional metadata - * @type {?GuildScheduledEventEntityMetadata} - */ - this.entityMetadata = { - location: - data.entity_metadata.location ?? - this.entityMetadata?.location ?? - null, - }; - } else { - this.entityMetadata = null; - } - } else { - this.entityMetadata ??= null; - } - - if ('image' in data) { - /** - * The cover image hash for this scheduled event - * @type {?string} - */ - this.image = data.image; - } else { - this.image ??= null; - } - - /** - * Represents the recurrence rule for a {@link GuildScheduledEvent}. - * @typedef {Object} GuildScheduledEventRecurrenceRule - * @property {number} startTimestamp The timestamp the recurrence rule interval starts at - * @property {Date} startAt The time the recurrence rule interval starts at - * @property {?number} endTimestamp The timestamp the recurrence rule interval ends at - * @property {?Date} endAt The time the recurrence rule interval ends at - * @property {GuildScheduledEventRecurrenceRuleFrequency} frequency How often the event occurs - * @property {number} interval The spacing between the events - * @property {?GuildScheduledEventRecurrenceRuleWeekday[]} byWeekday The days within a week to recur on - * @property {?GuildScheduledEventRecurrenceRuleNWeekday[]} byNWeekday The days within a week to recur on - * @property {?GuildScheduledEventRecurrenceRuleMonth[]} byMonth The months to recur on - * @property {?number[]} byMonthDay The days within a month to recur on - * @property {?number[]} byYearDay The days within a year to recur on - * @property {?number} count The total amount of times the event is allowed to recur before stopping - */ - /** - * @typedef {Object} GuildScheduledEventRecurrenceRuleNWeekday - * @property {number} n The week to recur on - * @property {GuildScheduledEventRecurrenceRuleWeekday} day The day within the week to recur on - */ - - if ('recurrence_rule' in data) { - /** - * The recurrence rule for this scheduled event - * @type {?GuildScheduledEventRecurrenceRule} - */ - this.recurrenceRule = data.recurrence_rule && { - startTimestamp: Date.parse(data.recurrence_rule.start), - get startAt() { - return new Date(this.startTimestamp); - }, - endTimestamp: - data.recurrence_rule.end && Date.parse(data.recurrence_rule.end), - get endAt() { - return this.endTimestamp && new Date(this.endTimestamp); - }, - frequency: data.recurrence_rule.frequency, - interval: data.recurrence_rule.interval, - byWeekday: data.recurrence_rule.by_weekday, - byNWeekday: data.recurrence_rule.by_n_weekday, - byMonth: data.recurrence_rule.by_month, - byMonthDay: data.recurrence_rule.by_month_day, - byYearDay: data.recurrence_rule.by_year_day, - count: data.recurrence_rule.count, - }; - } else { - this.recurrenceRule ??= null; - } - } - - /** - * The URL of this scheduled event's cover image - * @param {StaticImageURLOptions} [options={}] Options for image URL - * @returns {?string} - */ - coverImageURL({ format, size } = {}) { - return ( - this.image && - this.client.rest.cdn.GuildScheduledEventCover( - this.id, - this.image, - format, - size, - ) - ); - } - - /** - * Whether this guild scheduled event is partial. - * @type {boolean} - * @readonly - */ - get partial() { - return this.name === null; - } - - /** - * The timestamp the guild scheduled event was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return SnowflakeUtil.timestampFrom(this.id); - } - - /** - * The time the guild scheduled event was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * The time the guild scheduled event will start at - * @type {Date} - * @readonly - */ - get scheduledStartAt() { - return new Date(this.scheduledStartTimestamp); - } - - /** - * The time the guild scheduled event will end at, - * or `null` if the event does not have a scheduled time to end - * @type {?Date} - * @readonly - */ - get scheduledEndAt() { - return this.scheduledEndTimestamp && new Date(this.scheduledEndTimestamp); - } - - /** - * The channel associated with this scheduled event - * @type {?(VoiceChannel|StageChannel)} - * @readonly - */ - get channel() { - return this.client.channels.resolve(this.channelId); - } - - /** - * The guild this scheduled event belongs to - * @type {?Guild} - * @readonly - */ - get guild() { - return this.client.guilds.resolve(this.guildId); - } - - /** - * The URL to the guild scheduled event - * @type {string} - * @readonly - */ - get url() { - return Endpoints.scheduledEvent( - this.client.options.http.scheduledEvent, - this.guildId, - this.id, - ); - } - - /** - * Fetches this guild scheduled event. - * @param {boolean} [force=true] Whether to skip the cache check and request the API - * @returns {Promise} - */ - fetch(force = true) { - return this.guild.scheduledEvents.fetch({ - guildScheduledEvent: this.id, - force, - }); - } - - /** - * Options used to create an invite URL to a {@link GuildScheduledEvent} - * @typedef {CreateInviteOptions} CreateGuildScheduledEventInviteURLOptions - * @property {GuildInvitableChannelResolvable} [channel] The channel to create the invite in. - * This is required when the `entityType` of `GuildScheduledEvent` is `EXTERNAL`, gets ignored otherwise - */ - - /** - * Creates an invite URL to this guild scheduled event. - * @param {CreateGuildScheduledEventInviteURLOptions} [options] The options to create the invite - * @returns {Promise} - */ - async createInviteURL(options) { - let channelId = this.channelId; - if (this.entityType === 'EXTERNAL') { - if (!options?.channel) throw new Error('INVITE_OPTIONS_MISSING_CHANNEL'); - channelId = this.guild.channels.resolveId(options.channel); - if (!channelId) throw new Error('GUILD_CHANNEL_RESOLVE'); - } - const invite = await this.guild.invites.create(channelId, options); - return Endpoints.invite( - this.client.options.http.invite, - invite.code, - this.id, - ); - } - - /** - * Edits this guild scheduled event. - * @param {GuildScheduledEventEditOptions} options The options to edit the guild scheduled event - * @returns {Promise} - * @example - * // Edit a guild scheduled event - * guildScheduledEvent.edit({ name: 'Party' }) - * .then(guildScheduledEvent => console.log(guildScheduledEvent)) - * .catch(console.error); - */ - edit(options) { - return this.guild.scheduledEvents.edit(this.id, options); - } - - /** - * Deletes this guild scheduled event. - * @returns {Promise} - * @example - * // Delete a guild scheduled event - * guildScheduledEvent.delete() - * .then(guildScheduledEvent => console.log(guildScheduledEvent)) - * .catch(console.error); - */ - async delete() { - await this.guild.scheduledEvents.delete(this.id); - return this; - } - - /** - * Sets a new name for the guild scheduled event. - * @param {string} name The new name of the guild scheduled event - * @param {string} [reason] The reason for changing the name - * @returns {Promise} - * @example - * // Set name of a guild scheduled event - * guildScheduledEvent.setName('Birthday Party') - * .then(guildScheduledEvent => console.log(`Set the name to: ${guildScheduledEvent.name}`)) - * .catch(console.error); - */ - setName(name, reason) { - return this.edit({ name, reason }); - } - - /** - * Sets a new time to schedule the event at. - * @param {DateResolvable} scheduledStartTime The time to schedule the event at - * @param {string} [reason] The reason for changing the scheduled start time - * @returns {Promise} - * @example - * // Set start time of a guild scheduled event - * guildScheduledEvent.setScheduledStartTime('2022-09-24T00:00:00+05:30') - * .then(guildScheduledEvent => console.log(`Set the start time to: ${guildScheduledEvent.scheduledStartTime}`)) - * .catch(console.error); - */ - setScheduledStartTime(scheduledStartTime, reason) { - return this.edit({ scheduledStartTime, reason }); - } - - // TODO: scheduledEndTime gets reset on passing null but it hasn't been documented - /** - * Sets a new time to end the event at. - * @param {DateResolvable} scheduledEndTime The time to end the event at - * @param {string} [reason] The reason for changing the scheduled end time - * @returns {Promise} - * @example - * // Set end time of a guild scheduled event - * guildScheduledEvent.setScheduledEndTime('2022-09-25T00:00:00+05:30') - * .then(guildScheduledEvent => console.log(`Set the end time to: ${guildScheduledEvent.scheduledEndTime}`)) - * .catch(console.error); - */ - setScheduledEndTime(scheduledEndTime, reason) { - return this.edit({ scheduledEndTime, reason }); - } - - /** - * Sets the new description of the guild scheduled event. - * @param {string} description The description of the guild scheduled event - * @param {string} [reason] The reason for changing the description - * @returns {Promise} - * @example - * // Set description of a guild scheduled event - * guildScheduledEvent.setDescription('A virtual birthday party') - * .then(guildScheduledEvent => console.log(`Set the description to: ${guildScheduledEvent.description}`)) - * .catch(console.error); - */ - setDescription(description, reason) { - return this.edit({ description, reason }); - } - - /** - * Sets the new status of the guild scheduled event. - * If you're working with TypeScript, use this method in conjunction with status type-guards - * like {@link GuildScheduledEvent#isScheduled} to get only valid status as suggestion - * @param {GuildScheduledEventStatus|number} status The status of the guild scheduled event - * @param {string} [reason] The reason for changing the status - * @returns {Promise} - * @example - * // Set status of a guild scheduled event - * guildScheduledEvent.setStatus('ACTIVE') - * .then(guildScheduledEvent => console.log(`Set the status to: ${guildScheduledEvent.status}`)) - * .catch(console.error); - */ - setStatus(status, reason) { - return this.edit({ status, reason }); - } - - /** - * Sets the new location of the guild scheduled event. - * @param {string} location The location of the guild scheduled event - * @param {string} [reason] The reason for changing the location - * @returns {Promise} - * @example - * // Set location of a guild scheduled event - * guildScheduledEvent.setLocation('Earth') - * .then(guildScheduledEvent => console.log(`Set the location to: ${guildScheduledEvent.entityMetadata.location}`)) - * .catch(console.error); - */ - setLocation(location, reason) { - return this.edit({ entityMetadata: { location }, reason }); - } - - /** - * Fetches subscribers of this guild scheduled event. - * @param {FetchGuildScheduledEventSubscribersOptions} [options] Options for fetching the subscribers - * @returns {Promise>} - */ - fetchSubscribers(options) { - return this.guild.scheduledEvents.fetchSubscribers(this.id, options); - } - - /** - * When concatenated with a string, this automatically concatenates the event's URL instead of the object. - * @returns {string} - * @example - * // Logs: Event: https://discord.com/events/412345678901234567/499876543211234567 - * console.log(`Event: ${guildScheduledEvent}`); - */ - toString() { - return this.url; - } - - /** - * Indicates whether this guild scheduled event has an `ACTIVE` status. - * @returns {boolean} - */ - isActive() { - return ( - GuildScheduledEventStatuses[this.status] === - GuildScheduledEventStatuses.ACTIVE - ); - } - - /** - * Indicates whether this guild scheduled event has a `CANCELED` status. - * @returns {boolean} - */ - isCanceled() { - return ( - GuildScheduledEventStatuses[this.status] === - GuildScheduledEventStatuses.CANCELED - ); - } - - /** - * Indicates whether this guild scheduled event has a `COMPLETED` status. - * @returns {boolean} - */ - isCompleted() { - return ( - GuildScheduledEventStatuses[this.status] === - GuildScheduledEventStatuses.COMPLETED - ); - } - - /** - * Indicates whether this guild scheduled event has a `SCHEDULED` status. - * @returns {boolean} - */ - isScheduled() { - return ( - GuildScheduledEventStatuses[this.status] === - GuildScheduledEventStatuses.SCHEDULED - ); - } -} - -exports.GuildScheduledEvent = GuildScheduledEvent; diff --git a/vendor/discord.js-selfbot-v13/src/structures/GuildTemplate.js b/vendor/discord.js-selfbot-v13/src/structures/GuildTemplate.js deleted file mode 100644 index b7e2fc9..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/GuildTemplate.js +++ /dev/null @@ -1,247 +0,0 @@ -'use strict'; - -const { setTimeout } = require('node:timers'); -const Base = require('./Base'); -const { Events } = require('../util/Constants'); -const DataResolver = require('../util/DataResolver'); - -/** - * Represents the template for a guild. - * @extends {Base} - */ -class GuildTemplate extends Base { - constructor(client, data) { - super(client); - this._patch(data); - } - - _patch(data) { - if ('code' in data) { - /** - * The unique code of this template - * @type {string} - */ - this.code = data.code; - } - - if ('name' in data) { - /** - * The name of this template - * @type {string} - */ - this.name = data.name; - } - - if ('description' in data) { - /** - * The description of this template - * @type {?string} - */ - this.description = data.description; - } - - if ('usage_count' in data) { - /** - * The amount of times this template has been used - * @type {number} - */ - this.usageCount = data.usage_count; - } - - if ('creator_id' in data) { - /** - * The id of the user that created this template - * @type {Snowflake} - */ - this.creatorId = data.creator_id; - } - - if ('creator' in data) { - /** - * The user that created this template - * @type {User} - */ - this.creator = this.client.users._add(data.creator); - } - - if ('created_at' in data) { - /** - * The time when this template was created at - * @type {Date} - */ - this.createdAt = new Date(data.created_at); - } - - if ('updated_at' in data) { - /** - * The time when this template was last synced to the guild - * @type {Date} - */ - this.updatedAt = new Date(data.updated_at); - } - - if ('source_guild_id' in data) { - /** - * The id of the guild that this template belongs to - * @type {Snowflake} - */ - this.guildId = data.source_guild_id; - } - - if ('serialized_source_guild' in data) { - /** - * The data of the guild that this template would create - * @type {APIGuild} - */ - this.serializedGuild = data.serialized_source_guild; - } - - /** - * Whether this template has unsynced changes - * @type {?boolean} - */ - this.unSynced = 'is_dirty' in data ? Boolean(data.is_dirty) : null; - - return this; - } - - /** - * Creates a guild based on this template. - * This is only available to bots in fewer than 10 guilds. - * @param {string} name The name of the guild - * @param {BufferResolvable|Base64Resolvable} [icon] The icon for the guild - * @returns {Promise} - */ - async createGuild(name, icon) { - const { client } = this; - const data = await client.api.guilds.templates(this.code).post({ - data: { - name, - icon: await DataResolver.resolveImage(icon), - }, - }); - - if (client.guilds.cache.has(data.id)) - return client.guilds.cache.get(data.id); - - return new Promise((resolve) => { - const resolveGuild = (guild) => { - client.off(Events.GUILD_CREATE, handleGuild); - client.decrementMaxListeners(); - resolve(guild); - }; - - const handleGuild = (guild) => { - if (guild.id === data.id) { - clearTimeout(timeout); - resolveGuild(guild); - } - }; - - client.incrementMaxListeners(); - client.on(Events.GUILD_CREATE, handleGuild); - - const timeout = setTimeout( - () => resolveGuild(client.guilds._add(data)), - 10_000, - ).unref(); - }); - } - - /** - * Options used to edit a guild template. - * @typedef {Object} EditGuildTemplateOptions - * @property {string} [name] The name of this template - * @property {string} [description] The description of this template - */ - - /** - * Updates the metadata of this template. - * @param {EditGuildTemplateOptions} [options] Options for editing the template - * @returns {Promise} - */ - async edit({ name, description } = {}) { - const data = await this.client.api - .guilds(this.guildId) - .templates(this.code) - .patch({ data: { name, description } }); - return this._patch(data); - } - - /** - * Deletes this template. - * @returns {Promise} - */ - async delete() { - await this.client.api.guilds(this.guildId).templates(this.code).delete(); - return this; - } - - /** - * Syncs this template to the current state of the guild. - * @returns {Promise} - */ - async sync() { - const data = await this.client.api - .guilds(this.guildId) - .templates(this.code) - .put(); - return this._patch(data); - } - - /** - * The timestamp of when this template was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return this.createdAt.getTime(); - } - - /** - * The timestamp of when this template was last synced to the guild - * @type {number} - * @readonly - */ - get updatedTimestamp() { - return this.updatedAt.getTime(); - } - - /** - * The guild that this template belongs to - * @type {?Guild} - * @readonly - */ - get guild() { - return this.client.guilds.resolve(this.guildId); - } - - /** - * The URL of this template - * @type {string} - * @readonly - */ - get url() { - return `${this.client.options.http.template}/${this.code}`; - } - - /** - * When concatenated with a string, this automatically returns the template's code instead of the template object. - * @returns {string} - * @example - * // Logs: Template: FKvmczH2HyUf - * console.log(`Template: ${guildTemplate}!`); - */ - toString() { - return this.code; - } -} - -/** - * Regular expression that globally matches guild template links - * @type {RegExp} - */ -GuildTemplate.GUILD_TEMPLATES_PATTERN = - /discord(?:app)?\.(?:com\/template|new)\/([\w-]{2,255})/gi; - -module.exports = GuildTemplate; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Integration.js b/vendor/discord.js-selfbot-v13/src/structures/Integration.js deleted file mode 100644 index 2f6a60e..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Integration.js +++ /dev/null @@ -1,194 +0,0 @@ -'use strict'; - -const Base = require('./Base'); -const IntegrationApplication = require('./IntegrationApplication'); - -/** - * The information account for an integration - * @typedef {Object} IntegrationAccount - * @property {Snowflake|string} id The id of the account - * @property {string} name The name of the account - */ - -/** - * The type of an {@link Integration}. This can be: - * * `twitch` - * * `youtube` - * * `discord` - * * `guild_subscription` - * @typedef {string} IntegrationType - */ - -/** - * Represents a guild integration. - * @extends {Base} - */ -class Integration extends Base { - constructor(client, data, guild) { - super(client); - - /** - * The guild this integration belongs to - * @type {Guild} - */ - this.guild = guild; - - /** - * The integration id - * @type {Snowflake|string} - */ - this.id = data.id; - - /** - * The integration name - * @type {string} - */ - this.name = data.name; - - /** - * The integration type - * @type {IntegrationType} - */ - this.type = data.type; - - /** - * Whether this integration is enabled - * @type {boolean} - */ - this.enabled = data.enabled; - - /** - * Whether this integration is syncing - * @type {?boolean} - */ - this.syncing = data.syncing; - - /** - * The role that this integration uses for subscribers - * @type {?Role} - */ - this.role = this.guild.roles.cache.get(data.role_id); - - if ('enable_emoticons' in data) { - /** - * Whether emoticons should be synced for this integration (twitch only currently) - * @type {?boolean} - */ - this.enableEmoticons = data.enable_emoticons; - } else { - this.enableEmoticons ??= null; - } - - if (data.user) { - /** - * The user for this integration - * @type {?User} - */ - this.user = this.client.users._add(data.user); - } else { - this.user = null; - } - - /** - * The account integration information - * @type {IntegrationAccount} - */ - this.account = data.account; - - /** - * The last time this integration was last synced - * @type {?number} - */ - this.syncedAt = data.synced_at; - - if ('subscriber_count' in data) { - /** - * How many subscribers this integration has - * @type {?number} - */ - this.subscriberCount = data.subscriber_count; - } else { - this.subscriberCount ??= null; - } - - if ('revoked' in data) { - /** - * Whether this integration has been revoked - * @type {?boolean} - */ - this.revoked = data.revoked; - } else { - this.revoked ??= null; - } - - this._patch(data); - } - - /** - * All roles that are managed by this integration - * @type {Collection} - * @readonly - */ - get roles() { - const roles = this.guild.roles.cache; - return roles.filter((role) => role.tags?.integrationId === this.id); - } - - _patch(data) { - if ('expire_behavior' in data) { - /** - * The behavior of expiring subscribers - * @type {?number} - */ - this.expireBehavior = data.expire_behavior; - } - - if ('expire_grace_period' in data) { - /** - * The grace period before expiring subscribers - * @type {?number} - */ - this.expireGracePeriod = data.expire_grace_period; - } - - if ('application' in data) { - if (this.application) { - this.application._patch(data.application); - } else { - /** - * The application for this integration - * @type {?IntegrationApplication} - */ - this.application = new IntegrationApplication( - this.client, - data.application, - ); - } - } else { - this.application ??= null; - } - } - - /** - * Deletes this integration. - * @returns {Promise} - * @param {string} [reason] Reason for deleting this integration - */ - async delete(reason) { - await this.client.api - .guilds(this.guild.id) - .integrations(this.id) - .delete({ reason }); - return this; - } - - toJSON() { - return super.toJSON({ - role: 'roleId', - guild: 'guildId', - user: 'userId', - }); - } -} - -module.exports = Integration; diff --git a/vendor/discord.js-selfbot-v13/src/structures/IntegrationApplication.js b/vendor/discord.js-selfbot-v13/src/structures/IntegrationApplication.js deleted file mode 100644 index 61cb199..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/IntegrationApplication.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -const Application = require('./interfaces/Application'); - -/** - * Represents an Integration's OAuth2 Application. - * @extends {Application} - */ -class IntegrationApplication extends Application { - _patch(data) { - super._patch(data); - - if ('bot' in data) { - /** - * The bot user for this application - * @type {?User} - */ - this.bot = this.client.users._add(data.bot); - } else { - this.bot ??= null; - } - - if ('terms_of_service_url' in data) { - /** - * The URL of the application's terms of service - * @type {?string} - */ - this.termsOfServiceURL = data.terms_of_service_url; - } else { - this.termsOfServiceURL ??= null; - } - - if ('privacy_policy_url' in data) { - /** - * The URL of the application's privacy policy - * @type {?string} - */ - this.privacyPolicyURL = data.privacy_policy_url; - } else { - this.privacyPolicyURL ??= null; - } - - if ('rpc_origins' in data) { - /** - * The Array of RPC origin URLs - * @type {string[]} - */ - this.rpcOrigins = data.rpc_origins; - } else { - this.rpcOrigins ??= []; - } - - if ('summary' in data) { - /** - * The application's summary - * @type {?string} - * @deprecated This property is no longer being sent by the API. - */ - this.summary = data.summary; - } else { - this.summary ??= null; - } - - if ('hook' in data) { - /** - * Whether the application can be default hooked by the client - * @type {?boolean} - */ - this.hook = data.hook; - } else { - this.hook ??= null; - } - - if ('cover_image' in data) { - /** - * The hash of the application's cover image - * @type {?string} - */ - this.cover = data.cover_image; - } else { - this.cover ??= null; - } - - if ('verify_key' in data) { - /** - * The hex-encoded key for verification in interactions and the GameSDK's GetTicket - * @type {?string} - */ - this.verifyKey = data.verify_key; - } else { - this.verifyKey ??= null; - } - } -} - -module.exports = IntegrationApplication; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Interaction.js b/vendor/discord.js-selfbot-v13/src/structures/Interaction.js deleted file mode 100644 index 1f57cb7..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Interaction.js +++ /dev/null @@ -1,318 +0,0 @@ -'use strict'; - -const Base = require('./Base'); -const { - InteractionTypes, - MessageComponentTypes, - ApplicationCommandTypes, -} = require('../util/Constants'); -const Permissions = require('../util/Permissions'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); - -/** - * Represents an interaction. - * @extends {Base} - */ -class Interaction extends Base { - constructor(client, data) { - super(client); - - /** - * The interaction's type - * @type {InteractionType} - */ - this.type = InteractionTypes[data.type]; - - /** - * The interaction's id - * @type {Snowflake} - */ - this.id = data.id; - - /** - * The interaction's token - * @type {string} - * @name Interaction#token - * @readonly - */ - Object.defineProperty(this, 'token', { value: data.token }); - - /** - * The application's id - * @type {Snowflake} - */ - this.applicationId = data.application_id; - - /** - * The id of the channel this interaction was sent in - * @type {?Snowflake} - */ - this.channelId = data.channel_id ?? null; - - /** - * The id of the guild this interaction was sent in - * @type {?Snowflake} - */ - this.guildId = data.guild_id ?? null; - - /** - * The user which sent this interaction - * @type {User} - */ - this.user = this.client.users._add(data.user ?? data.member.user); - - /** - * If this interaction was sent in a guild, the member which sent it - * @type {?(GuildMember|APIGuildMember)} - */ - this.member = data.member - ? (this.guild?.members._add(data.member) ?? data.member) - : null; - - /** - * The version - * @type {number} - */ - this.version = data.version; - - /** - * Set of permissions the application or bot has within the channel the interaction was sent from - * @type {?Readonly} - */ - this.appPermissions = data.app_permissions - ? new Permissions(data.app_permissions).freeze() - : null; - - /** - * The permissions of the member, if one exists, in the channel this interaction was executed in - * @type {?Readonly} - */ - this.memberPermissions = data.member?.permissions - ? new Permissions(data.member.permissions).freeze() - : null; - - /** - * A Discord locale string, possible values are: - * * en-US (English, US) - * * en-GB (English, UK) - * * bg (Bulgarian) - * * zh-CN (Chinese, China) - * * zh-TW (Chinese, Taiwan) - * * hr (Croatian) - * * cs (Czech) - * * da (Danish) - * * nl (Dutch) - * * fi (Finnish) - * * fr (French) - * * de (German) - * * el (Greek) - * * hi (Hindi) - * * hu (Hungarian) - * * it (Italian) - * * ja (Japanese) - * * ko (Korean) - * * lt (Lithuanian) - * * no (Norwegian) - * * pl (Polish) - * * pt-BR (Portuguese, Brazilian) - * * ro (Romanian, Romania) - * * ru (Russian) - * * es-ES (Spanish) - * * sv-SE (Swedish) - * * th (Thai) - * * tr (Turkish) - * * uk (Ukrainian) - * * vi (Vietnamese) - * @see {@link https://discord.com/developers/docs/reference#locales} - * @typedef {string} Locale - */ - - /** - * The locale of the user who invoked this interaction - * @type {Locale} - */ - this.locale = data.locale; - - /** - * The preferred locale from the guild this interaction was sent in - * @type {?Locale} - */ - this.guildLocale = data.guild_locale ?? null; - } - - /** - * The timestamp the interaction was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return SnowflakeUtil.timestampFrom(this.id); - } - - /** - * The time the interaction was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * The channel this interaction was sent in - * @type {?TextBasedChannels} - * @readonly - */ - get channel() { - return this.client.channels.cache.get(this.channelId) ?? null; - } - - /** - * The guild this interaction was sent in - * @type {?Guild} - * @readonly - */ - get guild() { - return this.client.guilds.cache.get(this.guildId) ?? null; - } - - /** - * Indicates whether this interaction is received from a guild. - * @returns {boolean} - */ - inGuild() { - return Boolean(this.guildId && this.member); - } - - /** - * Indicates whether or not this interaction is both cached and received from a guild. - * @returns {boolean} - */ - inCachedGuild() { - return Boolean(this.guild && this.member); - } - - /** - * Indicates whether or not this interaction is received from an uncached guild. - * @returns {boolean} - */ - inRawGuild() { - return Boolean(this.guildId && !this.guild && this.member); - } - - /** - * Indicates whether this interaction is a {@link BaseCommandInteraction}. - * @returns {boolean} - */ - isApplicationCommand() { - return InteractionTypes[this.type] === InteractionTypes.APPLICATION_COMMAND; - } - - /** - * Indicates whether this interaction is a {@link CommandInteraction}. - * @returns {boolean} - */ - isCommand() { - return ( - InteractionTypes[this.type] === InteractionTypes.APPLICATION_COMMAND && - typeof this.targetId === 'undefined' - ); - } - - /** - * Indicates whether this interaction is a {@link ContextMenuInteraction} - * @returns {boolean} - */ - isContextMenu() { - return ( - InteractionTypes[this.type] === InteractionTypes.APPLICATION_COMMAND && - typeof this.targetId !== 'undefined' - ); - } - - /** - * Indicates whether this interaction is a {@link ModalSubmitInteraction} - * @returns {boolean} - */ - isModalSubmit() { - return InteractionTypes[this.type] === InteractionTypes.MODAL_SUBMIT; - } - - /** - * Indicates whether this interaction is a {@link UserContextMenuInteraction} - * @returns {boolean} - */ - isUserContextMenu() { - return ( - this.isContextMenu() && - ApplicationCommandTypes[this.targetType] === ApplicationCommandTypes.USER - ); - } - - /** - * Indicates whether this interaction is a {@link MessageContextMenuInteraction} - * @returns {boolean} - */ - isMessageContextMenu() { - return ( - this.isContextMenu() && - ApplicationCommandTypes[this.targetType] === - ApplicationCommandTypes.MESSAGE - ); - } - - /** - * Indicates whether this interaction is an {@link AutocompleteInteraction} - * @returns {boolean} - */ - isAutocomplete() { - return ( - InteractionTypes[this.type] === - InteractionTypes.APPLICATION_COMMAND_AUTOCOMPLETE - ); - } - - /** - * Indicates whether this interaction is a {@link MessageComponentInteraction}. - * @returns {boolean} - */ - isMessageComponent() { - return InteractionTypes[this.type] === InteractionTypes.MESSAGE_COMPONENT; - } - - /** - * Indicates whether this interaction is a {@link ButtonInteraction}. - * @returns {boolean} - */ - isButton() { - return ( - InteractionTypes[this.type] === InteractionTypes.MESSAGE_COMPONENT && - MessageComponentTypes[this.componentType] === MessageComponentTypes.BUTTON - ); - } - - /** - * Indicates whether this interaction is a {@link SelectMenuInteraction}. - * @returns {boolean} - */ - isSelectMenu() { - return ( - InteractionTypes[this.type] === InteractionTypes.MESSAGE_COMPONENT && - MessageComponentTypes[this.componentType] === - MessageComponentTypes.SELECT_MENU - ); - } - - /** - * Indicates whether this interaction can be replied to. - * @returns {boolean} - */ - isRepliable() { - return ![ - InteractionTypes.PING, - InteractionTypes.APPLICATION_COMMAND_AUTOCOMPLETE, - ].includes(InteractionTypes[this.type]); - } -} - -module.exports = Interaction; diff --git a/vendor/discord.js-selfbot-v13/src/structures/InteractionCollector.js b/vendor/discord.js-selfbot-v13/src/structures/InteractionCollector.js deleted file mode 100644 index 0fa0cfa..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/InteractionCollector.js +++ /dev/null @@ -1,279 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const Collector = require('./interfaces/Collector'); -const { Events } = require('../util/Constants'); -const { - InteractionTypes, - MessageComponentTypes, -} = require('../util/Constants'); - -/** - * @typedef {CollectorOptions} InteractionCollectorOptions - * @property {TextBasedChannelsResolvable} [channel] The channel to listen to interactions from - * @property {MessageComponentType} [componentType] The type of component to listen for - * @property {GuildResolvable} [guild] The guild to listen to interactions from - * @property {InteractionType} [interactionType] The type of interaction to listen for - * @property {number} [max] The maximum total amount of interactions to collect - * @property {number} [maxComponents] The maximum number of components to collect - * @property {number} [maxUsers] The maximum number of users to interact - * @property {Message|APIMessage} [message] The message to listen to interactions from - */ - -/** - * Collects interactions. - * Will automatically stop if the message ({@link Client#event:messageDelete messageDelete} or - * {@link Client#event:messageDeleteBulk messageDeleteBulk}), - * channel ({@link Client#event:channelDelete channelDelete}), or - * guild ({@link Client#event:guildDelete guildDelete}) is deleted. - * Interaction collectors that do not specify `time` or `idle` may be prone to always running. - * Ensure your interaction collectors end via either of these options or manual cancellation. - * @extends {Collector} - */ -class InteractionCollector extends Collector { - /** - * @param {Client} client The client on which to collect interactions - * @param {InteractionCollectorOptions} [options={}] The options to apply to this collector - */ - constructor(client, options = {}) { - super(client, options); - - /** - * The message from which to collect interactions, if provided - * @type {?Snowflake} - */ - this.messageId = options.message?.id ?? null; - - /** - * The channel from which to collect interactions, if provided - * @type {?Snowflake} - */ - this.channelId = - this.client.channels.resolveId(options.message?.channel) ?? - options.message?.channel_id ?? - this.client.channels.resolveId(options.channel); - - /** - * The guild from which to collect interactions, if provided - * @type {?Snowflake} - */ - this.guildId = - this.client.guilds.resolveId(options.message?.guild) ?? - options.message?.guild_id ?? - this.client.guilds.resolveId(options.channel?.guild) ?? - this.client.guilds.resolveId(options.guild); - - /** - * The type of interaction to collect - * @type {?InteractionType} - */ - this.interactionType = - typeof options.interactionType === 'number' - ? InteractionTypes[options.interactionType] - : (options.interactionType ?? null); - - /** - * The type of component to collect - * @type {?MessageComponentType} - */ - this.componentType = - typeof options.componentType === 'number' - ? MessageComponentTypes[options.componentType] - : (options.componentType ?? null); - - /** - * The users that have interacted with this collector - * @type {Collection} - */ - this.users = new Collection(); - - /** - * The total number of interactions collected - * @type {number} - */ - this.total = 0; - - this.empty = this.empty.bind(this); - this.client.incrementMaxListeners(); - - const bulkDeleteListener = (messages) => { - if (messages.has(this.messageId)) this.stop('messageDelete'); - }; - - if (this.messageId) { - this._handleMessageDeletion = this._handleMessageDeletion.bind(this); - this.client.on(Events.MESSAGE_DELETE, this._handleMessageDeletion); - this.client.on(Events.MESSAGE_BULK_DELETE, bulkDeleteListener); - } - - if (this.channelId) { - this._handleChannelDeletion = this._handleChannelDeletion.bind(this); - this._handleThreadDeletion = this._handleThreadDeletion.bind(this); - this.client.on(Events.CHANNEL_DELETE, this._handleChannelDeletion); - this.client.on(Events.THREAD_DELETE, this._handleThreadDeletion); - } - - if (this.guildId) { - this._handleGuildDeletion = this._handleGuildDeletion.bind(this); - this.client.on(Events.GUILD_DELETE, this._handleGuildDeletion); - } - - this.client.on(Events.INTERACTION_CREATE, this.handleCollect); - - this.once('end', () => { - this.client.removeListener(Events.INTERACTION_CREATE, this.handleCollect); - this.client.removeListener( - Events.MESSAGE_DELETE, - this._handleMessageDeletion, - ); - this.client.removeListener( - Events.MESSAGE_BULK_DELETE, - bulkDeleteListener, - ); - this.client.removeListener( - Events.CHANNEL_DELETE, - this._handleChannelDeletion, - ); - this.client.removeListener( - Events.THREAD_DELETE, - this._handleThreadDeletion, - ); - this.client.removeListener( - Events.GUILD_DELETE, - this._handleGuildDeletion, - ); - this.client.decrementMaxListeners(); - }); - - this.on('collect', (interaction) => { - this.total++; - this.users.set(interaction.user.id, interaction.user); - }); - } - - /** - * Handles an incoming interaction for possible collection. - * @param {Interaction} interaction The interaction to possibly collect - * @returns {?Snowflake} - * @private - */ - collect(interaction) { - /** - * Emitted whenever an interaction is collected. - * @event InteractionCollector#collect - * @param {Interaction} interaction The interaction that was collected - */ - if (this.interactionType && interaction.type !== this.interactionType) - return null; - if (this.componentType && interaction.componentType !== this.componentType) - return null; - if (this.messageId && interaction.message?.id !== this.messageId) - return null; - if (this.channelId && interaction.channelId !== this.channelId) return null; - if (this.guildId && interaction.guildId !== this.guildId) return null; - - return interaction.id; - } - - /** - * Handles an interaction for possible disposal. - * @param {Interaction} interaction The interaction that could be disposed of - * @returns {?Snowflake} - */ - dispose(interaction) { - /** - * Emitted whenever an interaction is disposed of. - * @event InteractionCollector#dispose - * @param {Interaction} interaction The interaction that was disposed of - */ - if (this.type && interaction.type !== this.type) return null; - if (this.componentType && interaction.componentType !== this.componentType) - return null; - if (this.messageId && interaction.message?.id !== this.messageId) - return null; - if (this.channelId && interaction.channelId !== this.channelId) return null; - if (this.guildId && interaction.guildId !== this.guildId) return null; - - return interaction.id; - } - - /** - * Empties this interaction collector. - */ - empty() { - this.total = 0; - this.collected.clear(); - this.users.clear(); - this.checkEnd(); - } - - /** - * The reason this collector has ended with, or null if it hasn't ended yet - * @type {?string} - * @readonly - */ - get endReason() { - if (this.options.max && this.total >= this.options.max) return 'limit'; - if ( - this.options.maxComponents && - this.collected.size >= this.options.maxComponents - ) - return 'componentLimit'; - if (this.options.maxUsers && this.users.size >= this.options.maxUsers) - return 'userLimit'; - return null; - } - - /** - * Handles checking if the message has been deleted, and if so, stops the collector with the reason 'messageDelete'. - * @private - * @param {Message} message The message that was deleted - * @returns {void} - */ - _handleMessageDeletion(message) { - if (message.id === this.messageId) { - this.stop('messageDelete'); - } - } - - /** - * Handles checking if the channel has been deleted, and if so, stops the collector with the reason 'channelDelete'. - * @private - * @param {GuildChannel} channel The channel that was deleted - * @returns {void} - */ - _handleChannelDeletion(channel) { - if ( - channel.id === this.channelId || - channel.threads?.cache.has(this.channelId) - ) { - this.stop('channelDelete'); - } - } - - /** - * Handles checking if the thread has been deleted, and if so, stops the collector with the reason 'threadDelete'. - * @private - * @param {ThreadChannel} thread The thread that was deleted - * @returns {void} - */ - _handleThreadDeletion(thread) { - if (thread.id === this.channelId) { - this.stop('threadDelete'); - } - } - - /** - * Handles checking if the guild has been deleted, and if so, stops the collector with the reason 'guildDelete'. - * @private - * @param {Guild} guild The guild that was deleted - * @returns {void} - */ - _handleGuildDeletion(guild) { - if (guild.id === this.guildId) { - this.stop('guildDelete'); - } - } -} - -module.exports = InteractionCollector; diff --git a/vendor/discord.js-selfbot-v13/src/structures/InteractionWebhook.js b/vendor/discord.js-selfbot-v13/src/structures/InteractionWebhook.js deleted file mode 100644 index 6e3c7f1..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/InteractionWebhook.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -const Webhook = require('./Webhook'); - -/** - * Represents a webhook for an Interaction - * @implements {Webhook} - */ -class InteractionWebhook { - /** - * @param {Client} client The instantiating client - * @param {Snowflake} id The application's id - * @param {string} token The interaction's token - */ - constructor(client, id, token) { - /** - * The client that instantiated the interaction webhook - * @name InteractionWebhook#client - * @type {Client} - * @readonly - */ - Object.defineProperty(this, 'client', { value: client }); - this.id = id; - Object.defineProperty(this, 'token', { - value: token, - writable: true, - configurable: true, - }); - } - - // These are here only for documentation purposes - they are implemented by Webhook - /* eslint-disable no-empty-function, valid-jsdoc */ - /** - * Sends a message with this webhook. - * @param {string|MessagePayload|InteractionReplyOptions} options The content for the reply - * @returns {Promise} - */ - send() {} - fetchMessage() {} - editMessage() {} - deleteMessage() {} - get url() {} -} - -Webhook.applyToClass(InteractionWebhook, [ - 'sendSlackMessage', - 'edit', - 'delete', - 'createdTimestamp', - 'createdAt', -]); - -module.exports = InteractionWebhook; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Invite.js b/vendor/discord.js-selfbot-v13/src/structures/Invite.js deleted file mode 100644 index 8f56fa1..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Invite.js +++ /dev/null @@ -1,378 +0,0 @@ -'use strict'; - -const Base = require('./Base'); -const { GuildScheduledEvent } = require('./GuildScheduledEvent'); -const IntegrationApplication = require('./IntegrationApplication'); -const InviteStageInstance = require('./InviteStageInstance'); -const { Error } = require('../errors'); -const { Endpoints } = require('../util/Constants'); -const InviteFlags = require('../util/InviteFlags'); -const Permissions = require('../util/Permissions'); - -// TODO: Convert `inviter` and `channel` in this class to a getter. - -/** - * Represents an invitation to a guild channel. - * @extends {Base} - */ -class Invite extends Base { - constructor(client, data) { - super(client); - this._patch(data); - } - - _patch(data) { - const InviteGuild = require('./InviteGuild'); - /** - * The guild the invite is for including welcome screen data if present - * @type {?(Guild|InviteGuild)} - */ - this.guild ??= null; - if (data.guild) { - this.guild = - this.client.guilds.cache.get(data.guild.id) ?? - new InviteGuild(this.client, data.guild); - } - - if ('code' in data) { - /** - * The code for this invite - * @type {string} - */ - this.code = data.code; - } - - if ('approximate_presence_count' in data) { - /** - * The approximate number of online members of the guild this invite is for - * This is only available when the invite was fetched through {@link Client#fetchInvite}. - * @type {?number} - */ - this.presenceCount = data.approximate_presence_count; - } else { - this.presenceCount ??= null; - } - - if ('approximate_member_count' in data) { - /** - * The approximate total number of members of the guild this invite is for - * This is only available when the invite was fetched through {@link Client#fetchInvite}. - * @type {?number} - */ - this.memberCount = data.approximate_member_count; - } else { - this.memberCount ??= null; - } - - if ('temporary' in data) { - /** - * Whether or not this invite only grants temporary membership - * This is only available when the invite was fetched through {@link GuildInviteManager#fetch} - * or created through {@link GuildInviteManager#create}. - * @type {?boolean} - */ - this.temporary = data.temporary ?? null; - } else { - this.temporary ??= null; - } - - if ('max_age' in data) { - /** - * The maximum age of the invite, in seconds, 0 if never expires - * This is only available when the invite was fetched through {@link GuildInviteManager#fetch} - * or created through {@link GuildInviteManager#create}. - * @type {?number} - */ - this.maxAge = data.max_age; - } else { - this.maxAge ??= null; - } - - if ('uses' in data) { - /** - * How many times this invite has been used - * This is only available when the invite was fetched through {@link GuildInviteManager#fetch} - * or created through {@link GuildInviteManager#create}. - * @type {?number} - */ - this.uses = data.uses; - } else { - this.uses ??= null; - } - - if ('max_uses' in data) { - /** - * The maximum uses of this invite - * This is only available when the invite was fetched through {@link GuildInviteManager#fetch} - * or created through {@link GuildInviteManager#create}. - * @type {?number} - */ - this.maxUses = data.max_uses; - } else { - this.maxUses ??= null; - } - - if ('inviter_id' in data) { - /** - * The user's id who created this invite - * @type {?Snowflake} - */ - this.inviterId = data.inviter_id; - this.inviter = this.client.users.resolve(data.inviter_id); - } else { - this.inviterId ??= null; - } - - if ('inviter' in data) { - /** - * The user who created this invite - * @type {?User} - */ - this.inviter ??= this.client.users._add(data.inviter); - this.inviterId = data.inviter.id; - } else { - this.inviter ??= null; - } - - if ('target_user' in data) { - /** - * The user whose stream to display for this voice channel stream invite - * @type {?User} - */ - this.targetUser = this.client.users._add(data.target_user); - } else { - this.targetUser ??= null; - } - - if ('target_application' in data) { - /** - * The embedded application to open for this voice channel embedded application invite - * @type {?IntegrationApplication} - */ - this.targetApplication = new IntegrationApplication( - this.client, - data.target_application, - ); - } else { - this.targetApplication ??= null; - } - - /** - * The type of the invite target: - * * 1: STREAM - * * 2: EMBEDDED_APPLICATION - * * 3: ROLE_SUBSCRIPTIONS - * * 4: CREATOR_PAGE - * @typedef {number} TargetType - * @see {@link https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types} - */ - - if ('target_type' in data) { - /** - * The target type - * @type {?TargetType} - */ - this.targetType = data.target_type; - } else { - this.targetType ??= null; - } - - /** - * The type of the invite: - * * 0: GUILD - * * 1: GROUP_DM - * * 2: FRIEND - * @typedef {number} InviteType - * @see {@link https://docs.discord.food/resources/invite#invite-type} - */ - if ('type' in data) { - /** - * The type of invite - * @type {?InviteType} - */ - this.type = data.type; - } else { - this.type ??= null; - } - - if ('channel_id' in data) { - /** - * The channel's id this invite is for - * @type {?Snowflake} - */ - this.channelId = data.channel_id; - this.channel = this.client.channels.cache.get(data.channel_id); - } - - if ('channel' in data && data.channel !== null) { - /** - * The channel this invite is for - * @type {?Channel} - */ - this.channel ??= this.client.channels._add(data.channel, this.guild, { - cache: false, - }); - this.channelId ??= data.channel.id; - } - - if ('created_at' in data) { - /** - * The timestamp this invite was created at - * @type {?number} - */ - this.createdTimestamp = new Date(data.created_at).getTime(); - } else { - this.createdTimestamp ??= null; - } - - if ('expires_at' in data) { - this._expiresTimestamp = data.expires_at && Date.parse(data.expires_at); - } else { - this._expiresTimestamp ??= null; - } - - if ('stage_instance' in data) { - /** - * The stage instance data if there is a public {@link StageInstance} in the stage channel this invite is for - * @type {?InviteStageInstance} - */ - this.stageInstance = new InviteStageInstance( - this.client, - data.stage_instance, - this.channel.id, - this.guild.id, - ); - } else { - this.stageInstance ??= null; - } - - if ('guild_scheduled_event' in data) { - /** - * The guild scheduled event data if there is a {@link GuildScheduledEvent} in the channel this invite is for - * @type {?GuildScheduledEvent} - */ - this.guildScheduledEvent = new GuildScheduledEvent( - this.client, - data.guild_scheduled_event, - ); - } else { - this.guildScheduledEvent ??= null; - } - - if ('flags' in data) { - /** - * The flags that are applied to the invite. - * @type {?Readonly} - */ - this.flags = new InviteFlags(data.flags).freeze(); - } else { - this.flags ??= new InviteFlags().freeze(); - } - } - - /** - * The time the invite was created at - * @type {?Date} - * @readonly - */ - get createdAt() { - return this.createdTimestamp ? new Date(this.createdTimestamp) : null; - } - - /** - * Whether the invite is deletable by the client user - * @type {boolean} - * @readonly - */ - get deletable() { - const guild = this.guild; - if (!guild || !this.client.guilds.cache.has(guild.id)) return false; - if (!guild.members.me) throw new Error('GUILD_UNCACHED_ME'); - return ( - this.channel - .permissionsFor(this.client.user) - .has(Permissions.FLAGS.MANAGE_CHANNELS, false) || - guild.members.me.permissions.has(Permissions.FLAGS.MANAGE_GUILD) - ); - } - - /** - * The timestamp the invite will expire at - * @type {?number} - * @readonly - */ - get expiresTimestamp() { - return ( - this._expiresTimestamp ?? - (this.createdTimestamp && this.maxAge - ? this.createdTimestamp + this.maxAge * 1_000 - : null) - ); - } - - /** - * The time the invite will expire at - * @type {?Date} - * @readonly - */ - get expiresAt() { - const { expiresTimestamp } = this; - return expiresTimestamp ? new Date(expiresTimestamp) : null; - } - - /** - * The URL to the invite - * @type {string} - * @readonly - */ - get url() { - return Endpoints.invite(this.client.options.http.invite, this.code); - } - - /** - * Deletes this invite. - * @param {string} [reason] Reason for deleting this invite - * @returns {Promise} - */ - async delete(reason) { - await this.client.api.invites[this.code].delete({ reason }); - return this; - } - - /** - * When concatenated with a string, this automatically concatenates the invite's URL instead of the object. - * @returns {string} - * @example - * // Logs: Invite: https://discord.gg/A1b2C3 - * console.log(`Invite: ${invite}`); - */ - toString() { - return this.url; - } - - toJSON() { - return super.toJSON({ - url: true, - expiresTimestamp: true, - presenceCount: false, - memberCount: false, - uses: false, - channel: 'channelId', - inviter: 'inviterId', - guild: 'guildId', - }); - } - - valueOf() { - return this.code; - } -} - -/** - * Regular expression that globally matches Discord invite links - * @type {RegExp} - */ -Invite.INVITES_PATTERN = - /discord(?:(?:app)?\.com\/invite|\.gg(?:\/invite)?)\/([\w-]{2,255})/gi; - -module.exports = Invite; diff --git a/vendor/discord.js-selfbot-v13/src/structures/InviteGuild.js b/vendor/discord.js-selfbot-v13/src/structures/InviteGuild.js deleted file mode 100644 index 11d72e8..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/InviteGuild.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -const AnonymousGuild = require('./AnonymousGuild'); -const WelcomeScreen = require('./WelcomeScreen'); - -/** - * Represents a guild received from an invite, includes welcome screen data if available. - * @extends {AnonymousGuild} - */ -class InviteGuild extends AnonymousGuild { - constructor(client, data) { - super(client, data); - - /** - * The welcome screen for this invite guild - * @type {?WelcomeScreen} - */ - this.welcomeScreen = - typeof data.welcome_screen !== 'undefined' - ? new WelcomeScreen(this, data.welcome_screen) - : null; - } -} - -module.exports = InviteGuild; diff --git a/vendor/discord.js-selfbot-v13/src/structures/InviteStageInstance.js b/vendor/discord.js-selfbot-v13/src/structures/InviteStageInstance.js deleted file mode 100644 index 73db63a..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/InviteStageInstance.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const Base = require('./Base'); - -/** - * Represents the data about a public {@link StageInstance} in an {@link Invite}. - * @extends {Base} - */ -class InviteStageInstance extends Base { - constructor(client, data, channelId, guildId) { - super(client); - - /** - * The id of the stage channel this invite is for - * @type {Snowflake} - */ - this.channelId = channelId; - - /** - * The stage channel's guild id - * @type {Snowflake} - */ - this.guildId = guildId; - - /** - * The members speaking in the stage channel - * @type {Collection} - */ - this.members = new Collection(); - - this._patch(data); - } - - _patch(data) { - if ('topic' in data) { - /** - * The topic of the stage instance - * @type {string} - */ - this.topic = data.topic; - } - - if ('participant_count' in data) { - /** - * The number of users in the stage channel - * @type {number} - */ - this.participantCount = data.participant_count; - } - - if ('speaker_count' in data) { - /** - * The number of users speaking in the stage channel - * @type {number} - */ - this.speakerCount = data.speaker_count; - } - - this.members.clear(); - for (const rawMember of data.members) { - const member = this.guild.members._add(rawMember); - this.members.set(member.id, member); - } - } - - /** - * The stage channel this invite is for - * @type {?StageChannel} - * @readonly - */ - get channel() { - return this.client.channels.resolve(this.channelId); - } - - /** - * The guild of the stage channel this invite is for - * @type {?Guild} - * @readonly - */ - get guild() { - return this.client.guilds.resolve(this.guildId); - } -} - -module.exports = InviteStageInstance; diff --git a/vendor/discord.js-selfbot-v13/src/structures/MediaChannel.js b/vendor/discord.js-selfbot-v13/src/structures/MediaChannel.js deleted file mode 100644 index 5b21c41..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/MediaChannel.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const ThreadOnlyChannel = require('./ThreadOnlyChannel'); - -/** - * Represents a media channel. - * @extends {ThreadOnlyChannel} - */ -class MediaChannel extends ThreadOnlyChannel {} - -module.exports = MediaChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/MediaGalleryComponent.js b/vendor/discord.js-selfbot-v13/src/structures/MediaGalleryComponent.js deleted file mode 100644 index 5033ef7..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/MediaGalleryComponent.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -const BaseMessageComponent = require('./BaseMessageComponent'); -const MediaGalleryItem = require('./MediaGalleryItem'); -const { MessageComponentTypes } = require('../util/Constants'); - -class MediaGalleryComponent extends BaseMessageComponent { - /** - * @property {MediaGalleryItem[]} [items] 1 to 10 media gallery items - */ - - /** - * @param {MediaGalleryComponent | APIMediaGalleryComponent} [data={}] The data - */ - constructor(data = {}) { - super({ type: 'MEDIA_GALLERY' }); - - this.setup(data); - } - - setup(data) { - super.setup(data); - /** - * 1 to 10 media gallery items - * @type {MediaGalleryItem[]} - */ - this.items = data.items?.map((item) => new MediaGalleryItem(item)) ?? []; - } - - /** - * @returns {APIMediaGalleryComponent} - */ - toJSON() { - return { - type: MessageComponentTypes[this.type], - items: this.items.map((c) => c.toJSON()), - }; - } -} - -module.exports = MediaGalleryComponent; diff --git a/vendor/discord.js-selfbot-v13/src/structures/MediaGalleryItem.js b/vendor/discord.js-selfbot-v13/src/structures/MediaGalleryItem.js deleted file mode 100644 index 4d145c8..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/MediaGalleryItem.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -const UnfurledMediaItem = require('./UnfurledMediaItem'); - -class MediaGalleryItem { - /** - * @property {UnfurledMediaItem} [media] A url or attachment - * @property {String} [description] Alt text for the media, max 1024 characters - * @property {Boolean} [spoiler] Whether the media should be a spoiler (or blurred out). Defaults to false - */ - - /** - * @param {MediaGalleryItem | APIMediaGalleryItem} [data={}] The data - */ - constructor(data = {}) { - /** - * A url or attachment - * @type {UnfurledMediaItem} - */ - this.media = new UnfurledMediaItem(data.media); - - /** - * Alt text for the media, max 1024 characters - * @type {String} - */ - this.description = data.description ?? null; - - /** - * Whether the media should be a spoiler (or blurred out). Defaults to false - * @type {Boolean} - */ - this.spoiler = data.spoiler ?? false; - } - - /** - * @returns {APIMediaGalleryItem} - */ - toJSON() { - return { - media: this.media.toJSON(), - description: this.description, - spoiler: this.spoiler, - }; - } -} - -module.exports = MediaGalleryItem; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Message.js b/vendor/discord.js-selfbot-v13/src/structures/Message.js deleted file mode 100644 index 88dea1a..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Message.js +++ /dev/null @@ -1,1322 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const { Collection } = require('@discordjs/collection'); -const Base = require('./Base'); -const BaseMessageComponent = require('./BaseMessageComponent'); -const MessageAttachment = require('./MessageAttachment'); -const Embed = require('./MessageEmbed'); -const Mentions = require('./MessageMentions'); -const MessagePayload = require('./MessagePayload'); -const { Poll } = require('./Poll'); -const ReactionCollector = require('./ReactionCollector'); -const { Sticker } = require('./Sticker'); -const Application = require('./interfaces/Application'); -const { Error } = require('../errors'); -const ReactionManager = require('../managers/ReactionManager'); -const { - InteractionTypes, - MessageTypes, - SystemMessageTypes, - MessageComponentTypes, - MessageReferenceTypes, -} = require('../util/Constants'); -const MessageFlags = require('../util/MessageFlags'); -const Permissions = require('../util/Permissions'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); -const Util = require('../util/Util'); - -/** - * @type {WeakSet} - * @private - * @internal - */ -const deletedMessages = new WeakSet(); -let deprecationEmittedForDeleted = false; - -/** - * Represents a message on Discord. - * @extends {Base} - */ -class Message extends Base { - constructor(client, data) { - super(client); - - /** - * The id of the channel the message was sent in - * @type {Snowflake} - */ - this.channelId = data.channel_id; - - /** - * The id of the guild the message was sent in, if any - * @type {?Snowflake} - */ - this.guildId = data.guild_id ?? this.channel?.guild?.id ?? null; - - this._patch(data); - } - - _patch(data) { - /** - * The message's id - * @type {Snowflake} - */ - this.id = data.id; - - if ('position' in data) { - /** - * A generally increasing integer (there may be gaps or duplicates) that represents - * the approximate position of the message in a thread. - * @type {?number} - */ - this.position = data.position; - } else { - this.position ??= null; - } - - /** - * The timestamp the message was sent at - * @type {number} - */ - this.createdTimestamp = this.id - ? SnowflakeUtil.timestampFrom(this.id) - : new Date(data.timestamp).getTime(); - - if ('type' in data) { - /** - * The type of the message - * @type {?MessageType} - */ - this.type = MessageTypes[data.type]; - - /** - * Whether or not this message was sent by Discord, not actually a user (e.g. pin notifications) - * @type {?boolean} - */ - this.system = SystemMessageTypes.includes(this.type); - } else { - this.system ??= null; - this.type ??= null; - } - - if ('content' in data) { - /** - * The content of the message - * @type {?string} - */ - this.content = data.content; - } else { - this.content ??= null; - } - - if ('author' in data) { - /** - * The author of the message - * @type {?User} - */ - this.author = this.client.users._add(data.author, !data.webhook_id); - } else { - this.author ??= null; - } - - if ('pinned' in data) { - /** - * Whether or not this message is pinned - * @type {?boolean} - */ - this.pinned = Boolean(data.pinned); - } else { - this.pinned ??= null; - } - - if ('tts' in data) { - /** - * Whether or not the message was Text-To-Speech - * @type {?boolean} - */ - this.tts = data.tts; - } else { - this.tts ??= null; - } - - if ('nonce' in data) { - /** - * A random number or string used for checking message delivery - * This is only received after the message was sent successfully, and - * lost if re-fetched - * @type {?string} - */ - this.nonce = data.nonce; - } else { - this.nonce ??= null; - } - - if ('embeds' in data) { - /** - * A list of embeds in the message - e.g. YouTube Player - * @type {MessageEmbed[]} - */ - this.embeds = data.embeds.map((e) => new Embed(e, true)); - } else { - this.embeds = this.embeds?.slice() ?? []; - } - - /** - * @typedef {MessageActionRow|ContainerComponent|FileComponent|MediaGalleryComponent|SectionComponent|SeparatorComponent|TextDisplayComponent} TopLevelComponent - */ - - if ('components' in data) { - /** - * An array of components in the message - * @type {TopLevelComponent[]} - */ - this.components = data.components.map((c) => - BaseMessageComponent.create(c, this.client), - ); - } else { - this.components = this.components?.slice() ?? []; - } - - if ('attachments' in data) { - /** - * A collection of attachments in the message - e.g. Pictures - mapped by their ids - * @type {Collection} - */ - this.attachments = new Collection(); - if (data.attachments) { - for (const attachment of data.attachments) { - this.attachments.set( - attachment.id, - new MessageAttachment( - attachment.url, - attachment.filename, - attachment, - ), - ); - } - } - } else { - this.attachments = new Collection(this.attachments); - } - - if ('sticker_items' in data || 'stickers' in data) { - /** - * A collection of stickers in the message - * @type {Collection} - */ - this.stickers = new Collection( - (data.sticker_items ?? data.stickers)?.map((s) => [ - s.id, - new Sticker(this.client, s), - ]), - ); - } else { - this.stickers = new Collection(this.stickers); - } - - // Discord sends null if the message has not been edited - if (data.edited_timestamp) { - /** - * The timestamp the message was last edited at (if applicable) - * @type {?number} - */ - this.editedTimestamp = data.edited_timestamp - ? Date.parse(data.edited_timestamp) - : null; - } else { - this.editedTimestamp ??= null; - } - - if ('reactions' in data) { - /** - * A manager of the reactions belonging to this message - * @type {ReactionManager} - */ - this.reactions = new ReactionManager(this); - if (data.reactions?.length > 0) { - for (const reaction of data.reactions) { - this.reactions._add(reaction); - } - } - } else { - this.reactions ??= new ReactionManager(this); - } - - if (!this.mentions) { - /** - * All valid mentions that the message contains - * @type {MessageMentions} - */ - this.mentions = new Mentions( - this, - data.mentions, - data.mention_roles, - data.mention_everyone, - data.mention_channels, - data.referenced_message?.author, - ); - } else { - this.mentions = new Mentions( - this, - data.mentions ?? this.mentions.users, - data.mention_roles ?? this.mentions.roles, - data.mention_everyone ?? this.mentions.everyone, - data.mention_channels ?? this.mentions.crosspostedChannels, - data.referenced_message?.author ?? this.mentions.repliedUser, - ); - } - - if ('webhook_id' in data) { - /** - * The id of the webhook that sent the message, if applicable - * @type {?Snowflake} - */ - this.webhookId = data.webhook_id; - } else { - this.webhookId ??= null; - } - - if (data.poll) { - /** - * The poll that was sent with the message - * @type {?Poll} - */ - this.poll = new Poll(this.client, data.poll, this); - } else { - this.poll ??= null; - } - - if ('application' in data) { - /** - * Supplemental application information for group activities - * @type {?Application} - */ - this.groupActivityApplication = new Application( - this.client, - data.application, - ); - } else { - this.groupActivityApplication ??= null; - } - - if ('application_id' in data) { - /** - * The id of the application of the interaction that sent this message, if any - * @type {?Snowflake} - */ - this.applicationId = data.application_id; - } else { - this.applicationId ??= null; - } - - if ('activity' in data) { - /** - * Group activity - * @type {?MessageActivity} - */ - this.activity = { - partyId: data.activity.party_id, - type: data.activity.type, - }; - } else { - this.activity ??= null; - } - - if ('thread' in data) { - this.client.channels._add(data.thread, this.guild); - } - - if (this.member && data.member) { - this.member._patch(data.member); - } else if (data.member && this.guild && this.author) { - this.guild.members._add( - Object.assign(data.member, { user: this.author }), - ); - } - - if ('flags' in data) { - /** - * Flags that are applied to the message - * @type {Readonly} - */ - this.flags = new MessageFlags(data.flags).freeze(); - } else { - this.flags = new MessageFlags(this.flags).freeze(); - } - - /** - * Reference data sent in a message that contains ids identifying the referenced message. - * This can be present in the following types of message: - * * Crossposted messages (IS_CROSSPOST {@link MessageFlags.FLAGS message flag}) - * * CHANNEL_FOLLOW_ADD - * * CHANNEL_PINNED_MESSAGE - * * REPLY - * * THREAD_STARTER_MESSAGE - * @see {@link https://discord.com/developers/docs/resources/channel#message-types} - * @typedef {Object} MessageReference - * @property {Snowflake} channelId The channel's id the message was referenced - * @property {?Snowflake} guildId The guild's id the message was referenced - * @property {?Snowflake} messageId The message's id that was referenced - * @property {MessageReferenceType} type The type of the message reference - */ - - if ('message_reference' in data) { - /** - * Message reference data - * @type {?MessageReference} - */ - this.reference = { - channelId: data.message_reference.channel_id, - guildId: data.message_reference.guild_id, - messageId: data.message_reference.message_id, - type: MessageReferenceTypes[data.message_reference.type ?? 0], - }; - } else { - this.reference ??= null; - } - - if (data.referenced_message) { - this.channel?.messages._add({ - guild_id: data.message_reference?.guild_id, - ...data.referenced_message, - }); - } - - /** - * Partial data of the interaction that a message is a reply to - * @typedef {Object} MessageInteraction - * @property {Snowflake} id The interaction's id - * @property {InteractionType} type The type of the interaction - * @property {string} commandName The name of the interaction's application command, - * as well as the subcommand and subcommand group, where applicable - * @property {User} user The user that invoked the interaction - */ - - if (data.interaction) { - /** - * Partial data of the interaction that this message is a reply to - * @type {?MessageInteraction} - */ - this.interaction = { - id: data.interaction.id, - type: InteractionTypes[data.interaction.type], - commandName: data.interaction.name, - user: this.client.users._add(data.interaction.user), - }; - } else { - this.interaction ??= null; - } - - if (data.message_snapshots) { - /** - * The message snapshots associated with the message reference - * @type {Collection} - */ - this.messageSnapshots = data.message_snapshots.reduce( - (coll, snapshot) => { - const channel = this.client.channels.cache.get( - this.reference.channelId, - ); - const snapshotData = { - ...snapshot.message, - id: this.reference.messageId, - channel_id: this.reference.channelId, - guild_id: this.reference.guildId, - }; - - return coll.set( - this.reference.messageId, - channel - ? channel.messages._add(snapshotData) - : new this.constructor(this.client, snapshotData), - ); - }, - new Collection(), - ); - } else { - this.messageSnapshots ??= new Collection(); - } - - /** - * A call associated with a message - * @typedef {Object} MessageCall - * @property {Readonly} endedAt The time the call ended - * @property {?number} endedTimestamp The timestamp the call ended - * @property {Snowflake[]} participants The ids of the users that participated in the call - */ - - if (data.call) { - /** - * The call associated with the message - * @type {?MessageCall} - */ - this.call = { - endedTimestamp: data.call.ended_timestamp - ? Date.parse(data.call.ended_timestamp) - : null, - participants: data.call.participants, - get endedAt() { - return this.endedTimestamp && new Date(this.endedTimestamp); - }, - }; - } else { - this.call ??= null; - } - } - - /** - * Whether or not the structure has been deleted - * @type {boolean} - * @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 - */ - get deleted() { - if (!deprecationEmittedForDeleted) { - deprecationEmittedForDeleted = true; - process.emitWarning( - 'Message#deleted is deprecated, see https://github.com/discordjs/discord.js/issues/7091.', - 'DeprecationWarning', - ); - } - - return deletedMessages.has(this); - } - - set deleted(value) { - if (!deprecationEmittedForDeleted) { - deprecationEmittedForDeleted = true; - process.emitWarning( - 'Message#deleted is deprecated, see https://github.com/discordjs/discord.js/issues/7091.', - 'DeprecationWarning', - ); - } - - if (value) deletedMessages.add(this); - else deletedMessages.delete(this); - } - - /** - * The channel that the message was sent in - * @type {TextBasedChannels} - * @readonly - */ - get channel() { - return this.client.channels.cache.get(this.channelId) ?? null; - } - - /** - * Whether or not this message is a partial - * @type {boolean} - * @readonly - */ - get partial() { - return typeof this.content !== 'string' || !this.author; - } - - /** - * Represents the author of the message as a guild member. - * Only available if the message comes from a guild where the author is still a member - * @type {?GuildMember} - * @readonly - */ - get member() { - return this.guild?.members.resolve(this.author) ?? null; - } - - /** - * The time the message was sent at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * The time the message was last edited at (if applicable) - * @type {?Date} - * @readonly - */ - get editedAt() { - return this.editedTimestamp ? new Date(this.editedTimestamp) : null; - } - - /** - * The guild the message was sent in (if in a guild channel) - * @type {?Guild} - * @readonly - */ - get guild() { - return ( - this.client.guilds.cache.get(this.guildId) ?? this.channel?.guild ?? null - ); - } - - /** - * Whether this message has a thread associated with it - * @type {boolean} - * @readonly - */ - get hasThread() { - return this.flags.has(MessageFlags.FLAGS.HAS_THREAD); - } - - /** - * The thread started by this message - * This property is not suitable for checking whether a message has a thread, - * use {@link Message#hasThread} instead. - * @type {?ThreadChannel} - * @readonly - */ - get thread() { - return this.channel?.threads?.cache.get(this.id) ?? null; - } - - /** - * The URL to jump to this message - * @type {string} - * @readonly - */ - get url() { - return `https://discord.com/channels/${this.guildId ?? '@me'}/${this.channelId}/${this.id}`; - } - - /** - * The message contents with all mentions replaced by the equivalent text. - * If mentions cannot be resolved to a name, the relevant mention in the message content will not be converted. - * @type {?string} - * @readonly - */ - get cleanContent() { - // eslint-disable-next-line eqeqeq - return this.content != null && this.channel - ? Util.cleanContent(this.content, this.channel) - : null; - } - - /** - * Creates a reaction collector. - * @param {ReactionCollectorOptions} [options={}] Options to send to the collector - * @returns {ReactionCollector} - * @example - * // Create a reaction collector - * const filter = (reaction, user) => reaction.emoji.name === '👌' && user.id === 'someId'; - * const collector = message.createReactionCollector({ filter, time: 15_000 }); - * collector.on('collect', r => console.log(`Collected ${r.emoji.name}`)); - * collector.on('end', collected => console.log(`Collected ${collected.size} items`)); - */ - createReactionCollector(options = {}) { - return new ReactionCollector(this, options); - } - - /** - * An object containing the same properties as CollectorOptions, but a few more: - * @typedef {ReactionCollectorOptions} AwaitReactionsOptions - * @property {string[]} [errors] Stop/end reasons that cause the promise to reject - */ - - /** - * Similar to createReactionCollector but in promise form. - * Resolves with a collection of reactions that pass the specified filter. - * @param {AwaitReactionsOptions} [options={}] Optional options to pass to the internal collector - * @returns {Promise>} - * @example - * // Create a reaction collector - * const filter = (reaction, user) => reaction.emoji.name === '👌' && user.id === 'someId' - * message.awaitReactions({ filter, time: 15_000 }) - * .then(collected => console.log(`Collected ${collected.size} reactions`)) - * .catch(console.error); - */ - awaitReactions(options = {}) { - return new Promise((resolve, reject) => { - const collector = this.createReactionCollector(options); - collector.once('end', (reactions, reason) => { - if (options.errors?.includes(reason)) reject(reactions); - else resolve(reactions); - }); - }); - } - - /** - * Whether the message is editable by the client user - * @type {boolean} - * @readonly - */ - get editable() { - const precheck = Boolean( - this.author.id === this.client.user.id && - !deletedMessages.has(this) && - (!this.guild || this.channel?.viewable) && - this.reference?.type !== 'FORWARD', - ); - - // Regardless of permissions thread messages cannot be edited if - // the thread is archived or the thread is locked and the bot does not have permission to manage threads. - if (this.channel?.isThread()) { - if (this.channel.archived) return false; - if (this.channel.locked) { - const permissions = this.channel.permissionsFor(this.client.user); - if (!permissions?.has(Permissions.FLAGS.MANAGE_THREADS, true)) - return false; - } - } - - return precheck; - } - - /** - * Whether the message is deletable by the client user - * @type {boolean} - * @readonly - */ - get deletable() { - if (deletedMessages.has(this)) { - return false; - } - if (!this.guild) { - return this.author.id === this.client.user.id; - } - // DMChannel does not have viewable property, so check viewable after proved that message is on a guild. - if (!this.channel?.viewable) { - return false; - } - - const permissions = this.channel?.permissionsFor(this.client.user); - if (!permissions) return false; - // This flag allows deleting even if timed out - if (permissions.has(Permissions.FLAGS.ADMINISTRATOR, false)) return true; - - return Boolean( - this.author.id === this.client.user.id || - (permissions.has(Permissions.FLAGS.MANAGE_MESSAGES, false) && - this.guild.members.me.communicationDisabledUntilTimestamp < - Date.now()), - ); - } - - /** - * Whether the message is bulk deletable by the client user - * @type {boolean} - * @readonly - * @example - * // Filter for bulk deletable messages - * channel.bulkDelete(messages.filter(message => message.bulkDeletable)); - */ - get bulkDeletable() { - return false; - } - - /** - * Whether the message is pinnable by the client user - * @type {boolean} - * @readonly - */ - get pinnable() { - const { channel } = this; - return Boolean( - !this.system && - !deletedMessages.has(this) && - (!this.guild || - (channel?.viewable && - channel - ?.permissionsFor(this.client.user) - ?.has(Permissions.FLAGS.MANAGE_MESSAGES, false))), - ); - } - - /** - * Fetches the Message this crosspost/reply/pin-add references, if available to the client - * @returns {Promise} - */ - async fetchReference() { - if (!this.reference) throw new Error('MESSAGE_REFERENCE_MISSING'); - const { channelId, messageId } = this.reference; - if (!messageId) throw new Error('MESSAGE_REFERENCE_MISSING'); - const channel = this.client.channels.resolve(channelId); - if (!channel) throw new Error('GUILD_CHANNEL_RESOLVE'); - const message = await channel.messages.fetch(messageId); - return message; - } - - /** - * Whether the message is crosspostable by the client user - * @type {boolean} - * @readonly - */ - get crosspostable() { - const bitfield = - Permissions.FLAGS.SEND_MESSAGES | - (this.author.id === this.client.user.id - ? Permissions.defaultBit - : Permissions.FLAGS.MANAGE_MESSAGES); - const { channel } = this; - return Boolean( - channel?.type === 'GUILD_NEWS' && - !this.flags.has(MessageFlags.FLAGS.CROSSPOSTED) && - this.reference?.type !== 'FORWARD' && - this.type === 'DEFAULT' && - !this.poll && - channel.viewable && - channel.permissionsFor(this.client.user)?.has(bitfield, false) && - !deletedMessages.has(this), - ); - } - - /** - * Options that can be passed into {@link Message#edit}. - * @typedef {Object} MessageEditOptions - * @property {?string} [content] Content to be edited - * @property {MessageEmbed[]|APIEmbed[]} [embeds] Embeds to be added/edited - * @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content - * @property {MessageFlags} [flags] Which flags to set for the message. Only `SUPPRESS_EMBEDS` can be edited. - * @property {MessageAttachment[]} [attachments] An array of attachments to keep, - * all attachments will be kept if omitted - * @property {FileOptions[]|BufferResolvable[]|MessageAttachment[]} [files] Files to add to the message - * @property {MessageActionRow[]|MessageActionRowOptions[]} [components] - * Action rows containing interactive components for the message (buttons, select menus) - */ - - /** - * Edits the content of the message. - * @param {string|MessagePayload|MessageEditOptions} options The options to provide - * @returns {Promise} - * @example - * // Update the content of a message - * message.edit('This is my new content!') - * .then(msg => console.log(`Updated the content of a message to ${msg.content}`)) - * .catch(console.error); - */ - async edit(options) { - if (!this.channel) throw new Error('CHANNEL_NOT_CACHED'); - return this.channel.messages.edit(this, options); - } - - /** - * Publishes a message in an announcement channel to all channels following it. - * @returns {Promise} - * @example - * // Crosspost a message - * if (message.channel.type === 'GUILD_NEWS') { - * message.crosspost() - * .then(() => console.log('Crossposted message')) - * .catch(console.error); - * } - */ - async crosspost() { - if (!this.channel) throw new Error('CHANNEL_NOT_CACHED'); - return this.channel.messages.crosspost(this.id); - } - - /** - * Pins this message to the channel's pinned messages. - * @param {string} [reason] Reason for pinning - * @returns {Promise} - * @example - * // Pin a message - * message.pin() - * .then(console.log) - * .catch(console.error) - */ - async pin(reason) { - if (!this.channel) throw new Error('CHANNEL_NOT_CACHED'); - await this.channel.messages.pin(this.id, reason); - return this; - } - - /** - * Unpins this message from the channel's pinned messages. - * @param {string} [reason] Reason for unpinning - * @returns {Promise} - * @example - * // Unpin a message - * message.unpin() - * .then(console.log) - * .catch(console.error) - */ - async unpin(reason) { - if (!this.channel) throw new Error('CHANNEL_NOT_CACHED'); - await this.channel.messages.unpin(this.id, reason); - return this; - } - - /** - * Adds a reaction to the message. - * @param {EmojiIdentifierResolvable} emoji The emoji to react with - * @param {boolean} [burst=false] Super Reactions - * @returns {Promise} - * @example - * // React to a message with a unicode emoji - * message.react('🤔') - * .then(console.log) - * .catch(console.error); - * @example - * // React to a message with a custom emoji - * message.react(message.guild.emojis.cache.get('123456789012345678')) - * .then(console.log) - * .catch(console.error); - */ - async react(emoji, burst = false) { - if (!this.channel) throw new Error('CHANNEL_NOT_CACHED'); - await this.channel.messages.react(this.id, emoji, burst); - - return this.client.actions.MessageReactionAdd.handle( - { - [this.client.actions.injectedUser]: this.client.user, - [this.client.actions.injectedChannel]: this.channel, - [this.client.actions.injectedMessage]: this, - emoji: Util.resolvePartialEmoji(emoji), - me_burst: burst, - }, - true, - ).reaction; - } - - /** - * Deletes the message. - * @returns {Promise} - * @example - * // Delete a message - * message.delete() - * .then(msg => console.log(`Deleted message from ${msg.author.username}`)) - * .catch(console.error); - */ - async delete() { - if (!this.channel) throw new Error('CHANNEL_NOT_CACHED'); - await this.channel.messages.delete(this.id); - return this; - } - - /** - * Options provided when sending a message as an inline reply. - * @typedef {BaseMessageOptions} ReplyMessageOptions - * @property {boolean} [failIfNotExists=true] Whether to error if the referenced message - * does not exist (creates a standard message in this case when false) - * @property {StickerResolvable[]} [stickers=[]] Stickers to send in the message - */ - - /** - * Send an inline reply to this message. - * @param {string|MessagePayload|ReplyMessageOptions} options The options to provide - * @returns {Promise} - * @example - * // Reply to a message - * message.reply('This is a reply!') - * .then(() => console.log(`Replied to message "${message.content}"`)) - * .catch(console.error); - */ - async reply(options) { - if (!this.channel) throw new Error('CHANNEL_NOT_CACHED'); - let data; - - if (options instanceof MessagePayload) { - data = options; - } else { - data = MessagePayload.create(this, options, { - reply: { - messageReference: this, - failIfNotExists: - options?.failIfNotExists ?? this.client.options.failIfNotExists, - }, - }); - } - return this.channel.send(data); - } - - /** - * Forwards this message - * @param {TextBasedChannelResolvable} channel The channel to forward this message to. - * @returns {Promise} - */ - forward(channel) { - const resolvedChannel = this.client.channels.resolve(channel); - if (!resolvedChannel) - throw new Error('INVALID_TYPE', 'channel', 'TextBasedChannelResolvable'); - return resolvedChannel.send({ - forward: { - message: this.id, - channel: this.channelId, - guild: this.guildId, - }, - }); - } - - /** - * A number that is allowed to be the duration (in minutes) of inactivity after which a thread is automatically - * archived. This can be: - * * `60` (1 hour) - * * `1440` (1 day) - * * `4320` (3 days) - * * `10080` (7 days) - * * `'MAX'` (7 days) - * This option is deprecated and will be removed in the next major version. - * @typedef {number|string} ThreadAutoArchiveDuration - */ - - /** - * Options for starting a thread on a message. - * @typedef {Object} StartThreadOptions - * @property {string} name The name of the new thread - * @property {ThreadAutoArchiveDuration} [autoArchiveDuration=this.channel.defaultAutoArchiveDuration] The amount of - * time (in minutes) after which the thread should automatically archive in case of no recent activity - * @property {string} [reason] Reason for creating the thread - * @property {number} [rateLimitPerUser] The rate limit per user (slowmode) for the thread in seconds - */ - - /** - * Create a new public thread from this message - * @see GuildTextThreadManager#create - * @param {StartThreadOptions} [options] Options for starting a thread on this message - * @returns {Promise} - */ - async startThread(options = {}) { - if (!this.channel) throw new Error('CHANNEL_NOT_CACHED'); - if (!['GUILD_TEXT', 'GUILD_NEWS'].includes(this.channel.type)) { - throw new Error('MESSAGE_THREAD_PARENT'); - } - if (this.hasThread) throw new Error('MESSAGE_EXISTING_THREAD'); - return this.channel.threads.create({ ...options, startMessage: this }); - } - - /** - * Submits a poll vote for the current user. Returns a 204 empty response on success. - * @param {...number[]} ids ID of the answer - * @returns {Promise} - * @example - * // Vote multi choices - * message.vote(1,2); - * // Remove vote - * message.vote(); - */ - vote(...ids) { - return this.client.api - .channels(this.channel.id) - .polls(this.id) - .answers['@me'].put({ - data: { - answer_ids: ids.flat(1).map((value) => value.toString()), - }, - }); - } - - /** - * Fetch this message. - * @param {boolean} [force=true] Whether to skip the cache check and request the API - * @returns {Promise} - */ - async fetch(force = true) { - if (!this.channel) throw new Error('CHANNEL_NOT_CACHED'); - return this.channel.messages.fetch(this.id, { force }); - } - - /** - * Fetches the webhook used to create this message. - * @returns {Promise} - */ - async fetchWebhook() { - if (!this.webhookId) throw new Error('WEBHOOK_MESSAGE'); - if (this.webhookId === this.applicationId) - throw new Error('WEBHOOK_APPLICATION'); - return this.client.fetchWebhook(this.webhookId); - } - - /** - * Suppresses or unsuppresses embeds on a message. - * @param {boolean} [suppress=true] If the embeds should be suppressed or not - * @returns {Promise} - */ - suppressEmbeds(suppress = true) { - const flags = new MessageFlags(this.flags.bitfield); - - if (suppress) { - flags.add(MessageFlags.FLAGS.SUPPRESS_EMBEDS); - } else { - flags.remove(MessageFlags.FLAGS.SUPPRESS_EMBEDS); - } - - return this.edit({ flags }); - } - - /** - * Removes the attachments from this message. - * @returns {Promise} - */ - removeAttachments() { - return this.edit({ attachments: [] }); - } - - /** - * Resolves a component by a custom id. - * @param {string} customId The custom id to resolve against - * @returns {?MessageActionRowComponent} - */ - resolveComponent(customId) { - return ( - this.components - .flatMap(BaseMessageComponent.extractInteractiveComponents) - .find( - (component) => - (component.customId ?? component.custom_id) === customId, - ) ?? null - ); - } - - /** - * Used mainly internally. Whether two messages are identical in properties. If you want to compare messages - * without checking all the properties, use `message.id === message2.id`, which is much more efficient. This - * method allows you to see if there are differences in content, embeds, attachments, nonce and tts properties. - * @param {Message} message The message to compare it to - * @param {APIMessage} rawData Raw data passed through the WebSocket about this message - * @returns {boolean} - */ - equals(message, rawData) { - if (!message) return false; - const embedUpdate = !message.author && !message.attachments; - if (embedUpdate) - return ( - this.id === message.id && this.embeds.length === message.embeds.length - ); - - let equal = - this.id === message.id && - this.author.id === message.author.id && - this.content === message.content && - this.tts === message.tts && - this.nonce === message.nonce && - this.embeds.length === message.embeds.length && - this.attachments.size === message.attachments.size && - this.attachments.every((attachment) => - message.attachments.has(attachment.id), - ) && - this.embeds.every((embed, index) => embed.equals(message.embeds[index])); - - if (equal && rawData) { - equal = - this.mentions.everyone === message.mentions.everyone && - this.createdTimestamp === new Date(rawData.timestamp).getTime() && - this.editedTimestamp === new Date(rawData.edited_timestamp).getTime(); - } - - return equal; - } - - /** - * Whether this message is from a guild. - * @returns {boolean} - */ - inGuild() { - return Boolean(this.guildId); - } - - /** - * When concatenated with a string, this automatically concatenates the message's content instead of the object. - * @returns {string} - * @example - * // Logs: Message: This is a message! - * console.log(`Message: ${message}`); - */ - toString() { - return this.content; - } - - toJSON() { - return super.toJSON({ - channel: 'channelId', - author: 'authorId', - groupActivityApplication: 'groupActivityApplicationId', - guild: 'guildId', - cleanContent: true, - member: false, - reactions: false, - }); - } - - // TypeScript - /** - * Check data - * @type {boolean} - * @readonly - */ - get isMessage() { - return true; - } - - /** - * Click a specified button in the message based on the button's CustomID - * @param {string} buttonid customId of the button to click - * - * To be compatible with Components V2, the following methods have been removed in this version: - * - Clicking by coordinates (using ActionRow) - * - Clicking the first button in the message - * - * Currently, only clicking by CustomID is supported. - * @returns {Promise} - */ - clickButton(buttonid) { - const button = this.resolveComponent(buttonid); - if (!button || button.type !== 'BUTTON') - throw new TypeError('BUTTON_NOT_FOUND'); - if (button.disabled) throw new TypeError('BUTTON_CANNOT_CLICK'); - const nonce = SnowflakeUtil.generate(); - const data = { - type: InteractionTypes.MESSAGE_COMPONENT, - nonce, - guild_id: this.guildId, - channel_id: this.channelId, - message_id: this.id, - application_id: this.applicationId ?? this.author.id, - session_id: this.client.sessionId, - message_flags: this.flags.bitfield, - data: { - component_type: MessageComponentTypes.BUTTON, - custom_id: button.customId, - }, - }; - this.client.api.interactions.post({ - data, - }); - return Util.createPromiseInteraction(this.client, nonce, 5_000, true, this); - } - - /** - * Select specific menu - * @param {number|string} menu Target - * @param {Array} values Any value - * @returns {Promise} - */ - selectMenu(menu, values = []) { - let selectMenu = menu; - if (/[0-4]/.test(menu)) { - selectMenu = this.components[menu]?.components[0]; - } else if (typeof menu == 'string') { - selectMenu = this.components - .flatMap((row) => row.components) - .find( - (b) => - [ - 'STRING_SELECT', - 'USER_SELECT', - 'ROLE_SELECT', - 'MENTIONABLE_SELECT', - 'CHANNEL_SELECT', - ].includes(b.type) && - b.customId == menu && - !b.disabled, - ); - } - if (values.length < selectMenu.minValues) { - throw new RangeError( - `[SELECT_MENU_MIN_VALUES] The minimum number of values is ${selectMenu.minValues}`, - ); - } - if (values.length > selectMenu?.maxValues) { - throw new RangeError( - `[SELECT_MENU_MAX_VALUES] The maximum number of values is ${selectMenu.maxValues}`, - ); - } - values = values.map((value) => { - switch (selectMenu.type) { - case 'STRING_SELECT': { - return selectMenu.options.find( - (obj) => obj.value === value || obj.label === value, - ).value; - } - case 'USER_SELECT': { - return this.client.users.resolveId(value); - } - case 'ROLE_SELECT': { - return this.guild.roles.resolveId(value); - } - case 'MENTIONABLE_SELECT': { - return ( - this.client.users.resolveId(value) || - this.guild.roles.resolveId(value) - ); - } - case 'CHANNEL_SELECT': { - return this.client.channels.resolveId(value); - } - default: { - return value; - } - } - }); - const nonce = SnowflakeUtil.generate(); - const data = { - type: InteractionTypes.MESSAGE_COMPONENT, - guild_id: this.guildId, - channel_id: this.channelId, - message_id: this.id, - application_id: this.applicationId ?? this.author.id, - session_id: this.client.sessionId, - message_flags: this.flags.bitfield, - data: { - component_type: MessageComponentTypes[selectMenu.type], - custom_id: selectMenu.customId, - type: MessageComponentTypes[selectMenu.type], - values, - }, - nonce, - }; - this.client.api.interactions.post({ - data, - }); - return Util.createPromiseInteraction(this.client, nonce, 5_000, true, this); - } - - /** - * Marks the message as unread. - * @returns {Promise} - */ - markUnread() { - return this.client.api.channels[this.channelId].messages[this.id].ack.post({ - data: { - manual: true, - mention_count: 1, - }, - }); - } - - /** - * Marks the message as read. - * @returns {Promise} - */ - markRead() { - return this.client.api.channels[this.channelId].messages[this.id].ack.post({ - data: { - token: null, - }, - }); - } - - /** - * Report Message - * @param {Arrray} breadcrumbs Options for reporting - * @param {Object} [elements={}] Metadata - * @returns {Promise<{ report_id: Snowflake }>} - * @example - * // GET https://discord.com/api/v9/reporting/menu/message?variant=4 - * // Report Category - * // - MESSAGE_WELCOME (3) - * // - Something else (28) - * // - Hacks, cheats, phishing or malicious links (72) - * message.report([3, 28, 72]).then(console.log); - * // { "report_id": "1199663489988440124" } - */ - report(breadcrumbs, elements = {}) { - return this.client.api.reporting.message.post({ - data: { - version: '1.0', - variant: '4', - language: 'en', - breadcrumbs, - elements, - channel_id: this.channelId, - message_id: this.id, - name: 'message', - }, - }); - } -} - -exports.Message = Message; -exports.deletedMessages = deletedMessages; diff --git a/vendor/discord.js-selfbot-v13/src/structures/MessageActionRow.js b/vendor/discord.js-selfbot-v13/src/structures/MessageActionRow.js deleted file mode 100644 index ad773a6..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/MessageActionRow.js +++ /dev/null @@ -1,112 +0,0 @@ -'use strict'; - -const BaseMessageComponent = require('./BaseMessageComponent'); -const { MessageComponentTypes } = require('../util/Constants'); - -/** - * Represents an action row containing message components. - * @extends {BaseMessageComponent} - */ -class MessageActionRow extends BaseMessageComponent { - /** - * Components that can be placed in an action row - * * MessageButton - * * MessageSelectMenu - * * TextInputComponent - * @typedef {MessageButton|MessageSelectMenu|TextInputComponent} MessageActionRowComponent - */ - - /** - * Options for components that can be placed in an action row - * * MessageButtonOptions - * * MessageSelectMenuOptions - * * TextInputComponentOptions - * @typedef {MessageButtonOptions|MessageSelectMenuOptions|TextInputComponentOptions} MessageActionRowComponentOptions - */ - - /** - * Data that can be resolved into components that can be placed in an action row - * * MessageActionRowComponent - * * MessageActionRowComponentOptions - * @typedef {MessageActionRowComponent|MessageActionRowComponentOptions} MessageActionRowComponentResolvable - */ - - /** - * @typedef {BaseMessageComponentOptions} MessageActionRowOptions - * @property {MessageActionRowComponentResolvable[]} [components] - * The components to place in this action row - */ - - /** - * @param {MessageActionRow|MessageActionRowOptions} [data={}] MessageActionRow to clone or raw data - * @param {Client} [client] The client constructing this MessageActionRow, if provided - */ - constructor(data = {}, client = null) { - super({ type: 'ACTION_ROW' }); - - /** - * The components in this action row - * @type {MessageActionRowComponent[]} - */ - this.components = - data.components?.map((c) => BaseMessageComponent.create(c, client)) ?? []; - - super.setup(data); - } - - /** - * Adds components to the action row. - * @param {...MessageActionRowComponentResolvable[]} components The components to add - * @returns {MessageActionRow} - */ - addComponents(...components) { - this.components.push( - ...components.flat(Infinity).map((c) => BaseMessageComponent.create(c)), - ); - return this; - } - - /** - * Sets the components of the action row. - * @param {...MessageActionRowComponentResolvable[]} components The components to set - * @returns {MessageActionRow} - */ - setComponents(...components) { - this.spliceComponents(0, this.components.length, components); - return this; - } - - /** - * Removes, replaces, and inserts components in the action row. - * @param {number} index The index to start at - * @param {number} deleteCount The number of components to remove - * @param {...MessageActionRowComponentResolvable[]} [components] The replacing components - * @returns {MessageActionRow} - */ - spliceComponents(index, deleteCount, ...components) { - this.components.splice( - index, - deleteCount, - ...components.flat(Infinity).map((c) => BaseMessageComponent.create(c)), - ); - return this; - } - - /** - * Transforms the action row to a plain object. - * @returns {APIMessageComponent} The raw data of this action row - */ - toJSON() { - return { - components: this.components.map((c) => c.toJSON()), - type: MessageComponentTypes[this.type], - }; - } -} - -module.exports = MessageActionRow; - -/** - * @external APIMessageComponent - * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object} - */ diff --git a/vendor/discord.js-selfbot-v13/src/structures/MessageAttachment.js b/vendor/discord.js-selfbot-v13/src/structures/MessageAttachment.js deleted file mode 100644 index 4c3ff6f..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/MessageAttachment.js +++ /dev/null @@ -1,216 +0,0 @@ -'use strict'; - -const AttachmentFlags = require('../util/AttachmentFlags'); -const Util = require('../util/Util'); - -/** - * Represents an attachment in a message. - */ -class MessageAttachment { - /** - * @param {BufferResolvable|Stream} attachment The file - * @param {string} [name=null] The name of the file, if any - * @param {APIAttachment} [data] Extra data - */ - constructor(attachment, name = null, data) { - this.attachment = attachment; - /** - * The name of this attachment - * @type {?string} - */ - this.name = name; - if (data) this._patch(data); - } - - /** - * Sets the description of this attachment. - * @param {string} description The description of the file - * @returns {MessageAttachment} This attachment - */ - setDescription(description) { - this.description = description; - return this; - } - - /** - * Sets the file of this attachment. - * @param {BufferResolvable|Stream} attachment The file - * @param {string} [name=null] The name of the file, if any - * @returns {MessageAttachment} This attachment - */ - setFile(attachment, name = null) { - this.attachment = attachment; - this.name = name; - return this; - } - - /** - * Sets the name of this attachment. - * @param {string} name The name of the file - * @returns {MessageAttachment} This attachment - */ - setName(name) { - this.name = name; - return this; - } - - /** - * Sets whether this attachment is a spoiler - * @param {boolean} [spoiler=true] Whether the attachment should be marked as a spoiler - * @returns {MessageAttachment} This attachment - */ - setSpoiler(spoiler = true) { - if (spoiler === this.spoiler) return this; - - if (!spoiler) { - while (this.spoiler) { - this.name = this.name.slice('SPOILER_'.length); - } - return this; - } - this.name = `SPOILER_${this.name}`; - return this; - } - - _patch(data) { - /** - * The attachment's id - * @type {Snowflake} - */ - this.id = data.id; - - if ('size' in data) { - /** - * The size of this attachment in bytes - * @type {number} - */ - this.size = data.size; - } - - if ('url' in data) { - /** - * The URL to this attachment - * @type {string} - */ - this.url = data.url; - } - - if ('proxy_url' in data) { - /** - * The Proxy URL to this attachment - * @type {string} - */ - this.proxyURL = data.proxy_url; - } - - if ('height' in data) { - /** - * The height of this attachment (if an image or video) - * @type {?number} - */ - this.height = data.height; - } else { - this.height ??= null; - } - - if ('width' in data) { - /** - * The width of this attachment (if an image or video) - * @type {?number} - */ - this.width = data.width; - } else { - this.width ??= null; - } - - if ('content_type' in data) { - /** - * The media (MIME) type of this attachment - * @type {?string} - * @see {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types} - */ - this.contentType = data.content_type; - } else { - this.contentType ??= null; - } - - if ('description' in data) { - /** - * The description (alt text) of this attachment - * @type {?string} - */ - this.description = data.description; - } else { - this.description ??= null; - } - - /** - * Whether this attachment is ephemeral - * @type {boolean} - */ - this.ephemeral = data.ephemeral ?? false; - - if ('duration_secs' in data) { - /** - * The duration of this attachment in seconds - * This will only be available if the attachment is an audio file. - * @type {?number} - */ - this.duration = data.duration_secs; - } else { - this.duration ??= null; - } - - if ('waveform' in data) { - /** - * The base64 encoded byte array representing a sampled waveform - * This will only be available if the attachment is an audio file. - * @type {?string} - */ - this.waveform = data.waveform; - } else { - this.waveform ??= null; - } - - if ('flags' in data) { - /** - * The flags of this attachment - * @type {Readonly} - */ - this.flags = new AttachmentFlags(data.flags).freeze(); - } else { - this.flags ??= new AttachmentFlags().freeze(); - } - - if ('title' in data) { - /** - * The title of this attachment - * This will only be available if the attachment name contains special characters. - * @type {?string} - */ - this.title = data.title; - } else { - this.title ??= null; - } - } - - /** - * Whether or not this attachment has been marked as a spoiler - * @type {boolean} - * @readonly - */ - get spoiler() { - return Util.basename(this.url ?? this.name).startsWith('SPOILER_'); - } - - toJSON() { - return Util.flatten(this); - } -} - -module.exports = MessageAttachment; - -/** - * @external APIAttachment - * @see {@link https://discord.com/developers/docs/resources/channel#attachment-object} - */ diff --git a/vendor/discord.js-selfbot-v13/src/structures/MessageButton.js b/vendor/discord.js-selfbot-v13/src/structures/MessageButton.js deleted file mode 100644 index 5bb6057..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/MessageButton.js +++ /dev/null @@ -1,169 +0,0 @@ -'use strict'; - -const BaseMessageComponent = require('./BaseMessageComponent'); -const { RangeError } = require('../errors'); -const { - MessageButtonStyles, - MessageComponentTypes, -} = require('../util/Constants'); -const Util = require('../util/Util'); - -/** - * Represents a button message component. - * @extends {BaseMessageComponent} - */ -class MessageButton extends BaseMessageComponent { - /** - * @typedef {BaseMessageComponentOptions} MessageButtonOptions - * @property {string} [label] The text to be displayed on this button - * @property {string} [customId] A unique string to be sent in the interaction when clicked - * @property {MessageButtonStyleResolvable} [style] The style of this button - * @property {EmojiIdentifierResolvable} [emoji] The emoji to be displayed to the left of the text - * @property {string} [url] Optional URL for link-style buttons - * @property {boolean} [disabled=false] Disables the button to prevent interactions - */ - - /** - * @param {MessageButton|MessageButtonOptions} [data={}] MessageButton to clone or raw data - */ - constructor(data = {}) { - super({ type: 'BUTTON' }); - - this.setup(data); - } - - setup(data) { - super.setup(data); - /** - * The text to be displayed on this button - * @type {?string} - */ - this.label = data.label ?? null; - - /** - * A unique string to be sent in the interaction when clicked - * @type {?string} - */ - this.customId = data.custom_id ?? data.customId ?? null; - - /** - * The style of this button - * @type {?MessageButtonStyle} - */ - this.style = data.style ? MessageButton.resolveStyle(data.style) : null; - - /** - * Emoji for this button - * @type {?RawEmoji} - */ - this.emoji = data.emoji ? Util.resolvePartialEmoji(data.emoji) : null; - - /** - * The URL this button links to, if it is a Link style button - * @type {?string} - */ - this.url = data.url ?? null; - - /** - * Whether this button is currently disabled - * @type {boolean} - */ - this.disabled = data.disabled ?? false; - } - - /** - * Sets the custom id for this button - * @param {string} customId A unique string to be sent in the interaction when clicked - * @returns {MessageButton} - */ - setCustomId(customId) { - this.customId = Util.verifyString(customId, RangeError, 'BUTTON_CUSTOM_ID'); - return this; - } - - /** - * Sets the interactive status of the button - * @param {boolean} [disabled=true] Whether this button should be disabled - * @returns {MessageButton} - */ - setDisabled(disabled = true) { - this.disabled = disabled; - return this; - } - - /** - * Set the emoji of this button - * @param {EmojiIdentifierResolvable} emoji The emoji to be displayed on this button - * @returns {MessageButton} - */ - setEmoji(emoji) { - this.emoji = Util.resolvePartialEmoji(emoji); - return this; - } - - /** - * Sets the label of this button - * @param {string} label The text to be displayed on this button - * @returns {MessageButton} - */ - setLabel(label) { - this.label = Util.verifyString(label, RangeError, 'BUTTON_LABEL'); - return this; - } - - /** - * Sets the style of this button - * @param {MessageButtonStyleResolvable} style The style of this button - * @returns {MessageButton} - */ - setStyle(style) { - this.style = MessageButton.resolveStyle(style); - return this; - } - - /** - * Sets the URL of this button. - * MessageButton#style must be LINK when setting a URL - * @param {string} url The URL of this button - * @returns {MessageButton} - */ - setURL(url) { - this.url = Util.verifyString(url, RangeError, 'BUTTON_URL'); - return this; - } - - /** - * Transforms the button to a plain object. - * @returns {APIMessageButton} The raw data of this button - */ - toJSON() { - return { - custom_id: this.customId, - disabled: this.disabled, - emoji: this.emoji, - label: this.label, - style: MessageButtonStyles[this.style], - type: MessageComponentTypes[this.type], - url: this.url, - }; - } - - /** - * Data that can be resolved to a MessageButtonStyle. This can be - * * MessageButtonStyle - * * number - * @typedef {number|MessageButtonStyle} MessageButtonStyleResolvable - */ - - /** - * Resolves the style of a button - * @param {MessageButtonStyleResolvable} style The style to resolve - * @returns {MessageButtonStyle} - * @private - */ - static resolveStyle(style) { - return typeof style === 'string' ? style : MessageButtonStyles[style]; - } -} - -module.exports = MessageButton; diff --git a/vendor/discord.js-selfbot-v13/src/structures/MessageCollector.js b/vendor/discord.js-selfbot-v13/src/structures/MessageCollector.js deleted file mode 100644 index 163ea62..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/MessageCollector.js +++ /dev/null @@ -1,166 +0,0 @@ -'use strict'; - -const Collector = require('./interfaces/Collector'); -const { Events } = require('../util/Constants'); - -/** - * @typedef {CollectorOptions} MessageCollectorOptions - * @property {number} max The maximum amount of messages to collect - * @property {number} maxProcessed The maximum amount of messages to process - */ - -/** - * Collects messages on a channel. - * Will automatically stop if the channel ({@link Client#event:channelDelete channelDelete}), - * thread ({@link Client#event:threadDelete threadDelete}), or - * guild ({@link Client#event:guildDelete guildDelete}) is deleted. - * @extends {Collector} - */ -class MessageCollector extends Collector { - /** - * @param {TextBasedChannels} channel The channel - * @param {MessageCollectorOptions} options The options to be applied to this collector - * @emits MessageCollector#message - */ - constructor(channel, options = {}) { - super(channel.client, options); - - /** - * The channel - * @type {TextBasedChannels} - */ - this.channel = channel; - - /** - * Total number of messages that were received in the channel during message collection - * @type {number} - */ - this.received = 0; - - const bulkDeleteListener = (messages) => { - for (const message of messages.values()) this.handleDispose(message); - }; - - this._handleChannelDeletion = this._handleChannelDeletion.bind(this); - this._handleThreadDeletion = this._handleThreadDeletion.bind(this); - this._handleGuildDeletion = this._handleGuildDeletion.bind(this); - - this.client.incrementMaxListeners(); - this.client.on(Events.MESSAGE_CREATE, this.handleCollect); - this.client.on(Events.MESSAGE_DELETE, this.handleDispose); - this.client.on(Events.MESSAGE_BULK_DELETE, bulkDeleteListener); - this.client.on(Events.CHANNEL_DELETE, this._handleChannelDeletion); - this.client.on(Events.THREAD_DELETE, this._handleThreadDeletion); - this.client.on(Events.GUILD_DELETE, this._handleGuildDeletion); - - this.once('end', () => { - this.client.removeListener(Events.MESSAGE_CREATE, this.handleCollect); - this.client.removeListener(Events.MESSAGE_DELETE, this.handleDispose); - this.client.removeListener( - Events.MESSAGE_BULK_DELETE, - bulkDeleteListener, - ); - this.client.removeListener( - Events.CHANNEL_DELETE, - this._handleChannelDeletion, - ); - this.client.removeListener( - Events.THREAD_DELETE, - this._handleThreadDeletion, - ); - this.client.removeListener( - Events.GUILD_DELETE, - this._handleGuildDeletion, - ); - this.client.decrementMaxListeners(); - }); - } - - /** - * Handles a message for possible collection. - * @param {Message} message The message that could be collected - * @returns {?Snowflake} - * @private - */ - collect(message) { - /** - * Emitted whenever a message is collected. - * @event MessageCollector#collect - * @param {Message} message The message that was collected - */ - if (message.channelId !== this.channel.id) return null; - this.received++; - return message.id; - } - - /** - * Handles a message for possible disposal. - * @param {Message} message The message that could be disposed of - * @returns {?Snowflake} - */ - dispose(message) { - /** - * Emitted whenever a message is disposed of. - * @event MessageCollector#dispose - * @param {Message} message The message that was disposed of - */ - return message.channelId === this.channel.id ? message.id : null; - } - - /** - * The reason this collector has ended with, or null if it hasn't ended yet - * @type {?string} - * @readonly - */ - get endReason() { - if (this.options.max && this.collected.size >= this.options.max) - return 'limit'; - if ( - this.options.maxProcessed && - this.received === this.options.maxProcessed - ) - return 'processedLimit'; - return null; - } - - /** - * Handles checking if the channel has been deleted, and if so, stops the collector with the reason 'channelDelete'. - * @private - * @param {GuildChannel} channel The channel that was deleted - * @returns {void} - */ - _handleChannelDeletion(channel) { - if ( - channel.id === this.channel.id || - channel.id === this.channel.parentId - ) { - this.stop('channelDelete'); - } - } - - /** - * Handles checking if the thread has been deleted, and if so, stops the collector with the reason 'threadDelete'. - * @private - * @param {ThreadChannel} thread The thread that was deleted - * @returns {void} - */ - _handleThreadDeletion(thread) { - if (thread.id === this.channel.id) { - this.stop('threadDelete'); - } - } - - /** - * Handles checking if the guild has been deleted, and if so, stops the collector with the reason 'guildDelete'. - * @private - * @param {Guild} guild The guild that was deleted - * @returns {void} - */ - _handleGuildDeletion(guild) { - if (guild.id === this.channel.guild?.id) { - this.stop('guildDelete'); - } - } -} - -module.exports = MessageCollector; diff --git a/vendor/discord.js-selfbot-v13/src/structures/MessageComponentInteraction.js b/vendor/discord.js-selfbot-v13/src/structures/MessageComponentInteraction.js deleted file mode 100644 index 3ec1e0d..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/MessageComponentInteraction.js +++ /dev/null @@ -1,129 +0,0 @@ -'use strict'; - -const Interaction = require('./Interaction'); -const InteractionWebhook = require('./InteractionWebhook'); -const InteractionResponses = require('./interfaces/InteractionResponses'); -const { MessageComponentTypes } = require('../util/Constants'); - -/** - * Represents a message component interaction. - * @extends {Interaction} - * @implements {InteractionResponses} - */ -class MessageComponentInteraction extends Interaction { - constructor(client, data) { - super(client, data); - - /** - * The id of the channel this interaction was sent in - * @type {Snowflake} - * @name MessageComponentInteraction#channelId - */ - - /** - * The message to which the component was attached - * @type {Message|APIMessage} - */ - this.message = this.channel?.messages._add(data.message) ?? data.message; - - /** - * The custom id of the component which was interacted with - * @type {string} - */ - this.customId = data.data.custom_id; - - /** - * The type of component which was interacted with - * @type {string} - */ - this.componentType = MessageComponentInteraction.resolveType( - data.data.component_type, - ); - - /** - * Whether the reply to this interaction has been deferred - * @type {boolean} - */ - this.deferred = false; - - /** - * Whether the reply to this interaction is ephemeral - * @type {?boolean} - */ - this.ephemeral = null; - - /** - * Whether this interaction has already been replied to - * @type {boolean} - */ - this.replied = false; - - /** - * An associated interaction webhook, can be used to further interact with this interaction - * @type {InteractionWebhook} - */ - this.webhook = new InteractionWebhook( - this.client, - this.applicationId, - this.token, - ); - } - - /** - * Raw message components from the API - * * APIMessageButton - * * APIMessageSelectMenu - * @typedef {APIMessageButton|APIMessageSelectMenu} APIMessageActionRowComponent - */ - - /** - * The component which was interacted with - * @type {MessageActionRowComponent|APIMessageActionRowComponent} - * @readonly - */ - get component() { - return this.message.components - .flatMap((row) => row.components) - .find( - (component) => - (component.customId ?? component.custom_id) === this.customId, - ); - } - - /** - * Resolves the type of a MessageComponent - * @param {MessageComponentTypeResolvable} type The type to resolve - * @returns {MessageComponentType} - * @private - */ - static resolveType(type) { - return typeof type === 'string' ? type : MessageComponentTypes[type]; - } - - // These are here only for documentation purposes - they are implemented by InteractionResponses - /* eslint-disable no-empty-function */ - deferReply() {} - reply() {} - fetchReply() {} - editReply() {} - deleteReply() {} - followUp() {} - deferUpdate() {} - update() {} - showModal() {} - awaitModalSubmit() {} -} - -InteractionResponses.applyToClass(MessageComponentInteraction); - -module.exports = MessageComponentInteraction; - -/** - * @external APIMessageSelectMenu - * @see {@link https://discord.com/developers/docs/interactions/message-components#select-menu-object} - */ - -/** - * @external APIMessageButton - * @see {@link https://discord.com/developers/docs/interactions/message-components#button-object} - */ diff --git a/vendor/discord.js-selfbot-v13/src/structures/MessageContextMenuInteraction.js b/vendor/discord.js-selfbot-v13/src/structures/MessageContextMenuInteraction.js deleted file mode 100644 index 0855f30..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/MessageContextMenuInteraction.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -const ContextMenuInteraction = require('./ContextMenuInteraction'); - -/** - * Represents a message context menu interaction. - * @extends {ContextMenuInteraction} - */ -class MessageContextMenuInteraction extends ContextMenuInteraction { - /** - * The message this interaction was sent from - * @type {Message|APIMessage} - * @readonly - */ - get targetMessage() { - return this.options.getMessage('message'); - } -} - -module.exports = MessageContextMenuInteraction; diff --git a/vendor/discord.js-selfbot-v13/src/structures/MessageEmbed.js b/vendor/discord.js-selfbot-v13/src/structures/MessageEmbed.js deleted file mode 100644 index 8579a6c..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/MessageEmbed.js +++ /dev/null @@ -1,633 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const { RangeError } = require('../errors'); -const Util = require('../util/Util'); - -let deprecationEmittedForSetAuthor = false; -let deprecationEmittedForSetFooter = false; -let deprecationEmittedForAddField = false; - -// TODO: Remove the deprecated code for `setAuthor()` and `setFooter()`. - -/** - * Represents an embed in a message (image/video preview, rich embed, etc.) - */ -class MessageEmbed { - /** - * A `Partial` object is a representation of any existing object. - * This object contains between 0 and all of the original objects parameters. - * This is true regardless of whether the parameters are optional in the base object. - * @typedef {Object} Partial - */ - - /** - * Represents the possible options for a MessageEmbed - * @typedef {Object} MessageEmbedOptions - * @property {string} [title] The title of this embed - * @property {string} [description] The description of this embed - * @property {string} [url] The URL of this embed - * @property {Date|number} [timestamp] The timestamp of this embed - * @property {ColorResolvable} [color] The color of this embed - * @property {EmbedFieldData[]} [fields] The fields of this embed - * @property {Partial} [author] The author of this embed - * @property {Partial} [thumbnail] The thumbnail of this embed - * @property {Partial} [image] The image of this embed - * @property {Partial} [video] The video of this embed - * @property {Partial} [footer] The footer of this embed - */ - - // eslint-disable-next-line valid-jsdoc - /** - * @param {MessageEmbed|MessageEmbedOptions|APIEmbed} [data={}] MessageEmbed to clone or raw embed data - */ - constructor(data = {}, skipValidation = false) { - this.setup(data, skipValidation); - } - - setup(data, skipValidation) { - /** - * The type of this embed, either: - * * `rich` - a generic embed rendered from embed attributes - * * `image` - an image embed - * * `video` - a video embed - * * `gifv` - an animated gif image embed rendered as a video embed - * * `article` - an article embed - * * `link` - a link embed - * @type {string} - * @see {@link https://discord.com/developers/docs/resources/channel#embed-object-embed-types} - * @deprecated - */ - this.type = data.type ?? 'rich'; - - /** - * The title of this embed - * @type {?string} - */ - this.title = data.title ?? null; - - /** - * The description of this embed - * @type {?string} - */ - this.description = data.description ?? null; - - /** - * The URL of this embed - * @type {?string} - */ - this.url = data.url ?? null; - - /** - * The color of this embed - * @type {?number} - */ - this.color = 'color' in data ? Util.resolveColor(data.color) : null; - - /** - * The timestamp of this embed - * @type {?number} - */ - this.timestamp = - 'timestamp' in data ? new Date(data.timestamp).getTime() : null; - - /** - * Represents a field of a MessageEmbed - * @typedef {Object} EmbedField - * @property {string} name The name of this field - * @property {string} value The value of this field - * @property {boolean} inline If this field will be displayed inline - */ - - /** - * The fields of this embed - * @type {EmbedField[]} - */ - this.fields = []; - if (data.fields) { - this.fields = skipValidation - ? data.fields.map(Util.cloneObject) - : this.constructor.normalizeFields(data.fields); - } - - /** - * Represents the thumbnail of a MessageEmbed - * @typedef {Object} MessageEmbedThumbnail - * @property {string} url URL for this thumbnail - * @property {string} proxyURL ProxyURL for this thumbnail - * @property {number} height Height of this thumbnail - * @property {number} width Width of this thumbnail - */ - - /** - * The thumbnail of this embed (if there is one) - * @type {?MessageEmbedThumbnail} - */ - this.thumbnail = data.thumbnail - ? { - url: data.thumbnail.url, - proxyURL: data.thumbnail.proxyURL ?? data.thumbnail.proxy_url, - height: data.thumbnail.height, - width: data.thumbnail.width, - } - : null; - - /** - * Represents the image of a MessageEmbed - * @typedef {Object} MessageEmbedImage - * @property {string} url URL for this image - * @property {string} proxyURL ProxyURL for this image - * @property {number} height Height of this image - * @property {number} width Width of this image - */ - - /** - * The image of this embed, if there is one - * @type {?MessageEmbedImage} - */ - this.image = data.image - ? { - url: data.image.url, - proxyURL: data.image.proxyURL ?? data.image.proxy_url, - height: data.image.height, - width: data.image.width, - } - : null; - - /** - * Represents the video of a MessageEmbed - * @typedef {Object} MessageEmbedVideo - * @property {string} url URL of this video - * @property {string} proxyURL ProxyURL for this video - * @property {number} height Height of this video - * @property {number} width Width of this video - */ - - /** - * The video of this embed (if there is one) - * @type {?MessageEmbedVideo} - * @readonly - */ - this.video = data.video - ? { - url: data.video.url, - proxyURL: data.video.proxyURL ?? data.video.proxy_url, - height: data.video.height, - width: data.video.width, - } - : null; - - /** - * Represents the author field of a MessageEmbed - * @typedef {Object} MessageEmbedAuthor - * @property {string} name The name of this author - * @property {string} url URL of this author - * @property {string} iconURL URL of the icon for this author - * @property {string} proxyIconURL Proxied URL of the icon for this author - */ - - /** - * The author of this embed (if there is one) - * @type {?MessageEmbedAuthor} - */ - this.author = data.author - ? { - name: data.author.name, - url: data.author.url, - iconURL: data.author.iconURL ?? data.author.icon_url, - proxyIconURL: data.author.proxyIconURL ?? data.author.proxy_icon_url, - } - : null; - - /** - * Represents the provider of a MessageEmbed - * @typedef {Object} MessageEmbedProvider - * @property {string} name The name of this provider - * @property {string} url URL of this provider - */ - - /** - * The provider of this embed (if there is one) - * @type {?MessageEmbedProvider} - */ - this.provider = data.provider - ? { - name: data.provider.name, - url: data.provider.url, - } - : null; - - /** - * Represents the footer field of a MessageEmbed - * @typedef {Object} MessageEmbedFooter - * @property {string} text The text of this footer - * @property {string} iconURL URL of the icon for this footer - * @property {string} proxyIconURL Proxied URL of the icon for this footer - */ - - /** - * The footer of this embed - * @type {?MessageEmbedFooter} - */ - this.footer = data.footer - ? { - text: data.footer.text, - iconURL: data.footer.iconURL ?? data.footer.icon_url, - proxyIconURL: data.footer.proxyIconURL ?? data.footer.proxy_icon_url, - } - : null; - } - - /** - * The date displayed on this embed - * @type {?Date} - * @readonly - */ - get createdAt() { - return this.timestamp ? new Date(this.timestamp) : null; - } - - /** - * The hexadecimal version of the embed color, with a leading hash - * @type {?string} - * @readonly - */ - get hexColor() { - return this.color ? `#${this.color.toString(16).padStart(6, '0')}` : null; - } - - /** - * The accumulated length for the embed title, description, fields, footer text, and author name - * @type {number} - * @readonly - */ - get length() { - return ( - (this.title?.length ?? 0) + - (this.description?.length ?? 0) + - (this.fields.length >= 1 - ? this.fields.reduce( - (prev, curr) => prev + curr.name.length + curr.value.length, - 0, - ) - : 0) + - (this.footer?.text.length ?? 0) + - (this.author?.name.length ?? 0) - ); - } - - /** - * Checks if this embed is equal to another one by comparing every single one of their properties. - * @param {MessageEmbed|APIEmbed} embed The embed to compare with - * @returns {boolean} - */ - equals(embed) { - return ( - this.type === embed.type && - this.author?.name === embed.author?.name && - this.author?.url === embed.author?.url && - this.author?.iconURL === - (embed.author?.iconURL ?? embed.author?.icon_url) && - this.color === embed.color && - this.title === embed.title && - this.description === embed.description && - this.url === embed.url && - this.timestamp === embed.timestamp && - this.fields.length === embed.fields.length && - this.fields.every((field, i) => - this._fieldEquals(field, embed.fields[i]), - ) && - this.footer?.text === embed.footer?.text && - this.footer?.iconURL === - (embed.footer?.iconURL ?? embed.footer?.icon_url) && - this.image?.url === embed.image?.url && - this.thumbnail?.url === embed.thumbnail?.url && - this.video?.url === embed.video?.url && - this.provider?.name === embed.provider?.name && - this.provider?.url === embed.provider?.url - ); - } - - /** - * Compares two given embed fields to see if they are equal - * @param {EmbedFieldData} field The first field to compare - * @param {EmbedFieldData} other The second field to compare - * @returns {boolean} - * @private - */ - _fieldEquals(field, other) { - return ( - field.name === other.name && - field.value === other.value && - field.inline === other.inline - ); - } - - /** - * Adds a field to the embed (max 25). - * @param {string} name The name of this field - * @param {string} value The value of this field - * @param {boolean} [inline=false] If this field will be displayed inline - * @returns {MessageEmbed} - * @deprecated This method is a wrapper for {@link MessageEmbed#addFields}. Use that instead. - */ - addField(name, value, inline) { - if (!deprecationEmittedForAddField) { - process.emitWarning( - // eslint-disable-next-line max-len - 'MessageEmbed#addField is deprecated and will be removed in the next major update. Use MessageEmbed#addFields instead.', - 'DeprecationWarning', - ); - - deprecationEmittedForAddField = true; - } - return this.addFields({ name, value, inline }); - } - - /** - * Adds fields to the embed (max 25). - * @param {...EmbedFieldData|EmbedFieldData[]} fields The fields to add - * @returns {MessageEmbed} - */ - addFields(...fields) { - this.fields.push(...this.constructor.normalizeFields(fields)); - return this; - } - - /** - * Removes, replaces, and inserts fields in the embed (max 25). - * @param {number} index The index to start at - * @param {number} deleteCount The number of fields to remove - * @param {...EmbedFieldData|EmbedFieldData[]} [fields] The replacing field objects - * @returns {MessageEmbed} - */ - spliceFields(index, deleteCount, ...fields) { - this.fields.splice( - index, - deleteCount, - ...this.constructor.normalizeFields(...fields), - ); - return this; - } - - /** - * Sets the embed's fields (max 25). - * @param {...EmbedFieldData|EmbedFieldData[]} fields The fields to set - * @returns {MessageEmbed} - */ - setFields(...fields) { - this.spliceFields(0, this.fields.length, fields); - return this; - } - - /** - * The options to provide for setting an author for a {@link MessageEmbed}. - * @typedef {Object} EmbedAuthorData - * @property {string} name The name of this author. - * @property {string} [url] The URL of this author. - * @property {string} [iconURL] The icon URL of this author. - */ - - /** - * Sets the author of this embed. - * @param {string|EmbedAuthorData|null} options The options to provide for the author. - * Provide `null` to remove the author data. - * @param {string} [deprecatedIconURL] The icon URL of this author. - * This parameter is **deprecated**. Use the `options` parameter instead. - * @param {string} [deprecatedURL] The URL of this author. - * This parameter is **deprecated**. Use the `options` parameter instead. - * @returns {MessageEmbed} - */ - setAuthor(options, deprecatedIconURL, deprecatedURL) { - if (options === null) { - this.author = {}; - return this; - } - - if (typeof options === 'string') { - if (!deprecationEmittedForSetAuthor) { - process.emitWarning( - 'Passing strings for MessageEmbed#setAuthor is deprecated. Pass a sole object instead.', - 'DeprecationWarning', - ); - - deprecationEmittedForSetAuthor = true; - } - - options = { - name: options, - url: deprecatedURL, - iconURL: deprecatedIconURL, - }; - } - - const { name, url, iconURL } = options; - this.author = { - name: Util.verifyString(name, RangeError, 'EMBED_AUTHOR_NAME'), - url, - iconURL, - }; - return this; - } - - /** - * Sets the color of this embed. - * @param {ColorResolvable} color The color of the embed - * @returns {MessageEmbed} - */ - setColor(color) { - this.color = Util.resolveColor(color); - return this; - } - - /** - * Sets the description of this embed. - * @param {string} description The description - * @returns {MessageEmbed} - */ - setDescription(description) { - this.description = Util.verifyString( - description, - RangeError, - 'EMBED_DESCRIPTION', - ); - return this; - } - - /** - * The options to provide for setting a footer for a {@link MessageEmbed}. - * @typedef {Object} EmbedFooterData - * @property {string} text The text of the footer. - * @property {string} [iconURL] The icon URL of the footer. - */ - - /** - * Sets the footer of this embed. - * @param {string|EmbedFooterData|null} options The options to provide for the footer. - * Provide `null` to remove the footer data. - * @param {string} [deprecatedIconURL] The icon URL of this footer. - * This parameter is **deprecated**. Use the `options` parameter instead. - * @returns {MessageEmbed} - */ - setFooter(options, deprecatedIconURL) { - if (options === null) { - this.footer = undefined; - return this; - } - - if (typeof options === 'string') { - if (!deprecationEmittedForSetFooter) { - process.emitWarning( - 'Passing strings for MessageEmbed#setFooter is deprecated. Pass a sole object instead.', - 'DeprecationWarning', - ); - - deprecationEmittedForSetFooter = true; - } - - options = { text: options, iconURL: deprecatedIconURL }; - } - - const { text, iconURL } = options; - this.footer = { - text: Util.verifyString(text, RangeError, 'EMBED_FOOTER_TEXT'), - iconURL, - }; - return this; - } - - /** - * Sets the image of this embed. - * @param {string} url The URL of the image - * @returns {MessageEmbed} - */ - setImage(url) { - this.image = { url }; - return this; - } - - /** - * Sets the thumbnail of this embed. - * @param {string} url The URL of the thumbnail - * @returns {MessageEmbed} - */ - setThumbnail(url) { - this.thumbnail = { url }; - return this; - } - - /** - * Sets the timestamp of this embed. - * @param {Date|number|null} [timestamp=Date.now()] The timestamp or date. - * If `null` then the timestamp will be unset (i.e. when editing an existing {@link MessageEmbed}) - * @returns {MessageEmbed} - */ - setTimestamp(timestamp = Date.now()) { - if (timestamp instanceof Date) timestamp = timestamp.getTime(); - this.timestamp = timestamp; - return this; - } - - /** - * Sets the title of this embed. - * @param {string} title The title - * @returns {MessageEmbed} - */ - setTitle(title) { - this.title = Util.verifyString(title, RangeError, 'EMBED_TITLE'); - return this; - } - - /** - * Sets the URL of this embed. - * @param {string} url The URL - * @returns {MessageEmbed} - */ - setURL(url) { - this.url = url; - return this; - } - - /** - * Transforms the embed to a plain object. - * @returns {APIEmbed} The raw data of this embed - */ - toJSON() { - return { - title: this.title, - type: this.type, - description: this.description, - url: this.url, - timestamp: this.timestamp && new Date(this.timestamp), - color: this.color, - fields: this.fields, - thumbnail: this.thumbnail, - image: this.image, - author: this.author && { - name: this.author.name, - url: this.author.url, - icon_url: this.author.iconURL, - }, - video: this.video && { - url: this.video.url, - proxyURL: this.video.proxyURL, - height: this.video.height, - width: this.video.width, - }, - provider: this.provider && { - name: this.provider.name, - url: this.provider.url, - }, - footer: this.footer && { - text: this.footer.text, - icon_url: this.footer.iconURL, - }, - }; - } - - /** - * Normalizes field input and verifies strings. - * @param {string} name The name of the field - * @param {string} value The value of the field - * @param {boolean} [inline=false] Set the field to display inline - * @returns {EmbedField} - */ - static normalizeField(name, value, inline = false) { - return { - name: Util.verifyString(name, RangeError, 'EMBED_FIELD_NAME', false), - value: Util.verifyString(value, RangeError, 'EMBED_FIELD_VALUE', false), - inline, - }; - } - - /** - * @typedef {Object} EmbedFieldData - * @property {string} name The name of this field - * @property {string} value The value of this field - * @property {boolean} [inline] If this field will be displayed inline - */ - - /** - * Normalizes field input and resolves strings. - * @param {...EmbedFieldData|EmbedFieldData[]} fields Fields to normalize - * @returns {EmbedField[]} - */ - static normalizeFields(...fields) { - return fields - .flat(2) - .map((field) => - this.normalizeField( - field.name, - field.value, - typeof field.inline === 'boolean' ? field.inline : false, - ), - ); - } -} - -module.exports = MessageEmbed; - -/** - * @external APIEmbed - * @see {@link https://discord.com/developers/docs/resources/channel#embed-object} - */ diff --git a/vendor/discord.js-selfbot-v13/src/structures/MessageMentions.js b/vendor/discord.js-selfbot-v13/src/structures/MessageMentions.js deleted file mode 100644 index ba68b7e..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/MessageMentions.js +++ /dev/null @@ -1,301 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const { ChannelTypes } = require('../util/Constants'); -const Util = require('../util/Util'); - -/** - * Keeps track of mentions in a {@link Message}. - */ -class MessageMentions { - constructor( - message, - users, - roles, - everyone, - crosspostedChannels, - repliedUser, - ) { - /** - * The client the message is from - * @type {Client} - * @readonly - */ - Object.defineProperty(this, 'client', { value: message.client }); - - /** - * The guild the message is in - * @type {?Guild} - * @readonly - */ - Object.defineProperty(this, 'guild', { value: message.guild }); - - /** - * The initial message content - * @type {string} - * @readonly - * @private - */ - Object.defineProperty(this, '_content', { value: message.content }); - - /** - * Whether `@everyone` or `@here` were mentioned - * @type {boolean} - */ - this.everyone = Boolean(everyone); - - if (users) { - if (users instanceof Collection) { - /** - * Any users that were mentioned - * Order as received from the API, not as they appear in the message content - * @type {Collection} - */ - this.users = new Collection(users); - } else { - this.users = new Collection(); - for (const mention of users) { - if (mention.member && message.guild) { - message.guild.members._add( - Object.assign(mention.member, { user: mention }), - ); - } - const user = message.client.users._add(mention); - this.users.set(user.id, user); - } - } - } else { - this.users = new Collection(); - } - - if (roles instanceof Collection) { - /** - * Any roles that were mentioned - * Order as received from the API, not as they appear in the message content - * @type {Collection} - */ - this.roles = new Collection(roles); - } else if (roles) { - this.roles = new Collection(); - const guild = message.guild; - if (guild) { - for (const mention of roles) { - const role = guild.roles.cache.get(mention); - if (role) this.roles.set(role.id, role); - } - } - } else { - this.roles = new Collection(); - } - - /** - * Cached members for {@link MessageMentions#members} - * @type {?Collection} - * @private - */ - this._members = null; - - /** - * Cached channels for {@link MessageMentions#channels} - * @type {?Collection} - * @private - */ - this._channels = null; - - /** - * Cached users for {@link MessageMentions#parsedUsers} - * @type {?Collection} - * @private - */ - this._parsedUsers = null; - - /** - * Crossposted channel data. - * @typedef {Object} CrosspostedChannel - * @property {Snowflake} channelId The mentioned channel's id - * @property {Snowflake} guildId The id of the guild that has the channel - * @property {ChannelType} type The channel's type - * @property {string} name The channel's name - */ - - if (crosspostedChannels) { - if (crosspostedChannels instanceof Collection) { - /** - * A collection of crossposted channels - * Order as received from the API, not as they appear in the message content - * @type {Collection} - */ - this.crosspostedChannels = new Collection(crosspostedChannels); - } else { - this.crosspostedChannels = new Collection(); - const channelTypes = Object.keys(ChannelTypes); - for (const d of crosspostedChannels) { - const type = channelTypes[d.type]; - this.crosspostedChannels.set(d.id, { - channelId: d.id, - guildId: d.guild_id, - type: type ?? 'UNKNOWN', - name: d.name, - }); - } - } - } else { - this.crosspostedChannels = new Collection(); - } - - /** - * The author of the message that this message is a reply to - * @type {?User} - */ - this.repliedUser = repliedUser ? this.client.users._add(repliedUser) : null; - } - - /** - * Any members that were mentioned (only in {@link Guild}s) - * Order as received from the API, not as they appear in the message content - * @type {?Collection} - * @readonly - */ - get members() { - if (this._members) return this._members; - if (!this.guild) return null; - this._members = new Collection(); - this.users.forEach((user) => { - const member = this.guild.members.resolve(user); - if (member) this._members.set(member.user.id, member); - }); - return this._members; - } - - /** - * Any channels that were mentioned - * Order as they appear first in the message content - * @type {Collection} - * @readonly - */ - get channels() { - if (this._channels) return this._channels; - this._channels = new Collection(); - let matches; - while ( - (matches = this.constructor.CHANNELS_PATTERN.exec(this._content)) !== null - ) { - const chan = this.client.channels.cache.get(matches[1]); - if (chan) this._channels.set(chan.id, chan); - } - return this._channels; - } - - /** - * Any user mentions that were included in the message content - * Order as they appear first in the message content - * @type {Collection} - * @readonly - */ - get parsedUsers() { - if (this._parsedUsers) return this._parsedUsers; - this._parsedUsers = new Collection(); - let matches; - while ( - (matches = this.constructor.USERS_PATTERN.exec(this._content)) !== null - ) { - const user = this.client.users.cache.get(matches[1]); - if (user) this._parsedUsers.set(user.id, user); - } - return this._parsedUsers; - } - - /** - * Options used to check for a mention. - * @typedef {Object} MessageMentionsHasOptions - * @property {boolean} [ignoreDirect=false] Whether to ignore direct mentions to the item - * @property {boolean} [ignoreRoles=false] Whether to ignore role mentions to a guild member - * @property {boolean} [ignoreRepliedUser=false] Whether to ignore replied user mention to an user - * @property {boolean} [ignoreEveryone=false] Whether to ignore `@everyone`/`@here` mentions - */ - - /** - * Checks if a user, guild member, thread member, role, or channel is mentioned. - * Takes into account user mentions, role mentions, channel mentions, - * replied user mention, and `@everyone`/`@here` mentions. - * @param {UserResolvable|RoleResolvable|ChannelResolvable} data The User/Role/Channel to check for - * @param {MessageMentionsHasOptions} [options] The options for the check - * @returns {boolean} - */ - has( - data, - { - ignoreDirect = false, - ignoreRoles = false, - ignoreRepliedUser = false, - ignoreEveryone = false, - } = {}, - ) { - const user = this.client.users.resolve(data); - - if (!ignoreEveryone && user && this.everyone) return true; - - const userWasRepliedTo = user && this.repliedUser?.id === user.id; - - if (!ignoreRepliedUser && userWasRepliedTo && this.users.has(user.id)) - return true; - - if (!ignoreDirect) { - if ( - user && - (!ignoreRepliedUser || this.parsedUsers.has(user.id)) && - this.users.has(user.id) - ) - return true; - - const role = this.guild?.roles.resolve(data); - if (role && this.roles.has(role.id)) return true; - - const channel = this.client.channels.resolve(data); - if (channel && this.channels.has(channel.id)) return true; - } - - if (!ignoreRoles) { - const member = this.guild?.members.resolve(data); - if (member) { - for (const mentionedRole of this.roles.values()) - if (member.roles.cache.has(mentionedRole.id)) return true; - } - } - - return false; - } - - toJSON() { - return Util.flatten(this, { - members: true, - channels: true, - }); - } -} - -/** - * Regular expression that globally matches `@everyone` and `@here` - * @type {RegExp} - */ -MessageMentions.EVERYONE_PATTERN = /@(everyone|here)/g; - -/** - * Regular expression that globally matches user mentions like `<@81440962496172032>` - * @type {RegExp} - */ -MessageMentions.USERS_PATTERN = /<@!?(\d{17,19})>/g; - -/** - * Regular expression that globally matches role mentions like `<@&297577916114403338>` - * @type {RegExp} - */ -MessageMentions.ROLES_PATTERN = /<@&(\d{17,19})>/g; - -/** - * Regular expression that globally matches channel mentions like `<#222079895583457280>` - * @type {RegExp} - */ -MessageMentions.CHANNELS_PATTERN = /<#(\d{17,19})>/g; - -module.exports = MessageMentions; diff --git a/vendor/discord.js-selfbot-v13/src/structures/MessagePayload.js b/vendor/discord.js-selfbot-v13/src/structures/MessagePayload.js deleted file mode 100644 index c4fa06b..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/MessagePayload.js +++ /dev/null @@ -1,399 +0,0 @@ -'use strict'; - -const { Buffer } = require('node:buffer'); -const BaseMessageComponent = require('./BaseMessageComponent'); -const MessageEmbed = require('./MessageEmbed'); -const { RangeError, Error: DjsError } = require('../errors'); -const ActivityFlags = require('../util/ActivityFlags'); -const { PollLayoutTypes, MessageReferenceTypes } = require('../util/Constants'); -const DataResolver = require('../util/DataResolver'); -const MessageFlags = require('../util/MessageFlags'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); -const Util = require('../util/Util'); - -/** - * Represents a message to be sent to the API. - */ -class MessagePayload { - /** - * @param {MessageTarget} target The target for this message to be sent to - * @param {MessageOptions|WebhookMessageOptions} options Options passed in from send - */ - constructor(target, options) { - /** - * The target for this message to be sent to - * @type {MessageTarget} - */ - this.target = target; - - /** - * Options passed in from send - * @type {MessageOptions|WebhookMessageOptions} - */ - this.options = options; - - /** - * Data sendable to the API - * @type {?APIMessage} - */ - this.data = null; - - /** - * @typedef {Object} MessageFile - * @property {Buffer|string|Stream} attachment The original attachment that generated this file - * @property {string} name The name of this file - * @property {Buffer|Stream} file The file to be sent to the API - */ - - /** - * Files sendable to the API - * @type {?MessageFile[]} - */ - this.files = null; - } - - /** - * Whether or not the target is a {@link Webhook} or a {@link WebhookClient} - * @type {boolean} - * @readonly - */ - get isWebhook() { - const Webhook = require('./Webhook'); - const WebhookClient = require('../client/WebhookClient'); - return ( - this.target instanceof Webhook || this.target instanceof WebhookClient - ); - } - - /** - * Whether or not the target is a {@link User} - * @type {boolean} - * @readonly - */ - get isUser() { - const User = require('./User'); - const { GuildMember } = require('./GuildMember'); - return this.target instanceof User || this.target instanceof GuildMember; - } - - /** - * Whether or not the target is a {@link Message} - * @type {boolean} - * @readonly - */ - get isMessage() { - const { Message } = require('./Message'); - return this.target instanceof Message; - } - - /** - * Whether or not the target is a {@link MessageManager} - * @type {boolean} - * @readonly - */ - get isMessageManager() { - const MessageManager = require('../managers/MessageManager'); - return this.target instanceof MessageManager; - } - - /** - * Whether or not the target is an {@link Interaction} or an {@link InteractionWebhook} - * @type {boolean} - * @readonly - */ - get isInteraction() { - const Interaction = require('./Interaction'); - const InteractionWebhook = require('./InteractionWebhook'); - return ( - this.target instanceof Interaction || - this.target instanceof InteractionWebhook - ); - } - - /** - * Makes the content of this message. - * @returns {?string} - */ - makeContent() { - let content; - if (this.options.content === null) { - content = ''; - } else if (typeof this.options.content !== 'undefined') { - content = Util.verifyString( - this.options.content, - RangeError, - 'MESSAGE_CONTENT_TYPE', - false, - ); - } - - return content; - } - - /** - * Resolves data. - * @returns {MessagePayload} - */ - resolveData() { - if (this.data) return this; - const isInteraction = this.isInteraction; - const isWebhook = this.isWebhook; - - const content = this.makeContent(); - const tts = Boolean(this.options.tts); - - let nonce = SnowflakeUtil.generate(); - if (typeof this.options.nonce !== 'undefined') { - nonce = this.options.nonce; - // eslint-disable-next-line max-len - if ( - typeof nonce === 'number' - ? !Number.isInteger(nonce) - : typeof nonce !== 'string' - ) { - throw new RangeError('MESSAGE_NONCE_TYPE'); - } - } - - const components = this.options.components?.map((c) => - BaseMessageComponent.create(c).toJSON(), - ); - - let username; - let avatarURL; - let threadName; - let appliedTags; - if (isWebhook) { - username = this.options.username ?? this.target.name; - if (this.options.avatarURL) avatarURL = this.options.avatarURL; - if (this.options.threadName) threadName = this.options.threadName; - if (this.options.appliedTags) appliedTags = this.options.appliedTags; - } - - let flags; - if (this.options.flags != null) { - flags = new MessageFlags(this.options.flags).bitfield; - } - - if (isInteraction && this.options.ephemeral) { - flags |= MessageFlags.FLAGS.EPHEMERAL; - } - - let allowedMentions = - typeof this.options.allowedMentions === 'undefined' - ? this.target.client.options.allowedMentions - : this.options.allowedMentions; - - if (allowedMentions) { - allowedMentions = Util.cloneObject(allowedMentions); - allowedMentions.replied_user = allowedMentions.repliedUser; - delete allowedMentions.repliedUser; - } - - let message_reference; - if (typeof this.options.reply === 'object') { - const reference = this.options.reply.messageReference; - const message_id = this.isMessage - ? (reference.id ?? reference) - : this.target.messages.resolveId(reference); - if (message_id) { - message_reference = { - message_id, - type: MessageReferenceTypes.DEFAULT, - fail_if_not_exists: - this.options.reply.failIfNotExists ?? - this.target.client.options.failIfNotExists, - }; - } - } - - if (typeof this.options.forward === 'object') { - const reference = this.options.forward.message; - const channel_id = - reference.channelId ?? - this.target.client.channels.resolveId(this.options.forward.channel); - const guild_id = - reference.guildId ?? - this.target.client.guilds.resolveId(this.options.forward.guild); - const message_id = this.target.messages.resolveId(reference); - if (message_id) { - if (!channel_id) - throw new DjsError( - 'INVALID_TYPE', - 'channelId', - 'TextBasedChannelResolvable', - ); - message_reference = { - type: MessageReferenceTypes.FORWARD, - message_id, - channel_id, - guild_id: guild_id ?? undefined, - }; - } - } - - const attachments = this.options.files?.map((file, index) => ({ - id: index.toString(), - description: file.description, - })); - if (Array.isArray(this.options.attachments)) { - this.options.attachments.push(...(attachments ?? [])); - } else { - this.options.attachments = attachments; - } - - // Activity - let activity; - if ( - this.options.activity instanceof Object && - typeof this.options.activity.partyId == 'string' && - this.options.activity.type - ) { - const type = ActivityFlags.resolve(this.options.activity.type); - const sessionId = this.target.client.sessionId; - const partyId = this.options.activity.partyId; - activity = { - type, - party_id: partyId, - session_id: sessionId, - }; - } - - let poll; - if (this.options.poll) { - poll = { - question: { - text: this.options.poll.question.text, - }, - answers: this.options.poll.answers.map((answer) => ({ - poll_media: { - text: answer.text, - emoji: Util.resolvePartialEmoji(answer.emoji), - }, - })), - duration: this.options.poll.duration, - allow_multiselect: this.options.poll.allowMultiselect, - layout_type: - typeof this.options.poll.layoutType == 'number' - ? this.options.poll.layoutType - : PollLayoutTypes[this.options.poll.layoutType], - }; - } - - this.data = { - activity, - content, - tts, - nonce, - embeds: this.options.embeds?.map((embed) => - new MessageEmbed(embed).toJSON(), - ), - components, - username, - avatar_url: avatarURL, - allowed_mentions: - this.isMessage && - message_reference === undefined && - this.target?.author?.id !== this.target?.client?.user?.id - ? undefined - : allowedMentions, - flags, - message_reference, - attachments: this.options.attachments, - sticker_ids: this.options.stickers?.map( - (sticker) => sticker.id ?? sticker, - ), - thread_name: threadName, - applied_tags: appliedTags, - poll, - }; - return this; - } - - /** - * Resolves files. - * @returns {Promise} - */ - async resolveFiles() { - if (this.files) return this; - - this.files = await Promise.all( - this.options.files?.map((file) => this.constructor.resolveFile(file)) ?? - [], - ); - return this; - } - - /** - * Resolves a single file into an object sendable to the API. - * @param {BufferResolvable|Stream|FileOptions|MessageAttachment} fileLike Something that could be resolved to a file - * @returns {Promise} - */ - static async resolveFile(fileLike) { - let attachment; - let name; - - const findName = (thing) => { - if (typeof thing === 'string') { - return Util.basename(thing); - } - - if (thing.path) { - return Util.basename(thing.path); - } - - return 'file.jpg'; - }; - - const ownAttachment = - typeof fileLike === 'string' || - fileLike instanceof Buffer || - typeof fileLike.pipe === 'function'; - if (ownAttachment) { - attachment = fileLike; - name = findName(attachment); - } else { - attachment = fileLike.attachment; - name = fileLike.name ?? findName(attachment); - } - - const resource = await DataResolver.resolveFile(attachment); - return { - attachment, - name, - file: resource, - description: fileLike.description, - duration_secs: fileLike.duration, - waveform: fileLike.waveform, - }; - } - - /** - * Creates a {@link MessagePayload} from user-level arguments. - * @param {MessageTarget} target Target to send to - * @param {string|MessageOptions|WebhookMessageOptions} options Options or content to use - * @param {MessageOptions|WebhookMessageOptions} [extra={}] Extra options to add onto specified options - * @returns {MessagePayload} - */ - static create(target, options, extra = {}) { - return new this( - target, - typeof options !== 'object' || options === null - ? { content: options, ...extra } - : { ...options, ...extra }, - ); - } -} - -module.exports = MessagePayload; - -/** - * A target for a message. - * @typedef {TextBasedChannels|User|GuildMember|Webhook|WebhookClient|Interaction|InteractionWebhook| - * Message|MessageManager} MessageTarget - */ - -/** - * @external APIMessage - * @see {@link https://discord.com/developers/docs/resources/channel#message-object} - */ diff --git a/vendor/discord.js-selfbot-v13/src/structures/MessageReaction.js b/vendor/discord.js-selfbot-v13/src/structures/MessageReaction.js deleted file mode 100644 index d898e67..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/MessageReaction.js +++ /dev/null @@ -1,187 +0,0 @@ -'use strict'; - -const GuildEmoji = require('./GuildEmoji'); -const ReactionEmoji = require('./ReactionEmoji'); -const ReactionUserManager = require('../managers/ReactionUserManager'); -const Util = require('../util/Util'); - -/** - * Represents a reaction to a message. - */ -class MessageReaction { - constructor(client, data, message) { - /** - * The client that instantiated this message reaction - * @name MessageReaction#client - * @type {Client} - * @readonly - */ - Object.defineProperty(this, 'client', { value: client }); - - /** - * The message that this reaction refers to - * @type {Message} - */ - this.message = message; - - /** - * Whether the client has given this reaction - * @type {boolean} - */ - this.me = data.me; - - /** - * Whether the client has super-reacted using this emoji - * @type {boolean} - */ - this.meBurst = Boolean(data.me_burst); - - /** - * A manager of the users that have given this reaction - * @type {ReactionUserManager} - */ - this.users = new ReactionUserManager(this, this.me ? [client.user] : []); - - this._emoji = new ReactionEmoji(this, data.emoji); - - this.burstColors = null; - - this._patch(data); - } - - _patch(data) { - if (data.burst_colors) { - /** - * Hexadecimal colors used for this super reaction - * @type {?string[]} - */ - this.burstColors = data.burst_colors; - } - - if ('count' in data) { - /** - * The number of people that have given the same reaction - * @type {?number} - */ - this.count ??= data.count; - } - - if ('count_details' in data) { - /** - * The reaction count details object contains information about super and normal reaction counts. - * @typedef {Object} ReactionCountDetailsData - * @property {number} burst Count of super reactions - * @property {number} normal Count of normal reactions - */ - - /** - * The reaction count details object contains information about super and normal reaction counts. - * @type {ReactionCountDetailsData} - */ - this.countDetails = { - burst: data.count_details.burst, - normal: data.count_details.normal, - }; - } else { - this.countDetails ??= { burst: 0, normal: 0 }; - } - } - - /** - * Removes all users from this reaction. - * @returns {Promise} - */ - async remove() { - await this.client.api - .channels(this.message.channelId) - .messages(this.message.id) - .reactions(this._emoji.identifier) - .delete(); - return this; - } - - /** - * The emoji of this reaction. Either a {@link GuildEmoji} object for known custom emojis, or a {@link ReactionEmoji} - * object which has fewer properties. Whatever the prototype of the emoji, it will still have - * `name`, `id`, `identifier` and `toString()` - * @type {GuildEmoji|ReactionEmoji} - * @readonly - */ - get emoji() { - if (this._emoji instanceof GuildEmoji) return this._emoji; - // Check to see if the emoji has become known to the client - if (this._emoji.id) { - const emojis = this.message.client.emojis.cache; - if (emojis.has(this._emoji.id)) { - const emoji = emojis.get(this._emoji.id); - this._emoji = emoji; - return emoji; - } - } - return this._emoji; - } - - /** - * Whether or not this reaction is a partial - * @type {boolean} - * @readonly - */ - get partial() { - return this.count === null; - } - - /** - * Fetch this reaction. - * @returns {Promise} - */ - async fetch() { - const message = await this.message.fetch(); - const existing = message.reactions.cache.get( - this.emoji.id ?? this.emoji.name, - ); - // The reaction won't get set when it has been completely removed - this._patch(existing ?? { count: 0 }); - return this; - } - - toJSON() { - return Util.flatten(this, { emoji: 'emojiId', message: 'messageId' }); - } - - _add(user, burst) { - if (this.partial) return; - this.users.cache.set(user.id, user); - if ( - !this.me || - user.id !== this.message.client.user.id || - this.count === 0 - ) { - this.count++; - if (burst) this.countDetails.burst++; - else this.countDetails.normal++; - } - if (user.id === this.message.client.user.id) { - if (burst) this.meBurst = true; - else this.me = true; - } - } - - _remove(user, burst) { - if (this.partial) return; - this.users.cache.delete(user.id); - if (!this.me || user.id !== this.message.client.user.id) { - this.count--; - if (burst) this.countDetails.burst--; - else this.countDetails.normal--; - } - if (user.id === this.message.client.user.id) { - if (burst) this.meBurst = false; - else this.me = false; - } - if (this.count <= 0 && this.users.cache.size === 0) { - this.message.reactions.cache.delete(this.emoji.id ?? this.emoji.name); - } - } -} - -module.exports = MessageReaction; diff --git a/vendor/discord.js-selfbot-v13/src/structures/MessageSelectMenu.js b/vendor/discord.js-selfbot-v13/src/structures/MessageSelectMenu.js deleted file mode 100644 index dce994b..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/MessageSelectMenu.js +++ /dev/null @@ -1,164 +0,0 @@ -'use strict'; - -const BaseMessageComponent = require('./BaseMessageComponent'); -const { ChannelTypes, MessageComponentTypes } = require('../util/Constants'); -const Util = require('../util/Util'); - -/** - * Represents a select menu message component - * @extends {BaseMessageComponent} - */ -class MessageSelectMenu extends BaseMessageComponent { - /** - * @typedef {BaseMessageComponentOptions} MessageSelectMenuOptions - * @property {string} [customId] A unique string to be sent in the interaction when clicked - * @property {string} [placeholder] Custom placeholder text to display when nothing is selected - * @property {number} [minValues] The minimum number of selections required - * @property {number} [maxValues] The maximum number of selections allowed - * @property {MessageSelectOption[]} [options] Options for the select menu - * @property {boolean} [disabled=false] Disables the select menu to prevent interactions - * @property {ChannelType[]} [channelTypes] List of channel types to include in the ChannelSelect component - */ - - /** - * @typedef {Object} MessageSelectOption - * @property {string} label The text to be displayed on this option - * @property {string} value The value to be sent for this option - * @property {?string} description Optional description to show for this option - * @property {?RawEmoji} emoji Emoji to display for this option - * @property {boolean} default Render this option as the default selection - */ - - /** - * @typedef {Object} MessageSelectOptionData - * @property {string} label The text to be displayed on this option - * @property {string} value The value to be sent for this option - * @property {string} [description] Optional description to show for this option - * @property {EmojiIdentifierResolvable} [emoji] Emoji to display for this option - * @property {boolean} [default] Render this option as the default selection - */ - - /** - * @param {MessageSelectMenu|MessageSelectMenuOptions} [data={}] MessageSelectMenu to clone or raw data - */ - constructor(data = {}) { - super({ - type: BaseMessageComponent.resolveType(data.type) ?? 'STRING_SELECT', - }); - - this.setup(data); - } - - setup(data) { - super.setup(data); - /** - * A unique string to be sent in the interaction when clicked - * @type {?string} - */ - this.customId = data.custom_id ?? data.customId ?? null; - - /** - * Custom placeholder text to display when nothing is selected - * @type {?string} - */ - this.placeholder = data.placeholder ?? null; - - /** - * The minimum number of selections required - * @type {?number} - */ - this.minValues = data.min_values ?? data.minValues ?? null; - - /** - * The maximum number of selections allowed - * @type {?number} - */ - this.maxValues = data.max_values ?? data.maxValues ?? null; - - /** - * Options for the STRING_SELECT menu - * @type {MessageSelectOption[]} - */ - this.options = this.constructor.normalizeOptions(data.options ?? []); - - /** - * Whether this select menu is currently disabled - * @type {boolean} - */ - this.disabled = data.disabled ?? false; - - /** - * Channels that are possible to select in CHANNEL_SELECT menu - * @type {ChannelType[]} - */ - this.channelTypes = - data.channel_types?.map((channelType) => - typeof channelType === 'string' - ? channelType - : ChannelTypes[channelType], - ) ?? []; - } - - /** - * Transforms the select menu into a plain object - * @returns {APIMessageSelectMenu} The raw data of this select menu - */ - toJSON() { - return { - channel_types: this.channelTypes.map((type) => - typeof type === 'string' ? ChannelTypes[type] : type, - ), - custom_id: this.customId, - disabled: this.disabled, - placeholder: this.placeholder, - min_values: this.minValues, - max_values: - this.maxValues ?? (this.minValues ? this.options.length : undefined), - options: this.options, - type: - typeof this.type === 'string' - ? MessageComponentTypes[this.type] - : this.type, - }; - } - - /** - * Normalizes option input and resolves strings and emojis. - * @param {MessageSelectOptionData} option The select menu option to normalize - * @returns {MessageSelectOption} - */ - static normalizeOption(option) { - let { label, value, description, emoji } = option; - - label = Util.verifyString(label, RangeError, 'SELECT_OPTION_LABEL'); - value = Util.verifyString(value, RangeError, 'SELECT_OPTION_VALUE'); - emoji = emoji ? Util.resolvePartialEmoji(emoji) : null; - description = description - ? Util.verifyString( - description, - RangeError, - 'SELECT_OPTION_DESCRIPTION', - true, - ) - : null; - - return { - label, - value, - description, - emoji, - default: option.default ?? false, - }; - } - - /** - * Normalizes option input and resolves strings and emojis. - * @param {...MessageSelectOptionData|MessageSelectOptionData[]} options The select menu options to normalize - * @returns {MessageSelectOption[]} - */ - static normalizeOptions(...options) { - return options.flat(Infinity).map((option) => this.normalizeOption(option)); - } -} - -module.exports = MessageSelectMenu; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Modal.js b/vendor/discord.js-selfbot-v13/src/structures/Modal.js deleted file mode 100644 index da63564..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Modal.js +++ /dev/null @@ -1,165 +0,0 @@ -'use strict'; - -const BaseMessageComponent = require('./BaseMessageComponent'); -const { InteractionTypes } = require('../util/Constants'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); -const Util = require('../util/Util'); - -/** - * Represents a modal (form) to be shown in response to an interaction - */ -class Modal { - /** - * @param {Object} data Modal to clone or raw data - * @param {Client} client The client constructing this Modal, if provided - */ - constructor(data = {}, client = null) { - /** - * A list of MessageActionRows in the modal - * @type {MessageActionRow[]} - */ - this.components = - data.components?.map((c) => BaseMessageComponent.create(c, client)) ?? []; - - /** - * A unique string to be sent in the interaction when submitted - * @type {?string} - */ - this.customId = data.custom_id; - - /** - * The title to be displayed on this modal - * @type {?string} - */ - this.title = data.title; - - /** - * Timestamp (Discord epoch) of when this modal was created - * @type {Snowflake} - */ - this.nonce = data.nonce; - - /** - * ID slash / button / menu when modal is displayed - * @type {Snowflake} - */ - this.id = data.id; - - /** - * Application sending the modal - * @type {Snowflake} - */ - this.applicationId = data.application.id; - - /** - * The id of the channel the message was sent in - * @type {Snowflake} - */ - this.channelId = data.channel_id; - - /** - * Whether this interaction has already been replied to - * @type {boolean} - */ - this.replied = false; - - Object.defineProperty(this, 'client', { - value: client, - writable: false, - }); - } - - /** - * The id of the guild the message was sent in, if any - * @type {?Snowflake} - * @readonly - */ - get guildId() { - return this.client.channels.cache.get(this.channelId)?.guildId || null; - } - - /** - * The channel that the message was sent in - * @type {TextBasedChannels} - * @readonly - */ - get channel() { - return this.client.channels.resolve(this.channelId); - } - - /** - * The guild the message was sent in (if in a guild channel) - * @type {?Guild} - * @readonly - */ - get guild() { - return ( - this.client.guilds.resolve(this.guildId) ?? this.channel?.guild ?? null - ); - } - - toJSON() { - return { - components: this.components.map((c) => c.toJSON()), - custom_id: this.customId, - title: this.title, - id: this.id, - }; - } - - /** - * Reply to this modal with data. (Event only) - * @returns {Promise} - * @example - * client.on('interactionModalCreate', modal => { - * // Modal > ActionRow > TextInput - * modal.components[0].components[0].setValue('1+1'); - * modal.components[1].components[0].setValue('hello'); - * modal.reply(); - * }) - */ - reply() { - if (!this.applicationId || !this.client || !this.channelId || this.replied) - throw new Error('Modal cannot reply'); - // Get Object - const dataFinal = this.toJSON(); - dataFinal.components = dataFinal.components - .map((c) => { - c.components[0] = { - type: c.components[0].type, - value: c.components[0].value, - custom_id: c.components[0].custom_id, - }; - return c; - }) - .filter((c) => typeof c.components[0].value == 'string'); - delete dataFinal.title; - const nonce = SnowflakeUtil.generate(); - const postData = { - type: InteractionTypes.MODAL_SUBMIT, // Modal - application_id: this.applicationId, - guild_id: this.guildId, - channel_id: this.channelId, - data: dataFinal, - nonce, - session_id: this.client.sessionId, - }; - this.client.api.interactions.post({ - data: postData, - }); - this.replied = true; - return Util.createPromiseInteraction(this.client, nonce, 5_000, true, this); - } - - // TypeScript - /** - * Check data - * @type {boolean} - * @readonly - */ - get isMessage() { - return false; - } -} - -module.exports = Modal; diff --git a/vendor/discord.js-selfbot-v13/src/structures/ModalSubmitFieldsResolver.js b/vendor/discord.js-selfbot-v13/src/structures/ModalSubmitFieldsResolver.js deleted file mode 100644 index 81b5487..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/ModalSubmitFieldsResolver.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; - -const { TypeError } = require('../errors'); -const { MessageComponentTypes } = require('../util/Constants'); - -/** - * A resolver for modal submit interaction text inputs. - */ -class ModalSubmitFieldsResolver { - constructor(components) { - /** - * The components within the modal - * @type {PartialModalActionRow[]} The components in the modal - */ - this.components = components; - } - - /** - * The extracted fields from the modal - * @type {PartialInputTextData[]} The fields in the modal - * @private - */ - get _fields() { - return this.components.reduce( - (previous, next) => previous.concat(next.components), - [], - ); - } - - /** - * Gets a field given a custom id from a component - * @param {string} customId The custom id of the component - * @returns {?PartialInputTextData} - */ - getField(customId) { - const field = this._fields.find((f) => f.customId === customId); - if (!field) - throw new TypeError('MODAL_SUBMIT_INTERACTION_FIELD_NOT_FOUND', customId); - return field; - } - - /** - * Gets the value of a text input component given a custom id - * @param {string} customId The custom id of the text input component - * @returns {?string} - */ - getTextInputValue(customId) { - const field = this.getField(customId); - const expectedType = - MessageComponentTypes[MessageComponentTypes.TEXT_INPUT]; - if (field.type !== expectedType) { - throw new TypeError( - 'MODAL_SUBMIT_INTERACTION_FIELD_TYPE', - customId, - field.type, - expectedType, - ); - } - return field.value; - } -} - -module.exports = ModalSubmitFieldsResolver; diff --git a/vendor/discord.js-selfbot-v13/src/structures/ModalSubmitInteraction.js b/vendor/discord.js-selfbot-v13/src/structures/ModalSubmitInteraction.js deleted file mode 100644 index c56d3ff..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/ModalSubmitInteraction.js +++ /dev/null @@ -1,128 +0,0 @@ -'use strict'; - -const Interaction = require('./Interaction'); -const InteractionWebhook = require('./InteractionWebhook'); -const ModalSubmitFieldsResolver = require('./ModalSubmitFieldsResolver'); -const InteractionResponses = require('./interfaces/InteractionResponses'); -const { MessageComponentTypes } = require('../util/Constants'); - -/** - * Represents a modal submit interaction. - * @extends {Interaction} - * @implements {InteractionResponses} - */ -class ModalSubmitInteraction extends Interaction { - constructor(client, data) { - super(client, data); - - /** - * The custom id of the modal. - * @type {string} - */ - this.customId = data.data.custom_id; - - /** - * @typedef {Object} PartialTextInputData - * @property {string} [customId] A unique string to be sent in the interaction when submitted - * @property {MessageComponentType} [type] The type of this component - * @property {string} [value] Value of this text input component - */ - - /** - * @typedef {Object} PartialModalActionRow - * @property {MessageComponentType} [type] The type of this component - * @property {PartialTextInputData[]} [components] Partial text input components - */ - - /** - * The inputs within the modal - * @type {PartialModalActionRow[]} - */ - this.components = - data.data.components?.map((c) => ({ - type: MessageComponentTypes[c.type], - components: ModalSubmitInteraction.transformComponent(c), - })) ?? []; - - /** - * The message associated with this interaction - * @type {Message|APIMessage|null} - */ - this.message = data.message - ? (this.channel?.messages._add(data.message) ?? data.message) - : null; - - /** - * The fields within the modal - * @type {ModalSubmitFieldsResolver} - */ - this.fields = new ModalSubmitFieldsResolver(this.components); - - /** - * Whether the reply to this interaction has been deferred - * @type {boolean} - */ - this.deferred = false; - - /** - * Whether the reply to this interaction is ephemeral - * @type {?boolean} - */ - this.ephemeral = null; - - /** - * Whether this interaction has already been replied to - * @type {boolean} - */ - this.replied = false; - - /** - * An associated interaction webhook, can be used to further interact with this interaction - * @type {InteractionWebhook} - */ - this.webhook = new InteractionWebhook( - this.client, - this.applicationId, - this.token, - ); - } - - /** - * Transforms component data to discord.js-compatible data - * @param {*} rawComponent The data to transform - * @returns {PartialTextInputData[]} - */ - static transformComponent(rawComponent) { - return rawComponent.components.map((c) => ({ - value: c.value, - type: MessageComponentTypes[c.type], - customId: c.custom_id, - })); - } - - /** - * Whether this is from a {@link MessageComponentInteraction}. - * @returns {boolean} - */ - isFromMessage() { - return Boolean(this.message); - } - - // These are here only for documentation purposes - they are implemented by InteractionResponses - /* eslint-disable no-empty-function */ - deferReply() {} - reply() {} - fetchReply() {} - editReply() {} - deleteReply() {} - followUp() {} - update() {} - deferUpdate() {} -} - -InteractionResponses.applyToClass(ModalSubmitInteraction, [ - 'showModal', - 'awaitModalSubmit', -]); - -module.exports = ModalSubmitInteraction; diff --git a/vendor/discord.js-selfbot-v13/src/structures/NewsChannel.js b/vendor/discord.js-selfbot-v13/src/structures/NewsChannel.js deleted file mode 100644 index b5ef4ee..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/NewsChannel.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -const BaseGuildTextChannel = require('./BaseGuildTextChannel'); -const { Error } = require('../errors'); - -/** - * Represents a guild news channel on Discord. - * @extends {BaseGuildTextChannel} - */ -class NewsChannel extends BaseGuildTextChannel { - /** - * Adds the target to this channel's followers. - * If you need the created webhook id, use {@link GuildChannelManager#addFollower}. - * @param {TextChannelResolvable} channel The channel where the webhook should be created - * @param {string} [reason] Reason for creating the webhook - * @returns {Promise} - * @example - * if (channel.type === 'GUILD_NEWS') { - * channel.addFollower('222197033908436994', 'Important announcements') - * .then(() => console.log('Added follower')) - * .catch(console.error); - * } - */ - async addFollower(channel, reason) { - const channelId = this.guild.channels.resolveId(channel); - if (!channelId) throw new Error('GUILD_CHANNEL_RESOLVE'); - await this.client.api - .channels(this.id) - .followers.post({ data: { webhook_channel_id: channelId }, reason }); - return this; - } -} - -module.exports = NewsChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/OAuth2Guild.js b/vendor/discord.js-selfbot-v13/src/structures/OAuth2Guild.js deleted file mode 100644 index 3f44ad4..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/OAuth2Guild.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -const BaseGuild = require('./BaseGuild'); -const Permissions = require('../util/Permissions'); - -/** - * A partial guild received when using {@link GuildManager#fetch} to fetch multiple guilds. - * @extends {BaseGuild} - */ -class OAuth2Guild extends BaseGuild { - constructor(client, data) { - super(client, data); - - /** - * Whether the client user is the owner of the guild - * @type {boolean} - */ - this.owner = data.owner; - - /** - * The permissions that the client user has in this guild - * @type {Readonly} - */ - this.permissions = new Permissions(BigInt(data.permissions)).freeze(); - } -} - -module.exports = OAuth2Guild; diff --git a/vendor/discord.js-selfbot-v13/src/structures/PermissionOverwrites.js b/vendor/discord.js-selfbot-v13/src/structures/PermissionOverwrites.js deleted file mode 100644 index 7da3d1f..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/PermissionOverwrites.js +++ /dev/null @@ -1,215 +0,0 @@ -'use strict'; - -const Base = require('./Base'); -const { Role } = require('./Role'); -const { TypeError } = require('../errors'); -const { OverwriteTypes } = require('../util/Constants'); -const Permissions = require('../util/Permissions'); - -/** - * Represents a permission overwrite for a role or member in a guild channel. - * @extends {Base} - */ -class PermissionOverwrites extends Base { - constructor(client, data, channel) { - super(client); - - /** - * The GuildChannel this overwrite is for - * @name PermissionOverwrites#channel - * @type {GuildChannel} - * @readonly - */ - Object.defineProperty(this, 'channel', { value: channel }); - - if (data) this._patch(data); - } - - _patch(data) { - /** - * The overwrite's id, either a {@link User} or a {@link Role} id - * @type {Snowflake} - */ - this.id = data.id; - - if ('type' in data) { - /** - * The type of this overwrite - * @type {OverwriteType} - */ - this.type = - typeof data.type === 'number' ? OverwriteTypes[data.type] : data.type; - } - - if ('deny' in data) { - /** - * The permissions that are denied for the user or role. - * @type {Readonly} - */ - this.deny = new Permissions(BigInt(data.deny)).freeze(); - } - - if ('allow' in data) { - /** - * The permissions that are allowed for the user or role. - * @type {Readonly} - */ - this.allow = new Permissions(BigInt(data.allow)).freeze(); - } - } - - /** - * Edits this Permission Overwrite. - * @param {PermissionOverwriteOptions} options The options for the update - * @param {string} [reason] Reason for creating/editing this overwrite - * @returns {Promise} - * @example - * // Update permission overwrites - * permissionOverwrites.edit({ - * SEND_MESSAGES: false - * }) - * .then(channel => console.log(channel.permissionOverwrites.get(message.author.id))) - * .catch(console.error); - */ - async edit(options, reason) { - await this.channel.permissionOverwrites.upsert( - this.id, - options, - { type: OverwriteTypes[this.type], reason }, - this, - ); - return this; - } - - /** - * Deletes this Permission Overwrite. - * @param {string} [reason] Reason for deleting this overwrite - * @returns {Promise} - */ - async delete(reason) { - await this.channel.permissionOverwrites.delete(this.id, reason); - return this; - } - - toJSON() { - return { - id: this.id, - type: OverwriteTypes[this.type], - allow: this.allow, - deny: this.deny, - }; - } - - /** - * An object mapping permission flags to `true` (enabled), `null` (unset) or `false` (disabled). - * ```js - * { - * 'SEND_MESSAGES': true, - * 'EMBED_LINKS': null, - * 'ATTACH_FILES': false, - * } - * ``` - * @typedef {Object} PermissionOverwriteOptions - */ - - /** - * @typedef {Object} ResolvedOverwriteOptions - * @property {Permissions} allow The allowed permissions - * @property {Permissions} deny The denied permissions - */ - - /** - * Resolves bitfield permissions overwrites from an object. - * @param {PermissionOverwriteOptions} options The options for the update - * @param {ResolvedOverwriteOptions} initialPermissions The initial permissions - * @returns {ResolvedOverwriteOptions} - */ - static resolveOverwriteOptions(options, { allow, deny } = {}) { - allow = new Permissions(allow); - deny = new Permissions(deny); - - for (const [perm, value] of Object.entries(options)) { - if (value === true) { - allow.add(perm); - deny.remove(perm); - } else if (value === false) { - allow.remove(perm); - deny.add(perm); - } else if (value === null) { - allow.remove(perm); - deny.remove(perm); - } - } - - return { allow, deny }; - } - - /** - * The raw data for a permission overwrite - * @typedef {Object} RawOverwriteData - * @property {Snowflake} id The id of the {@link Role} or {@link User} this overwrite belongs to - * @property {string} allow The permissions to allow - * @property {string} deny The permissions to deny - * @property {number} type The type of this OverwriteData - */ - - /** - * Data that can be resolved into {@link RawOverwriteData}. This can be: - * * PermissionOverwrites - * * OverwriteData - * @typedef {PermissionOverwrites|OverwriteData} OverwriteResolvable - */ - - /** - * Data that can be used for a permission overwrite - * @typedef {Object} OverwriteData - * @property {GuildMemberResolvable|RoleResolvable} id Member or role this overwrite is for - * @property {PermissionResolvable} [allow] The permissions to allow - * @property {PermissionResolvable} [deny] The permissions to deny - * @property {OverwriteType} [type] The type of this OverwriteData - */ - - /** - * Resolves an overwrite into {@link RawOverwriteData}. - * @param {OverwriteResolvable} overwrite The overwrite-like data to resolve - * @param {Guild} [guild] The guild to resolve from - * @returns {RawOverwriteData} - */ - static resolve(overwrite, guild) { - if (overwrite instanceof this) return overwrite.toJSON(); - if (typeof overwrite.id === 'string' && overwrite.type in OverwriteTypes) { - return { - id: overwrite.id, - type: OverwriteTypes[overwrite.type], - allow: Permissions.resolve( - overwrite.allow ?? Permissions.defaultBit, - ).toString(), - deny: Permissions.resolve( - overwrite.deny ?? Permissions.defaultBit, - ).toString(), - }; - } - - const userOrRole = - guild.roles.resolve(overwrite.id) ?? - guild.client.users.resolve(overwrite.id); - if (!userOrRole) { - throw new TypeError('INVALID_TYPE', 'parameter', 'cached User or Role'); - } - const type = - userOrRole instanceof Role ? OverwriteTypes.role : OverwriteTypes.member; - - return { - id: userOrRole.id, - type, - allow: Permissions.resolve( - overwrite.allow ?? Permissions.defaultBit, - ).toString(), - deny: Permissions.resolve( - overwrite.deny ?? Permissions.defaultBit, - ).toString(), - }; - } -} - -module.exports = PermissionOverwrites; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Poll.js b/vendor/discord.js-selfbot-v13/src/structures/Poll.js deleted file mode 100644 index 7e5e40a..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Poll.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const Base = require('./Base'); -const { PollAnswer } = require('./PollAnswer'); -const { Error } = require('../errors'); -const { PollLayoutTypes } = require('../util/Constants'); - -/** - * Represents a Poll - * @extends {Base} - */ -class Poll extends Base { - constructor(client, data, message) { - super(client); - - /** - * The message that started this poll - * @name Poll#message - * @type {Message} - * @readonly - */ - - Object.defineProperty(this, 'message', { value: message }); - - /** - * The media for a poll's question - * @typedef {Object} PollQuestionMedia - * @property {string} text The text of this question - */ - - /** - * The media for this poll's question - * @type {PollQuestionMedia} - */ - this.question = { - text: data.question.text, - }; - - /** - * The answers of this poll - * @type {Collection} - */ - this.answers = data.answers.reduce( - (acc, answer) => - acc.set(answer.answer_id, new PollAnswer(this.client, answer, this)), - new Collection(), - ); - - /** - * The timestamp when this poll expires - * @type {number} - */ - this.expiresTimestamp = Date.parse(data.expiry); - - /** - * Whether this poll allows multiple answers - * @type {boolean} - */ - this.allowMultiselect = data.allow_multiselect; - - /** - * The layout type of this poll - * @type {PollLayoutType} - */ - this.layoutType = PollLayoutTypes[data.layout_type]; - - this._patch(data); - } - - _patch(data) { - if (data.results) { - /** - * Whether this poll's results have been precisely counted - * @type {boolean} - */ - this.resultsFinalized = data.results.is_finalized; - - for (const answerResult of data.results.answer_counts) { - const answer = this.answers.get(answerResult.id); - answer?._patch(answerResult); - } - } else { - this.resultsFinalized ??= false; - } - } - - /** - * The date when this poll expires - * @type {Date} - * @readonly - */ - get expiresAt() { - return new Date(this.expiresTimestamp); - } - - /** - * Ends this poll. - * @returns {Promise} - */ - async end() { - if (Date.now() > this.expiresTimestamp) { - throw new Error('POLL_ALREADY_EXPIRED'); - } - return this.message.channel.messages.endPoll(this.message.id); - } -} - -module.exports = { Poll }; diff --git a/vendor/discord.js-selfbot-v13/src/structures/PollAnswer.js b/vendor/discord.js-selfbot-v13/src/structures/PollAnswer.js deleted file mode 100644 index 2de37da..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/PollAnswer.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -const Base = require('./Base'); -const { Emoji } = require('./Emoji'); - -/** - * Represents an answer to a {@link Poll} - * @extends {Base} - */ -class PollAnswer extends Base { - constructor(client, data, poll) { - super(client); - - /** - * The {@link Poll} this answer is part of - * @name PollAnswer#poll - * @type {Poll} - * @readonly - */ - Object.defineProperty(this, 'poll', { value: poll }); - - /** - * The id of this answer - * @type {number} - */ - this.id = data.answer_id; - - /** - * The text of this answer - * @type {?string} - */ - this.text = data.poll_media.text ?? null; - - /** - * The raw emoji of this answer - * @name PollAnswer#_emoji - * @type {?APIPartialEmoji} - * @private - */ - Object.defineProperty(this, '_emoji', { - value: data.poll_media.emoji ?? null, - }); - - this._patch(data); - } - - _patch(data) { - // This `count` field comes from `poll.results.answer_counts` - if ('count' in data) { - /** - * The amount of votes this answer has - * @type {number} - */ - this.voteCount = data.count; - } else { - this.voteCount ??= 0; - } - } - - /** - * The emoji of this answer - * @type {?(GuildEmoji|Emoji)} - */ - get emoji() { - if (!this._emoji || (!this._emoji.id && !this._emoji.name)) return null; - return ( - this.client.emojis.cache.get(this._emoji.id) ?? - new Emoji(this.client, this._emoji) - ); - } - - /** - * @typedef {Object} FetchPollVotersOptions - * @property {number} [limit] The maximum number of voters to fetch - * @property {Snowflake} [after] The user id to fetch voters after - */ - - /** - * Fetches the users that voted for this answer - * @param {FetchPollVotersOptions} [options={}] The options for fetching voters - * @returns {Promise>} - */ - fetchVoters({ after, limit } = {}) { - return this.poll.message.channel.messages.fetchPollAnswerVoters({ - messageId: this.poll.message.id, - answerId: this.id, - after, - limit, - }); - } -} - -module.exports = { PollAnswer }; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Presence.js b/vendor/discord.js-selfbot-v13/src/structures/Presence.js deleted file mode 100644 index f18560d..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Presence.js +++ /dev/null @@ -1,1165 +0,0 @@ -'use strict'; - -const { randomUUID } = require('node:crypto'); -const Base = require('./Base'); -const ActivityFlags = require('../util/ActivityFlags'); -const { ActivityTypes } = require('../util/Constants'); -const Util = require('../util/Util'); - -/** - * Activity sent in a message. - * @typedef {Object} MessageActivity - * @property {string} [partyId] Id of the party represented in activity - * @property {MessageActivityType} type Type of activity sent - */ - -/** - * The status of this presence: - * * **`online`** - user is online - * * **`idle`** - user is AFK - * * **`offline`** - user is offline or invisible - * * **`dnd`** - user is in Do Not Disturb - * @typedef {string} PresenceStatus - */ - -/** - * The status of this presence: - * * **`online`** - user is online - * * **`idle`** - user is AFK - * * **`dnd`** - user is in Do Not Disturb - * @typedef {string} ClientPresenceStatus - */ - -/** - * Represents a user's presence. - * @extends {Base} - */ -class Presence extends Base { - constructor(client, data = {}) { - super(client); - - /** - * The presence's user id - * @type {Snowflake} - */ - this.userId = data.user.id; - - /** - * The guild this presence is in - * @type {?Guild} - */ - this.guild = data.guild ?? null; - - this._patch(data); - } - - /** - * The user of this presence - * @type {?User} - * @readonly - */ - get user() { - return this.client.users.resolve(this.userId); - } - - /** - * The member of this presence - * @type {?GuildMember} - * @readonly - */ - get member() { - return this.guild.members.resolve(this.userId); - } - - _patch(data) { - if ('status' in data) { - /** - * The status of this presence - * @type {PresenceStatus} - */ - this.status = data.status; - } else { - this.status ??= 'offline'; - } - - if ('activities' in data) { - /** - * The activities of this presence (Always `Activity[]` if not ClientUser) - * @type {CustomStatus[]|RichPresence[]|SpotifyRPC[]|Activity[]} - */ - this.activities = data.activities.map((activity) => { - if (this.userId == this.client.user.id) { - if ([ActivityTypes.CUSTOM, 'CUSTOM'].includes(activity.type)) { - return new CustomStatus(this.client, activity); - } else if (activity.id == 'spotify:1') { - return new SpotifyRPC(this.client, activity); - } else { - return new RichPresence(this.client, activity); - } - } else { - return new Activity(this, activity); - } - }); - } else { - this.activities ??= []; - } - - if ('client_status' in data) { - /** - * The devices this presence is on - * @type {?Object} - * @property {?ClientPresenceStatus} web The current presence in the web application - * @property {?ClientPresenceStatus} mobile The current presence in the mobile application - * @property {?ClientPresenceStatus} desktop The current presence in the desktop application - */ - this.clientStatus = data.client_status; - } else { - this.clientStatus ??= null; - } - - if ('last_modified' in data) { - /** - * The timestamp this presence was last updated - * @type {number} - */ - this.lastModified = data.last_modified; - } - - if ('afk' in data) { - this.afk = data.afk; - } else { - this.afk ??= false; - } - - if ('since' in data) { - this.since = data.since; - } else { - this.since ??= 0; - } - - return this; - } - - _clone() { - const clone = Object.assign(Object.create(this), this); - clone.activities = this.activities.map((activity) => activity._clone()); - return clone; - } - - /** - * Whether this presence is equal to another. - * @param {Presence} presence The presence to compare with - * @returns {boolean} - */ - equals(presence) { - return ( - this === presence || - (presence && - this.status === presence.status && - this.clientStatus?.web === presence.clientStatus?.web && - this.clientStatus?.mobile === presence.clientStatus?.mobile && - this.clientStatus?.desktop === presence.clientStatus?.desktop && - this.activities.length === presence.activities.length && - this.activities.every((activity, index) => - activity.equals(presence.activities[index]), - )) - ); - } - - toJSON() { - return Util.flatten(this); - } -} - -/** - * The platform of this activity: - * * **`desktop`** - * * **`samsung`** - playing on Samsung Galaxy - * * **`xbox`** - playing on Xbox Live - * * **`ios`** - * * **`android`** - * * **`embedded`** - * * **`ps4`** - * * **`ps5`** - * @typedef {string} ActivityPlatform - */ - -/** - * Represents an activity that is part of a user's presence. - */ -class Activity { - constructor(presence, data) { - if (!(presence instanceof Presence)) { - throw new Error( - "Class constructor Activity cannot be invoked without 'presence'", - ); - } - /** - * The presence of the Activity - * @type {Presence} - * @readonly - * @name Activity#presence - */ - Object.defineProperty(this, 'presence', { value: presence }); - - this._patch(data); - } - - _patch(data = {}) { - if ('id' in data) { - /** - * The activity's id - * @type {string} - */ - this.id = data.id; - } - - if ('name' in data) { - /** - * The activity's name - * @type {string} - */ - this.name = data.name; - } - - if ('type' in data) { - /** - * The activity status's type - * @type {ActivityType} - */ - this.type = - typeof data.type === 'number' ? ActivityTypes[data.type] : data.type; - } - - if ('url' in data) { - /** - * If the activity is being streamed, a link to the stream - * @type {?string} - */ - this.url = data.url; - } else { - this.url = null; - } - - if ('created_at' in data || 'createdTimestamp' in data) { - /** - * Creation date of the activity - * @type {number} - */ - this.createdTimestamp = data.created_at || data.createdTimestamp; - } - - if ('session_id' in data) { - /** - * The game's or Spotify session's id - * @type {?string} - */ - this.sessionId = data.session_id; - } else { - this.sessionId = this.presence.client?.sessionId; - } - - if ('platform' in data) { - /** - * The platform the game is being played on - * @type {?ActivityPlatform} - */ - this.platform = data.platform; - } else { - this.platform = null; - } - - if ('timestamps' in data && data.timestamps) { - /** - * Represents timestamps of an activity - * @typedef {Object} ActivityTimestamps - * @property {?number} start When the activity started - * @property {?number} end When the activity will end - */ - - /** - * Timestamps for the activity - * @type {?ActivityTimestamps} - */ - this.timestamps = { - start: data.timestamps.start - ? new Date(data.timestamps.start).getTime() - : null, - end: data.timestamps.end - ? new Date(data.timestamps.end).getTime() - : null, - }; - } else { - this.timestamps = null; - } - - if ('application_id' in data || 'applicationId' in data) { - /** - * The id of the application associated with this activity - * @type {?Snowflake} - */ - this.applicationId = data.application_id || data.applicationId; - } else { - this.applicationId = null; - } - - if ('details' in data) { - /** - * Details about the activity - * @type {?string} - */ - this.details = data.details; - } else { - this.details = null; - } - - if ('state' in data) { - /** - * State of the activity - * @type {?string} - */ - this.state = data.state; - } else { - this.state = null; - } - - if ('sync_id' in data || 'syncId' in data) { - /** - * The sync id of the activity - * This property is not documented by Discord and represents the track id in spotify activities. - * @type {?string} - */ - this.syncId = data.sync_id || data.syncId; - } else { - this.syncId = null; - } - - if ('flags' in data) { - /** - * Flags that describe the activity - * @type {Readonly} - */ - this.flags = new ActivityFlags(data.flags).freeze(); - } else { - this.flags = new ActivityFlags().freeze(); - } - - if ('buttons' in data) { - /** - * The labels of the buttons of this rich presence - * @type {string[]} - */ - this.buttons = data.buttons; - } else { - this.buttons = []; - } - - if ('emoji' in data && data.emoji) { - /** - * Emoji for a custom activity - * @type {?EmojiIdentifierResolvable} - */ - this.emoji = Util.resolvePartialEmoji(data.emoji); - } else { - this.emoji = null; - } - - if ('party' in data) { - /** - * Represents a party of an activity - * @typedef {Object} ActivityParty - * @property {?string} id The party's id - * @property {number[]} size Size of the party as `[current, max]` - */ - - /** - * Party of the activity - * @type {?ActivityParty} - */ - this.party = data.party; - } else { - this.party = null; - } - - /** - * Assets for rich presence - * @type {?RichPresenceAssets} - */ - this.assets = new RichPresenceAssets(this, data.assets); - } - - /** - * Whether this activity is equal to another activity. - * @param {Activity} activity The activity to compare with - * @returns {boolean} - */ - equals(activity) { - return ( - this === activity || - (activity && - this.name === activity.name && - this.type === activity.type && - this.url === activity.url && - this.state === activity.state && - this.details === activity.details && - this.emoji?.id === activity.emoji?.id && - this.emoji?.name === activity.emoji?.name) - ); - } - - /** - * The time the activity was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * When concatenated with a string, this automatically returns the activities' name instead of the Activity object. - * @returns {string} - */ - toString() { - return this.name; - } - - _clone() { - return Object.assign(Object.create(this), this); - } - - toJSON(...props) { - return Util.clearNullOrUndefinedObject({ - ...Util.flatten(this, ...props), - type: - typeof this.type === 'number' ? this.type : ActivityTypes[this.type], - }); - } -} - -/** - * Assets for a rich presence - */ -class RichPresenceAssets { - constructor(activity, assets) { - /** - * The activity of the RichPresenceAssets - * @type {Activity} - * @readonly - * @name RichPresenceAssets#activity - */ - Object.defineProperty(this, 'activity', { value: activity }); - - this._patch(assets); - } - - _patch(assets = {}) { - if ('large_text' in assets || 'largeText' in assets) { - /** - * Hover text for the large image - * @type {?string} - */ - this.largeText = assets.large_text || assets.largeText; - } else { - this.largeText = null; - } - - if ('small_text' in assets || 'smallText' in assets) { - /** - * Hover text for the small image - * @type {?string} - */ - this.smallText = assets.small_text || assets.smallText; - } else { - this.smallText = null; - } - - if ('large_image' in assets || 'largeImage' in assets) { - /** - * The large image asset's id - * @type {?Snowflake} - */ - this.largeImage = assets.large_image || assets.largeImage; - } else { - this.largeImage = null; - } - - if ('small_image' in assets || 'smallImage' in assets) { - /** - * The small image asset's id - * @type {?Snowflake} - */ - this.smallImage = assets.small_image || assets.smallImage; - } else { - this.smallImage = null; - } - } - - /** - * Gets the URL of the small image asset - * @param {StaticImageURLOptions} [options] Options for the image URL - * @returns {?string} - */ - smallImageURL({ format, size } = {}) { - if (!this.smallImage) return null; - if (this.smallImage.includes(':')) { - const [platform, id] = this.smallImage.split(':'); - switch (platform) { - case 'mp': - return `https://media.discordapp.net/${id}`; - case 'spotify': - return `https://i.scdn.co/image/${id}`; - case 'youtube': - return `https://i.ytimg.com/vi/${id}/hqdefault_live.jpg`; - case 'twitch': - return `https://static-cdn.jtvnw.net/previews-ttv/live_user_${id}.png`; - default: - return null; - } - } - - return this.activity.presence.client.rest.cdn.AppAsset( - this.activity.applicationId, - this.smallImage, - { - format, - size, - }, - ); - } - - /** - * Gets the URL of the large image asset - * @param {StaticImageURLOptions} [options] Options for the image URL - * @returns {?string} - */ - largeImageURL({ format, size } = {}) { - if (!this.largeImage) return null; - if (this.largeImage.includes(':')) { - const [platform, id] = this.largeImage.split(':'); - switch (platform) { - case 'mp': - return `https://media.discordapp.net/${id}`; - case 'spotify': - return `https://i.scdn.co/image/${id}`; - case 'youtube': - return `https://i.ytimg.com/vi/${id}/hqdefault_live.jpg`; - case 'twitch': - return `https://static-cdn.jtvnw.net/previews-ttv/live_user_${id}.png`; - default: - return null; - } - } - - return this.activity.presence.client.rest.cdn.AppAsset( - this.activity.applicationId, - this.largeImage, - { - format, - size, - }, - ); - } - - static parseImage(image) { - if (typeof image != 'string') { - image = null; - } else if ( - URL.canParse(image) && - ['http:', 'https:'].includes(new URL(image).protocol) - ) { - // Discord URL: - image = image - .replace('https://cdn.discordapp.com/', 'mp:') - .replace('http://cdn.discordapp.com/', 'mp:') - .replace('https://media.discordapp.net/', 'mp:') - .replace('http://media.discordapp.net/', 'mp:'); - // - if (!image.startsWith('mp:')) { - throw new Error('INVALID_URL'); - } - } else if (/^[0-9]{17,19}$/.test(image)) { - // ID Assets - } else if ( - ['mp:', 'youtube:', 'spotify:', 'twitch:'].some((v) => - image.startsWith(v), - ) - ) { - // Image - } else if (image.startsWith('external/')) { - image = `mp:${image}`; - } - return image; - } - - toJSON() { - if ( - !this.largeImage && - !this.largeText && - !this.smallImage && - !this.smallText - ) - return null; - return { - large_image: RichPresenceAssets.parseImage(this.largeImage), - large_text: this.largeText, - small_image: RichPresenceAssets.parseImage(this.smallImage), - small_text: this.smallText, - }; - } - - /** - * @typedef {string} RichPresenceImage - * Support: - * - cdn.discordapp.com - * - media.discordapp.net - * - Assets ID (https://discord.com/api/v9/oauth2/applications/{application_id}/assets) - * - Media Proxy (mp:external/{hash}) - * - Twitch (twitch:{username}) - * - YouTube (youtube:{video_id}) - * - Spotify (spotify:{image_id}) - */ - - /** - * Set the large image of this activity - * @param {?RichPresenceImage} image The large image asset's id - * @returns {RichPresenceAssets} - */ - setLargeImage(image) { - image = RichPresenceAssets.parseImage(image); - this.largeImage = image; - return this; - } - - /** - * Set the small image of this activity - * @param {?RichPresenceImage} image The small image asset's id - * @returns {RichPresenceAssets} - */ - setSmallImage(image) { - image = RichPresenceAssets.parseImage(image); - this.smallImage = image; - return this; - } - - /** - * Hover text for the large image - * @param {string} text Assets text - * @returns {RichPresenceAssets} - */ - setLargeText(text) { - this.largeText = text; - return this; - } - - /** - * Hover text for the small image - * @param {string} text Assets text - * @returns {RichPresenceAssets} - */ - setSmallText(text) { - this.smallText = text; - return this; - } -} - -class CustomStatus extends Activity { - /** - * @typedef {Object} CustomStatusOptions - * @property {string} [state] The state to be displayed - * @property {EmojiIdentifierResolvable} [emoji] The emoji to be displayed - */ - - /** - * @param {Client} client Discord Client - * @param {CustomStatus|CustomStatusOptions} [data={}] CustomStatus to clone or raw data - */ - constructor(client, data = {}) { - if (!client) - throw new Error( - "Class constructor CustomStatus cannot be invoked without 'client'", - ); - super('presence' in client ? client.presence : client, { - name: ' ', - type: ActivityTypes.CUSTOM, - ...data, - }); - } - - /** - * Set the emoji of this activity - * @param {EmojiIdentifierResolvable} emoji The emoji to be displayed - * @returns {CustomStatus} - */ - setEmoji(emoji) { - this.emoji = Util.resolvePartialEmoji(emoji); - return this; - } - - /** - * Set state of this activity - * @param {string | null} state The state to be displayed - * @returns {CustomStatus} - */ - setState(state) { - if (typeof state == 'string' && state.length > 128) - throw new Error('State must be less than 128 characters'); - this.state = state; - return this; - } - - /** - * Returns an object that can be used to set the status - * @returns {CustomStatus} - */ - toJSON() { - if (!this.emoji & !this.state) - throw new Error('CustomStatus must have at least one of emoji or state'); - return { - name: this.name, - emoji: this.emoji, - type: ActivityTypes.CUSTOM, - state: this.state, - }; - } -} - -class RichPresence extends Activity { - /** - * @param {Client} client Discord client - * @param {RichPresence} [data={}] RichPresence to clone or raw data - */ - constructor(client, data = {}) { - if (!client) - throw new Error( - "Class constructor RichPresence cannot be invoked without 'client'", - ); - super('presence' in client ? client.presence : client, { - type: 0, - ...data, - }); - this.setup(data); - } - - /** - * Sets the status from a JSON object - * @param {RichPresence} data data - * @private - */ - setup(data = {}) { - this.secrets = 'secrets' in data ? data.secrets : {}; - this.metadata = 'metadata' in data ? data.metadata : {}; - } - - /** - * Set the large image of this activity - * @param {?RichPresenceImage} image The large image asset's id - * @returns {RichPresence} - */ - setAssetsLargeImage(image) { - this.assets.setLargeImage(image); - return this; - } - - /** - * Set the small image of this activity - * @param {?RichPresenceImage} image The small image asset's id - * @returns {RichPresence} - */ - setAssetsSmallImage(image) { - this.assets.setSmallImage(image); - return this; - } - - /** - * Hover text for the large image - * @param {string} text Assets text - * @returns {RichPresence} - */ - setAssetsLargeText(text) { - this.assets.setLargeText(text); - return this; - } - - /** - * Hover text for the small image - * @param {string} text Assets text - * @returns {RichPresence} - */ - setAssetsSmallText(text) { - this.assets.setSmallText(text); - return this; - } - - /** - * Set the name of the activity - * @param {?string} name The activity's name - * @returns {RichPresence} - */ - setName(name) { - this.name = name; - return this; - } - - /** - * If the activity is being streamed, a link to the stream - * @param {?string} url URL of the stream - * @returns {RichPresence} - */ - setURL(url) { - if (typeof url == 'string' && !URL.canParse(url)) - throw new Error('URL must be a valid URL'); - this.url = url; - return this; - } - - /** - * The activity status's type - * @param {?ActivityTypes} type The type of activity - * @returns {RichPresence} - */ - setType(type) { - this.type = typeof type == 'number' ? type : ActivityTypes[type]; - return this; - } - - /** - * Set the application id of this activity - * @param {?Snowflake} id Bot's id - * @returns {RichPresence} - */ - setApplicationId(id) { - this.applicationId = id; - return this; - } - - /** - * Set the state of the activity - * @param {?string} state The state of the activity - * @returns {RichPresence} - */ - setState(state) { - this.state = state; - return this; - } - - /** - * Set the details of the activity - * @param {?string} details The details of the activity - * @returns {RichPresence} - */ - setDetails(details) { - this.details = details; - return this; - } - - /** - * @typedef {Object} RichParty - * @property {string} id The id of the party - * @property {number} max The maximum number of members in the party - * @property {number} current The current number of members in the party - */ - - /** - * Set the party of this activity - * @param {?RichParty} party The party to be displayed - * @returns {RichPresence} - */ - setParty(party) { - if (typeof party == 'object') { - if (!party.max || typeof party.max != 'number') - throw new Error('Party must have max number'); - if (!party.current || typeof party.current != 'number') - throw new Error('Party must have current'); - if (party.current > party.max) - throw new Error('Party current must be less than max number'); - if (!party.id || typeof party.id != 'string') party.id = randomUUID(); - this.party = { - size: [party.current, party.max], - id: party.id, - }; - } else { - this.party = null; - } - return this; - } - - /** - * Sets the start timestamp of the activity - * @param {Date|number|null} timestamp The timestamp of the start of the activity - * @returns {RichPresence} - */ - setStartTimestamp(timestamp) { - if (!this.timestamps) this.timestamps = {}; - if (timestamp instanceof Date) timestamp = timestamp.getTime(); - this.timestamps.start = timestamp; - return this; - } - - /** - * Sets the end timestamp of the activity - * @param {Date|number|null} timestamp The timestamp of the end of the activity - * @returns {RichPresence} - */ - setEndTimestamp(timestamp) { - if (!this.timestamps) this.timestamps = {}; - if (timestamp instanceof Date) timestamp = timestamp.getTime(); - this.timestamps.end = timestamp; - return this; - } - - /** - * @typedef {object} RichButton - * @property {string} name The name of the button - * @property {string} url The url of the button - */ - /** - * Set the buttons of the rich presence - * @param {...?RichButton} button A list of buttons to set - * @returns {RichPresence} - */ - setButtons(...button) { - if (button.length == 0) { - this.buttons = []; - delete this.metadata.button_urls; - return this; - } else if (button.length > 2) { - throw new Error('RichPresence can only have up to 2 buttons'); - } - - this.buttons = []; - this.metadata.button_urls = []; - - button.flat(2).forEach((b) => { - if (b.name && b.url) { - this.buttons.push(b.name); - if (!URL.canParse(b.url)) - throw new Error('Button url must be a valid url'); - this.metadata.button_urls.push(b.url); - } else { - throw new Error('Button must have name and url'); - } - }); - return this; - } - - /** - * The platform the activity is being played on - * @param {ActivityPlatform | null} platform Any platform - * @returns {RichPresence} - */ - setPlatform(platform) { - this.platform = platform; - return this; - } - - /** - * Secrets for rich presence joining and spectating (send-only) - * @param {?string} join Secrets for rich presence joining - * @returns {RichPresence} - */ - setJoinSecret(join) { - this.secrets.join = join; - return this; - } - - /** - * Add a button to the rich presence - * @param {string} name The name of the button - * @param {string} url The url of the button - * @returns {RichPresence} - */ - addButton(name, url) { - if (!name || !url) { - throw new Error('Button must have name and url'); - } - if (typeof name !== 'string') - throw new Error('Button name must be a string'); - if (!URL.canParse(url)) throw new Error('Button url must be a valid url'); - this.buttons.push(name); - if (Array.isArray(this.metadata.button_urls)) - this.metadata.button_urls.push(url); - else this.metadata.button_urls = [url]; - return this; - } - - /** - * Convert the rich presence to a JSON object - * @returns {Object} - */ - toJSON(...props) { - return super.toJSON( - { - applicationId: 'application_id', - sessionId: 'session_id', - syncId: 'sync_id', - createdTimestamp: 'created_at', - }, - ...props, - ); - } - - /** - * @typedef {Object} ExternalAssets - * @property {?string} url Orginal url of the image - * @property {?string} external_asset_path Proxy url of the image (Using to RPC) - */ - - /** - * Retrieves external assets from a RichPresence - * @param {Client} client - The Discord client instance. - * @param {Snowflake} applicationId - The application ID associated with the Rich Presence. - * @param {...string} images - 1 or 2 external image URLs (not hosted by Discord). - * @returns {Promise} - */ - static async getExternal(client, applicationId, ...images) { - if (!client || !client.token || !client.api) - throw new Error('Client must be set'); - // Check if applicationId is discord snowflake (17 , 18, 19 numbers) - if (!/^[0-9]{17,19}$/.test(applicationId)) { - throw new Error('Application id must be a Discord Snowflake'); - } - // Check if images are 1 or 2 - if (images.length > 2) { - throw new Error('RichPresence can only have up to 2 external images'); - } - // Check if all images are valid URLs - if (images.some((image) => !URL.canParse(image))) { - throw new Error('Each image must be a valid URL.'); - } - const res = await client.api.applications[applicationId][ - 'external-assets' - ].post({ - data: { - urls: images, - }, - }); - return res; - } - - /** - * When concatenated with a string, this automatically returns the activities' name instead of the Activity object. - * @returns {string} - */ - toString() { - return this.name; - } - - _clone() { - return Object.assign(Object.create(this), this); - } -} - -/** - * @extends {RichPresence} - */ -class SpotifyRPC extends RichPresence { - /** - * Create a new RichPresence (Spotify style) - * @param {Client} client Discord Client - * @param {SpotifyRPC} [options] Options for the Spotify RPC - */ - constructor(client, options = {}) { - if (!client) - throw new Error( - "Class constructor SpotifyRPC cannot be invoked without 'client'", - ); - super(client, { - name: 'Spotify', - type: ActivityTypes.LISTENING, - party: { - id: `spotify:${client.user.id}`, - }, - id: 'spotify:1', - flags: 48, // Sync + Play (ActivityFlags) - ...options, - }); - this.setup(options); - } - /** - * Sets the status from a JSON object - * @param {SpotifyRPC} options data - * @private - */ - setup(options) { - /** - * @typedef {Object} SpotifyMetadata - * @property {string} album_id The Spotify ID of the album of the song being played - * @property {Array} artist_ids The Spotify IDs of the artists of the song being played - * @property {string} context_uri The Spotify URI of the current player context - */ - - /** - * Spotify metadata - * @type {SpotifyMetadata} - */ - this.metadata = { - album_id: options.metadata?.album_id || null, - artist_ids: options.metadata?.artist_ids || [], - context_uri: options.metadata?.context_uri || null, - }; - } - - /** - * Set Spotify song id to sync with - * @param {string} id Song id - * @returns {SpotifyRPC} - */ - setSongId(id) { - this.syncId = id; - return this; - } - - /** - * Add the artist id - * @param {string} id Artist id - * @returns {SpotifyRPC} - */ - addArtistId(id) { - if (!this.metadata.artist_ids) this.metadata.artist_ids = []; - this.metadata.artist_ids.push(id); - return this; - } - - /** - * Set the artist ids - * @param {string | Array} ids Artist ids - * @returns {SpotifyRPC} - */ - setArtistIds(...ids) { - if (!ids?.length) { - this.metadata.artist_ids = []; - return this; - } - if (!this.metadata.artist_ids) this.metadata.artist_ids = []; - ids.flat(2).forEach((id) => this.metadata.artist_ids.push(id)); - return this; - } - - /** - * Set the album id - * @param {string} id Album id - * @returns {SpotifyRPC} - */ - setAlbumId(id) { - this.metadata.album_id = id; - this.metadata.context_uri = `spotify:album:${id}`; - return this; - } - - toJSON() { - return super.toJSON({ - id: false, - emoji: false, - platform: false, - buttons: false, - }); - } -} - -exports.Presence = Presence; -exports.Activity = Activity; -exports.RichPresenceAssets = RichPresenceAssets; -exports.CustomStatus = CustomStatus; -exports.RichPresence = RichPresence; -exports.SpotifyRPC = SpotifyRPC; diff --git a/vendor/discord.js-selfbot-v13/src/structures/ReactionCollector.js b/vendor/discord.js-selfbot-v13/src/structures/ReactionCollector.js deleted file mode 100644 index 192fa34..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/ReactionCollector.js +++ /dev/null @@ -1,262 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const Collector = require('./interfaces/Collector'); -const { Events } = require('../util/Constants'); - -/** - * @typedef {CollectorOptions} ReactionCollectorOptions - * @property {number} max The maximum total amount of reactions to collect - * @property {number} maxEmojis The maximum number of emojis to collect - * @property {number} maxUsers The maximum number of users to react - */ - -/** - * Collects reactions on messages. - * Will automatically stop if the message ({@link Client#event:messageDelete messageDelete} or - * {@link Client#event:messageDeleteBulk messageDeleteBulk}), - * channel ({@link Client#event:channelDelete channelDelete}), - * thread ({@link Client#event:threadDelete threadDelete}), or - * guild ({@link Client#event:guildDelete guildDelete}) is deleted. - * @extends {Collector} - */ -class ReactionCollector extends Collector { - /** - * @param {Message} message The message upon which to collect reactions - * @param {ReactionCollectorOptions} [options={}] The options to apply to this collector - */ - constructor(message, options = {}) { - super(message.client, options); - - /** - * The message upon which to collect reactions - * @type {Message} - */ - this.message = message; - - /** - * The users that have reacted to this message - * @type {Collection} - */ - this.users = new Collection(); - - /** - * The total number of reactions collected - * @type {number} - */ - this.total = 0; - - this.empty = this.empty.bind(this); - this._handleChannelDeletion = this._handleChannelDeletion.bind(this); - this._handleThreadDeletion = this._handleThreadDeletion.bind(this); - this._handleGuildDeletion = this._handleGuildDeletion.bind(this); - this._handleMessageDeletion = this._handleMessageDeletion.bind(this); - - const bulkDeleteListener = (messages) => { - if (messages.has(this.message.id)) this.stop('messageDelete'); - }; - - this.client.incrementMaxListeners(); - this.client.on(Events.MESSAGE_REACTION_ADD, this.handleCollect); - this.client.on(Events.MESSAGE_REACTION_REMOVE, this.handleDispose); - this.client.on(Events.MESSAGE_REACTION_REMOVE_ALL, this.empty); - this.client.on(Events.MESSAGE_DELETE, this._handleMessageDeletion); - this.client.on(Events.MESSAGE_BULK_DELETE, bulkDeleteListener); - this.client.on(Events.CHANNEL_DELETE, this._handleChannelDeletion); - this.client.on(Events.THREAD_DELETE, this._handleThreadDeletion); - this.client.on(Events.GUILD_DELETE, this._handleGuildDeletion); - - this.once('end', () => { - this.client.removeListener( - Events.MESSAGE_REACTION_ADD, - this.handleCollect, - ); - this.client.removeListener( - Events.MESSAGE_REACTION_REMOVE, - this.handleDispose, - ); - this.client.removeListener( - Events.MESSAGE_REACTION_REMOVE_ALL, - this.empty, - ); - this.client.removeListener( - Events.MESSAGE_DELETE, - this._handleMessageDeletion, - ); - this.client.removeListener( - Events.MESSAGE_BULK_DELETE, - bulkDeleteListener, - ); - this.client.removeListener( - Events.CHANNEL_DELETE, - this._handleChannelDeletion, - ); - this.client.removeListener( - Events.THREAD_DELETE, - this._handleThreadDeletion, - ); - this.client.removeListener( - Events.GUILD_DELETE, - this._handleGuildDeletion, - ); - this.client.decrementMaxListeners(); - }); - - this.on('collect', (reaction, user) => { - /** - * Emitted whenever a reaction is newly created on a message. Will emit only when a new reaction is - * added to the message, as opposed to {@link Collector#collect} which will - * be emitted even when a reaction has already been added to the message. - * @event ReactionCollector#create - * @param {MessageReaction} reaction The reaction that was added - * @param {User} user The user that added the reaction - */ - if (reaction.count === 1) { - this.emit('create', reaction, user); - } - this.total++; - this.users.set(user.id, user); - }); - - this.on('remove', (reaction, user) => { - this.total--; - if (!this.collected.some((r) => r.users.cache.has(user.id))) - this.users.delete(user.id); - }); - } - - /** - * Handles an incoming reaction for possible collection. - * @param {MessageReaction} reaction The reaction to possibly collect - * @param {User} user The user that added the reaction - * @returns {?(Snowflake|string)} - * @private - */ - collect(reaction) { - /** - * Emitted whenever a reaction is collected. - * @event ReactionCollector#collect - * @param {MessageReaction} reaction The reaction that was collected - * @param {User} user The user that added the reaction - */ - if (reaction.message.id !== this.message.id) return null; - - return ReactionCollector.key(reaction); - } - - /** - * Handles a reaction deletion for possible disposal. - * @param {MessageReaction} reaction The reaction to possibly dispose of - * @param {User} user The user that removed the reaction - * @returns {?(Snowflake|string)} - */ - dispose(reaction, user) { - /** - * Emitted when the reaction had all the users removed and the `dispose` option is set to true. - * @event ReactionCollector#dispose - * @param {MessageReaction} reaction The reaction that was disposed of - * @param {User} user The user that removed the reaction - */ - if (reaction.message.id !== this.message.id) return null; - - /** - * Emitted when the reaction had one user removed and the `dispose` option is set to true. - * @event ReactionCollector#remove - * @param {MessageReaction} reaction The reaction that was removed - * @param {User} user The user that removed the reaction - */ - if ( - this.collected.has(ReactionCollector.key(reaction)) && - this.users.has(user.id) - ) { - this.emit('remove', reaction, user); - } - return reaction.count ? null : ReactionCollector.key(reaction); - } - - /** - * Empties this reaction collector. - */ - empty() { - this.total = 0; - this.collected.clear(); - this.users.clear(); - this.checkEnd(); - } - - /** - * The reason this collector has ended with, or null if it hasn't ended yet - * @type {?string} - * @readonly - */ - get endReason() { - if (this.options.max && this.total >= this.options.max) return 'limit'; - if (this.options.maxEmojis && this.collected.size >= this.options.maxEmojis) - return 'emojiLimit'; - if (this.options.maxUsers && this.users.size >= this.options.maxUsers) - return 'userLimit'; - return null; - } - - /** - * Handles checking if the message has been deleted, and if so, stops the collector with the reason 'messageDelete'. - * @private - * @param {Message} message The message that was deleted - * @returns {void} - */ - _handleMessageDeletion(message) { - if (message.id === this.message.id) { - this.stop('messageDelete'); - } - } - - /** - * Handles checking if the channel has been deleted, and if so, stops the collector with the reason 'channelDelete'. - * @private - * @param {GuildChannel} channel The channel that was deleted - * @returns {void} - */ - _handleChannelDeletion(channel) { - if ( - channel.id === this.message.channelId || - channel.threads?.cache.has(this.message.channelId) - ) { - this.stop('channelDelete'); - } - } - - /** - * Handles checking if the thread has been deleted, and if so, stops the collector with the reason 'threadDelete'. - * @private - * @param {ThreadChannel} thread The thread that was deleted - * @returns {void} - */ - _handleThreadDeletion(thread) { - if (thread.id === this.message.channelId) { - this.stop('threadDelete'); - } - } - - /** - * Handles checking if the guild has been deleted, and if so, stops the collector with the reason 'guildDelete'. - * @private - * @param {Guild} guild The guild that was deleted - * @returns {void} - */ - _handleGuildDeletion(guild) { - if (guild.id === this.message.guild?.id) { - this.stop('guildDelete'); - } - } - - /** - * Gets the collector key for a reaction. - * @param {MessageReaction} reaction The message reaction to get the key for - * @returns {Snowflake|string} - */ - static key(reaction) { - return reaction.emoji.id ?? reaction.emoji.name; - } -} - -module.exports = ReactionCollector; diff --git a/vendor/discord.js-selfbot-v13/src/structures/ReactionEmoji.js b/vendor/discord.js-selfbot-v13/src/structures/ReactionEmoji.js deleted file mode 100644 index bcd2470..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/ReactionEmoji.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -const { Emoji } = require('./Emoji'); -const Util = require('../util/Util'); - -/** - * Represents a limited emoji set used for both custom and unicode emojis. Custom emojis - * will use this class opposed to the Emoji class when the client doesn't know enough - * information about them. - * @extends {Emoji} - */ -class ReactionEmoji extends Emoji { - constructor(reaction, emoji) { - super(reaction.message.client, emoji); - /** - * The message reaction this emoji refers to - * @type {MessageReaction} - */ - this.reaction = reaction; - } - - toJSON() { - return Util.flatten(this, { identifier: true }); - } - - valueOf() { - return this.id; - } -} - -module.exports = ReactionEmoji; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Role.js b/vendor/discord.js-selfbot-v13/src/structures/Role.js deleted file mode 100644 index 10c7324..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Role.js +++ /dev/null @@ -1,595 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const Base = require('./Base'); -const { Error } = require('../errors'); -const Permissions = require('../util/Permissions'); -const RoleFlags = require('../util/RoleFlags'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); - -let deprecationEmittedForComparePositions = false; - -/** - * @type {WeakSet} - * @private - * @internal - */ -const deletedRoles = new WeakSet(); -let deprecationEmittedForDeleted = false; - -/** - * Represents a role on Discord. - * @extends {Base} - */ -class Role extends Base { - constructor(client, data, guild) { - super(client); - - /** - * The guild that the role belongs to - * @type {Guild} - */ - this.guild = guild; - - /** - * The icon hash of the role - * @type {?string} - */ - this.icon = null; - - /** - * The unicode emoji for the role - * @type {?string} - */ - this.unicodeEmoji = null; - - if (data) this._patch(data); - } - - _patch(data) { - /** - * The role's id (unique to the guild it is part of) - * @type {Snowflake} - */ - this.id = data.id; - if ('name' in data) { - /** - * The name of the role - * @type {string} - */ - this.name = data.name; - } - - if ('color' in data) { - /** - * The base 10 color of the role - * @type {number} - * @deprecated Use {@link Role#colors} instead. - */ - this.color = data.color; - } - - /** - * @typedef {Object} RoleColors - * @property {number} primaryColor The primary color of the role - * @property {?number} secondaryColor The secondary color of the role. - * This will make the role a gradient between the other provided colors - * @property {?number} tertiaryColor The tertiary color of the role. - * When sending `tertiaryColor` the API enforces the role color to be a holographic style - * with values of `primaryColor = 11127295`, `secondaryColor = 16759788`, and `tertiaryColor = 16761760`. - * These values are available as a constant: `Constants.HolographicStyle` - */ - - if ('colors' in data) { - /** - * The colors of the role - * - * @type {RoleColors} - */ - this.colors = { - primaryColor: data.colors.primary_color, - secondaryColor: data.colors.secondary_color, - tertiaryColor: data.colors.tertiary_color, - }; - } - - if ('hoist' in data) { - /** - * If true, users that are part of this role will appear in a separate category in the users list - * @type {boolean} - */ - this.hoist = data.hoist; - } - - if ('position' in data) { - /** - * The raw position of the role from the API - * @type {number} - */ - this.rawPosition = data.position; - } - - if ('permissions' in data) { - /** - * The permissions of the role - * @type {Readonly} - */ - this.permissions = new Permissions(BigInt(data.permissions)).freeze(); - } - - if ('managed' in data) { - /** - * Whether or not the role is managed by an external service - * @type {boolean} - */ - this.managed = data.managed; - } - - if ('mentionable' in data) { - /** - * Whether or not the role can be mentioned by anyone - * @type {boolean} - */ - this.mentionable = data.mentionable; - } - - if ('icon' in data) this.icon = data.icon; - - if ('unicode_emoji' in data) this.unicodeEmoji = data.unicode_emoji; - - /** - * The tags this role has - * @type {?Object} - * @property {Snowflake} [botId] The id of the bot this role belongs to - * @property {Snowflake|string} [integrationId] The id of the integration this role belongs to - * @property {true} [premiumSubscriberRole] Whether this is the guild's premium subscription role - * @property {Snowflake} [subscriptionListingId] The id of this role's subscription SKU and listing - * @property {true} [availableForPurchase] Whether this role is available for purchase - * @property {true} [guildConnections] Whether this role is a guild's linked role - */ - this.tags = data.tags ? {} : null; - if (data.tags) { - if ('bot_id' in data.tags) { - this.tags.botId = data.tags.bot_id; - } - if ('integration_id' in data.tags) { - this.tags.integrationId = data.tags.integration_id; - } - if ('premium_subscriber' in data.tags) { - this.tags.premiumSubscriberRole = true; - } - if ('subscription_listing_id' in data.tags) { - this.tags.subscriptionListingId = data.tags.subscription_listing_id; - } - if ('available_for_purchase' in data.tags) { - this.tags.availableForPurchase = true; - } - if ('guild_connections' in data.tags) { - this.tags.guildConnections = true; - } - } - - if ('flags' in data) { - /** - * The flags of this role - * @type {Readonly} - */ - this.flags = new RoleFlags(data.flags).freeze(); - } else { - this.flags ??= new RoleFlags().freeze(); - } - } - - /** - * The timestamp the role was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return SnowflakeUtil.timestampFrom(this.id); - } - - /** - * The time the role was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * Whether or not the role has been deleted - * @type {boolean} - * @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 - */ - get deleted() { - if (!deprecationEmittedForDeleted) { - deprecationEmittedForDeleted = true; - process.emitWarning( - 'Role#deleted is deprecated, see https://github.com/discordjs/discord.js/issues/7091.', - 'DeprecationWarning', - ); - } - - return deletedRoles.has(this); - } - - set deleted(value) { - if (!deprecationEmittedForDeleted) { - deprecationEmittedForDeleted = true; - process.emitWarning( - 'Role#deleted is deprecated, see https://github.com/discordjs/discord.js/issues/7091.', - 'DeprecationWarning', - ); - } - - if (value) deletedRoles.add(this); - else deletedRoles.delete(this); - } - - /** - * The hexadecimal version of the role color, with a leading hashtag - * @type {string} - * @readonly - */ - get hexColor() { - return `#${this.colors.primaryColor.toString(16).padStart(6, '0')}`; - } - - /** - * The cached guild members that have this role - * @type {Collection} - * @readonly - */ - get members() { - return this.guild.members.cache.filter((m) => m.roles.cache.has(this.id)); - } - - /** - * Whether the role is editable by the client user - * @type {boolean} - * @readonly - */ - get editable() { - if (this.managed) return false; - const clientMember = this.guild.members.resolve(this.client.user); - if (!clientMember.permissions.has(Permissions.FLAGS.MANAGE_ROLES)) - return false; - return clientMember.roles.highest.comparePositionTo(this) > 0; - } - - /** - * The position of the role in the role manager - * @type {number} - * @readonly - */ - get position() { - let count = 0; - for (const role of this.guild.roles.cache.values()) { - if (this.rawPosition > role.rawPosition) count++; - else if ( - this.rawPosition === role.rawPosition && - BigInt(this.id) < BigInt(role.id) - ) - count++; - } - - return count; - } - - /** - * Compares this role's position to another role's. - * @param {RoleResolvable} role Role to compare to this one - * @returns {number} Negative number if this role's position is lower (other role's is higher), - * positive number if this one is higher (other's is lower), 0 if equal - * @example - * // Compare the position of a role to another - * const roleCompare = role.comparePositionTo(otherRole); - * if (roleCompare >= 1) console.log(`${role.name} is higher than ${otherRole.name}`); - */ - comparePositionTo(role) { - return this.guild.roles.comparePositions(this, role); - } - - /** - * The data for a role. - * @typedef {Object} RoleData - * @property {string} [name] The name of the role - * @property {ColorResolvable} [color] The color of the role, either a hex string or a base 10 number - * This property is deprecated. Use `colors` instead. - * @property {RoleColorsResolvable} [colors] The colors of the role - * @property {boolean} [hoist] Whether or not the role should be hoisted - * @property {number} [position] The position of the role - * @property {PermissionResolvable} [permissions] The permissions of the role - * @property {boolean} [mentionable] Whether or not the role should be mentionable - * @property {?(BufferResolvable|Base64Resolvable|EmojiResolvable)} [icon] The icon for the role - * The `EmojiResolvable` should belong to the same guild as the role. - * If not, pass the emoji's URL directly - * @property {?string} [unicodeEmoji] The unicode emoji for the role - */ - - /** - * Edits the role. - * @param {RoleData} data The new data for the role - * @param {string} [reason] Reason for editing this role - * @returns {Promise} - * @example - * // Edit a role - * role.edit({ name: 'new role' }) - * .then(updated => console.log(`Edited role name to ${updated.name}`)) - * .catch(console.error); - */ - edit(data, reason) { - return this.guild.roles.edit(this, data, reason); - } - - /** - * Returns `channel.permissionsFor(role)`. Returns permissions for a role in a guild channel, - * taking into account permission overwrites. - * @param {GuildChannel|Snowflake} channel The guild channel to use as context - * @param {boolean} [checkAdmin=true] Whether having `ADMINISTRATOR` will return all permissions - * @returns {Readonly} - */ - permissionsIn(channel, checkAdmin = true) { - channel = this.guild.channels.resolve(channel); - if (!channel) throw new Error('GUILD_CHANNEL_RESOLVE'); - return channel.rolePermissions(this, checkAdmin); - } - - /** - * Sets a new name for the role. - * @param {string} name The new name of the role - * @param {string} [reason] Reason for changing the role's name - * @returns {Promise} - * @example - * // Set the name of the role - * role.setName('new role') - * .then(updated => console.log(`Updated role name to ${updated.name}`)) - * .catch(console.error); - */ - setName(name, reason) { - return this.edit({ name }, reason); - } - - /** - * Sets a new color for the role. - * @param {ColorResolvable} color The color of the role - * @param {string} [reason] Reason for changing the role's color - * @returns {Promise} - * @deprecated Use {@link Role#setColors} instead. - */ - setColor(color, reason) { - return this.edit({ color }, reason); - } - - /** - * Sets new colors for the role. - * - * @param {RoleColorsResolvable} colors The colors of the role - * @param {string} [reason] Reason for changing the role's colors - * @returns {Promise} - * @example - * // Set the colors of a role - * role.setColors({ primaryColor: '#FF0000', secondaryColor: '#00FF00', tertiaryColor: '#0000FF' }) - * .then(updated => console.log(`Set colors of role to ${updated.colors}`)) - * .catch(console.error); - * @example - * // Set holographic colors using constants - * role.setColors({ - * primaryColor: Constants.HolographicStyle.Primary, - * secondaryColor: Constants.HolographicStyle.Secondary, - * tertiaryColor: Constants.HolographicStyle.Tertiary, - * }) - * .then(updated => console.log(`Set holographic colors for role ${updated.name}`)) - * .catch(console.error); - */ - setColors(colors, reason) { - return this.edit({ colors, reason }); - } - - /** - * Sets whether or not the role should be hoisted. - * @param {boolean} [hoist=true] Whether or not to hoist the role - * @param {string} [reason] Reason for setting whether or not the role should be hoisted - * @returns {Promise} - * @example - * // Set the hoist of the role - * role.setHoist(true) - * .then(updated => console.log(`Role hoisted: ${updated.hoist}`)) - * .catch(console.error); - */ - setHoist(hoist = true, reason) { - return this.edit({ hoist }, reason); - } - - /** - * Sets the permissions of the role. - * @param {PermissionResolvable} permissions The permissions of the role - * @param {string} [reason] Reason for changing the role's permissions - * @returns {Promise} - * @example - * // Set the permissions of the role - * role.setPermissions([Permissions.FLAGS.KICK_MEMBERS, Permissions.FLAGS.BAN_MEMBERS]) - * .then(updated => console.log(`Updated permissions to ${updated.permissions.bitfield}`)) - * .catch(console.error); - * @example - * // Remove all permissions from a role - * role.setPermissions(0n) - * .then(updated => console.log(`Updated permissions to ${updated.permissions.bitfield}`)) - * .catch(console.error); - */ - setPermissions(permissions, reason) { - return this.edit({ permissions }, reason); - } - - /** - * Sets whether this role is mentionable. - * @param {boolean} [mentionable=true] Whether this role should be mentionable - * @param {string} [reason] Reason for setting whether or not this role should be mentionable - * @returns {Promise} - * @example - * // Make the role mentionable - * role.setMentionable(true) - * .then(updated => console.log(`Role updated ${updated.name}`)) - * .catch(console.error); - */ - setMentionable(mentionable = true, reason) { - return this.edit({ mentionable }, reason); - } - - /** - * Sets a new icon for the role. - * @param {?(BufferResolvable|Base64Resolvable|EmojiResolvable)} icon The icon for the role - * The `EmojiResolvable` should belong to the same guild as the role. - * If not, pass the emoji's URL directly - * @param {string} [reason] Reason for changing the role's icon - * @returns {Promise} - */ - setIcon(icon, reason) { - return this.edit({ icon }, reason); - } - - /** - * Sets a new unicode emoji for the role. - * @param {?string} unicodeEmoji The new unicode emoji for the role - * @param {string} [reason] Reason for changing the role's unicode emoji - * @returns {Promise} - * @example - * // Set a new unicode emoji for the role - * role.setUnicodeEmoji('🤖') - * .then(updated => console.log(`Set unicode emoji for the role to ${updated.unicodeEmoji}`)) - * .catch(console.error); - */ - setUnicodeEmoji(unicodeEmoji, reason) { - return this.edit({ unicodeEmoji }, reason); - } - - /** - * Options used to set the position of a role. - * @typedef {Object} SetRolePositionOptions - * @property {boolean} [relative=false] Whether to change the position relative to its current value or not - * @property {string} [reason] The reason for changing the position - */ - - /** - * Sets the new position of the role. - * @param {number} position The new position for the role - * @param {SetRolePositionOptions} [options] Options for setting the position - * @returns {Promise} - * @example - * // Set the position of the role - * role.setPosition(1) - * .then(updated => console.log(`Role position: ${updated.position}`)) - * .catch(console.error); - */ - setPosition(position, options = {}) { - return this.guild.roles.setPosition(this, position, options); - } - - /** - * Deletes the role. - * @param {string} [reason] Reason for deleting this role - * @returns {Promise} - * @example - * // Delete a role - * role.delete('The role needed to go') - * .then(deleted => console.log(`Deleted role ${deleted.name}`)) - * .catch(console.error); - */ - async delete(reason) { - await this.guild.roles.delete(this.id, reason); - return this; - } - - /** - * Fetches the member ids for this role in the guild. - * This only returns 100 member ids - * @returns {Promise} - */ - fetchMemberIds() { - return this.guild.roles.fetchMemberIds(this.id); - } - - /** - * A link to the role's icon - * @param {StaticImageURLOptions} [options={}] Options for the image URL - * @returns {?string} - */ - iconURL({ format, size } = {}) { - if (!this.icon) return null; - return this.client.rest.cdn.RoleIcon(this.id, this.icon, format, size); - } - - /** - * Whether this role equals another role. It compares all properties, so for most operations - * it is advisable to just compare `role.id === role2.id` as it is much faster and is often - * what most users need. - * @param {Role} role Role to compare with - * @returns {boolean} - */ - equals(role) { - return ( - role && - this.id === role.id && - this.name === role.name && - this.colors.primaryColor === role.colors.primaryColor && - this.colors.secondaryColor === role.colors.secondaryColor && - this.colors.tertiaryColor === role.colors.tertiaryColor && - this.hoist === role.hoist && - this.position === role.position && - this.permissions.bitfield === role.permissions.bitfield && - this.managed === role.managed && - this.icon === role.icon && - this.unicodeEmoji === role.unicodeEmoji - ); - } - - /** - * When concatenated with a string, this automatically returns the role's mention instead of the Role object. - * @returns {string} - * @example - * // Logs: Role: <@&123456789012345678> - * console.log(`Role: ${role}`); - */ - toString() { - if (this.id === this.guild.id) return '@everyone'; - return `<@&${this.id}>`; - } - - toJSON() { - return { - ...super.toJSON({ createdTimestamp: true }), - permissions: this.permissions.toJSON(), - }; - } - - /** - * Compares the positions of two roles. - * @param {Role} role1 First role to compare - * @param {Role} role2 Second role to compare - * @returns {number} Negative number if the first role's position is lower (second role's is higher), - * positive number if the first's is higher (second's is lower), 0 if equal - * @deprecated Use {@link RoleManager#comparePositions} instead. - */ - static comparePositions(role1, role2) { - if (!deprecationEmittedForComparePositions) { - process.emitWarning( - 'The Role.comparePositions method is deprecated. Use RoleManager#comparePositions instead.', - 'DeprecationWarning', - ); - - deprecationEmittedForComparePositions = true; - } - - return role1.guild.roles.comparePositions(role1, role2); - } -} - -exports.Role = Role; -exports.deletedRoles = deletedRoles; - -/** - * @external APIRole - * @see {@link https://discord.com/developers/docs/topics/permissions#role-object} - */ diff --git a/vendor/discord.js-selfbot-v13/src/structures/SectionComponent.js b/vendor/discord.js-selfbot-v13/src/structures/SectionComponent.js deleted file mode 100644 index 7a4e860..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/SectionComponent.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; - -const BaseMessageComponent = require('./BaseMessageComponent'); -const { MessageComponentTypes } = require('../util/Constants'); - -class SectionComponent extends BaseMessageComponent { - /** - * @property {TextDisplayComponent[]} [components] One to three text components - * @property {ThumbnailComponent|MessageButton} [accessory] A thumbnail or a button component, with a future possibility of adding more compatible components - */ - - /** - * @param {SectionComponent | APISectionComponent} [data={}] The data - */ - constructor(data = {}) { - super({ type: 'SECTION' }); - - this.setup(data); - } - - setup(data) { - super.setup(data); - /** - * One to three text components - * @type {TextDisplayComponent[]} - */ - this.components = - data.components?.map((c) => BaseMessageComponent.create(c)) ?? []; - - /** - * A thumbnail or a button component, with a future possibility of adding more compatible components - * @type {ThumbnailComponent|MessageButton} - */ - this.accessory = BaseMessageComponent.create(data.accessory) ?? null; - } - - /** - * @returns {APISectionComponent} - */ - toJSON() { - return { - type: MessageComponentTypes[this.type], - components: this.components.map((c) => c.toJSON()), - accessory: this.accessory.toJSON(), - }; - } -} - -module.exports = SectionComponent; diff --git a/vendor/discord.js-selfbot-v13/src/structures/SelectMenuInteraction.js b/vendor/discord.js-selfbot-v13/src/structures/SelectMenuInteraction.js deleted file mode 100644 index 42ef0c1..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/SelectMenuInteraction.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -const MessageComponentInteraction = require('./MessageComponentInteraction'); - -/** - * Represents a select menu interaction. - * @extends {MessageComponentInteraction} - */ -class SelectMenuInteraction extends MessageComponentInteraction { - constructor(client, data) { - super(client, data); - - /** - * The values selected, if the component which was interacted with was a select menu - * @type {string[]} - */ - this.values = data.data.values ?? []; - } -} - -module.exports = SelectMenuInteraction; diff --git a/vendor/discord.js-selfbot-v13/src/structures/SeparatorComponent.js b/vendor/discord.js-selfbot-v13/src/structures/SeparatorComponent.js deleted file mode 100644 index 1d69353..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/SeparatorComponent.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -const BaseMessageComponent = require('./BaseMessageComponent'); -const { - MessageComponentTypes, - SeparatorSpacingSizes, -} = require('../util/Constants'); - -class SeparatorComponent extends BaseMessageComponent { - /** - * @property {SeparatorSpacingSizes} [spacing] Size of separator padding — SeparatorSpacingSizes.SMALL for small padding, SeparatorSpacingSizes.LARGE for large padding. Defaults to SeparatorSpacingSizes.SMALL - * @property {Boolean} [divider] Whether a visual divider should be displayed in the component. Defaults to true - */ - - /** - * @param {SeparatorComponent | APISeparatorComponent} [data={}] The data - */ - constructor(data = {}) { - super({ type: 'SEPARATOR' }); - - this.setup(data); - } - - setup(data) { - super.setup(data); - /** - * Size of separator padding — SeparatorSpacingSizes.SMALL for small padding, SeparatorSpacingSizes.LARGE for large padding. Defaults to SeparatorSpacingSizes.SMALL - * @type {SeparatorSpacingSizes} - */ - this.spacing = data.spacing ?? SeparatorSpacingSizes.SMALL; - - /** - * Whether a visual divider should be displayed in the component. Defaults to true - * @type {Boolean} - */ - this.divider = data.divider ?? true; - } - - /** - * @returns {APISeparatorComponent} - */ - toJSON() { - return { - type: MessageComponentTypes[this.type], - spacing: this.spacing, - divider: this.divider, - }; - } -} - -module.exports = SeparatorComponent; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Session.js b/vendor/discord.js-selfbot-v13/src/structures/Session.js deleted file mode 100644 index 51dbe47..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Session.js +++ /dev/null @@ -1,81 +0,0 @@ -'use strict'; - -const Base = require('./Base'); - -/** - * @typedef {Object} SessionClientInfo - * @property {string} location Location of the client (using IP address) - * @property {string} platform Platform of the client - * @property {string} os Operating system of the client - */ - -/** - * Represents a Client OAuth2 Application Team. - * @extends {Base} - */ -class Session extends Base { - constructor(client, data) { - super(client); - this._patch(data); - } - - _patch(data) { - if ('id_hash' in data) { - /** - * The session hash id - * @type {string} - */ - this.id = data.id_hash; - } - if ('approx_last_used_time' in data) { - /** - * The approximate last used time - * @type {string} - */ - this.approxLastUsedTime = data.approx_last_used_time; - } - if ('client_info' in data) { - /** - * The client info - * @type {SessionClientInfo} - */ - this.clientInfo = data.client_info; - } - } - - /** - * The timestamp the client was last used at. - * @type {number} - * @readonly - */ - get createdTimestamp() { - return this.createdAt.getTime(); - } - - /** - * The time the client was last used at. - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.approxLastUsedTime); - } - - /** - * Logout the client (remote). - * @returns {Promise} - */ - logout() { - return this.client.api.auth.sessions.logout({ - data: { - session_id_hashes: [this.id], - }, - }); - } - - toJSON() { - return super.toJSON(); - } -} - -module.exports = Session; diff --git a/vendor/discord.js-selfbot-v13/src/structures/StageChannel.js b/vendor/discord.js-selfbot-v13/src/structures/StageChannel.js deleted file mode 100644 index f0219cc..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/StageChannel.js +++ /dev/null @@ -1,108 +0,0 @@ -'use strict'; - -const BaseGuildVoiceChannel = require('./BaseGuildVoiceChannel'); - -/** - * Represents a guild stage channel on Discord. - * @extends {BaseGuildVoiceChannel} - */ -class StageChannel extends BaseGuildVoiceChannel { - _patch(data) { - super._patch(data); - - if ('topic' in data) { - /** - * The topic of the stage channel - * @type {?string} - */ - this.topic = data.topic; - } - } - - /** - * The stage instance of this stage channel, if it exists - * @type {?StageInstance} - * @readonly - */ - get stageInstance() { - return ( - this.guild.stageInstances.cache.find( - (stageInstance) => stageInstance.channelId === this.id, - ) ?? null - ); - } - - /** - * Creates a stage instance associated with this stage channel. - * @param {StageInstanceCreateOptions} options The options to create the stage instance - * @returns {Promise} - */ - createStageInstance(options) { - return this.guild.stageInstances.create(this.id, options); - } - - /** - * Sets a new topic for the guild channel. - * @param {?string} topic The new topic for the guild channel - * @param {string} [reason] Reason for changing the guild channel's topic - * @returns {Promise} - * @example - * // Set a new channel topic - * channel.setTopic('needs more rate limiting') - * .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`)) - * .catch(console.error); - */ - setTopic(topic, reason) { - return this.edit({ topic }, reason); - } - - /** - * Sets the bitrate of the channel. - * @name StageChannel#setBitrate - * @param {number} bitrate The new bitrate - * @param {string} [reason] Reason for changing the channel's bitrate - * @returns {Promise} - * @example - * // Set the bitrate of a voice channel - * stageChannel.setBitrate(48_000) - * .then(channel => console.log(`Set bitrate to ${channel.bitrate}bps for ${channel.name}`)) - * .catch(console.error); - */ - - /** - * Sets the RTC region of the channel. - * @name StageChannel#setRTCRegion - * @param {?string} rtcRegion The new region of the channel. Set to `null` to remove a specific region for the channel - * @param {string} [reason] The reason for modifying this region. - * @returns {Promise} - * @example - * // Set the RTC region to sydney - * stageChannel.setRTCRegion('sydney'); - * @example - * // Remove a fixed region for this channel - let Discord decide automatically - * stageChannel.setRTCRegion(null, 'We want to let Discord decide.'); - */ - - /** - * Sets the user limit of the channel. - * @name StageChannel#setUserLimit - * @param {number} userLimit The new user limit - * @param {string} [reason] Reason for changing the user limit - * @returns {Promise} - * @example - * // Set the user limit of a voice channel - * stageChannel.setUserLimit(42) - * .then(channel => console.log(`Set user limit to ${channel.userLimit} for ${channel.name}`)) - * .catch(console.error); - */ - - /** - * Sets the camera video quality mode of the channel. - * @name StageChannel#setVideoQualityMode - * @param {VideoQualityMode|number} videoQualityMode The new camera video quality mode. - * @param {string} [reason] Reason for changing the camera video quality mode. - * @returns {Promise} - */ -} - -module.exports = StageChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/StageInstance.js b/vendor/discord.js-selfbot-v13/src/structures/StageInstance.js deleted file mode 100644 index 1f5318f..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/StageInstance.js +++ /dev/null @@ -1,210 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const Base = require('./Base'); -const { PrivacyLevels } = require('../util/Constants'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); - -/** - * @type {WeakSet} - * @private - * @internal - */ -const deletedStageInstances = new WeakSet(); -let deprecationEmittedForDeleted = false; - -/** - * Represents a stage instance. - * @extends {Base} - */ -class StageInstance extends Base { - constructor(client, data) { - super(client); - - /** - * The stage instance's id - * @type {Snowflake} - */ - this.id = data.id; - - this._patch(data); - } - - _patch(data) { - if ('guild_id' in data) { - /** - * The id of the guild associated with the stage channel - * @type {Snowflake} - */ - this.guildId = data.guild_id; - } - - if ('channel_id' in data) { - /** - * The id of the channel associated with the stage channel - * @type {Snowflake} - */ - this.channelId = data.channel_id; - } - - if ('topic' in data) { - /** - * The topic of the stage instance - * @type {string} - */ - this.topic = data.topic; - } - - if ('privacy_level' in data) { - /** - * The privacy level of the stage instance - * @type {PrivacyLevel} - */ - this.privacyLevel = PrivacyLevels[data.privacy_level]; - } - - if ('discoverable_disabled' in data) { - /** - * Whether or not stage discovery is disabled - * @type {?boolean} - */ - this.discoverableDisabled = data.discoverable_disabled; - } else { - this.discoverableDisabled ??= null; - } - - if ('guild_scheduled_event_id' in data) { - /** - * The associated guild scheduled event id of this stage instance - * @type {?Snowflake} - */ - this.guildScheduledEventId = data.guild_scheduled_event_id; - } else { - this.guildScheduledEventId ??= null; - } - } - - /** - * The stage channel associated with this stage instance - * @type {?StageChannel} - * @readonly - */ - get channel() { - return this.client.channels.resolve(this.channelId); - } - - /** - * The associated guild scheduled event of this stage instance - * @type {?GuildScheduledEvent} - * @readonly - */ - get guildScheduledEvent() { - return ( - this.guild?.scheduledEvents.resolve(this.guildScheduledEventId) ?? null - ); - } - - /** - * Whether or not the stage instance has been deleted - * @type {boolean} - * @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 - */ - get deleted() { - if (!deprecationEmittedForDeleted) { - deprecationEmittedForDeleted = true; - process.emitWarning( - 'StageInstance#deleted is deprecated, see https://github.com/discordjs/discord.js/issues/7091.', - 'DeprecationWarning', - ); - } - - return deletedStageInstances.has(this); - } - - set deleted(value) { - if (!deprecationEmittedForDeleted) { - deprecationEmittedForDeleted = true; - process.emitWarning( - 'StageInstance#deleted is deprecated, see https://github.com/discordjs/discord.js/issues/7091.', - 'DeprecationWarning', - ); - } - - if (value) deletedStageInstances.add(this); - else deletedStageInstances.delete(this); - } - - /** - * The guild this stage instance belongs to - * @type {?Guild} - * @readonly - */ - get guild() { - return this.client.guilds.resolve(this.guildId); - } - - /** - * Edits this stage instance. - * @param {StageInstanceEditOptions} options The options to edit the stage instance - * @returns {Promise} - * @example - * // Edit a stage instance - * stageInstance.edit({ topic: 'new topic' }) - * .then(stageInstance => console.log(stageInstance)) - * .catch(console.error) - */ - edit(options) { - return this.guild.stageInstances.edit(this.channelId, options); - } - - /** - * Deletes this stage instance. - * @returns {Promise} - * @example - * // Delete a stage instance - * stageInstance.delete() - * .then(stageInstance => console.log(stageInstance)) - * .catch(console.error); - */ - async delete() { - await this.guild.stageInstances.delete(this.channelId); - const clone = this._clone(); - deletedStageInstances.add(clone); - return clone; - } - - /** - * Sets the topic of this stage instance. - * @param {string} topic The topic for the stage instance - * @returns {Promise} - * @example - * // Set topic of a stage instance - * stageInstance.setTopic('new topic') - * .then(stageInstance => console.log(`Set the topic to: ${stageInstance.topic}`)) - * .catch(console.error); - */ - setTopic(topic) { - return this.guild.stageInstances.edit(this.channelId, { topic }); - } - - /** - * The timestamp this stage instances was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return SnowflakeUtil.timestampFrom(this.id); - } - - /** - * The time this stage instance was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } -} - -exports.StageInstance = StageInstance; -exports.deletedStageInstances = deletedStageInstances; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Sticker.js b/vendor/discord.js-selfbot-v13/src/structures/Sticker.js deleted file mode 100644 index 572f25b..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Sticker.js +++ /dev/null @@ -1,314 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const Base = require('./Base'); -const { Error } = require('../errors'); -const { StickerFormatTypes, StickerTypes } = require('../util/Constants'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); - -/** - * @type {WeakSet} - * @private - * @internal - */ -const deletedStickers = new WeakSet(); -let deprecationEmittedForDeleted = false; - -/** - * Represents a Sticker. - * @extends {Base} - */ -class Sticker extends Base { - constructor(client, sticker) { - super(client); - - this._patch(sticker); - } - - _patch(sticker) { - /** - * The sticker's id - * @type {Snowflake} - */ - this.id = sticker.id; - - if ('description' in sticker) { - /** - * The description of the sticker - * @type {?string} - */ - this.description = sticker.description; - } else { - this.description ??= null; - } - - if ('type' in sticker) { - /** - * The type of the sticker - * @type {?StickerType} - */ - this.type = StickerTypes[sticker.type]; - } else { - this.type ??= null; - } - - if ('format_type' in sticker) { - /** - * The format of the sticker - * @type {StickerFormatType} - */ - this.format = StickerFormatTypes[sticker.format_type]; - } - - if ('name' in sticker) { - /** - * The name of the sticker - * @type {string} - */ - this.name = sticker.name; - } - - if ('pack_id' in sticker) { - /** - * The id of the pack the sticker is from, for standard stickers - * @type {?Snowflake} - */ - this.packId = sticker.pack_id; - } else { - this.packId ??= null; - } - - if ('tags' in sticker) { - /** - * An array of tags for the sticker - * @type {?string[]} - */ - this.tags = sticker.tags.split(', '); - } else { - this.tags ??= null; - } - - if ('available' in sticker) { - /** - * Whether or not the guild sticker is available - * @type {?boolean} - */ - this.available = sticker.available; - } else { - this.available ??= null; - } - - if ('guild_id' in sticker) { - /** - * The id of the guild that owns this sticker - * @type {?Snowflake} - */ - this.guildId = sticker.guild_id; - } else { - this.guildId ??= null; - } - - if ('user' in sticker) { - /** - * The user that uploaded the guild sticker - * @type {?User} - */ - this.user = this.client.users._add(sticker.user); - } else { - this.user ??= null; - } - - if ('sort_value' in sticker) { - /** - * The standard sticker's sort order within its pack - * @type {?number} - */ - this.sortValue = sticker.sort_value; - } else { - this.sortValue ??= null; - } - } - - /** - * The timestamp the sticker was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return SnowflakeUtil.timestampFrom(this.id); - } - - /** - * The time the sticker was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * Whether or not the sticker has been deleted - * @type {boolean} - * @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 - */ - get deleted() { - if (!deprecationEmittedForDeleted) { - deprecationEmittedForDeleted = true; - process.emitWarning( - 'Sticker#deleted is deprecated, see https://github.com/discordjs/discord.js/issues/7091.', - 'DeprecationWarning', - ); - } - - return deletedStickers.has(this); - } - - set deleted(value) { - if (!deprecationEmittedForDeleted) { - deprecationEmittedForDeleted = true; - process.emitWarning( - 'Sticker#deleted is deprecated, see https://github.com/discordjs/discord.js/issues/7091.', - 'DeprecationWarning', - ); - } - - if (value) deletedStickers.add(this); - else deletedStickers.delete(this); - } - - /** - * Whether this sticker is partial - * @type {boolean} - * @readonly - */ - get partial() { - return !this.type; - } - - /** - * The guild that owns this sticker - * @type {?Guild} - * @readonly - */ - get guild() { - return this.client.guilds.resolve(this.guildId); - } - - /** - * A link to the sticker - * If the sticker's format is LOTTIE, it returns the URL of the Lottie JSON file. - * @type {string} - */ - get url() { - return this.client.rest.cdn.Sticker(this.id, this.format); - } - - /** - * Fetches this sticker. - * @returns {Promise} - */ - async fetch() { - const data = await this.client.api.stickers(this.id).get(); - this._patch(data); - return this; - } - - /** - * Fetches the pack this sticker is part of from Discord, if this is a Nitro sticker. - * @returns {Promise} - */ - async fetchPack() { - return ( - (this.packId && - (await this.client.fetchPremiumStickerPacks()).get(this.packId)) ?? - null - ); - } - - /** - * Fetches the user who uploaded this sticker, if this is a guild sticker. - * @returns {Promise} - */ - async fetchUser() { - if (this.partial) await this.fetch(); - if (!this.guildId) throw new Error('NOT_GUILD_STICKER'); - return this.guild.stickers.fetchUser(this); - } - - /** - * Data for editing a sticker. - * @typedef {Object} GuildStickerEditData - * @property {string} [name] The name of the sticker - * @property {?string} [description] The description of the sticker - * @property {string} [tags] The Discord name of a unicode emoji representing the sticker's expression - */ - - /** - * Edits the sticker. - * @param {GuildStickerEditData} [data] The new data for the sticker - * @param {string} [reason] Reason for editing this sticker - * @returns {Promise} - * @example - * // Update the name of a sticker - * sticker.edit({ name: 'new name' }) - * .then(s => console.log(`Updated the name of the sticker to ${s.name}`)) - * .catch(console.error); - */ - edit(data, reason) { - return this.guild.stickers.edit(this, data, reason); - } - - /** - * Deletes the sticker. - * @returns {Promise} - * @param {string} [reason] Reason for deleting this sticker - * @example - * // Delete a message - * sticker.delete() - * .then(s => console.log(`Deleted sticker ${s.name}`)) - * .catch(console.error); - */ - async delete(reason) { - await this.guild.stickers.delete(this, reason); - return this; - } - - /** - * Whether this sticker is the same as another one. - * @param {Sticker|APISticker} other The sticker to compare it to - * @returns {boolean} - */ - equals(other) { - if (other instanceof Sticker) { - return ( - other.id === this.id && - other.description === this.description && - other.type === this.type && - other.format === this.format && - other.name === this.name && - other.packId === this.packId && - other.tags.length === this.tags.length && - other.tags.every((tag) => this.tags.includes(tag)) && - other.available === this.available && - other.guildId === this.guildId && - other.sortValue === this.sortValue - ); - } else { - return ( - other.id === this.id && - other.description === this.description && - other.name === this.name && - other.tags === this.tags.join(', ') - ); - } - } -} - -exports.Sticker = Sticker; -exports.deletedStickers = deletedStickers; - -/** - * @external APISticker - * @see {@link https://discord.com/developers/docs/resources/sticker#sticker-object} - */ diff --git a/vendor/discord.js-selfbot-v13/src/structures/StickerPack.js b/vendor/discord.js-selfbot-v13/src/structures/StickerPack.js deleted file mode 100644 index 95ff1b0..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/StickerPack.js +++ /dev/null @@ -1,100 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const Base = require('./Base'); -const { Sticker } = require('./Sticker'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); - -/** - * Represents a pack of standard stickers. - * @extends {Base} - */ -class StickerPack extends Base { - constructor(client, pack) { - super(client); - /** - * The Sticker pack's id - * @type {Snowflake} - */ - this.id = pack.id; - - /** - * The stickers in the pack - * @type {Collection} - */ - this.stickers = new Collection( - pack.stickers.map((s) => [s.id, new Sticker(client, s)]), - ); - - /** - * The name of the sticker pack - * @type {string} - */ - this.name = pack.name; - - /** - * The id of the pack's SKU - * @type {Snowflake} - */ - this.skuId = pack.sku_id; - - /** - * The id of a sticker in the pack which is shown as the pack's icon - * @type {?Snowflake} - */ - this.coverStickerId = pack.cover_sticker_id ?? null; - - /** - * The description of the sticker pack - * @type {string} - */ - this.description = pack.description; - - /** - * The id of the sticker pack's banner image - * @type {?Snowflake} - */ - this.bannerId = pack.banner_asset_id ?? null; - } - - /** - * The timestamp the sticker was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return SnowflakeUtil.timestampFrom(this.id); - } - - /** - * The time the sticker was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * The sticker which is shown as the pack's icon - * @type {?Sticker} - * @readonly - */ - get coverSticker() { - return this.coverStickerId && this.stickers.get(this.coverStickerId); - } - - /** - * The URL to this sticker pack's banner. - * @param {StaticImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - bannerURL({ format, size } = {}) { - return ( - this.bannerId && - this.client.rest.cdn.StickerPackBanner(this.bannerId, format, size) - ); - } -} - -module.exports = StickerPack; diff --git a/vendor/discord.js-selfbot-v13/src/structures/StoreChannel.js b/vendor/discord.js-selfbot-v13/src/structures/StoreChannel.js deleted file mode 100644 index 4501fcb..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/StoreChannel.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -const GuildChannel = require('./GuildChannel'); - -/** - * Represents a guild store channel on Discord. - * Store channels have been removed from Discord. See - * [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/6309018858647) - * for more information. - * @extends {GuildChannel} - */ -class StoreChannel extends GuildChannel { - constructor(guild, data, client) { - super(guild, data, client); - - /** - * If the guild considers this channel NSFW - * @type {boolean} - */ - this.nsfw = Boolean(data.nsfw); - } - - _patch(data) { - super._patch(data); - - if ('nsfw' in data) { - this.nsfw = Boolean(data.nsfw); - } - } - - /** - * Creates an invite to this guild channel. - * @param {CreateInviteOptions} [options={}] The options for creating the invite - * @returns {Promise} - * @example - * // Create an invite to a channel - * channel.createInvite() - * .then(invite => console.log(`Created an invite with a code of ${invite.code}`)) - * .catch(console.error); - */ - createInvite(options) { - return this.guild.invites.create(this.id, options); - } - - /** - * Fetches a collection of invites to this guild channel. - * Resolves with a collection mapping invites by their codes. - * @param {boolean} [cache=true] Whether or not to cache the fetched invites - * @returns {Promise>} - */ - fetchInvites(cache = true) { - return this.guild.invites.fetch({ channelId: this.id, cache }); - } -} - -module.exports = StoreChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Team.js b/vendor/discord.js-selfbot-v13/src/structures/Team.js deleted file mode 100644 index ccb8175..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Team.js +++ /dev/null @@ -1,118 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const Base = require('./Base'); -const TeamMember = require('./TeamMember'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); - -/** - * Represents a Client OAuth2 Application Team. - * @extends {Base} - */ -class Team extends Base { - constructor(client, data) { - super(client); - this._patch(data); - } - - _patch(data) { - /** - * The Team's id - * @type {Snowflake} - */ - this.id = data.id; - - if ('name' in data) { - /** - * The name of the Team - * @type {string} - */ - this.name = data.name; - } - - if ('icon' in data) { - /** - * The Team's icon hash - * @type {?string} - */ - this.icon = data.icon; - } else { - this.icon ??= null; - } - - if ('owner_user_id' in data) { - /** - * The Team's owner id - * @type {?Snowflake} - */ - this.ownerId = data.owner_user_id; - } else { - this.ownerId ??= null; - } - /** - * The Team's members - * @type {Collection} - */ - this.members = new Collection(); - - for (const memberData of data.members) { - const member = new TeamMember(this, memberData); - this.members.set(member.id, member); - } - } - - /** - * The owner of this team - * @type {?TeamMember} - * @readonly - */ - get owner() { - return this.members.get(this.ownerId) ?? null; - } - - /** - * The timestamp the team was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return SnowflakeUtil.timestampFrom(this.id); - } - - /** - * The time the team was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * A link to the team's icon. - * @param {StaticImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - iconURL({ format, size } = {}) { - if (!this.icon) return null; - return this.client.rest.cdn.TeamIcon(this.id, this.icon, { format, size }); - } - - /** - * When concatenated with a string, this automatically returns the Team's name instead of the - * Team object. - * @returns {string} - * @example - * // Logs: Team name: My Team - * console.log(`Team name: ${team}`); - */ - toString() { - return this.name; - } - - toJSON() { - return super.toJSON({ createdTimestamp: true }); - } -} - -module.exports = Team; diff --git a/vendor/discord.js-selfbot-v13/src/structures/TeamMember.js b/vendor/discord.js-selfbot-v13/src/structures/TeamMember.js deleted file mode 100644 index b748dba..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/TeamMember.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict'; - -const Base = require('./Base'); -const { MembershipStates } = require('../util/Constants'); - -/** - * Represents a Client OAuth2 Application Team Member. - * @extends {Base} - */ -class TeamMember extends Base { - constructor(team, data) { - super(team.client); - - /** - * The Team this member is part of - * @type {Team} - */ - this.team = team; - - this._patch(data); - } - - _patch(data) { - if ('permissions' in data) { - /** - * The permissions this Team Member has with regard to the team - * @type {string[]} - * @deprecated Use {@link TeamMember#role} instead. - */ - this.permissions = data.permissions; - } - - if ('role' in data) { - /** - * The role of this Team Member - * @type {TeamMemberRole} - */ - this.role = data.role; - } - - if ('membership_state' in data) { - /** - * The permissions this Team Member has with regard to the team - * @type {MembershipState} - */ - this.membershipState = MembershipStates[data.membership_state]; - } - - if ('user' in data) { - /** - * The user for this Team Member - * @type {User} - */ - this.user = this.client.users._add(data.user); - } - } - - /** - * The Team Member's id - * @type {Snowflake} - * @readonly - */ - get id() { - return this.user.id; - } - - /** - * When concatenated with a string, this automatically returns the team member's mention instead of the - * TeamMember object. - * @returns {string} - * @example - * // Logs: Team Member's mention: <@123456789012345678> - * console.log(`Team Member's mention: ${teamMember}`); - */ - toString() { - return this.user.toString(); - } -} - -module.exports = TeamMember; diff --git a/vendor/discord.js-selfbot-v13/src/structures/TextChannel.js b/vendor/discord.js-selfbot-v13/src/structures/TextChannel.js deleted file mode 100644 index 97040a2..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/TextChannel.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -const BaseGuildTextChannel = require('./BaseGuildTextChannel'); - -/** - * Represents a guild text channel on Discord. - * @extends {BaseGuildTextChannel} - */ -class TextChannel extends BaseGuildTextChannel { - _patch(data) { - super._patch(data); - - if ('rate_limit_per_user' in data) { - /** - * The rate limit per user (slowmode) for this channel in seconds - * @type {number} - */ - this.rateLimitPerUser = data.rate_limit_per_user; - } - } - - /** - * Sets the rate limit per user (slowmode) for this channel. - * @param {number} rateLimitPerUser The new rate limit in seconds - * @param {string} [reason] Reason for changing the channel's rate limit - * @returns {Promise} - */ - setRateLimitPerUser(rateLimitPerUser, reason) { - return this.edit({ rateLimitPerUser }, reason); - } -} - -module.exports = TextChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/TextDisplayComponent.js b/vendor/discord.js-selfbot-v13/src/structures/TextDisplayComponent.js deleted file mode 100644 index 5e4a83e..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/TextDisplayComponent.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -const BaseMessageComponent = require('./BaseMessageComponent'); -const { MessageComponentTypes } = require('../util/Constants'); - -class TextDisplayComponent extends BaseMessageComponent { - /** - * @property {String} [content] Text that will be displayed similar to a message - */ - - /** - * @param {TextDisplayComponent | APITextDisplayComponent} [data={}] The data - */ - constructor(data = {}) { - super({ type: 'TEXT_DISPLAY' }); - - this.setup(data); - } - - setup(data) { - super.setup(data); - /** - * Text that will be displayed similar to a message - * @type {String} - */ - this.content = data.content ?? null; - } - - /** - * @returns {APITextDisplayComponent} - */ - toJSON() { - return { - type: MessageComponentTypes[this.type], - content: this.content, - }; - } -} - -module.exports = TextDisplayComponent; diff --git a/vendor/discord.js-selfbot-v13/src/structures/TextInputComponent.js b/vendor/discord.js-selfbot-v13/src/structures/TextInputComponent.js deleted file mode 100644 index 8097f00..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/TextInputComponent.js +++ /dev/null @@ -1,134 +0,0 @@ -'use strict'; - -const BaseMessageComponent = require('./BaseMessageComponent'); -const { RangeError } = require('../errors'); -const { TextInputStyles, MessageComponentTypes } = require('../util/Constants'); -const Util = require('../util/Util'); - -/** - * Represents a text input component in a modal - * @extends {BaseMessageComponent} - */ - -class TextInputComponent extends BaseMessageComponent { - /** - * @typedef {BaseMessageComponentOptions} TextInputComponentOptions - * @property {string} [customId] A unique string to be sent in the interaction when submitted - * @property {string} [label] The text to be displayed above this text input component - * @property {number} [maxLength] Maximum length of text that can be entered - * @property {number} [minLength] Minimum length of text required to be entered - * @property {string} [placeholder] Custom placeholder text to display when no text is entered - * @property {boolean} [required] Whether or not this text input component is required - * @property {TextInputStyleResolvable} [style] The style of this text input component - * @property {string} [value] Value of this text input component - */ - - /** - * @param {TextInputComponent|TextInputComponentOptions} [data={}] TextInputComponent to clone or raw data - */ - constructor(data = {}) { - super({ type: 'TEXT_INPUT' }); - - this.setup(data); - } - - setup(data) { - super.setup(data); - /** - * A unique string to be sent in the interaction when submitted - * @type {?string} - */ - this.customId = data.custom_id ?? data.customId ?? null; - - /** - * The text to be displayed above this text input component - * @type {?string} - */ - this.label = data.label ?? null; - - /** - * Maximum length of text that can be entered - * @type {?number} - */ - this.maxLength = data.max_length ?? data.maxLength ?? null; - - /** - * Minimum length of text required to be entered - * @type {?string} - */ - this.minLength = data.min_length ?? data.minLength ?? null; - - /** - * Custom placeholder text to display when no text is entered - * @type {?string} - */ - this.placeholder = data.placeholder ?? null; - - /** - * Whether or not this text input component is required - * @type {?boolean} - */ - this.required = data.required ?? false; - - /** - * The style of this text input component - * @type {?TextInputStyle} - */ - this.style = data.style - ? TextInputComponent.resolveStyle(data.style) - : null; - - /** - * Value of this text input component - * @type {?string} - */ - this.value = data.value ?? null; - } - - /** - * Sets the value of this text input component - * @param {string} value Value of this text input component - * @returns {TextInputComponent} - */ - setValue(value) { - this.value = Util.verifyString(value, RangeError, 'TEXT_INPUT_VALUE'); - return this; - } - - /** - * Transforms the text input component into a plain object - * @returns {APITextInput} The raw data of this text input component - */ - toJSON() { - return { - custom_id: this.customId, - label: this.label, - max_length: this.maxLength, - min_length: this.minLength, - placeholder: this.placeholder, - required: this.required, - style: TextInputStyles[this.style], - type: MessageComponentTypes[this.type], - value: this.value, - }; - } - - /** - * Data that can be resolved to a TextInputStyle. This can be - * * TextInputStyle - * * number - * @typedef {number|TextInputStyle} TextInputStyleResolvable - */ - - /** - * Resolves the style of a text input component - * @param {TextInputStyleResolvable} style The style to resolve - * @returns {TextInputStyle} - * @private - */ - static resolveStyle(style) { - return typeof style === 'string' ? style : TextInputStyles[style]; - } -} - -module.exports = TextInputComponent; diff --git a/vendor/discord.js-selfbot-v13/src/structures/ThreadChannel.js b/vendor/discord.js-selfbot-v13/src/structures/ThreadChannel.js deleted file mode 100644 index dd4135a..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/ThreadChannel.js +++ /dev/null @@ -1,634 +0,0 @@ -'use strict'; - -const { Channel } = require('./Channel'); -const TextBasedChannel = require('./interfaces/TextBasedChannel'); -const { RangeError } = require('../errors'); -const MessageManager = require('../managers/MessageManager'); -const ThreadMemberManager = require('../managers/ThreadMemberManager'); -const ChannelFlags = require('../util/ChannelFlags'); -const Permissions = require('../util/Permissions'); -const { resolveAutoArchiveMaxLimit } = require('../util/Util'); - -/** - * Represents a thread channel on Discord. - * @extends {Channel} - * @implements {TextBasedChannel} - */ -class ThreadChannel extends Channel { - constructor(guild, data, client) { - super(guild?.client ?? client, data, false); - - /** - * The guild the thread is in - * @type {Guild} - */ - this.guild = guild; - - /** - * The id of the member who created this thread - * @type {Snowflake} - */ - this.ownerId = data.owner_id; - - /** - * The id of the guild the channel is in - * @type {Snowflake} - */ - this.guildId = guild?.id ?? data.guild_id; - - /** - * A manager of the messages sent to this thread - * @type {MessageManager} - */ - this.messages = new MessageManager(this); - - /** - * A manager of the members that are part of this thread - * @type {ThreadMemberManager} - */ - this.members = new ThreadMemberManager(this); - if (data) this._patch(data); - } - - _patch(data, partial = false) { - super._patch(data); - - if ('name' in data) { - /** - * The name of the thread - * @type {string} - */ - this.name = data.name; - } - - if ('guild_id' in data) { - this.guildId = data.guild_id; - } - - if ('parent_id' in data) { - /** - * The id of the parent channel of this thread - * @type {?Snowflake} - */ - this.parentId = data.parent_id; - } else { - this.parentId ??= null; - } - - if ('thread_metadata' in data) { - /** - * Whether the thread is locked - * @type {?boolean} - */ - this.locked = data.thread_metadata.locked ?? false; - - /** - * Whether members without `MANAGE_THREADS` can invite other members without `MANAGE_THREADS` - * Always `null` in public threads - * @type {?boolean} - */ - this.invitable = - this.type === 'GUILD_PRIVATE_THREAD' - ? (data.thread_metadata.invitable ?? false) - : null; - - /** - * Whether the thread is archived - * @type {?boolean} - */ - this.archived = data.thread_metadata.archived; - - /** - * The amount of time (in minutes) after which the thread will automatically archive in case of no recent activity - * @type {?number} - */ - this.autoArchiveDuration = data.thread_metadata.auto_archive_duration; - - /** - * The timestamp when the thread's archive status was last changed - * If the thread was never archived or unarchived, this is the timestamp at which the thread was - * created - * @type {?number} - */ - this.archiveTimestamp = data.thread_metadata?.archive_timestamp - ? Date.parse(data.thread_metadata.archive_timestamp) - : null; - - if ('create_timestamp' in data.thread_metadata) { - // Note: this is needed because we can't assign directly to getters - this._createdTimestamp = Date.parse( - data.thread_metadata.create_timestamp, - ); - } - } else { - this.locked ??= null; - this.archived ??= null; - this.autoArchiveDuration ??= null; - this.archiveTimestamp ??= null; - this.invitable ??= null; - } - - this._createdTimestamp ??= - this.type === 'GUILD_PRIVATE_THREAD' ? super.createdTimestamp : null; - - if ('last_message_id' in data) { - /** - * The last message id sent in this thread, if one was sent - * @type {?Snowflake} - */ - this.lastMessageId = data.last_message_id; - } else { - this.lastMessageId ??= null; - } - - if ('last_pin_timestamp' in data) { - /** - * The timestamp when the last pinned message was pinned, if there was one - * @type {?number} - */ - this.lastPinTimestamp = data.last_pin_timestamp - ? new Date(data.last_pin_timestamp).getTime() - : null; - } else { - this.lastPinTimestamp ??= null; - } - - if ('rate_limit_per_user' in data || !partial) { - /** - * The rate limit per user (slowmode) for this thread in seconds - * @type {?number} - */ - this.rateLimitPerUser = data.rate_limit_per_user ?? 0; - } else { - this.rateLimitPerUser ??= null; - } - - if ('message_count' in data) { - /** - * Threads created before July 1, 2022 may have an inaccurate count. - * If you need an approximate value higher than that, use `ThreadChannel#messages.cache.size` - * @type {?number} - */ - this.messageCount = data.message_count; - } else { - this.messageCount ??= null; - } - - if ('member_count' in data) { - /** - * The approximate count of users in this thread - * This stops counting at 50. If you need an approximate value higher than that, use - * `ThreadChannel#members.cache.size` - * @type {?number} - */ - this.memberCount = data.member_count; - } else { - this.memberCount ??= null; - } - - if ('total_message_sent' in data) { - /** - * The number of messages ever sent in a thread, similar to {@link ThreadChannel#messageCount} except it - * will not decrement whenever a message is deleted - * @type {?number} - */ - this.totalMessageSent = data.total_message_sent; - } else { - this.totalMessageSent ??= null; - } - - if ('applied_tags' in data) { - /** - * The tags applied to this thread - * @type {Snowflake[]} - */ - this.appliedTags = data.applied_tags; - } else { - this.appliedTags ??= []; - } - - if (data.member && this.client.user) - this.members._add({ user_id: this.client.user.id, ...data.member }); - if (data.messages) - for (const message of data.messages) this.messages._add(message); - } - - /** - * The timestamp when this thread was created. This isn't available for threads - * created before 2022-01-09 - * @type {?number} - * @readonly - */ - get createdTimestamp() { - return this._createdTimestamp; - } - - /** - * A collection of associated guild member objects of this thread's members - * @type {Collection} - * @readonly - */ - get guildMembers() { - return this.members.cache.mapValues((member) => member.guildMember); - } - - /** - * The time at which this thread's archive status was last changed - * If the thread was never archived or unarchived, this is the time at which the thread was created - * @type {?Date} - * @readonly - */ - get archivedAt() { - if (!this.archiveTimestamp) return null; - return new Date(this.archiveTimestamp); - } - - /** - * The time the thread was created at - * @type {?Date} - * @readonly - */ - get createdAt() { - return this.createdTimestamp && new Date(this.createdTimestamp); - } - - /** - * The parent channel of this thread - * @type {?(NewsChannel|TextChannel|ForumChannel|MediaChannel)} - * @readonly - */ - get parent() { - return this.guild.channels.resolve(this.parentId); - } - - /** - * Makes the client user join the thread. - * @returns {Promise} - */ - async join() { - await this.members.add('@me'); - return this; - } - - /** - * Makes the client user leave the thread. - * @returns {Promise} - */ - async leave() { - await this.members.remove('@me'); - return this; - } - - /** - * Gets the overall set of permissions for a member or role in this thread's parent channel, taking overwrites into - * account. - * @param {GuildMemberResolvable|RoleResolvable} memberOrRole The member or role to obtain the overall permissions for - * @param {boolean} [checkAdmin=true] Whether having `ADMINISTRATOR` will return all permissions - * @returns {?Readonly} - */ - permissionsFor(memberOrRole, checkAdmin) { - return this.parent?.permissionsFor(memberOrRole, checkAdmin) ?? null; - } - - /** - * Fetches the owner of this thread. If the thread member object isn't needed, - * use {@link ThreadChannel#ownerId} instead. - * @param {BaseFetchOptions} [options] The options for fetching the member - * @returns {Promise} - */ - async fetchOwner({ cache = true, force = false } = {}) { - if (!force) { - const existing = this.members.cache.get(this.ownerId); - if (existing) return existing; - } - - // We cannot fetch a single thread member, as of this commit's date, Discord API responds with 405 - const members = await this.members.fetch(cache); - return members.get(this.ownerId) ?? null; - } - - /** - * Fetches the message that started this thread, if any. - * The `Promise` will reject if the original message in a forum post is deleted - * or when the original message in the parent channel is deleted. - * If you just need the id of that message, use {@link ThreadChannel#id} instead. - * @param {BaseFetchOptions} [options] Additional options for this fetch - * @returns {Promise} - */ - // eslint-disable-next-line require-await - async fetchStarterMessage(options) { - const channel = this.parent?.type === 'GUILD_FORUM' ? this : this.parent; - return channel?.messages.fetch(this.id, options) ?? null; - } - - /** - * The options used to edit a thread channel - * @typedef {Object} ThreadEditData - * @property {string} [name] The new name for the thread - * @property {boolean} [archived] Whether the thread is archived - * @property {ThreadAutoArchiveDuration} [autoArchiveDuration] The amount of time (in minutes) after which the thread - * should automatically archive in case of no recent activity - * @property {number} [rateLimitPerUser] The rate limit per user (slowmode) for the thread in seconds - * @property {boolean} [locked] Whether the thread is locked - * @property {boolean} [invitable] Whether non-moderators can add other non-moderators to a thread - * Can only be edited on `GUILD_PRIVATE_THREAD` - * @property {Snowflake[]} [appliedTags] The tags to apply to the thread - * @property {ChannelFlagsResolvable} [flags] The flags to set on the channel - */ - - /** - * Edits this thread. - * @param {ThreadEditData} data The new data for this thread - * @param {string} [reason] Reason for editing this thread - * @returns {Promise} - * @example - * // Edit a thread - * thread.edit({ name: 'new-thread' }) - * .then(editedThread => console.log(editedThread)) - * .catch(console.error); - */ - async edit(data, reason) { - let autoArchiveDuration = data.autoArchiveDuration; - if (autoArchiveDuration === 'MAX') - autoArchiveDuration = resolveAutoArchiveMaxLimit(this.guild); - - const newData = await this.client.api.channels(this.id).patch({ - data: { - name: data.name, - archived: data.archived, - auto_archive_duration: autoArchiveDuration, - rate_limit_per_user: data.rateLimitPerUser, - locked: data.locked, - invitable: - this.type === 'GUILD_PRIVATE_THREAD' ? data.invitable : undefined, - applied_tags: data.appliedTags, - flags: 'flags' in data ? ChannelFlags.resolve(data.flags) : undefined, - }, - reason, - }); - - return this.client.actions.ChannelUpdate.handle(newData).updated; - } - - /** - * Sets whether the thread is archived. - * @param {boolean} [archived=true] Whether the thread is archived - * @param {string} [reason] Reason for archiving or unarchiving - * @returns {Promise} - * @example - * // Archive the thread - * thread.setArchived(true) - * .then(newThread => console.log(`Thread is now ${newThread.archived ? 'archived' : 'active'}`)) - * .catch(console.error); - */ - setArchived(archived = true, reason) { - return this.edit({ archived }, reason); - } - - /** - * Sets the duration after which the thread will automatically archive in case of no recent activity. - * @param {ThreadAutoArchiveDuration} autoArchiveDuration The amount of time (in minutes) after which the thread - * should automatically archive in case of no recent activity - * @param {string} [reason] Reason for changing the auto archive duration - * @returns {Promise} - * @example - * // Set the thread's auto archive time to 1 hour - * thread.setAutoArchiveDuration(60) - * .then(newThread => { - * console.log(`Thread will now archive after ${newThread.autoArchiveDuration} minutes of inactivity`); - * }); - * .catch(console.error); - */ - setAutoArchiveDuration(autoArchiveDuration, reason) { - return this.edit({ autoArchiveDuration }, reason); - } - - /** - * Sets whether members without the `MANAGE_THREADS` permission can invite other members without the - * `MANAGE_THREADS` permission to this thread. - * @param {boolean} [invitable=true] Whether non-moderators can invite non-moderators to this thread - * @param {string} [reason] Reason for changing invite - * @returns {Promise} - */ - async setInvitable(invitable = true, reason) { - if (this.type !== 'GUILD_PRIVATE_THREAD') - throw new RangeError('THREAD_INVITABLE_TYPE', this.type); - return this.edit({ invitable }, reason); - } - - /** - * Sets whether the thread can be **unarchived** by anyone with `SEND_MESSAGES` permission. - * When a thread is locked only members with `MANAGE_THREADS` can unarchive it. - * @param {boolean} [locked=true] Whether the thread is locked - * @param {string} [reason] Reason for locking or unlocking the thread - * @returns {Promise} - * @example - * // Set the thread to locked - * thread.setLocked(true) - * .then(newThread => console.log(`Thread is now ${newThread.locked ? 'locked' : 'unlocked'}`)) - * .catch(console.error); - */ - setLocked(locked = true, reason) { - return this.edit({ locked }, reason); - } - - /** - * Sets a new name for this thread. - * @param {string} name The new name for the thread - * @param {string} [reason] Reason for changing the thread's name - * @returns {Promise} - * @example - * // Change the thread's name - * thread.setName('not_general') - * .then(newThread => console.log(`Thread's new name is ${newThread.name}`)) - * .catch(console.error); - */ - setName(name, reason) { - return this.edit({ name }, reason); - } - - /** - * Sets the rate limit per user (slowmode) for this thread. - * @param {number} rateLimitPerUser The new rate limit in seconds - * @param {string} [reason] Reason for changing the thread's rate limit - * @returns {Promise} - */ - setRateLimitPerUser(rateLimitPerUser, reason) { - return this.edit({ rateLimitPerUser }, reason); - } - - /** - * Pins this thread from the forum channel. - * @param {string} [reason] Reason for pinning - * @returns {Promise} - */ - pin(reason) { - return this.edit( - { flags: this.flags.add(ChannelFlags.FLAGS.PINNED) }, - reason, - ); - } - - /** - * Unpins this thread from the forum channel. - * @param {string} [reason] Reason for unpinning - * @returns {Promise} - */ - unpin(reason) { - return this.edit( - { flags: this.flags.remove(ChannelFlags.FLAGS.PINNED) }, - reason, - ); - } - - /** - * Set the applied tags for this channel (only applicable to forum threads) - * @param {Snowflake[]} appliedTags The tags to set for this channel - * @param {string} [reason] Reason for changing the thread's applied tags - * @returns {Promise} - */ - setAppliedTags(appliedTags, reason) { - return this.edit({ appliedTags }, reason); - } - - /** - * Whether the client user is a member of the thread. - * @type {boolean} - * @readonly - */ - get joined() { - return this.members.cache.has(this.client.user?.id); - } - - /** - * Whether the thread is editable by the client user (name, archived, autoArchiveDuration) - * @type {boolean} - * @readonly - */ - get editable() { - return ( - (this.ownerId === this.client.user.id && - (this.type !== 'GUILD_PRIVATE_THREAD' || this.joined)) || - this.manageable - ); - } - - /** - * Whether the thread is joinable by the client user - * @type {boolean} - * @readonly - */ - get joinable() { - return ( - !this.archived && - !this.joined && - this.permissionsFor(this.client.user)?.has( - this.type === 'GUILD_PRIVATE_THREAD' - ? Permissions.FLAGS.MANAGE_THREADS - : Permissions.FLAGS.VIEW_CHANNEL, - false, - ) - ); - } - - /** - * Whether the thread is manageable by the client user, for deleting or editing rateLimitPerUser or locked. - * @type {boolean} - * @readonly - */ - get manageable() { - const permissions = this.permissionsFor(this.client.user); - if (!permissions) return false; - // This flag allows managing even if timed out - if (permissions.has(Permissions.FLAGS.ADMINISTRATOR, false)) return true; - - return ( - this.guild.members.me.communicationDisabledUntilTimestamp < Date.now() && - permissions.has(Permissions.FLAGS.MANAGE_THREADS, false) - ); - } - - /** - * Whether the thread is viewable by the client user - * @type {boolean} - * @readonly - */ - get viewable() { - if (this.client.user.id === this.guild.ownerId) return true; - const permissions = this.permissionsFor(this.client.user); - if (!permissions) return false; - return permissions.has(Permissions.FLAGS.VIEW_CHANNEL, false); - } - - /** - * Whether the client user can send messages in this thread - * @type {boolean} - * @readonly - */ - get sendable() { - const permissions = this.permissionsFor(this.client.user); - if (!permissions) return false; - // This flag allows sending even if timed out - if (permissions.has(Permissions.FLAGS.ADMINISTRATOR, false)) return true; - - return ( - !(this.archived && this.locked && !this.manageable) && - (this.type !== 'GUILD_PRIVATE_THREAD' || - this.joined || - this.manageable) && - permissions.has(Permissions.FLAGS.SEND_MESSAGES_IN_THREADS, false) && - this.guild.members.me.communicationDisabledUntilTimestamp < Date.now() - ); - } - - /** - * Whether the thread is unarchivable by the client user - * @type {boolean} - * @readonly - */ - get unarchivable() { - return this.archived && this.sendable && (!this.locked || this.manageable); - } - - /** - * Whether this thread is a private thread - * @returns {boolean} - */ - isPrivate() { - return this.type === 'GUILD_PRIVATE_THREAD'; - } - - /** - * Deletes this thread. - * @param {string} [reason] Reason for deleting this thread - * @returns {Promise} - * @example - * // Delete the thread - * thread.delete('cleaning out old threads') - * .then(deletedThread => console.log(deletedThread)) - * .catch(console.error); - */ - async delete(reason) { - await this.guild.channels.delete(this.id, reason); - return this; - } - - // These are here only for documentation purposes - they are implemented by TextBasedChannel - /* eslint-disable no-empty-function */ - get lastMessage() {} - get lastPinAt() {} - send() {} - sendTyping() {} - createMessageCollector() {} - awaitMessages() {} - // Doesn't work on Thread channels; setRateLimitPerUser() {} - // Doesn't work on Thread channels; setNSFW() {} -} - -TextBasedChannel.applyToClass(ThreadChannel, true, [ - 'fetchWebhooks', - 'setRateLimitPerUser', - 'setNSFW', -]); - -module.exports = ThreadChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/ThreadMember.js b/vendor/discord.js-selfbot-v13/src/structures/ThreadMember.js deleted file mode 100644 index 8efb1c8..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/ThreadMember.js +++ /dev/null @@ -1,106 +0,0 @@ -'use strict'; - -const Base = require('./Base'); -const ThreadMemberFlags = require('../util/ThreadMemberFlags'); - -/** - * Represents a Member for a Thread. - * @extends {Base} - */ -class ThreadMember extends Base { - constructor(thread, data, extra = {}) { - super(thread.client); - - /** - * The thread that this member is a part of - * @type {ThreadChannel} - */ - this.thread = thread; - - /** - * The timestamp the member last joined the thread at - * @type {?number} - */ - this.joinedTimestamp = null; - - /** - * The id of the thread member - * @type {Snowflake} - */ - this.id = data.user_id; - - this._patch(data, extra); - } - - _patch(data, extra = {}) { - if ('join_timestamp' in data) - this.joinedTimestamp = new Date(data.join_timestamp).getTime(); - - if ('flags' in data) { - /** - * The flags for this thread member - * @type {ThreadMemberFlags} - */ - this.flags = new ThreadMemberFlags(data.flags).freeze(); - } - - if ('member' in data) { - /** - * The guild member associated with this thread member. - * @type {?GuildMember} - * @private - */ - this.member = this.thread.guild.members._add(data.member, extra.cache); - } else { - this.member ??= null; - } - } - - /** - * The guild member associated with this thread member - * @type {?GuildMember} - * @readonly - */ - get guildMember() { - return this.member ?? this.thread.guild.members.cache.get(this.id) ?? null; - } - - /** - * The last time this member joined the thread - * @type {?Date} - * @readonly - */ - get joinedAt() { - return this.joinedTimestamp ? new Date(this.joinedTimestamp) : null; - } - - /** - * The user associated with this thread member - * @type {?User} - * @readonly - */ - get user() { - return this.client.users.cache.get(this.id) ?? null; - } - - /** - * Whether the client user can manage this thread member - * @type {boolean} - * @readonly - */ - get manageable() { - return !this.thread.archived && this.thread.editable; - } - - /** - * Removes this member from the thread. - * @param {string} [reason] Reason for removing the member - * @returns {ThreadMember} - */ - async remove(reason) { - await this.thread.members.remove(this.id, reason); - return this; - } -} - -module.exports = ThreadMember; diff --git a/vendor/discord.js-selfbot-v13/src/structures/ThreadOnlyChannel.js b/vendor/discord.js-selfbot-v13/src/structures/ThreadOnlyChannel.js deleted file mode 100644 index 05e4109..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/ThreadOnlyChannel.js +++ /dev/null @@ -1,256 +0,0 @@ -'use strict'; - -const GuildChannel = require('./GuildChannel'); -const TextBasedChannel = require('./interfaces/TextBasedChannel'); -const GuildForumThreadManager = require('../managers/GuildForumThreadManager'); -const { SortOrderTypes } = require('../util/Constants'); -const { - transformAPIGuildForumTag, - transformAPIGuildDefaultReaction, -} = require('../util/Util'); - -/** - * @typedef {Object} GuildForumTagEmoji - * @property {?Snowflake} id The id of a guild's custom emoji - * @property {?string} name The unicode character of the emoji - */ - -/** - * @typedef {Object} GuildForumTag - * @property {Snowflake} id The id of the tag - * @property {string} name The name of the tag - * @property {boolean} moderated Whether this tag can only be added to or removed from threads - * by a member with the `ManageThreads` permission - * @property {?GuildForumTagEmoji} emoji The emoji of this tag - */ - -/** - * @typedef {Object} GuildForumTagData - * @property {Snowflake} [id] The id of the tag - * @property {string} name The name of the tag - * @property {boolean} [moderated] Whether this tag can only be added to or removed from threads - * by a member with the `ManageThreads` permission - * @property {?GuildForumTagEmoji} [emoji] The emoji of this tag - */ - -/** - * @typedef {Object} DefaultReactionEmoji - * @property {?Snowflake} id The id of a guild's custom emoji - * @property {?string} name The unicode character of the emoji - */ - -/** - * Represents a channel that only contains threads - * @extends {GuildChannel} - * @implements {TextBasedChannel} - * @abstract - */ -class ThreadOnlyChannel extends GuildChannel { - constructor(guild, data, client) { - super(guild, data, client, false); - - /** - * A manager of the threads belonging to this channel - * @type {GuildForumThreadManager} - */ - this.threads = new GuildForumThreadManager(this); - - this._patch(data); - } - - _patch(data) { - super._patch(data); - if ('available_tags' in data) { - /** - * The set of tags that can be used in this channel. - * @type {GuildForumTag[]} - */ - this.availableTags = data.available_tags.map((tag) => - transformAPIGuildForumTag(tag), - ); - } else { - this.availableTags ??= []; - } - - if ('default_reaction_emoji' in data) { - /** - * The emoji to show in the add reaction button on a thread in a guild forum channel - * @type {?DefaultReactionEmoji} - */ - this.defaultReactionEmoji = - data.default_reaction_emoji && - transformAPIGuildDefaultReaction(data.default_reaction_emoji); - } else { - this.defaultReactionEmoji ??= null; - } - - if ('default_thread_rate_limit_per_user' in data) { - /** - * The initial rate limit per user (slowmode) to set on newly created threads in a channel. - * @type {?number} - */ - this.defaultThreadRateLimitPerUser = - data.default_thread_rate_limit_per_user; - } else { - this.defaultThreadRateLimitPerUser ??= null; - } - - if ('rate_limit_per_user' in data) { - /** - * The rate limit per user (slowmode) for this channel. - * @type {?number} - */ - this.rateLimitPerUser = data.rate_limit_per_user; - } else { - this.rateLimitPerUser ??= null; - } - - if ('default_auto_archive_duration' in data) { - /** - * The default auto archive duration for newly created threads in this channel. - * @type {?ThreadAutoArchiveDuration} - */ - this.defaultAutoArchiveDuration = data.default_auto_archive_duration; - } else { - this.defaultAutoArchiveDuration ??= null; - } - - if ('nsfw' in data) { - /** - * If this channel is considered NSFW. - * @type {boolean} - */ - this.nsfw = data.nsfw; - } else { - this.nsfw ??= false; - } - - if ('topic' in data) { - /** - * The topic of this channel. - * @type {?string} - */ - this.topic = data.topic; - } - - if ('default_sort_order' in data) { - /** - * The default sort order mode used to order posts - * @type {?SortOrderType} - */ - this.defaultSortOrder = SortOrderTypes[data.default_sort_order]; - } else { - this.defaultSortOrder ??= null; - } - } - - /** - * Sets the available tags for this forum channel - * @param {GuildForumTagData[]} availableTags The tags to set as available in this channel - * @param {string} [reason] Reason for changing the available tags - * @returns {Promise} - */ - setAvailableTags(availableTags, reason) { - return this.edit({ availableTags }, reason); - } - - /** - * Sets the default reaction emoji for this channel - * @param {?DefaultReactionEmoji} defaultReactionEmoji The emoji to set as the default reaction emoji - * @param {string} [reason] Reason for changing the default reaction emoji - * @returns {Promise} - */ - setDefaultReactionEmoji(defaultReactionEmoji, reason) { - return this.edit({ defaultReactionEmoji }, reason); - } - - /** - * Sets the default rate limit per user (slowmode) for new threads in this channel - * @param {number} defaultThreadRateLimitPerUser The rate limit to set on newly created threads in this channel - * @param {string} [reason] Reason for changing the default rate limit - * @returns {Promise} - */ - setDefaultThreadRateLimitPerUser(defaultThreadRateLimitPerUser, reason) { - return this.edit({ defaultThreadRateLimitPerUser }, reason); - } - - /** - * Sets the default sort order mode used to order posts - * @param {?SortOrderType} defaultSortOrder The default sort order mode to set on this channel - * @param {string} [reason] Reason for changing the default sort order - * @returns {Promise} - */ - setDefaultSortOrder(defaultSortOrder, reason) { - return this.edit({ defaultSortOrder }, reason); - } - - /** - * Creates an invite to this guild channel. - * @param {CreateInviteOptions} [options={}] The options for creating the invite - * @returns {Promise} - * @example - * // Create an invite to a channel - * channel.createInvite() - * .then(invite => console.log(`Created an invite with a code of ${invite.code}`)) - * .catch(console.error); - */ - createInvite(options) { - return this.guild.invites.create(this.id, options); - } - - /** - * Fetches a collection of invites to this guild channel. - * Resolves with a collection mapping invites by their codes. - * @param {boolean} [cache=true] Whether or not to cache the fetched invites - * @returns {Promise>} - */ - fetchInvites(cache = true) { - return this.guild.invites.fetch({ channelId: this.id, cache }); - } - - /** - * Sets the default auto archive duration for all newly created threads in this channel. - * @param {ThreadAutoArchiveDuration} defaultAutoArchiveDuration The new default auto archive duration - * @param {string} [reason] Reason for changing the channel's default auto archive duration - * @returns {Promise} - */ - setDefaultAutoArchiveDuration(defaultAutoArchiveDuration, reason) { - return this.edit({ defaultAutoArchiveDuration }, reason); - } - - /** - * Sets a new topic for the guild channel. - * @param {?string} topic The new topic for the guild channel - * @param {string} [reason] Reason for changing the guild channel's topic - * @returns {Promise} - * @example - * // Set a new channel topic - * channel.setTopic('needs more rate limiting') - * .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`)) - * .catch(console.error); - */ - setTopic(topic, reason) { - return this.edit({ topic }, reason); - } - - // These are here only for documentation purposes - they are implemented by TextBasedChannel - /* eslint-disable no-empty-function */ - createWebhook() {} - fetchWebhooks() {} - setNSFW() {} - setRateLimitPerUser() {} -} - -TextBasedChannel.applyToClass(ThreadOnlyChannel, true, [ - 'send', - 'lastMessage', - 'lastPinAt', - 'bulkDelete', - 'sendTyping', - 'createMessageCollector', - 'awaitMessages', - 'createMessageComponentCollector', - 'awaitMessageComponent', -]); - -module.exports = ThreadOnlyChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/ThumbnailComponent.js b/vendor/discord.js-selfbot-v13/src/structures/ThumbnailComponent.js deleted file mode 100644 index ca71a67..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/ThumbnailComponent.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -const BaseMessageComponent = require('./BaseMessageComponent'); -const UnfurledMediaItem = require('./UnfurledMediaItem'); -const { MessageComponentTypes } = require('../util/Constants'); - -class ThumbnailComponent extends BaseMessageComponent { - /** - * @property {UnfurledMediaItem} [media] A url or attachment - * @property {String} [description] Alt text for the media, max 1024 characters - * @property {Boolean} [spoiler] Whether the thumbnail should be a spoiler (or blurred out). Defaults to false - */ - - /** - * @param {ThumbnailComponent | APIThumbnailComponent} [data={}] The data - */ - constructor(data = {}) { - super({ type: 'THUMBNAIL' }); - - this.setup(data); - } - - setup(data) { - super.setup(data); - /** - * A url or attachment - * @type {UnfurledMediaItem} - */ - this.media = new UnfurledMediaItem(data.media); - - /** - * Alt text for the media, max 1024 characters - * @type {String} - */ - this.description = data.description ?? null; - - /** - * Whether the thumbnail should be a spoiler (or blurred out). Defaults to false - * @type {Boolean} - */ - this.spoiler = data.spoiler ?? false; - } - - /** - * @returns {APIThumbnailComponent} - */ - toJSON() { - return { - type: MessageComponentTypes[this.type], - media: this.media.toJSON(), - description: this.description, - spoiler: this.spoiler, - }; - } -} - -module.exports = ThumbnailComponent; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Typing.js b/vendor/discord.js-selfbot-v13/src/structures/Typing.js deleted file mode 100644 index 341d7ca..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Typing.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; - -const Base = require('./Base'); - -/** - * Represents a typing state for a user in a channel. - * @extends {Base} - */ -class Typing extends Base { - constructor(channel, user, data) { - super(channel.client); - - /** - * The channel the status is from - * @type {TextBasedChannels} - */ - this.channel = channel; - - /** - * The user who is typing - * @type {User} - */ - this.user = user; - - this._patch(data); - } - - _patch(data) { - if ('timestamp' in data) { - /** - * The UNIX timestamp in milliseconds the user started typing at - * @type {number} - */ - this.startedTimestamp = data.timestamp * 1_000; - } - } - - /** - * Indicates whether the status is received from a guild. - * @returns {boolean} - */ - inGuild() { - return this.guild !== null; - } - - /** - * The time the user started typing at - * @type {Date} - * @readonly - */ - get startedAt() { - return new Date(this.startedTimestamp); - } - - /** - * The guild the status is from - * @type {?Guild} - * @readonly - */ - get guild() { - return this.channel.guild ?? null; - } - - /** - * The member who is typing - * @type {?GuildMember} - * @readonly - */ - get member() { - return this.guild?.members.resolve(this.user) ?? null; - } -} - -module.exports = Typing; diff --git a/vendor/discord.js-selfbot-v13/src/structures/UnfurledMediaItem.js b/vendor/discord.js-selfbot-v13/src/structures/UnfurledMediaItem.js deleted file mode 100644 index d299ac0..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/UnfurledMediaItem.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -class UnfurledMediaItem { - /** - * @property {string} [url] Supports arbitrary urls and `attachment://` references - */ - /** - * @param {UnfurledMediaItem | APIUnfurledMediaItem} [data={}] The data - */ - constructor(data = {}) { - /** - * @type {string} - */ - this.url = data.url ?? null; - /** - * @type {APIUnfurledMediaItem} - */ - this.data = data; - } - /** - * Returns the API-compatible JSON for this media item - * @returns {APIUnfurledMediaItem} - */ - toJSON() { - return { ...this.data }; - } -} - -module.exports = UnfurledMediaItem; diff --git a/vendor/discord.js-selfbot-v13/src/structures/User.js b/vendor/discord.js-selfbot-v13/src/structures/User.js deleted file mode 100644 index 4963d89..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/User.js +++ /dev/null @@ -1,663 +0,0 @@ -'use strict'; - -const Base = require('./Base'); -const VoiceState = require('./VoiceState'); -const TextBasedChannel = require('./interfaces/TextBasedChannel'); -const { Error } = require('../errors'); -const { RelationshipTypes } = require('../util/Constants'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); -const UserFlags = require('../util/UserFlags'); -const Util = require('../util/Util'); - -/** - * Represents a user on Discord. - * @implements {TextBasedChannel} - * @extends {Base} - */ -class User extends Base { - constructor(client, data) { - super(client); - - /** - * The user's id - * @type {Snowflake} - */ - this.id = data.id; - - this.bot = null; - - this.system = null; - - this.flags = null; - - this._patch(data); - } - - _patch(data) { - if ('username' in data) { - /** - * The username of the user - * @type {?string} - */ - this.username = data.username; - } else { - this.username ??= null; - } - - if ('global_name' in data) { - /** - * The global name of this user - * @type {?string} - */ - this.globalName = data.global_name; - } else { - this.globalName ??= null; - } - - if ('bot' in data) { - /** - * Whether or not the user is a bot - * @type {?boolean} - */ - this.bot = Boolean(data.bot); - } else if (!this.partial && typeof this.bot !== 'boolean') { - this.bot = false; - } - - if ('discriminator' in data) { - /** - * The discriminator of this user - * `'0'`, or a 4-digit stringified number if they're using the legacy username system - * @type {?string} - */ - this.discriminator = data.discriminator; - } else { - this.discriminator ??= null; - } - - if ('avatar' in data) { - /** - * The user avatar's hash - * @type {?string} - */ - this.avatar = data.avatar; - } else { - this.avatar ??= null; - } - - if ('banner' in data) { - /** - * The user banner's hash - * The user must be force fetched for this property to be present or be updated - * @type {?string} - */ - this.banner = data.banner; - } else if (this.banner !== null) { - this.banner ??= undefined; - } - - if ('banner_color' in data) { - /** - * The user banner's hex - * The user must be force fetched for this property to be present or be updated - * @type {?string} - */ - this.bannerColor = data.banner_color; - } else if (this.bannerColor !== null) { - this.bannerColor ??= undefined; - } - - if ('accent_color' in data) { - /** - * The base 10 accent color of the user's banner - * The user must be force fetched for this property to be present or be updated - * @type {?number} - */ - this.accentColor = data.accent_color; - } else if (this.accentColor !== null) { - this.accentColor ??= undefined; - } - - if ('system' in data) { - /** - * Whether the user is an Official Discord System user (part of the urgent message system) - * @type {?boolean} - */ - this.system = Boolean(data.system); - } else if (!this.partial && typeof this.system !== 'boolean') { - this.system = false; - } - - if ('public_flags' in data) { - /** - * The flags for this user - * @type {?UserFlags} - */ - this.flags = new UserFlags(data.public_flags); - } - - /** - * @typedef {Object} AvatarDecorationData - * @property {string} asset The avatar decoration hash - * @property {Snowflake} skuId The id of the avatar decoration's SKU - */ - - if (data.avatar_decoration_data) { - if (data.avatar_decoration_data) { - /** - * The user avatar decoration's data - * @type {?AvatarDecorationData} - */ - this.avatarDecorationData = { - asset: data.avatar_decoration_data.asset, - skuId: data.avatar_decoration_data.sku_id, - }; - } else { - this.avatarDecorationData = null; - } - } else { - this.avatarDecorationData ??= null; - } - - /** - * @typedef {Object} UserPrimaryGuild - * @property {?Snowflake} identityGuildId The id of the user's primary guild - * @property {?boolean} identityEnabled Whether the user is displaying the primary guild's tag - * @property {?string} tag The user's guild tag. Limited to 4 characters - * @property {?string} badge The guild tag badge hash - */ - - if ('primary_guild' in data) { - if (data.primary_guild) { - /** - * The primary guild of the user - * @type {?UserPrimaryGuild} - */ - this.primaryGuild = { - identityGuildId: data.primary_guild.identity_guild_id, - identityEnabled: data.primary_guild.identity_enabled, - tag: data.primary_guild.tag, - badge: data.primary_guild.badge, - }; - } else { - this.primaryGuild = null; - } - } else { - this.primaryGuild ??= null; - } - - /** - * @typedef {Object} NameplateData - * @property {Snowflake} skuId The id of the nameplate's SKU - * @property {string} asset The nameplate's asset path - * @property {string} label The nameplate's label - * @property {NameplatePalette} palette Background color of the nameplate - */ - - /** - * @typedef {Object} Collectibles - * @property {?NameplateData} nameplate The user's nameplate data - */ - - if (data.collectibles) { - if (data.collectibles.nameplate) { - /** - * The user's collectibles - * @type {?Collectibles} - */ - this.collectibles = { - nameplate: { - skuId: data.collectibles.nameplate.sku_id, - asset: data.collectibles.nameplate.asset, - label: data.collectibles.nameplate.label, - palette: data.collectibles.nameplate.palette, - }, - }; - } else { - this.collectibles = { nameplate: null }; - } - } else { - this.collectibles ??= null; - } - } - - /** - * The primary clan the user is in - * @type {?PrimaryGuild} - * @deprecated Use `primaryGuild` instead - */ - get clan() { - return this.primaryGuild; - } - - /** - * The user avatar decoration's hash - * @type {?string} - * @deprecated Use `avatarDecorationData` instead - * Removed in v4 - */ - get avatarDecoration() { - return this.avatarDecorationData?.asset || null; - } - - /** - * Whether this User is a partial - * @type {boolean} - * @readonly - */ - get partial() { - return typeof this.username !== 'string'; - } - - /** - * The timestamp the user was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return SnowflakeUtil.timestampFrom(this.id); - } - - /** - * The time the user was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * A link to the user's avatar. - * @param {ImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - avatarURL({ format, size, dynamic } = {}) { - if (!this.avatar) return null; - return this.client.rest.cdn.Avatar( - this.id, - this.avatar, - format, - size, - dynamic, - ); - } - - /** - * A link to the user's avatar decoration. - * @returns {?string} - */ - avatarDecorationURL() { - if (!this.avatarDecorationData) return null; - return this.client.rest.cdn.AvatarDecoration( - this.avatarDecorationData.asset, - ); - } - - /** - * A link to the user's guild tag badge. - * @returns {?string} - * @deprecated - */ - clanBadgeURL() { - return this.guildTagBadgeURL(); - } - - /** - * A link to the user's guild tag badge. - * @returns {?string} - */ - guildTagBadgeURL() { - if ( - !this.primaryGuild || - !this.primaryGuild.identityGuildId || - !this.primaryGuild.badge - ) - return null; - return this.client.rest.cdn.GuildTagBadge( - this.primaryGuild.identityGuildId, - this.primaryGuild.badge, - ); - } - - /** - * A link to the user's default avatar - * @type {string} - * @readonly - */ - get defaultAvatarURL() { - const index = - this.discriminator === '0' || this.discriminator === '0000' - ? Util.calculateUserDefaultAvatarIndex(this.id) - : this.discriminator % 5; - return this.client.rest.cdn.DefaultAvatar(index); - } - - /** - * A link to the user's avatar if they have one. - * Otherwise a link to their default avatar will be returned. - * @param {ImageURLOptions} [options={}] Options for the Image URL - * @returns {string} - */ - displayAvatarURL(options) { - return this.avatarURL(options) ?? this.defaultAvatarURL; - } - - /** - * The hexadecimal version of the user accent color, with a leading hash - * The user must be force fetched for this property to be present - * @type {?string} - * @readonly - */ - get hexAccentColor() { - if (typeof this.accentColor !== 'number') return this.accentColor; - return `#${this.accentColor.toString(16).padStart(6, '0')}`; - } - - /** - * A link to the user's banner. - * This method will throw an error if called before the user is force fetched. - * See {@link User#banner} for more info - * @param {ImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - bannerURL({ format, size, dynamic } = {}) { - if (typeof this.banner === 'undefined') - throw new Error('USER_BANNER_NOT_FETCHED'); - if (!this.banner) return null; - return this.client.rest.cdn.Banner( - this.id, - this.banner, - format, - size, - dynamic, - ); - } - - /** - * The tag of this user - * This user's username, or their legacy tag (e.g. `hydrabolt#0001`) - * if they're using the legacy username system - * @type {?string} - * @readonly - */ - get tag() { - return typeof this.username === 'string' - ? this.discriminator === '0' || this.discriminator === '0000' - ? this.username - : `${this.username}#${this.discriminator}` - : null; - } - - /** - * The global name of this user, or their username if they don't have one - * @type {?string} - * @readonly - */ - get displayName() { - return this.globalName ?? this.username; - } - - /** - * The DM between the client's user and this user - * @type {?DMChannel} - * @readonly - */ - get dmChannel() { - return this.client.users.dmChannel(this.id); - } - - /** - * Creates a DM channel between the client and the user. - * @param {boolean} [force=false] Whether to skip the cache check and request the API - * @returns {Promise} - */ - createDM(force = false) { - return this.client.users.createDM(this.id, force); - } - - /** - * Deletes a DM channel (if one exists) between the client and the user. Resolves with the channel if successful. - * @returns {Promise} - */ - deleteDM() { - return this.client.users.deleteDM(this.id); - } - - /** - * Checks if the user is equal to another. - * It compares id, username, discriminator, avatar, banner, accent color, and bot flags. - * It is recommended to compare equality by using `user.id === user2.id` unless you want to compare all properties. - * @param {User} user User to compare with - * @returns {boolean} - */ - equals(user) { - return ( - user && - this.id === user.id && - this.username === user.username && - this.discriminator === user.discriminator && - this.globalName === user.globalName && - this.avatar === user.avatar && - this.flags?.bitfield === user.flags?.bitfield && - this.banner === user.banner && - this.accentColor === user.accentColor && - this.avatarDecorationData?.asset === user.avatarDecorationData?.asset && - this.avatarDecorationData?.skuId === user.avatarDecorationData?.skuId && - this.collectibles?.nameplate?.skuId === - user.collectibles?.nameplate?.skuId && - this.collectibles?.nameplate?.asset === - user.collectibles?.nameplate?.asset && - this.collectibles?.nameplate?.label === - user.collectibles?.nameplate?.label && - this.collectibles?.nameplate?.palette === - user.collectibles?.nameplate?.palette && - this.primaryGuild?.identityGuildId === - user.primaryGuild?.identityGuildId && - this.primaryGuild?.identityEnabled === - user.primaryGuild?.identityEnabled && - this.primaryGuild?.tag === user.primaryGuild?.tag && - this.primaryGuild?.badge === user.primaryGuild?.badge - ); - } - - /** - * Compares the user with an API user object - * @param {APIUser} user The API user object to compare - * @returns {boolean} - * @private - */ - _equals(user) { - return ( - user && - this.id === user.id && - this.username === user.username && - this.discriminator === user.discriminator && - this.globalName === user.global_name && - this.avatar === user.avatar && - this.flags?.bitfield === user.public_flags && - ('banner' in user ? this.banner === user.banner : true) && - ('accent_color' in user - ? this.accentColor === user.accent_color - : true) && - ('avatar_decoration_data' in user - ? this.avatarDecorationData?.asset === - user.avatar_decoration_data?.asset && - this.avatarDecorationData?.skuId === - user.avatar_decoration_data?.sku_id - : true) && - ('collectibles' in user - ? this.collectibles?.nameplate?.skuId === - user.collectibles?.nameplate?.sku_id && - this.collectibles?.nameplate?.asset === - user.collectibles?.nameplate?.asset && - this.collectibles?.nameplate?.label === - user.collectibles?.nameplate?.label && - this.collectibles?.nameplate?.palette === - user.collectibles?.nameplate?.palette - : true) && - ('primary_guild' in user - ? this.primaryGuild?.identityGuildId === - user.primary_guild?.identity_guild_id && - this.primaryGuild?.identityEnabled === - user.primary_guild?.identity_enabled && - this.primaryGuild?.tag === user.primary_guild?.tag && - this.primaryGuild?.badge === user.primary_guild?.badge - : true) - ); - } - - /** - * Fetches this user. - * @param {boolean} [force=true] Whether to skip the cache check and request the API - * @returns {Promise} - */ - fetch(force = true) { - return this.client.users.fetch(this.id, { force }); - } - - /** - * Returns a user profile object for a given user ID. - * This endpoint requires one of the following: - * - The user is a bot - * - The user shares a mutual guild with the current user - * - The user is a friend of the current user - * - The user is a friend suggestion of the current user - * - The user has an outgoing friend request to the current user - * @param {Snowflake} [guildId] The guild ID to get the user's member profile in - * @returns {Promise} - * @see {@link https://discord-userdoccers.vercel.app/resources/user#response-body} - */ - getProfile(guildId) { - return this.client.api.users(this.id).profile.get({ - query: { - with_mutual_guilds: true, - with_mutual_friends: true, - with_mutual_friends_count: true, - guild_id: guildId, - }, - }); - } - - /** - * When concatenated with a string, this automatically returns the user's mention instead of the User object. - * @returns {string} - * @example - * // Logs: Hello from <@123456789012345678>! - * console.log(`Hello from ${user}!`); - */ - toString() { - return `<@${this.id}>`; - } - - toJSON(...props) { - const json = super.toJSON( - { - createdTimestamp: true, - defaultAvatarURL: true, - hexAccentColor: true, - tag: true, - }, - ...props, - ); - json.avatarURL = this.avatarURL(); - json.displayAvatarURL = this.displayAvatarURL(); - json.bannerURL = this.banner ? this.bannerURL() : this.banner; - json.guildTagBadgeURL = this.guildTagBadgeURL(); - return json; - } - - /** - * The function updates the note of a user and returns the updated user. - * @param {string|null|undefined} [note=null] - The `note` parameter is the new value that you want to set for the note of the - * user. It is an optional parameter and its default value is `null`. - * @returns {Promise} The `setNote` method is returning the `User` object. - */ - async setNote(note = null) { - await this.client.notes.updateNote(this.id, note); - return this; - } - - /** - * The function returns the note associated with a specific client ID from a cache. - * @type {?string} The note that corresponds to the given id. - */ - get note() { - return this.client.notes.cache.get(this.id); - } - - /** - * The voice state of this member - * @type {VoiceState} - * @readonly - */ - get voice() { - return ( - this.client.voiceStates.cache.get(this.id) ?? - this.client.guilds.cache - .find((g) => g?.voiceStates?.cache?.get(this.id)) - ?.voiceStates?.cache?.get(this.id) ?? - new VoiceState({ client: this.client }, { user_id: this.id }) - ); - } - - /** - * Send Friend Request to the user - * @type {boolean} - * @returns {Promise} - */ - sendFriendRequest() { - return this.client.relationships.sendFriendRequest(this); - } - - /** - * Unblock / Unfriend / Cancels a friend request - * @type {boolean} - * @returns {Promise} - */ - deleteRelationship() { - return this.client.relationships.deleteRelationship(this); - } - - /** - * Check relationship status (Client -> User) - * @type {RelationshipType} - * @readonly - */ - get relationship() { - const i = this.client.relationships.cache.get(this.id) ?? 0; - return RelationshipTypes[parseInt(i)]; - } - - /** - * Get friend nickname - * @type {?string} - * @readonly - */ - get friendNickname() { - return this.client.relationships.friendNicknames.get(this.id); - } -} - -/** - * Sends a message to this user. - * @method send - * @memberof User - * @instance - * @param {string|MessagePayload|MessageOptions} options The options to provide - * @returns {Promise} - * @example - * // Send a direct message - * user.send('Hello!') - * .then(message => console.log(`Sent message: ${message.content} to ${user.tag}`)) - * .catch(console.error); - */ - -TextBasedChannel.applyToClass(User); - -module.exports = User; - -/** - * @external APIUser - * @see {@link https://discord.com/developers/docs/resources/user#user-object} - */ diff --git a/vendor/discord.js-selfbot-v13/src/structures/UserContextMenuInteraction.js b/vendor/discord.js-selfbot-v13/src/structures/UserContextMenuInteraction.js deleted file mode 100644 index ba857f3..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/UserContextMenuInteraction.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -const ContextMenuInteraction = require('./ContextMenuInteraction'); - -/** - * Represents a user context menu interaction. - * @extends {ContextMenuInteraction} - */ -class UserContextMenuInteraction extends ContextMenuInteraction { - /** - * The target user from this interaction - * @type {User} - * @readonly - */ - get targetUser() { - return this.options.getUser('user'); - } - - /** - * The target member from this interaction - * @type {?(GuildMember|APIGuildMember)} - * @readonly - */ - get targetMember() { - return this.options.getMember('user'); - } -} - -module.exports = UserContextMenuInteraction; diff --git a/vendor/discord.js-selfbot-v13/src/structures/VoiceChannel.js b/vendor/discord.js-selfbot-v13/src/structures/VoiceChannel.js deleted file mode 100644 index 850f042..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/VoiceChannel.js +++ /dev/null @@ -1,117 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const BaseGuildVoiceChannel = require('./BaseGuildVoiceChannel'); -const Permissions = require('../util/Permissions'); - -let deprecationEmittedForEditable = false; - -/** - * Represents a guild voice channel on Discord. - * @extends {BaseGuildVoiceChannel} - */ -class VoiceChannel extends BaseGuildVoiceChannel { - /** - * Whether the channel is editable by the client user - * @type {boolean} - * @readonly - * @deprecated Use {@link VoiceChannel#manageable} instead - */ - get editable() { - if (!deprecationEmittedForEditable) { - process.emitWarning( - 'The VoiceChannel#editable getter is deprecated. Use VoiceChannel#manageable instead.', - 'DeprecationWarning', - ); - - deprecationEmittedForEditable = true; - } - - return this.manageable; - } - - /** - * Whether the channel is joinable by the client user - * @type {boolean} - * @readonly - */ - get joinable() { - if (!super.joinable) return false; - if ( - this.full && - !this.permissionsFor(this.client.user).has( - Permissions.FLAGS.MOVE_MEMBERS, - false, - ) - ) - return false; - return true; - } - - /** - * Checks if the client has permission to send audio to the voice channel - * @type {boolean} - * @readonly - */ - get speakable() { - const permissions = this.permissionsFor(this.client.user); - if (!permissions) return false; - // This flag allows speaking even if timed out - if (permissions.has(Permissions.FLAGS.ADMINISTRATOR, false)) return true; - - return ( - this.guild.members.me.communicationDisabledUntilTimestamp < Date.now() && - permissions.has(Permissions.FLAGS.SPEAK, false) - ); - } - - /** - * Sets the bitrate of the channel. - * @name VoiceChannel#setBitrate - * @param {number} bitrate The new bitrate - * @param {string} [reason] Reason for changing the channel's bitrate - * @returns {Promise} - * @example - * // Set the bitrate of a voice channel - * voiceChannel.setBitrate(48_000) - * .then(channel => console.log(`Set bitrate to ${channel.bitrate}bps for ${channel.name}`)) - * .catch(console.error); - */ - - /** - * Sets the RTC region of the channel. - * @name VoiceChannel#setRTCRegion - * @param {?string} rtcRegion The new region of the channel. Set to `null` to remove a specific region for the channel - * @param {string} [reason] The reason for modifying this region. - * @returns {Promise} - * @example - * // Set the RTC region to sydney - * voiceChannel.setRTCRegion('sydney'); - * @example - * // Remove a fixed region for this channel - let Discord decide automatically - * voiceChannel.setRTCRegion(null, 'We want to let Discord decide.'); - */ - - /** - * Sets the user limit of the channel. - * @name VoiceChannel#setUserLimit - * @param {number} userLimit The new user limit - * @param {string} [reason] Reason for changing the user limit - * @returns {Promise} - * @example - * // Set the user limit of a voice channel - * voiceChannel.setUserLimit(42) - * .then(channel => console.log(`Set user limit to ${channel.userLimit} for ${channel.name}`)) - * .catch(console.error); - */ - - /** - * Sets the camera video quality mode of the channel. - * @name VoiceChannel#setVideoQualityMode - * @param {VideoQualityMode|number} videoQualityMode The new camera video quality mode. - * @param {string} [reason] Reason for changing the camera video quality mode. - * @returns {Promise} - */ -} - -module.exports = VoiceChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/VoiceChannelEffect.js b/vendor/discord.js-selfbot-v13/src/structures/VoiceChannelEffect.js deleted file mode 100644 index ee42ea6..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/VoiceChannelEffect.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; - -const { Emoji } = require('./Emoji'); - -/** - * Represents an effect used in a {@link VoiceChannel}. - */ -class VoiceChannelEffect { - constructor(data, guild) { - /** - * The guild where the effect was sent from. - * @type {Guild} - */ - this.guild = guild; - - /** - * The id of the channel the effect was sent in. - * @type {Snowflake} - */ - this.channelId = data.channel_id; - - /** - * The id of the user that sent the effect. - * @type {Snowflake} - */ - this.userId = data.user_id; - - /** - * The emoji of the effect. - * @type {?Emoji} - */ - this.emoji = data.emoji ? new Emoji(guild.client, data.emoji) : null; - - /** - * The animation type of the effect. - * @type {?VoiceChannelEffectSendAnimationType} - */ - this.animationType = data.animation_type ?? null; - - /** - * The animation id of the effect. - * @type {?number} - */ - this.animationId = data.animation_id ?? null; - - /** - * The id of the soundboard sound for soundboard effects. - * @type {?(Snowflake|number)} - */ - this.soundId = data.sound_id ?? null; - - /** - * The volume of the soundboard sound [0-1] for soundboard effects. - * @type {?number} - */ - this.soundVolume = data.sound_volume ?? null; - } - - /** - * The channel the effect was sent in. - * @type {?VoiceChannel} - * @readonly - */ - get channel() { - return this.guild.channels.cache.get(this.channelId) ?? null; - } -} - -module.exports = VoiceChannelEffect; diff --git a/vendor/discord.js-selfbot-v13/src/structures/VoiceRegion.js b/vendor/discord.js-selfbot-v13/src/structures/VoiceRegion.js deleted file mode 100644 index 7cf6c88..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/VoiceRegion.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -const Util = require('../util/Util'); - -/** - * Represents a Discord voice region for guilds. - */ -class VoiceRegion { - constructor(data) { - /** - * The region's id - * @type {string} - */ - this.id = data.id; - - /** - * Name of the region - * @type {string} - */ - this.name = data.name; - - /** - * Whether the region is VIP-only - * @type {boolean} - * @deprecated This property is no longer being sent by the API. - */ - this.vip = data.vip; - - /** - * Whether the region is deprecated - * @type {boolean} - */ - this.deprecated = data.deprecated; - - /** - * Whether the region is optimal - * @type {boolean} - */ - this.optimal = data.optimal; - - /** - * Whether the region is custom - * @type {boolean} - */ - this.custom = data.custom; - } - - toJSON() { - return Util.flatten(this); - } -} - -module.exports = VoiceRegion; diff --git a/vendor/discord.js-selfbot-v13/src/structures/VoiceState.js b/vendor/discord.js-selfbot-v13/src/structures/VoiceState.js deleted file mode 100644 index 428fdfb..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/VoiceState.js +++ /dev/null @@ -1,367 +0,0 @@ -'use strict'; - -const Base = require('./Base'); -const { Error, TypeError } = require('../errors'); - -/** - * Represents the voice state for a Guild Member. - * @extends {Base} - */ -class VoiceState extends Base { - constructor(guild, data) { - super(guild.client); - /** - * The guild of this voice state - * @type {Guild} - */ - this.guild = guild; - /** - * The id of the member of this voice state - * @type {Snowflake} - */ - this.id = data.user_id; - this._patch(data); - } - - _patch(data) { - if ('deaf' in data) { - /** - * Whether this member is deafened server-wide - * @type {?boolean} - */ - this.serverDeaf = data.deaf; - } else { - this.serverDeaf ??= null; - } - - if ('mute' in data) { - /** - * Whether this member is muted server-wide - * @type {?boolean} - */ - this.serverMute = data.mute; - } else { - this.serverMute ??= null; - } - - if ('self_deaf' in data) { - /** - * Whether this member is self-deafened - * @type {?boolean} - */ - this.selfDeaf = data.self_deaf; - } else { - this.selfDeaf ??= null; - } - - if ('self_mute' in data) { - /** - * Whether this member is self-muted - * @type {?boolean} - */ - this.selfMute = data.self_mute; - } else { - this.selfMute ??= null; - } - - if ('self_video' in data) { - /** - * Whether this member's camera is enabled - * @type {?boolean} - */ - this.selfVideo = data.self_video; - } else { - this.selfVideo ??= null; - } - - if ('session_id' in data) { - /** - * The session id for this member's connection - * @type {?string} - */ - this.sessionId = data.session_id; - } else { - this.sessionId ??= null; - } - - // The self_stream is property is omitted if false, check for another property - // here to avoid incorrectly clearing this when partial data is specified - if ('self_video' in data) { - /** - * Whether this member is streaming using "Screen Share" - * @type {boolean} - */ - this.streaming = data.self_stream ?? false; - } else { - this.streaming ??= null; - } - - if ('channel_id' in data) { - /** - * The {@link VoiceChannel} or {@link StageChannel} id the member is in - * @type {?Snowflake} - */ - this.channelId = data.channel_id; - } else { - this.channelId ??= null; - } - - if ('suppress' in data) { - /** - * Whether this member is suppressed from speaking. This property is specific to stage channels only. - * @type {boolean} - */ - this.suppress = data.suppress; - } - - if ('request_to_speak_timestamp' in data) { - /** - * The time at which the member requested to speak. This property is specific to stage channels only. - * @type {?number} - */ - this.requestToSpeakTimestamp = - data.request_to_speak_timestamp && - Date.parse(data.request_to_speak_timestamp); - } else { - this.requestToSpeakTimestamp ??= null; - } - - return this; - } - - /** - * The member that this voice state belongs to - * @type {?GuildMember} - * @readonly - */ - get member() { - if (!this.guild?.id) return null; - return this.guild.members.cache.get(this.id) ?? null; - } - - /** - * The user that this voice state belongs to - * @type {?User} - * @readonly - */ - get user() { - return this.guild.client.users.cache.get(this.id) ?? null; - } - - /** - * The channel that the member is connected to - * @type {?(VoiceChannel|StageChannel|DMChannel|GroupDMChannel)} - * @readonly - */ - get channel() { - return ( - (this.guild?.id ? this.guild : this.client)?.channels?.cache.get( - this.channelId, - ) ?? null - ); - } - - /** - * Whether this member is either self-deafened or server-deafened - * @type {?boolean} - * @readonly - */ - get deaf() { - return this.serverDeaf || this.selfDeaf; - } - - /** - * Whether this member is either self-muted or server-muted - * @type {?boolean} - * @readonly - */ - get mute() { - return this.serverMute || this.selfMute; - } - - /** - * Mutes/unmutes the member of this voice state. - * @param {boolean} [mute=true] Whether or not the member should be muted - * @param {string} [reason] Reason for muting or unmuting - * @returns {Promise} - */ - setMute(mute = true, reason) { - if (!this.guild?.id) return null; - return this.guild.members.edit(this.id, { mute }, reason); - } - - /** - * Deafens/undeafens the member of this voice state. - * @param {boolean} [deaf=true] Whether or not the member should be deafened - * @param {string} [reason] Reason for deafening or undeafening - * @returns {Promise} - */ - setDeaf(deaf = true, reason) { - if (!this.guild?.id) return null; - return this.guild.members.edit(this.id, { deaf }, reason); - } - - /** - * Disconnects the member from the channel. - * @param {string} [reason] Reason for disconnecting the member from the channel - * @returns {Promise} - */ - disconnect(reason) { - return this.setChannel(null, reason); - } - - /** - * Moves the member to a different channel, or disconnects them from the one they're in. - * @param {GuildVoiceChannelResolvable|null} channel Channel to move the member to, or `null` if you want to - * disconnect them from voice. - * @param {string} [reason] Reason for moving member to another channel or disconnecting - * @returns {Promise} - */ - setChannel(channel, reason) { - if (!this.guild?.id) return null; - return this.guild.members.edit(this.id, { channel }, reason); - } - - /** - * Toggles the request to speak in the channel. - * Only applicable for stage channels and for the client's own voice state. - * @param {boolean} [request=true] Whether or not the client is requesting to become a speaker. - * @example - * // Making the client request to speak in a stage channel (raise its hand) - * guild.members.me.voice.setRequestToSpeak(true); - * @example - * // Making the client cancel a request to speak - * guild.members.me.voice.setRequestToSpeak(false); - * @returns {Promise} - */ - async setRequestToSpeak(request = true) { - if (this.channel?.type !== 'GUILD_STAGE_VOICE') - throw new Error('VOICE_NOT_STAGE_CHANNEL'); - - if (this.client.user.id !== this.id) throw new Error('VOICE_STATE_NOT_OWN'); - - await this.client.api.guilds(this.guild.id, 'voice-states', '@me').patch({ - data: { - channel_id: this.channelId, - request_to_speak_timestamp: request ? new Date().toISOString() : null, - }, - }); - } - - /** - * Suppress/unsuppress the user. Only applicable for stage channels. - * @param {boolean} [suppressed=true] Whether or not the user should be suppressed. - * @example - * // Making the client a speaker - * guild.members.me.voice.setSuppressed(false); - * @example - * // Making the client an audience member - * guild.members.me.voice.setSuppressed(true); - * @example - * // Inviting another user to speak - * voiceState.setSuppressed(false); - * @example - * // Moving another user to the audience, or cancelling their invite to speak - * voiceState.setSuppressed(true); - * @returns {Promise} - */ - async setSuppressed(suppressed = true) { - if (typeof suppressed !== 'boolean') - throw new TypeError('VOICE_STATE_INVALID_TYPE', 'suppressed'); - - if (this.channel?.type !== 'GUILD_STAGE_VOICE') - throw new Error('VOICE_NOT_STAGE_CHANNEL'); - - const target = this.client.user.id === this.id ? '@me' : this.id; - - await this.client.api.guilds(this.guild.id, 'voice-states', target).patch({ - data: { - channel_id: this.channelId, - suppress: suppressed, - request_to_speak_timestamp: null, - }, - }); - } - - /** - * Sets the status of the voice channel - * @param {string} [status=""] The message to set the channel status to - * @example - * // Setting the status to something - * guild.members.me.voice.setStatus("something") - * @example - * // Removing the status - * guild.members.me.voice.setStatus() - * @returns {Promise} - */ - setStatus(status = '') { - // PUT https://discord.com/api/v9/channels/:id/voice-status - return this.client.api.channels(this.channel.id, 'voice-status').put({ - data: { - status, - }, - }); - } - - /** - * Get URL Image of the user's streaming video (NOT STREAMING !!!) - * @returns {Promise} URL Image of the user's streaming video - */ - async getPreview() { - if (!this.streaming) throw new Error('USER_NOT_STREAMING'); - // URL: https://discord.com/api/v9/streams/guild:guildid:voicechannelid:userid/preview - // URL: https://discord.com/api/v9/streams/call:channelId:userId/preview - const streamKey = this.guild?.id - ? `guild:${this.guild.id}:${this.channelId}:${this.id}` - : `call:${this.channelId}:${this.id}`; - const data = - await this.client.api.streams[ - encodeURIComponent(streamKey) - ].preview.get(); - return data.url; - } - - /** - * Post Preview Image to the client user's streaming video - * @param {string} base64Image Base64 URI (data:image/jpeg;base64,data) - * @returns {Promise} - */ - postPreview(base64Image) { - if (!this.client.user.id === this.id || !this.streaming) - throw new Error('USER_NOT_STREAMING'); - // URL: https://discord.com/api/v9/streams/guild:guildid:voicechannelid:userid/preview - // URL: https://discord.com/api/v9/streams/call:channelId:userId/preview - const streamKey = this.guild?.id - ? `guild:${this.guild.id}:${this.channelId}:${this.id}` - : `call:${this.channelId}:${this.id}`; - return this.client.api.streams[encodeURIComponent(streamKey)].preview.post({ - data: { - thumbnail: base64Image, - }, - }); - } - - /** - * Fetches this voice state. - * @param {boolean} [force=true] Whether to skip the cache check and request the API - * @returns {Promise} - */ - fetch(force = true) { - return this.guild?.voiceStates?.fetch(this.id, { force }); - } - - toJSON() { - return super.toJSON({ - id: true, - serverDeaf: true, - serverMute: true, - selfDeaf: true, - selfMute: true, - selfVideo: true, - sessionId: true, - channelId: 'channel', - }); - } -} - -module.exports = VoiceState; diff --git a/vendor/discord.js-selfbot-v13/src/structures/WebEmbed.js b/vendor/discord.js-selfbot-v13/src/structures/WebEmbed.js deleted file mode 100644 index 0bdc875..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/WebEmbed.js +++ /dev/null @@ -1,377 +0,0 @@ -'use strict'; - -const baseURL = 'https://webembed-sb.onrender.com/embed?'; -const hiddenCharter = - '||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||'; -const { RangeError } = require('../errors'); -const Util = require('../util/Util'); - -/** - * Send Embedlink to Discord - * Only works with Discord Web and Discord Client (no custom theme installed) - * - No Timestamp, Footer, Fields, Author iconURL - * - Video with Embed working - * - Can only choose between image and thumbnail - * - Description limit 350 characters - */ -class WebEmbed { - /** - * @param {WebEmbed} [data={}] Raw data - */ - constructor(data = {}) { - /** - * A `Partial` object is a representation of any existing object. - * This object contains between 0 and all of the original objects parameters. - * This is true regardless of whether the parameters are optional in the base object. - * @typedef {Object} Partial - */ - - /** - * Represents the possible options for a WebEmbed - * @typedef {Object} WebEmbedOptions - * @property {string} [title] The title of this embed - * @property {string} [description] The description of this embed - * @property {string} [url] The URL of this embed - * @property {ColorResolvable} [color] The color of this embed - * @property {Partial} [author] The author of this embed - * @property {Partial} [thumbnail] The thumbnail of this embed - * @property {Partial} [image] The image of this embed - * @property {Partial} [video] The video of this embed - * @property {Partial} [footer] The footer of this embed - * @property {Partial} [provider] The provider of this embed - * @property {string} [redirect] Redirect URL - */ - - // eslint-disable-next-line valid-jsdoc - /** - * @param {WebEmbed|WebEmbedOptions|APIEmbed} [data={}] WebEmbed to clone or raw embed data - */ - this._setup(data); - } - /** - * @private - * @param {Object} data The data for the embed - */ - _setup(data) { - /** - * Type image of this embed - * @type {?thumbnail | image} - */ - this.imageType = 'thumbnail'; - /** - * The title of this embed - * @type {?string} - */ - this.title = data.title ?? null; - - /** - * The description of this embed - * @type {?string} - */ - this.description = data.description ?? null; - - /** - * The URL of this embed - * @type {?string} - */ - this.url = data.url ?? null; - - /** - * The color of this embed - * @type {?number} - */ - this.color = 'color' in data ? Util.resolveColor(data.color) : null; - - /** - * Represents the image of a WebEmbed - * @typedef {Object} WebEmbedImage - * @property {string} url URL for this image - * @property {string} proxyURL ProxyURL for this image - * @property {number} height Height of this image - * @property {number} width Width of this image - */ - - /** - * The image of this embed, if there is one - * @type {?WebEmbedImage} - */ - this.image = data.image - ? { - url: data.image.url, - proxyURL: data.image.proxyURL ?? data.image.proxy_url, - height: data.image.height, - width: data.image.width, - } - : null; - - /** - * The thumbnail of this embed (if there is one) - * @type {?WebEmbedThumbnail} - */ - this.thumbnail = data.thumbnail - ? { - url: data.thumbnail.url, - proxyURL: data.thumbnail.proxyURL ?? data.thumbnail.proxy_url, - height: data.thumbnail.height, - width: data.thumbnail.width, - } - : null; - - /** - * Represents the video of a WebEmbed - * @typedef {Object} WebEmbedVideo - * @property {string} url URL of this video - * @property {string} proxyURL ProxyURL for this video - * @property {number} height Height of this video - * @property {number} width Width of this video - */ - - /** - * The video of this embed (if there is one) - * @type {?WebEmbedVideo} - * @readonly - */ - this.video = data.video - ? { - url: data.video.url, - proxyURL: data.video.proxyURL ?? data.video.proxy_url, - height: data.video.height, - width: data.video.width, - } - : null; - - /** - * Represents the author field of a WebEmbed - * @typedef {Object} WebEmbedAuthor - * @property {string} name The name of this author - * @property {string} url URL of this author - */ - - /** - * The author of this embed (if there is one) - * @type {?WebEmbedAuthor} - */ - this.author = data.author - ? { - name: data.author.name, - url: data.author.url, - } - : null; - - /** - * Represents the provider of a WebEmbed - * @typedef {Object} WebEmbedProvider - * @property {string} name The name of this provider - * @property {string} url URL of this provider - */ - - /** - * The provider of this embed (if there is one) - * @type {?WebEmbedProvider} - */ - this.provider = data.provider - ? { - name: data.provider.name, - url: data.provider.name, - } - : null; - - /** - * Redirect URL - * @type {string} - */ - this.redirect = data.redirect; - } - /** - * The options to provide for setting an author for a {@link WebEmbed}. - * @typedef {Object} EmbedAuthorData - * @property {string} name The name of this author. - */ - - /** - * Sets the author of this embed. - * @param {string|EmbedAuthorData|null} options The options to provide for the author. - * Provide `null` to remove the author data. - * @returns {WebEmbed} - */ - setAuthor(options) { - if (options === null) { - this.author = {}; - return this; - } - const { name, url } = options; - this.author = { - name: Util.verifyString(name, RangeError, 'EMBED_AUTHOR_NAME'), - url, - }; - return this; - } - - /** - * The options to provide for setting an provider for a {@link WebEmbed}. - * @typedef {Object} EmbedProviderData - * @property {string} name The name of this provider. - */ - - /** - * Sets the provider of this embed. - * @param {string|EmbedProviderData|null} options The options to provide for the provider. - * Provide `null` to remove the provider data. - * @returns {WebEmbed} - */ - setProvider(options) { - if (options === null) { - this.provider = {}; - return this; - } - const { name, url } = options; - this.provider = { - name: Util.verifyString(name, RangeError, 'EMBED_PROVIDER_NAME'), - url, - }; - return this; - } - - /** - * Sets the color of this embed. - * @param {ColorResolvable} color The color of the embed - * @returns {WebEmbed} - */ - setColor(color) { - this.color = Util.resolveColor(color); - return this; - } - - /** - * Sets the description of this embed. - * @param {string} description The description (Limit 350 characters) - * @returns {WebEmbed} - */ - setDescription(description) { - this.description = Util.verifyString( - description, - RangeError, - 'EMBED_DESCRIPTION', - ); - return this; - } - - /** - * Sets the image of this embed. - * @param {string} url The URL of the image - * @returns {WebEmbed} - */ - setImage(url) { - if (this.thumbnail && this.thumbnail.url) { - console.warn('You can only set image or thumbnail per embed.'); - this.thumbnail.url = null; - } - this.imageType = 'image'; - this.image = { url }; - return this; - } - - /** - * Sets the thumbnail of this embed. - * @param {string} url The URL of the image - * @returns {WebEmbed} - */ - setThumbnail(url) { - if (this.image && this.image.url) { - console.warn('You can only set image or thumbnail per embed.'); - this.image.url = null; - } - this.imageType = 'thumbnail'; - this.thumbnail = { url }; - return this; - } - - /** - * Sets the video of this embed. - * @param {string} url The URL of the video - * @returns {WebEmbed} - */ - setVideo(url) { - this.video = { url }; - return this; - } - - /** - * Sets the title of this embed. - * @param {string} title The title - * @returns {WebEmbed} - */ - setTitle(title) { - this.title = Util.verifyString(title, RangeError, 'EMBED_TITLE'); - return this; - } - - /** - * Sets the URL of this embed. - * @param {string} url The URL - * @returns {WebEmbed} - */ - setURL(url) { - this.url = url; - return this; - } - - /** - * Sets the redirect URL of this embed. - * @param {string} url The URL - * @returns {WebEmbed} - */ - setRedirect(url) { - this.redirect = url; - return this; - } - - toString() { - const url = new URL(baseURL); - url.searchParams.set('image_type', this.imageType); - if (this.title) { - url.searchParams.set('title', this.title); - } - if (this.description) { - url.searchParams.set('description', this.description); - } - if (this.url) { - url.searchParams.set('url', this.url); - } - if (this.color) { - url.searchParams.set('color', `#${this.color.toString(16)}`); - } - if (this.image?.url) { - url.searchParams.set('image', this.image.url); - } - if (this.video?.url) { - url.searchParams.set('video', this.video.url); - } - if (this.author) { - if (this.author.name) { - url.searchParams.set('author_name', this.author.name); - } - if (this.author.url) { - url.searchParams.set('author_url', this.author.url); - } - } - if (this.provider) { - if (this.provider.name) { - url.searchParams.set('provider_name', this.provider.name); - } - if (this.provider.url) { - url.searchParams.set('provider_url', this.provider.url); - } - } - if (this.thumbnail?.url) { - url.searchParams.set('image', this.thumbnail.url); - } - if (this.redirect) { - url.searchParams.set('redirect', this.redirect); - } - return url.toString(); - } -} - -module.exports = WebEmbed; -module.exports.hiddenEmbed = hiddenCharter; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Webhook.js b/vendor/discord.js-selfbot-v13/src/structures/Webhook.js deleted file mode 100644 index c491ed8..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Webhook.js +++ /dev/null @@ -1,508 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const MessagePayload = require('./MessagePayload'); -const { Error } = require('../errors'); -const { WebhookTypes } = require('../util/Constants'); -const DataResolver = require('../util/DataResolver'); -const SnowflakeUtil = require('../util/SnowflakeUtil'); - -let deprecationEmittedForFetchMessage = false; - -/** - * Represents a webhook. - */ -class Webhook { - constructor(client, data) { - /** - * The client that instantiated the webhook - * @name Webhook#client - * @type {Client} - * @readonly - */ - Object.defineProperty(this, 'client', { value: client }); - if (data) this._patch(data); - } - - _patch(data) { - if ('name' in data) { - /** - * The name of the webhook - * @type {string} - */ - this.name = data.name; - } - - /** - * The token for the webhook, unavailable for follower webhooks and webhooks owned by another application. - * @name Webhook#token - * @type {?string} - */ - Object.defineProperty(this, 'token', { - value: data.token ?? null, - writable: true, - configurable: true, - }); - - if ('avatar' in data) { - /** - * The avatar for the webhook - * @type {?string} - */ - this.avatar = data.avatar; - } - - /** - * The webhook's id - * @type {Snowflake} - */ - this.id = data.id; - - if ('type' in data) { - /** - * The type of the webhook - * @type {WebhookType} - */ - this.type = WebhookTypes[data.type]; - } - - if ('guild_id' in data) { - /** - * The guild the webhook belongs to - * @type {Snowflake} - */ - this.guildId = data.guild_id; - } - - if ('channel_id' in data) { - /** - * The id of the channel the webhook belongs to - * @type {Snowflake} - */ - this.channelId = data.channel_id; - } - - if ('user' in data) { - /** - * The owner of the webhook - * @type {?(User|APIUser)} - */ - this.owner = this.client.users?._add(data.user) ?? data.user; - } else { - this.owner ??= null; - } - - if ('source_guild' in data) { - /** - * The source guild of the webhook - * @type {?(Guild|APIGuild)} - */ - this.sourceGuild = - this.client.guilds?.cache.get(data.source_guild.id) ?? - data.source_guild; - } else { - this.sourceGuild ??= null; - } - - if ('source_channel' in data) { - /** - * The source channel of the webhook - * @type {?(NewsChannel|APIChannel)} - */ - this.sourceChannel = - this.client.channels?.cache.get(data.source_channel?.id) ?? - data.source_channel; - } else { - this.sourceChannel ??= null; - } - } - - /** - * Options that can be passed into send. - * @typedef {BaseMessageOptionsWithPoll} WebhookMessageOptions - * @property {string} [username=this.name] Username override for the message - * @property {string} [avatarURL] Avatar URL override for the message - * @property {Snowflake} [threadId] The id of the thread in the channel to send to. - * For interaction webhooks, this property is ignored - * @property {string} [threadName] Name of the thread to create (only available if webhook is in a forum channel) - * @property {MessageFlags} [flags] Which flags to set for the message. Only `SUPPRESS_EMBEDS` can be set. - * @property {Snowflake[]} [appliedTags] - * The tags to apply to the created thread (only available if the webhook is in a forum channel) - * @property {boolean} [withComponents] Whether to allow sending non-interactive components in the message. - * For application-owned webhooks, this property is ignored - */ - - /** - * Options that can be passed into editMessage. - * @typedef {Object} WebhookEditMessageOptions - * @property {MessageEmbed[]|APIEmbed[]} [embeds] See {@link WebhookMessageOptions#embeds} - * @property {string} [content] See {@link BaseMessageOptions#content} - * @property {FileOptions[]|BufferResolvable[]|MessageAttachment[]} [files] See {@link BaseMessageOptions#files} - * @property {MessageMentionOptions} [allowedMentions] See {@link BaseMessageOptions#allowedMentions} - * @property {MessageAttachment[]} [attachments] Attachments to send with the message - * @property {MessageActionRow[]|MessageActionRowOptions[]} [components] - * Action rows containing interactive components for the message (buttons, select menus) - * @property {Snowflake} [threadId] The id of the thread this message belongs to - * For interaction webhooks, this property is ignored - * @property {boolean} [withComponents] Whether to allow sending non-interactive components in the message. - * For application-owned webhooks, this property is ignored - */ - - /** - * Sends a message with this webhook. - * @param {string|MessagePayload|WebhookMessageOptions} options The options to provide - * @returns {Promise} - * @example - * // Send a basic message - * webhook.send('hello!') - * .then(message => console.log(`Sent message: ${message.content}`)) - * .catch(console.error); - * @example - * // Send a basic message in a thread - * webhook.send({ content: 'hello!', threadId: '836856309672348295' }) - * .then(message => console.log(`Sent message: ${message.content}`)) - * .catch(console.error); - * @example - * // Send a remote file - * webhook.send({ - * files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048'] - * }) - * .then(console.log) - * .catch(console.error); - * @example - * // Send a local file - * webhook.send({ - * files: [{ - * attachment: 'entire/path/to/file.jpg', - * name: 'file.jpg' - * }] - * }) - * .then(console.log) - * .catch(console.error); - * @example - * // Send an embed with a local image inside - * webhook.send({ - * content: 'This is an embed', - * embeds: [{ - * thumbnail: { - * url: 'attachment://file.jpg' - * } - * }], - * files: [{ - * attachment: 'entire/path/to/file.jpg', - * name: 'file.jpg' - * }] - * }) - * .then(console.log) - * .catch(console.error); - */ - async send(options) { - if (!this.token) throw new Error('WEBHOOK_TOKEN_UNAVAILABLE'); - - let messagePayload; - - if (options instanceof MessagePayload) { - messagePayload = options.resolveData(); - } else { - messagePayload = MessagePayload.create(this, options).resolveData(); - } - - const { data, files } = await messagePayload.resolveFiles(); - const d = await this.client.api.webhooks(this.id, this.token).post({ - data, - files, - query: { - thread_id: messagePayload.options.threadId, - wait: true, - with_components: messagePayload.options.withComponents, - }, - auth: false, - webhook: true, - }); - return ( - this.client.channels?.cache.get(d.channel_id)?.messages._add(d, false) ?? - d - ); - } - - /** - * Sends a raw slack message with this webhook. - * @param {Object} body The raw body to send - * @returns {Promise} - * @example - * // Send a slack message - * webhook.sendSlackMessage({ - * 'username': 'Wumpus', - * 'attachments': [{ - * 'pretext': 'this looks pretty cool', - * 'color': '#F0F', - * 'footer_icon': 'http://snek.s3.amazonaws.com/topSnek.png', - * 'footer': 'Powered by sneks', - * 'ts': Date.now() / 1_000 - * }] - * }).catch(console.error); - * @see {@link https://api.slack.com/messaging/webhooks} - */ - async sendSlackMessage(body) { - if (!this.token) throw new Error('WEBHOOK_TOKEN_UNAVAILABLE'); - - const data = await this.client.api - .webhooks(this.id, this.token) - .slack.post({ - query: { wait: true }, - auth: false, - data: body, - webhook: true, - }); - return data.toString() === 'ok'; - } - - /** - * Options used to edit a {@link Webhook}. - * @typedef {Object} WebhookEditData - * @property {string} [name=this.name] The new name for the webhook - * @property {?(BufferResolvable)} [avatar] The new avatar for the webhook - * @property {GuildTextChannelResolvable|VoiceChannel|StageChannel|ForumChannel|MediaChannel} [channel] - * The new channel for the webhook - */ - - /** - * Edits this webhook. - * @param {WebhookEditData} options Options for editing the webhook - * @param {string} [reason] Reason for editing the webhook - * @returns {Promise} - */ - async edit({ name = this.name, avatar, channel }, reason) { - if (avatar && !(typeof avatar === 'string' && avatar.startsWith('data:'))) { - avatar = await DataResolver.resolveImage(avatar); - } - channel &&= channel.id ?? channel; - const data = await this.client.api - .webhooks(this.id, channel ? undefined : this.token) - .patch({ - data: { name, avatar, channel_id: channel }, - reason, - auth: !this.token || Boolean(channel), - webhook: true, - }); - - this.name = data.name; - this.avatar = data.avatar; - this.channelId = data.channel_id; - return this; - } - - /** - * Options that can be passed into fetchMessage. - * @typedef {options} WebhookFetchMessageOptions - * @property {boolean} [cache=true] Whether to cache the message. - * @property {Snowflake} [threadId] The id of the thread this message belongs to. - * For interaction webhooks, this property is ignored - */ - - /** - * Gets a message that was sent by this webhook. - * @param {Snowflake|'@original'} message The id of the message to fetch - * @param {WebhookFetchMessageOptions|boolean} [cacheOrOptions={}] The options to provide to fetch the message. - * A **deprecated** boolean may be passed instead to specify whether to cache the message. - * @returns {Promise} Returns the raw message data if the webhook was instantiated as a - * {@link WebhookClient} or if the channel is uncached, otherwise a {@link Message} will be returned - */ - async fetchMessage(message, cacheOrOptions = { cache: true }) { - if (typeof cacheOrOptions === 'boolean') { - if (!deprecationEmittedForFetchMessage) { - process.emitWarning( - 'Passing a boolean to cache the message in Webhook#fetchMessage is deprecated. Pass an object instead.', - 'DeprecationWarning', - ); - - deprecationEmittedForFetchMessage = true; - } - - cacheOrOptions = { cache: cacheOrOptions }; - } - - if (!this.token) throw new Error('WEBHOOK_TOKEN_UNAVAILABLE'); - - const data = await this.client.api - .webhooks(this.id, this.token) - .messages(message) - .get({ - query: { - thread_id: cacheOrOptions.threadId, - }, - auth: false, - webhook: true, - }); - return ( - this.client.channels?.cache - .get(data.channel_id) - ?.messages._add(data, cacheOrOptions.cache) ?? data - ); - } - - /** - * Edits a message that was sent by this webhook. - * @param {MessageResolvable|'@original'} message The message to edit - * @param {string|MessagePayload|WebhookEditMessageOptions} options The options to provide - * @returns {Promise} Returns the raw message data if the webhook was instantiated as a - * {@link WebhookClient} or if the channel is uncached, otherwise a {@link Message} will be returned - */ - async editMessage(message, options) { - if (!this.token) throw new Error('WEBHOOK_TOKEN_UNAVAILABLE'); - - let messagePayload; - - if (options instanceof MessagePayload) messagePayload = options; - else messagePayload = MessagePayload.create(this, options); - - const { data, files } = await messagePayload.resolveData().resolveFiles(); - - const d = await this.client.api - .webhooks(this.id, this.token) - .messages(typeof message === 'string' ? message : message.id) - .patch({ - data, - files, - query: { - thread_id: messagePayload.options.threadId, - with_components: messagePayload.options.withComponents, - }, - auth: false, - webhook: true, - }); - - const messageManager = this.client.channels?.cache.get( - d.channel_id, - )?.messages; - if (!messageManager) return d; - - const existing = messageManager.cache.get(d.id); - if (!existing) return messageManager._add(d); - - const clone = existing._clone(); - clone._patch(d); - return clone; - } - - /** - * Deletes the webhook. - * @param {string} [reason] Reason for deleting this webhook - * @returns {Promise} - */ - async delete(reason) { - await this.client.api - .webhooks(this.id, this.token) - .delete({ reason, auth: !this.token, webhook: true }); - } - - /** - * Delete a message that was sent by this webhook. - * @param {MessageResolvable|'@original'} message The message to delete - * @param {Snowflake} [threadId] The id of the thread this message belongs to - * @returns {Promise} - */ - async deleteMessage(message, threadId) { - if (!this.token) throw new Error('WEBHOOK_TOKEN_UNAVAILABLE'); - - await this.client.api - .webhooks(this.id, this.token) - .messages(typeof message === 'string' ? message : message.id) - .delete({ - query: { - thread_id: threadId, - }, - auth: false, - webhook: true, - }); - } - - /** - * The channel the webhook belongs to - * @type {?(TextChannel|VoiceChannel|NewsChannel|ForumChannel|MediaChannel)} - * @readonly - */ - get channel() { - return this.client.channels.resolve(this.channelId); - } - - /** - * The timestamp the webhook was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return SnowflakeUtil.timestampFrom(this.id); - } - - /** - * The time the webhook was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * The URL of this webhook - * @type {string} - * @readonly - */ - get url() { - return ( - this.client.options.http.api + - this.client.api.webhooks(this.id, this.token) - ); - } - - /** - * A link to the webhook's avatar. - * @param {StaticImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - avatarURL({ format, size } = {}) { - if (!this.avatar) return null; - return this.client.rest.cdn.Avatar(this.id, this.avatar, format, size); - } - - /** - * Whether or not this webhook is a channel follower webhook. - * @returns {boolean} - */ - isChannelFollower() { - return this.type === 'Channel Follower'; - } - - /** - * Whether or not this webhook is an incoming webhook. - * @returns {boolean} - */ - isIncoming() { - return this.type === 'Incoming'; - } - - static applyToClass(structure, ignore = []) { - for (const prop of [ - 'send', - 'sendSlackMessage', - 'fetchMessage', - 'edit', - 'editMessage', - 'delete', - 'deleteMessage', - 'createdTimestamp', - 'createdAt', - 'url', - ]) { - if (ignore.includes(prop)) continue; - Object.defineProperty( - structure.prototype, - prop, - Object.getOwnPropertyDescriptor(Webhook.prototype, prop), - ); - } - } -} - -module.exports = Webhook; diff --git a/vendor/discord.js-selfbot-v13/src/structures/WelcomeChannel.js b/vendor/discord.js-selfbot-v13/src/structures/WelcomeChannel.js deleted file mode 100644 index f66e547..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/WelcomeChannel.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; - -const Base = require('./Base'); -const { Emoji } = require('./Emoji'); - -/** - * Represents a channel link in a guild's welcome screen. - * @extends {Base} - */ -class WelcomeChannel extends Base { - constructor(guild, data) { - super(guild.client); - - /** - * The guild for this welcome channel - * @type {Guild|InviteGuild} - */ - this.guild = guild; - - /** - * The description of this welcome channel - * @type {string} - */ - this.description = data.description; - - /** - * The raw emoji data - * @type {Object} - * @private - */ - this._emoji = { - name: data.emoji_name, - id: data.emoji_id, - }; - - /** - * The id of this welcome channel - * @type {Snowflake} - */ - this.channelId = data.channel_id; - } - - /** - * The channel of this welcome channel - * @type {?(TextChannel|NewsChannel|StoreChannel|ForumChannel|MediaChannel)} - */ - get channel() { - return this.client.channels.cache.get(this.channelId) ?? null; - } - - /** - * The emoji of this welcome channel - * @type {GuildEmoji|Emoji} - */ - get emoji() { - return ( - this.client.emojis.cache.get(this._emoji.id) ?? - new Emoji(this.client, this._emoji) - ); - } -} - -module.exports = WelcomeChannel; diff --git a/vendor/discord.js-selfbot-v13/src/structures/WelcomeScreen.js b/vendor/discord.js-selfbot-v13/src/structures/WelcomeScreen.js deleted file mode 100644 index b4b7449..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/WelcomeScreen.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const Base = require('./Base'); -const WelcomeChannel = require('./WelcomeChannel'); - -/** - * Represents a welcome screen. - * @extends {Base} - */ -class WelcomeScreen extends Base { - constructor(guild, data) { - super(guild.client); - - /** - * The guild for this welcome screen - * @type {Guild} - */ - this.guild = guild; - - /** - * The description of this welcome screen - * @type {?string} - */ - this.description = data.description ?? null; - - /** - * Collection of welcome channels belonging to this welcome screen - * @type {Collection} - */ - this.welcomeChannels = new Collection(); - - for (const channel of data.welcome_channels) { - const welcomeChannel = new WelcomeChannel(this.guild, channel); - this.welcomeChannels.set(welcomeChannel.channelId, welcomeChannel); - } - } - - /** - * Whether the welcome screen is enabled on the guild or not - * @type {boolean} - */ - get enabled() { - return this.guild.features.includes('WELCOME_SCREEN_ENABLED'); - } -} - -module.exports = WelcomeScreen; diff --git a/vendor/discord.js-selfbot-v13/src/structures/Widget.js b/vendor/discord.js-selfbot-v13/src/structures/Widget.js deleted file mode 100644 index 6ee0cae..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/Widget.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - -const { Collection } = require('@discordjs/collection'); -const Base = require('./Base'); -const WidgetMember = require('./WidgetMember'); - -/** - * Represents a Widget. - * @extends {Base} - */ -class Widget extends Base { - constructor(client, data) { - super(client); - this._patch(data); - } - - /** - * Represents a channel in a Widget - * @typedef {Object} WidgetChannel - * @property {Snowflake} id Id of the channel - * @property {string} name Name of the channel - * @property {number} position Position of the channel - */ - - _patch(data) { - /** - * The id of the guild. - * @type {Snowflake} - */ - this.id = data.id; - - if ('name' in data) { - /** - * The name of the guild. - * @type {string} - */ - this.name = data.name; - } - - if ('instant_invite' in data) { - /** - * The invite of the guild. - * @type {?string} - */ - this.instantInvite = data.instant_invite; - } - - /** - * The list of channels in the guild. - * @type {Collection} - */ - this.channels = new Collection(); - for (const channel of data.channels) { - this.channels.set(channel.id, channel); - } - - /** - * The list of members in the guild. - * These strings are just arbitrary numbers, they aren't Snowflakes. - * @type {Collection} - */ - this.members = new Collection(); - for (const member of data.members) { - this.members.set(member.id, new WidgetMember(this.client, member)); - } - - if ('presence_count' in data) { - /** - * The number of members online. - * @type {number} - */ - this.presenceCount = data.presence_count; - } - } - - /** - * Update the Widget. - * @returns {Promise} - */ - async fetch() { - const data = await this.client.api.guilds(this.id, 'widget.json').get(); - this._patch(data); - return this; - } -} - -module.exports = Widget; diff --git a/vendor/discord.js-selfbot-v13/src/structures/WidgetMember.js b/vendor/discord.js-selfbot-v13/src/structures/WidgetMember.js deleted file mode 100644 index d7aca21..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/WidgetMember.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict'; - -const Base = require('./Base'); - -/** - * Represents a WidgetMember. - * @extends {Base} - */ -class WidgetMember extends Base { - /** - * Activity sent in a {@link WidgetMember}. - * @typedef {Object} WidgetActivity - * @property {string} name The name of the activity - */ - - constructor(client, data) { - super(client); - - /** - * The id of the user. It's an arbitrary number. - * @type {string} - */ - this.id = data.id; - - /** - * The username of the member. - * @type {string} - */ - this.username = data.username; - - /** - * The discriminator of the member. - * @type {string} - */ - this.discriminator = data.discriminator; - - /** - * The avatar of the member. - * @type {?string} - */ - this.avatar = data.avatar; - - /** - * The status of the member. - * @type {PresenceStatus} - */ - this.status = data.status; - - /** - * If the member is server deafened - * @type {?boolean} - */ - this.deaf = data.deaf ?? null; - - /** - * If the member is server muted - * @type {?boolean} - */ - this.mute = data.mute ?? null; - - /** - * If the member is self deafened - * @type {?boolean} - */ - this.selfDeaf = data.self_deaf ?? null; - - /** - * If the member is self muted - * @type {?boolean} - */ - this.selfMute = data.self_mute ?? null; - - /** - * If the member is suppressed - * @type {?boolean} - */ - this.suppress = data.suppress ?? null; - - /** - * The id of the voice channel the member is in, if any - * @type {?Snowflake} - */ - this.channelId = data.channel_id ?? null; - - /** - * The avatar URL of the member. - * @type {string} - */ - this.avatarURL = data.avatar_url; - - /** - * The activity of the member. - * @type {?WidgetActivity} - */ - this.activity = data.activity ?? null; - } -} - -module.exports = WidgetMember; diff --git a/vendor/discord.js-selfbot-v13/src/structures/interfaces/Application.js b/vendor/discord.js-selfbot-v13/src/structures/interfaces/Application.js deleted file mode 100644 index 269eee4..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/interfaces/Application.js +++ /dev/null @@ -1,840 +0,0 @@ -'use strict'; - -const process = require('node:process'); -const ApplicationFlags = require('../../util/ApplicationFlags'); -const { - ClientApplicationAssetTypes, - Endpoints, -} = require('../../util/Constants'); -const Permissions = require('../../util/Permissions'); -const SnowflakeUtil = require('../../util/SnowflakeUtil'); -const { - ApplicationRoleConnectionMetadata, -} = require('../ApplicationRoleConnectionMetadata'); -const Base = require('../Base'); -const Team = require('../Team'); - -const AssetTypes = Object.keys(ClientApplicationAssetTypes); - -let deprecationEmittedForFetchAssets = false; - -/** - * Represents an OAuth2 Application. - * @extends {Base} - * @abstract - */ -class Application extends Base { - constructor(client, data) { - super(client); - this._patch(data); - } - - _patch(data) { - /** - * The application's id - * @type {Snowflake} - */ - this.id = data.id; - - if ('name' in data) { - /** - * The name of the application - * @type {?string} - */ - this.name = data.name; - } else { - this.name ??= null; - } - - if ('description' in data) { - /** - * The application's description - * @type {?string} - */ - this.description = data.description; - } else { - this.description ??= null; - } - - if ('icon' in data) { - /** - * The application's icon hash - * @type {?string} - */ - this.icon = data.icon; - } else { - this.icon ??= null; - } - - if ('terms_of_service_url' in data) { - /** - * The URL of the application's terms of service - * @type {?string} - */ - this.termsOfServiceURL = data.terms_of_service_url; - } else { - this.termsOfServiceURL ??= null; - } - - if ('privacy_policy_url' in data) { - /** - * The URL of the application's privacy policy - * @type {?string} - */ - this.privacyPolicyURL = data.privacy_policy_url; - } else { - this.privacyPolicyURL ??= null; - } - - if ('verify_key' in data) { - /** - * The hex-encoded key for verification in interactions and the GameSDK's GetTicket - * @type {?string} - */ - this.verifyKey = data.verify_key; - } else { - this.verifyKey ??= null; - } - - if ('role_connections_verification_url' in data) { - /** - * This application's role connection verification entry point URL - * @type {?string} - */ - this.roleConnectionsVerificationURL = - data.role_connections_verification_url; - } else { - this.roleConnectionsVerificationURL ??= null; - } - - /** - * The tags this application has (max of 5) - * @type {string[]} - */ - this.tags = data.tags ?? []; - - if ('install_params' in data) { - /** - * Settings for this application's default in-app authorization - * @type {?ClientApplicationInstallParams} - */ - this.installParams = { - scopes: data.install_params.scopes, - permissions: new Permissions(data.install_params.permissions).freeze(), - }; - } else { - this.installParams ??= null; - } - - if ('custom_install_url' in data) { - /** - * This application's custom installation URL - * @type {?string} - */ - this.customInstallURL = data.custom_install_url; - } else { - this.customInstallURL = null; - } - - if ('flags' in data) { - /** - * The flags this application has - * @type {ApplicationFlags} - */ - this.flags = new ApplicationFlags(data.flags).freeze(); - } - - if ('approximate_guild_count' in data) { - /** - * An approximate amount of guilds this application is in. - * @type {?number} - */ - this.approximateGuildCount = data.approximate_guild_count; - } else { - this.approximateGuildCount ??= null; - } - - if ('guild_id' in data) { - /** - * The id of the guild associated with this application. - * @type {?Snowflake} - */ - this.guildId = data.guild_id; - } else { - this.guildId ??= null; - } - - if ('cover_image' in data) { - /** - * The hash of the application's cover image - * @type {?string} - */ - this.cover = data.cover_image; - } else { - this.cover ??= null; - } - - if ('rpc_origins' in data) { - /** - * The application's RPC origins, if enabled - * @type {string[]} - */ - this.rpcOrigins = data.rpc_origins; - } else { - this.rpcOrigins ??= []; - } - - if ('bot_require_code_grant' in data) { - /** - * If this application's bot requires a code grant when using the OAuth2 flow - * @deprecated - * @type {?boolean} - */ - this.botRequireCodeGrant = data.bot_require_code_grant; - } else { - this.botRequireCodeGrant ??= null; - } - - if ('bot_public' in data) { - /** - * If this application's bot is public - * @deprecated - * @type {?boolean} - */ - this.botPublic = data.bot_public; - } else { - this.botPublic ??= null; - } - - /** - * The owner of this OAuth application - * @type {?(User|Team)} - */ - this.owner = data.team - ? new Team(this.client, data.team) - : data.owner - ? this.client.users._add(data.owner) - : (this.owner ?? null); - - if ('splash' in data) { - /** - * The application's splash image hash - * @type {?string} - */ - this.splash = data.splash; - } else { - this.splash ??= null; - } - - if ('type' in data) { - /** - * The type of the application - * @type {number} - * @see {@link https://docs.discord.food/resources/application#application-type} - */ - this.type = data.type; - } else { - this.type = null; - } - - if ('primary_sku_id' in data) { - /** - * The ID of the application's primary SKU (game, application subscription, etc.) - * @type {?Snowflake} - */ - this.primarySkuId = data.primary_sku_id; - } else { - this.primarySkuId = null; - } - - if ('eula_id' in data) { - /** - * The ID of the application's EULA - * @type {?Snowflake} - */ - this.eulaId = data.eula_id; - } else { - this.eulaId = null; - } - - if ('slug' in data) { - /** - * The URL slug that links to the primary store page of the application - * @type {?string} - */ - this.slug = data.slug; - } else { - this.slug = null; - } - - if ('aliases' in data) { - /** - * Other names the application's game is associated with - * @type {string[]} - */ - this.aliases = data.aliases; - } else { - this.aliases = []; - } - - if ('executables' in data) { - /** - * @typedef {Object} ApplicationExecutable - * @property {string} os - The operating system the executable can be found on - * @property {string} name - The name of the executable - * @property {boolean} is_launcher - Whether the executable is for a game launcher - */ - - /** - * The unique executables of the application's game - * @type {?ApplicationExecutable[]} - */ - this.executables = data.executables; - } else { - this.executables ??= null; - } - - if ('third_party_skus' in data) { - /** - * @typedef {Object} ApplicationSku - * @property {?Snowflake} id - The ID of the game - * @property {?string} sku - The SKU of the game - * @property {string} distributor - The distributor of the game - */ - - /** - * The third party SKUs of the application's game - * @type {?ApplicationSku[]} - */ - this.thirdPartySkus = data.third_party_skus; - } else { - this.thirdPartySkus ??= null; - } - - if ('hook' in data) { - /** - * Whether the Discord client is allowed to hook into the application's game directly - * @type {?boolean} - */ - this.hook = data.hook; - } else { - this.hook ??= null; - } - - if ('overlay' in data) { - /** - * Whether the application's game supports the Discord overlay (default false) - * @type {?boolean} - */ - this.overlay = data.overlay; - } else { - this.overlay ??= null; - } - - if ('overlay_methods' in data) { - /** - * The methods of overlaying that the application's game supports - * @type {?number} - */ - this.overlayMethods = data.overlay_methods; - } else { - this.overlayMethods ??= null; - } - - if ('overlay_warn' in data) { - /** - * Whether the Discord overlay is known to be problematic with this application's game (default false) - * @type {?boolean} - */ - this.overlayWarn = data.overlay_warn; - } else { - this.overlayWarn ??= null; - } - - if ('overlay_compatibility_hook' in data) { - /** - * Whether to use the compatibility hook for the overlay (default false) - * @type {?boolean} - */ - this.overlayCompatibilityHook = data.overlay_compatibility_hook; - } else { - this.overlayCompatibilityHook ??= null; - } - - if ('bot' in data) { - /** - * The bot attached to this application - * @type {?User} - */ - this.bot = data.bot; - } else { - this.bot ??= null; - } - - if ('developers' in data) { - /** - * @typedef {Object} Company - * @property {?Snowflake} id - The ID of the company - * @property {?string} name - The name of the company - */ - - /** - * The companies that developed the application - * @type {?Company[]} - */ - this.developers = data.developers; - } else { - this.developers ??= null; - } - - if ('publishers' in data) { - /** - * The companies that published the application - * @type {?Company[]} - */ - this.publishers = data.publishers; - } else { - this.publishers ??= null; - } - - if ('redirect_uris' in data) { - /** - * The whitelisted URLs for redirecting to during OAuth2 authorization (max 10) - * @type {?string[]} - */ - this.redirectUris = data.redirect_uris; - } else { - this.redirectUris ??= null; - } - - if ('deeplink_uri' in data) { - /** - * The URL used for deep linking during OAuth2 authorization on mobile devices - * @type {?string} - */ - this.deeplinkUri = data.deeplink_uri; - } else { - this.deeplinkUri ??= null; - } - - if ('integration_public' in data) { - /** - * Whether only the application owner can add the integration - * @type {?boolean} - */ - this.integrationPublic = data.integration_public; - } else { - this.integrationPublic ??= null; - } - - if ('integration_require_code_grant' in data) { - /** - * Whether the integration will only be added upon completion of a full OAuth2 token exchange - * @type {?boolean} - */ - this.integrationRequireCodeGrant = data.integration_require_code_grant; - } else { - this.integrationRequireCodeGrant ??= null; - } - - if ('bot_disabled' in data) { - /** - * Whether the application's bot is disabled by Discord (default false) - * @type {?boolean} - */ - this.botDisabled = data.bot_disabled; - } else { - this.botDisabled ??= null; - } - - if ('bot_quarantined' in data) { - /** - * Whether the application's bot is quarantined by Discord - * @type {?boolean} - */ - this.botQuarantined = data.bot_quarantined; - } else { - this.botQuarantined ??= null; - } - - if ('approximate_user_install_count' in data) { - /** - * Approximate count of users that have authorized the application with the applications.commands scope - * @type {?number} - */ - this.approximateUserInstallCount = data.approximate_user_install_count; - } else { - this.approximateUserInstallCount ??= null; - } - - if ('approximate_user_authorization_count' in data) { - /** - * Approximate count of users that have OAuth2 authorizations for the application - * @type {?number} - */ - this.approximateUserAuthorizationCount = - data.approximate_user_authorization_count; - } else { - this.approximateUserAuthorizationCount ??= null; - } - - if ('internal_guild_restriction' in data) { - /** - * What guilds the application can be authorized in - * @type {?number} - */ - this.internalGuildRestriction = data.internal_guild_restriction; - } else { - this.internalGuildRestriction ??= null; - } - - if ('interactions_endpoint_url' in data) { - /** - * The URL of the application's interactions endpoint - * @type {?string} - */ - this.interactionsEndpointUrl = data.interactions_endpoint_url; - } else { - this.interactionsEndpointUrl ??= null; - } - - if ('interactions_version' in data) { - /** - * The version of the application's interactions endpoint implementation - * @type {?number} - */ - this.interactionsVersion = data.interactions_version; - } else { - this.interactionsVersion ??= null; - } - - if ('interactions_event_types' in data) { - /** - * The enabled event webhook types to send to the interaction endpoint - * @type {?string[]} - */ - this.interactionsEventTypes = data.interactions_event_types; - } else { - this.interactionsEventTypes ??= null; - } - - if ('event_webhooks_status' in data) { - /** - * Whether event webhooks are enabled - * @type {?number} - */ - this.eventWebhooksStatus = data.event_webhooks_status; - } else { - this.eventWebhooksStatus ??= null; - } - - if ('event_webhooks_url' in data) { - /** - * The URL of the application's event webhooks endpoint - * @type {?string} - */ - this.eventWebhooksUrl = data.event_webhooks_url; - } else { - this.eventWebhooksUrl ??= null; - } - - if ('event_webhooks_types' in data) { - /** - * The enabled event webhook types to send to the event webhooks endpoint - * @type {?string[]} - */ - this.eventWebhooksTypes = data.event_webhooks_types; - } else { - this.eventWebhooksTypes ??= null; - } - - if ('explicit_content_filter' in data) { - /** - * Whether uploaded media content used in application commands is scanned and deleted for explicit content - * @type {?number} - */ - this.explicitContentFilter = data.explicit_content_filter; - } else { - this.explicitContentFilter ??= null; - } - - if ('integration_types_config' in data) { - /** - * The configuration for each integration type supported by the application - * @type {?object} - */ - this.integrationTypesConfig = data.integration_types_config; - } else { - this.integrationTypesConfig ??= null; - } - - if ('is_verified' in data) { - /** - * Whether the application is verified - * @type {?boolean} - */ - this.isVerified = data.is_verified; - } else { - this.isVerified ??= null; - } - - if ('verification_state' in data) { - /** - * The current verification state of the application - * @type {?number} - */ - this.verificationState = data.verification_state; - } else { - this.verificationState ??= null; - } - - if ('store_application_state' in data) { - /** - * The current store approval state of the commerce application - * @type {?number} - */ - this.storeApplicationState = data.store_application_state; - } else { - this.storeApplicationState ??= null; - } - - if ('rpc_application_state' in data) { - /** - * The current RPC approval state of the application - * @type {?number} - */ - this.rpcApplicationState = data.rpc_application_state; - } else { - this.rpcApplicationState ??= null; - } - - if ('creator_monetization_state' in data) { - /** - * The current guild creator monetization state of the application - * @type {?number} - */ - this.creatorMonetizationState = data.creator_monetization_state; - } else { - this.creatorMonetizationState ??= null; - } - - if ('is_discoverable' in data) { - /** - * Whether the application is discoverable in the application directory - * @type {?boolean} - */ - this.isDiscoverable = data.is_discoverable; - } else { - this.isDiscoverable ??= null; - } - - if ('discoverability_state' in data) { - /** - * The current application directory discoverability state of the application - * @type {?number} - */ - this.discoverabilityState = data.discoverability_state; - } else { - this.discoverabilityState ??= null; - } - - if ('discovery_eligibility_flags' in data) { - /** - * The current application directory eligibility flags for the application - * @type {?number} - */ - this.discoveryEligibilityFlags = data.discovery_eligibility_flags; - } else { - this.discoveryEligibilityFlags ??= null; - } - - if ('is_monetized' in data) { - /** - * Whether the application has monetization enabled - * @type {?boolean} - */ - this.isMonetized = data.is_monetized; - } else { - this.isMonetized ??= null; - } - - if ('storefront_available' in data) { - /** - * Whether the application has public subscriptions or products available for purchase - * @type {?boolean} - */ - this.storefrontAvailable = data.storefront_available; - } else { - this.storefrontAvailable ??= null; - } - - if ('monetization_state' in data) { - /** - * The current application monetization state of the application - * @type {?number} - */ - this.monetizationState = data.monetization_state; - } else { - this.monetizationState ??= null; - } - - if ('monetization_eligibility_flags' in data) { - /** - * The current application monetization eligibility flags for the application - * @type {?number} - */ - this.monetizationEligibilityFlags = data.monetization_eligibility_flags; - } else { - this.monetizationEligibilityFlags ??= null; - } - - if ('max_participants' in data) { - /** - * The maximum possible participants in the application's embedded activity (-1 for no limit) - * @type {?number} - */ - this.maxParticipants = data.max_participants; - } else { - this.maxParticipants ??= null; - } - } - - /** - * The guild associated with this application. - * @type {?Guild} - * @readonly - */ - get guild() { - return this.client.guilds.cache.get(this.guildId) ?? null; - } - - /** - * Whether this application is partial - * @type {boolean} - * @readonly - */ - get partial() { - return !this.name; - } - - /** - * The timestamp the application was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return SnowflakeUtil.timestampFrom(this.id); - } - - /** - * The time the application was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * Obtains this application from Discord. - * @returns {Promise} - */ - async fetch() { - const app = await this.client.api.oauth2.authorize.get({ - query: { - client_id: this.id, - scope: 'bot applications.commands', - }, - }); - const user = this.client.users._add(app.bot); - user._partial = false; - this._patch(app.application); - return this; - } - - /** - * Gets this application's role connection metadata records - * @returns {Promise} - */ - async fetchRoleConnectionMetadataRecords() { - const metadata = await this.client.api - .applications(this.id)('role-connections') - .metadata.get(); - return metadata.map((data) => new ApplicationRoleConnectionMetadata(data)); - } - - /** - * A link to the application's icon. - * @param {StaticImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - iconURL({ format, size } = {}) { - if (!this.icon) return null; - return this.client.rest.cdn.AppIcon(this.id, this.icon, { format, size }); - } - - /** - * A link to this application's cover image. - * @param {StaticImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - coverURL({ format, size } = {}) { - if (!this.cover) return null; - return Endpoints.CDN(this.client.options.http.cdn).AppIcon( - this.id, - this.cover, - { format, size }, - ); - } - - /** - * Asset data. - * @typedef {Object} ApplicationAsset - * @property {Snowflake} id The asset's id - * @property {string} name The asset's name - * @property {string} type The asset's type - */ - - /** - * Gets the application's rich presence assets. - * @returns {Promise>} - * @deprecated This will be removed in the next major as it is unsupported functionality. - */ - async fetchAssets() { - if (!deprecationEmittedForFetchAssets) { - process.emitWarning( - 'Application#fetchAssets is deprecated as it is unsupported and will be removed in the next major version.', - 'DeprecationWarning', - ); - - deprecationEmittedForFetchAssets = true; - } - - const assets = await this.client.api.oauth2 - .applications(this.id) - .assets.get(); - return assets.map((a) => ({ - id: a.id, - name: a.name, - type: AssetTypes[a.type - 1], - })); - } - - /** - * When concatenated with a string, this automatically returns the application's name instead of the - * Application object. - * @returns {?string} - * @example - * // Logs: Application name: My App - * console.log(`Application name: ${application}`); - */ - toString() { - return this.name; - } - - toJSON() { - return super.toJSON({ createdTimestamp: true }); - } -} - -module.exports = Application; diff --git a/vendor/discord.js-selfbot-v13/src/structures/interfaces/Collector.js b/vendor/discord.js-selfbot-v13/src/structures/interfaces/Collector.js deleted file mode 100644 index 95d02f4..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/interfaces/Collector.js +++ /dev/null @@ -1,319 +0,0 @@ -'use strict'; - -const EventEmitter = require('node:events'); -const { setTimeout } = require('node:timers'); -const { Collection } = require('@discordjs/collection'); -const { TypeError } = require('../../errors'); -const Util = require('../../util/Util'); - -/** - * Filter to be applied to the collector. - * @typedef {Function} CollectorFilter - * @param {...*} args Any arguments received by the listener - * @param {Collection} collection The items collected by this collector - * @returns {boolean|Promise} - */ - -/** - * Options to be applied to the collector. - * @typedef {Object} CollectorOptions - * @property {CollectorFilter} [filter] The filter applied to this collector - * @property {number} [time] How long to run the collector for in milliseconds - * @property {number} [idle] How long to stop the collector after inactivity in milliseconds - * @property {boolean} [dispose=false] Whether to dispose data when it's deleted - */ - -/** - * Abstract class for defining a new Collector. - * @extends {EventEmitter} - * @abstract - */ -class Collector extends EventEmitter { - constructor(client, options = {}) { - super(); - - /** - * The client that instantiated this Collector - * @name Collector#client - * @type {Client} - * @readonly - */ - Object.defineProperty(this, 'client', { value: client }); - - /** - * The filter applied to this collector - * @type {CollectorFilter} - * @returns {boolean|Promise} - */ - this.filter = options.filter ?? (() => true); - - /** - * The options of this collector - * @type {CollectorOptions} - */ - this.options = options; - - /** - * The items collected by this collector - * @type {Collection} - */ - this.collected = new Collection(); - - /** - * Whether this collector has finished collecting - * @type {boolean} - */ - this.ended = false; - - /** - * Timeout for cleanup - * @type {?Timeout} - * @private - */ - this._timeout = null; - - /** - * Timeout for cleanup due to inactivity - * @type {?Timeout} - * @private - */ - this._idletimeout = null; - - if (typeof this.filter !== 'function') { - throw new TypeError('INVALID_TYPE', 'options.filter', 'function'); - } - - this.handleCollect = this.handleCollect.bind(this); - this.handleDispose = this.handleDispose.bind(this); - - if (options.time) - this._timeout = setTimeout(() => this.stop('time'), options.time).unref(); - if (options.idle) - this._idletimeout = setTimeout( - () => this.stop('idle'), - options.idle, - ).unref(); - } - - /** - * Call this to handle an event as a collectable element. Accepts any event data as parameters. - * @param {...*} args The arguments emitted by the listener - * @returns {Promise} - * @emits Collector#collect - */ - async handleCollect(...args) { - const collect = await this.collect(...args); - - if (collect && (await this.filter(...args, this.collected))) { - this.collected.set(collect, args[0]); - - /** - * Emitted whenever an element is collected. - * @event Collector#collect - * @param {...*} args The arguments emitted by the listener - */ - this.emit('collect', ...args); - - if (this._idletimeout) { - clearTimeout(this._idletimeout); - this._idletimeout = setTimeout( - () => this.stop('idle'), - this.options.idle, - ).unref(); - } - } - this.checkEnd(); - } - - /** - * Call this to remove an element from the collection. Accepts any event data as parameters. - * @param {...*} args The arguments emitted by the listener - * @returns {Promise} - * @emits Collector#dispose - */ - async handleDispose(...args) { - if (!this.options.dispose) return; - - const dispose = this.dispose(...args); - if ( - !dispose || - !(await this.filter(...args)) || - !this.collected.has(dispose) - ) - return; - this.collected.delete(dispose); - - /** - * Emitted whenever an element is disposed of. - * @event Collector#dispose - * @param {...*} args The arguments emitted by the listener - */ - this.emit('dispose', ...args); - this.checkEnd(); - } - - /** - * Returns a promise that resolves with the next collected element; - * rejects with collected elements if the collector finishes without receiving a next element - * @type {Promise} - * @readonly - */ - get next() { - return new Promise((resolve, reject) => { - if (this.ended) { - reject(this.collected); - return; - } - - const cleanup = () => { - this.removeListener('collect', onCollect); - this.removeListener('end', onEnd); - }; - - const onCollect = (item) => { - cleanup(); - resolve(item); - }; - - const onEnd = () => { - cleanup(); - reject(this.collected); // eslint-disable-line prefer-promise-reject-errors - }; - - this.on('collect', onCollect); - this.on('end', onEnd); - }); - } - - /** - * Stops this collector and emits the `end` event. - * @param {string} [reason='user'] The reason this collector is ending - * @emits Collector#end - */ - stop(reason = 'user') { - if (this.ended) return; - - if (this._timeout) { - clearTimeout(this._timeout); - this._timeout = null; - } - if (this._idletimeout) { - clearTimeout(this._idletimeout); - this._idletimeout = null; - } - this.ended = true; - - /** - * Emitted when the collector is finished collecting. - * @event Collector#end - * @param {Collection} collected The elements collected by the collector - * @param {string} reason The reason the collector ended - */ - this.emit('end', this.collected, reason); - } - - /** - * Options used to reset the timeout and idle timer of a {@link Collector}. - * @typedef {Object} CollectorResetTimerOptions - * @property {number} [time] How long to run the collector for (in milliseconds) - * @property {number} [idle] How long to wait to stop the collector after inactivity (in milliseconds) - */ - - /** - * Resets the collector's timeout and idle timer. - * @param {CollectorResetTimerOptions} [options] Options for resetting - */ - resetTimer({ time, idle } = {}) { - if (this._timeout) { - clearTimeout(this._timeout); - this._timeout = setTimeout( - () => this.stop('time'), - time ?? this.options.time, - ).unref(); - } - if (this._idletimeout) { - clearTimeout(this._idletimeout); - this._idletimeout = setTimeout( - () => this.stop('idle'), - idle ?? this.options.idle, - ).unref(); - } - } - - /** - * Checks whether the collector should end, and if so, ends it. - * @returns {boolean} Whether the collector ended or not - */ - checkEnd() { - const reason = this.endReason; - if (reason) this.stop(reason); - return Boolean(reason); - } - - /** - * Allows collectors to be consumed with for-await-of loops - * @see {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of} - */ - async *[Symbol.asyncIterator]() { - const queue = []; - const onCollect = (item) => queue.push(item); - this.on('collect', onCollect); - - try { - while (queue.length || !this.ended) { - if (queue.length) { - yield queue.shift(); - } else { - // eslint-disable-next-line no-await-in-loop - await new Promise((resolve) => { - const tick = () => { - this.removeListener('collect', tick); - this.removeListener('end', tick); - return resolve(); - }; - this.on('collect', tick); - this.on('end', tick); - }); - } - } - } finally { - this.removeListener('collect', onCollect); - } - } - - toJSON() { - return Util.flatten(this); - } - - /* eslint-disable no-empty-function */ - /** - * The reason this collector has ended with, or null if it hasn't ended yet - * @type {?string} - * @readonly - * @abstract - */ - get endReason() {} - - /** - * Handles incoming events from the `handleCollect` function. Returns null if the event should not - * be collected, or returns an object describing the data that should be stored. - * @see Collector#handleCollect - * @param {...*} args Any args the event listener emits - * @returns {?(*|Promise)} Data to insert into collection, if any - * @abstract - */ - collect() {} - - /** - * Handles incoming events from the `handleDispose`. Returns null if the event should not - * be disposed, or returns the key that should be removed. - * @see Collector#handleDispose - * @param {...*} args Any args the event listener emits - * @returns {?*} Key to remove from the collection, if any - * @abstract - */ - dispose() {} - /* eslint-enable no-empty-function */ -} - -module.exports = Collector; diff --git a/vendor/discord.js-selfbot-v13/src/structures/interfaces/InteractionResponses.js b/vendor/discord.js-selfbot-v13/src/structures/interfaces/InteractionResponses.js deleted file mode 100644 index 6e10cf4..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/interfaces/InteractionResponses.js +++ /dev/null @@ -1,331 +0,0 @@ -'use strict'; - -const { Error } = require('../../errors'); -const { - InteractionResponseTypes, - InteractionTypes, -} = require('../../util/Constants'); -const MessageFlags = require('../../util/MessageFlags'); -const InteractionCollector = require('../InteractionCollector'); -const MessagePayload = require('../MessagePayload'); -const Modal = require('../Modal'); - -/** - * Interface for classes that support shared interaction response types. - * @interface - */ -class InteractionResponses { - /** - * Options for deferring the reply to an {@link Interaction}. - * @typedef {Object} InteractionDeferReplyOptions - * @property {boolean} [ephemeral] Whether the reply should be ephemeral - * @property {boolean} [fetchReply] Whether to fetch the reply - */ - - /** - * Options for deferring and updating the reply to a {@link MessageComponentInteraction}. - * @typedef {Object} InteractionDeferUpdateOptions - * @property {boolean} [fetchReply] Whether to fetch the reply - */ - - /** - * Options for a reply to an {@link Interaction}. - * @typedef {BaseMessageOptionsWithPoll} InteractionReplyOptions - * @property {boolean} [ephemeral] Whether the reply should be ephemeral - * @property {boolean} [fetchReply] Whether to fetch the reply - * @property {MessageFlags} [flags] Which flags to set for the message. - * Only `SUPPRESS_EMBEDS` and `EPHEMERAL` can be set. - */ - - /** - * Options for updating the message received from a {@link MessageComponentInteraction}. - * @typedef {MessageEditOptions} InteractionUpdateOptions - * @property {boolean} [fetchReply] Whether to fetch the reply - */ - - /** - * Defers the reply to this interaction. - * @param {InteractionDeferReplyOptions} [options] Options for deferring the reply to this interaction - * @returns {Promise} - * @example - * // Defer the reply to this interaction - * interaction.deferReply() - * .then(console.log) - * .catch(console.error) - * @example - * // Defer to send an ephemeral reply later - * interaction.deferReply({ ephemeral: true }) - * .then(console.log) - * .catch(console.error); - */ - async deferReply(options = {}) { - if (this.deferred || this.replied) - throw new Error('INTERACTION_ALREADY_REPLIED'); - this.ephemeral = options.ephemeral ?? false; - await this.client.api.interactions(this.id, this.token).callback.post({ - data: { - type: InteractionResponseTypes.DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE, - data: { - flags: options.ephemeral ? MessageFlags.FLAGS.EPHEMERAL : undefined, - }, - }, - auth: false, - }); - this.deferred = true; - - return options.fetchReply ? this.fetchReply() : undefined; - } - - /** - * Creates a reply to this interaction. - * Use the `fetchReply` option to get the bot's reply message. - * @param {string|MessagePayload|InteractionReplyOptions} options The options for the reply - * @returns {Promise} - * @example - * // Reply to the interaction and fetch the response - * interaction.reply({ content: 'Pong!', fetchReply: true }) - * .then((message) => console.log(`Reply sent with content ${message.content}`)) - * .catch(console.error); - * @example - * // Create an ephemeral reply with an embed - * const embed = new MessageEmbed().setDescription('Pong!'); - * - * interaction.reply({ embeds: [embed], ephemeral: true }) - * .then(() => console.log('Reply sent.')) - * .catch(console.error); - */ - async reply(options) { - if (this.deferred || this.replied) - throw new Error('INTERACTION_ALREADY_REPLIED'); - this.ephemeral = options.ephemeral ?? false; - - let messagePayload; - if (options instanceof MessagePayload) messagePayload = options; - else messagePayload = MessagePayload.create(this, options); - - const { data, files } = await messagePayload.resolveData().resolveFiles(); - - await this.client.api.interactions(this.id, this.token).callback.post({ - data: { - type: InteractionResponseTypes.CHANNEL_MESSAGE_WITH_SOURCE, - data, - }, - files, - auth: false, - }); - this.replied = true; - - return options.fetchReply ? this.fetchReply() : undefined; - } - - /** - * Fetches a reply to this interaction. - * @see Webhook#fetchMessage - * @param {MessageResolvable|'@original'} [message='@original'] The response to fetch - * @returns {Promise} - * @example - * // Fetch the initial reply to this interaction - * interaction.fetchReply() - * .then(reply => console.log(`Replied with ${reply.content}`)) - * .catch(console.error); - */ - fetchReply(message = '@original') { - return this.webhook.fetchMessage(message); - } - - /** - * Options that can be passed into {@link InteractionResponses#editReply}. - * @typedef {WebhookEditMessageOptions} InteractionEditReplyOptions - * @property {MessageResolvable|'@original'} [message='@original'] The response to edit - */ - - /** - * Edits a reply to this interaction. - * @see Webhook#editMessage - * @param {string|MessagePayload|InteractionEditReplyOptions} options The new options for the message - * @returns {Promise} - * @example - * // Edit the initial reply to this interaction - * interaction.editReply('New content') - * .then(console.log) - * .catch(console.error); - */ - async editReply(options) { - if (!this.deferred && !this.replied) - throw new Error('INTERACTION_NOT_REPLIED'); - const message = await this.webhook.editMessage( - options.message ?? '@original', - options, - ); - this.replied = true; - return message; - } - - /** - * Deletes a reply to this interaction. - * @see Webhook#deleteMessage - * @param {MessageResolvable|'@original'} [message='@original'] The response to delete - * @returns {Promise} - * @example - * // Delete the initial reply to this interaction - * interaction.deleteReply() - * .then(console.log) - * .catch(console.error); - */ - async deleteReply(message = '@original') { - await this.webhook.deleteMessage(message); - } - - /** - * Send a follow-up message to this interaction. - * @param {string|MessagePayload|InteractionReplyOptions} options The options for the reply - * @returns {Promise} - */ - async followUp(options) { - if (!this.deferred && !this.replied) - throw new Error('INTERACTION_NOT_REPLIED'); - return this.webhook.send(options); - } - - /** - * Defers an update to the message to which the component was attached. - * @param {InteractionDeferUpdateOptions} [options] Options for deferring the update to this interaction - * @returns {Promise} - * @example - * // Defer updating and reset the component's loading state - * interaction.deferUpdate() - * .then(console.log) - * .catch(console.error); - */ - async deferUpdate(options = {}) { - if (this.deferred || this.replied) - throw new Error('INTERACTION_ALREADY_REPLIED'); - await this.client.api.interactions(this.id, this.token).callback.post({ - data: { - type: InteractionResponseTypes.DEFERRED_MESSAGE_UPDATE, - }, - auth: false, - }); - this.deferred = true; - - return options.fetchReply ? this.fetchReply() : undefined; - } - - /** - * Updates the original message of the component on which the interaction was received on. - * @param {string|MessagePayload|InteractionUpdateOptions} options The options for the updated message - * @returns {Promise} - * @example - * // Remove the components from the message - * interaction.update({ - * content: "A component interaction was received", - * components: [] - * }) - * .then(console.log) - * .catch(console.error); - */ - async update(options) { - if (this.deferred || this.replied) - throw new Error('INTERACTION_ALREADY_REPLIED'); - - let messagePayload; - if (options instanceof MessagePayload) messagePayload = options; - else messagePayload = MessagePayload.create(this, options); - - const { data, files } = await messagePayload.resolveData().resolveFiles(); - - await this.client.api.interactions(this.id, this.token).callback.post({ - data: { - type: InteractionResponseTypes.UPDATE_MESSAGE, - data, - }, - files, - auth: false, - }); - this.replied = true; - - return options.fetchReply ? this.fetchReply() : undefined; - } - - /** - * Shows a modal component - * @param {Modal|ModalOptions} modal The modal to show - * @returns {Promise} - */ - async showModal(modal) { - if (this.deferred || this.replied) - throw new Error('INTERACTION_ALREADY_REPLIED'); - - const _modal = modal instanceof Modal ? modal : new Modal(modal); - await this.client.api.interactions(this.id, this.token).callback.post({ - data: { - type: InteractionResponseTypes.MODAL, - data: _modal.toJSON(), - }, - }); - this.replied = true; - } - - /** - * An object containing the same properties as CollectorOptions, but a few more: - * @typedef {Object} AwaitModalSubmitOptions - * @property {CollectorFilter} [filter] The filter applied to this collector - * @property {number} time Time in milliseconds to wait for an interaction before rejecting - */ - - /** - * Collects a single modal submit interaction that passes the filter. - * The Promise will reject if the time expires. - * @param {AwaitModalSubmitOptions} options Options to pass to the internal collector - * @returns {Promise} - * @example - * // Collect a modal submit interaction - * const filter = (interaction) => interaction.customId === 'modal'; - * interaction.awaitModalSubmit({ filter, time: 15_000 }) - * .then(interaction => console.log(`${interaction.customId} was submitted!`)) - * .catch(console.error); - */ - awaitModalSubmit(options) { - if (typeof options.time !== 'number') - throw new Error('INVALID_TYPE', 'time', 'number'); - const _options = { - ...options, - max: 1, - interactionType: InteractionTypes.MODAL_SUBMIT, - }; - return new Promise((resolve, reject) => { - const collector = new InteractionCollector(this.client, _options); - collector.once('end', (interactions, reason) => { - const interaction = interactions.first(); - if (interaction) resolve(interaction); - else reject(new Error('INTERACTION_COLLECTOR_ERROR', reason)); - }); - }); - } - - static applyToClass(structure, ignore = []) { - const props = [ - 'deferReply', - 'reply', - 'fetchReply', - 'editReply', - 'deleteReply', - 'followUp', - 'deferUpdate', - 'update', - 'showModal', - 'awaitModalSubmit', - ]; - - for (const prop of props) { - if (ignore.includes(prop)) continue; - Object.defineProperty( - structure.prototype, - prop, - Object.getOwnPropertyDescriptor(InteractionResponses.prototype, prop), - ); - } - } -} - -module.exports = InteractionResponses; diff --git a/vendor/discord.js-selfbot-v13/src/structures/interfaces/TextBasedChannel.js b/vendor/discord.js-selfbot-v13/src/structures/interfaces/TextBasedChannel.js deleted file mode 100644 index 055d46a..0000000 --- a/vendor/discord.js-selfbot-v13/src/structures/interfaces/TextBasedChannel.js +++ /dev/null @@ -1,806 +0,0 @@ -'use strict'; - -/* eslint-disable import/order */ -const MessageCollector = require('../MessageCollector'); -const MessagePayload = require('../MessagePayload'); -const { - InteractionTypes, - ApplicationCommandOptionTypes, - Events, -} = require('../../util/Constants'); -const { Error } = require('../../errors'); -const SnowflakeUtil = require('../../util/SnowflakeUtil'); -const { setTimeout } = require('node:timers'); -const { s } = require('@sapphire/shapeshift'); -const Util = require('../../util/Util'); -const validateName = (stringName) => - s - .string() - .lengthGreaterThanOrEqual(1) - .lengthLessThanOrEqual(32) - .regex(/^[\p{Ll}\p{Lm}\p{Lo}\p{N}\p{sc=Devanagari}\p{sc=Thai}_-]+$/u) - .setValidationEnabled(true) - .parse(stringName); - -/** - * Interface for classes that have text-channel-like features. - * @interface - */ -class TextBasedChannel { - constructor() { - /** - * A manager of the messages sent to this channel - * @type {MessageManager} - */ - this.messages = new MessageManager(this); - - /** - * The channel's last message id, if one was sent - * @type {?Snowflake} - */ - this.lastMessageId = null; - - /** - * The timestamp when the last pinned message was pinned, if there was one - * @type {?number} - */ - this.lastPinTimestamp = null; - } - - /** - * The Message object of the last message in the channel, if one was sent - * @type {?Message} - * @readonly - */ - get lastMessage() { - return this.messages.resolve(this.lastMessageId); - } - - /** - * The date when the last pinned message was pinned, if there was one - * @type {?Date} - * @readonly - */ - get lastPinAt() { - return this.lastPinTimestamp ? new Date(this.lastPinTimestamp) : null; - } - - /** - * Represents the data for a poll answer. - * @typedef {Object} PollAnswerData - * @property {string} text The text for the poll answer - * @property {EmojiIdentifierResolvable} [emoji] The emoji for the poll answer - */ - - /** - * Represents the data for a poll. - * @typedef {Object} PollData - * @property {PollQuestionMedia} question The question for the poll - * @property {PollAnswerData[]} answers The answers for the poll - * @property {number} duration The duration in hours for the poll - * @property {boolean} allowMultiselect Whether the poll allows multiple answers - * @property {PollLayoutType} [layoutType] The layout type for the poll - */ - - /** - * Base options provided when sending. - * @typedef {Object} BaseMessageOptions - * @property {MessageActivity} [activity] Group activity - * @property {boolean} [tts=false] Whether or not the message should be spoken aloud - * @property {string} [nonce=''] The nonce for the message - * @property {string} [content=''] The content for the message - * @property {Array<(MessageEmbed|APIEmbed)>} [embeds] The embeds for the message - * (see [here](https://discord.com/developers/docs/resources/channel#embed-object) for more details) - * @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content - * (see [here](https://discord.com/developers/docs/resources/channel#allowed-mentions-object) for more details) - * @property {Array<(FileOptions|BufferResolvable|MessageAttachment[])>} [files] Files to send with the message - * @property {Array<(MessageActionRow|MessageActionRowOptions)>} [components] - * Action rows containing interactive components for the message (buttons, select menus) - * @property {MessageAttachment[]} [attachments] Attachments to send in the message - */ - - /** - * The base message options for messages including a poll. - * @typedef {BaseMessageOptions} BaseMessageOptionsWithPoll - * @property {PollData} [poll] The poll to send with the message - */ - - /** - * @typedef {Object} ForwardOptions - * @property {MessageResolvable} message The originating message - * @property {TextBasedChannelResolvable} [channel] The channel of the originating message - * @property {GuildResolvable} [guild] The guild of the originating message - */ - - /** - * Options provided when sending or editing a message. - * @typedef {BaseMessageOptions} MessageOptions - * @property {ReplyOptions} [reply] The options for replying to a message - * @property {ForwardOptions} [forward] The options for forwarding a message - * @property {StickerResolvable[]} [stickers=[]] Stickers to send in the message - * @property {MessageFlags} [flags] Which flags to set for the message. - * Only `SUPPRESS_EMBEDS`, `SUPPRESS_NOTIFICATIONS` and `IS_VOICE_MESSAGE` can be set. - */ - - /** - * Options provided to control parsing of mentions by Discord - * @typedef {Object} MessageMentionOptions - * @property {MessageMentionTypes[]} [parse] Types of mentions to be parsed - * @property {Snowflake[]} [users] Snowflakes of Users to be parsed as mentions - * @property {Snowflake[]} [roles] Snowflakes of Roles to be parsed as mentions - * @property {boolean} [repliedUser=true] Whether the author of the Message being replied to should be pinged - */ - - /** - * Types of mentions to enable in MessageMentionOptions. - * - `roles` - * - `users` - * - `everyone` - * @typedef {string} MessageMentionTypes - */ - - /** - * @typedef {Object} FileOptions - * @property {BufferResolvable} attachment File to attach - * @property {string} [name='file.jpg'] Filename of the attachment - * @property {string} description The description of the file - */ - - /** - * Options for sending a message with a reply. - * @typedef {Object} ReplyOptions - * @property {MessageResolvable} messageReference The message to reply to (must be in the same channel and not system) - * @property {boolean} [failIfNotExists=true] Whether to error if the referenced message - * does not exist (creates a standard message in this case when false) - */ - - /** - * Sends a message to this channel. - * @param {string|MessagePayload|MessageOptions} options The options to provide - * @returns {Promise} - * @example - * // Send a basic message - * channel.send('hello!') - * .then(message => console.log(`Sent message: ${message.content}`)) - * .catch(console.error); - * @example - * // Send a remote file - * channel.send({ - * files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048'] - * }) - * .then(console.log) - * .catch(console.error); - * @example - * // Send a local file - * channel.send({ - * files: [{ - * attachment: 'entire/path/to/file.jpg', - * name: 'file.jpg', - * description: 'A description of the file' - * }] - * }) - * .then(console.log) - * .catch(console.error); - */ - async send(options) { - const User = require('../User'); - const { GuildMember } = require('../GuildMember'); - - if (this instanceof User || this instanceof GuildMember) { - const dm = await this.createDM(); - return dm.send(options); - } - - let messagePayload; - - if (options instanceof MessagePayload) { - messagePayload = options.resolveData(); - } else { - messagePayload = MessagePayload.create(this, options).resolveData(); - } - - const { data, files } = await messagePayload.resolveFiles(); - // New API - const attachments = await Util.getUploadURL(this.client, this.id, files); - const requestPromises = attachments.map(async (attachment) => { - await Util.uploadFile(files[attachment.id].file, attachment.upload_url); - return { - id: attachment.id, - filename: files[attachment.id].name, - uploaded_filename: attachment.upload_filename, - description: files[attachment.id].description, - duration_secs: files[attachment.id].duration_secs, - waveform: files[attachment.id].waveform, - }; - }); - const attachmentsData = await Promise.all(requestPromises); - attachmentsData.sort((a, b) => parseInt(a.id) - parseInt(b.id)); - data.attachments = attachmentsData; - // Empty Files - const d = await this.client.api.channels[this.id].messages.post({ data }); - - return this.messages.cache.get(d.id) ?? this.messages._add(d); - } - - searchInteractionFromGuildAndPrivateChannel() { - // Support Slash / ContextMenu - // API https://canary.discord.com/api/v9/guilds/:id/application-command-index // Guild - // https://canary.discord.com/api/v9/channels/:id/application-command-index // DM Channel - // Updated: 07/01/2023 - return this.client.api[this.guild ? 'guilds' : 'channels'][ - this.guild?.id || this.id - ]['application-command-index'] - .get() - .catch(() => ({ - application_commands: [], - applications: [], - version: '', - })); - } - - searchInteractionUserApps() { - return this.client.api.users['@me']['application-command-index'] - .get() - .catch(() => ({ - application_commands: [], - applications: [], - version: '', - })); - } - - searchInteraction() { - return Promise.all([ - this.searchInteractionFromGuildAndPrivateChannel(), - this.searchInteractionUserApps(), - ]).then(([dataA, dataB]) => ({ - applications: [...dataA.applications, ...dataB.applications], - application_commands: [ - ...dataA.application_commands, - ...dataB.application_commands, - ], - })); - } - - async sendSlash(botOrApplicationId, commandNameString, ...args) { - // Parse commandName /role add user - const cmd = commandNameString.trim().split(' '); - // Ex: role add user => [role, add, user] - // Parse: name, subGr, sub - const commandName = validateName(cmd[0]); - // Parse: role - const sub = cmd.slice(1); - // Parse: [add, user] - for (let i = 0; i < sub.length; i++) { - if (sub.length > 2) { - throw new Error('INVALID_COMMAND_NAME', cmd); - } - validateName(sub[i]); - } - // Search all - const data = await this.searchInteraction(); - // Find command... - const filterCommand = data.application_commands.filter((obj) => - // Filter: name | name_default - [obj.name, obj.name_default].includes(commandName), - ); - // Filter Bot - botOrApplicationId = this.client.users.resolveId(botOrApplicationId); - const application = data.applications.find( - (obj) => obj.id == botOrApplicationId || obj.bot_id == botOrApplicationId, - ); - if (!application) { - throw new Error( - 'INVALID_APPLICATION_COMMAND', - "Bot/Application doesn't exist", - ); - } - // Find Command with application - const command = filterCommand.find( - (command) => command.application_id == application.id, - ); - if (!command) { - throw new Error('INVALID_APPLICATION_COMMAND', application.id); - } - args = args.flat(2); - let optionFormat = []; - let attachments = []; - let optionsMaxdepth, subGroup, subCommand; - if (sub.length == 2) { - // Subcommand Group > Subcommand - // Find Sub group - subGroup = command.options.find( - (obj) => - obj.type == ApplicationCommandOptionTypes.SUB_COMMAND_GROUP && - [obj.name, obj.name_default].includes(sub[0]), - ); - if (!subGroup) - throw new Error('SLASH_COMMAND_SUB_COMMAND_GROUP_INVALID', sub[0]); - // Find Sub - subCommand = subGroup.options.find( - (obj) => - obj.type == ApplicationCommandOptionTypes.SUB_COMMAND && - [obj.name, obj.name_default].includes(sub[1]), - ); - if (!subCommand) - throw new Error('SLASH_COMMAND_SUB_COMMAND_INVALID', sub[1]); - // Options - optionsMaxdepth = subCommand.options; - } else if (sub.length == 1) { - // Subcommand - subCommand = command.options.find( - (obj) => - obj.type == ApplicationCommandOptionTypes.SUB_COMMAND && - [obj.name, obj.name_default].includes(sub[0]), - ); - if (!subCommand) - throw new Error('SLASH_COMMAND_SUB_COMMAND_INVALID', sub[0]); - // Options - optionsMaxdepth = subCommand.options; - } else { - optionsMaxdepth = command.options; - } - const valueRequired = - optionsMaxdepth?.filter((o) => o.required).length || 0; - for ( - let i = 0; - i < Math.min(args.length, optionsMaxdepth?.length || 0); - i++ - ) { - const optionInput = optionsMaxdepth[i]; - const value = args[i]; - const parseData = await parseOption( - this.client, - optionInput, - value, - optionFormat, - attachments, - command, - application.id, - this.guild?.id, - this.id, - subGroup, - subCommand, - ); - optionFormat = parseData.optionFormat; - attachments = parseData.attachments; - } - if (valueRequired > args.length) { - throw new Error( - 'SLASH_COMMAND_REQUIRED_OPTIONS_MISSING', - valueRequired, - optionFormat.length, - ); - } - // Post - let postData; - if (subGroup) { - postData = [ - { - type: ApplicationCommandOptionTypes.SUB_COMMAND_GROUP, - name: subGroup.name, - options: [ - { - type: ApplicationCommandOptionTypes.SUB_COMMAND, - name: subCommand.name, - options: optionFormat, - }, - ], - }, - ]; - } else if (subCommand) { - postData = [ - { - type: ApplicationCommandOptionTypes.SUB_COMMAND, - name: subCommand.name, - options: optionFormat, - }, - ]; - } else { - postData = optionFormat; - } - const nonce = SnowflakeUtil.generate(); - const body = createPostData( - this.client, - false, - application.id, - nonce, - this.guild?.id, - Boolean(command.guild_id), - this.id, - command.version, - command.id, - command.name_default || command.name, - command.type, - postData, - attachments, - ); - this.client.api.interactions.post({ - data: body, - usePayloadJSON: true, - }); - return Util.createPromiseInteraction(this.client, nonce, 5000); - } - - /** - * Sends a typing indicator in the channel. - * @returns {Promise<{ message_send_cooldown_ms: number, thread_create_cooldown_ms: number }|void>} Resolves upon the typing status being sent - * @example - * // Start typing in a channel - * channel.sendTyping(); - */ - sendTyping() { - return this.client.api.channels(this.id).typing.post(); - } - - /** - * Creates a Message Collector. - * @param {MessageCollectorOptions} [options={}] The options to pass to the collector - * @returns {MessageCollector} - * @example - * // Create a message collector - * const filter = m => m.content.includes('discord'); - * const collector = channel.createMessageCollector({ filter, time: 15_000 }); - * collector.on('collect', m => console.log(`Collected ${m.content}`)); - * collector.on('end', collected => console.log(`Collected ${collected.size} items`)); - */ - createMessageCollector(options = {}) { - return new MessageCollector(this, options); - } - - /** - * An object containing the same properties as CollectorOptions, but a few more: - * @typedef {MessageCollectorOptions} AwaitMessagesOptions - * @property {string[]} [errors] Stop/end reasons that cause the promise to reject - */ - - /** - * Similar to createMessageCollector but in promise form. - * Resolves with a collection of messages that pass the specified filter. - * @param {AwaitMessagesOptions} [options={}] Optional options to pass to the internal collector - * @returns {Promise>} - * @example - * // Await !vote messages - * const filter = m => m.content.startsWith('!vote'); - * // Errors: ['time'] treats ending because of the time limit as an error - * channel.awaitMessages({ filter, max: 4, time: 60_000, errors: ['time'] }) - * .then(collected => console.log(collected.size)) - * .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`)); - */ - awaitMessages(options = {}) { - return new Promise((resolve, reject) => { - const collector = this.createMessageCollector(options); - collector.once('end', (collection, reason) => { - if (options.errors?.includes(reason)) { - reject(collection); - } else { - resolve(collection); - } - }); - }); - } - - /** - * Fetches all webhooks for the channel. - * @returns {Promise>} - * @example - * // Fetch webhooks - * channel.fetchWebhooks() - * .then(hooks => console.log(`This channel has ${hooks.size} hooks`)) - * .catch(console.error); - */ - fetchWebhooks() { - return this.guild.channels.fetchWebhooks(this.id); - } - - /** - * Options used to create a {@link Webhook} in a guild text-based channel. - * @typedef {Object} ChannelWebhookCreateOptions - * @property {?(BufferResolvable|Base64Resolvable)} [avatar] Avatar for the webhook - * @property {string} [reason] Reason for creating the webhook - */ - - /** - * Creates a webhook for the channel. - * @param {string} name The name of the webhook - * @param {ChannelWebhookCreateOptions} [options] Options for creating the webhook - * @returns {Promise} Returns the created Webhook - * @example - * // Create a webhook for the current channel - * channel.createWebhook('Snek', { - * avatar: 'https://i.imgur.com/mI8XcpG.jpg', - * reason: 'Needed a cool new Webhook' - * }) - * .then(console.log) - * .catch(console.error) - */ - createWebhook(name, options = {}) { - return this.guild.channels.createWebhook(this.id, name, options); - } - - /** - * Sets the rate limit per user (slowmode) for this channel. - * @param {number} rateLimitPerUser The new rate limit in seconds - * @param {string} [reason] Reason for changing the channel's rate limit - * @returns {Promise} - */ - setRateLimitPerUser(rateLimitPerUser, reason) { - return this.edit({ rateLimitPerUser }, reason); - } - - /** - * Sets whether this channel is flagged as NSFW. - * @param {boolean} [nsfw=true] Whether the channel should be considered NSFW - * @param {string} [reason] Reason for changing the channel's NSFW flag - * @returns {Promise} - */ - setNSFW(nsfw = true, reason) { - return this.edit({ nsfw }, reason); - } - - static applyToClass(structure, full = false, ignore = []) { - const props = ['send']; - if (full) { - props.push( - 'sendSlash', - 'searchInteraction', - 'searchInteractionFromGuildAndPrivateChannel', - 'searchInteractionUserApps', - 'lastMessage', - 'lastPinAt', - 'sendTyping', - 'createMessageCollector', - 'awaitMessages', - 'fetchWebhooks', - 'createWebhook', - 'setRateLimitPerUser', - 'setNSFW', - ); - } - for (const prop of props) { - if (ignore.includes(prop)) continue; - Object.defineProperty( - structure.prototype, - prop, - Object.getOwnPropertyDescriptor(TextBasedChannel.prototype, prop), - ); - } - } -} - -module.exports = TextBasedChannel; - -// Fixes Circular -const MessageManager = require('../../managers/MessageManager'); - -// Utils -function parseChoices(parent, list_choices, value) { - if (value !== undefined) { - if (Array.isArray(list_choices) && list_choices.length) { - const choice = list_choices.find((c) => - [c.name, c.value].includes(value), - ); - if (choice) { - return choice.value; - } else { - throw new Error('INVALID_SLASH_COMMAND_CHOICES', parent, value); - } - } else { - return value; - } - } else { - return undefined; - } -} - -async function addDataFromAttachment(value, client, channelId, attachments) { - value = await MessagePayload.resolveFile(value); - if (!value?.file) { - throw new TypeError( - 'The attachment data must be a BufferResolvable or Stream or FileOptions of MessageAttachment', - ); - } - const data = await Util.getUploadURL(client, channelId, [value]); - await Util.uploadFile(value.file, data[0].upload_url); - const id = attachments.length; - attachments.push({ - id, - filename: value.name, - uploaded_filename: data[0].upload_filename, - }); - return { - id, - attachments, - }; -} - -async function parseOption( - client, - optionCommand, - value, - optionFormat, - attachments, - command, - applicationId, - guildId, - channelId, - subGroup, - subCommand, -) { - const data = { - type: optionCommand.type, - name: optionCommand.name, - }; - if (value !== undefined) { - switch (optionCommand.type) { - case ApplicationCommandOptionTypes.BOOLEAN: - case 'BOOLEAN': { - data.value = Boolean(value); - break; - } - case ApplicationCommandOptionTypes.INTEGER: - case 'INTEGER': { - data.value = Number(value); - break; - } - case ApplicationCommandOptionTypes.ATTACHMENT: - case 'ATTACHMENT': { - const parseData = await addDataFromAttachment( - value, - client, - channelId, - attachments, - ); - data.value = parseData.id; - attachments = parseData.attachments; - break; - } - case ApplicationCommandOptionTypes.SUB_COMMAND_GROUP: - case 'SUB_COMMAND_GROUP': { - break; - } - default: { - value = parseChoices(optionCommand.name, optionCommand.choices, value); - if (optionCommand.autocomplete) { - const nonce = SnowflakeUtil.generate(); - // Post - let postData; - if (subGroup) { - postData = [ - { - type: ApplicationCommandOptionTypes.SUB_COMMAND_GROUP, - name: subGroup.name, - options: [ - { - type: ApplicationCommandOptionTypes.SUB_COMMAND, - name: subCommand.name, - options: [ - { - type: optionCommand.type, - name: optionCommand.name, - value, - focused: true, - }, - ], - }, - ], - }, - ]; - } else if (subCommand) { - postData = [ - { - type: ApplicationCommandOptionTypes.SUB_COMMAND, - name: subCommand.name, - options: [ - { - type: optionCommand.type, - name: optionCommand.name, - value, - focused: true, - }, - ], - }, - ]; - } else { - postData = [ - { - type: optionCommand.type, - name: optionCommand.name, - value, - focused: true, - }, - ]; - } - const body = createPostData( - client, - true, - applicationId, - nonce, - guildId, - Boolean(command.guild_id), - channelId, - command.version, - command.id, - command.name_default || command.name, - command.type, - postData, - [], - ); - await client.api.interactions.post({ - data: body, - }); - data.value = await awaitAutocomplete(client, nonce, value); - } else { - data.value = value; - } - } - } - optionFormat.push(data); - } - return { - optionFormat, - attachments, - }; -} - -function awaitAutocomplete(client, nonce, defaultValue) { - return new Promise((resolve) => { - const handler = (data) => { - if (data.t !== 'APPLICATION_COMMAND_AUTOCOMPLETE_RESPONSE') return; - if (data.d?.nonce !== nonce) return; - clearTimeout(timeout); - client.removeListener(Events.UNHANDLED_PACKET, handler); - client.decrementMaxListeners(); - if (data.d.choices.length >= 1) { - resolve(data.d.choices[0].value); - } else { - resolve(defaultValue); - } - }; - const timeout = setTimeout(() => { - client.removeListener(Events.UNHANDLED_PACKET, handler); - client.decrementMaxListeners(); - resolve(defaultValue); - }, 5_000).unref(); - client.incrementMaxListeners(); - client.on(Events.UNHANDLED_PACKET, handler); - }); -} - -function createPostData( - client, - isAutocomplete = false, - applicationId, - nonce, - guildId, - isGuildCommand, - channelId, - commandVersion, - commandId, - commandName, - commandType, - postData, - attachments = [], -) { - const data = { - type: isAutocomplete - ? InteractionTypes.APPLICATION_COMMAND_AUTOCOMPLETE - : InteractionTypes.APPLICATION_COMMAND, - application_id: applicationId, - guild_id: guildId, - channel_id: channelId, - session_id: client.sessionId, - data: { - version: commandVersion, - id: commandId, - name: commandName, - type: commandType, - options: postData, - attachments: attachments, - }, - nonce, - }; - if (isGuildCommand) { - data.data.guild_id = guildId; - } - return data; -} diff --git a/vendor/discord.js-selfbot-v13/src/util/APITypes.js b/vendor/discord.js-selfbot-v13/src/util/APITypes.js deleted file mode 100644 index 871ee31..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/APITypes.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @external APIGuildScheduledEventRecurrenceRule - * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIGuildScheduledEventRecurrenceRule} - */ - -/** - * @external APIIncidentsData - * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIIncidentsData} - */ - -/** - * @external GuildScheduledEventRecurrenceRuleFrequency - * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/GuildScheduledEventRecurrenceRuleFrequency} - */ - -/** - * @external GuildScheduledEventRecurrenceRuleMonth - * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/GuildScheduledEventRecurrenceRuleMonth} - */ - -/** - * @external GuildScheduledEventRecurrenceRuleWeekday - * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/GuildScheduledEventRecurrenceRuleWeekday} - */ - -/** - * @external MessageActivityType - * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/MessageActivityType} - */ - -/** - * @external NameplatePalette - * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/NameplatePalette} - */ - -/** - * @external PollLayoutType - * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/PollLayoutType} - */ - -/** - * @external ReactionType - * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ReactionType} - */ - -/** - * @external RtpPacket - * @see {@link https://github.com/shinyoshiaki/werift-webrtc/blob/develop/doc/classes/RtpPacket.md} - */ - -/** - * @external TeamMemberRole - * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/TeamMemberRole} - */ - -/** - * @external VoiceChannelEffectSendAnimationType - * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/VoiceChannelEffectSendAnimationType} - */ diff --git a/vendor/discord.js-selfbot-v13/src/util/ActivityFlags.js b/vendor/discord.js-selfbot-v13/src/util/ActivityFlags.js deleted file mode 100644 index 6d55621..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/ActivityFlags.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -const BitField = require('./BitField'); - -/** - * Data structure that makes it easy to interact with an {@link Activity#flags} bitfield. - * @extends {BitField} - */ -class ActivityFlags extends BitField {} - -/** - * @name ActivityFlags - * @kind constructor - * @memberof ActivityFlags - * @param {BitFieldResolvable} [bits=0] Bit(s) to read from - */ - -/** - * Numeric activity flags. All available properties: - * * `INSTANCE` - * * `JOIN` - * * `SPECTATE` - * * `JOIN_REQUEST` - * * `SYNC` - * * `PLAY` - * * `PARTY_PRIVACY_FRIENDS` - * * `PARTY_PRIVACY_VOICE_CHANNEL` - * * `EMBEDDED` - * @type {Object} - * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags} - */ -ActivityFlags.FLAGS = { - INSTANCE: 1 << 0, - JOIN: 1 << 1, - SPECTATE: 1 << 2, - JOIN_REQUEST: 1 << 3, - SYNC: 1 << 4, - PLAY: 1 << 5, - PARTY_PRIVACY_FRIENDS: 1 << 6, - PARTY_PRIVACY_VOICE_CHANNEL: 1 << 7, - EMBEDDED: 1 << 8, -}; - -module.exports = ActivityFlags; diff --git a/vendor/discord.js-selfbot-v13/src/util/ApplicationFlags.js b/vendor/discord.js-selfbot-v13/src/util/ApplicationFlags.js deleted file mode 100644 index cd3f825..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/ApplicationFlags.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - -const BitField = require('./BitField'); - -/** - * Data structure that makes it easy to interact with a {@link Application#flags} bitfield. - * @extends {BitField} - */ -class ApplicationFlags extends BitField {} - -/** - * @name ApplicationFlags - * @kind constructor - * @memberof ApplicationFlags - * @param {BitFieldResolvable} [bits=0] Bit(s) to read from - */ - -/** - * Bitfield of the packed bits - * @type {number} - * @name ApplicationFlags#bitfield - */ - -/** - * Numeric application flags. All available properties: - * * `EMBEDDED_RELEASED` - * * `MANAGED_EMOJI` - * * `GROUP_DM_CREATE` - * * `RPC_PRIVATE_BETA` - * * `APPLICATION_AUTO_MODERATION_RULE_CREATE_BADGE` - * * `ALLOW_ASSETS` - * * `ALLOW_ACTIVITY_ACTION_SPECTATE` - * * `ALLOW_ACTIVITY_ACTION_JOIN_REQUEST` - * * `RPC_HAS_CONNECTED` - * * `GATEWAY_PRESENCE` - * * `GATEWAY_PRESENCE_LIMITED` - * * `GATEWAY_GUILD_MEMBERS` - * * `GATEWAY_GUILD_MEMBERS_LIMITED` - * * `VERIFICATION_PENDING_GUILD_LIMIT` - * * `EMBEDDED` - * * `GATEWAY_MESSAGE_CONTENT` - * * `GATEWAY_MESSAGE_CONTENT_LIMITED` - * * `EMBEDDED_FIRST_PARTY` - * * `APPLICATION_COMMAND_BADGE` - * * `ACTIVE` - * * `IFRAME_MODAL` - * @type {Object} - * @see {@link https://discord.com/developers/docs/resources/application#application-object-application-flags} - * @see {@link https://flags.lewistehminerz.dev/} - */ -ApplicationFlags.FLAGS = { - EMBEDDED_RELEASED: 1 << 1, - MANAGED_EMOJI: 1 << 2, - EMBEDDED_IAP: 1 << 3, - GROUP_DM_CREATE: 1 << 4, - RPC_PRIVATE_BETA: 1 << 5, - APPLICATION_AUTO_MODERATION_RULE_CREATE_BADGE: 1 << 6, - ALLOW_ASSETS: 1 << 8, - ALLOW_ACTIVITY_ACTION_SPECTATE: 1 << 9, - ALLOW_ACTIVITY_ACTION_JOIN_REQUEST: 1 << 10, - RPC_HAS_CONNECTED: 1 << 11, - GATEWAY_PRESENCE: 1 << 12, - GATEWAY_PRESENCE_LIMITED: 1 << 13, - GATEWAY_GUILD_MEMBERS: 1 << 14, - GATEWAY_GUILD_MEMBERS_LIMITED: 1 << 15, - VERIFICATION_PENDING_GUILD_LIMIT: 1 << 16, - EMBEDDED: 1 << 17, - GATEWAY_MESSAGE_CONTENT: 1 << 18, - GATEWAY_MESSAGE_CONTENT_LIMITED: 1 << 19, - EMBEDDED_FIRST_PARTY: 1 << 20, - APPLICATION_COMMAND_BADGE: 1 << 23, - ACTIVE: 1 << 24, - IFRAME_MODAL: 1 << 26, -}; - -module.exports = ApplicationFlags; diff --git a/vendor/discord.js-selfbot-v13/src/util/AttachmentFlags.js b/vendor/discord.js-selfbot-v13/src/util/AttachmentFlags.js deleted file mode 100644 index fa94351..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/AttachmentFlags.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -const BitField = require('./BitField'); - -/** - * Data structure that makes it easy to interact with an {@link GuildMember#flags} bitfield. - * @extends {BitField} - */ -class AttachmentFlags extends BitField {} - -/** - * @name AttachmentFlags - * @kind constructor - * @memberof AttachmentFlags - * @param {BitFieldResolvable} [bits=0] Bit(s) to read from - */ - -/* eslint-disable max-len */ -/** - * Numeric guild member flags. All available properties: - * * `IS_REMIX` - * @type {Object} - * @see {@link https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure-attachment-flags} - */ -AttachmentFlags.FLAGS = { - IS_REMIX: 1 << 2, -}; - -/** - * Data that can be resolved to give a guild attachment bitfield. This can be: - * * A string (see {@link AttachmentFlags.FLAGS}) - * * A attachment flag - * * An instance of AttachmentFlags - * * An Array of AttachmentFlagsResolvable - * @typedef {string|number|AttachmentFlags|AttachmentFlagsResolvable[]} AttachmentFlagsResolvable - */ - -module.exports = AttachmentFlags; diff --git a/vendor/discord.js-selfbot-v13/src/util/BitField.js b/vendor/discord.js-selfbot-v13/src/util/BitField.js deleted file mode 100644 index ba75203..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/BitField.js +++ /dev/null @@ -1,184 +0,0 @@ -'use strict'; - -const { RangeError } = require('../errors'); - -/** - * Data structure that makes it easy to interact with a bitfield. - */ -class BitField { - /** - * @param {BitFieldResolvable} [bits=this.constructor.defaultBit] Bit(s) to read from - */ - constructor(bits = this.constructor.defaultBit) { - /** - * Bitfield of the packed bits - * @type {number|bigint} - */ - this.bitfield = this.constructor.resolve(bits); - } - - /** - * Checks whether the bitfield has a bit, or any of multiple bits. - * @param {BitFieldResolvable} bit Bit(s) to check for - * @returns {boolean} - */ - any(bit) { - return ( - (this.bitfield & this.constructor.resolve(bit)) !== - this.constructor.defaultBit - ); - } - - /** - * Checks if this bitfield equals another - * @param {BitFieldResolvable} bit Bit(s) to check for - * @returns {boolean} - */ - equals(bit) { - return this.bitfield === this.constructor.resolve(bit); - } - - /** - * Checks whether the bitfield has a bit, or multiple bits. - * @param {BitFieldResolvable} bit Bit(s) to check for - * @returns {boolean} - */ - has(bit) { - bit = this.constructor.resolve(bit); - return (this.bitfield & bit) === bit; - } - - /** - * Gets all given bits that are missing from the bitfield. - * @param {BitFieldResolvable} bits Bit(s) to check for - * @param {...*} hasParams Additional parameters for the has method, if any - * @returns {string[]} - */ - missing(bits, ...hasParams) { - return new this.constructor(bits).remove(this).toArray(...hasParams); - } - - /** - * Freezes these bits, making them immutable. - * @returns {Readonly} - */ - freeze() { - return Object.freeze(this); - } - - /** - * Adds bits to these ones. - * @param {...BitFieldResolvable} [bits] Bits to add - * @returns {BitField} These bits or new BitField if the instance is frozen. - */ - add(...bits) { - let total = this.constructor.defaultBit; - for (const bit of bits) { - total |= this.constructor.resolve(bit); - } - if (Object.isFrozen(this)) - return new this.constructor(this.bitfield | total); - this.bitfield |= total; - return this; - } - - /** - * Removes bits from these. - * @param {...BitFieldResolvable} [bits] Bits to remove - * @returns {BitField} These bits or new BitField if the instance is frozen. - */ - remove(...bits) { - let total = this.constructor.defaultBit; - for (const bit of bits) { - total |= this.constructor.resolve(bit); - } - if (Object.isFrozen(this)) - return new this.constructor(this.bitfield & ~total); - this.bitfield &= ~total; - return this; - } - - /** - * Gets an object mapping field names to a {@link boolean} indicating whether the - * bit is available. - * @param {...*} hasParams Additional parameters for the has method, if any - * @returns {Object} - */ - serialize(...hasParams) { - const serialized = {}; - for (const [flag, bit] of Object.entries(this.constructor.FLAGS)) - serialized[flag] = this.has(bit, ...hasParams); - return serialized; - } - - /** - * Gets an {@link Array} of bitfield names based on the bits available. - * @param {...*} hasParams Additional parameters for the has method, if any - * @returns {string[]} - */ - toArray(...hasParams) { - return Object.keys(this.constructor.FLAGS).filter((bit) => - this.has(bit, ...hasParams), - ); - } - - toJSON() { - return typeof this.bitfield === 'number' - ? this.bitfield - : this.bitfield.toString(); - } - - valueOf() { - return this.bitfield; - } - - *[Symbol.iterator]() { - yield* this.toArray(); - } - - /** - * Data that can be resolved to give a bitfield. This can be: - * * A bit number (this can be a number literal or a value taken from {@link BitField.FLAGS}) - * * A string bit number - * * An instance of BitField - * * An Array of BitFieldResolvable - * @typedef {number|string|bigint|BitField|BitFieldResolvable[]} BitFieldResolvable - */ - - /** - * Resolves bitfields to their numeric form. - * @param {BitFieldResolvable} [bit] bit(s) to resolve - * @returns {number|bigint} - */ - static resolve(bit) { - const { defaultBit } = this; - if (typeof defaultBit === typeof bit && bit >= defaultBit) return bit; - if (bit instanceof BitField) return bit.bitfield; - if (Array.isArray(bit)) - return bit - .map((p) => this.resolve(p)) - .reduce((prev, p) => prev | p, defaultBit); - if (typeof bit === 'string') { - if (!isNaN(bit)) - return typeof defaultBit === 'bigint' ? BigInt(bit) : Number(bit); - if (this.FLAGS[bit] !== undefined) return this.FLAGS[bit]; - } - throw new RangeError('BITFIELD_INVALID', bit); - } -} - -/** - * Numeric bitfield flags. - * Defined in extension classes - * @type {Object} - * @abstract - */ -BitField.FLAGS = {}; - -/** - * @type {number|bigint} - * @private - */ -BitField.defaultBit = 0; - -module.exports = BitField; diff --git a/vendor/discord.js-selfbot-v13/src/util/ChannelFlags.js b/vendor/discord.js-selfbot-v13/src/util/ChannelFlags.js deleted file mode 100644 index 2e5d809..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/ChannelFlags.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -const BitField = require('./BitField'); - -/** - * Data structure that makes it easy to interact with a {@link Channel#flags} bitfield. - * @extends {BitField} - */ -class ChannelFlags extends BitField {} - -/** - * Numeric guild channel flags. All available properties: - * * `PINNED` - * * `REQUIRE_TAG` - * @type {Object} - * @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-flags} - */ -ChannelFlags.FLAGS = { - PINNED: 1 << 1, - REQUIRE_TAG: 1 << 4, -}; - -/** - * @name ChannelFlags - * @kind constructor - * @memberof ChannelFlags - * @param {BitFieldResolvable} [bits=0] Bit(s) to read from - */ - -/** - * Bitfield of the packed bits - * @type {number} - * @name ChannelFlags#bitfield - */ - -/** - * Data that can be resolved to give a channel flag bitfield. This can be: - * * A string (see {@link ChannelFlags.FLAGS}) - * * A channel flag - * * An instance of ChannelFlags - * * An Array of ChannelFlags - * @typedef {string|number|ChannelFlags|ChannelFlagsResolvable[]} ChannelFlagsResolvable - */ - -module.exports = ChannelFlags; diff --git a/vendor/discord.js-selfbot-v13/src/util/Constants.js b/vendor/discord.js-selfbot-v13/src/util/Constants.js deleted file mode 100644 index 24ff860..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/Constants.js +++ /dev/null @@ -1,2064 +0,0 @@ -'use strict'; - -const { Error, RangeError, TypeError } = require('../errors'); - -/** - * Max bulk deletable message age - * @typedef {number} MaxBulkDeletableMessageAge - */ -exports.MaxBulkDeletableMessageAge = 1_209_600_000; - -exports.UserAgent = - 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) discord/1.0.9210 Chrome/134.0.6998.205 Electron/35.3.0 Safari/537.36'; - -/** - * Chrome TLS ciphers - * @see {@link https://tls.browserleaks.com/tls} - * @see {@link https://github.com/yifeikong/curl-impersonate} - * @typedef {Array} Ciphers - */ -exports.ciphers = [ - 'TLS_AES_128_GCM_SHA256', - 'TLS_AES_256_GCM_SHA384', - 'TLS_CHACHA20_POLY1305_SHA256', - 'ECDHE-ECDSA-AES128-GCM-SHA256', - 'ECDHE-RSA-AES128-GCM-SHA256', - 'ECDHE-ECDSA-AES256-GCM-SHA384', - 'ECDHE-RSA-AES256-GCM-SHA384', - 'ECDHE-ECDSA-CHACHA20-POLY1305', - 'ECDHE-RSA-CHACHA20-POLY1305', - 'ECDHE-RSA-AES128-SHA', - 'ECDHE-RSA-AES256-SHA', - 'AES128-GCM-SHA256', - 'AES256-GCM-SHA384', - 'AES128-SHA', - 'AES256-SHA', -]; - -/** - * The types of WebSocket error codes: - * * 1000: WS_CLOSE_REQUESTED - * * 1011: INTERNAL_ERROR - * * 4004: TOKEN_INVALID - * * 4010: SHARDING_INVALID - * * 4011: SHARDING_REQUIRED - * * 4013: INVALID_INTENTS - * * 4014: DISALLOWED_INTENTS - * @typedef {Object} WSCodes - */ -exports.WSCodes = { - 1000: 'WS_CLOSE_REQUESTED', - 1011: 'INTERNAL_ERROR', - 4004: 'TOKEN_INVALID', - 4010: 'SHARDING_INVALID', - 4011: 'SHARDING_REQUIRED', - 4013: 'INVALID_INTENTS', - 4014: 'DISALLOWED_INTENTS', -}; - -const AllowedImageFormats = ['webp', 'png', 'jpg', 'jpeg', 'gif']; - -const AllowedImageSizes = [ - 16, 32, 56, 64, 96, 128, 256, 300, 512, 600, 1024, 2048, 4096, -]; - -function makeImageUrl(root, { format = 'webp', size } = {}) { - if (!['undefined', 'number'].includes(typeof size)) - throw new TypeError('INVALID_TYPE', 'size', 'number'); - if (format && !AllowedImageFormats.includes(format)) - throw new Error('IMAGE_FORMAT', format); - if (size && !AllowedImageSizes.includes(size)) - throw new RangeError('IMAGE_SIZE', size); - return `${root}.${format}${size ? `?size=${size}` : ''}`; -} - -/** - * Options for Image URLs. - * @typedef {StaticImageURLOptions} ImageURLOptions - * @property {boolean} [dynamic=false] If true, the format will dynamically change to `gif` for animated avatars. - */ - -/** - * Options for static Image URLs. - * @typedef {Object} StaticImageURLOptions - * @property {string} [format='webp'] One of `webp`, `png`, `jpg`, `jpeg`. - * @property {number} [size] One of `16`, `32`, `56`, `64`, `96`, `128`, `256`, `300`, `512`, `600`, `1024`, `2048`, - * `4096` - */ - -/** - * An object containing functions that return certain endpoints on the API. - * @typedef {Object} Endpoints - * @see {@link https://discord.com/developers/docs/reference#image-formatting-cdn-endpoints} - */ -exports.Endpoints = { - CDN(root) { - return { - Emoji: (emojiId, format = 'webp') => - `${root}/emojis/${emojiId}.${format}`, - Asset: (name) => `${root}/assets/${name}`, - DefaultAvatar: (index) => `${root}/embed/avatars/${index}.png`, - Avatar: (userId, hash, format, size, dynamic = false) => { - if (dynamic && hash.startsWith('a_')) format = 'gif'; - return makeImageUrl(`${root}/avatars/${userId}/${hash}`, { - format, - size, - }); - }, - AvatarDecoration: (hash) => - makeImageUrl(`${root}/avatar-decoration-presets/${hash}`, { - format: 'png', - }), - GuildTagBadge: (guildId, hash) => - `${root}/guild-tag-badges/${guildId}/${hash}.png`, - GuildMemberAvatar: ( - guildId, - memberId, - hash, - format = 'webp', - size, - dynamic = false, - ) => { - if (dynamic && hash.startsWith('a_')) format = 'gif'; - return makeImageUrl( - `${root}/guilds/${guildId}/users/${memberId}/avatars/${hash}`, - { format, size }, - ); - }, - GuildMemberBanner: ( - guildId, - memberId, - hash, - format = 'webp', - size, - dynamic = false, - ) => { - if (dynamic && hash.startsWith('a_')) format = 'gif'; - return makeImageUrl( - `${root}/guilds/${guildId}/users/${memberId}/banners/${hash}`, - { format, size }, - ); - }, - Banner: (id, hash, format, size, dynamic = false) => { - if (dynamic && hash.startsWith('a_')) format = 'gif'; - return makeImageUrl(`${root}/banners/${id}/${hash}`, { format, size }); - }, - Icon: (guildId, hash, format, size, dynamic = false) => { - if (dynamic && hash.startsWith('a_')) format = 'gif'; - return makeImageUrl(`${root}/icons/${guildId}/${hash}`, { - format, - size, - }); - }, - AppIcon: (appId, hash, options) => - makeImageUrl(`${root}/app-icons/${appId}/${hash}`, options), - AppAsset: (appId, hash, options) => - makeImageUrl(`${root}/app-assets/${appId}/${hash}`, options), - StickerPackBanner: (bannerId, format, size) => - makeImageUrl( - `${root}/app-assets/710982414301790216/store/${bannerId}`, - { size, format }, - ), - GDMIcon: (channelId, hash, format, size) => - makeImageUrl(`${root}/channel-icons/${channelId}/${hash}`, { - size, - format, - }), - Splash: (guildId, hash, format, size) => - makeImageUrl(`${root}/splashes/${guildId}/${hash}`, { size, format }), - DiscoverySplash: (guildId, hash, format, size) => - makeImageUrl(`${root}/discovery-splashes/${guildId}/${hash}`, { - size, - format, - }), - TeamIcon: (teamId, hash, options) => - makeImageUrl(`${root}/team-icons/${teamId}/${hash}`, options), - Sticker: (stickerId, stickerFormat) => - `${root}/stickers/${stickerId}.${ - stickerFormat === 'LOTTIE' - ? 'json' - : stickerFormat === 'GIF' - ? 'gif' - : 'png' - }`, - RoleIcon: (roleId, hash, format = 'webp', size) => - makeImageUrl(`${root}/role-icons/${roleId}/${hash}`, { size, format }), - GuildScheduledEventCover: (scheduledEventId, coverHash, format, size) => - makeImageUrl(`${root}/guild-events/${scheduledEventId}/${coverHash}`, { - size, - format, - }), - }; - }, - invite: (root, code, eventId) => - eventId ? `${root}/${code}?event=${eventId}` : `${root}/${code}`, - scheduledEvent: (root, guildId, eventId) => `${root}/${guildId}/${eventId}`, - botGateway: '/gateway', -}; - -/** - * The current status of the client. Here are the available statuses: - * * READY: 0 - * * CONNECTING: 1 - * * RECONNECTING: 2 - * * IDLE: 3 - * * NEARLY: 4 - * * DISCONNECTED: 5 - * * WAITING_FOR_GUILDS: 6 - * * IDENTIFYING: 7 - * * RESUMING: 8 - * @typedef {Object} Status - */ -exports.Status = { - READY: 0, - CONNECTING: 1, - RECONNECTING: 2, - IDLE: 3, - NEARLY: 4, - DISCONNECTED: 5, - WAITING_FOR_GUILDS: 6, - IDENTIFYING: 7, - RESUMING: 8, -}; - -/** - * The current status of a voice connection. Here are the available statuses: - * * CONNECTED: 0 - * * CONNECTING: 1 - * * AUTHENTICATING: 2 - * * RECONNECTING: 3 - * * DISCONNECTED: 4 - * @typedef {number} VoiceStatus - */ -exports.VoiceStatus = { - CONNECTED: 0, - CONNECTING: 1, - AUTHENTICATING: 2, - RECONNECTING: 3, - DISCONNECTED: 4, -}; - -/** - * The Opcodes sent to the Gateway: - * * DISPATCH: 0 - * * HEARTBEAT: 1 - * * IDENTIFY: 2 - * * STATUS_UPDATE: 3 - * * VOICE_STATE_UPDATE: 4 - * * VOICE_GUILD_PING: 5 - * * RESUME: 6 - * * RECONNECT: 7 - * * REQUEST_GUILD_MEMBERS: 8 - * * INVALID_SESSION: 9 - * * HELLO: 10 - * * HEARTBEAT_ACK: 11 - * * GUILD_SYNC: 12 [Unused] - * * DM_UPDATE: 13 # Send => used to get dm features - * * GUILD_SUBSCRIPTIONS: 14 # Send => discord responds back with GUILD_MEMBER_LIST_UPDATE type SYNC... - * * LOBBY_CONNECT: 15 - * * LOBBY_DISCONNECT: 16 - * * LOBBY_VOICE_STATE_UPDATE: 17 # Receive - * * STREAM_CREATE: 18 - * * STREAM_DELETE: 19 - * * STREAM_WATCH: 20 - * * STREAM_PING: 21 # Send - * * STREAM_SET_PAUSED: 22 - * * LFG_SUBSCRIPTIONS: 23 [Unused] - * * REQUEST_GUILD_APPLICATION_COMMANDS: 24 [Unused] - * * EMBEDDED_ACTIVITY_LAUNCH: 25 => Launch an embedded activity in a voice channel or call. - * * EMBEDDED_ACTIVITY_CLOSE: 26 => Stop an embedded activity. - * * EMBEDDED_ACTIVITY_UPDATE: 27 => Update an embedded activity. - * * REQUEST_FORUM_UNREADS: 28 => Request forum channel unread counts. - * * REMOTE_COMMAND: 29 => Send a remote command to an embedded (Xbox, PlayStation) voice session. - * * GET_DELETED_ENTITY_IDS_NOT_MATCHING_HASH: 30 => Request deleted entity IDs not matching a given hash for a guild. - * * REQUEST_SOUNDBOARD_SOUNDS: 31 - * * SPEED_TEST_CREATE: 32 => Create a voice speed test. - * * SPEED_TEST_DELETE: 33 => Delete a voice speed test. - * * REQUEST_LAST_MESSAGES: 34 => Request last messages for a guild's channels. - * * SEARCH_RECENT_MEMBERS: 35 => ~ Opcode 8 (Member Safety) - * * REQUEST_CHANNEL_STATUSES: 36 => Request Voice Channel status. - * * GUILD_SUBSCRIPTIONS_BULK: 37 => ~ Opcode 14 - * @typedef {Object} Opcodes - */ -exports.Opcodes = { - DISPATCH: 0, - HEARTBEAT: 1, - IDENTIFY: 2, - STATUS_UPDATE: 3, - VOICE_STATE_UPDATE: 4, - VOICE_GUILD_PING: 5, - RESUME: 6, - RECONNECT: 7, - REQUEST_GUILD_MEMBERS: 8, - INVALID_SESSION: 9, - HELLO: 10, - HEARTBEAT_ACK: 11, - GUILD_SYNC: 12, - DM_UPDATE: 13, - GUILD_SUBSCRIPTIONS: 14, - LOBBY_CONNECT: 15, - LOBBY_DISCONNECT: 16, - LOBBY_VOICE_STATE_UPDATE: 17, - STREAM_CREATE: 18, - STREAM_DELETE: 19, - STREAM_WATCH: 20, - STREAM_PING: 21, - STREAM_SET_PAUSED: 22, - REQUEST_GUILD_APPLICATION_COMMANDS: 24, - EMBEDDED_ACTIVITY_LAUNCH: 25, - EMBEDDED_ACTIVITY_CLOSE: 26, - EMBEDDED_ACTIVITY_UPDATE: 27, - REQUEST_FORUM_UNREADS: 28, // Payload: { guild_id: Snowflake, channel_id: Snowflake, threads: { thread_id: Snowflake, ack_message_id: Snowflake }[] } - REMOTE_COMMAND: 29, // Payload: { target_session_id: string, payload: any } - GET_DELETED_ENTITY_IDS_NOT_MATCHING_HASH: 30, // Payload: { guild_id: Snowflake, channel_ids_hash: string[], role_ids_hash: string[], emoji_ids_hash: string[], sticker_ids_hash: string[] } - REQUEST_SOUNDBOARD_SOUNDS: 31, // Payload: { guild_ids: string[] } - SPEED_TEST_CREATE: 32, // Payload: { preferred_region: string } - SPEED_TEST_DELETE: 33, // Payload: null - REQUEST_LAST_MESSAGES: 34, // Payload: { guild_id: string, channel_ids: string[] } - SEARCH_RECENT_MEMBERS: 35, // Payload: { guild_id: string, query: string, continuation_token?: Snowflake } - REQUEST_CHANNEL_STATUSES: 36, // Payload: { guild_id: string } | Response: CHANNEL_STATUSES | { guild_id, channels: { status, id }[] } - GUILD_SUBSCRIPTIONS_BULK: 37, // Payload: { subscriptions: Object } | Response: Opcode 14 - // Updated: 23/1/2024 -}; - -/** - * @typedef {Opject} VoiceOpcodes - */ -exports.VoiceOpcodes = { - IDENTIFY: 0, - SELECT_PROTOCOL: 1, - READY: 2, - HEARTBEAT: 3, - SESSION_DESCRIPTION: 4, - SPEAKING: 5, - HEARTBEAT_ACK: 6, - RESUME: 7, - HELLO: 8, - RESUMED: 9, - SOURCES: 12, - CLIENT_DISCONNECT: 13, - SESSION_UPDATE: 14, - MEDIA_SINK_WANTS: 15, - VOICE_BACKEND_VERSION: 16, - CHANNEL_OPTIONS_UPDATE: 17, -}; - -/** - * The types of events emitted by the Client: - * * RATE_LIMIT: rateLimit - * * INVALID_REQUEST_WARNING: invalidRequestWarning - * * API_RESPONSE: apiResponse - * * API_REQUEST: apiRequest - * * CLIENT_READY: ready - * * APPLICATION_COMMAND_CREATE: applicationCommandCreate (deprecated) - * * APPLICATION_COMMAND_DELETE: applicationCommandDelete (deprecated) - * * APPLICATION_COMMAND_UPDATE: applicationCommandUpdate (deprecated) - * * APPLICATION_COMMAND_PERMISSIONS_UPDATE: applicationCommandPermissionsUpdate - * * AUTO_MODERATION_ACTION_EXECUTION: autoModerationActionExecution - * * AUTO_MODERATION_RULE_CREATE: autoModerationRuleCreate - * * AUTO_MODERATION_RULE_DELETE: autoModerationRuleDelete - * * AUTO_MODERATION_RULE_UPDATE: autoModerationRuleUpdate - * * GUILD_AVAILABLE: guildAvailable - * * GUILD_CREATE: guildCreate - * * GUILD_DELETE: guildDelete - * * GUILD_UPDATE: guildUpdate - * * GUILD_UNAVAILABLE: guildUnavailable - * * GUILD_MEMBER_ADD: guildMemberAdd - * * GUILD_MEMBER_REMOVE: guildMemberRemove - * * GUILD_MEMBER_UPDATE: guildMemberUpdate - * * GUILD_MEMBER_AVAILABLE: guildMemberAvailable - * * GUILD_MEMBERS_CHUNK: guildMembersChunk - * * GUILD_INTEGRATIONS_UPDATE: guildIntegrationsUpdate - * * GUILD_ROLE_CREATE: roleCreate - * * GUILD_ROLE_DELETE: roleDelete - * * INVITE_CREATE: inviteCreate - * * INVITE_DELETE: inviteDelete - * * GUILD_ROLE_UPDATE: roleUpdate - * * GUILD_EMOJI_CREATE: emojiCreate - * * GUILD_EMOJI_DELETE: emojiDelete - * * GUILD_EMOJI_UPDATE: emojiUpdate - * * GUILD_BAN_ADD: guildBanAdd - * * GUILD_BAN_REMOVE: guildBanRemove - * * CHANNEL_CREATE: channelCreate - * * CHANNEL_DELETE: channelDelete - * * CHANNEL_UPDATE: channelUpdate - * * CHANNEL_PINS_UPDATE: channelPinsUpdate - * * MESSAGE_CREATE: messageCreate - * * MESSAGE_DELETE: messageDelete - * * MESSAGE_UPDATE: messageUpdate - * * MESSAGE_BULK_DELETE: messageDeleteBulk - * * MESSAGE_REACTION_ADD: messageReactionAdd - * * MESSAGE_REACTION_REMOVE: messageReactionRemove - * * MESSAGE_REACTION_REMOVE_ALL: messageReactionRemoveAll - * * MESSAGE_REACTION_REMOVE_EMOJI: messageReactionRemoveEmoji - * * THREAD_CREATE: threadCreate - * * THREAD_DELETE: threadDelete - * * THREAD_UPDATE: threadUpdate - * * THREAD_LIST_SYNC: threadListSync - * * THREAD_MEMBER_UPDATE: threadMemberUpdate - * * THREAD_MEMBERS_UPDATE: threadMembersUpdate - * * USER_UPDATE: userUpdate - * * PRESENCE_UPDATE: presenceUpdate - * * VOICE_SERVER_UPDATE: voiceServerUpdate - * * VOICE_STATE_UPDATE: voiceStateUpdate - * * TYPING_START: typingStart - * * WEBHOOKS_UPDATE: webhookUpdate - * * ERROR: error - * * WARN: warn - * * DEBUG: debug - * * CACHE_SWEEP: cacheSweep - * * SHARD_DISCONNECT: shardDisconnect - * * SHARD_ERROR: shardError - * * SHARD_RECONNECTING: shardReconnecting - * * SHARD_READY: shardReady - * * SHARD_RESUME: shardResume - * * INVALIDATED: invalidated - * * RAW: raw - * * STAGE_INSTANCE_CREATE: stageInstanceCreate - * * STAGE_INSTANCE_UPDATE: stageInstanceUpdate - * * STAGE_INSTANCE_DELETE: stageInstanceDelete - * * GUILD_STICKER_CREATE: stickerCreate - * * GUILD_STICKER_DELETE: stickerDelete - * * GUILD_STICKER_UPDATE: stickerUpdate - * * GUILD_SCHEDULED_EVENT_CREATE: guildScheduledEventCreate - * * GUILD_SCHEDULED_EVENT_UPDATE: guildScheduledEventUpdate - * * GUILD_SCHEDULED_EVENT_DELETE: guildScheduledEventDelete - * * GUILD_SCHEDULED_EVENT_USER_ADD: guildScheduledEventUserAdd - * * GUILD_SCHEDULED_EVENT_USER_REMOVE: guildScheduledEventUserRemove - * * GUILD_AUDIT_LOG_ENTRY_CREATE: guildAuditLogEntryCreate - * * UNHANDLED_PACKET: unhandledPacket - * * RELATIONSHIP_ADD: relationshipAdd - * * RELATIONSHIP_REMOVE: relationshipRemove - * * RELATIONSHIP_UPDATE: relationshipUpdate - * * CHANNEL_RECIPIENT_ADD: channelRecipientAdd - * * CHANNEL_RECIPIENT_REMOVE: channelRecipientRemove - * * INTERACTION_MODAL_CREATE: interactionModalCreate - * * CALL_CREATE: callCreate - * * CALL_UPDATE: callUpdate - * * CALL_DELETE: callDelete - * * VOICE_CHANNEL_EFFECT_SEND: voiceChannelEffectSend - * @typedef {Object} Events - */ -exports.Events = { - RATE_LIMIT: 'rateLimit', - INVALID_REQUEST_WARNING: 'invalidRequestWarning', - API_RESPONSE: 'apiResponse', - API_REQUEST: 'apiRequest', - CLIENT_READY: 'ready', - APPLICATION_COMMAND_CREATE: 'applicationCommandCreate', - APPLICATION_COMMAND_DELETE: 'applicationCommandDelete', - APPLICATION_COMMAND_UPDATE: 'applicationCommandUpdate', - APPLICATION_COMMAND_PERMISSIONS_UPDATE: 'applicationCommandPermissionsUpdate', - AUTO_MODERATION_ACTION_EXECUTION: 'autoModerationActionExecution', - AUTO_MODERATION_RULE_CREATE: 'autoModerationRuleCreate', - AUTO_MODERATION_RULE_DELETE: 'autoModerationRuleDelete', - AUTO_MODERATION_RULE_UPDATE: 'autoModerationRuleUpdate', - GUILD_AVAILABLE: 'guildAvailable', - GUILD_CREATE: 'guildCreate', - GUILD_DELETE: 'guildDelete', - GUILD_UPDATE: 'guildUpdate', - GUILD_UNAVAILABLE: 'guildUnavailable', - GUILD_MEMBER_ADD: 'guildMemberAdd', - GUILD_MEMBER_REMOVE: 'guildMemberRemove', - GUILD_MEMBER_UPDATE: 'guildMemberUpdate', - GUILD_MEMBER_AVAILABLE: 'guildMemberAvailable', - GUILD_MEMBERS_CHUNK: 'guildMembersChunk', - GUILD_INTEGRATIONS_UPDATE: 'guildIntegrationsUpdate', - GUILD_ROLE_CREATE: 'roleCreate', - GUILD_ROLE_DELETE: 'roleDelete', - INVITE_CREATE: 'inviteCreate', - INVITE_DELETE: 'inviteDelete', - GUILD_ROLE_UPDATE: 'roleUpdate', - GUILD_EMOJI_CREATE: 'emojiCreate', - GUILD_EMOJI_DELETE: 'emojiDelete', - GUILD_EMOJI_UPDATE: 'emojiUpdate', - GUILD_BAN_ADD: 'guildBanAdd', - GUILD_BAN_REMOVE: 'guildBanRemove', - CHANNEL_CREATE: 'channelCreate', - CHANNEL_DELETE: 'channelDelete', - CHANNEL_UPDATE: 'channelUpdate', - CHANNEL_PINS_UPDATE: 'channelPinsUpdate', - MESSAGE_CREATE: 'messageCreate', - MESSAGE_DELETE: 'messageDelete', - MESSAGE_UPDATE: 'messageUpdate', - MESSAGE_BULK_DELETE: 'messageDeleteBulk', - MESSAGE_REACTION_ADD: 'messageReactionAdd', - MESSAGE_REACTION_REMOVE: 'messageReactionRemove', - MESSAGE_REACTION_REMOVE_ALL: 'messageReactionRemoveAll', - MESSAGE_REACTION_REMOVE_EMOJI: 'messageReactionRemoveEmoji', - THREAD_CREATE: 'threadCreate', - THREAD_DELETE: 'threadDelete', - THREAD_UPDATE: 'threadUpdate', - THREAD_LIST_SYNC: 'threadListSync', - THREAD_MEMBER_UPDATE: 'threadMemberUpdate', - THREAD_MEMBERS_UPDATE: 'threadMembersUpdate', - USER_UPDATE: 'userUpdate', - PRESENCE_UPDATE: 'presenceUpdate', - VOICE_SERVER_UPDATE: 'voiceServerUpdate', - VOICE_STATE_UPDATE: 'voiceStateUpdate', - TYPING_START: 'typingStart', - WEBHOOKS_UPDATE: 'webhookUpdate', - ERROR: 'error', - WARN: 'warn', - DEBUG: 'debug', - CACHE_SWEEP: 'cacheSweep', - SHARD_DISCONNECT: 'shardDisconnect', - SHARD_ERROR: 'shardError', - SHARD_RECONNECTING: 'shardReconnecting', - SHARD_READY: 'shardReady', - SHARD_RESUME: 'shardResume', - INVALIDATED: 'invalidated', - RAW: 'raw', - STAGE_INSTANCE_CREATE: 'stageInstanceCreate', - STAGE_INSTANCE_UPDATE: 'stageInstanceUpdate', - STAGE_INSTANCE_DELETE: 'stageInstanceDelete', - GUILD_STICKER_CREATE: 'stickerCreate', - GUILD_STICKER_DELETE: 'stickerDelete', - GUILD_STICKER_UPDATE: 'stickerUpdate', - GUILD_SCHEDULED_EVENT_CREATE: 'guildScheduledEventCreate', - GUILD_SCHEDULED_EVENT_UPDATE: 'guildScheduledEventUpdate', - GUILD_SCHEDULED_EVENT_DELETE: 'guildScheduledEventDelete', - GUILD_SCHEDULED_EVENT_USER_ADD: 'guildScheduledEventUserAdd', - GUILD_SCHEDULED_EVENT_USER_REMOVE: 'guildScheduledEventUserRemove', - GUILD_AUDIT_LOG_ENTRY_CREATE: 'guildAuditLogEntryCreate', - UNHANDLED_PACKET: 'unhandledPacket', - RELATIONSHIP_ADD: 'relationshipAdd', - RELATIONSHIP_UPDATE: 'relationshipUpdate', - RELATIONSHIP_REMOVE: 'relationshipRemove', - CHANNEL_RECIPIENT_ADD: 'channelRecipientAdd', - CHANNEL_RECIPIENT_REMOVE: 'channelRecipientRemove', - INTERACTION_MODAL_CREATE: 'interactionModalCreate', - CALL_CREATE: 'callCreate', - CALL_UPDATE: 'callUpdate', - CALL_DELETE: 'callDelete', - MESSAGE_POLL_VOTE_ADD: 'messagePollVoteAdd', - MESSAGE_POLL_VOTE_REMOVE: 'messagePollVoteRemove', - VOICE_CHANNEL_EFFECT_SEND: 'voiceChannelEffectSend', - // Djs v12 - VOICE_BROADCAST_SUBSCRIBE: 'subscribe', - VOICE_BROADCAST_UNSUBSCRIBE: 'unsubscribe', -}; - -/** - * The types of events emitted by a Shard: - * * CLOSE: close - * * DESTROYED: destroyed - * * INVALID_SESSION: invalidSession - * * READY: ready - * * RESUMED: resumed - * * ALL_READY: allReady - * @typedef {Object} ShardEvents - */ -exports.ShardEvents = { - CLOSE: 'close', - DESTROYED: 'destroyed', - INVALID_SESSION: 'invalidSession', - READY: 'ready', - RESUMED: 'resumed', - ALL_READY: 'allReady', -}; - -/** - * The type of Structure allowed to be a partial: - * * USER - * * CHANNEL (only affects DMChannels) - * * GUILD_MEMBER - * * MESSAGE - * * REACTION - * * GUILD_SCHEDULED_EVENT - * Partials require you to put checks in place when handling data. See the "Partial Structures" topic on the - * [guide](https://discordjs.guide/popular-topics/partials.html) for more information. - * @typedef {string} PartialType - */ -exports.PartialTypes = keyMirror([ - 'USER', - 'CHANNEL', - 'GUILD_MEMBER', - 'MESSAGE', - 'REACTION', - 'GUILD_SCHEDULED_EVENT', -]); - -/** - * The type of a WebSocket message event, e.g. `MESSAGE_CREATE`. Here are the available events: - * * READY - * * RESUMED - * * APPLICATION_COMMAND_CREATE (deprecated) - * * APPLICATION_COMMAND_DELETE (deprecated) - * * APPLICATION_COMMAND_PERMISSIONS_UPDATE - * * APPLICATION_COMMAND_UPDATE (deprecated) - * * AUTO_MODERATION_ACTION_EXECUTION - * * AUTO_MODERATION_RULE_CREATE - * * AUTO_MODERATION_RULE_DELETE - * * AUTO_MODERATION_RULE_UPDATE - * * GUILD_CREATE - * * GUILD_DELETE - * * GUILD_UPDATE - * * INVITE_CREATE - * * INVITE_DELETE - * * GUILD_MEMBER_ADD - * * GUILD_MEMBER_REMOVE - * * GUILD_MEMBER_UPDATE - * * GUILD_MEMBERS_CHUNK - * * GUILD_INTEGRATIONS_UPDATE - * * GUILD_ROLE_CREATE - * * GUILD_ROLE_DELETE - * * GUILD_ROLE_UPDATE - * * GUILD_BAN_ADD - * * GUILD_BAN_REMOVE - * * GUILD_EMOJIS_UPDATE - * * CHANNEL_CREATE - * * CHANNEL_DELETE - * * CHANNEL_UPDATE - * * CHANNEL_PINS_UPDATE - * * MESSAGE_CREATE - * * MESSAGE_DELETE - * * MESSAGE_UPDATE - * * MESSAGE_DELETE_BULK - * * MESSAGE_REACTION_ADD - * * MESSAGE_REACTION_REMOVE - * * MESSAGE_REACTION_REMOVE_ALL - * * MESSAGE_REACTION_REMOVE_EMOJI - * * THREAD_CREATE - * * THREAD_UPDATE - * * THREAD_DELETE - * * THREAD_LIST_SYNC - * * THREAD_MEMBER_UPDATE - * * THREAD_MEMBERS_UPDATE - * * USER_UPDATE - * * PRESENCE_UPDATE - * * TYPING_START - * * VOICE_STATE_UPDATE - * * VOICE_SERVER_UPDATE - * * WEBHOOKS_UPDATE - * * STAGE_INSTANCE_CREATE - * * STAGE_INSTANCE_UPDATE - * * STAGE_INSTANCE_DELETE - * * GUILD_STICKERS_UPDATE - * * GUILD_SCHEDULED_EVENT_CREATE - * * GUILD_SCHEDULED_EVENT_UPDATE - * * GUILD_SCHEDULED_EVENT_DELETE - * * GUILD_SCHEDULED_EVENT_USER_ADD - * * GUILD_SCHEDULED_EVENT_USER_REMOVE - * * GUILD_AUDIT_LOG_ENTRY_CREATE - * @typedef {string} WSEventType - * @see {@link https://discord.com/developers/docs/topics/gateway-events#receive-events} - */ -exports.WSEvents = keyMirror([ - 'READY', - 'RESUMED', - 'APPLICATION_COMMAND_CREATE', - 'APPLICATION_COMMAND_DELETE', - 'APPLICATION_COMMAND_UPDATE', - 'APPLICATION_COMMAND_PERMISSIONS_UPDATE', - 'AUTO_MODERATION_ACTION_EXECUTION', - 'AUTO_MODERATION_RULE_CREATE', - 'AUTO_MODERATION_RULE_DELETE', - 'AUTO_MODERATION_RULE_UPDATE', - 'GUILD_CREATE', - 'GUILD_DELETE', - 'GUILD_UPDATE', - 'INVITE_CREATE', - 'INVITE_DELETE', - 'GUILD_MEMBER_ADD', - 'GUILD_MEMBER_REMOVE', - 'GUILD_MEMBER_UPDATE', - 'GUILD_MEMBERS_CHUNK', - 'GUILD_INTEGRATIONS_UPDATE', - 'GUILD_ROLE_CREATE', - 'GUILD_ROLE_DELETE', - 'GUILD_ROLE_UPDATE', - 'GUILD_BAN_ADD', - 'GUILD_BAN_REMOVE', - 'GUILD_EMOJIS_UPDATE', - 'CHANNEL_CREATE', - 'CHANNEL_DELETE', - 'CHANNEL_UPDATE', - 'CHANNEL_PINS_UPDATE', - 'MESSAGE_CREATE', - 'MESSAGE_DELETE', - 'MESSAGE_UPDATE', - 'MESSAGE_DELETE_BULK', - 'MESSAGE_REACTION_ADD', - 'MESSAGE_REACTION_REMOVE', - 'MESSAGE_REACTION_REMOVE_ALL', - 'MESSAGE_REACTION_REMOVE_EMOJI', - 'THREAD_CREATE', - 'THREAD_UPDATE', - 'THREAD_DELETE', - 'THREAD_LIST_SYNC', - 'THREAD_MEMBER_UPDATE', - 'THREAD_MEMBERS_UPDATE', - 'USER_UPDATE', - 'PRESENCE_UPDATE', - 'TYPING_START', - 'VOICE_STATE_UPDATE', - 'VOICE_SERVER_UPDATE', - 'WEBHOOKS_UPDATE', - 'STAGE_INSTANCE_CREATE', - 'STAGE_INSTANCE_UPDATE', - 'STAGE_INSTANCE_DELETE', - 'GUILD_STICKERS_UPDATE', - 'GUILD_SCHEDULED_EVENT_CREATE', - 'GUILD_SCHEDULED_EVENT_UPDATE', - 'GUILD_SCHEDULED_EVENT_DELETE', - 'GUILD_SCHEDULED_EVENT_USER_ADD', - 'GUILD_SCHEDULED_EVENT_USER_REMOVE', - 'GUILD_AUDIT_LOG_ENTRY_CREATE', -]); - -/** - * A valid scope to request when generating an invite link. - * Scopes that require whitelist are not considered valid for this generator - * * `applications.builds.read`: allows reading build data for a users applications - * * `applications.commands`: allows this bot to create commands in the server - * * `applications.entitlements`: allows reading entitlements for a users applications - * * `applications.store.update`: allows reading and updating of store data for a users applications - * * `bot`: makes the bot join the selected guild - * * `connections`: makes the endpoint for getting a users connections available - * * `email`: allows the `/users/@me` endpoint return with an email - * * `identify`: allows the `/users/@me` endpoint without an email - * * `guilds`: makes the `/users/@me/guilds` endpoint available for a user - * * `guilds.join`: allows the bot to join the user to any guild it is in using Guild#addMember - * * `gdm.join`: allows joining the user to a group dm - * * `webhook.incoming`: generates a webhook to a channel - * * `role_connections.write`: allows your app to update a user's connection and metadata for the app - * @typedef {string} InviteScope - * @see {@link https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes} - */ -exports.InviteScopes = [ - 'applications.builds.read', - 'applications.commands', - 'applications.entitlements', - 'applications.store.update', - 'bot', - 'connections', - 'email', - 'identify', - 'guilds', - 'guilds.join', - 'gdm.join', - 'webhook.incoming', - 'role_connections.write', -]; - -// TODO: change Integration#expireBehavior to this and clean up Integration -/** - * The behavior of expiring subscribers for Integrations. This can be: - * * REMOVE_ROLE - * * KICK - * @typedef {string} IntegrationExpireBehavior - * @see {@link https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors} - */ -exports.IntegrationExpireBehaviors = createEnum(['REMOVE_ROLE', 'KICK']); - -/** - * The type of a message, e.g. `DEFAULT`. Here are the available types: - * * DEFAULT - * * RECIPIENT_ADD - * * RECIPIENT_REMOVE - * * CALL - * * CHANNEL_NAME_CHANGE - * * CHANNEL_ICON_CHANGE - * * CHANNEL_PINNED_MESSAGE - * * GUILD_MEMBER_JOIN - * * USER_PREMIUM_GUILD_SUBSCRIPTION - * * USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1 - * * USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2 - * * USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3 - * * CHANNEL_FOLLOW_ADD - * * GUILD_DISCOVERY_DISQUALIFIED - * * GUILD_DISCOVERY_REQUALIFIED - * * GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING - * * GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING - * * THREAD_CREATED - * * REPLY - * * APPLICATION_COMMAND - * * THREAD_STARTER_MESSAGE - * * GUILD_INVITE_REMINDER - * * CONTEXT_MENU_COMMAND - * * AUTO_MODERATION_ACTION - * * ROLE_SUBSCRIPTION_PURCHASE - * * INTERACTION_PREMIUM_UPSELL - * * STAGE_START - * * STAGE_END - * * STAGE_SPEAKER - * * STAGE_RAISE_HAND - * * STAGE_TOPIC - * * GUILD_APPLICATION_PREMIUM_SUBSCRIPTION - * * PREMIUM_REFERRAL - * * GUILD_INCIDENT_ALERT_MODE_ENABLED - * * GUILD_INCIDENT_ALERT_MODE_DISABLED - * * GUILD_INCIDENT_REPORT_RAID - * * GUILD_INCIDENT_REPORT_FALSE_ALARM - * * GUILD_DEADCHAT_REVIVE_PROMPT - * * CUSTOM_GIFT - * * GUILD_GAMING_STATS_PROMPT - * * PURCHASE_NOTIFICATION - * * POLL_RESULT - * * CHANGELOG - * * NITRO_NOTIFICATION - * @typedef {string} MessageType - * @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-types} - * @see {@link https://docs.discord.food/resources/message#message-type} - */ -exports.MessageTypes = [ - 'DEFAULT', // 0 - 'RECIPIENT_ADD', - 'RECIPIENT_REMOVE', - 'CALL', - 'CHANNEL_NAME_CHANGE', - 'CHANNEL_ICON_CHANGE', - 'CHANNEL_PINNED_MESSAGE', - 'GUILD_MEMBER_JOIN', - 'USER_PREMIUM_GUILD_SUBSCRIPTION', - 'USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1', - 'USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2', - 'USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3', - 'CHANNEL_FOLLOW_ADD', - null, // 13 - 'GUILD_DISCOVERY_DISQUALIFIED', - 'GUILD_DISCOVERY_REQUALIFIED', - 'GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING', - 'GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING', - 'THREAD_CREATED', - 'REPLY', - 'APPLICATION_COMMAND', - 'THREAD_STARTER_MESSAGE', - 'GUILD_INVITE_REMINDER', - 'CONTEXT_MENU_COMMAND', - 'AUTO_MODERATION_ACTION', - 'ROLE_SUBSCRIPTION_PURCHASE', - 'INTERACTION_PREMIUM_UPSELL', - 'STAGE_START', - 'STAGE_END', - 'STAGE_SPEAKER', - 'STAGE_RAISE_HAND', - 'STAGE_TOPIC', - 'GUILD_APPLICATION_PREMIUM_SUBSCRIPTION', - null, // 33 - null, - 'PREMIUM_REFERRAL', - 'GUILD_INCIDENT_ALERT_MODE_ENABLED', - 'GUILD_INCIDENT_ALERT_MODE_DISABLED', - 'GUILD_INCIDENT_REPORT_RAID', - 'GUILD_INCIDENT_REPORT_FALSE_ALARM', - 'GUILD_DEADCHAT_REVIVE_PROMPT', - 'CUSTOM_GIFT', - 'GUILD_GAMING_STATS_PROMPT', - null, - 'PURCHASE_NOTIFICATION', - null, - 'POLL_RESULT', - 'CHANGELOG', - 'NITRO_NOTIFICATION', -]; - -/** - * The type of a message reference, e.g. `DEFAULT`. Here are the available types: - * * DEFAULT - * * FORWARD - * @typedef {string} MessageReferenceType - * @see {@link https://discord.com/developers/docs/resources/message#message-reference-types} - */ -exports.MessageReferenceTypes = createEnum([ - 'DEFAULT', // 0 - 'FORWARD', -]); - -/** - * The name of an item to be swept in Sweepers - * * `applicationCommands` - both global and guild commands - * * `autoModerationRules` - * * `bans` - * * `emojis` - * * `invites` - accepts the `lifetime` property, using it will sweep based on expires timestamp - * * `guildMembers` - * * `messages` - accepts the `lifetime` property, using it will sweep based on edited or created timestamp - * * `presences` - * * `reactions` - * * `stageInstances` - * * `stickers` - * * `threadMembers` - * * `threads` - accepts the `lifetime` property, using it will sweep archived threads based on archived timestamp - * * `users` - * * `voiceStates` - * @typedef {string} SweeperKey - */ -exports.SweeperKeys = [ - 'applicationCommands', - 'autoModerationRules', - 'bans', - 'emojis', - 'invites', - 'guildMembers', - 'messages', - 'presences', - 'reactions', - 'stageInstances', - 'stickers', - 'threadMembers', - 'threads', - 'users', - 'voiceStates', -]; - -/** - * The types of messages that are `System`. The available types are `MessageTypes` excluding: - * * DEFAULT - * * REPLY - * * APPLICATION_COMMAND - * * CONTEXT_MENU_COMMAND - * @typedef {string} SystemMessageType - */ -exports.SystemMessageTypes = exports.MessageTypes.filter( - (type) => - type && - ![ - 'DEFAULT', - 'REPLY', - 'APPLICATION_COMMAND', - 'CONTEXT_MENU_COMMAND', - ].includes(type), -); - -/** - * Bots cannot set a `CUSTOM` activity type, it is only for custom statuses received from users - * The type of an activity of a user's presence. Here are the available types: - * * PLAYING - * * STREAMING - * * LISTENING - * * WATCHING - * * CUSTOM - * * COMPETING - * * HANG - * @typedef {string} ActivityType - * @see {@link https://discord.com/developers/docs/game-sdk/activities#data-models-activitytype-enum} - */ -exports.ActivityTypes = createEnum([ - 'PLAYING', - 'STREAMING', - 'LISTENING', - 'WATCHING', - 'CUSTOM', - 'COMPETING', - 'HANG', -]); - -/** - * All available channel types: - * * `GUILD_TEXT` - a guild text channel - * * `DM` - a DM channel - * * `GUILD_VOICE` - a guild voice channel - * * `GROUP_DM` - a group DM channel - * * `GUILD_CATEGORY` - a guild category channel - * * `GUILD_NEWS` - a guild news channel - * * `GUILD_STORE` - a guild store channel - * Store channels are deprecated and will be removed from Discord in March 2022. See - * [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/6309018858647) - * for more information. - * * `GUILD_NEWS_THREAD` - a guild news channel's public thread channel - * * `GUILD_PUBLIC_THREAD` - a guild text channel's public thread channel - * * `GUILD_PRIVATE_THREAD` - a guild text channel's private thread channel - * * `GUILD_STAGE_VOICE` - a guild stage voice channel - * * `GUILD_DIRECTORY` - the channel in a hub containing guilds - * * `GUILD_FORUM` - a channel that can only contain threads - * * `GUILD_MEDIA` - a channel that can only contain threads, similar to `GUILD_FORUM` channels - * * `UNKNOWN` - a generic channel of unknown type, could be Channel or GuildChannel - * @typedef {string} ChannelType - * @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-types} - */ -exports.ChannelTypes = createEnum([ - 'GUILD_TEXT', - 'DM', - 'GUILD_VOICE', - 'GROUP_DM', - 'GUILD_CATEGORY', - 'GUILD_NEWS', - 'GUILD_STORE', - ...Array(3).fill(null), - // 10 - 'GUILD_NEWS_THREAD', - 'GUILD_PUBLIC_THREAD', - 'GUILD_PRIVATE_THREAD', - 'GUILD_STAGE_VOICE', - 'GUILD_DIRECTORY', - 'GUILD_FORUM', - 'GUILD_MEDIA', -]); - -/** - * The channels that are text-based. - * * DMChannel - * * TextChannel - * * NewsChannel - * * ThreadChannel - * * VoiceChannel - * * StageChannel - * @typedef {DMChannel|TextChannel|NewsChannel|ThreadChannel|VoiceChannel|StageChannel} TextBasedChannels - */ - -/** - * Data that resolves to give a text-based channel. This can be: - * * A text-based channel - * * A snowflake - * @typedef {TextBasedChannels|Snowflake} TextBasedChannelsResolvable - */ - -/** - * The types of channels that are text-based. The available types are: - * * DM - * * GUILD_TEXT - * * GUILD_NEWS - * * GUILD_NEWS_THREAD - * * GUILD_PUBLIC_THREAD - * * GUILD_PRIVATE_THREAD - * * GUILD_VOICE - * * GUILD_STAGE_VOICE - * @typedef {string} TextBasedChannelTypes - */ -exports.TextBasedChannelTypes = [ - 'DM', - 'GUILD_TEXT', - 'GUILD_NEWS', - 'GUILD_NEWS_THREAD', - 'GUILD_PUBLIC_THREAD', - 'GUILD_PRIVATE_THREAD', - 'GUILD_VOICE', - 'GUILD_STAGE_VOICE', -]; - -/** - * The types of channels that are threads. The available types are: - * * GUILD_NEWS_THREAD - * * GUILD_PUBLIC_THREAD - * * GUILD_PRIVATE_THREAD - * @typedef {string} ThreadChannelTypes - */ -exports.ThreadChannelTypes = [ - 'GUILD_NEWS_THREAD', - 'GUILD_PUBLIC_THREAD', - 'GUILD_PRIVATE_THREAD', -]; - -/** - * The types of channels that are voice-based. The available types are: - * * GUILD_VOICE - * * GUILD_STAGE_VOICE - * @typedef {string} VoiceBasedChannelTypes - */ -exports.VoiceBasedChannelTypes = ['GUILD_VOICE', 'GUILD_STAGE_VOICE']; - -/** - * The types of assets of an application: - * * SMALL: 1 - * * BIG: 2 - * @typedef {Object} ClientApplicationAssetTypes - */ -exports.ClientApplicationAssetTypes = { - SMALL: 1, - BIG: 2, -}; - -/** - * A commonly used color: - * * DEFAULT - * * WHITE - * * AQUA - * * GREEN - * * BLUE - * * YELLOW - * * PURPLE - * * LUMINOUS_VIVID_PINK - * * FUCHSIA - * * GOLD - * * ORANGE - * * RED - * * GREY - * * NAVY - * * DARK_AQUA - * * DARK_GREEN - * * DARK_BLUE - * * DARK_PURPLE - * * DARK_VIVID_PINK - * * DARK_GOLD - * * DARK_ORANGE - * * DARK_RED - * * DARK_GREY - * * DARKER_GREY - * * LIGHT_GREY - * * DARK_NAVY - * * BLURPLE - * * GREYPLE - * * DARK_BUT_NOT_BLACK - * * NOT_QUITE_BLACK - * @typedef {string} Color - */ -exports.Colors = { - DEFAULT: 0x000000, - WHITE: 0xffffff, - AQUA: 0x1abc9c, - GREEN: 0x57f287, - BLUE: 0x3498db, - YELLOW: 0xfee75c, - PURPLE: 0x9b59b6, - LUMINOUS_VIVID_PINK: 0xe91e63, - FUCHSIA: 0xeb459e, - GOLD: 0xf1c40f, - ORANGE: 0xe67e22, - RED: 0xed4245, - GREY: 0x95a5a6, - NAVY: 0x34495e, - DARK_AQUA: 0x11806a, - DARK_GREEN: 0x1f8b4c, - DARK_BLUE: 0x206694, - DARK_PURPLE: 0x71368a, - DARK_VIVID_PINK: 0xad1457, - DARK_GOLD: 0xc27c0e, - DARK_ORANGE: 0xa84300, - DARK_RED: 0x992d22, - DARK_GREY: 0x979c9f, - DARKER_GREY: 0x7f8c8d, - LIGHT_GREY: 0xbcc0c0, - DARK_NAVY: 0x2c3e50, - BLURPLE: 0x5865f2, - GREYPLE: 0x99aab5, - DARK_BUT_NOT_BLACK: 0x2c2f33, - NOT_QUITE_BLACK: 0x23272a, -}; - -/** - * Holographic color values for role styling. - * When using `tertiaryColor`, the API enforces these specific values for holographic effect. - * - * * PRIMARY: 11127295 (0xA9FFFF) - * * SECONDARY: 16759788 (0xFFCCCC) - * * TERTIARY: 16761760 (0xFFE0A0) - * @typedef {Object} HolographicStyle - */ -exports.HolographicStyles = { - PRIMARY: 11_127_295, - SECONDARY: 16_759_788, - TERTIARY: 16_761_760, -}; - -/** - * The value set for the explicit content filter levels for a guild: - * * DISABLED - * * MEMBERS_WITHOUT_ROLES - * * ALL_MEMBERS - * @typedef {string} ExplicitContentFilterLevel - * @see {@link https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level} - */ -exports.ExplicitContentFilterLevels = createEnum([ - 'DISABLED', - 'MEMBERS_WITHOUT_ROLES', - 'ALL_MEMBERS', -]); - -/** - * The value set for the verification levels for a guild: - * * NONE - * * LOW - * * MEDIUM - * * HIGH - * * VERY_HIGH - * @typedef {string} VerificationLevel - * @see {@link https://discord.com/developers/docs/resources/guild#guild-object-verification-level} - */ -exports.VerificationLevels = createEnum([ - 'NONE', - 'LOW', - 'MEDIUM', - 'HIGH', - 'VERY_HIGH', -]); - -/** - * An error encountered while performing an API request. Here are the potential errors: - * * UNKNOWN_ACCOUNT - * * UNKNOWN_APPLICATION - * * UNKNOWN_CHANNEL - * * UNKNOWN_GUILD - * * UNKNOWN_INTEGRATION - * * UNKNOWN_INVITE - * * UNKNOWN_MEMBER - * * UNKNOWN_MESSAGE - * * UNKNOWN_OVERWRITE - * * UNKNOWN_PROVIDER - * * UNKNOWN_ROLE - * * UNKNOWN_TOKEN - * * UNKNOWN_USER - * * UNKNOWN_EMOJI - * * UNKNOWN_WEBHOOK - * * UNKNOWN_WEBHOOK_SERVICE - * * UNKNOWN_SESSION - * * UNKNOWN_BAN - * * UNKNOWN_SKU - * * UNKNOWN_STORE_LISTING - * * UNKNOWN_ENTITLEMENT - * * UNKNOWN_BUILD - * * UNKNOWN_LOBBY - * * UNKNOWN_BRANCH - * * UNKNOWN_STORE_DIRECTORY_LAYOUT - * * UNKNOWN_REDISTRIBUTABLE - * * UNKNOWN_GIFT_CODE - * * UNKNOWN_STREAM - * * UNKNOWN_PREMIUM_SERVER_SUBSCRIBE_COOLDOWN - * * UNKNOWN_GUILD_TEMPLATE - * * UNKNOWN_DISCOVERABLE_SERVER_CATEGORY - * * UNKNOWN_STICKER - * * UNKNOWN_INTERACTION - * * UNKNOWN_APPLICATION_COMMAND - * * UNKNOWN_APPLICATION_COMMAND_PERMISSIONS - * * UNKNOWN_STAGE_INSTANCE - * * UNKNOWN_GUILD_MEMBER_VERIFICATION_FORM - * * UNKNOWN_GUILD_WELCOME_SCREEN - * * UNKNOWN_GUILD_SCHEDULED_EVENT - * * UNKNOWN_GUILD_SCHEDULED_EVENT_USER - * * BOT_PROHIBITED_ENDPOINT - * * BOT_ONLY_ENDPOINT - * * CANNOT_SEND_EXPLICIT_CONTENT - * * NOT_AUTHORIZED - * * SLOWMODE_RATE_LIMIT - * * ACCOUNT_OWNER_ONLY - * * ANNOUNCEMENT_EDIT_LIMIT_EXCEEDED - * * CHANNEL_HIT_WRITE_RATELIMIT - * * SERVER_HIT_WRITE_RATELIMIT - * * CONTENT_NOT_ALLOWED - * * GUILD_PREMIUM_LEVEL_TOO_LOW - * * MAXIMUM_GUILDS - * * MAXIMUM_FRIENDS - * * MAXIMUM_PINS - * * MAXIMUM_RECIPIENTS - * * MAXIMUM_ROLES - * * MAXIMUM_WEBHOOKS - * * MAXIMUM_EMOJIS - * * MAXIMUM_REACTIONS - * * MAXIMUM_CHANNELS - * * MAXIMUM_ATTACHMENTS - * * MAXIMUM_INVITES - * * MAXIMUM_ANIMATED_EMOJIS - * * MAXIMUM_SERVER_MEMBERS - * * MAXIMUM_NUMBER_OF_SERVER_CATEGORIES - * * GUILD_ALREADY_HAS_TEMPLATE - * * MAXIMUM_THREAD_PARTICIPANTS - * * MAXIMUM_NON_GUILD_MEMBERS_BANS - * * MAXIMUM_BAN_FETCHES - * * MAXIMUM_NUMBER_OF_UNCOMPLETED_GUILD_SCHEDULED_EVENTS_REACHED - * * MAXIMUM_NUMBER_OF_STICKERS_REACHED - * * MAXIMUM_PRUNE_REQUESTS - * * MAXIMUM_GUILD_WIDGET_SETTINGS_UPDATE - * * UNAUTHORIZED - * * ACCOUNT_VERIFICATION_REQUIRED - * * DIRECT_MESSAGES_TOO_FAST - * * REQUEST_ENTITY_TOO_LARGE - * * FEATURE_TEMPORARILY_DISABLED - * * USER_BANNED - * * TARGET_USER_NOT_CONNECTED_TO_VOICE - * * ALREADY_CROSSPOSTED - * * MISSING_ACCESS - * * INVALID_ACCOUNT_TYPE - * * CANNOT_EXECUTE_ON_DM - * * EMBED_DISABLED - * * CANNOT_EDIT_MESSAGE_BY_OTHER - * * CANNOT_SEND_EMPTY_MESSAGE - * * CANNOT_MESSAGE_USER - * * CANNOT_SEND_MESSAGES_IN_VOICE_CHANNEL - * * CHANNEL_VERIFICATION_LEVEL_TOO_HIGH - * * OAUTH2_APPLICATION_BOT_ABSENT - * * MAXIMUM_OAUTH2_APPLICATIONS - * * INVALID_OAUTH_STATE - * * MISSING_PERMISSIONS - * * INVALID_AUTHENTICATION_TOKEN - * * NOTE_TOO_LONG - * * INVALID_BULK_DELETE_QUANTITY - * * CANNOT_PIN_MESSAGE_IN_OTHER_CHANNEL - * * INVALID_OR_TAKEN_INVITE_CODE - * * CANNOT_EXECUTE_ON_SYSTEM_MESSAGE - * * CANNOT_EXECUTE_ON_CHANNEL_TYPE - * * INVALID_OAUTH_TOKEN - * * MISSING_OAUTH_SCOPE - * * INVALID_WEBHOOK_TOKEN - * * INVALID_ROLE - * * INVALID_RECIPIENTS - * * BULK_DELETE_MESSAGE_TOO_OLD - * * INVALID_FORM_BODY - * * INVITE_ACCEPTED_TO_GUILD_NOT_CONTAINING_BOT - * * INVALID_API_VERSION - * * FILE_UPLOADED_EXCEEDS_MAXIMUM_SIZE - * * INVALID_FILE_UPLOADED - * * CANNOT_SELF_REDEEM_GIFT - * * INVALID_GUILD - * * INVALID_MESSAGE_TYPE - * * PAYMENT_SOURCE_REQUIRED - * * CANNOT_DELETE_COMMUNITY_REQUIRED_CHANNEL - * * INVALID_STICKER_SENT - * * INVALID_OPERATION_ON_ARCHIVED_THREAD - * * INVALID_THREAD_NOTIFICATION_SETTINGS - * * PARAMETER_EARLIER_THAN_CREATION - * * GUILD_NOT_AVAILABLE_IN_LOCATION - * * GUILD_MONETIZATION_REQUIRED - * * INSUFFICIENT_BOOSTS - * * INVALID_JSON - * * TWO_FACTOR_REQUIRED - * * NO_USERS_WITH_DISCORDTAG_EXIST - * * REACTION_BLOCKED - * * RESOURCE_OVERLOADED - * * STAGE_ALREADY_OPEN - * * CANNOT_REPLY_WITHOUT_READ_MESSAGE_HISTORY_PERMISSION - * * MESSAGE_ALREADY_HAS_THREAD - * * THREAD_LOCKED - * * MAXIMUM_ACTIVE_THREADS - * * MAXIMUM_ACTIVE_ANNOUNCEMENT_THREADS - * * INVALID_JSON_FOR_UPLOADED_LOTTIE_FILE - * * UPLOADED_LOTTIES_CANNOT_CONTAIN_RASTERIZED_IMAGES - * * STICKER_MAXIMUM_FRAMERATE_EXCEEDED - * * STICKER_FRAME_COUNT_EXCEEDS_MAXIMUM_OF_1000_FRAMES - * * LOTTIE_ANIMATION_MAXIMUM_DIMENSIONS_EXCEEDED - * * STICKER_FRAME_RATE_IS_TOO_SMALL_OR_TOO_LARGE - * * STICKER_ANIMATION_DURATION_EXCEEDS_MAXIMUM_OF_5_SECONDS - * * CANNOT_UPDATE_A_FINISHED_EVENT - * * FAILED_TO_CREATE_STAGE_NEEDED_FOR_STAGE_EVENT - * @typedef {string} APIError - * @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes} - * @see {@link https://gist.github.com/Dziurwa14/de2498e5ee28d2089f095aa037957cbb} - */ -exports.APIErrors = { - UNKNOWN_ACCOUNT: 10001, - UNKNOWN_APPLICATION: 10002, - UNKNOWN_CHANNEL: 10003, - UNKNOWN_GUILD: 10004, - UNKNOWN_INTEGRATION: 10005, - UNKNOWN_INVITE: 10006, - UNKNOWN_MEMBER: 10007, - UNKNOWN_MESSAGE: 10008, - UNKNOWN_OVERWRITE: 10009, - UNKNOWN_PROVIDER: 10010, - UNKNOWN_ROLE: 10011, - UNKNOWN_TOKEN: 10012, - UNKNOWN_USER: 10013, - UNKNOWN_EMOJI: 10014, - UNKNOWN_WEBHOOK: 10015, - UNKNOWN_WEBHOOK_SERVICE: 10016, - UNKNOWN_SESSION: 10020, - UNKNOWN_BAN: 10026, - UNKNOWN_SKU: 10027, - UNKNOWN_STORE_LISTING: 10028, - UNKNOWN_ENTITLEMENT: 10029, - UNKNOWN_BUILD: 10030, - UNKNOWN_LOBBY: 10031, - UNKNOWN_BRANCH: 10032, - UNKNOWN_STORE_DIRECTORY_LAYOUT: 10033, - UNKNOWN_REDISTRIBUTABLE: 10036, - UNKNOWN_GIFT_CODE: 10038, - UNKNOWN_STREAM: 10049, - UNKNOWN_PREMIUM_SERVER_SUBSCRIBE_COOLDOWN: 10050, - UNKNOWN_GUILD_TEMPLATE: 10057, - UNKNOWN_DISCOVERABLE_SERVER_CATEGORY: 10059, - UNKNOWN_STICKER: 10060, - UNKNOWN_INTERACTION: 10062, - UNKNOWN_APPLICATION_COMMAND: 10063, - UNKNOWN_APPLICATION_COMMAND_PERMISSIONS: 10066, - UNKNOWN_STAGE_INSTANCE: 10067, - UNKNOWN_GUILD_MEMBER_VERIFICATION_FORM: 10068, - UNKNOWN_GUILD_WELCOME_SCREEN: 10069, - UNKNOWN_GUILD_SCHEDULED_EVENT: 10070, - UNKNOWN_GUILD_SCHEDULED_EVENT_USER: 10071, - BOT_PROHIBITED_ENDPOINT: 20001, - BOT_ONLY_ENDPOINT: 20002, - CANNOT_SEND_EXPLICIT_CONTENT: 20009, - NOT_AUTHORIZED: 20012, - SLOWMODE_RATE_LIMIT: 20016, - ACCOUNT_OWNER_ONLY: 20018, - ANNOUNCEMENT_EDIT_LIMIT_EXCEEDED: 20022, - CHANNEL_HIT_WRITE_RATELIMIT: 20028, - SERVER_HIT_WRITE_RATELIMIT: 20029, - CONTENT_NOT_ALLOWED: 20031, - GUILD_PREMIUM_LEVEL_TOO_LOW: 20035, - MAXIMUM_GUILDS: 30001, - MAXIMUM_FRIENDS: 30002, - MAXIMUM_PINS: 30003, - MAXIMUM_RECIPIENTS: 30004, - MAXIMUM_ROLES: 30005, - MAXIMUM_WEBHOOKS: 30007, - MAXIMUM_EMOJIS: 30008, - MAXIMUM_REACTIONS: 30010, - MAXIMUM_CHANNELS: 30013, - MAXIMUM_ATTACHMENTS: 30015, - MAXIMUM_INVITES: 30016, - MAXIMUM_ANIMATED_EMOJIS: 30018, - MAXIMUM_SERVER_MEMBERS: 30019, - MAXIMUM_NUMBER_OF_SERVER_CATEGORIES: 30030, - GUILD_ALREADY_HAS_TEMPLATE: 30031, - MAXIMUM_THREAD_PARTICIPANTS: 30033, - MAXIMUM_NON_GUILD_MEMBERS_BANS: 30035, - MAXIMUM_BAN_FETCHES: 30037, - MAXIMUM_NUMBER_OF_UNCOMPLETED_GUILD_SCHEDULED_EVENTS_REACHED: 30038, - MAXIMUM_NUMBER_OF_STICKERS_REACHED: 30039, - MAXIMUM_PRUNE_REQUESTS: 30040, - MAXIMUM_GUILD_WIDGET_SETTINGS_UPDATE: 30042, - MAXIMUM_NUMBER_OF_PREMIUM_EMOJIS: 30056, - UNAUTHORIZED: 40001, - ACCOUNT_VERIFICATION_REQUIRED: 40002, - DIRECT_MESSAGES_TOO_FAST: 40003, - REQUEST_ENTITY_TOO_LARGE: 40005, - FEATURE_TEMPORARILY_DISABLED: 40006, - USER_BANNED: 40007, - TARGET_USER_NOT_CONNECTED_TO_VOICE: 40032, - ALREADY_CROSSPOSTED: 40033, - MISSING_ACCESS: 50001, - INVALID_ACCOUNT_TYPE: 50002, - CANNOT_EXECUTE_ON_DM: 50003, - EMBED_DISABLED: 50004, - CANNOT_EDIT_MESSAGE_BY_OTHER: 50005, - CANNOT_SEND_EMPTY_MESSAGE: 50006, - CANNOT_MESSAGE_USER: 50007, - CANNOT_SEND_MESSAGES_IN_VOICE_CHANNEL: 50008, - CHANNEL_VERIFICATION_LEVEL_TOO_HIGH: 50009, - OAUTH2_APPLICATION_BOT_ABSENT: 50010, - MAXIMUM_OAUTH2_APPLICATIONS: 50011, - INVALID_OAUTH_STATE: 50012, - MISSING_PERMISSIONS: 50013, - INVALID_AUTHENTICATION_TOKEN: 50014, - NOTE_TOO_LONG: 50015, - INVALID_BULK_DELETE_QUANTITY: 50016, - CANNOT_PIN_MESSAGE_IN_OTHER_CHANNEL: 50019, - INVALID_OR_TAKEN_INVITE_CODE: 50020, - CANNOT_EXECUTE_ON_SYSTEM_MESSAGE: 50021, - CANNOT_EXECUTE_ON_CHANNEL_TYPE: 50024, - INVALID_OAUTH_TOKEN: 50025, - MISSING_OAUTH_SCOPE: 50026, - INVALID_WEBHOOK_TOKEN: 50027, - INVALID_ROLE: 50028, - INVALID_RECIPIENTS: 50033, - BULK_DELETE_MESSAGE_TOO_OLD: 50034, - INVALID_FORM_BODY: 50035, - INVITE_ACCEPTED_TO_GUILD_NOT_CONTAINING_BOT: 50036, - INVALID_API_VERSION: 50041, - FILE_UPLOADED_EXCEEDS_MAXIMUM_SIZE: 50045, - INVALID_FILE_UPLOADED: 50046, - CANNOT_SELF_REDEEM_GIFT: 50054, - INVALID_GUILD: 50055, - INVALID_MESSAGE_TYPE: 50068, - PAYMENT_SOURCE_REQUIRED: 50070, - CANNOT_DELETE_COMMUNITY_REQUIRED_CHANNEL: 50074, - INVALID_STICKER_SENT: 50081, - INVALID_OPERATION_ON_ARCHIVED_THREAD: 50083, - INVALID_THREAD_NOTIFICATION_SETTINGS: 50084, - PARAMETER_EARLIER_THAN_CREATION: 50085, - GUILD_NOT_AVAILABLE_IN_LOCATION: 50095, - GUILD_MONETIZATION_REQUIRED: 50097, - INSUFFICIENT_BOOSTS: 50101, - INVALID_JSON: 50109, - CANNOT_MIX_SUBSCRIPTION_AND_NON_SUBSCRIPTION_ROLES_FOR_EMOJI: 50144, - CANNOT_CONVERT_PREMIUM_EMOJI_TO_NORMAL_EMOJI: 50145, - VOICE_MESSAGES_DO_NOT_SUPPORT_ADDITIONAL_CONTENT: 50159, - VOICE_MESSAGES_MUST_HAVE_A_SINGLE_AUDIO_ATTACHMENT: 50160, - VOICE_MESSAGES_MUST_HAVE_SUPPORTING_METADATA: 50161, - VOICE_MESSAGES_CANNOT_BE_EDITED: 50162, - YOU_CANNOT_SEND_VOICE_MESSAGES_IN_THIS_CHANNEL: 50173, - TWO_FACTOR_REQUIRED: 60003, - NO_USERS_WITH_DISCORDTAG_EXIST: 80004, - REACTION_BLOCKED: 90001, - RESOURCE_OVERLOADED: 130000, - STAGE_ALREADY_OPEN: 150006, - CANNOT_REPLY_WITHOUT_READ_MESSAGE_HISTORY_PERMISSION: 160002, - MESSAGE_ALREADY_HAS_THREAD: 160004, - THREAD_LOCKED: 160005, - MAXIMUM_ACTIVE_THREADS: 160006, - MAXIMUM_ACTIVE_ANNOUNCEMENT_THREADS: 160007, - INVALID_JSON_FOR_UPLOADED_LOTTIE_FILE: 170001, - UPLOADED_LOTTIES_CANNOT_CONTAIN_RASTERIZED_IMAGES: 170002, - STICKER_MAXIMUM_FRAMERATE_EXCEEDED: 170003, - STICKER_FRAME_COUNT_EXCEEDS_MAXIMUM_OF_1000_FRAMES: 170004, - LOTTIE_ANIMATION_MAXIMUM_DIMENSIONS_EXCEEDED: 170005, - STICKER_FRAME_RATE_IS_TOO_SMALL_OR_TOO_LARGE: 170006, - STICKER_ANIMATION_DURATION_EXCEEDS_MAXIMUM_OF_5_SECONDS: 170007, - CANNOT_UPDATE_A_FINISHED_EVENT: 180000, - FAILED_TO_CREATE_STAGE_NEEDED_FOR_STAGE_EVENT: 180002, -}; - -/** - * The value set for a guild's default message notifications, e.g. `ALL_MESSAGES`. Here are the available types: - * * ALL_MESSAGES - * * ONLY_MENTIONS - * @typedef {string} DefaultMessageNotificationLevel - * @see {@link https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level} - */ -exports.DefaultMessageNotificationLevels = createEnum([ - 'ALL_MESSAGES', - 'ONLY_MENTIONS', -]); - -/** - * The value set for a team member's membership state: - * * INVITED - * * ACCEPTED - * @typedef {string} MembershipState - * @see {@link https://discord.com/developers/docs/topics/teams#data-models-membership-state-enum} - */ -exports.MembershipStates = createEnum([null, 'INVITED', 'ACCEPTED']); - -/** - * The value set for a webhook's type: - * * Incoming - * * Channel Follower - * * Application - * @typedef {string} WebhookType - * @see {@link https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types} - */ -exports.WebhookTypes = createEnum([ - null, - 'Incoming', - 'Channel Follower', - 'Application', -]); - -/** - * The value set for a sticker's type: - * * STANDARD - * * GUILD - * @typedef {string} StickerType - * @see {@link https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-types} - */ -exports.StickerTypes = createEnum([null, 'STANDARD', 'GUILD']); - -/** - * The value set for a sticker's format type: - * * PNG - * * APNG - * * LOTTIE - * * GIF - * @typedef {string} StickerFormatType - * @see {@link https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-format-types} - */ -exports.StickerFormatTypes = createEnum([null, 'PNG', 'APNG', 'LOTTIE', 'GIF']); - -/** - * An overwrite type: - * * role - * * member - * @typedef {string} OverwriteType - * @see {@link https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure} - */ -exports.OverwriteTypes = createEnum(['role', 'member']); - -/* eslint-disable max-len */ -/** - * The type of an {@link ApplicationCommand} object: - * * CHAT_INPUT - * * USER - * * MESSAGE - * @typedef {string} ApplicationCommandType - * @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types} - */ -exports.ApplicationCommandTypes = createEnum([ - null, - 'CHAT_INPUT', - 'USER', - 'MESSAGE', -]); - -/** - * The type of an {@link ApplicationCommandOption} object: - * * SUB_COMMAND - * * SUB_COMMAND_GROUP - * * STRING - * * INTEGER - * * BOOLEAN - * * USER - * * CHANNEL - * * ROLE - * * MENTIONABLE - * * NUMBER - * * ATTACHMENT - * @typedef {string} ApplicationCommandOptionType - * @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type} - */ -exports.ApplicationCommandOptionTypes = createEnum([ - null, - 'SUB_COMMAND', - 'SUB_COMMAND_GROUP', - 'STRING', - 'INTEGER', - 'BOOLEAN', - 'USER', - 'CHANNEL', - 'ROLE', - 'MENTIONABLE', - 'NUMBER', - 'ATTACHMENT', -]); - -/** - * The type of an {@link ApplicationCommandPermissions} object: - * * ROLE - * * USER - * @typedef {string} ApplicationCommandPermissionType - * @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type} - */ -exports.ApplicationCommandPermissionTypes = createEnum([null, 'ROLE', 'USER']); - -/** - * Each metadata type offers a comparison operation that allows - * guilds to configure role requirements based on metadata values stored by the bot. - * Bots specify a metadata value for each user and guilds specify - * the required guild's configured value within the guild role settings. - * All available channel types: - * * INTEGER_LESS_THAN_OR_EQUAL - * * INTEGER_GREATER_THAN_OR_EQUAL - * * INTEGER_EQUAL - * * INTEGER_NOT_EQUAL - * * DATATIME_LESS_THAN_OR_EQUAL - * * DATATIME_GREATER_THAN_OR_EQUAL - * * BOOLEAN_EQUAL - * * BOOLEAN_NOT_EQUAL - * @typedef {string} ApplicationRoleConnectionMetadataType - * @see{@link https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-type} - */ -exports.ApplicationRoleConnectionMetadataTypes = createEnum([ - null, - 'INTEGER_LESS_THAN_OR_EQUAL', - 'INTEGER_GREATER_THAN_OR_EQUAL', - 'INTEGER_EQUAL', - 'INTEGER_NOT_EQUAL', - 'DATATIME_LESS_THAN_OR_EQUAL', - 'DATATIME_GREATER_THAN_OR_EQUAL', - 'BOOLEAN_EQUAL', - 'BOOLEAN_NOT_EQUAL', -]); - -/** - * The type of an {@link AutoModerationRuleTriggerTypes} object: - * * KEYWORD - * * SPAM - * * KEYWORD_PRESET - * * MENTION_SPAM - * @typedef {string} AutoModerationRuleTriggerType - * @see {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types} - */ -exports.AutoModerationRuleTriggerTypes = createEnum([ - null, - 'KEYWORD', - null, - 'SPAM', - 'KEYWORD_PRESET', - 'MENTION_SPAM', -]); - -/** - * The type of an {@link AutoModerationRuleKeywordPresetTypes} object: - * * KEYWORD - * * SPAM - * * KEYWORD_PRESET - * * MENTION_SPAM - * @typedef {string} AutoModerationRuleKeywordPresetType - * @see {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-preset-types} - */ -exports.AutoModerationRuleKeywordPresetTypes = createEnum([ - null, - 'PROFANITY', - 'SEXUAL_CONTENT', - 'SLURS', -]); -/** - * The type of an {@link AutoModerationActionTypes} object: - * * BLOCK_MESSAGE - * * SEND_ALERT_MESSAGE - * * TIMEOUT - * @typedef {string} AutoModerationActionType - * @see {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-types} - */ -exports.AutoModerationActionTypes = createEnum([ - null, - 'BLOCK_MESSAGE', - 'SEND_ALERT_MESSAGE', - 'TIMEOUT', -]); - -/** - * The type of an {@link AutoModerationRuleEventTypes} object: - * * MESSAGE_SEND - * @typedef {string} AutoModerationRuleEventType - * @see {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-event-types} - */ - -exports.AutoModerationRuleEventTypes = createEnum([null, 'MESSAGE_SEND']); -/** - * The type of an {@link Interaction} object: - * * PING - * * APPLICATION_COMMAND - * * MESSAGE_COMPONENT - * * APPLICATION_COMMAND_AUTOCOMPLETE - * * MODAL_SUBMIT - * @typedef {string} InteractionType - * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type} - */ -exports.InteractionTypes = createEnum([ - null, - 'PING', - 'APPLICATION_COMMAND', - 'MESSAGE_COMPONENT', - 'APPLICATION_COMMAND_AUTOCOMPLETE', - 'MODAL_SUBMIT', -]); - -/** - * The type of an interaction response: - * * PONG - * * CHANNEL_MESSAGE_WITH_SOURCE - * * DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE - * * DEFERRED_MESSAGE_UPDATE - * * UPDATE_MESSAGE - * * APPLICATION_COMMAND_AUTOCOMPLETE_RESULT - * * MODAL - * @typedef {string} InteractionResponseType - * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type} - */ -exports.InteractionResponseTypes = createEnum([ - null, - 'PONG', - null, - null, - 'CHANNEL_MESSAGE_WITH_SOURCE', - 'DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE', - 'DEFERRED_MESSAGE_UPDATE', - 'UPDATE_MESSAGE', - 'APPLICATION_COMMAND_AUTOCOMPLETE_RESULT', - 'MODAL', -]); - -/** - * The type of a message component - * * ACTION_ROW - * * BUTTON - * * STRING_SELECT - * * TEXT_INPUT - * * USER_SELECT - * * ROLE_SELECT - * * MENTIONABLE_SELECT - * * CHANNEL_SELECT - * @typedef {string} MessageComponentType - * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object-component-types} - */ -exports.MessageComponentTypes = createEnum([ - null, - 'ACTION_ROW', - 'BUTTON', - 'STRING_SELECT', - 'TEXT_INPUT', - 'USER_SELECT', - 'ROLE_SELECT', - 'MENTIONABLE_SELECT', - 'CHANNEL_SELECT', - 'SECTION', - 'TEXT_DISPLAY', - 'THUMBNAIL', - 'MEDIA_GALLERY', - 'FILE', - 'SEPARATOR', - null, - null, - 'CONTAINER', -]); - -/** - * The types of components that are select menus. The available types are: - * * STRING_MENU - * * USER_SELECT - * * ROLE_SELECT - * * MENTIONABLE_SELECT - * * CHANNEL_SELECT - * @typedef {string} SelectMenuComponentType - * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object-component-types} - */ -exports.SelectMenuComponentTypes = createEnum([ - ...new Array(3).fill(null), - 'STRING_MENU', - null, - 'USER_SELECT', - 'ROLE_SELECT', - 'MENTIONABLE_SELECT', - 'CHANNEL_SELECT', -]); - -/** - * The style of a message button - * * PRIMARY - * * SECONDARY - * * SUCCESS - * * DANGER - * * LINK - * @typedef {string} MessageButtonStyle - * @see {@link https://discord.com/developers/docs/interactions/message-components#button-object-button-styles} - */ -exports.MessageButtonStyles = createEnum([ - null, - 'PRIMARY', - 'SECONDARY', - 'SUCCESS', - 'DANGER', - 'LINK', -]); - -/** - * The required MFA level for a guild - * * NONE - * * ELEVATED - * @typedef {string} MFALevel - * @see {@link https://discord.com/developers/docs/resources/guild#guild-object-mfa-level} - */ -exports.MFALevels = createEnum(['NONE', 'ELEVATED']); - -/** - * NSFW level of a Guild: - * * DEFAULT - * * EXPLICIT - * * SAFE - * * AGE_RESTRICTED - * @typedef {string} NSFWLevel - * @see {@link https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level} - */ -exports.NSFWLevels = createEnum([ - 'DEFAULT', - 'EXPLICIT', - 'SAFE', - 'AGE_RESTRICTED', -]); - -/** - * Privacy level of a {@link StageInstance} object: - * * PUBLIC - * * GUILD_ONLY - * @typedef {string} PrivacyLevel - * @see {@link https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-privacy-level} - */ -exports.PrivacyLevels = createEnum([null, 'PUBLIC', 'GUILD_ONLY']); - -/** - * The style of a text input component - * * SHORT - * * PARAGRAPH - * @typedef {string} TextInputStyle - * @see {@link https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-styles} - */ -exports.TextInputStyles = createEnum([null, 'SHORT', 'PARAGRAPH']); - -/** - * Privacy level of a {@link GuildScheduledEvent} object: - * * GUILD_ONLY - * @typedef {string} GuildScheduledEventPrivacyLevel - * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level} - */ -exports.GuildScheduledEventPrivacyLevels = createEnum([ - null, - null, - 'GUILD_ONLY', -]); - -/** - * The premium tier (Server Boost level) of a guild: - * * NONE - * * TIER_1 - * * TIER_2 - * * TIER_3 - * @typedef {string} PremiumTier - * @see {@link https://discord.com/developers/docs/resources/guild#guild-object-premium-tier} - */ -exports.PremiumTiers = createEnum(['NONE', 'TIER_1', 'TIER_2', 'TIER_3']); - -/** - * The status of a {@link GuildScheduledEvent}: - * * SCHEDULED - * * ACTIVE - * * COMPLETED - * * CANCELED - * @typedef {string} GuildScheduledEventStatus - * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-status} - */ -exports.GuildScheduledEventStatuses = createEnum([ - null, - 'SCHEDULED', - 'ACTIVE', - 'COMPLETED', - 'CANCELED', -]); - -/** - * The entity type of a {@link GuildScheduledEvent}: - * * NONE - * * STAGE_INSTANCE - * * VOICE - * * EXTERNAL - * @typedef {string} GuildScheduledEventEntityType - * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-types} - */ -exports.GuildScheduledEventEntityTypes = createEnum([ - null, - 'STAGE_INSTANCE', - 'VOICE', - 'EXTERNAL', -]); -/* eslint-enable max-len */ - -/** - * The camera video quality mode of a {@link VoiceChannel}: - * * AUTO - * * FULL - * @typedef {string} VideoQualityMode - * @see {@link https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes} - */ -exports.VideoQualityModes = createEnum([null, 'AUTO', 'FULL']); - -/** - * The type of reaction - * * NORMAL - * * BURST - * @typedef {string} ReactionType - * @see {@link https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes} - */ -exports.ReactionTypes = createEnum(['NORMAL', 'BURST']); - -/** - * Sort {@link ThreadOnlyChannel} posts by creation time or activity - * * LATEST_ACTIVITY - * * CREATION_DATE - * @typedef {string} SortOrderType - * @see {@link https://discord.com/developers/docs/resources/channel/#channel-object-sort-order-types} - */ -exports.SortOrderTypes = createEnum([null, 'LATEST_ACTIVITY', 'CREATION_DATE']); - -/** - * The default forum layout to set on the {@link ForumChannel} - * * NOT_SET - * * LIST_VIEW - * * GALLERY_VIEW - * @typedef {string} ForumLayoutType - * @see {@link https://discord.com/developers/docs/resources/channel/#channel-object-forum-layout-types} - */ -exports.ForumLayoutTypes = createEnum(['NOT_SET', 'LIST_VIEW', 'GALLERY_VIEW']); - -/** - * Different layouts for {@link MessagePoll} will come in the future. For now though, this value will always be `DEFAULT`. - * * DEFAULT - * * IMAGE_ONLY_ANSWERS - * @typedef {string} PollLayoutType - * @see {@link https://docs.discord.food/resources/message#poll-layout-type} - */ -exports.PollLayoutTypes = createEnum([null, 'DEFAULT', 'IMAGE_ONLY_ANSWERS']); - -/** - * Relationship Enums: - * * 0: NONE - * * 1: FRIEND - * * 2: BLOCKED - * * 3: PENDING_INCOMING - * * 4: PENDING_OUTGOING - * * 5: IMPLICIT - * @typedef {string} RelationshipType - * @see {@link https://luna.gitlab.io/discord-unofficial-docs/relationships.html} - */ - -exports.RelationshipTypes = createEnum([ - 'NONE', - 'FRIEND', - 'BLOCKED', - 'PENDING_INCOMING', - 'PENDING_OUTGOING', - 'IMPLICIT', -]); - -exports.SeparatorSpacingSizes = createEnum([null, 'SMALL', 'LARGE']); - -exports._cleanupSymbol = Symbol('djsCleanup'); - -function keyMirror(arr) { - let tmp = Object.create(null); - for (const value of arr) tmp[value] = value; - return tmp; -} - -function createEnum(keys) { - const obj = {}; - for (const [index, key] of keys.entries()) { - if (key === null) continue; - obj[key] = index; - obj[index] = key; - } - return obj; -} - -/** - * @typedef {Object} Constants Constants that can be used in an enum or object-like way. - * @property {Object} ActivityTypes The type of an activity of a users presence. - * @property {Object} APIErrors An error encountered while performing an API request. - * @property {Object} ApplicationCommandOptionTypes - * The type of an {@link ApplicationCommandOption} object. - * @property {Object} ApplicationCommandPermissionTypes - * The type of an {@link ApplicationCommandPermissions} object. - * @property {Object} ApplicationCommandTypes - * The type of an {@link ApplicationCommand} object. - * @property {Object} ApplicationRoleConnectionMetadataTypes - * The type of an {@link ApplicationRoleConnectionMetadata} object. - * @property {Object} AutoModerationActionTypes - * A type of an action which executes whenever a rule is triggered. - * @property {Object} AutoModerationRuleEventTypes Indicates in what event context - * a rule should be checked. - * @property {Object} AutoModerationRuleKeywordPresetTypes - * The internally pre-defined wordsetswhich will be searched for in content - * @property {Object} AutoModerationRuleTriggerTypes Characterizes the type - * of content which can trigger the rule. - * @property {Object} ChannelTypes All available channel types. - * @property {ClientApplicationAssetTypes} ClientApplicationAssetTypes The types of an {@link ApplicationAsset} object. - * @property {Object} Colors An object with regularly used colors. - * @property {Object} DefaultMessageNotificationLevels - * The value set for a guilds default message notifications. - * @property {Endpoints} Endpoints Object containing functions that return certain endpoints on the API. - * @property {Events} Events The types of events emitted by the Client. - * @property {Object} ExplicitContentFilterLevels - * The value set for the explicit content filter levels for a guild. - * @property {Object} GuildScheduledEventEntityTypes - * The entity type of a {@link GuildScheduledEvent} object. - * @property {Object} GuildScheduledEventPrivacyLevels - * Privacy level of a {@link GuildScheduledEvent} object. - * @property {Object} GuildScheduledEventStatuses - * The status of a {@link GuildScheduledEvent} object. - * @property {Object} IntegrationExpireBehaviors - * The behavior of expiring subscribers for Integrations. - * @property {Object} InteractionResponseTypes The type of an interaction response. - * @property {Object} InteractionTypes The type of an {@link Interaction} object. - * @property {InviteScope[]} InviteScopes The scopes of an invite. - * @property {Object} RelationshipTypes Relationship Enums - * @property {Object} SeparatorSpacingSize Size of separator padding (Enums) - * @property {Object} MembershipStates The value set for a team members membership state. - * @property {Object} MessageButtonStyles The style of a message button. - * @property {Object} MessageComponentTypes The type of a message component. - * @property {MessageType[]} MessageTypes The type of a {@link Message} object. - * @property {Object} MFALevels The required MFA level for a guild. - * @property {Object} NSFWLevels NSFW level of a guild. - * @property {Opcodes} Opcodes The types of Opcodes sent to the Gateway. - * @property {Object} OverwriteTypes An overwrite type. - * @property {Object} Package The package.json of the library. - * @property {Object} PartialTypes The type of Structure allowed to be a partial. - * @property {Object} PremiumTiers The premium tier (Server Boost level) of a guild. - * @property {Object} PrivacyLevels Privacy level of a {@link StageInstance} object. - * @property {ShardEvents} ShardEvents The type of events emitted by a Shard. - * @property {Status} Status The available statuses of the client. - * @property {Object} SelectMenuComponentTypes The type of any select menu. - * @property {Object} StickerFormatTypes The value set for a stickers format type. - * @property {Object} StickerTypes The value set for a stickers type. - * @property {SweeperKey[]} SweeperKeys The name of an item to be swept in Sweepers. - * @property {SystemMessageType[]} SystemMessageTypes The types of messages that are `System`. - * @property {Object} TextInputStyles The style of a text input component. - * @property {ThreadChannelTypes[]} ThreadChannelTypes The type of a {@link ThreadChannel} object. - * @property {string} UserAgent The user agent used for requests. - * @property {Object} VerificationLevels - * The value set for the verification levels for a guild. - * @property {Object} VideoQualityModes - * The camera video quality mode for a {@link VoiceChannel}. - * @property {Object} WebhookTypes The value set for a webhooks type. - * @property {WSCodes} WSCodes The types of WebSocket error codes. - * @property {Object} WSEvents The type of a WebSocket message event. - * @property {HolographicStyle} HolographicStyles Holographic color values for role styling. - */ diff --git a/vendor/discord.js-selfbot-v13/src/util/DataResolver.js b/vendor/discord.js-selfbot-v13/src/util/DataResolver.js deleted file mode 100644 index d5fd84b..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/DataResolver.js +++ /dev/null @@ -1,149 +0,0 @@ -'use strict'; - -const { Buffer } = require('node:buffer'); -const fs = require('node:fs'); -const path = require('node:path'); -const stream = require('node:stream'); -const { fetch } = require('undici'); -const { Error: DiscordError, TypeError } = require('../errors'); -const Invite = require('../structures/Invite'); - -/** - * The DataResolver identifies different objects and tries to resolve a specific piece of information from them. - * @private - */ -class DataResolver extends null { - /** - * Data that can be resolved to give an invite code. This can be: - * * An invite code - * * An invite URL - * @typedef {string} InviteResolvable - */ - - /** - * Data that can be resolved to give a template code. This can be: - * * A template code - * * A template URL - * @typedef {string} GuildTemplateResolvable - */ - - /** - * Resolves the string to a code based on the passed regex. - * @param {string} data The string to resolve - * @param {RegExp} regex The RegExp used to extract the code - * @returns {string} - */ - static resolveCode(data, regex) { - return new RegExp(regex.source).exec(data)?.[1] ?? data; - } - - /** - * Resolves InviteResolvable to an invite code. - * @param {InviteResolvable} data The invite resolvable to resolve - * @returns {string} - */ - static resolveInviteCode(data) { - return this.resolveCode(data, Invite.INVITES_PATTERN); - } - - /** - * Resolves GuildTemplateResolvable to a template code. - * @param {GuildTemplateResolvable} data The template resolvable to resolve - * @returns {string} - */ - static resolveGuildTemplateCode(data) { - const GuildTemplate = require('../structures/GuildTemplate'); - return this.resolveCode(data, GuildTemplate.GUILD_TEMPLATES_PATTERN); - } - - /** - * Resolves a Base64Resolvable, a string, or a BufferResolvable to a Base 64 image. - * @param {BufferResolvable|Base64Resolvable} image The image to be resolved - * @returns {Promise} - */ - static async resolveImage(image) { - if (!image) return null; - if (typeof image === 'string' && image.startsWith('data:')) { - return image; - } - const file = await this.resolveFileAsBuffer(image); - return DataResolver.resolveBase64(file); - } - - /** - * Data that resolves to give a Base64 string, typically for image uploading. This can be: - * * A Buffer - * * A base64 string - * @typedef {Buffer|string} Base64Resolvable - */ - - /** - * Resolves a Base64Resolvable to a Base 64 image. - * @param {Base64Resolvable} data The base 64 resolvable you want to resolve - * @returns {?string} - */ - static resolveBase64(data) { - if (Buffer.isBuffer(data)) - return `data:image/jpg;base64,${data.toString('base64')}`; - return data; - } - - /** - * Data that can be resolved to give a Buffer. This can be: - * * A Buffer - * * The path to a local file - * * A URL When provided a URL, discord.js will fetch the URL internally in order to create a Buffer. - * This can pose a security risk when the URL has not been sanitized - * @typedef {string|Buffer} BufferResolvable - */ - - /** - * @external Stream - * @see {@link https://nodejs.org/api/stream.html} - */ - - /** - * Resolves a BufferResolvable to a Buffer or a Stream. - * @param {BufferResolvable|Stream} resource The buffer or stream resolvable to resolve - * @returns {Promise} - */ - static async resolveFile(resource) { - if (Buffer.isBuffer(resource) || resource instanceof stream.Readable) - return resource; - if (typeof resource === 'string') { - if (/^https?:\/\//.test(resource)) { - const res = await fetch(resource); - if (res.ok) return res.body; - else throw new DiscordError('FILE_NOT_FOUND', resource); - } - - return new Promise((resolve, reject) => { - const file = path.resolve(resource); - fs.stat(file, (err, stats) => { - if (err) return reject(err); - if (!stats.isFile()) - return reject(new DiscordError('FILE_NOT_FOUND', file)); - return resolve(fs.createReadStream(file)); - }); - }); - } - - throw new TypeError('REQ_RESOURCE_TYPE'); - } - - /** - * Resolves a BufferResolvable to a Buffer. - * @param {BufferResolvable|Stream} resource The buffer or stream resolvable to resolve - * @returns {Promise} - */ - static async resolveFileAsBuffer(resource) { - const file = await this.resolveFile(resource); - if (Buffer.isBuffer(file)) return file; - - const buffers = []; - for await (const data of file) buffers.push(data); - return Buffer.concat(buffers); - } -} - -module.exports = DataResolver; diff --git a/vendor/discord.js-selfbot-v13/src/util/Formatters.js b/vendor/discord.js-selfbot-v13/src/util/Formatters.js deleted file mode 100644 index 86a3b7b..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/Formatters.js +++ /dev/null @@ -1,229 +0,0 @@ -'use strict'; - -const { - blockQuote, - bold, - channelMention, - codeBlock, - formatEmoji, - hideLinkEmbed, - hyperlink, - inlineCode, - italic, - quote, - roleMention, - spoiler, - strikethrough, - time, - TimestampStyles, - underscore, - userMention, -} = require('@discordjs/builders'); - -/** - * Contains various Discord-specific functions for formatting messages. - */ -class Formatters extends null {} - -/** - * Formats the content into a block quote. This needs to be at the start of the line for Discord to format it. - * @method blockQuote - * @memberof Formatters - * @param {string} content The content to wrap. - * @returns {string} - */ -Formatters.blockQuote = blockQuote; - -/** - * Formats the content into bold text. - * @method bold - * @memberof Formatters - * @param {string} content The content to wrap. - * @returns {string} - */ -Formatters.bold = bold; - -/** - * Formats a channel id into a channel mention. - * @method channelMention - * @memberof Formatters - * @param {string} channelId The channel id to format. - * @returns {string} - */ -Formatters.channelMention = channelMention; - -/** - * Formats an application command name, subcommand group name, subcommand name, and ID - * into an application command mention - * @method chatInputApplicationCommandMention - * @memberof Formatters - * @param {string} commandName The name of the application command - * @param {string|Snowflake} subcommandGroupOrSubOrId - * The subcommand group name, subcommand name, or application command id - * @param {?(string|Snowflake)} [subcommandNameOrId] The subcommand name or application command id - * @param {?Snowflake} [commandId] The id of the application command - * @returns {string} - * @static - */ -Formatters.chatInputApplicationCommandMention = - function chatInputApplicationCommandMention( - commandName, - subcommandGroupOrSubOrId, - subcommandNameOrId, - commandId, - ) { - if (typeof commandId !== 'undefined') { - return ``; - } - - if (typeof subcommandNameOrId !== 'undefined') { - return ``; - } - - return ``; - }; - -/** - * Wraps the content inside a code block with an optional language. - * @method codeBlock - * @memberof Formatters - * @param {string} contentOrLanguage The language to use, content if a second parameter isn't provided. - * @param {string} [content] The content to wrap. - * @returns {string} - */ -Formatters.codeBlock = codeBlock; - -/** - * Formats an emoji id into a fully qualified emoji identifier - * @method formatEmoji - * @memberof Formatters - * @param {string} emojiId The emoji id to format. - * @param {boolean} [animated] Whether the emoji is animated or not. Defaults to `false` - * @returns {string} - */ -Formatters.formatEmoji = formatEmoji; - -/** - * Wraps the URL into `<>`, which stops it from embedding. - * @method hideLinkEmbed - * @memberof Formatters - * @param {string} content The content to wrap. - * @returns {string} - */ -Formatters.hideLinkEmbed = hideLinkEmbed; - -/** - * Formats the content and the URL into a masked URL with an optional title. - * @method hyperlink - * @memberof Formatters - * @param {string} content The content to display. - * @param {string} url The URL the content links to. - * @param {string} [title] The title shown when hovering on the masked link. - * @returns {string} - */ -Formatters.hyperlink = hyperlink; - -/** - * Wraps the content inside \`backticks\`, which formats it as inline code. - * @method inlineCode - * @memberof Formatters - * @param {string} content The content to wrap. - * @returns {string} - */ -Formatters.inlineCode = inlineCode; - -/** - * Formats the content into italic text. - * @method italic - * @memberof Formatters - * @param {string} content The content to wrap. - * @returns {string} - */ -Formatters.italic = italic; - -/** - * Formats the content into a quote. This needs to be at the start of the line for Discord to format it. - * @method quote - * @memberof Formatters - * @param {string} content The content to wrap. - * @returns {string} - */ -Formatters.quote = quote; - -/** - * Formats a role id into a role mention. - * @method roleMention - * @memberof Formatters - * @param {string} roleId The role id to format. - * @returns {string} - */ -Formatters.roleMention = roleMention; - -/** - * Formats the content into spoiler text. - * @method spoiler - * @memberof Formatters - * @param {string} content The content to spoiler. - * @returns {string} - */ -Formatters.spoiler = spoiler; - -/** - * Formats the content into strike-through text. - * @method strikethrough - * @memberof Formatters - * @param {string} content The content to wrap. - * @returns {string} - */ -Formatters.strikethrough = strikethrough; - -/** - * Formats a date into a short date-time string. - * @method time - * @memberof Formatters - * @param {number|Date} [date] The date to format. - * @param {TimestampStylesString} [style] The style to use. - * @returns {string} - */ -Formatters.time = time; - -/** - * A message formatting timestamp style, as defined in - * [here](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles). - * * `t` Short time format, consisting of hours and minutes, e.g. 16:20. - * * `T` Long time format, consisting of hours, minutes, and seconds, e.g. 16:20:30. - * * `d` Short date format, consisting of day, month, and year, e.g. 20/04/2021. - * * `D` Long date format, consisting of day, month, and year, e.g. 20 April 2021. - * * `f` Short date-time format, consisting of short date and short time formats, e.g. 20 April 2021 16:20. - * * `F` Long date-time format, consisting of long date and short time formats, e.g. Tuesday, 20 April 2021 16:20. - * * `R` Relative time format, consisting of a relative duration format, e.g. 2 months ago. - * @typedef {string} TimestampStylesString - */ - -/** - * The message formatting timestamp - * [styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord. - * @memberof Formatters - * @type {Object} - */ -Formatters.TimestampStyles = TimestampStyles; - -/** - * Formats the content into underscored text. - * @method underscore - * @memberof Formatters - * @param {string} content The content to wrap. - * @returns {string} - */ -Formatters.underscore = underscore; - -/** - * Formats a user id into a user mention. - * @method userMention - * @memberof Formatters - * @param {string} userId The user id to format. - * @returns {string} - */ -Formatters.userMention = userMention; - -module.exports = Formatters; diff --git a/vendor/discord.js-selfbot-v13/src/util/GuildMemberFlags.js b/vendor/discord.js-selfbot-v13/src/util/GuildMemberFlags.js deleted file mode 100644 index b4c3709..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/GuildMemberFlags.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -const BitField = require('./BitField'); - -/** - * Data structure that makes it easy to interact with an {@link GuildMember#flags} bitfield. - * @extends {BitField} - */ -class GuildMemberFlags extends BitField {} - -/** - * @name GuildMemberFlags - * @kind constructor - * @memberof GuildMemberFlags - * @param {BitFieldResolvable} [bits=0] Bit(s) to read from - */ - -/** - * Numeric guild member flags. All available properties: - * * `DID_REJOIN` - * * `COMPLETED_ONBOARDING` - * * `BYPASSES_VERIFICATION` - * * `STARTED_ONBOARDING` - * @type {Object} - * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-flags} - */ -GuildMemberFlags.FLAGS = { - DID_REJOIN: 1 << 0, - COMPLETED_ONBOARDING: 1 << 1, - BYPASSES_VERIFICATION: 1 << 2, - STARTED_ONBOARDING: 1 << 3, -}; - -/** - * Data that can be resolved to give a guild member flag bitfield. This can be: - * * A string (see {@link GuildMemberFlags.FLAGS}) - * * A guild member flag - * * An instance of GuildMemberFlags - * * An Array of GuildMemberFlagsResolvable - * @typedef {string|number|GuildMemberFlags|GuildMemberFlagsResolvable[]} GuildMemberFlagsResolvable - */ - -module.exports = GuildMemberFlags; diff --git a/vendor/discord.js-selfbot-v13/src/util/Intents.js b/vendor/discord.js-selfbot-v13/src/util/Intents.js deleted file mode 100644 index 95239c5..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/Intents.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; -const BitField = require('./BitField'); - -/** - * Data structure that makes it easy to calculate intents. - * @extends {BitField} - */ -class Intents extends BitField {} - -/** - * @name Intents - * @kind constructor - * @memberof Intents - * @param {IntentsResolvable} [bits=0] Bit(s) to read from - */ - -/** - * Data that can be resolved to give a permission number. This can be: - * * A string (see {@link Intents.FLAGS}) - * * An intents flag - * * An instance of Intents - * * An array of IntentsResolvable - * @typedef {string|number|Intents|IntentsResolvable[]} IntentsResolvable - */ - -/** - * Numeric WebSocket intents. All available properties: - * * `GUILDS` - * * `GUILD_MEMBERS` - * * `GUILD_BANS` - * * `GUILD_EMOJIS_AND_STICKERS` - * * `GUILD_INTEGRATIONS` - * * `GUILD_WEBHOOKS` - * * `GUILD_INVITES` - * * `GUILD_VOICE_STATES` - * * `GUILD_PRESENCES` - * * `GUILD_MESSAGES` - * * `GUILD_MESSAGE_REACTIONS` - * * `GUILD_MESSAGE_TYPING` - * * `DIRECT_MESSAGES` - * * `DIRECT_MESSAGE_REACTIONS` - * * `DIRECT_MESSAGE_TYPING` - * * `MESSAGE_CONTENT` - * * `GUILD_SCHEDULED_EVENTS` - * * `AUTO_MODERATION_CONFIGURATION` - * * `AUTO_MODERATION_EXECUTION` - * @type {Object} - * @see {@link https://discord.com/developers/docs/topics/gateway#list-of-intents} - */ -Intents.FLAGS = { - GUILDS: 1 << 0, - GUILD_MEMBERS: 1 << 1, - GUILD_BANS: 1 << 2, - GUILD_EMOJIS_AND_STICKERS: 1 << 3, - GUILD_INTEGRATIONS: 1 << 4, - GUILD_WEBHOOKS: 1 << 5, - GUILD_INVITES: 1 << 6, - GUILD_VOICE_STATES: 1 << 7, - GUILD_PRESENCES: 1 << 8, - GUILD_MESSAGES: 1 << 9, - GUILD_MESSAGE_REACTIONS: 1 << 10, - GUILD_MESSAGE_TYPING: 1 << 11, - DIRECT_MESSAGES: 1 << 12, - DIRECT_MESSAGE_REACTIONS: 1 << 13, - DIRECT_MESSAGE_TYPING: 1 << 14, - MESSAGE_CONTENT: 1 << 15, - GUILD_SCHEDULED_EVENTS: 1 << 16, - AUTO_MODERATION_CONFIGURATION: 1 << 20, - AUTO_MODERATION_EXECUTION: 1 << 21, -}; - -Intents.ALL = Object.values(Intents.FLAGS).reduce((all, p) => all | p, 0); - -module.exports = Intents; diff --git a/vendor/discord.js-selfbot-v13/src/util/InviteFlags.js b/vendor/discord.js-selfbot-v13/src/util/InviteFlags.js deleted file mode 100644 index 0e55187..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/InviteFlags.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -const BitField = require('./BitField'); - -/** - * Data structure that makes it easy to interact with an {@link InviteFlags#flags} bitfield. - * @extends {BitField} - */ -class InviteFlags extends BitField {} - -/** - * @name InviteFlags - * @kind constructor - * @memberof InviteFlags - * @param {BitFieldResolvable} [bits=0] Bit(s) to read from - */ - -/** - * Numeric the Discord invite flags. All available properties: - * * `IS_GUEST_INVITE` - * * `IS_VIEWED` - * * `IS_ENHANCED` - * * `IS_APPLICATION_BYPASS` - * @type {Object} - * @see {@link https://docs.discord.food/resources/invite#invite-flags} - */ -InviteFlags.FLAGS = { - IS_GUEST_INVITE: 1 << 0, - IS_VIEWED: 1 << 1, - IS_ENHANCED: 1 << 2, - IS_APPLICATION_BYPASS: 1 << 3, -}; - -module.exports = InviteFlags; diff --git a/vendor/discord.js-selfbot-v13/src/util/LimitedCollection.js b/vendor/discord.js-selfbot-v13/src/util/LimitedCollection.js deleted file mode 100644 index 364fbd0..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/LimitedCollection.js +++ /dev/null @@ -1,141 +0,0 @@ -'use strict'; - -const { setInterval } = require('node:timers'); -const { Collection } = require('@discordjs/collection'); -const { _cleanupSymbol } = require('./Constants.js'); -const Sweepers = require('./Sweepers.js'); -const { TypeError } = require('../errors/DJSError.js'); - -/** - * @typedef {Function} SweepFilter - * @param {LimitedCollection} collection The collection being swept - * @returns {Function|null} Return `null` to skip sweeping, otherwise a function passed to `sweep()`, - * See {@link [Collection#sweep](https://discord.js.org/docs/packages/collection/stable/Collection:Class#sweep)} - * for the definition of this function. - */ - -/** - * Options for defining the behavior of a LimitedCollection - * @typedef {Object} LimitedCollectionOptions - * @property {?number} [maxSize=Infinity] The maximum size of the Collection - * @property {?Function} [keepOverLimit=null] A function, which is passed the value and key of an entry, ran to decide - * to keep an entry past the maximum size - * @property {?SweepFilter} [sweepFilter=null] DEPRECATED: There is no direct alternative to this, - * however most of its purpose is fulfilled by {@link Client#sweepers} - * A function ran every `sweepInterval` to determine how to sweep - * @property {?number} [sweepInterval=0] DEPRECATED: There is no direct alternative to this, - * however most of its purpose is fulfilled by {@link Client#sweepers} - * How frequently, in seconds, to sweep the collection. - */ - -/** - * A Collection which holds a max amount of entries and sweeps periodically. - * @extends {Collection} - * @param {LimitedCollectionOptions} [options={}] Options for constructing the Collection. - * @param {Iterable} [iterable=null] Optional entries passed to the Map constructor. - */ -class LimitedCollection extends Collection { - constructor(options = {}, iterable) { - if (typeof options !== 'object' || options === null) { - throw new TypeError('INVALID_TYPE', 'options', 'object', true); - } - const { - maxSize = Infinity, - keepOverLimit = null, - sweepInterval = 0, - sweepFilter = null, - } = options; - - if (typeof maxSize !== 'number') { - throw new TypeError('INVALID_TYPE', 'maxSize', 'number'); - } - if (keepOverLimit !== null && typeof keepOverLimit !== 'function') { - throw new TypeError('INVALID_TYPE', 'keepOverLimit', 'function'); - } - if (typeof sweepInterval !== 'number') { - throw new TypeError('INVALID_TYPE', 'sweepInterval', 'number'); - } - if (sweepFilter !== null && typeof sweepFilter !== 'function') { - throw new TypeError('INVALID_TYPE', 'sweepFilter', 'function'); - } - - super(iterable); - - /** - * The max size of the Collection. - * @type {number} - */ - this.maxSize = maxSize; - - /** - * A function called to check if an entry should be kept when the Collection is at max size. - * @type {?Function} - */ - this.keepOverLimit = keepOverLimit; - - /** - * A function called every sweep interval that returns a function passed to `sweep`. - * @deprecated in favor of {@link Client#sweepers} - * @type {?SweepFilter} - */ - this.sweepFilter = sweepFilter; - - /** - * The id of the interval being used to sweep. - * @deprecated in favor of {@link Client#sweepers} - * @type {?Timeout} - */ - this.interval = - sweepInterval > 0 && sweepInterval !== Infinity && sweepFilter - ? setInterval(() => { - const sweepFn = this.sweepFilter(this); - if (sweepFn === null) return; - if (typeof sweepFn !== 'function') - throw new TypeError('SWEEP_FILTER_RETURN'); - this.sweep(sweepFn); - }, sweepInterval * 1_000).unref() - : null; - } - - set(key, value) { - if (this.maxSize === 0) return this; - if (this.size >= this.maxSize && !this.has(key)) { - for (const [k, v] of this.entries()) { - const keep = this.keepOverLimit?.(v, k, this) ?? false; - if (!keep) { - this.delete(k); - break; - } - } - } - return super.set(key, value); - } - - /** - * Create a sweepFilter function that uses a lifetime to determine sweepability. - * @param {LifetimeFilterOptions} [options={}] The options used to generate the filter function - * @deprecated Use {@link Sweepers.filterByLifetime} instead - * @returns {SweepFilter} - */ - static filterByLifetime({ - lifetime = 14400, - getComparisonTimestamp = (e) => e?.createdTimestamp, - excludeFromSweep = () => false, - } = {}) { - return Sweepers.filterByLifetime({ - lifetime, - getComparisonTimestamp, - excludeFromSweep, - }); - } - - [_cleanupSymbol]() { - return this.interval ? () => clearInterval(this.interval) : null; - } - - static get [Symbol.species]() { - return Collection; - } -} - -module.exports = LimitedCollection; diff --git a/vendor/discord.js-selfbot-v13/src/util/MessageFlags.js b/vendor/discord.js-selfbot-v13/src/util/MessageFlags.js deleted file mode 100644 index 9baf4c7..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/MessageFlags.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; - -const BitField = require('./BitField'); - -/** - * Data structure that makes it easy to interact with a {@link Message#flags} bitfield. - * @extends {BitField} - */ -class MessageFlags extends BitField {} - -/** - * @name MessageFlags - * @kind constructor - * @memberof MessageFlags - * @param {BitFieldResolvable} [bits=0] Bit(s) to read from - */ - -/** - * Bitfield of the packed bits - * @type {number} - * @name MessageFlags#bitfield - */ - -/** - * Numeric message flags. All available properties: - * * `CROSSPOSTED` - * * `IS_CROSSPOST` - * * `SUPPRESS_EMBEDS` - * * `SOURCE_MESSAGE_DELETED` - * * `URGENT` - * * `HAS_THREAD` - * * `EPHEMERAL` - * * `LOADING` - * * `FAILED_TO_MENTION_SOME_ROLES_IN_THREAD` - * * `GUILD_FEED_HIDDEN` - * * `SHOULD_SHOW_LINK_NOT_DISCORD_WARNING` - * * `SUPPRESS_NOTIFICATIONS` - * * `IS_VOICE_MESSAGE` - * * `HAS_SNAPSHOT` - * * `IS_COMPONENTS_V2` - * @type {Object} - * @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-flags} - * @see {@link https://docs.discord.food/resources/message#message-flags} - */ -MessageFlags.FLAGS = { - CROSSPOSTED: 1 << 0, - IS_CROSSPOST: 1 << 1, - SUPPRESS_EMBEDS: 1 << 2, - SOURCE_MESSAGE_DELETED: 1 << 3, - URGENT: 1 << 4, - HAS_THREAD: 1 << 5, - EPHEMERAL: 1 << 6, - LOADING: 1 << 7, - FAILED_TO_MENTION_SOME_ROLES_IN_THREAD: 1 << 8, - GUILD_FEED_HIDDEN: 1 << 9, - SHOULD_SHOW_LINK_NOT_DISCORD_WARNING: 1 << 10, - SUPPRESS_NOTIFICATIONS: 1 << 12, - IS_VOICE_MESSAGE: 1 << 13, - HAS_SNAPSHOT: 1 << 14, - IS_COMPONENTS_V2: 1 << 15, -}; - -module.exports = MessageFlags; diff --git a/vendor/discord.js-selfbot-v13/src/util/Options.js b/vendor/discord.js-selfbot-v13/src/util/Options.js deleted file mode 100644 index 5d91d9f..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/Options.js +++ /dev/null @@ -1,365 +0,0 @@ -'use strict'; - -const { randomUUID } = require('node:crypto'); -const { UserAgent } = require('./Constants'); -const Intents = require('./Intents'); - -/** - * Rate limit data - * @typedef {Object} RateLimitData - * @property {number} timeout Time until this rate limit ends, in milliseconds - * @property {number} limit The maximum amount of requests of this endpoint - * @property {string} method The HTTP method of this request - * @property {string} path The path of the request relative to the HTTP endpoint - * @property {string} route The route of the request relative to the HTTP endpoint - * @property {boolean} global Whether this is a global rate limit - */ - -/** - * Whether this rate limit should throw an Error - * @typedef {Function} RateLimitQueueFilter - * @param {RateLimitData} rateLimitData The data of this rate limit - * @returns {boolean|Promise} - */ - -/** - * @typedef {Function} CacheFactory - * @param {Function} manager The manager class the cache is being requested from. - * @param {Function} holds The class that the cache will hold. - * @returns {Collection} A Collection used to store the cache of the manager. - */ - -/** - * @typedef {Function} CaptchaSolver - * @param {Captcha} captcha Discord Captcha - * @param {string} UserAgent Current UserAgent - * @returns {Promise} HCaptcha Token - * @example - * const Captcha = require("2captcha") - * // A new 'solver' instance with our API key - * const solver = new Captcha.Solver("") - * function solveCaptcha(captcha, UA) { - * return solver.hcaptcha(captcha.captcha_sitekey, 'discord.com', { - * invisible: 1, - * userAgent: UA, - * data: captcha.captcha_rqdata, - * }).then(res => res.data) - * } - */ - -/** - * Options for a client. - * @typedef {Object} ClientOptions - * @property {number} [DMChannelVoiceStatusSync=0] The amount of time in milliseconds that the Client to register the event with each DM channel (0=Disable) - * @property {number} [captchaRetryLimit=3] Captcha retry limit - * @property {CaptchaSolver} [captchaSolver] Captcha Solver - * @property {string} [TOTPKey] TOTP key / 2FA Key for two-factor authentication - * This is a 32-character Base32 string (excluding spaces), typically shown only once during your 2FA setup (QR code), or in the "Manual Entry" section. - * The library automatically removes spaces and converts the secret to uppercase. - * Example value: 'ftc3 uz6q 5lpw 2kew 4thr vtyp n2cu topn' or 'WSLIVE6EKYSRMVRBZLFGG2KVIVJMMQY5' - * @property {number} [closeTimeout=5000] The amount of time in milliseconds to wait for the close frame to be received - * from the WebSocket. - * Don't have this too high/low. It's best to have it between 2000-6000 ms. - * (e.g. recommended shard count, shard count of the ShardingManager) - * @property {CacheFactory} [makeCache] Function to create a cache. - * You can use your own function, or the {@link Options} class to customize the Collection used for the cache. - * Overriding the cache used in `GuildManager`, `ChannelManager`, `GuildChannelManager`, `RoleManager`, - * and `PermissionOverwriteManager` is unsupported and **will** break functionality - * @property {number} [messageCacheLifetime=0] DEPRECATED: Pass `lifetime` to `sweepers.messages` instead. - * How long a message should stay in the cache until it is considered sweepable (in seconds, 0 for forever) - * @property {number} [messageSweepInterval=0] DEPRECATED: Pass `interval` to `sweepers.messages` instead. - * How frequently to remove messages from the cache that are older than the message cache lifetime - * (in seconds, 0 for never) - * @property {MessageMentionOptions} [allowedMentions] Default value for {@link MessageOptions#allowedMentions} - * @property {number} [invalidRequestWarningInterval=0] The number of invalid REST requests (those that return - * 401, 403, or 429) in a 10 minute window between emitted warnings (0 for no warnings). That is, if set to 500, - * warnings will be emitted at invalid request number 500, 1000, 1500, and so on. - * @property {PartialType[]} [partials=['USER', 'CHANNEL', 'GUILD_MEMBER', 'MESSAGE', 'REACTION', 'GUILD_SCHEDULED_EVENT']] Structures allowed to be partial. This means events can be emitted even when - * they're missing all the data for a particular structure. See the "Partial Structures" topic on the - * [guide](https://discordjs.guide/popular-topics/partials.html) for some - * important usage information, as partials require you to put checks in place when handling data. - * @property {number} [restWsBridgeTimeout=5000] Maximum time permitted between REST responses and their - * corresponding WebSocket events - * @property {number} [restTimeOffset=500] Extra time in milliseconds to wait before continuing to make REST - * requests (higher values will reduce rate-limiting errors on bad connections) - * @property {number} [restRequestTimeout=15000] Time to wait before cancelling a REST request, in milliseconds - * @property {number} [restSweepInterval=60] How frequently to delete inactive request buckets, in seconds - * (or 0 for never) - * @property {number} [restGlobalRateLimit=0] How many requests to allow sending per second (0 for unlimited, 50 for - * the standard global limit used by Discord) - * @property {string[]|RateLimitQueueFilter} [rejectOnRateLimit] Decides how rate limits and pre-emptive throttles - * should be handled. If this option is an array containing the prefix of the request route (e.g. /channels to match any - * route starting with /channels, such as /channels/222197033908436994/messages) or a function returning true, a - * {@link RateLimitError} will be thrown. Otherwise the request will be queued for later - * @property {number} [retryLimit=1] How many times to retry on 5XX errors - * (Infinity for an indefinite amount of retries) - * @property {boolean} [failIfNotExists=true] Default value for {@link ReplyMessageOptions#failIfNotExists} - * @property {PresenceData} [presence={ status: 'online', since: 0, activities: [], afk: false }] Presence data to use upon login - * @property {number} [waitGuildTimeout=15_000] Time in milliseconds that Clients with the GUILDS intent should wait for - * missing guilds to be received before starting the bot. If not specified, the default is 15 seconds. - * @property {SweeperOptions} [sweepers={}] Options for cache sweeping - * @property {WebsocketOptions} [ws] Options for the WebSocket - * @property {HTTPOptions} [http] HTTP options - */ - -/** - * Options for {@link Sweepers} defining the behavior of cache sweeping - * @typedef {Object} SweeperOptions - */ - -/** - * Options for sweeping a single type of item from cache - * @typedef {Object} SweepOptions - * @property {number} interval The interval (in seconds) at which to perform sweeping of the item - * @property {number} [lifetime] How long an item should stay in cache until it is considered sweepable. - * This property is only valid for the `invites`, `messages`, and `threads` keys. The `filter` property - * is mutually exclusive to this property and takes priority - * @property {GlobalSweepFilter} filter The function used to determine the function passed to the sweep method - * This property is optional when the key is `invites`, `messages`, or `threads` and `lifetime` is set - */ - -/** - * WebSocket options (these are left as snake_case to match the API) - * @typedef {Object} WebsocketOptions - * @property {AgentOptions} [agent={}] HTTPS Agent options (WS Proxy) - * @property {boolean} [compress=false] Whether to compress data sent on the connection - * @property {WebSocketProperties} [properties] Properties to identify the client with - */ - -/** - * HTTPS Agent options. - * @typedef {Object} AgentOptions - * @see {@link https://nodejs.org/api/https.html#https_class_https_agent} - * @see {@link https://nodejs.org/api/http.html#http_new_agent_options} - */ - -/** - * ProxyAgent options. - * @typedef {Object} ProxyAgentOptions - * @see {@link https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md} - */ - -/** - * HTTP options - * @typedef {Object} HTTPOptions - * @property {number} [version=9] API version to use - * @property {ProxyAgentOptions} [agent={}] ProxyAgent options - * @property {string} [api='https://discord.com/api'] Base URL of the API - * @property {string} [cdn='https://cdn.discordapp.com'] Base URL of the CDN - * @property {string} [invite='https://discord.gg'] Base URL of invites - * @property {string} [template='https://discord.new'] Base URL of templates - * @property {Object} [headers] Additional headers to send for all API requests - * @property {string} [scheduledEvent='https://discord.com/events'] Base URL of guild scheduled events - */ - -/** - * Contains various utilities for client options. - */ -class Options extends null { - /** - * The default client options. - * @returns {ClientOptions} - */ - static createDefault() { - return { - DMChannelVoiceStatusSync: 0, - captchaRetryLimit: 3, - captchaSolver: () => { - const err = new Error('CAPTCHA_SOLVER_NOT_IMPLEMENTED'); - err.cause = - 'You need to provide a captcha solver to use this feature\nExample: const client = new Client({ captchaSolver: yourAsyncFunction })'; - throw err; - }, - TOTPKey: null, - closeTimeout: 5_000, - waitGuildTimeout: 15_000, - shardCount: 1, - shards: [0], - makeCache: this.cacheWithLimits(this.defaultMakeCacheSettings), - messageCacheLifetime: 0, - messageSweepInterval: 0, - invalidRequestWarningInterval: 0, - intents: Intents.ALL, - partials: [ - 'USER', - 'CHANNEL', - 'GUILD_MEMBER', - 'MESSAGE', - 'REACTION', - 'GUILD_SCHEDULED_EVENT', - ], // Enable the partials - restWsBridgeTimeout: 5_000, - restRequestTimeout: 15_000, - restGlobalRateLimit: 0, - retryLimit: 1, - restTimeOffset: 500, - restSweepInterval: 60, - failIfNotExists: true, - presence: { status: 'online', since: 0, activities: [], afk: true }, - sweepers: {}, - ws: { - capabilities: 0, // https://discord-userdoccers.vercel.app/topics/gateway#gateway-capabilities - properties: { - os: 'Windows', - browser: 'Discord Client', - release_channel: 'stable', - client_version: '1.0.9210', - os_version: '10.0.19044', - os_arch: 'x64', - app_arch: 'x64', - system_locale: 'en-US', - has_client_mods: false, - client_launch_id: randomUUID(), - browser_user_agent: UserAgent, - browser_version: '35.3.0', - os_sdk_version: '19044', - client_build_number: 455964, - native_build_number: 69976, - client_event_source: null, - launch_signature: randomUUID(), - client_heartbeat_session_id: randomUUID(), - client_app_state: 'focused', - }, - compress: false, - client_state: { - guild_versions: {}, - }, - version: 9, - agent: {}, - }, - http: { - agent: {}, - headers: { - 'User-Agent': UserAgent, - }, - version: 9, - api: 'https://discord.com/api', - cdn: 'https://cdn.discordapp.com', - invite: 'https://discord.gg', - template: 'https://discord.new', - scheduledEvent: 'https://discord.com/events', - }, - }; - } - - /** - * Create a cache factory using predefined settings to sweep or limit. - * @param {Object} [settings={}] Settings passed to the relevant constructor. - * If no setting is provided for a manager, it uses Collection. - * If a number is provided for a manager, it uses that number as the max size for a LimitedCollection. - * If LimitedCollectionOptions are provided for a manager, it uses those settings to form a LimitedCollection. - * @returns {CacheFactory} - * @example - * // Store up to 200 messages per channel and discard archived threads if they were archived more than 4 hours ago. - * // Note archived threads will remain in the guild and client caches with these settings - * Options.cacheWithLimits({ - * MessageManager: 200, - * ThreadManager: { - * sweepInterval: 3600, - * sweepFilter: LimitedCollection.filterByLifetime({ - * getComparisonTimestamp: e => e.archiveTimestamp, - * excludeFromSweep: e => !e.archived, - * }), - * }, - * }); - * @example - * // Sweep messages every 5 minutes, removing messages that have not been edited or created in the last 30 minutes - * Options.cacheWithLimits({ - * // Keep default thread sweeping behavior - * ...Options.defaultMakeCacheSettings, - * // Override MessageManager - * MessageManager: { - * sweepInterval: 300, - * sweepFilter: LimitedCollection.filterByLifetime({ - * lifetime: 1800, - * getComparisonTimestamp: e => e.editedTimestamp ?? e.createdTimestamp, - * }) - * } - * }); - */ - static cacheWithLimits(settings = {}) { - const { Collection } = require('@discordjs/collection'); - const LimitedCollection = require('./LimitedCollection'); - - return (manager) => { - const setting = settings[manager.name]; - /* eslint-disable-next-line eqeqeq */ - if (setting == null) { - return new Collection(); - } - if (typeof setting === 'number') { - if (setting === Infinity) { - return new Collection(); - } - return new LimitedCollection({ maxSize: setting }); - } - /* eslint-disable eqeqeq */ - const noSweeping = - setting.sweepFilter == null || - setting.sweepInterval == null || - setting.sweepInterval <= 0 || - setting.sweepInterval === Infinity; - const noLimit = setting.maxSize == null || setting.maxSize === Infinity; - /* eslint-enable eqeqeq */ - if (noSweeping && noLimit) { - return new Collection(); - } - return new LimitedCollection(setting); - }; - } - - /** - * Create a cache factory that always caches everything. - * @returns {CacheFactory} - */ - static cacheEverything() { - const { Collection } = require('@discordjs/collection'); - return () => new Collection(); - } - - /** - * The default settings passed to {@link ClientOptions.makeCache}. - * The caches that this changes are: - * * `MessageManager` - Limit to 200 messages - * * `ChannelManager` - Sweep archived threads - * * `GuildChannelManager` - Sweep archived threads - * * `ThreadManager` - Sweep archived threads - * If you want to keep default behavior and add on top of it you can use this object and add on to it, e.g. - * `makeCache: Options.cacheWithLimits({ ...Options.defaultMakeCacheSettings, ReactionManager: 0 })` - * @type {Object} - */ - static get defaultMakeCacheSettings() { - return { - MessageManager: 200, - ChannelManager: { - sweepInterval: 3600, - sweepFilter: require('./Util').archivedThreadSweepFilter(), - }, - GuildChannelManager: { - sweepInterval: 3600, - sweepFilter: require('./Util').archivedThreadSweepFilter(), - }, - ThreadManager: { - sweepInterval: 3600, - sweepFilter: require('./Util').archivedThreadSweepFilter(), - }, - }; - } -} - -/** - * The default settings passed to {@link ClientOptions.sweepers}. - * The sweepers that this changes are: - * * `threads` - Sweep archived threads every hour, removing those archived more than 4 hours ago - * If you want to keep default behavior and add on top of it you can use this object and add on to it, e.g. - * `sweepers: { ...Options.defaultSweeperSettings, messages: { interval: 300, lifetime: 600 } }` - * @type {SweeperOptions} - */ -Options.defaultSweeperSettings = { - threads: { - interval: 3600, - lifetime: 14400, - }, -}; - -module.exports = Options; diff --git a/vendor/discord.js-selfbot-v13/src/util/Permissions.js b/vendor/discord.js-selfbot-v13/src/util/Permissions.js deleted file mode 100644 index 326f691..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/Permissions.js +++ /dev/null @@ -1,215 +0,0 @@ -'use strict'; - -const BitField = require('./BitField'); - -/** - * Data structure that makes it easy to interact with a permission bitfield. All {@link GuildMember}s have a set of - * permissions in their guild, and each channel in the guild may also have {@link PermissionOverwrites} for the member - * that override their default permissions. - * @extends {BitField} - */ -class Permissions extends BitField { - /** - * Bitfield of the packed bits - * @type {bigint} - * @name Permissions#bitfield - */ - - /** - * Data that can be resolved to give a permission number. This can be: - * * A string (see {@link Permissions.FLAGS}) - * * A permission number - * * An instance of Permissions - * * An Array of PermissionResolvable - * @typedef {string|bigint|Permissions|PermissionResolvable[]} PermissionResolvable - */ - - /** - * Gets all given bits that are missing from the bitfield. - * @param {BitFieldResolvable} bits Bit(s) to check for - * @param {boolean} [checkAdmin=true] Whether to allow the administrator permission to override - * @returns {string[]} - */ - missing(bits, checkAdmin = true) { - return checkAdmin && this.has(this.constructor.FLAGS.ADMINISTRATOR) - ? [] - : super.missing(bits); - } - - /** - * Checks whether the bitfield has a permission, or any of multiple permissions. - * @param {PermissionResolvable} permission Permission(s) to check for - * @param {boolean} [checkAdmin=true] Whether to allow the administrator permission to override - * @returns {boolean} - */ - any(permission, checkAdmin = true) { - return ( - (checkAdmin && super.has(this.constructor.FLAGS.ADMINISTRATOR)) || - super.any(permission) - ); - } - - /** - * Checks whether the bitfield has a permission, or multiple permissions. - * @param {PermissionResolvable} permission Permission(s) to check for - * @param {boolean} [checkAdmin=true] Whether to allow the administrator permission to override - * @returns {boolean} - */ - has(permission, checkAdmin = true) { - return ( - (checkAdmin && super.has(this.constructor.FLAGS.ADMINISTRATOR)) || - super.has(permission) - ); - } - - /** - * Gets an {@link Array} of bitfield names based on the permissions available. - * @returns {string[]} - */ - toArray() { - return super.toArray(false); - } -} - -/** - * Numeric permission flags. All available properties: - * * `CREATE_INSTANT_INVITE` (create invitations to the guild) - * * `KICK_MEMBERS` - * * `BAN_MEMBERS` - * * `ADMINISTRATOR` (implicitly has *all* permissions, and bypasses all channel overwrites) - * * `MANAGE_CHANNELS` (edit and reorder channels) - * * `MANAGE_GUILD` (edit the guild information, region, etc.) - * * `ADD_REACTIONS` (add new reactions to messages) - * * `VIEW_AUDIT_LOG` - * * `PRIORITY_SPEAKER` - * * `STREAM` - * * `VIEW_CHANNEL` - * * `SEND_MESSAGES` - * * `SEND_TTS_MESSAGES` - * * `MANAGE_MESSAGES` (delete messages and reactions) - * * `EMBED_LINKS` (links posted will have a preview embedded) - * * `ATTACH_FILES` - * * `READ_MESSAGE_HISTORY` (view messages that were posted prior to opening Discord) - * * `MENTION_EVERYONE` - * * `USE_EXTERNAL_EMOJIS` (use emojis from different guilds) - * * `VIEW_GUILD_INSIGHTS` - * * `CONNECT` (connect to a voice channel) - * * `SPEAK` (speak in a voice channel) - * * `MUTE_MEMBERS` (mute members across all voice channels) - * * `DEAFEN_MEMBERS` (deafen members across all voice channels) - * * `MOVE_MEMBERS` (move members between voice channels) - * * `USE_VAD` (use voice activity detection) - * * `CHANGE_NICKNAME` - * * `MANAGE_NICKNAMES` (change other members' nicknames) - * * `MANAGE_ROLES` - * * `MANAGE_WEBHOOKS` - * * `MANAGE_EMOJIS_AND_STICKERS` - * * `USE_APPLICATION_COMMANDS` - * * `REQUEST_TO_SPEAK` - * * `MANAGE_EVENTS` - * * `MANAGE_THREADS` - * * `USE_PUBLIC_THREADS` (deprecated) - * * `CREATE_PUBLIC_THREADS` - * * `USE_PRIVATE_THREADS` (deprecated) - * * `CREATE_PRIVATE_THREADS` - * * `USE_EXTERNAL_STICKERS` (use stickers from different guilds) - * * `SEND_MESSAGES_IN_THREADS` - * * `START_EMBEDDED_ACTIVITIES` - * * `MODERATE_MEMBERS` - * * `VIEW_CREATOR_MONETIZATION_ANALYTICS` - * * `USE_SOUNDBOARD` - * * `CREATE_GUILD_EXPRESSIONS` - * * `CREATE_EVENTS` - * * `USE_EXTERNAL_SOUNDS` - * * `SEND_VOICE_MESSAGES` - * * `USE_CLYDE_AI` - * * `SET_VOICE_CHANNEL_STATUS` - * * `SEND_POLLS` - * * `USE_EXTERNAL_APPS` - * @type {Object} - * @see {@link https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags} - */ -Permissions.FLAGS = { - CREATE_INSTANT_INVITE: 1n << 0n, - KICK_MEMBERS: 1n << 1n, - BAN_MEMBERS: 1n << 2n, - ADMINISTRATOR: 1n << 3n, - MANAGE_CHANNELS: 1n << 4n, - MANAGE_GUILD: 1n << 5n, - ADD_REACTIONS: 1n << 6n, - VIEW_AUDIT_LOG: 1n << 7n, - PRIORITY_SPEAKER: 1n << 8n, - STREAM: 1n << 9n, - VIEW_CHANNEL: 1n << 10n, - SEND_MESSAGES: 1n << 11n, - SEND_TTS_MESSAGES: 1n << 12n, - MANAGE_MESSAGES: 1n << 13n, - EMBED_LINKS: 1n << 14n, - ATTACH_FILES: 1n << 15n, - READ_MESSAGE_HISTORY: 1n << 16n, - MENTION_EVERYONE: 1n << 17n, - USE_EXTERNAL_EMOJIS: 1n << 18n, - VIEW_GUILD_INSIGHTS: 1n << 19n, - CONNECT: 1n << 20n, - SPEAK: 1n << 21n, - MUTE_MEMBERS: 1n << 22n, - DEAFEN_MEMBERS: 1n << 23n, - MOVE_MEMBERS: 1n << 24n, - USE_VAD: 1n << 25n, - CHANGE_NICKNAME: 1n << 26n, - MANAGE_NICKNAMES: 1n << 27n, - MANAGE_ROLES: 1n << 28n, - MANAGE_WEBHOOKS: 1n << 29n, - MANAGE_EMOJIS_AND_STICKERS: 1n << 30n, - USE_APPLICATION_COMMANDS: 1n << 31n, - REQUEST_TO_SPEAK: 1n << 32n, - MANAGE_EVENTS: 1n << 33n, - MANAGE_THREADS: 1n << 34n, - // TODO: Remove deprecated USE_*_THREADS flags in v14 - USE_PUBLIC_THREADS: 1n << 35n, - CREATE_PUBLIC_THREADS: 1n << 35n, - USE_PRIVATE_THREADS: 1n << 36n, - CREATE_PRIVATE_THREADS: 1n << 36n, - USE_EXTERNAL_STICKERS: 1n << 37n, - SEND_MESSAGES_IN_THREADS: 1n << 38n, - START_EMBEDDED_ACTIVITIES: 1n << 39n, - MODERATE_MEMBERS: 1n << 40n, - VIEW_CREATOR_MONETIZATION_ANALYTICS: 1n << 41n, - USE_SOUNDBOARD: 1n << 42n, - CREATE_GUILD_EXPRESSIONS: 1n << 43n, - CREATE_EVENTS: 1n << 44n, - USE_EXTERNAL_SOUNDS: 1n << 45n, - SEND_VOICE_MESSAGES: 1n << 46n, - USE_CLYDE_AI: 1n << 47n, - SET_VOICE_CHANNEL_STATUS: 1n << 48n, - SEND_POLLS: 1n << 49n, - USE_EXTERNAL_APPS: 1n << 50n, -}; - -/** - * Bitfield representing every permission combined - * @type {bigint} - */ -Permissions.ALL = Object.values(Permissions.FLAGS).reduce( - (all, p) => all | p, - 0n, -); - -/** - * Bitfield representing the default permissions for users - * @type {bigint} - */ -Permissions.DEFAULT = BigInt(104324673); - -/** - * Bitfield representing the permissions required for moderators of stage channels - * @type {bigint} - */ -Permissions.STAGE_MODERATOR = - Permissions.FLAGS.MANAGE_CHANNELS | - Permissions.FLAGS.MUTE_MEMBERS | - Permissions.FLAGS.MOVE_MEMBERS; - -Permissions.defaultBit = BigInt(0); - -module.exports = Permissions; diff --git a/vendor/discord.js-selfbot-v13/src/util/PremiumUsageFlags.js b/vendor/discord.js-selfbot-v13/src/util/PremiumUsageFlags.js deleted file mode 100644 index 2aede1e..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/PremiumUsageFlags.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -const BitField = require('./BitField'); - -/** - * Data structure that makes it easy to interact with an {@link PremiumUsageFlags#flags} bitfield. - * @extends {BitField} - */ -class PremiumUsageFlags extends BitField {} - -/** - * @name PremiumUsageFlags - * @kind constructor - * @memberof PremiumUsageFlags - * @param {BitFieldResolvable} [bits=0] Bit(s) to read from - */ - -/** - * Numeric the Discord premium usage flags. All available properties: - * * `PREMIUM_DISCRIMINATOR` - * * `ANIMATED_AVATAR` - * * `PROFILE_BANNER` - * @type {Object} - */ -PremiumUsageFlags.FLAGS = { - PREMIUM_DISCRIMINATOR: 1 << 0, - ANIMATED_AVATAR: 1 << 1, - PROFILE_BANNER: 1 << 2, -}; - -module.exports = PremiumUsageFlags; diff --git a/vendor/discord.js-selfbot-v13/src/util/PurchasedFlags.js b/vendor/discord.js-selfbot-v13/src/util/PurchasedFlags.js deleted file mode 100644 index 888768c..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/PurchasedFlags.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -const BitField = require('./BitField'); - -/** - * Data structure that makes it easy to interact with an {@link PurchasedFlags#flags} bitfield. - * @extends {BitField} - */ -class PurchasedFlags extends BitField {} - -/** - * @name PurchasedFlags - * @kind constructor - * @memberof PurchasedFlags - * @param {BitFieldResolvable} [bits=0] Bit(s) to read from - */ - -/** - * Numeric the Discord purchased flags. All available properties: - * * `NITRO_CLASSIC` - * * `NITRO` - * * `GUILD_BOOST` - * * `NITRO_BASIC` - * @type {Object} - */ -PurchasedFlags.FLAGS = { - NITRO_CLASSIC: 1 << 0, - NITRO: 1 << 1, - GUILD_BOOST: 1 << 2, - NITRO_BASIC: 1 << 3, -}; - -module.exports = PurchasedFlags; diff --git a/vendor/discord.js-selfbot-v13/src/util/RemoteAuth.js b/vendor/discord.js-selfbot-v13/src/util/RemoteAuth.js deleted file mode 100644 index fa802f9..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/RemoteAuth.js +++ /dev/null @@ -1,387 +0,0 @@ -'use strict'; - -const { Buffer } = require('node:buffer'); -const crypto = require('node:crypto'); -const EventEmitter = require('node:events'); -const { StringDecoder } = require('node:string_decoder'); -const { setTimeout } = require('node:timers'); -const { fetch } = require('undici'); -const WebSocket = require('ws'); -const { UserAgent } = require('./Constants'); -const Options = require('./Options'); - -const defaultClientOptions = Options.createDefault(); - -const baseURL = 'https://discord.com/ra/'; - -const wsURL = 'wss://remote-auth-gateway.discord.gg/?v=2'; - -const receiveEvent = { - HELLO: 'hello', - NONCE_PROOF: 'nonce_proof', - PENDING_REMOTE_INIT: 'pending_remote_init', - HEARTBEAT_ACK: 'heartbeat_ack', - PENDING_TICKET: 'pending_ticket', - CANCEL: 'cancel', - PENDING_LOGIN: 'pending_login', -}; - -const sendEvent = { - INIT: 'init', - NONCE_PROOF: 'nonce_proof', - HEARTBEAT: 'heartbeat', -}; - -const Event = { - READY: 'ready', - ERROR: 'error', - CANCEL: 'cancel', - WAIT_SCAN: 'pending', - FINISH: 'finish', - CLOSED: 'closed', - DEBUG: 'debug', -}; - -/** - * Discord Auth QR - * @extends {EventEmitter} - * @abstract - */ -class DiscordAuthWebsocket extends EventEmitter { - #ws = null; - #heartbeatInterval = null; - #expire = null; - #publicKey = null; - #privateKey = null; - #ticket = null; - #fingerprint = ''; - #userDecryptString = ''; - - /** - * Creates a new DiscordAuthWebsocket instance. - */ - constructor() { - super(); - this.token = ''; - } - - /** - * @type {string} - */ - get AuthURL() { - return baseURL + this.#fingerprint; - } - - /** - * @type {Date} - */ - get exprire() { - return this.#expire; - } - - /** - * @type {UserRaw} - */ - get user() { - return DiscordAuthWebsocket.decryptUser(this.#userDecryptString); - } - - #createWebSocket(url) { - this.#ws = new WebSocket(url, { - headers: { - Origin: 'https://discord.com', - 'User-Agent': UserAgent, - }, - }); - this.#handleWebSocket(); - } - - #handleWebSocket() { - this.#ws.on('error', (error) => { - /** - * WS Error - * @event DiscordAuthWebsocket#error - * @param {Error} error Error - */ - this.emit(Event.ERROR, error); - }); - this.#ws.on('open', () => { - /** - * Debug Event - * @event DiscordAuthWebsocket#debug - * @param {string} msg Debug msg - */ - this.emit(Event.DEBUG, '[WS] Client Connected'); - }); - this.#ws.on('close', () => { - this.emit(Event.DEBUG, '[WS] Connection closed'); - }); - this.#ws.on('message', this.#handleMessage.bind(this)); - } - - #handleMessage(message) { - message = JSON.parse(message); - switch (message.op) { - case receiveEvent.HELLO: { - this.#ready(message); - break; - } - - case receiveEvent.NONCE_PROOF: { - this.#receiveNonceProof(message); - break; - } - - case receiveEvent.PENDING_REMOTE_INIT: { - this.#fingerprint = message.fingerprint; - /** - * Ready Event - * @event DiscordAuthWebsocket#ready - * @param {DiscordAuthWebsocket} client WS - */ - this.emit(Event.READY, this); - break; - } - - case receiveEvent.HEARTBEAT_ACK: { - this.emit(Event.DEBUG, `Heartbeat acknowledged.`); - this.#heartbeatAck(); - break; - } - - case receiveEvent.PENDING_TICKET: { - this.#pendingLogin(message); - break; - } - - case receiveEvent.CANCEL: { - /** - * Cancel - * @event DiscordAuthWebsocket#cancel - * @param {DiscordAuthWebsocket} client WS - */ - this.emit(Event.CANCEL, this); - this.destroy(); - break; - } - - case receiveEvent.PENDING_LOGIN: { - this.#ticket = message.ticket; - this.#findRealToken(); - break; - } - } - } - - #send(op, data) { - if (!this.#ws) return; - let payload = { op: op }; - if (data !== null) payload = { ...payload, ...data }; - this.#ws.send(JSON.stringify(payload)); - } - - #heartbeatAck() { - setTimeout(() => { - this.#send(sendEvent.HEARTBEAT); - }, this.#heartbeatInterval).unref(); - } - - #ready(data) { - this.emit(Event.DEBUG, 'Attempting server handshake...'); - this.#expire = new Date(Date.now() + data.timeout_ms); - this.#heartbeatInterval = data.heartbeat_interval; - this.#createKey(); - this.#heartbeatAck(); - this.#init(); - } - - #createKey() { - const key = crypto.generateKeyPairSync('rsa', { - modulusLength: 2048, - publicKeyEncoding: { - type: 'spki', - format: 'pem', - }, - privateKeyEncoding: { - type: 'pkcs1', - format: 'pem', - }, - }); - this.#privateKey = key.privateKey; - this.#publicKey = key.publicKey; - } - - #encodePublicKey() { - const decoder = new StringDecoder('utf-8'); - let pub_key = decoder.write(this.#publicKey); - pub_key = pub_key.split('\n').slice(1, -2).join(''); - return pub_key; - } - - #init() { - const public_key = this.#encodePublicKey(); - this.#send(sendEvent.INIT, { encoded_public_key: public_key }); - } - - #receiveNonceProof(data) { - const nonce = data.encrypted_nonce; - const decrypted_nonce = this.#decryptPayload(nonce); - const proof = crypto - .createHash('sha256') - .update(decrypted_nonce) - .digest() - .toString('base64') - .replace(/\+/g, '-') - .replace(/\//g, '_') - .replace(/=+/, '') - .replace(/\s+$/, ''); - this.#send(sendEvent.NONCE_PROOF, { proof: proof }); - } - - #decryptPayload(encrypted_payload) { - const payload = Buffer.from(encrypted_payload, 'base64'); - const decoder = new StringDecoder('utf-8'); - const private_key = decoder.write(this.#privateKey); - const data = crypto.privateDecrypt( - { - key: private_key, - padding: crypto.constants.RSA_PKCS1_OAEP_PADDING, - oaepHash: 'sha256', - }, - payload, - ); - return data; - } - - #pendingLogin(data) { - const user_data = this.#decryptPayload(data.encrypted_user_payload); - this.#userDecryptString = user_data.toString(); - - /** - * @typedef {Object} UserRaw - * @property {Snowflake} id - * @property {string} username - * @property {number} discriminator - * @property {string} avatar - */ - - /** - * Emitted whenever a user is scan QR Code. - * @event DiscordAuthWebsocket#pending - * @param {UserRaw} user Discord User Raw - */ - this.emit(Event.WAIT_SCAN, this.user); - } - - #awaitLogin(client) { - return new Promise((r) => { - this.once(Event.FINISH, (token) => { - r(client.login(token)); - }); - }); - } - - /** - * Connect WS - * @param {Client} [client] DiscordJS Client - * @returns {Promise} - */ - connect(client) { - this.#createWebSocket(wsURL); - if (client) { - return this.#awaitLogin(client); - } else { - return Promise.resolve(); - } - } - - /** - * Destroy client - * @returns {void} - */ - destroy() { - if (!this.ws) return; - this.ws.close(); - this.emit(Event.DEBUG, 'WebSocket closed.'); - /** - * Emitted whenever a connection is closed. - * @event DiscordAuthWebsocket#closed - */ - this.emit(Event.CLOSED); - } - - /** - * Generate QR code for user to scan (Terminal) - * @returns {void} - */ - generateQR() { - if (!this.#fingerprint) return; - require('qrcode').toString( - this.AuthURL, - { type: 'utf8', errorCorrectionLevel: 'L' }, - (err, url) => { - if (err) { - // - } - console.log(url); - }, - ); - } - - #findRealToken() { - return fetch(`https://discord.com/api/v9/users/@me/remote-auth/login`, { - method: 'POST', - headers: { - Accept: '*/*', - 'Accept-Language': 'en-US', - 'Content-Type': 'application/json', - 'Sec-Fetch-Dest': 'empty', - 'Sec-Fetch-Mode': 'cors', - 'Sec-Fetch-Site': 'same-origin', - 'X-Debug-Options': 'bugReporterEnabled', - 'X-Super-Properties': `${Buffer.from( - JSON.stringify(defaultClientOptions.ws.properties), - 'ascii', - ).toString('base64')}`, - 'X-Discord-Locale': 'en-US', - 'User-Agent': UserAgent, - Referer: 'https://discord.com/channels/@me', - Connection: 'keep-alive', - Origin: 'https://discord.com', - }, - body: JSON.stringify({ - ticket: this.#ticket, - }), - }) - .then((r) => r.json()) - .then((res) => { - if (res.encrypted_token) { - this.token = this.#decryptPayload(res.encrypted_token).toString(); - } - /** - * Emitted whenever a real token is found. - * @event DiscordAuthWebsocket#finish - * @param {string} token Discord Token - */ - this.emit(Event.FINISH, this.token); - this.destroy(); - }) - .catch(() => false); - } - - static decryptUser(payload) { - const values = payload.split(':'); - const id = values[0]; - const username = values[3]; - const discriminator = values[1]; - const avatar = values[2]; - return { - id, - username, - discriminator, - avatar, - }; - } -} - -module.exports = DiscordAuthWebsocket; diff --git a/vendor/discord.js-selfbot-v13/src/util/RoleFlags.js b/vendor/discord.js-selfbot-v13/src/util/RoleFlags.js deleted file mode 100644 index 41e38ba..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/RoleFlags.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -const BitField = require('./BitField'); - -/** - * Data structure that makes it easy to interact with an {@link GuildMember#flags} bitfield. - * @extends {BitField} - */ -class RoleFlags extends BitField {} - -/** - * @name RoleFlags - * @kind constructor - * @memberof RoleFlags - * @param {BitFieldResolvable} [bits=0] Bit(s) to read from - */ - -/** - * Numeric guild member flags. All available properties: - * * `IN_PROMPT` - * @type {Object} - * @see {@link https://discord.com/developers/docs/topics/permissions#role-object-role-flags} - */ -RoleFlags.FLAGS = { - IN_PROMPT: 1 << 0, -}; - -/** - * Data that can be resolved to give a role flag bitfield. This can be: - * * A string (see {@link RoleFlags.FLAGS}) - * * A role flag - * * An instance of RoleFlags - * * An Array of RoleFlagsResolvable - * @typedef {string|number|RoleFlags|RoleFlagsResolvable[]} RoleFlagsResolvable - */ - -module.exports = RoleFlags; diff --git a/vendor/discord.js-selfbot-v13/src/util/SnowflakeUtil.js b/vendor/discord.js-selfbot-v13/src/util/SnowflakeUtil.js deleted file mode 100644 index d64fa2e..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/SnowflakeUtil.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -// Discord epoch (2015-01-01T00:00:00.000Z) -const EPOCH = 1_420_070_400_000; -let INCREMENT = BigInt(0); - -/** - * A container for useful snowflake-related methods. - */ -class SnowflakeUtil extends null { - /** - * A {@link https://docs.x.com/resources/fundamentals/x-ids Twitter snowflake}, - * except the epoch is 2015-01-01T00:00:00.000Z. - * - * If we have a snowflake '266241948824764416' we can represent it as binary: - * ``` - * 64 22 17 12 0 - * 000000111011000111100001101001000101000000 00001 00000 000000000000 - * number of milliseconds since Discord epoch worker pid increment - * ``` - * @typedef {string} Snowflake - */ - - /** - * Generates a Discord snowflake. - * This hardcodes the worker's id as 1 and the process's id as 0. - * @param {number|Date} [timestamp=Date.now()] Timestamp or date of the snowflake to generate - * @returns {Snowflake} The generated snowflake - */ - static generate(timestamp = Date.now()) { - if (timestamp instanceof Date) timestamp = timestamp.getTime(); - if (typeof timestamp !== 'number' || isNaN(timestamp)) { - throw new TypeError( - `"timestamp" argument must be a number (received ${isNaN(timestamp) ? 'NaN' : typeof timestamp})`, - ); - } - if (INCREMENT >= 4095n) INCREMENT = BigInt(0); - - // Assign WorkerId as 1 and ProcessId as 0: - return ( - (BigInt(timestamp - EPOCH) << 22n) | - (1n << 17n) | - INCREMENT++ - ).toString(); - } - - /** - * A deconstructed snowflake. - * @typedef {Object} DeconstructedSnowflake - * @property {number} timestamp Timestamp the snowflake was created - * @property {Date} date Date the snowflake was created - * @property {number} workerId The worker's id in the snowflake - * @property {number} processId The process's id in the snowflake - * @property {number} increment Increment in the snowflake - * @property {string} binary Binary representation of the snowflake - */ - - /** - * Deconstructs a Discord snowflake. - * @param {Snowflake} snowflake Snowflake to deconstruct - * @returns {DeconstructedSnowflake} - */ - static deconstruct(snowflake) { - const bigIntSnowflake = BigInt(snowflake); - return { - timestamp: Number(bigIntSnowflake >> 22n) + EPOCH, - get date() { - return new Date(this.timestamp); - }, - workerId: Number((bigIntSnowflake >> 17n) & 0b11111n), - processId: Number((bigIntSnowflake >> 12n) & 0b11111n), - increment: Number(bigIntSnowflake & 0b111111111111n), - binary: bigIntSnowflake.toString(2).padStart(64, '0'), - }; - } - - /** - * Retrieves the timestamp field's value from a Discord snowflake. - * @param {Snowflake} snowflake Snowflake to get the timestamp value from - * @returns {number} - */ - static timestampFrom(snowflake) { - return Number(BigInt(snowflake) >> 22n) + EPOCH; - } - - /** - * Discord's epoch value (2015-01-01T00:00:00.000Z). - * @type {number} - * @readonly - */ - static get EPOCH() { - return EPOCH; - } -} - -module.exports = SnowflakeUtil; diff --git a/vendor/discord.js-selfbot-v13/src/util/Speaking.js b/vendor/discord.js-selfbot-v13/src/util/Speaking.js deleted file mode 100644 index 5fda560..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/Speaking.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -const BitField = require('./BitField'); - -/** - * Data structure that makes it easy to interact with a {@link VoiceConnection#speaking} - * and {@link guildMemberSpeaking} event bitfields. - * @extends {BitField} - */ -class Speaking extends BitField {} - -/** - * @name Speaking - * @kind constructor - * @memberof Speaking - * @param {BitFieldResolvable} [bits=0] Bit(s) to read from - */ - -/** - * Numeric speaking flags. All available properties: - * * `SPEAKING` - * * `SOUNDSHARE` - * * `PRIORITY_SPEAKING` - * @type {Object} - * @see {@link https://discord.com/developers/docs/topics/voice-connections#speaking} - */ -Speaking.FLAGS = { - SPEAKING: 1 << 0, - SOUNDSHARE: 1 << 1, - PRIORITY_SPEAKING: 1 << 2, -}; - -module.exports = Speaking; diff --git a/vendor/discord.js-selfbot-v13/src/util/Sweepers.js b/vendor/discord.js-selfbot-v13/src/util/Sweepers.js deleted file mode 100644 index 6d8e02f..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/Sweepers.js +++ /dev/null @@ -1,505 +0,0 @@ -'use strict'; - -const { setInterval } = require('node:timers'); -const { Events, ThreadChannelTypes, SweeperKeys } = require('./Constants'); -const { TypeError } = require('../errors/DJSError.js'); - -/** - * @typedef {Function} GlobalSweepFilter - * @returns {Function|null} Return `null` to skip sweeping, otherwise a function passed to `sweep()`, - * See {@link [Collection#sweep](https://discord.js.org/docs/packages/collection/stable/Collection:Class#sweep)} - * for the definition of this function. - */ - -/** - * A container for all cache sweeping intervals and their associated sweep methods. - */ -class Sweepers { - constructor(client, options) { - /** - * The client that instantiated this - * @type {Client} - * @readonly - */ - Object.defineProperty(this, 'client', { value: client }); - - /** - * The options the sweepers were instantiated with - * @type {SweeperOptions} - */ - this.options = options; - - /** - * A record of interval timeout that is used to sweep the indicated items, or null if not being swept - * @type {Object} - */ - this.intervals = Object.fromEntries(SweeperKeys.map((key) => [key, null])); - - for (const key of SweeperKeys) { - if (!(key in options)) continue; - - this._validateProperties(key); - - const clonedOptions = { ...this.options[key] }; - - // Handle cases that have a "lifetime" - if (!('filter' in clonedOptions)) { - switch (key) { - case 'invites': - clonedOptions.filter = this.constructor.expiredInviteSweepFilter( - clonedOptions.lifetime, - ); - break; - case 'messages': - clonedOptions.filter = this.constructor.outdatedMessageSweepFilter( - clonedOptions.lifetime, - ); - break; - case 'threads': - clonedOptions.filter = this.constructor.archivedThreadSweepFilter( - clonedOptions.lifetime, - ); - } - } - - this._initInterval( - key, - `sweep${key[0].toUpperCase()}${key.slice(1)}`, - clonedOptions, - ); - } - } - - /** - * Sweeps all guild and global application commands and removes the ones which are indicated by the filter. - * @param {Function} filter The function used to determine which commands will be removed from the caches. - * @returns {number} Amount of commands that were removed from the caches - */ - sweepApplicationCommands(filter) { - const { guilds, items: guildCommands } = this._sweepGuildDirectProp( - 'commands', - filter, - { emit: false }, - ); - - const globalCommands = - this.client.application?.commands.cache.sweep(filter) ?? 0; - - this.client.emit( - Events.CACHE_SWEEP, - `Swept ${globalCommands} global application commands and ${guildCommands} guild commands in ${guilds} guilds.`, - ); - return guildCommands + globalCommands; - } - - /** - * Sweeps all auto moderation rules and removes the ones which are indicated by the filter. - * @param {Function} filter The function used to determine - * which auto moderation rules will be removed from the caches - * @returns {number} Amount of auto moderation rules that were removed from the caches - */ - sweepAutoModerationRules(filter) { - return this._sweepGuildDirectProp('autoModerationRules', filter).items; - } - - /** - * Sweeps all guild bans and removes the ones which are indicated by the filter. - * @param {Function} filter The function used to determine which bans will be removed from the caches. - * @returns {number} Amount of bans that were removed from the caches - */ - sweepBans(filter) { - return this._sweepGuildDirectProp('bans', filter).items; - } - - /** - * Sweeps all guild emojis and removes the ones which are indicated by the filter. - * @param {Function} filter The function used to determine which emojis will be removed from the caches. - * @returns {number} Amount of emojis that were removed from the caches - */ - sweepEmojis(filter) { - return this._sweepGuildDirectProp('emojis', filter).items; - } - - /** - * Sweeps all guild invites and removes the ones which are indicated by the filter. - * @param {Function} filter The function used to determine which invites will be removed from the caches. - * @returns {number} Amount of invites that were removed from the caches - */ - sweepInvites(filter) { - return this._sweepGuildDirectProp('invites', filter).items; - } - - /** - * Sweeps all guild members and removes the ones which are indicated by the filter. - * It is highly recommended to keep the client guild member cached - * @param {Function} filter The function used to determine which guild members will be removed from the caches. - * @returns {number} Amount of guild members that were removed from the caches - */ - sweepGuildMembers(filter) { - return this._sweepGuildDirectProp('members', filter, { - outputName: 'guild members', - }).items; - } - - /** - * Sweeps all text-based channels' messages and removes the ones which are indicated by the filter. - * @param {Function} filter The function used to determine which messages will be removed from the caches. - * @returns {number} Amount of messages that were removed from the caches - * @example - * // Remove all messages older than 1800 seconds from the messages cache - * const amount = sweepers.sweepMessages( - * Sweepers.filterByLifetime({ - * lifetime: 1800, - * getComparisonTimestamp: m => m.editedTimestamp ?? m.createdTimestamp, - * })(), - * ); - * console.log(`Successfully removed ${amount} messages from the cache.`); - */ - sweepMessages(filter) { - if (typeof filter !== 'function') { - throw new TypeError('INVALID_TYPE', 'filter', 'function'); - } - let channels = 0; - let messages = 0; - - for (const channel of this.client.channels.cache.values()) { - if (!channel.isText()) continue; - - channels++; - messages += channel.messages.cache.sweep(filter); - } - this.client.emit( - Events.CACHE_SWEEP, - `Swept ${messages} messages in ${channels} text-based channels.`, - ); - return messages; - } - - /** - * Sweeps all presences and removes the ones which are indicated by the filter. - * @param {Function} filter The function used to determine which presences will be removed from the caches. - * @returns {number} Amount of presences that were removed from the caches - */ - sweepPresences(filter) { - return this._sweepGuildDirectProp('presences', filter).items; - } - - /** - * Sweeps all message reactions and removes the ones which are indicated by the filter. - * @param {Function} filter The function used to determine which reactions will be removed from the caches. - * @returns {number} Amount of reactions that were removed from the caches - */ - sweepReactions(filter) { - if (typeof filter !== 'function') { - throw new TypeError('INVALID_TYPE', 'filter', 'function'); - } - let channels = 0; - let messages = 0; - let reactions = 0; - - for (const channel of this.client.channels.cache.values()) { - if (!channel.isText()) continue; - channels++; - - for (const message of channel.messages.cache.values()) { - messages++; - reactions += message.reactions.cache.sweep(filter); - } - } - this.client.emit( - Events.CACHE_SWEEP, - `Swept ${reactions} reactions on ${messages} messages in ${channels} text-based channels.`, - ); - return reactions; - } - - /** - * Sweeps all guild stage instances and removes the ones which are indicated by the filter. - * @param {Function} filter The function used to determine which stage instances will be removed from the caches. - * @returns {number} Amount of stage instances that were removed from the caches - */ - sweepStageInstances(filter) { - return this._sweepGuildDirectProp('stageInstances', filter, { - outputName: 'stage instances', - }).items; - } - - /** - * Sweeps all guild stickers and removes the ones which are indicated by the filter. - * @param {Function} filter The function used to determine which stickers will be removed from the caches. - * @returns {number} Amount of stickers that were removed from the caches - */ - sweepStickers(filter) { - return this._sweepGuildDirectProp('stickers', filter).items; - } - - /** - * Sweeps all thread members and removes the ones which are indicated by the filter. - * It is highly recommended to keep the client thread member cached - * @param {Function} filter The function used to determine which thread members will be removed from the caches. - * @returns {number} Amount of thread members that were removed from the caches - */ - sweepThreadMembers(filter) { - if (typeof filter !== 'function') { - throw new TypeError('INVALID_TYPE', 'filter', 'function'); - } - - let threads = 0; - let members = 0; - for (const channel of this.client.channels.cache.values()) { - if (!ThreadChannelTypes.includes(channel.type)) continue; - threads++; - members += channel.members.cache.sweep(filter); - } - this.client.emit( - Events.CACHE_SWEEP, - `Swept ${members} thread members in ${threads} threads.`, - ); - return members; - } - - /** - * Sweeps all threads and removes the ones which are indicated by the filter. - * @param {Function} filter The function used to determine which threads will be removed from the caches. - * @returns {number} filter Amount of threads that were removed from the caches - * @example - * // Remove all threads archived greater than 1 day ago from all the channel caches - * const amount = sweepers.sweepThreads( - * Sweepers.filterByLifetime({ - * getComparisonTimestamp: t => t.archivedTimestamp, - * excludeFromSweep: t => !t.archived, - * })(), - * ); - * console.log(`Successfully removed ${amount} threads from the cache.`); - */ - sweepThreads(filter) { - if (typeof filter !== 'function') { - throw new TypeError('INVALID_TYPE', 'filter', 'function'); - } - - let threads = 0; - for (const [key, val] of this.client.channels.cache.entries()) { - if (!ThreadChannelTypes.includes(val.type)) continue; - if (filter(val, key, this.client.channels.cache)) { - threads++; - this.client.channels._remove(key); - } - } - this.client.emit(Events.CACHE_SWEEP, `Swept ${threads} threads.`); - return threads; - } - - /** - * Sweeps all users and removes the ones which are indicated by the filter. - * @param {Function} filter The function used to determine which users will be removed from the caches. - * @returns {number} Amount of users that were removed from the caches - */ - sweepUsers(filter) { - if (typeof filter !== 'function') { - throw new TypeError('INVALID_TYPE', 'filter', 'function'); - } - - const users = this.client.users.cache.sweep(filter); - - this.client.emit(Events.CACHE_SWEEP, `Swept ${users} users.`); - - return users; - } - - /** - * Sweeps all guild voice states and removes the ones which are indicated by the filter. - * @param {Function} filter The function used to determine which voice states will be removed from the caches. - * @returns {number} Amount of voice states that were removed from the caches - */ - sweepVoiceStates(filter) { - return this._sweepGuildDirectProp('voiceStates', filter, { - outputName: 'voice states', - }).items; - } - - /** - * Cancels all sweeping intervals - * @returns {void} - */ - destroy() { - for (const key of SweeperKeys) { - if (this.intervals[key]) clearInterval(this.intervals[key]); - } - } - - /** - * Options for generating a filter function based on lifetime - * @typedef {Object} LifetimeFilterOptions - * @property {number} [lifetime=14400] How long, in seconds, an entry should stay in the collection - * before it is considered sweepable. - * @property {Function} [getComparisonTimestamp=e => e?.createdTimestamp] A function that takes an entry, key, - * and the collection and returns a timestamp to compare against in order to determine the lifetime of the entry. - * @property {Function} [excludeFromSweep=() => false] A function that takes an entry, key, and the collection - * and returns a boolean, `true` when the entry should not be checked for sweepability. - */ - - /** - * Create a sweepFilter function that uses a lifetime to determine sweepability. - * @param {LifetimeFilterOptions} [options={}] The options used to generate the filter function - * @returns {GlobalSweepFilter} - */ - static filterByLifetime({ - lifetime = 14400, - getComparisonTimestamp = (e) => e?.createdTimestamp, - excludeFromSweep = () => false, - } = {}) { - if (typeof lifetime !== 'number') { - throw new TypeError('INVALID_TYPE', 'lifetime', 'number'); - } - if (typeof getComparisonTimestamp !== 'function') { - throw new TypeError('INVALID_TYPE', 'getComparisonTimestamp', 'function'); - } - if (typeof excludeFromSweep !== 'function') { - throw new TypeError('INVALID_TYPE', 'excludeFromSweep', 'function'); - } - return () => { - if (lifetime <= 0) return null; - const lifetimeMs = lifetime * 1_000; - const now = Date.now(); - return (entry, key, coll) => { - if (excludeFromSweep(entry, key, coll)) { - return false; - } - const comparisonTimestamp = getComparisonTimestamp(entry, key, coll); - if (!comparisonTimestamp || typeof comparisonTimestamp !== 'number') - return false; - return now - comparisonTimestamp > lifetimeMs; - }; - }; - } - - /** - * Creates a sweep filter that sweeps archived threads - * @param {number} [lifetime=14400] How long a thread has to be archived to be valid for sweeping - * @returns {GlobalSweepFilter} - */ - static archivedThreadSweepFilter(lifetime = 14400) { - return this.filterByLifetime({ - lifetime, - getComparisonTimestamp: (e) => e.archiveTimestamp, - excludeFromSweep: (e) => !e.archived, - }); - } - - /** - * Creates a sweep filter that sweeps expired invites - * @param {number} [lifetime=14400] How long ago an invite has to have expired to be valid for sweeping - * @returns {GlobalSweepFilter} - */ - static expiredInviteSweepFilter(lifetime = 14400) { - return this.filterByLifetime({ - lifetime, - getComparisonTimestamp: (i) => i.expiresTimestamp, - }); - } - - /** - * Creates a sweep filter that sweeps outdated messages (edits taken into account) - * @param {number} [lifetime=3600] How long ago a message has to have been sent or edited to be valid for sweeping - * @returns {GlobalSweepFilter} - */ - static outdatedMessageSweepFilter(lifetime = 3600) { - return this.filterByLifetime({ - lifetime, - getComparisonTimestamp: (m) => m.editedTimestamp ?? m.createdTimestamp, - }); - } - - /** - * Configuration options for emitting the cache sweep client event - * @typedef {Object} SweepEventOptions - * @property {boolean} [emit=true] Whether to emit the client event in this method - * @property {string} [outputName] A name to output in the client event if it should differ from the key - * @private - */ - - /** - * Sweep a direct sub property of all guilds - * @param {string} key The name of the property - * @param {Function} filter Filter function passed to sweep - * @param {SweepEventOptions} [eventOptions={}] Options for the Client event emitted here - * @returns {Object} Object containing the number of guilds swept and the number of items swept - * @private - */ - _sweepGuildDirectProp(key, filter, { emit = true, outputName } = {}) { - if (typeof filter !== 'function') { - throw new TypeError('INVALID_TYPE', 'filter', 'function'); - } - - let guilds = 0; - let items = 0; - - for (const guild of this.client.guilds.cache.values()) { - const { cache } = guild[key]; - - guilds++; - items += cache.sweep(filter); - } - - if (emit) { - this.client.emit( - Events.CACHE_SWEEP, - `Swept ${items} ${outputName ?? key} in ${guilds} guilds.`, - ); - } - - return { guilds, items }; - } - - /** - * Validates a set of properties - * @param {string} key Key of the options object to check - * @private - */ - _validateProperties(key) { - const props = this.options[key]; - if (typeof props !== 'object') { - throw new TypeError('INVALID_TYPE', `sweepers.${key}`, 'object', true); - } - if (typeof props.interval !== 'number') { - throw new TypeError('INVALID_TYPE', `sweepers.${key}.interval`, 'number'); - } - // Invites, Messages, and Threads can be provided a lifetime parameter, which we use to generate the filter - if ( - ['invites', 'messages', 'threads'].includes(key) && - !('filter' in props) - ) { - if (typeof props.lifetime !== 'number') { - throw new TypeError( - 'INVALID_TYPE', - `sweepers.${key}.lifetime`, - 'number', - ); - } - return; - } - if (typeof props.filter !== 'function') { - throw new TypeError('INVALID_TYPE', `sweepers.${key}.filter`, 'function'); - } - } - - /** - * Initialize an interval for sweeping - * @param {string} intervalKey The name of the property that stores the interval for this sweeper - * @param {string} sweepKey The name of the function that sweeps the desired caches - * @param {Object} opts Validated options for a sweep - * @private - */ - _initInterval(intervalKey, sweepKey, opts) { - if (opts.interval <= 0 || opts.interval === Infinity) return; - this.intervals[intervalKey] = setInterval(() => { - const sweepFn = opts.filter(); - if (sweepFn === null) return; - if (typeof sweepFn !== 'function') - throw new TypeError('SWEEP_FILTER_RETURN'); - this[sweepKey](sweepFn); - }, opts.interval * 1_000).unref(); - } -} - -module.exports = Sweepers; diff --git a/vendor/discord.js-selfbot-v13/src/util/SystemChannelFlags.js b/vendor/discord.js-selfbot-v13/src/util/SystemChannelFlags.js deleted file mode 100644 index 110fdca..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/SystemChannelFlags.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -const BitField = require('./BitField'); - -/** - * Data structure that makes it easy to interact with a {@link Guild#systemChannelFlags} bitfield. - * Note that all event message types are enabled by default, - * and by setting their corresponding flags you are disabling them - * @extends {BitField} - */ -class SystemChannelFlags extends BitField {} - -/** - * @name SystemChannelFlags - * @kind constructor - * @memberof SystemChannelFlags - * @param {SystemChannelFlagsResolvable} [bits=0] Bit(s) to read from - */ - -/** - * Bitfield of the packed bits - * @type {number} - * @name SystemChannelFlags#bitfield - */ - -/** - * Data that can be resolved to give a system channel flag bitfield. This can be: - * * A string (see {@link SystemChannelFlags.FLAGS}) - * * A system channel flag - * * An instance of SystemChannelFlags - * * An Array of SystemChannelFlagsResolvable - * @typedef {string|number|SystemChannelFlags|SystemChannelFlagsResolvable[]} SystemChannelFlagsResolvable - */ - -/** - * Numeric system channel flags. All available properties: - * * `SUPPRESS_JOIN_NOTIFICATIONS` (Suppress member join notifications) - * * `SUPPRESS_PREMIUM_SUBSCRIPTIONS` (Suppress server boost notifications) - * * `SUPPRESS_GUILD_REMINDER_NOTIFICATIONS` (Suppress server setup tips) - * * `SUPPRESS_JOIN_NOTIFICATION_REPLIES` (Hide member join sticker reply buttons) - * * `SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATIONS` (Suppress role subscription purchase and renewal notifications) - * * `SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATION_REPLIES` (HHide role subscription sticker reply buttons) - * @type {Object} - * @see {@link https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags} - */ -SystemChannelFlags.FLAGS = { - SUPPRESS_JOIN_NOTIFICATIONS: 1 << 0, - SUPPRESS_PREMIUM_SUBSCRIPTIONS: 1 << 1, - SUPPRESS_GUILD_REMINDER_NOTIFICATIONS: 1 << 2, - SUPPRESS_JOIN_NOTIFICATION_REPLIES: 1 << 3, - SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATIONS: 1 << 4, - SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATION_REPLIES: 1 << 5, -}; - -module.exports = SystemChannelFlags; diff --git a/vendor/discord.js-selfbot-v13/src/util/ThreadMemberFlags.js b/vendor/discord.js-selfbot-v13/src/util/ThreadMemberFlags.js deleted file mode 100644 index 309ea59..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/ThreadMemberFlags.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -const BitField = require('./BitField'); - -/** - * Data structure that makes it easy to interact with a {@link ThreadMember#flags} bitfield. - * @extends {BitField} - */ -class ThreadMemberFlags extends BitField {} - -/** - * @name ThreadMemberFlags - * @kind constructor - * @memberof ThreadMemberFlags - * @param {BitFieldResolvable} [bits=0] Bit(s) to read from - */ - -/** - * Bitfield of the packed bits - * @type {number} - * @name ThreadMemberFlags#bitfield - */ - -/** - * Numeric thread member flags. There are currently no bitflags relevant to bots for this. - * @type {Object} - */ -ThreadMemberFlags.FLAGS = {}; - -module.exports = ThreadMemberFlags; diff --git a/vendor/discord.js-selfbot-v13/src/util/UserFlags.js b/vendor/discord.js-selfbot-v13/src/util/UserFlags.js deleted file mode 100644 index f60ef2e..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/UserFlags.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; -const BitField = require('./BitField'); - -/** - * Data structure that makes it easy to interact with a {@link User#flags} bitfield. - * @extends {BitField} - */ -class UserFlags extends BitField {} - -/** - * @name UserFlags - * @kind constructor - * @memberof UserFlags - * @param {BitFieldResolvable} [bits=0] Bit(s) to read from - */ - -/** - * Bitfield of the packed bits - * @type {number} - * @name UserFlags#bitfield - */ - -/** - * Numeric user flags. All available properties: - * * `DISCORD_EMPLOYEE` - * * `PARTNERED_SERVER_OWNER` - * * `HYPESQUAD_EVENTS` - * * `BUGHUNTER_LEVEL_1` - * * `MFA_SMS` - * * `PREMIUM_PROMO_DISMISSED` - * * `HOUSE_BRAVERY` - * * `HOUSE_BRILLIANCE` - * * `HOUSE_BALANCE` - * * `EARLY_SUPPORTER` - * * `TEAM_USER` - * * `INTERNAL_APPLICATION` - * * `SYSTEM` - * * `HAS_UNREAD_URGENT_MESSAGES` - * * `BUGHUNTER_LEVEL_2` - * * `UNDERAGE_DELETED` - * * `VERIFIED_BOT` - * * `EARLY_VERIFIED_BOT_DEVELOPER` - * * `DISCORD_CERTIFIED_MODERATOR` - * * `BOT_HTTP_INTERACTIONS` - * * `SPAMMER` - * * `DISABLE_PREMIUM` - * * `ACTIVE_DEVELOPER` - * * `HIGH_GLOBAL_RATE_LIMIT` - * * `DELETED` - * * `DISABLED_SUSPICIOUS_ACTIVITY` - * * `SELF_DELETED` - * * `PREMIUM_DISCRIMINATOR` - * * `USED_DESKTOP_CLIENT` - * * `USED_WEB_CLIENT` - * * `USED_MOBILE_CLIENT` - * * `DISABLED` - * * `VERIFIED_EMAIL` - * * `QUARANTINED` - * * `COLLABORATOR` - * * `RESTRICTED_COLLABORATOR` - * @type {Object} - * @see {@link https://discord.com/developers/docs/resources/user#user-object-user-flags} - * @see {@link https://github.com/LewisTehMinerz/discord-flags} - */ -UserFlags.FLAGS = { - DISCORD_EMPLOYEE: 1 << 0, - PARTNERED_SERVER_OWNER: 1 << 1, - HYPESQUAD_EVENTS: 1 << 2, - BUGHUNTER_LEVEL_1: 1 << 3, - MFA_SMS: 1 << 4, // [Undocumented] User has SMS 2FA enabled. - PREMIUM_PROMO_DISMISSED: 1 << 5, // [Undocumented] Presumably some sort of Discord Nitro promotion that the user dismissed. - HOUSE_BRAVERY: 1 << 6, - HOUSE_BRILLIANCE: 1 << 7, - HOUSE_BALANCE: 1 << 8, - EARLY_SUPPORTER: 1 << 9, - TEAM_USER: 1 << 10, - INTERNAL_APPLICATION: 1 << 11, // [Undocumented] An internal flag accidentally leaked to the client's private flags. Relates to partner/verification applications but nothing else is known. - SYSTEM: 1 << 12, // [Undocumented] Account is a Discord system account. - HAS_UNREAD_URGENT_MESSAGES: 1 << 13, // [Undocumented] User has unread messages from Discord. - BUGHUNTER_LEVEL_2: 1 << 14, - UNDERAGE_DELETED: 1 << 15, // [Undocumented] Unused. User was deleted for being underage. - VERIFIED_BOT: 1 << 16, - EARLY_VERIFIED_BOT_DEVELOPER: 1 << 17, - DISCORD_CERTIFIED_MODERATOR: 1 << 18, - BOT_HTTP_INTERACTIONS: 1 << 19, - SPAMMER: 1 << 20, // [Undocumented] User is marked as a spammer. - DISABLE_PREMIUM: 1 << 21, // [Undocumented] Forcefully disables Nitro features. - ACTIVE_DEVELOPER: 1 << 22, // User is an active developer. - HIGH_GLOBAL_RATE_LIMIT: Math.pow(2, 33), // [Undocumented] User is a high global rate limit. - DELETED: Math.pow(2, 34), // [Undocumented] Account has been deleted. - DISABLED_SUSPICIOUS_ACTIVITY: Math.pow(2, 35), // [Undocumented] Account has been disabled for suspicious activity. - SELF_DELETED: Math.pow(2, 36), // [Undocumented] Account was deleted by the user. - PREMIUM_DISCRIMINATOR: Math.pow(2, 37), // [Undocumented] User has a premium discriminator. - USED_DESKTOP_CLIENT: Math.pow(2, 38), // [Undocumented] User has used the desktop client. - USED_WEB_CLIENT: Math.pow(2, 39), // [Undocumented] User has used the web client. - USED_MOBILE_CLIENT: Math.pow(2, 40), // [Undocumented] User has used the mobile client. - DISABLED: Math.pow(2, 41), // [Undocumented] User is currently temporarily or permanently disabled. - VERIFIED_EMAIL: Math.pow(2, 43), // [Undocumented] User has a verified email on their account. - QUARANTINED: Math.pow(2, 44), // [Undocumented] User is quarantined. - COLLABORATOR: Math.pow(2, 50), // [Undocumented] User is a collaborator and has staff permissions. - RESTRICTED_COLLABORATOR: Math.pow(2, 51), // [Undocumented] User is a restricted collaborator and has staff permissions. -}; - -module.exports = UserFlags; diff --git a/vendor/discord.js-selfbot-v13/src/util/Util.js b/vendor/discord.js-selfbot-v13/src/util/Util.js deleted file mode 100644 index 3e203d2..0000000 --- a/vendor/discord.js-selfbot-v13/src/util/Util.js +++ /dev/null @@ -1,1114 +0,0 @@ -'use strict'; - -const { Agent } = require('node:http'); -const { parse } = require('node:path'); -const process = require('node:process'); -const { setTimeout } = require('node:timers'); -const { Collection } = require('@discordjs/collection'); -const { fetch } = require('undici'); -const { Colors, Events } = require('./Constants'); -const { Error: DiscordError, RangeError, TypeError } = require('../errors'); -const has = (o, k) => Object.prototype.hasOwnProperty.call(o, k); -const isObject = (d) => typeof d === 'object' && d !== null; - -let deprecationEmittedForSplitMessage = false; -let deprecationEmittedForRemoveMentions = false; -let deprecationEmittedForResolveAutoArchiveMaxLimit = false; - -const TextSortableGroupTypes = [ - 'GUILD_TEXT', - 'GUILD_ANNOUCMENT', - 'GUILD_FORUM', -]; -const VoiceSortableGroupTypes = ['GUILD_VOICE', 'GUILD_STAGE_VOICE']; -const CategorySortableGroupTypes = ['GUILD_CATEGORY']; - -const payloadTypes = [ - { - name: 'opus', - type: 'audio', - priority: 1000, - payload_type: 120, - }, - { - name: 'AV1', - type: 'video', - priority: 1000, - payload_type: 101, - rtx_payload_type: 102, - encode: false, - decode: false, - }, - { - name: 'H265', - type: 'video', - priority: 2000, - payload_type: 103, - rtx_payload_type: 104, - encode: false, - decode: false, - }, - { - name: 'H264', - type: 'video', - priority: 3000, - payload_type: 105, - rtx_payload_type: 106, - encode: true, - decode: true, - }, - { - name: 'VP8', - type: 'video', - priority: 4000, - payload_type: 107, - rtx_payload_type: 108, - encode: true, - decode: false, - }, - { - name: 'VP9', - type: 'video', - priority: 5000, - payload_type: 109, - rtx_payload_type: 110, - encode: false, - decode: false, - }, -]; - -/** - * Contains various general-purpose utility methods. - */ -class Util extends null { - /** - * Flatten an object. Any properties that are collections will get converted to an array of keys. - * @param {Object} obj The object to flatten. - * @param {...Object} [props] Specific properties to include/exclude. - * @returns {Object} - */ - static flatten(obj, ...props) { - if (!isObject(obj)) return obj; - - const objProps = Object.keys(obj) - .filter((k) => !k.startsWith('_')) - .map((k) => ({ [k]: true })); - - props = objProps.length - ? Object.assign(...objProps, ...props) - : Object.assign({}, ...props); - - const out = {}; - - for (let [prop, newProp] of Object.entries(props)) { - if (!newProp) continue; - newProp = newProp === true ? prop : newProp; - - const element = obj[prop]; - const elemIsObj = isObject(element); - const valueOf = - elemIsObj && typeof element.valueOf === 'function' - ? element.valueOf() - : null; - const hasToJSON = elemIsObj && typeof element.toJSON === 'function'; - - // If it's a Collection, make the array of keys - if (element instanceof Collection) - out[newProp] = Array.from(element.keys()); - // If the valueOf is a Collection, use its array of keys - else if (valueOf instanceof Collection) - out[newProp] = Array.from(valueOf.keys()); - // If it's an array, call toJSON function on each element if present, otherwise flatten each element - else if (Array.isArray(element)) - out[newProp] = element.map((e) => e.toJSON?.() ?? Util.flatten(e)); - // If it's an object with a primitive `valueOf`, use that value - else if (typeof valueOf !== 'object') out[newProp] = valueOf; - // If it's an object with a toJSON function, use the return value of it - else if (hasToJSON) out[newProp] = element.toJSON(); - // If element is an object, use the flattened version of it - else if (typeof element === 'object') - out[newProp] = Util.flatten(element); - // If it's a primitive - else if (!elemIsObj) out[newProp] = element; - } - - return out; - } - - /** - * Options for splitting a message. - * @typedef {Object} SplitOptions - * @property {number} [maxLength=2000] Maximum character length per message piece - * @property {string|string[]|RegExp|RegExp[]} [char='\n'] Character(s) or Regex(es) to split the message with, - * an array can be used to split multiple times - * @property {string} [prepend=''] Text to prepend to every piece except the first - * @property {string} [append=''] Text to append to every piece except the last - */ - - /** - * Splits a string into multiple chunks at a designated character that do not exceed a specific length. - * @param {string} text Content to split - * @param {SplitOptions} [options] Options controlling the behavior of the split - * @deprecated This will be removed in the next major version. - * @returns {string[]} - */ - static splitMessage( - text, - { maxLength = 2_000, char = '\n', prepend = '', append = '' } = {}, - ) { - if (!deprecationEmittedForSplitMessage) { - process.emitWarning( - 'The Util.splitMessage method is deprecated and will be removed in the next major version.', - 'DeprecationWarning', - ); - - deprecationEmittedForSplitMessage = true; - } - - text = Util.verifyString(text); - if (text.length <= maxLength) return [text]; - let splitText = [text]; - if (Array.isArray(char)) { - while ( - char.length > 0 && - splitText.some((elem) => elem.length > maxLength) - ) { - const currentChar = char.shift(); - if (currentChar instanceof RegExp) { - splitText = splitText.flatMap((chunk) => chunk.match(currentChar)); - } else { - splitText = splitText.flatMap((chunk) => chunk.split(currentChar)); - } - } - } else { - splitText = text.split(char); - } - if (splitText.some((elem) => elem.length > maxLength)) - throw new RangeError('SPLIT_MAX_LEN'); - const messages = []; - let msg = ''; - for (const chunk of splitText) { - if (msg && (msg + char + chunk + append).length > maxLength) { - messages.push(msg + append); - msg = prepend; - } - msg += (msg && msg !== prepend ? char : '') + chunk; - } - return messages.concat(msg).filter((m) => m); - } - - /** - * Options used to escape markdown. - * @typedef {Object} EscapeMarkdownOptions - * @property {boolean} [codeBlock=true] Whether to escape code blocks - * @property {boolean} [inlineCode=true] Whether to escape inline code - * @property {boolean} [bold=true] Whether to escape bolds - * @property {boolean} [italic=true] Whether to escape italics - * @property {boolean} [underline=true] Whether to escape underlines - * @property {boolean} [strikethrough=true] Whether to escape strikethroughs - * @property {boolean} [spoiler=true] Whether to escape spoilers - * @property {boolean} [codeBlockContent=true] Whether to escape text inside code blocks - * @property {boolean} [inlineCodeContent=true] Whether to escape text inside inline code - * @property {boolean} [escape=true] Whether to escape escape characters - * @property {boolean} [heading=false] Whether to escape headings - * @property {boolean} [bulletedList=false] Whether to escape bulleted lists - * @property {boolean} [numberedList=false] Whether to escape numbered lists - * @property {boolean} [maskedLink=false] Whether to escape masked links - */ - - /** - * Escapes any Discord-flavour markdown in a string. - * @param {string} text Content to escape - * @param {EscapeMarkdownOptions} [options={}] Options for escaping the markdown - * @returns {string} - */ - static escapeMarkdown( - text, - { - codeBlock = true, - inlineCode = true, - bold = true, - italic = true, - underline = true, - strikethrough = true, - spoiler = true, - codeBlockContent = true, - inlineCodeContent = true, - escape = true, - heading = false, - bulletedList = false, - numberedList = false, - maskedLink = false, - } = {}, - ) { - if (!codeBlockContent) { - return text - .split('```') - .map((subString, index, array) => { - if (index % 2 && index !== array.length - 1) return subString; - return Util.escapeMarkdown(subString, { - inlineCode, - bold, - italic, - underline, - strikethrough, - spoiler, - inlineCodeContent, - escape, - heading, - bulletedList, - numberedList, - maskedLink, - }); - }) - .join(codeBlock ? '\\`\\`\\`' : '```'); - } - if (!inlineCodeContent) { - return text - .split(/(?<=^|[^`])`(?=[^`]|$)/g) - .map((subString, index, array) => { - if (index % 2 && index !== array.length - 1) return subString; - return Util.escapeMarkdown(subString, { - codeBlock, - bold, - italic, - underline, - strikethrough, - spoiler, - escape, - heading, - bulletedList, - numberedList, - maskedLink, - }); - }) - .join(inlineCode ? '\\`' : '`'); - } - if (escape) text = Util.escapeEscape(text); - if (inlineCode) text = Util.escapeInlineCode(text); - if (codeBlock) text = Util.escapeCodeBlock(text); - if (italic) text = Util.escapeItalic(text); - if (bold) text = Util.escapeBold(text); - if (underline) text = Util.escapeUnderline(text); - if (strikethrough) text = Util.escapeStrikethrough(text); - if (spoiler) text = Util.escapeSpoiler(text); - if (heading) text = Util.escapeHeading(text); - if (bulletedList) text = Util.escapeBulletedList(text); - if (numberedList) text = Util.escapeNumberedList(text); - if (maskedLink) text = Util.escapeMaskedLink(text); - return text; - } - - /** - * Escapes code block markdown in a string. - * @param {string} text Content to escape - * @returns {string} - */ - static escapeCodeBlock(text) { - return text.replaceAll('```', '\\`\\`\\`'); - } - - /** - * Escapes inline code markdown in a string. - * @param {string} text Content to escape - * @returns {string} - */ - static escapeInlineCode(text) { - return text.replace(/(?<=^|[^`])``?(?=[^`]|$)/g, (match) => - match.length === 2 ? '\\`\\`' : '\\`', - ); - } - - /** - * Escapes italic markdown in a string. - * @param {string} text Content to escape - * @returns {string} - */ - static escapeItalic(text) { - let i = 0; - text = text.replace(/(?<=^|[^*])\*([^*]|\*\*|$)/g, (_, match) => { - if (match === '**') return ++i % 2 ? `\\*${match}` : `${match}\\*`; - return `\\*${match}`; - }); - i = 0; - return text.replace(/(?<=^|[^_])_([^_]|__|$)/g, (_, match) => { - if (match === '__') return ++i % 2 ? `\\_${match}` : `${match}\\_`; - return `\\_${match}`; - }); - } - - /** - * Escapes bold markdown in a string. - * @param {string} text Content to escape - * @returns {string} - */ - static escapeBold(text) { - let i = 0; - return text.replace(/\*\*(\*)?/g, (_, match) => { - if (match) return ++i % 2 ? `${match}\\*\\*` : `\\*\\*${match}`; - return '\\*\\*'; - }); - } - - /** - * Escapes underline markdown in a string. - * @param {string} text Content to escape - * @returns {string} - */ - static escapeUnderline(text) { - let i = 0; - return text.replace(/__(_)?/g, (_, match) => { - if (match) return ++i % 2 ? `${match}\\_\\_` : `\\_\\_${match}`; - return '\\_\\_'; - }); - } - - /** - * Escapes strikethrough markdown in a string. - * @param {string} text Content to escape - * @returns {string} - */ - static escapeStrikethrough(text) { - return text.replaceAll('~~', '\\~\\~'); - } - - /** - * Escapes spoiler markdown in a string. - * @param {string} text Content to escape - * @returns {string} - */ - static escapeSpoiler(text) { - return text.replaceAll('||', '\\|\\|'); - } - - /** - * Escapes escape characters in a string. - * @param {string} text Content to escape - * @returns {string} - */ - static escapeEscape(text) { - return text.replaceAll('\\', '\\\\'); - } - - /** - * Escapes heading characters in a string. - * @param {string} text Content to escape - * @returns {string} - */ - static escapeHeading(text) { - return text.replaceAll(/^( {0,2}[*-] +)?(#{1,3} )/gm, '$1\\$2'); - } - - /** - * Escapes bulleted list characters in a string. - * @param {string} text Content to escape - * @returns {string} - */ - static escapeBulletedList(text) { - return text.replaceAll(/^( *)[*-]( +)/gm, '$1\\-$2'); - } - - /** - * Escapes numbered list characters in a string. - * @param {string} text Content to escape - * @returns {string} - */ - static escapeNumberedList(text) { - return text.replaceAll(/^( *\d+)\./gm, '$1\\.'); - } - - /** - * Escapes masked link characters in a string. - * @param {string} text Content to escape - * @returns {string} - */ - static escapeMaskedLink(text) { - return text.replaceAll(/\[.+\]\(.+\)/gm, '\\$&'); - } - - /** - * @typedef {Object} FetchRecommendedShardsOptions - * @property {number} [guildsPerShard=1000] Number of guilds assigned per shard - * @property {number} [multipleOf=1] The multiple the shard count should round up to. (16 for large bot sharding) - */ - - static fetchRecommendedShards() { - throw new DiscordError('INVALID_USER_API'); - } - - /** - * Parses emoji info out of a string. The string must be one of: - * * A UTF-8 emoji (no id) - * * A URL-encoded UTF-8 emoji (no id) - * * A Discord custom emoji (`<:name:id>` or ``) - * @param {string} text Emoji string to parse - * @returns {APIEmoji} Object with `animated`, `name`, and `id` properties - * @private - */ - static parseEmoji(text) { - if (text.includes('%')) text = decodeURIComponent(text); - if (!text.includes(':')) return { animated: false, name: text, id: null }; - const match = text.match(/?/); - return ( - match && { - animated: Boolean(match[1]), - name: match[2], - id: match[3] ?? null, - } - ); - } - - /** - * Resolves a partial emoji object from an {@link EmojiIdentifierResolvable}, without checking a Client. - * @param {EmojiIdentifierResolvable} emoji Emoji identifier to resolve - * @returns {?RawEmoji} - * @private - */ - static resolvePartialEmoji(emoji) { - if (!emoji) return null; - if (typeof emoji === 'string') - return /^\d{17,19}$/.test(emoji) ? { id: emoji } : Util.parseEmoji(emoji); - const { id, name, animated } = emoji; - if (!id && !name) return null; - return { id, name, animated: Boolean(animated) }; - } - - /** - * Shallow-copies an object with its class/prototype intact. - * @param {Object} obj Object to clone - * @returns {Object} - * @private - */ - static cloneObject(obj) { - return Object.assign(Object.create(obj), obj); - } - - /** - * Sets default properties on an object that aren't already specified. - * @param {Object} def Default properties - * @param {Object} given Object to assign defaults to - * @returns {Object} - * @private - */ - static mergeDefault(def, given) { - if (!given) return def; - for (const key in def) { - if (!has(given, key) || given[key] === undefined) { - given[key] = def[key]; - } else if (given[key] === Object(given[key])) { - given[key] = Util.mergeDefault(def[key], given[key]); - } - } - - return given; - } - - /** - * Options used to make an error object. - * @typedef {Object} MakeErrorOptions - * @property {string} name Error type - * @property {string} message Message for the error - * @property {string} stack Stack for the error - */ - - /** - * Makes an Error from a plain info object. - * @param {MakeErrorOptions} obj Error info - * @returns {Error} - * @private - */ - static makeError(obj) { - const err = new Error(obj.message); - err.name = obj.name; - err.stack = obj.stack; - return err; - } - - /** - * Makes a plain error info object from an Error. - * @param {Error} err Error to get info from - * @returns {MakeErrorOptions} - * @private - */ - static makePlainError(err) { - return { - name: err.name, - message: err.message, - stack: err.stack, - }; - } - - /** - * Moves an element in an array *in place*. - * @param {Array<*>} array Array to modify - * @param {*} element Element to move - * @param {number} newIndex Index or offset to move the element to - * @param {boolean} [offset=false] Move the element by an offset amount rather than to a set index - * @returns {number} - * @private - */ - static moveElementInArray(array, element, newIndex, offset = false) { - const index = array.indexOf(element); - newIndex = (offset ? index : 0) + newIndex; - if (newIndex > -1 && newIndex < array.length) { - const removedElement = array.splice(index, 1)[0]; - array.splice(newIndex, 0, removedElement); - } - return array.indexOf(element); - } - - /** - * Verifies the provided data is a string, otherwise throws provided error. - * @param {string} data The string resolvable to resolve - * @param {Function} [error] The Error constructor to instantiate. Defaults to Error - * @param {string} [errorMessage] The error message to throw with. Defaults to "Expected string, got instead." - * @param {boolean} [allowEmpty=true] Whether an empty string should be allowed - * @returns {string} - */ - static verifyString( - data, - error = Error, - errorMessage = `Expected a string, got ${data} instead.`, - allowEmpty = true, - ) { - if (typeof data !== 'string') throw new error(errorMessage); - if (!allowEmpty && data.length === 0) throw new error(errorMessage); - return data; - } - - /** - * Can be a number, hex string, a {@link Color}, or an RGB array like: - * ```js - * [255, 0, 255] // purple - * ``` - * @typedef {string|Color|number|number[]} ColorResolvable - */ - - /** - * Resolves a ColorResolvable into a color number. - * @param {ColorResolvable} color Color to resolve - * @returns {number} A color - */ - static resolveColor(color) { - if (typeof color === 'string') { - if (color === 'RANDOM') return Math.floor(Math.random() * (0xffffff + 1)); - if (color === 'DEFAULT') return 0; - color = Colors[color] ?? parseInt(color.replace('#', ''), 16); - } else if (Array.isArray(color)) { - color = (color[0] << 16) + (color[1] << 8) + color[2]; - } - - if (color < 0 || color > 0xffffff) throw new RangeError('COLOR_RANGE'); - else if (Number.isNaN(color)) throw new TypeError('COLOR_CONVERT'); - - return color; - } - - /** - * Sorts by Discord's position and id. - * @param {Collection} collection Collection of objects to sort - * @returns {Collection} - */ - static discordSort(collection) { - const isGuildChannel = collection.first() instanceof GuildChannel; - return collection.toSorted( - isGuildChannel - ? (a, b) => - a.rawPosition - b.rawPosition || Number(BigInt(a.id) - BigInt(b.id)) - : (a, b) => - a.rawPosition - b.rawPosition || - Number(BigInt(b.id) - BigInt(a.id)), - ); - } - - /** - * Sets the position of a Channel or Role. - * @param {Channel|Role} item Object to set the position of - * @param {number} position New position for the object - * @param {boolean} relative Whether `position` is relative to its current position - * @param {Collection} sorted A collection of the objects sorted properly - * @param {APIRouter} route Route to call PATCH on - * @param {string} [reason] Reason for the change - * @returns {Promise} Updated item list, with `id` and `position` properties - * @private - */ - static async setPosition(item, position, relative, sorted, route, reason) { - let updatedItems = [...sorted.values()]; - Util.moveElementInArray(updatedItems, item, position, relative); - updatedItems = updatedItems.map((r, i) => ({ id: r.id, position: i })); - await route.patch({ data: updatedItems, reason }); - return updatedItems; - } - - /** - * Alternative to Node's `path.basename`, removing query string after the extension if it exists. - * @param {string} path Path to get the basename of - * @param {string} [ext] File extension to remove - * @returns {string} Basename of the path - * @private - */ - static basename(path, ext) { - const res = parse(path); - return ext && res.ext.startsWith(ext) ? res.name : res.base.split('?')[0]; - } - - /** - * Breaks user, role and everyone/here mentions by adding a zero width space after every @ character - * @param {string} str The string to sanitize - * @returns {string} - * @deprecated Use {@link BaseMessageOptions#allowedMentions} instead. - */ - static removeMentions(str) { - if (!deprecationEmittedForRemoveMentions) { - process.emitWarning( - 'The Util.removeMentions method is deprecated. Use MessageOptions#allowedMentions instead.', - 'DeprecationWarning', - ); - - deprecationEmittedForRemoveMentions = true; - } - - return Util._removeMentions(str); - } - - static _removeMentions(str) { - return str.replaceAll('@', '@\u200b'); - } - - /** - * The content to have all mentions replaced by the equivalent text. - * When {@link Util.removeMentions} is removed, this method will no longer sanitize mentions. - * Use {@link BaseMessageOptions#allowedMentions} instead to prevent mentions when sending a message. - * @param {string} str The string to be converted - * @param {TextBasedChannels} channel The channel the string was sent in - * @returns {string} - */ - static cleanContent(str, channel) { - str = str - .replace(/<@!?[0-9]+>/g, (input) => { - const id = input.replace(/<|!|>|@/g, ''); - if (channel.type === 'DM') { - const user = channel.client.users.cache.get(id); - return user ? Util._removeMentions(`@${user.username}`) : input; - } - - const member = channel.guild?.members.cache.get(id); - if (member) { - return Util._removeMentions(`@${member.displayName}`); - } else { - const user = channel.client.users.cache.get(id); - return user ? Util._removeMentions(`@${user.username}`) : input; - } - }) - .replace(/<#[0-9]+>/g, (input) => { - const mentionedChannel = channel.client.channels.cache.get( - input.replace(/<|#|>/g, ''), - ); - return mentionedChannel ? `#${mentionedChannel.name}` : input; - }) - .replace(/<@&[0-9]+>/g, (input) => { - if (channel.type === 'DM') return input; - const role = channel.guild.roles.cache.get( - input.replace(/<|@|>|&/g, ''), - ); - return role ? `@${role.name}` : input; - }); - return str; - } - - /** - * The content to put in a code block with all code block fences replaced by the equivalent backticks. - * @param {string} text The string to be converted - * @returns {string} - */ - static cleanCodeBlockContent(text) { - return text.replaceAll('```', '`\u200b``'); - } - - /** - * Creates a sweep filter that sweeps archived threads - * @param {number} [lifetime=14400] How long a thread has to be archived to be valid for sweeping - * @deprecated When not using with `makeCache` use `Sweepers.archivedThreadSweepFilter` instead - * @returns {SweepFilter} - */ - static archivedThreadSweepFilter(lifetime = 14400) { - const filter = require('./Sweepers').archivedThreadSweepFilter(lifetime); - filter.isDefault = true; - return filter; - } - - /** - * Resolves the maximum time a guild's thread channels should automatically archive in case of no recent activity. - * @param {Guild} guild The guild to resolve this limit from. - * @deprecated This will be removed in the next major version. - * @returns {number} - */ - static resolveAutoArchiveMaxLimit() { - if (!deprecationEmittedForResolveAutoArchiveMaxLimit) { - process.emitWarning( - // eslint-disable-next-line max-len - "The Util.resolveAutoArchiveMaxLimit method and the 'MAX' option are deprecated and will be removed in the next major version.", - 'DeprecationWarning', - ); - deprecationEmittedForResolveAutoArchiveMaxLimit = true; - } - return 10080; - } - - /** - * Transforms an API guild forum tag to camel-cased guild forum tag. - * @param {APIGuildForumTag} tag The tag to transform - * @returns {GuildForumTag} - * @ignore - */ - static transformAPIGuildForumTag(tag) { - return { - id: tag.id, - name: tag.name, - moderated: tag.moderated, - emoji: - (tag.emoji_id ?? tag.emoji_name) - ? { - id: tag.emoji_id, - name: tag.emoji_name, - } - : null, - }; - } - - /** - * Transforms a camel-cased guild forum tag to an API guild forum tag. - * @param {GuildForumTag} tag The tag to transform - * @returns {APIGuildForumTag} - * @ignore - */ - static transformGuildForumTag(tag) { - return { - id: tag.id, - name: tag.name, - moderated: tag.moderated, - emoji_id: tag.emoji?.id ?? null, - emoji_name: tag.emoji?.name ?? null, - }; - } - - /** - * Transforms an API guild forum default reaction object to a - * camel-cased guild forum default reaction object. - * @param {APIGuildForumDefaultReactionEmoji} defaultReaction The default reaction to transform - * @returns {DefaultReactionEmoji} - * @ignore - */ - static transformAPIGuildDefaultReaction(defaultReaction) { - return { - id: defaultReaction.emoji_id, - name: defaultReaction.emoji_name, - }; - } - - /** - * Transforms a camel-cased guild forum default reaction object to an - * API guild forum default reaction object. - * @param {DefaultReactionEmoji} defaultReaction The default reaction to transform - * @returns {APIGuildForumDefaultReactionEmoji} - * @ignore - */ - static transformGuildDefaultReaction(defaultReaction) { - return { - emoji_id: defaultReaction.id, - emoji_name: defaultReaction.name, - }; - } - - /** - * Transforms a guild scheduled event recurrence rule object to a snake-cased variant. - * @param {GuildScheduledEventRecurrenceRuleOptions} recurrenceRule The recurrence rule to transform - * @returns {APIGuildScheduledEventRecurrenceRule} - * @ignore - */ - static transformGuildScheduledEventRecurrenceRule(recurrenceRule) { - return { - start: new Date(recurrenceRule.startAt).toISOString(), - frequency: recurrenceRule.frequency, - interval: recurrenceRule.interval, - by_weekday: recurrenceRule.byWeekday, - by_n_weekday: recurrenceRule.byNWeekday, - by_month: recurrenceRule.byMonth, - by_month_day: recurrenceRule.byMonthDay, - }; - } - - /** - * Transforms API incidents data to a camel-cased variant. - * @param {APIIncidentsData} data The incidents data to transform - * @returns {IncidentActions} - * @ignore - */ - static transformAPIIncidentsData(data) { - return { - invitesDisabledUntil: data.invites_disabled_until - ? new Date(data.invites_disabled_until) - : null, - dmsDisabledUntil: data.dms_disabled_until - ? new Date(data.dms_disabled_until) - : null, - dmSpamDetectedAt: data.dm_spam_detected_at - ? new Date(data.dm_spam_detected_at) - : null, - raidDetectedAt: data.raid_detected_at - ? new Date(data.raid_detected_at) - : null, - }; - } - - /** - * Gets an array of the channel types that can be moved in the channel group. For example, a GuildText channel would - * return an array containing the types that can be ordered within the text channels (always at the top), and a voice - * channel would return an array containing the types that can be ordered within the voice channels (always at the - * bottom). - * @param {ChannelType} type The type of the channel - * @returns {ChannelType[]} - * @ignore - */ - static getSortableGroupTypes(type) { - switch (type) { - case 'GUILD_TEXT': - case 'GUILD_ANNOUNCEMENT': - case 'GUILD_FORUM': - return TextSortableGroupTypes; - case 'GUILD_VOICE': - case 'GUILD_STAGE_VOICE': - return VoiceSortableGroupTypes; - case 'GUILD_CATEGORY': - return CategorySortableGroupTypes; - default: - return [type]; - } - } - - /** - * Calculates the default avatar index for a given user id. - * @param {Snowflake} userId - The user id to calculate the default avatar index for - * @returns {number} - */ - static calculateUserDefaultAvatarIndex(userId) { - return Number(BigInt(userId) >> 22n) % 6; - } - - static async getUploadURL(client, channelId, files) { - if (!files.length) return []; - files = files.map((file, i) => ({ - filename: file.name, - // 25MB = 26_214_400bytes - file_size: Math.floor((26_214_400 / 10) * Math.random()), - id: `${i}`, - })); - const { attachments } = await client.api.channels[ - channelId - ].attachments.post({ - data: { - files, - }, - }); - return attachments; - } - - static uploadFile(data, url) { - return new Promise((resolve, reject) => { - fetch(url, { - method: 'PUT', - body: data, - duplex: 'half', // Node.js v20 - }) - .then((res) => { - if (res.ok) { - resolve(res); - } else { - reject(res); - } - }) - .catch(reject); - }); - } - - /** - * Lazily evaluates a callback function (yea it's v14 :yay:) - * @param {Function} cb The callback to lazily evaluate - * @returns {Function} - * @example - * const User = lazy(() => require('./User')); - * const user = new (User())(client, data); - */ - static lazy(cb) { - let defaultValue; - return () => (defaultValue ??= cb()); - } - - /** - * Hacking check object instanceof Proxy-agent - * @param {Object} object any - * @returns {boolean} - */ - static verifyProxyAgent(object) { - return ( - typeof object == 'object' && - object.httpAgent instanceof Agent && - object.httpsAgent instanceof Agent - ); - } - - static checkUndiciProxyAgent(data) { - if (typeof data === 'string') { - return { - uri: data, - }; - } - if (data instanceof URL) { - return { - uri: data.toString(), - }; - } - if (typeof data === 'object' && typeof data.uri === 'string') return data; - return false; - } - - static createPromiseInteraction( - client, - nonce, - timeoutMs = 5_000, - isHandlerDeferUpdate = false, - parent, - ) { - return new Promise((resolve, reject) => { - // Waiting for MsgCreate / ModalCreate - let dataFromInteractionSuccess; - let dataFromNormalEvent; - const handler = (data) => { - // UnhandledPacket - if ( - isHandlerDeferUpdate && - data.d?.nonce == nonce && - data.t == 'INTERACTION_SUCCESS' - ) { - // Interaction#deferUpdate - client.removeListener(Events.MESSAGE_CREATE, handler); - client.removeListener(Events.UNHANDLED_PACKET, handler); - client.removeListener(Events.INTERACTION_MODAL_CREATE, handler); - dataFromInteractionSuccess = parent; - } - if (data.nonce !== nonce) return; - clearTimeout(timeout); - client.removeListener(Events.MESSAGE_CREATE, handler); - client.removeListener(Events.INTERACTION_MODAL_CREATE, handler); - if (isHandlerDeferUpdate) - client.removeListener(Events.UNHANDLED_PACKET, handler); - client.decrementMaxListeners(); - dataFromNormalEvent = data; - resolve(data); - }; - const timeout = setTimeout(() => { - if (dataFromInteractionSuccess || dataFromNormalEvent) { - resolve(dataFromNormalEvent || dataFromInteractionSuccess); - return; - } - client.removeListener(Events.MESSAGE_CREATE, handler); - client.removeListener(Events.INTERACTION_MODAL_CREATE, handler); - if (isHandlerDeferUpdate) - client.removeListener(Events.UNHANDLED_PACKET, handler); - client.decrementMaxListeners(); - reject(new DiscordError('INTERACTION_FAILED')); - }, timeoutMs).unref(); - client.incrementMaxListeners(); - client.on(Events.MESSAGE_CREATE, handler); - client.on(Events.INTERACTION_MODAL_CREATE, handler); - if (isHandlerDeferUpdate) client.on(Events.UNHANDLED_PACKET, handler); - }); - } - - static clearNullOrUndefinedObject(object) { - const data = {}; - const keys = Object.keys(object); - - for (const key of keys) { - const value = object[key]; - if ( - value === undefined || - value === null || - (Array.isArray(value) && value.length === 0) - ) { - continue; - } else if (!Array.isArray(value) && typeof value === 'object') { - const cleanedValue = Util.clearNullOrUndefinedObject(value); - if (cleanedValue !== undefined) { - data[key] = cleanedValue; - } - } else { - data[key] = value; - } - } - - return Object.keys(data).length > 0 ? data : undefined; - } - - static getAllPayloadType() { - return payloadTypes; - } - - /** - * Get the payload type of the codec - * @param {'opus' | 'H264' | 'H265' | 'VP8' | 'VP9' | 'AV1'} codecName - Codec name - * @returns {number} - */ - static getPayloadType(codecName) { - return payloadTypes.find((p) => p.name === codecName).payload_type; - } - - static getSDPCodecName(portUdpH264, portUdpH265, portUdpOpus) { - const payloadTypeH264 = Util.getPayloadType('H264'); - const payloadTypeH265 = Util.getPayloadType('H265'); - const payloadTypeOpus = Util.getPayloadType('opus'); - let sdpData = `v=0 -o=- 0 0 IN IP4 0.0.0.0 -s=- -c=IN IP4 0.0.0.0 -t=0 0 -a=tool:libavformat 61.1.100 -m=video ${portUdpH264} RTP/AVP ${payloadTypeH264} -c=IN IP4 127.0.0.1 -b=AS:1000 -a=rtpmap:${payloadTypeH264} H264/90000 -a=fmtp:${payloadTypeH264} profile-level-id=42e01f;sprop-parameter-sets=Z0IAH6tAoAt2AtwEBAaQeJEV,aM4JyA==;packetization-mode=1 -${ - portUdpH265 - ? `m=video ${portUdpH265} RTP/AVP ${payloadTypeH265} -c=IN IP4 127.0.0.1 -b=AS:1000 -a=rtpmap:${payloadTypeH265} H265/90000` - : '' -} -m=audio ${portUdpOpus} RTP/AVP ${payloadTypeOpus} -c=IN IP4 127.0.0.1 -b=AS:96 -a=rtpmap:${payloadTypeOpus} opus/48000/2 -a=fmtp:${payloadTypeOpus} minptime=10;useinbandfec=1 -a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level -a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time -a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 -a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid -a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay -a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type -a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing -a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space -a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id -a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id -a=extmap:13 urn:3gpp:video-orientation -a=extmap:14 urn:ietf:params:rtp-hdrext:toffset -`; - return sdpData; - } -} - -module.exports = Util; - -// Fixes Circular -const GuildChannel = require('../structures/GuildChannel'); diff --git a/vendor/discord.js-selfbot-v13/tsconfig.json b/vendor/discord.js-selfbot-v13/tsconfig.json deleted file mode 100644 index 55e49e5..0000000 --- a/vendor/discord.js-selfbot-v13/tsconfig.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - // Mapped from https://www.typescriptlang.org/tsconfig - "compilerOptions": { - // Type Checking - "allowUnreachableCode": false, - "allowUnusedLabels": false, - // if true: conflicts with discord-api-types - "exactOptionalPropertyTypes": false, - "noFallthroughCasesInSwitch": true, - "noImplicitOverride": true, - "noImplicitReturns": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "strict": true, - "useUnknownInCatchVariables": true, - // Modules - "module": "Node16", - "moduleResolution": "node16", - "resolveJsonModule": true, - // Emit - "declaration": false, - "importHelpers": true, - "inlineSources": false, - "newLine": "lf", - "noEmitHelpers": true, - "outDir": "dist", - "rootDir": ".", - "preserveConstEnums": true, - "removeComments": false, - "sourceMap": false, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - // Language and Environment - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "lib": ["ESNext", "ES2021", "DOM"], - "target": "ES2020", - "useDefineForClassFields": true, - // Output Formatting - "pretty": false, - // Completeness - "skipLibCheck": true, - "skipDefaultLibCheck": true - } -} diff --git a/vendor/discord.js-selfbot-v13/typings/enums.d.ts b/vendor/discord.js-selfbot-v13/typings/enums.d.ts deleted file mode 100644 index 7e443fb..0000000 --- a/vendor/discord.js-selfbot-v13/typings/enums.d.ts +++ /dev/null @@ -1,437 +0,0 @@ -// These are enums that are used in the typings file but do not exist as actual exported values. To prevent them from -// showing up in an editor, they are imported from here instead of exporting them there directly. - -export const enum ActivityTypes { - PLAYING = 0, - STREAMING = 1, - LISTENING = 2, - WATCHING = 3, - CUSTOM = 4, - COMPETING = 5, - HANG = 6, -} - -export const enum ApplicationCommandTypes { - CHAT_INPUT = 1, - USER = 2, - MESSAGE = 3, -} - -export const enum ApplicationCommandOptionTypes { - SUB_COMMAND = 1, - SUB_COMMAND_GROUP = 2, - STRING = 3, - INTEGER = 4, - BOOLEAN = 5, - USER = 6, - CHANNEL = 7, - ROLE = 8, - MENTIONABLE = 9, - NUMBER = 10, - ATTACHMENT = 11, -} - -export const enum ApplicationCommandPermissionTypes { - ROLE = 1, - USER = 2, -} - -export const enum AutoModerationRuleTriggerTypes { - KEYWORD = 1, - SPAM = 2, - KEYWORD_PRESET = 3, - MENTION_SPAM = 4, -} - -export const enum AutoModerationRuleKeywordPresetTypes { - PROFANITY = 1, - SEXUAL_CONTENT = 2, - SLURS = 3, -} - -export const enum AutoModerationActionTypes { - BLOCK_MESSAGE = 1, - SEND_ALERT_MESSAGE = 2, - TIMEOUT = 3, -} - -export const enum AutoModerationRuleEventTypes { - MESSAGE_SEND = 1, -} - -export const enum ChannelTypes { - GUILD_TEXT = 0, - DM = 1, - GUILD_VOICE = 2, - GROUP_DM = 3, - GUILD_CATEGORY = 4, - GUILD_NEWS = 5, - GUILD_STORE = 6, - UNKNOWN = 7, - GUILD_NEWS_THREAD = 10, - GUILD_PUBLIC_THREAD = 11, - GUILD_PRIVATE_THREAD = 12, - GUILD_STAGE_VOICE = 13, - GUILD_DIRECTORY = 14, - GUILD_FORUM = 15, - GUILD_MEDIA = 16, -} - -export const enum SortOrderTypes { - LATEST_ACTIVITY = 1, - CREATION_DATE = 2, -} - -export const enum ForumLayoutTypes { - NOT_SET = 0, - LIST_VIEW = 1, - GALLERY_VIEW = 2, -} - -export const enum PollLayoutTypes { - DEFAULT = 1, - IMAGE_ONLY_ANSWERS, -} - -export const enum MessageTypes { - DEFAULT = 0, - RECIPIENT_ADD, - RECIPIENT_REMOVE, - CALL, - CHANNEL_NAME_CHANGE, - CHANNEL_ICON_CHANGE, - CHANNEL_PINNED_MESSAGE, - GUILD_MEMBER_JOIN, - USER_PREMIUM_GUILD_SUBSCRIPTION, - USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1, - USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2, - USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3, - CHANNEL_FOLLOW_ADD, - GUILD_DISCOVERY_DISQUALIFIED = 14, - GUILD_DISCOVERY_REQUALIFIED, - GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING, - GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING, - THREAD_CREATED, - REPLY, - APPLICATION_COMMAND, - THREAD_STARTER_MESSAGE, - GUILD_INVITE_REMINDER, - CONTEXT_MENU_COMMAND, - AUTO_MODERATION_ACTION, - ROLE_SUBSCRIPTION_PURCHASE, - INTERACTION_PREMIUM_UPSELL, - STAGE_START, - STAGE_END, - STAGE_SPEAKER, - STAGE_RAISE_HAND, - STAGE_TOPIC, - GUILD_APPLICATION_PREMIUM_SUBSCRIPTION, - PREMIUM_REFERRAL = 35, - GUILD_INCIDENT_ALERT_MODE_ENABLED, - GUILD_INCIDENT_ALERT_MODE_DISABLED, - GUILD_INCIDENT_REPORT_RAID, - GUILD_INCIDENT_REPORT_FALSE_ALARM, - GUILD_DEADCHAT_REVIVE_PROMPT, - CUSTOM_GIFT, - GUILD_GAMING_STATS_PROMPT, - PURCHASE_NOTIFICATION = 44, - POLL_RESULT = 46, - CHANGELOG, - NITRO_NOTIFICATION, -} - -export const enum MessageReferenceTypes { - DEFAULT = 0, - FORWARD, -} - -export const enum DefaultMessageNotificationLevels { - ALL_MESSAGES = 0, - ONLY_MENTIONS = 1, -} - -export const enum ExplicitContentFilterLevels { - DISABLED = 0, - MEMBERS_WITHOUT_ROLES = 1, - ALL_MEMBERS = 2, -} - -export const enum GuildScheduledEventEntityTypes { - STAGE_INSTANCE = 1, - VOICE = 2, - EXTERNAL = 3, -} - -export const enum GuildScheduledEventPrivacyLevels { - GUILD_ONLY = 2, -} - -export const enum GuildScheduledEventStatuses { - SCHEDULED = 1, - ACTIVE = 2, - COMPLETED = 3, - CANCELED = 4, -} - -export const enum InteractionResponseTypes { - PONG = 1, - CHANNEL_MESSAGE_WITH_SOURCE = 4, - DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE = 5, - DEFERRED_MESSAGE_UPDATE = 6, - UPDATE_MESSAGE = 7, - APPLICATION_COMMAND_AUTOCOMPLETE_RESULT = 8, - MODAL = 9, -} - -export const enum InteractionTypes { - PING = 1, - APPLICATION_COMMAND = 2, - MESSAGE_COMPONENT = 3, - APPLICATION_COMMAND_AUTOCOMPLETE = 4, - MODAL_SUBMIT = 5, -} - -export const enum InviteTargetTypes { - STREAM = 1, - EMBEDDED_APPLICATION, - ROLE_SUBSCRIPTIONS, - CREATOR_PAGE, -} - -export const enum InviteTypes { - GUILD, - GROUP_DM, - FRIEND, -} - -export const enum MembershipStates { - INVITED = 1, - ACCEPTED = 2, -} - -export const enum MessageButtonStyles { - PRIMARY = 1, - SECONDARY = 2, - SUCCESS = 3, - DANGER = 4, - LINK = 5, -} - -export const enum MessageComponentTypes { - ACTION_ROW = 1, - BUTTON = 2, - STRING_SELECT = 3, - TEXT_INPUT = 4, - USER_SELECT = 5, - ROLE_SELECT = 6, - MENTIONABLE_SELECT = 7, - CHANNEL_SELECT = 8, - SECTION = 9, - TEXT_DISPLAY = 10, - THUMBNAIL = 11, - MEDIA_GALLERY = 12, - FILE = 13, - SEPARATOR = 14, - CONTAINER = 17, -} - -export const enum MessageComponentInteractables { - ACTION_ROW = 1, - BUTTON = 2, - STRING_SELECT = 3, - TEXT_INPUT = 4, - USER_SELECT = 5, - ROLE_SELECT = 6, - MENTIONABLE_SELECT = 7, - CHANNEL_SELECT = 8, -} - -export const enum SelectMenuComponentTypes { - STRING_SELECT = 3, - USER_SELECT = 5, - ROLE_SELECT = 6, - MENTIONABLE_SELECT = 7, - CHANNEL_SELECT = 8, -} - -export const enum MFALevels { - NONE = 0, - ELEVATED = 1, -} - -export const enum NSFWLevels { - DEFAULT = 0, - EXPLICIT = 1, - SAFE = 2, - AGE_RESTRICTED = 3, -} - -/** - * Background color of a nameplate. - * @see {@link https://docs.discord.food/resources/user#nameplate-color-palette} - */ -export enum NameplatePalette { - /** - * Value: none - * Name: None - */ - None = 'none', - /** - * Value: crimson - * Name: Crimson - */ - Crimson = 'crimson', - /** - * Value: berry - * Name: Berry - */ - Berry = 'berry', - /** - * Value: sky - * Name: Sky - */ - Sky = 'sky', - /** - * Value: teal - * Name: Teal - */ - Teal = 'teal', - /** - * Value: forest - * Name: Forest - */ - Forest = 'forest', - /** - * Value: bubble_gum - * Name: BubbleGum - */ - BubbleGum = 'bubble_gum', - /** - * Value: violet - * Name: Violet - */ - Violet = 'violet', - /** - * Value: cobalt - * Name: Cobalt - */ - Cobalt = 'cobalt', - /** - * Value: clover - * Name: Clover - */ - Clover = 'clover', - /** - * Value: lemon - * Name: Lemon - */ - Lemon = 'lemon', - /** - * Value: white - * Name: White - */ - White = 'white', -} - -export const enum OverwriteTypes { - role = 0, - member = 1, -} - -export const enum PremiumTiers { - NONE = 0, - TIER_1 = 1, - TIER_2 = 2, - TIER_3 = 3, -} - -export const enum PrivacyLevels { - PUBLIC = 1, - GUILD_ONLY = 2, -} - -export const enum StickerFormatTypes { - PNG = 1, - APNG = 2, - LOTTIE = 3, - GIF = 4, -} - -export const enum StickerTypes { - STANDARD = 1, - GUILD = 2, -} - -export const enum TextInputStyles { - SHORT = 1, - PARAGRAPH = 2, -} - -export const enum VerificationLevels { - NONE = 0, - LOW = 1, - MEDIUM = 2, - HIGH = 3, - VERY_HIGH = 4, -} - -export const enum VideoQualityModes { - AUTO = 1, - FULL = 2, -} - -export const enum ReactionTypes { - NORMAL = 0, - BURST = 1, -} - -export const enum WebhookTypes { - Incoming = 1, - 'Channel Follower' = 2, - Application = 3, -} - -export enum ApplicationRoleConnectionMetadataTypes { - INTEGER_LESS_THAN_OR_EQUAL = 1, - INTEGER_GREATER_THAN_OR_EQUAL, - INTEGER_EQUAL, - INTEGER_NOT_EQUAL, - DATATIME_LESS_THAN_OR_EQUAL, - DATATIME_GREATER_THAN_OR_EQUAL, - BOOLEAN_EQUAL, - BOOLEAN_NOT_EQUAL, -} - -export const enum RelationshipTypes { - NONE = 0, - FRIEND = 1, - BLOCKED = 2, - PENDING_INCOMING = 3, - PENDING_OUTGOING = 4, - IMPLICIT = 5, -} - -export const enum SeparatorSpacingSizes { - SMALL = 1, - LARGE = 2, -} - -export const enum ApplicationType { - /** - * A game integrating with Discord - */ - GAME = 1, - /** - * A music service integrating with Discord - * @deprecated - */ - MUSIC = 2, - /** - * A limited application used for ticketed event SKUs - */ - TICKETED_EVENTS = 3, - /** - * A limited application used for creator monetization (e.g. role subscription) SKUs - */ - CREATOR_MONETIZATION = 4, -} diff --git a/vendor/discord.js-selfbot-v13/typings/index.d.ts b/vendor/discord.js-selfbot-v13/typings/index.d.ts deleted file mode 100644 index e55781f..0000000 --- a/vendor/discord.js-selfbot-v13/typings/index.d.ts +++ /dev/null @@ -1,10332 +0,0 @@ -import { - ChildProcess, - ChildProcessWithoutNullStreams, -} from 'node:child_process'; -import { Socket } from 'node:dgram'; -import { EventEmitter } from 'node:events'; -import { AgentOptions } from 'node:https'; -import { Readable, Stream, Writable } from 'node:stream'; -import { MessagePort, Worker } from 'node:worker_threads'; -import { - blockQuote, - bold, - ContextMenuCommandBuilder, - channelMention, - codeBlock, - formatEmoji, - hideLinkEmbed, - hyperlink, - inlineCode, - italic, - quote, - roleMention, - SlashCommandBuilder, - spoiler, - strikethrough, - TimestampStyles, - TimestampStylesString, - time, - underscore, - userMention, -} from '@discordjs/builders'; -import { Collection } from '@discordjs/collection'; -import { - APIActionRowComponent, - APIApplicationCommandInteractionData, - APIApplicationCommandOption, - APIApplicationCommandPermission, - APIAuditLogChange, - APIButtonComponent, - APIChannel, - APIChatInputApplicationCommandInteractionData, - APIContextMenuInteractionData, - APIEmbed, - APIEmoji, - APIGuildMember, - APIInteractionDataResolvedChannel, - APIInteractionDataResolvedGuildMember, - APIInteractionGuildMember, - APIMessage, - APIMessageActionRowComponent, - APIMessageComponent, - APIModalActionRowComponent, - APIOverwrite, - APIPartialChannel, - APIPartialEmoji, - APIPartialGuild, - APIPoll, - APIPollAnswer, - APIRole, - APISelectMenuComponent, - APITemplateSerializedSourceGuild, - APIUser, - GatewayVoiceChannelEffectSendDispatchData, - GatewayVoiceServerUpdateDispatchData, - GatewayVoiceStateUpdateDispatchData, - GuildScheduledEventRecurrenceRuleFrequency, - GuildScheduledEventRecurrenceRuleMonth, - GuildScheduledEventRecurrenceRuleWeekday, - LocaleString, - LocalizationMap, - MessageActivityType, - RESTPostAPIApplicationCommandsJSONBody, - ReactionType, - Snowflake, - TeamMemberRole, - VoiceChannelEffectSendAnimationType, -} from 'discord-api-types/v10'; -import { authenticator } from 'otplib'; -import { CookieJar } from 'tough-cookie'; -import { ProxyAgent, Response } from 'undici'; -import { RtpPacket } from 'werift-rtp'; -import * as WebSocket from 'ws'; -import { - ActivityTypes, - ApplicationCommandOptionTypes, - ApplicationCommandPermissionTypes, - ApplicationCommandTypes, - ApplicationRoleConnectionMetadataTypes, - ApplicationType, - AutoModerationActionTypes, - AutoModerationRuleEventTypes, - AutoModerationRuleKeywordPresetTypes, - AutoModerationRuleTriggerTypes, - ChannelTypes, - DefaultMessageNotificationLevels, - ExplicitContentFilterLevels, - ForumLayoutTypes, - GuildScheduledEventEntityTypes, - GuildScheduledEventPrivacyLevels, - GuildScheduledEventStatuses, - InteractionResponseTypes, - InteractionTypes, - InviteTargetTypes, - InviteTypes, - MembershipStates, - MessageButtonStyles, - MessageComponentInteractables, - MessageComponentTypes, - MessageReferenceTypes, - MessageTypes, - MFALevels, - NameplatePalette, - NSFWLevels, - OverwriteTypes, - PollLayoutTypes, - PremiumTiers, - PrivacyLevels, - ReactionTypes, - RelationshipTypes, - SelectMenuComponentTypes, - SeparatorSpacingSizes, - SortOrderTypes, - StickerFormatTypes, - StickerTypes, - TextInputStyles, - VerificationLevels, - VideoQualityModes, - WebhookTypes, -} from './enums'; -import { - APIApplicationRoleConnectionMetadata, - APIAutoModerationRule, - APIContainerComponent, - APIFileComponent, - APIMediaGalleryComponent, - APIMediaGalleryItem, - APISectionComponent, - APISeparatorComponent, - APITextDisplayComponent, - APIThumbnailComponent, - APIUnfurledMediaItem, - GatewayAutoModerationActionExecutionDispatchData, - RawActivityData, - RawAnonymousGuildData, - RawApplicationCommandData, - RawApplicationData, - RawBaseGuildData, - RawChannelData, - RawDMChannelData, - RawEmojiData, - RawGuildAuditLogData, - RawGuildAuditLogEntryData, - RawGuildBanData, - RawGuildChannelData, - RawGuildData, - RawGuildEmojiData, - RawGuildMemberData, - RawGuildPreviewData, - RawGuildScheduledEventData, - RawGuildTemplateData, - RawIntegrationApplicationData, - RawIntegrationData, - RawInteractionData, - RawInviteData, - RawInviteGuildData, - RawInviteStageInstance, - RawMessageAttachmentData, - RawMessageButtonInteractionData, - RawMessageComponentInteractionData, - RawMessageData, - RawMessagePayloadData, - RawMessageReactionData, - RawMessageSelectMenuInteractionData, - RawModalSubmitInteractionData, - RawOAuth2GuildData, - RawPartialGroupDMChannelData, - RawPartialMessageData, - RawPermissionOverwriteData, - RawPresenceData, - RawReactionEmojiData, - RawRichPresenceAssets, - RawRoleData, - RawStageInstanceData, - RawStickerData, - RawStickerPackData, - RawTeamData, - RawTeamMemberData, - RawTextInputComponentData, - RawThreadChannelData, - RawThreadMemberData, - RawTypingData, - RawUserData, - RawVoiceRegionData, - RawVoiceStateData, - RawWebhookData, - RawWelcomeChannelData, - RawWelcomeScreenData, - RawWidgetData, - RawWidgetMemberData, -} from './rawDataTypes'; - -//#region Classes - -// RPC by aiko-chan-ai -export interface RichButton { - name: string; - url: string; -} - -export class RichPresence extends Activity { - public constructor(client: Client, data?: object); - public metadata: RichPresenceMetadata; - public setAssetsLargeImage(image?: string): this; - public setAssetsLargeText(text?: string): this; - public setAssetsSmallImage(image?: string): this; - public setAssetsSmallText(text?: string): this; - public setName(name?: string): this; - public setURL(url?: string): this; - public setType(type?: ActivityType): this; - public setApplicationId(id?: Snowflake): this; - public setDetails(details?: string): this; - public setState(state?: string): this; - public setParty(party?: { max: number; current: number; id?: string }): this; - public setStartTimestamp(timestamp: Date | number | null): this; - public setEndTimestamp(timestamp: Date | number | null): this; - public setButtons(...button: RichButton[]): this; - public addButton(name: string, url: string): this; - public setJoinSecret(join?: string): this; - public setPlatform(platform?: ActivityPlatform): this; - public static getExternal( - client: Client, - applicationId: Snowflake, - ...images: string[] - ): Promise; -} - -export class DiscordAuthWebsocket extends EventEmitter { - constructor(); - public token: string; - public readonly user: { - id: Snowflake; - username: string; - discriminator: number; - avatar: string; - }; - public readonly exprire: Date; - public readonly AuthURL: string; - public connect(client?: Client): Promise; - public destroy(): void; - public generateQR(): void; - public on(event: 'ready', listener: (client: this) => void): this; - public on(event: 'finish', listener: (token: string) => void): this; - public on( - event: 'cancel' | 'pending', - listener: (user: RawUserData) => void, - ): this; - public on(event: 'closed', listener: () => void): this; - public on(event: string, listener: (...args: any[]) => Awaitable): this; -} - -export interface ExternalAssets { - url: string; - external_asset_path: string; -} - -export interface RichPresenceMetadata { - album_id?: string; - artist_ids?: string[]; - context_uri?: string; - button_urls?: string[]; -} - -export class SpotifyRPC extends RichPresence { - public constructor(client: Client, data?: object); - public setSongId(id: string): this; - public addArtistId(id: string): this; - public setArtistIds(...ids: string[]): this; - public setAlbumId(id: string): this; -} - -export class CustomStatus extends Activity { - public constructor(client: Client, data?: object); - public setEmoji(emoji?: EmojiIdentifierResolvable): this; - public setState(state: string): this; -} - -export class Activity { - public constructor(presence: Presence, data?: RawActivityData); - public readonly presence: Presence; - public applicationId: Snowflake | null; - public assets: RichPresenceAssets; - public buttons: string[]; - public readonly createdAt: Date; - public createdTimestamp: number; - public details: string | null; - public emoji: EmojiIdentifierResolvable | null; - public flags: Readonly; - public id: string; - public name: string; - public party: { - id: string | null; - size: [number, number]; - } | null; - public platform: ActivityPlatform | null; - public sessionId: string | null; - public state: string | null; - public syncId: string | null; - public timestamps: { - start: number | null; - end: number | null; - } | null; - public type: ActivityType; - public url: string | null; - public equals(activity: Activity): boolean; - public toJSON(): ActivityOptions; - public toString(): string; -} - -export class ActivityFlags extends BitField { - public static FLAGS: Record; - public static resolve( - bit?: BitFieldResolvable, - ): number; -} - -export class PurchasedFlags extends BitField { - public static FLAGS: Record; - public static resolve( - bit?: BitFieldResolvable, - ): number; -} - -export class PremiumUsageFlags extends BitField { - public static FLAGS: Record; - public static resolve( - bit?: BitFieldResolvable, - ): number; -} - -export class InviteFlags extends BitField { - public static FLAGS: Record; - public static resolve( - bit?: BitFieldResolvable, - ): number; -} - -export abstract class AnonymousGuild extends BaseGuild { - protected constructor( - client: Client, - data: RawAnonymousGuildData, - immediatePatch?: boolean, - ); - public banner: string | null; - public description: string | null; - public nsfwLevel: NSFWLevel; - public premiumSubscriptionCount: number | null; - public splash: string | null; - public vanityURLCode: string | null; - public verificationLevel: VerificationLevel; - public bannerURL(options?: StaticImageURLOptions): string | null; - public splashURL(options?: StaticImageURLOptions): string | null; -} - -export abstract class Application extends Base { - protected constructor(client: Client, data: RawApplicationData); - public readonly createdAt: Date; - public readonly createdTimestamp: number; - public description: string | null; - public icon: string | null; - public id: Snowflake; - public name: string | null; - public termsOfServiceURL: string | null; - public privacyPolicyURL: string | null; - public verifyKey: string | null; - public roleConnectionsVerificationURL: string | null; - public approximateGuildCount: number | null; - /** @deprecated */ - public botPublic: boolean | null; - /** @deprecated */ - public botRequireCodeGrant: boolean | null; - public commands: ApplicationCommandManager; - public cover: string | null; - public flags: Readonly; - public guildId: Snowflake | null; - public readonly guild: Guild | null; - public tags: string[]; - public installParams: ClientApplicationInstallParams | null; - public customInstallURL: string | null; - public owner: User | Team | null; - public readonly partial: boolean; - public rpcOrigins: string[]; - public splash: string | null; - public type: ApplicationType | null; - public primarySkuId: Snowflake | null; - public eulaId: Snowflake | null; - public slug: string | null; - public aliases: string[]; - public executables: - | { os: string; name: string; is_launcher: boolean }[] - | null; - public thirdPartySkus: - | { id: Snowflake | null; sku: string | null; distributor: string }[] - | null; - public hook: boolean | null; - public overlay: boolean | null; - public overlayMethods: number | null; - public overlayWarn: boolean | null; - public overlayCompatibilityHook: boolean | null; - public bot: PartialUser | null; - public developers: { id: Snowflake; name: string }[] | null; - public publishers: { id: Snowflake; name: string }[] | null; - public redirectUris: string[] | null; - public deeplinkUri: string | null; - public integrationPublic: boolean | null; - public integrationRequireCodeGrant: boolean | null; - public botDisabled: boolean | null; - public botQuarantined: boolean | null; - public approximateUserInstallCount: number | null; - public approximateUserAuthorizationCount: number | null; - public internalGuildRestriction: number | null; - public interactionsEndpointUrl: string | null; - public interactionsVersion: number | null; - public interactionsEventTypes: string[] | null; - public eventWebhooksStatus: number | null; - public eventWebhooksUrl: string | null; - public eventWebhooksTypes: string[] | null; - public explicitContentFilter: number | null; - public integrationTypesConfig: Record< - number, - { oauth2_install_params: ClientApplicationInstallParams | null } - > | null; - public isVerified: boolean | null; - public verificationState: number | null; - public storeApplicationState: number | null; - public rpcApplicationState: number | null; - public creatorMonetizationState: number | null; - public isDiscoverable: boolean | null; - public discoverabilityState: number | null; - public discoveryEligibilityFlags: number | null; - public isMonetized: boolean | null; - public storefrontAvailable: boolean | null; - public monetizationState: number | null; - public monetizationEligibilityFlags: number | null; - public maxParticipants: number | null; - public fetch(): Promise; - public fetchRoleConnectionMetadataRecords(): Promise< - ApplicationRoleConnectionMetadata[] - >; - public coverURL(options?: StaticImageURLOptions): string | null; - /** @deprecated This method is deprecated as it is unsupported and will be removed in the next major version. */ - public fetchAssets(): Promise; - public iconURL(options?: StaticImageURLOptions): string | null; - public toJSON(): unknown; - public toString(): string | null; -} - -export class ApplicationCommand extends Base { - private constructor( - client: Client, - data: RawApplicationCommandData, - guild?: Guild, - guildId?: Snowflake, - ); - public applicationId: Snowflake; - public readonly createdAt: Date; - public readonly createdTimestamp: number; - /** @deprecated Use {@link defaultMemberPermissions} and {@link dmPermission} instead. */ - public defaultPermission: boolean; - public defaultMemberPermissions: Readonly | null; - public description: string; - public descriptionLocalizations: LocalizationMap | null; - public descriptionLocalized: string | null; - public dmPermission: boolean | null; - public guild: Guild | null; - public guildId: Snowflake | null; - public readonly manager: ApplicationCommandManager; - public id: Snowflake; - public name: string; - public nameLocalizations: LocalizationMap | null; - public nameLocalized: string | null; - public options: (ApplicationCommandOption & { - nameLocalized?: string; - descriptionLocalized?: string; - })[]; - public permissions: ApplicationCommandPermissionsManager< - PermissionsFetchType, - PermissionsFetchType, - PermissionsFetchType, - Guild | null, - Snowflake - >; - public type: ApplicationCommandType; - public version: Snowflake; - public delete(): Promise>; - public edit( - data: Partial, - ): Promise>; - public setName( - name: string, - ): Promise>; - public setNameLocalizations( - nameLocalizations: LocalizationMap, - ): Promise>; - public setDescription( - description: string, - ): Promise>; - public setDescriptionLocalizations( - descriptionLocalizations: LocalizationMap, - ): Promise>; - /** @deprecated Use {@link setDefaultMemberPermissions} and {@link setDMPermission} instead. */ - public setDefaultPermission( - defaultPermission?: boolean, - ): Promise>; - public setDefaultMemberPermissions( - defaultMemberPermissions: PermissionResolvable | null, - ): Promise>; - public setDMPermission( - dmPermission?: boolean, - ): Promise>; - public setOptions( - options: ApplicationCommandOptionData[], - ): Promise>; - public equals( - command: - | ApplicationCommand - | ApplicationCommandData - | RawApplicationCommandData, - enforceOptionorder?: boolean, - ): boolean; - public static optionsEqual( - existing: ApplicationCommandOption[], - options: - | ApplicationCommandOption[] - | ApplicationCommandOptionData[] - | APIApplicationCommandOption[], - enforceOptionorder?: boolean, - ): boolean; - private static _optionEquals( - existing: ApplicationCommandOption, - options: - | ApplicationCommandOption - | ApplicationCommandOptionData - | APIApplicationCommandOption, - enforceOptionorder?: boolean, - ): boolean; - private static transformOption( - option: ApplicationCommandOptionData, - received?: boolean, - ): unknown; - private static transformCommand( - command: ApplicationCommandData, - ): RESTPostAPIApplicationCommandsJSONBody; - private static isAPICommandData( - command: object, - ): command is RESTPostAPIApplicationCommandsJSONBody; -} - -export class ApplicationRoleConnectionMetadata { - private constructor(data: APIApplicationRoleConnectionMetadata); - public name: string; - public nameLocalizations: LocalizationMap | null; - public description: string; - public descriptionLocalizations: LocalizationMap | null; - public key: string; - public type: ApplicationRoleConnectionMetadataTypes; -} - -export type ApplicationResolvable = Application | Activity | Snowflake; - -export type AutoModerationRuleResolvable = AutoModerationRule | Snowflake; - -export class ApplicationFlags extends BitField { - public static FLAGS: Record; - public static resolve( - bit?: BitFieldResolvable, - ): number; -} - -export abstract class Base { - public constructor(client: Client); - public readonly client: Client; - public toJSON(...props: Record[]): unknown; - public valueOf(): string; -} - -export class RESTManager { - private constructor(client: Client); - public readonly client: Client; - public handlers: Collection; - public versioned: true; - public cookieJar: CookieJar; - public fetch: typeof globalThis.fetch; - public getAuth(): string; - public readonly api: unknown; - public readonly cdn: unknown; -} - -export class BaseClient extends EventEmitter { - public constructor(options?: ClientOptions | WebhookClientOptions); - public readonly api: RESTManager['api']; - public rest: RESTManager; - private decrementMaxListeners(): void; - private incrementMaxListeners(): void; - - public on( - event: K, - listener: (...args: BaseClientEvents[K]) => Awaitable, - ): this; - public on( - event: Exclude, - listener: (...args: any[]) => Awaitable, - ): this; - - public once( - event: K, - listener: (...args: BaseClientEvents[K]) => Awaitable, - ): this; - public once( - event: Exclude, - listener: (...args: any[]) => Awaitable, - ): this; - - public emit( - event: K, - ...args: BaseClientEvents[K] - ): boolean; - public emit( - event: Exclude, - ...args: unknown[] - ): boolean; - - public off( - event: K, - listener: (...args: BaseClientEvents[K]) => Awaitable, - ): this; - public off( - event: Exclude, - listener: (...args: any[]) => Awaitable, - ): this; - - public removeAllListeners(event?: K): this; - public removeAllListeners( - event?: Exclude, - ): this; - - public options: ClientOptions | WebhookClientOptions; - public destroy(): void; - public toJSON(...props: Record[]): unknown; -} - -export type GuildCacheMessage = CacheTypeReducer< - Cached, - Message, - APIMessage, - Message | APIMessage, - Message | APIMessage ->; - -export interface InteractionResponseFields< - Cached extends CacheType = CacheType, -> { - deferred: boolean; - ephemeral: boolean | null; - replied: boolean; - webhook: InteractionWebhook; - reply( - options: InteractionReplyOptions & { fetchReply: true }, - ): Promise>; - reply( - options: string | MessagePayload | InteractionReplyOptions, - ): Promise; - deleteReply(message?: MessageResolvable | '@original'): Promise; - editReply( - options: string | MessagePayload | InteractionEditReplyOptions, - ): Promise>; - deferReply( - options: InteractionDeferReplyOptions & { fetchReply: true }, - ): Promise>; - deferReply(options?: InteractionDeferReplyOptions): Promise; - fetchReply( - message?: MessageResolvable | '@original', - ): Promise>; - followUp( - options: string | MessagePayload | InteractionReplyOptions, - ): Promise>; -} - -export abstract class BaseCommandInteraction< - Cached extends CacheType = CacheType, -> extends Interaction { - public readonly command: - | ApplicationCommand - | ApplicationCommand<{ guild: GuildResolvable }> - | null; - public options: Omit< - CommandInteractionOptionResolver, - | 'getMessage' - | 'getFocused' - | 'getMentionable' - | 'getRole' - | 'getNumber' - | 'getInteger' - | 'getString' - | 'getChannel' - | 'getBoolean' - | 'getSubcommandGroup' - | 'getSubcommand' - | 'getAttachment' - >; - public channelId: Snowflake; - public commandId: Snowflake; - public commandName: string; - public deferred: boolean; - public ephemeral: boolean | null; - public replied: boolean; - public webhook: InteractionWebhook; - public awaitModalSubmit( - options: AwaitModalSubmitOptions, - ): Promise>; - public inGuild(): this is BaseCommandInteraction<'raw' | 'cached'>; - public inCachedGuild(): this is BaseCommandInteraction<'cached'>; - public inRawGuild(): this is BaseCommandInteraction<'raw'>; - public deferReply( - options: InteractionDeferReplyOptions & { fetchReply: true }, - ): Promise>; - public deferReply(options?: InteractionDeferReplyOptions): Promise; - public deleteReply(message?: MessageResolvable | '@original'): Promise; - public editReply( - options: string | MessagePayload | InteractionEditReplyOptions, - ): Promise>; - public fetchReply( - message?: MessageResolvable | '@original', - ): Promise>; - public followUp( - options: string | MessagePayload | InteractionReplyOptions, - ): Promise>; - public reply( - options: InteractionReplyOptions & { fetchReply: true }, - ): Promise>; - public reply( - options: string | MessagePayload | InteractionReplyOptions, - ): Promise; - public showModal(modal: Modal | ModalOptions): Promise; - private transformOption( - option: APIApplicationCommandOption, - resolved: Extract< - APIApplicationCommandInteractionData, - | APIChatInputApplicationCommandInteractionData - | APIContextMenuInteractionData - >['resolved'], - ): CommandInteractionOption; - private transformResolved( - resolved: Extract< - APIApplicationCommandInteractionData, - | APIChatInputApplicationCommandInteractionData - | APIContextMenuInteractionData - >['resolved'], - ): CommandInteractionResolvedData; -} - -export abstract class BaseGuild extends Base { - protected constructor(client: Client, data: RawBaseGuildData); - public readonly createdAt: Date; - public readonly createdTimestamp: number; - public features: GuildFeatures[]; - public icon: string | null; - public id: Snowflake; - public name: string; - public readonly nameAcronym: string; - public readonly partnered: boolean; - public readonly verified: boolean; - public fetch(): Promise; - public iconURL(options?: ImageURLOptions): string | null; - public toString(): string; -} - -export class BaseGuildEmoji extends Emoji { - protected constructor( - client: Client, - data: RawGuildEmojiData, - guild: Guild | GuildPreview, - ); - public available: boolean | null; - public readonly createdAt: Date; - public readonly createdTimestamp: number; - public guild: Guild | GuildPreview; - public id: Snowflake; - public managed: boolean | null; - public requiresColons: boolean | null; -} - -export class BaseGuildTextChannel extends TextBasedChannelMixin(GuildChannel) { - protected constructor( - guild: Guild, - data?: RawGuildChannelData, - client?: Client, - immediatePatch?: boolean, - ); - public defaultAutoArchiveDuration?: ThreadAutoArchiveDuration; - public defaultThreadRateLimitPerUser: number | null; - public rateLimitPerUser: number | null; - public nsfw: boolean; - public threads: GuildTextThreadManager< - AllowedThreadTypeForTextChannel | AllowedThreadTypeForNewsChannel - >; - public topic: string | null; - public createInvite(options?: CreateInviteOptions): Promise; - public fetchInvites(cache?: boolean): Promise>; - public setDefaultAutoArchiveDuration( - defaultAutoArchiveDuration: ThreadAutoArchiveDuration | 'MAX', - reason?: string, - ): Promise; - public setTopic(topic: string | null, reason?: string): Promise; - public setType( - type: Pick, - reason?: string, - ): Promise; - public setType( - type: Pick, - reason?: string, - ): Promise; -} - -export class BaseGuildVoiceChannel extends TextBasedChannelMixin(GuildChannel, [ - 'lastPinTimestamp', - 'lastPinAt', -]) { - public constructor(guild: Guild, data?: RawGuildChannelData); - public readonly members: Collection; - public readonly full: boolean; - public readonly joinable: boolean; - public bitrate: number; - public nsfw: boolean; - public rtcRegion: string | null; - public rateLimitPerUser: number | null; - public userLimit: number; - public videoQualityMode: VideoQualityMode | null; - public status?: string; - public createInvite(options?: CreateInviteOptions): Promise; - public setRTCRegion(rtcRegion: string | null, reason?: string): Promise; - public fetchInvites(cache?: boolean): Promise>; - public setBitrate(bitrate: number, reason?: string): Promise; - public setUserLimit( - userLimit: number, - reason?: string, - ): Promise; - public setVideoQualityMode( - videoQualityMode: VideoQualityMode | number, - reason?: string, - ): Promise; -} - -export class BaseMessageComponent { - protected constructor( - data?: BaseMessageComponent | BaseMessageComponentOptions, - ); - public type: MessageComponentType | null; - public readonly id: number; - public data: MessageComponentOptions; - private static create( - data: MessageComponentOptions, - client?: Client | WebhookClient, - ): MessageComponent | undefined; - private static resolveType( - type: MessageComponentTypeResolvable, - ): MessageComponentType; -} - -export class BitField { - public constructor(bits?: BitFieldResolvable); - public bitfield: N; - public add(...bits: BitFieldResolvable[]): BitField; - public any(bit: BitFieldResolvable): boolean; - public equals(bit: BitFieldResolvable): boolean; - public freeze(): Readonly>; - public has(bit: BitFieldResolvable): boolean; - public missing( - bits: BitFieldResolvable, - ...hasParams: readonly unknown[] - ): S[]; - public remove(...bits: BitFieldResolvable[]): BitField; - public serialize(...hasParams: readonly unknown[]): Record; - public toArray(...hasParams: readonly unknown[]): S[]; - public toJSON(): N extends number ? number : string; - public valueOf(): N; - public [Symbol.iterator](): IterableIterator; - public static FLAGS: Record; - public static resolve( - bit?: BitFieldResolvable, - ): number | bigint; -} - -export class ButtonInteraction< - Cached extends CacheType = CacheType, -> extends MessageComponentInteraction { - private constructor(client: Client, data: RawMessageButtonInteractionData); - public readonly component: CacheTypeReducer< - Cached, - MessageButton, - APIButtonComponent, - MessageButton | APIButtonComponent, - MessageButton | APIButtonComponent - >; - public componentType: 'BUTTON'; - public inGuild(): this is ButtonInteraction<'raw' | 'cached'>; - public inCachedGuild(): this is ButtonInteraction<'cached'>; - public inRawGuild(): this is ButtonInteraction<'raw'>; -} - -export type KeyedEnum = { - [Key in keyof K]: T | string; -}; - -export type EnumValueMapped< - E extends KeyedEnum, - T extends Partial>, -> = T & { - [Key in keyof T as E[Key]]: T[Key]; -}; - -export type MappedChannelCategoryTypes = EnumValueMapped< - typeof ChannelTypes, - { - GUILD_NEWS: NewsChannel; - GUILD_VOICE: VoiceChannel; - GUILD_TEXT: TextChannel; - GUILD_STORE: StoreChannel; - GUILD_STAGE_VOICE: StageChannel; - GUILD_FORUM: ForumChannel; - GUILD_MEDIA: MediaChannel; - } ->; - -export type CategoryChannelTypes = ExcludeEnum< - typeof ChannelTypes, - | 'DM' - | 'GROUP_DM' - | 'UNKNOWN' - | 'GUILD_PUBLIC_THREAD' - | 'GUILD_NEWS_THREAD' - | 'GUILD_PRIVATE_THREAD' - | 'GUILD_CATEGORY' - | 'GUILD_DIRECTORY' ->; - -export class CategoryChannel extends GuildChannel { - public readonly children: Collection< - Snowflake, - Exclude - >; - public static parent: null; - public parentId: null; - public type: 'GUILD_CATEGORY'; - - public createChannel< - T extends Exclude< - CategoryChannelTypes, - 'GUILD_STORE' | ChannelTypes.GUILD_STORE - >, - >( - name: string, - options: CategoryCreateChannelOptions & { type: T }, - ): Promise; - /** @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/6309018858647) for more information */ - public createChannel( - name: string, - options: CategoryCreateChannelOptions & { - type: 'GUILD_STORE' | ChannelTypes.GUILD_STORE; - }, - ): Promise; - public createChannel( - name: string, - options?: CategoryCreateChannelOptions, - ): Promise; -} - -export type CategoryChannelResolvable = Snowflake | CategoryChannel; - -export abstract class Channel extends Base { - public constructor( - client: Client, - data?: RawChannelData, - immediatePatch?: boolean, - ); - public readonly createdAt: Date | null; - public readonly createdTimestamp: number | null; - /** @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 */ - public deleted: boolean; - public id: Snowflake; - public readonly partial: false; - public type: keyof typeof ChannelTypes; - public flags: Readonly | null; - public delete(): Promise; - public fetch(force?: boolean): Promise; - public isText(): this is TextBasedChannel; - public isVoice(): this is BaseGuildVoiceChannel; - public isThread(): this is ThreadChannel; - public isDirectory(): this is DirectoryChannel; - public isThreadOnly(): this is ThreadOnlyChannel; - public toString(): ChannelMention; -} - -export type If = T extends true - ? A - : T extends false - ? B - : A | B; - -export class Client extends BaseClient { - public constructor(options?: ClientOptions); - private actions: unknown; - public authenticator: typeof authenticator; - private presence: ClientPresence; - private _eval(script: string): unknown; - private _validateOptions(options: ClientOptions): void; - public channels: ChannelManager; - public readonly emojis: BaseGuildEmojiManager; - public guilds: GuildManager; - public options: ClientOptions; - public readyAt: If; - public readonly readyTimestamp: If; - public sweepers: Sweepers; - public shard: ShardClientUtil | null; - public token: If; - public uptime: If; - public user: If; - public users: UserManager; - public voice: ClientVoiceManager; - public ws: WebSocketManager; - public notes: UserNoteManager; - public relationships: RelationshipManager; - public voiceStates: VoiceStateManager; - public sessions: SessionManager; - public presences: PresenceManager; - public billing: BillingManager; - public settings: ClientUserSettingManager; - public readonly sessionId: If; - public destroy(): void; - public fetchGuildPreview(guild: GuildResolvable): Promise; - public fetchInvite( - invite: InviteResolvable, - options?: ClientFetchInviteOptions, - ): Promise; - public fetchGuildTemplate( - template: GuildTemplateResolvable, - ): Promise; - public fetchVoiceRegions(): Promise>; - public fetchSticker(id: Snowflake): Promise; - public fetchPremiumStickerPacks(): Promise< - Collection - >; - public fetchWebhook(id: Snowflake, token?: string): Promise; - public fetchGuildWidget(guild: GuildResolvable): Promise; - public refreshAttachmentURL( - ...urls: string[] - ): Promise<{ original: string; refreshed: string }[]>; - public sleep(timeout: number): Promise; - public login(token?: string): Promise; - /** @deprecated This method will not be updated until I find the most convenient way to implement MFA. */ - public passLogin(email: string, password: string): Promise; - public QRLogin(): Promise; - public logout(): Promise; - public isReady(): this is Client; - /** @deprecated Use {@link Sweepers#sweepMessages} instead */ - public sweepMessages(lifetime?: number): number; - public toJSON(): unknown; - public acceptInvite( - invite: InviteResolvable, - options?: AcceptInviteOptions, - ): Promise; - public redeemNitro( - nitro: string, - channel?: TextChannelResolvable, - paymentSourceId?: Snowflake, - ): Promise; - public authorizeURL( - urlOAuth2: string, - options?: OAuth2AuthorizeOptions, - ): Promise<{ location: string }>; - public installUserApps(applicationId: Snowflake): Promise; - public deauthorize( - id: Snowflake, - type?: 'application' | 'token', - ): Promise; - public authorizedApplications(): Promise< - Collection< - Snowflake, - { - application: Application; - scopes: string[]; - authorizedApplicationId: Snowflake; - deauthorize: () => Promise; - } - > - >; - - public on( - event: K, - listener: (...args: ClientEvents[K]) => Awaitable, - ): this; - public on( - event: Exclude, - listener: (...args: any[]) => Awaitable, - ): this; - - public once( - event: K, - listener: (...args: ClientEvents[K]) => Awaitable, - ): this; - public once( - event: Exclude, - listener: (...args: any[]) => Awaitable, - ): this; - - public emit( - event: K, - ...args: ClientEvents[K] - ): boolean; - public emit( - event: Exclude, - ...args: unknown[] - ): boolean; - - public off( - event: K, - listener: (...args: ClientEvents[K]) => Awaitable, - ): this; - public off( - event: Exclude, - listener: (...args: any[]) => Awaitable, - ): this; - - public removeAllListeners(event?: K): this; - public removeAllListeners( - event?: Exclude, - ): this; -} - -export interface AcceptInviteOptions { - bypassOnboarding: boolean; - bypassVerify: boolean; -} - -export type OAuth2AuthorizeOptions = { - guild_id?: Snowflake; - permissions?: string; - authorize?: boolean; - code?: string; - webhook_channel_id?: Snowflake; -} & Record; - -export class ClientPresence extends Presence { - private constructor(client: Client, data: RawPresenceData); - private _parse(data: PresenceData): RawPresenceData; - - public set(presence: PresenceData): ClientPresence; -} - -export class ClientUser extends User { - public mfaEnabled: boolean; - public readonly presence: ClientPresence; - public verified: boolean; - public edit(data: ClientUserEditData): Promise; - public setActivity( - options?: ActivityOptions | RichPresence | SpotifyRPC | CustomStatus, - ): ClientPresence; - public setActivity( - name: string, - options?: Omit, - ): ClientPresence; - public setAFK(afk?: boolean, shardId?: number | number[]): ClientPresence; - public setAvatar( - avatar: BufferResolvable | Base64Resolvable | null, - ): Promise; - public setPresence(data: PresenceData): ClientPresence; - public setStatus( - status: PresenceStatusData, - shardId?: number | number[], - ): ClientPresence; - public setUsername(username: string, password: string): Promise; - public purchasedFlags: Readonly; - public premiumUsageFlags: Readonly; - public phone: string | null; - public nsfwAllowed?: boolean; - public email: string | null; - public bio?: string; - public pronouns?: string; - public premiumType: number; - public setBanner( - banner: BufferResolvable | Base64Resolvable | null, - ): Promise; - public setHypeSquad( - hypesquad: - | 0 - | 1 - | 2 - | 3 - | 'LEAVE' - | 'HOUSE_BRAVERY' - | 'HOUSE_BRILLIANCE' - | 'HOUSE_BALANCE', - ): Promise; - public setAccentColor(color: ColorResolvable): Promise; - public setAboutMe(bio: string | null): Promise; - public createFriendInvite(): Promise; - public getAllFriendInvites(): Promise>; - public revokeAllFriendInvites(): Promise; - public setSamsungActivity( - packageName: string, - type: 'START' | 'UPDATE' | 'STOP', - ): Promise; - public stopRinging(channel: ChannelResolvable): Promise; - public fetchBurstCredit(): Promise; - public setPronouns(pronouns?: string | null): Promise; - public setGlobalName(globalName?: string | null): Promise; -} - -export class Options extends null { - private constructor(); - public static defaultMakeCacheSettings: CacheWithLimitsOptions; - public static defaultSweeperSettings: SweeperOptions; - public static createDefault(): ClientOptions; - public static cacheWithLimits( - settings?: CacheWithLimitsOptions, - ): CacheFactory; - public static cacheEverything(): CacheFactory; -} - -export class ClientVoiceManager { - private constructor(client: Client); - public readonly client: Client; - public adapters: Map; - public connection: VoiceConnection | null; - - public joinChannel( - channel: VoiceBasedChannel | DMChannel | GroupDMChannel | Snowflake, - config?: JoinChannelConfig, - ): Promise; -} - -export interface JoinChannelConfig { - selfMute?: boolean; - selfDeaf?: boolean; - selfVideo?: boolean; - videoCodec?: VideoCodec; -} - -export type VideoCodec = 'VP8' | 'H264'; - -export class VolumeInterface extends EventEmitter { - constructor(options?: { volume?: number }); - public readonly volume: number; - public readonly volumeDecibels: number; - public readonly volumeEditable: boolean; - public readonly volumeLogarithmic: number; - public setVolume(volume: number): void; - public setVolumeDecibels(db: number): void; - public setVolumeLogarithmic(value: number): void; - - public on( - event: 'volumeChange', - listener: (oldVolume: number, newVolume: number) => void, - ): this; - - public once( - event: 'volumeChange', - listener: (oldVolume: number, newVolume: number) => void, - ): this; -} - -export function VolumeMixin( - base: Constructable, -): Constructable; - -export type StreamType = - | 'unknown' - | 'converted' - | 'opus' - | 'ogg/opus' - | 'webm/opus'; - -export interface StreamOptions { - type?: StreamType; - seek?: number; - volume?: number | boolean; - plp?: number; - fec?: boolean; - bitrate?: number | 'auto'; - highWaterMark?: number; -} -export interface VideoOptions { - seek?: number; - highWaterMark?: number; - fps?: number; - hwAccel?: boolean; - presetH26x?: - | 'ultrafast' - | 'superfast' - | 'veryfast' - | 'faster' - | 'fast' - | 'medium' - | 'slow' - | 'slower' - | 'veryslow'; - inputFFmpegArgs?: string[]; - outputFFmpegArgs?: string[]; - bitrate?: number | 'auto'; -} - -export class BaseDispatcher extends Writable { - constructor( - player: object, - highWaterMark?: number, - payloadType?: number, - extensionEnabled?: boolean, - streams?: object, - ); - public readonly paused: boolean; - public pausedSince: number | null; - public readonly pausedTime: number; - public player: object; - public readonly streamTime: number; - public readonly totalStreamTime: number; - public count: number; - public sequence: number; - public timestamp: number; - public payloadType: number; - public extensionEnabled: boolean; - - public pause(silence?: boolean): void; - public resume(): void; - - public on( - event: 'close' | 'drain' | 'finish' | 'start', - listener: () => void, - ): this; - public on(event: 'debug', listener: (info: string) => void): this; - public on(event: 'error', listener: (err: Error) => void): this; - public on(event: 'pipe' | 'unpipe', listener: (src: Readable) => void): this; - public on(event: 'speaking', listener: (speaking: boolean) => void): this; - public on(event: string, listener: (...args: any[]) => void): this; - - public once( - event: 'close' | 'drain' | 'finish' | 'start', - listener: () => void, - ): this; - public once(event: 'debug', listener: (info: string) => void): this; - public once(event: 'error', listener: (err: Error) => void): this; - public once( - event: 'pipe' | 'unpipe', - listener: (src: Readable) => void, - ): this; - public once(event: 'speaking', listener: (speaking: boolean) => void): this; - public once(event: string, listener: (...args: any[]) => void): this; -} - -export class AudioDispatcher extends VolumeMixin(BaseDispatcher) { - constructor(player: object, options?: StreamOptions, streams?: object); - public readonly bitrateEditable: boolean; - - public getTypeDispatcher(): 'audio'; - - public setBitrate(value: number | 'auto'): boolean; - public setFEC(enabled: boolean): boolean; - public setPLP(value: number): boolean; - - public setSyncVideoDispatcher(otherDispatcher: VideoDispatcher): void; - - public on( - event: 'volumeChange', - listener: (oldVolume: number, newVolume: number) => void, - ): this; - public on(event: string, listener: (...args: any[]) => void): this; - - public once( - event: 'volumeChange', - listener: (oldVolume: number, newVolume: number) => void, - ): this; - public once(event: string, listener: (...args: any[]) => void): this; -} - -export class VideoDispatcher extends BaseDispatcher { - constructor( - player: object, - options?: StreamOptions, - streams?: object, - fps?: number, - ); - - public mtu: number; - public fps: number; - - public getTypeDispatcher(): 'video'; - - public setFPSSource(value: number): void; -} - -export class VoiceConnection extends EventEmitter { - constructor(voiceManager: ClientVoiceManager, channel: VoiceChannel); - private authentication: object; - private sockets: object; - private ssrcMap: Map; - private _speaking: Map>; - private _disconnect(): void; - private authenticate(): void; - private authenticateFailed(reason: string): void; - private checkAuthenticated(): void; - private cleanup(): void; - private connect(): void; - private onReady(data: object): void; - private onSessionDescription(mode: string, secret: string): void; - private onSpeaking(data: object): void; - private reconnect(token: string, endpoint: string): void; - public sendVoiceStateUpdate(options: { - self_video?: boolean; - self_deaf?: boolean; - self_mute?: boolean; - guild_id?: Snowflake | null; - channel_id?: Snowflake | null; - }): Promise; - private setSessionId(sessionId: string): void; - private setTokenAndEndpoint(token: string, endpoint: string): void; - private updateChannel(channel: VoiceChannel): void; - - public channel: VoiceChannel; - public readonly client: Client; - public readonly dispatcher: AudioDispatcher; - public readonly videoDispatcher?: VideoDispatcher; - public player: object; - public receiver: VoiceReceiver; - public speaking: Readonly; - public videoStatus: boolean; - public status: VoiceStatus; - public readonly voice: VoiceState | null; - public voiceManager: ClientVoiceManager; - public videoCodec: VideoCodec; - public streamConnection: StreamConnection | null; - public streamWatchConnection: Collection; - public disconnect(): void; - public playAudio( - input: Readable | string, - options?: StreamOptions, - ): AudioDispatcher; - public playVideo( - input: Readable | string, - options?: VideoOptions, - ): VideoDispatcher; - public setSpeaking(value: BitFieldResolvable): void; - public setVideoStatus(value: boolean): void; - public setVideoCodec(value: VideoCodec): this; - - public on( - event: - | 'authenticated' - | 'closing' - | 'newSession' - | 'ready' - | 'reconnecting', - listener: () => void, - ): this; - public on(event: 'debug', listener: (message: string) => void): this; - public on( - event: 'error' | 'failed' | 'disconnect', - listener: (error: Error) => void, - ): this; - public on( - event: 'speaking', - listener: (user: User, speaking: Readonly) => void, - ): this; - public on(event: 'warn', listener: (warning: string | Error) => void): this; - public on( - event: 'streamUpdate', - listener: (oldState: StreamState, newState: StreamState) => void, - ): this; - public on(event: string, listener: (...args: any[]) => void): this; - - public once( - event: - | 'authenticated' - | 'closing' - | 'newSession' - | 'ready' - | 'reconnecting', - listener: () => void, - ): this; - public once(event: 'debug', listener: (message: string) => void): this; - public once( - event: 'error' | 'failed' | 'disconnect', - listener: (error: Error) => void, - ): this; - public once( - event: 'speaking', - listener: (user: User, speaking: Readonly) => void, - ): this; - public once(event: 'warn', listener: (warning: string | Error) => void): this; - public once( - event: 'streamUpdate', - listener: (oldState: StreamState, newState: StreamState) => void, - ): this; - public once(event: string, listener: (...args: any[]) => void): this; - - public createStreamConnection(): Promise; - public joinStreamConnection( - user: UserResolvable, - ): Promise; -} - -export interface StreamState { - isPaused: boolean; - region: string | null; - viewerIds: Snowflake[]; -} - -export class StreamConnection extends VoiceConnection { - public createStreamConnection(): Promise; - public readonly voiceConnection: VoiceConnection; - public serverId: Snowflake; - public isPaused: boolean; - public region: string | null; - public streamConnection: this; - public viewerIds: Snowflake[]; - public sendSignalScreenshare(): void; - public sendScreenshareState(isPause: boolean): void; - private sendStopScreenshare(): void; - public readonly streamKey: string; -} - -export class StreamConnectionReadonly extends VoiceConnection { - public joinStreamConnection(): Promise; - public readonly voiceConnection: VoiceConnection; - public serverId: Snowflake; - public isPaused: boolean; - public region: string | null; - public userId: Snowflake; - public streamConnection: null; - public viewerIds: Snowflake[]; - public sendSignalScreenshare(): void; - private sendStopScreenshare(): void; - public readonly streamKey: string; - /** @deprecated removed */ - public override playAudio(): AudioDispatcher; - /** @deprecated removed */ - public override playVideo(): VideoDispatcher; -} - -export class Recorder< - Ready extends boolean = boolean, - T = any, -> extends EventEmitter { - constructor( - receiver: T, - options: { ffmpegArgs: string[]; channels: number; frameDuration: number }, - ); - private promise: Promise; - public readonly receiver: T; - public portUdpH264: number; - public portUdpOpus: number; - public ready: Ready; - public stream: If; - public socket: Socket; - public output: Writable | string; - public userId: Snowflake; - public feed(payload: RtpPacket | BufferResolvable): void; - public on( - event: 'ready' | 'closed', - listener: (recorder: Recorder) => void, - ): this; - public once( - event: 'ready' | 'closed', - listener: (recorder: Recorder) => void, - ): this; - public destroy(): void; -} - -export class VoiceReceiver extends EventEmitter { - constructor(connection: VoiceConnection); - public createStream( - user: UserResolvable, - options?: { - mode?: 'opus' | 'pcm'; - end?: 'silence' | 'manual'; - paddingSilence?: boolean; - }, - ): Readable; - public createVideoStream( - user: UserResolvable, - output: Writable | string, - ): Recorder; - - public on(event: 'debug', listener: (error: Error | string) => void): this; - public on( - event: 'receiverData', - listener: ( - ssrcData: { - userId: Snowflake; - hasVideo: boolean; - }, - packet: RtpPacket, - ) => void, - ): this; - public on(event: string, listener: (...args: any[]) => void): this; - - public once(event: 'debug', listener: (error: Error | string) => void): this; - public once( - event: 'receiverData', - listener: ( - ssrcData: { - userId: Snowflake; - hasVideo: boolean; - }, - packet: RtpPacket, - ) => void, - ): this; - public once(event: string, listener: (...args: any[]) => void): this; -} - -export { Collection } from '@discordjs/collection'; - -export interface CollectorEventTypes { - collect: [V, ...F]; - dispose: [V, ...F]; - end: [collected: Collection, reason: string]; -} - -export type ChannelFlagsString = 'PINNED' | 'REQUIRE_TAG'; -export class ChannelFlags extends BitField { - public static FLAGS: Record; - public static resolve( - bit?: BitFieldResolvable, - ): number; -} - -export abstract class Collector< - K, - V, - F extends unknown[] = [], -> extends EventEmitter { - protected constructor(client: Client, options?: CollectorOptions<[V, ...F]>); - private _timeout: NodeJS.Timeout | null; - private _idletimeout: NodeJS.Timeout | null; - - public readonly client: Client; - public collected: Collection; - public ended: boolean; - public abstract readonly endReason: string | null; - public filter: CollectorFilter<[V, ...F]>; - public readonly next: Promise; - public options: CollectorOptions<[V, ...F]>; - public checkEnd(): boolean; - public handleCollect(...args: unknown[]): Promise; - public handleDispose(...args: unknown[]): Promise; - public stop(reason?: string): void; - public resetTimer(options?: CollectorResetTimerOptions): void; - public [Symbol.asyncIterator](): AsyncIterableIterator; - public toJSON(): unknown; - - protected listener: (...args: any[]) => void; - public abstract collect(...args: unknown[]): K | null | Promise; - public abstract dispose(...args: unknown[]): K | null; - - public on>( - event: EventKey, - listener: ( - ...args: CollectorEventTypes[EventKey] - ) => Awaitable, - ): this; - - public once>( - event: EventKey, - listener: ( - ...args: CollectorEventTypes[EventKey] - ) => Awaitable, - ): this; -} - -export interface ApplicationCommandInteractionOptionResolver< - Cached extends CacheType = CacheType, -> extends CommandInteractionOptionResolver { - getSubcommand(required?: true): string; - getSubcommand(required: boolean): string | null; - getSubcommandGroup(required?: true): string; - getSubcommandGroup(required: boolean): string | null; - getBoolean(name: string, required: true): boolean; - getBoolean(name: string, required?: boolean): boolean | null; - getChannel( - name: string, - required: true, - ): NonNullable['channel']>; - getChannel( - name: string, - required?: boolean, - ): NonNullable['channel']> | null; - getString(name: string, required: true): string; - getString(name: string, required?: boolean): string | null; - getInteger(name: string, required: true): number; - getInteger(name: string, required?: boolean): number | null; - getNumber(name: string, required: true): number; - getNumber(name: string, required?: boolean): number | null; - getUser( - name: string, - required: true, - ): NonNullable['user']>; - getUser( - name: string, - required?: boolean, - ): NonNullable['user']> | null; - getMember( - name: string, - required: true, - ): NonNullable['member']>; - getMember( - name: string, - required?: boolean, - ): NonNullable['member']> | null; - getRole( - name: string, - required: true, - ): NonNullable['role']>; - getRole( - name: string, - required?: boolean, - ): NonNullable['role']> | null; - getMentionable( - name: string, - required: true, - ): NonNullable['member' | 'role' | 'user']>; - getMentionable( - name: string, - required?: boolean, - ): NonNullable< - CommandInteractionOption['member' | 'role' | 'user'] - > | null; -} - -export class CommandInteraction< - Cached extends CacheType = CacheType, -> extends BaseCommandInteraction { - public options: Omit< - CommandInteractionOptionResolver, - 'getMessage' | 'getFocused' - >; - public inGuild(): this is CommandInteraction<'raw' | 'cached'>; - public inCachedGuild(): this is CommandInteraction<'cached'>; - public inRawGuild(): this is CommandInteraction<'raw'>; - public toString(): string; -} - -export class AutocompleteInteraction< - Cached extends CacheType = CacheType, -> extends Interaction { - public readonly command: - | ApplicationCommand - | ApplicationCommand<{ guild: GuildResolvable }> - | null; - public channelId: Snowflake; - public commandId: Snowflake; - public commandName: string; - public responded: boolean; - public options: Omit, 'getMessage'>; - public inGuild(): this is AutocompleteInteraction<'raw' | 'cached'>; - public inCachedGuild(): this is AutocompleteInteraction<'cached'>; - public inRawGuild(): this is AutocompleteInteraction<'raw'>; - private transformOption( - option: APIApplicationCommandOption, - ): CommandInteractionOption; - public respond(options: ApplicationCommandOptionChoiceData[]): Promise; -} - -export class CommandInteractionOptionResolver< - Cached extends CacheType = CacheType, -> { - private constructor( - client: Client, - options: CommandInteractionOption[], - resolved: CommandInteractionResolvedData, - ); - public readonly client: Client; - public readonly data: readonly CommandInteractionOption[]; - public readonly resolved: Readonly>; - private _group: string | null; - private _hoistedOptions: CommandInteractionOption[]; - private _subcommand: string | null; - private _getTypedOption( - name: string, - type: ApplicationCommandOptionType, - properties: (keyof ApplicationCommandOption)[], - required: true, - ): CommandInteractionOption; - private _getTypedOption( - name: string, - type: ApplicationCommandOptionType, - properties: (keyof ApplicationCommandOption)[], - required: boolean, - ): CommandInteractionOption | null; - - public get(name: string, required: true): CommandInteractionOption; - public get( - name: string, - required?: boolean, - ): CommandInteractionOption | null; - - public getSubcommand(required?: true): string; - public getSubcommand(required: boolean): string | null; - public getSubcommandGroup(required?: true): string; - public getSubcommandGroup(required: boolean): string | null; - public getBoolean(name: string, required: true): boolean; - public getBoolean(name: string, required?: boolean): boolean | null; - public getChannel( - name: string, - required: true, - ): NonNullable['channel']>; - public getChannel( - name: string, - required?: boolean, - ): NonNullable['channel']> | null; - public getString(name: string, required: true): string; - public getString(name: string, required?: boolean): string | null; - public getInteger(name: string, required: true): number; - public getInteger(name: string, required?: boolean): number | null; - public getNumber(name: string, required: true): number; - public getNumber(name: string, required?: boolean): number | null; - public getUser( - name: string, - required: true, - ): NonNullable['user']>; - public getUser( - name: string, - required?: boolean, - ): NonNullable['user']> | null; - public getMember( - name: string, - required: true, - ): NonNullable['member']>; - public getMember( - name: string, - required?: boolean, - ): NonNullable['member']> | null; - public getRole( - name: string, - required: true, - ): NonNullable['role']>; - public getRole( - name: string, - required?: boolean, - ): NonNullable['role']> | null; - public getMentionable( - name: string, - required: true, - ): NonNullable['member' | 'role' | 'user']>; - public getMentionable( - name: string, - required?: boolean, - ): NonNullable< - CommandInteractionOption['member' | 'role' | 'user'] - > | null; - public getMessage( - name: string, - required: true, - ): NonNullable['message']>; - public getMessage( - name: string, - required?: boolean, - ): NonNullable['message']> | null; - public getFocused(getFull: true): AutocompleteFocusedOption; - public getFocused(getFull?: boolean): string; - public getAttachment( - name: string, - required: true, - ): NonNullable['attachment']>; - public getAttachment( - name: string, - required?: boolean, - ): NonNullable['attachment']> | null; -} - -export class ContextMenuInteraction< - Cached extends CacheType = CacheType, -> extends BaseCommandInteraction { - public options: Omit< - CommandInteractionOptionResolver, - | 'getFocused' - | 'getMentionable' - | 'getRole' - | 'getNumber' - | 'getInteger' - | 'getString' - | 'getChannel' - | 'getBoolean' - | 'getSubcommandGroup' - | 'getSubcommand' - >; - public targetId: Snowflake; - public targetType: Exclude; - public inGuild(): this is ContextMenuInteraction<'raw' | 'cached'>; - public inCachedGuild(): this is ContextMenuInteraction<'cached'>; - public inRawGuild(): this is ContextMenuInteraction<'raw'>; - private resolveContextMenuOptions( - data: APIApplicationCommandInteractionData, - ): CommandInteractionOption[]; -} - -export class DataResolver extends null { - private constructor(); - public static resolveBase64(data: Base64Resolvable): string; - public static resolveCode(data: string, regx: RegExp): string; - public static resolveFile( - resource: BufferResolvable | Stream, - ): Promise; - public static resolveFileAsBuffer( - resource: BufferResolvable | Stream, - ): Promise; - public static resolveImage( - resource: BufferResolvable | Base64Resolvable, - ): Promise; - public static resolveInviteCode(data: InviteResolvable): string; - public static resolveGuildTemplateCode(data: GuildTemplateResolvable): string; -} - -export class DiscordAPIError extends Error { - private constructor(error: unknown, status: number, request: unknown); - private static flattenErrors(obj: unknown, key: string): string[]; - - public code: number; - public method: string; - public path: string; - public httpStatus: number; - public requestData: HTTPErrorData; - public retries: number; - public captcha: Captcha | null; - public readonly isBlockedByCloudflare: boolean; -} - -export interface Captcha { - captcha_key: string[]; - captcha_sitekey: string; - captcha_service: 'hcaptcha'; - captcha_rqdata?: string; - captcha_rqtoken?: string; -} - -export class DMChannel extends TextBasedChannelMixin(Channel, [ - 'fetchWebhooks', - 'createWebhook', - 'setRateLimitPerUser', - 'setNSFW', -]) { - private constructor(client: Client, data?: RawDMChannelData); - public recipient: User; - public type: 'DM'; - public flags: Readonly; - public messageRequest?: boolean; - public messageRequestTimestamp?: number; - public fetch(force?: boolean): Promise; - public acceptMessageRequest(): Promise; - public cancelMessageRequest(): Promise; - public sync(): void; - public ring(): Promise; - public readonly voiceAdapterCreator: InternalDiscordGatewayAdapterCreator; - public readonly shard: WebSocketShard; - public readonly voiceUsers: Collection; -} - -export class Emoji extends Base { - protected constructor(client: Client, emoji: RawEmojiData); - public animated: boolean | null; - public readonly createdAt: Date | null; - public readonly createdTimestamp: number | null; - /** @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 */ - public deleted: boolean; - public id: Snowflake | null; - public name: string | null; - public readonly identifier: string; - public readonly url: string | null; - public toJSON(): unknown; - public toString(): string; -} - -export class Guild extends AnonymousGuild { - private constructor(client: Client, data: RawGuildData); - private _sortedRoles(): Collection; - private _sortedChannels( - channel: NonThreadGuildBasedChannel, - ): Collection; - - public readonly afkChannel: VoiceChannel | null; - public afkChannelId: Snowflake | null; - public afkTimeout: number; - public applicationId: Snowflake | null; - public maxVideoChannelUsers: number | null; - public maxStageVideoChannelUsers: number | null; - public approximateMemberCount: number | null; - public approximatePresenceCount: number | null; - public autoModerationRules: AutoModerationRuleManager; - public available: boolean; - public bans: GuildBanManager; - public channels: GuildChannelManager; - public defaultMessageNotifications: DefaultMessageNotificationLevel | number; - /** @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 */ - public deleted: boolean; - public discoverySplash: string | null; - public emojis: GuildEmojiManager; - public explicitContentFilter: ExplicitContentFilterLevel; - public invites: GuildInviteManager; - public readonly joinedAt: Date; - public joinedTimestamp: number; - public large: boolean; - public maximumMembers: number | null; - public maximumPresences: number | null; - /** @deprecated Use {@link GuildMemberManager.me} instead. */ - public readonly me: GuildMember | null; - public memberCount: number; - public members: GuildMemberManager; - public mfaLevel: MFALevel; - public ownerId: Snowflake; - public preferredLocale: string; - public premiumProgressBarEnabled: boolean; - public premiumTier: PremiumTier; - public presences: PresenceManager; - public readonly publicUpdatesChannel: TextChannel | null; - public publicUpdatesChannelId: Snowflake | null; - public roles: RoleManager; - public readonly rulesChannel: TextChannel | null; - public rulesChannelId: Snowflake | null; - public readonly safetyAlertsChannel: TextChannel | null; - public safetyAlertsChannelId: Snowflake | null; - public scheduledEvents: GuildScheduledEventManager; - public settings: GuildSettingManager; - public readonly shard: WebSocketShard; - public shardId: number; - public stageInstances: StageInstanceManager; - public stickers: GuildStickerManager; - public incidentsData: IncidentActions | null; - public readonly systemChannel: TextChannel | null; - public systemChannelFlags: Readonly; - public systemChannelId: Snowflake | null; - public vanityURLUses: number | null; - public readonly voiceAdapterCreator: InternalDiscordGatewayAdapterCreator; - public readonly voiceStates: VoiceStateManager; - public readonly widgetChannel: - | TextChannel - | NewsChannel - | VoiceBasedChannel - | ForumChannel - | MediaChannel - | null; - public widgetChannelId: Snowflake | null; - public widgetEnabled: boolean | null; - public readonly maximumBitrate: number; - public createTemplate( - name: string, - description?: string, - ): Promise; - public delete(): Promise; - public discoverySplashURL(options?: StaticImageURLOptions): string | null; - public edit(data: GuildEditData, reason?: string): Promise; - public editWelcomeScreen(data: WelcomeScreenEditData): Promise; - public equals(guild: Guild): boolean; - public fetchAuditLogs( - options?: GuildAuditLogsFetchOptions, - ): Promise>; - public fetchIntegrations(): Promise< - Collection - >; - public fetchOwner(options?: BaseFetchOptions): Promise; - public fetchPreview(): Promise; - public fetchTemplates(): Promise< - Collection - >; - public fetchVanityData(): Promise; - public fetchWebhooks(): Promise>; - public fetchWelcomeScreen(): Promise; - public fetchWidget(): Promise; - public fetchWidgetSettings(): Promise; - public leave(): Promise; - public disableInvites(disabled?: boolean): Promise; - public setIncidentActions( - incidentActions: IncidentActionsEditOptions, - ): Promise; - public setAFKChannel( - afkChannel: VoiceChannelResolvable | null, - reason?: string, - ): Promise; - public setAFKTimeout(afkTimeout: number, reason?: string): Promise; - public setBanner( - banner: BufferResolvable | Base64Resolvable | null, - reason?: string, - ): Promise; - /** @deprecated Use {@link GuildChannelManager.setPositions} instead */ - public setChannelPositions( - channelPositions: readonly ChannelPosition[], - ): Promise; - public setDefaultMessageNotifications( - defaultMessageNotifications: - | DefaultMessageNotificationLevel - | number - | null, - reason?: string, - ): Promise; - public setDiscoverySplash( - discoverySplash: BufferResolvable | Base64Resolvable | null, - reason?: string, - ): Promise; - public setExplicitContentFilter( - explicitContentFilter: ExplicitContentFilterLevel | number | null, - reason?: string, - ): Promise; - public setIcon( - icon: BufferResolvable | Base64Resolvable | null, - reason?: string, - ): Promise; - public setName(name: string, reason?: string): Promise; - public setOwner( - owner: GuildMemberResolvable, - reason?: string, - ): Promise; - public setPreferredLocale( - preferredLocale: string | null, - reason?: string, - ): Promise; - public setPublicUpdatesChannel( - publicUpdatesChannel: TextChannelResolvable | null, - reason?: string, - ): Promise; - /** @deprecated Use {@link RoleManager.setPositions} instead */ - public setRolePositions( - rolePositions: readonly RolePosition[], - ): Promise; - public setRulesChannel( - rulesChannel: TextChannelResolvable | null, - reason?: string, - ): Promise; - public setSafetyAlertsChannel( - safetyAlertsChannel: TextChannelResolvable | null, - reason?: string, - ): Promise; - public setSplash( - splash: BufferResolvable | Base64Resolvable | null, - reason?: string, - ): Promise; - public setSystemChannel( - systemChannel: TextChannelResolvable | null, - reason?: string, - ): Promise; - public setSystemChannelFlags( - systemChannelFlags: SystemChannelFlagsResolvable, - reason?: string, - ): Promise; - public setVerificationLevel( - verificationLevel: VerificationLevel | number | null, - reason?: string, - ): Promise; - public setPremiumProgressBarEnabled( - enabled?: boolean, - reason?: string, - ): Promise; - public setWidgetSettings( - settings: GuildWidgetSettingsData, - reason?: string, - ): Promise; - public toJSON(): unknown; - public markAsRead(): Promise; - public setCommunity( - stats: boolean, - publicUpdatesChannel?: GuildTextChannelResolvable, - rulesChannel?: GuildTextChannelResolvable, - reason?: string, - ): Promise; - public topEmojis(): Promise>; - public setVanityCode(code?: string): Promise; -} - -export class GuildAuditLogs { - private constructor(guild: Guild, data: RawGuildAuditLogData); - private webhooks: Collection; - private integrations: Collection; - private autoModerationRules: Collection; - - public entries: Collection>; - - public static Actions: GuildAuditLogsActions; - public static Targets: GuildAuditLogsTargets; - public static Entry: typeof GuildAuditLogsEntry; - public static actionType(action: number): GuildAuditLogsActionType; - public static build(...args: unknown[]): Promise; - public static targetType(target: number): GuildAuditLogsTarget; - public toJSON(): unknown; -} - -export class GuildAuditLogsEntry< - TActionRaw extends GuildAuditLogsResolvable = 'ALL', - TAction = TActionRaw extends keyof GuildAuditLogsIds - ? GuildAuditLogsIds[TActionRaw] - : TActionRaw extends null - ? 'ALL' - : TActionRaw, - TActionType extends - GuildAuditLogsActionType = TAction extends keyof GuildAuditLogsTypes - ? GuildAuditLogsTypes[TAction][1] - : 'ALL', - TTargetType extends - GuildAuditLogsTarget = TAction extends keyof GuildAuditLogsTypes - ? GuildAuditLogsTypes[TAction][0] - : 'UNKNOWN', -> { - private constructor( - guild: Guild, - data: RawGuildAuditLogEntryData, - logs?: GuildAuditLogs, - ); - public action: TAction; - public actionType: TActionType; - public changes: AuditLogChange[]; - public readonly createdAt: Date; - public readonly createdTimestamp: number; - public executorId: Snowflake | null; - public executor: User | null; - public extra: TAction extends keyof GuildAuditLogsEntryExtraField - ? GuildAuditLogsEntryExtraField[TAction] - : null; - public id: Snowflake; - public reason: string | null; - public targetId: Snowflake | null; - public target: TTargetType extends keyof GuildAuditLogsEntryTargetField - ? GuildAuditLogsEntryTargetField[TTargetType] - : Role | GuildEmoji | { id: Snowflake } | null; - public targetType: TTargetType; - public toJSON(): unknown; -} - -export class GuildBan extends Base { - private constructor(client: Client, data: RawGuildBanData, guild: Guild); - public guild: Guild; - public user: User; - public readonly partial: boolean; - public reason?: string | null; - public fetch(force?: boolean): Promise; -} - -export abstract class GuildChannel extends Channel { - public constructor( - guild: Guild, - data?: RawGuildChannelData, - client?: Client, - immediatePatch?: boolean, - ); - private memberPermissions( - member: GuildMember, - checkAdmin: boolean, - ): Readonly; - private rolePermissions( - role: Role, - checkAdmin: boolean, - ): Readonly; - public readonly createdAt: Date; - public readonly createdTimestamp: number; - public readonly calculatedPosition: number; - public readonly deletable: boolean; - public guild: Guild; - public guildId: Snowflake; - public readonly manageable: boolean; - public readonly members: Collection; - public name: string; - public readonly parent: CategoryChannel | null; - public parentId: Snowflake | null; - public permissionOverwrites: PermissionOverwriteManager; - public readonly permissionsLocked: boolean | null; - public readonly position: number; - public rawPosition: number; - public type: Exclude< - keyof typeof ChannelTypes, - 'DM' | 'GROUP_DM' | 'UNKNOWN' - >; - public flags: Readonly; - public readonly viewable: boolean; - public clone(options?: GuildChannelCloneOptions): Promise; - public delete(reason?: string): Promise; - public edit(data: ChannelData, reason?: string): Promise; - public equals(channel: GuildChannel): boolean; - public lockPermissions(): Promise; - public permissionsFor( - memberOrRole: GuildMember | Role, - checkAdmin?: boolean, - ): Readonly; - public permissionsFor( - memberOrRole: GuildMemberResolvable | RoleResolvable, - checkAdmin?: boolean, - ): Readonly | null; - public setName(name: string, reason?: string): Promise; - public setParent( - channel: CategoryChannelResolvable | null, - options?: SetParentOptions, - ): Promise; - public setPosition( - position: number, - options?: SetChannelPositionOptions, - ): Promise; - public isText(): this is GuildTextBasedChannel; -} - -export class GuildEmoji extends BaseGuildEmoji { - private constructor(client: Client, data: RawGuildEmojiData, guild: Guild); - private _roles: Snowflake[]; - - public readonly deletable: boolean; - public guild: Guild; - public author: User | null; - public readonly roles: GuildEmojiRoleManager; - public readonly url: string; - public delete(reason?: string): Promise; - public edit(data: GuildEmojiEditData, reason?: string): Promise; - public equals(other: GuildEmoji | unknown): boolean; - public fetchAuthor(): Promise; - public setName(name: string, reason?: string): Promise; -} - -export class GuildMember extends PartialTextBasedChannel(Base) { - private constructor(client: Client, data: RawGuildMemberData, guild: Guild); - private _roles: Snowflake[]; - public avatar: string | null; - public avatarDecorationData: AvatarDecorationData | null; - public banner: string | null; - public readonly bannable: boolean; - /** @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 */ - public deleted: boolean; - public readonly displayColor: number; - public readonly displayHexColor: HexColorString; - public readonly displayName: string; - public flags: Readonly; - public guild: Guild; - public readonly id: Snowflake; - public pending: boolean; - public readonly communicationDisabledUntil: Date | null; - public communicationDisabledUntilTimestamp: number | null; - public readonly joinedAt: Date | null; - public joinedTimestamp: number | null; - public readonly kickable: boolean; - public readonly manageable: boolean; - public readonly moderatable: boolean; - public nickname: string | null; - public readonly partial: false; - public readonly permissions: Readonly; - public readonly premiumSince: Date | null; - public premiumSinceTimestamp: number | null; - public readonly presence: Presence | null; - public readonly roles: GuildMemberRoleManager; - public user: User; - public readonly voice: VoiceState; - public avatarURL(options?: ImageURLOptions): string | null; - public avatarDecorationURL(): string | null; - public bannerURL(options?: ImageURLOptions): string | null; - public ban(options?: BanOptions): Promise; - public disableCommunicationUntil( - timeout: DateResolvable | null, - reason?: string, - ): Promise; - public timeout(timeout: number | null, reason?: string): Promise; - public fetch(force?: boolean): Promise; - public createDM(force?: boolean): Promise; - public deleteDM(): Promise; - public displayAvatarURL(options?: ImageURLOptions): string; - public displayBannerURL(options?: ImageURLOptions): string | null; - public displayAvatarDecorationURL(): string | null; - public edit(data: GuildMemberEditData, reason?: string): Promise; - public isCommunicationDisabled(): this is GuildMember & { - communicationDisabledUntilTimestamp: number; - readonly communicationDisabledUntil: Date; - }; - public kick(reason?: string): Promise; - public permissionsIn(channel: GuildChannelResolvable): Readonly; - public setNickname( - nickname: string | null, - reason?: string, - ): Promise; - public setFlags(flags: GuildMemberFlagsResolvable): Promise; - public toJSON(): unknown; - public toString(): MemberMention; - public valueOf(): string; - public setAvatar( - avatar: BufferResolvable | Base64Resolvable | null, - ): Promise; - public setBanner( - banner: BufferResolvable | Base64Resolvable | null, - ): Promise; - public setAboutMe(bio: string | null): Promise; -} - -export class GuildMemberFlags extends BitField { - public static FLAGS: Record; - public static resolve( - bit?: BitFieldResolvable, - ): number; -} - -export class GuildPreview extends Base { - private constructor(client: Client, data: RawGuildPreviewData); - public approximateMemberCount: number; - public approximatePresenceCount: number; - public readonly createdAt: Date; - public readonly createdTimestamp: number; - public description: string | null; - public discoverySplash: string | null; - public emojis: Collection; - public stickers: Collection; - public features: GuildFeatures[]; - public icon: string | null; - public id: Snowflake; - public name: string; - public splash: string | null; - public discoverySplashURL(options?: StaticImageURLOptions): string | null; - public iconURL(options?: ImageURLOptions): string | null; - public splashURL(options?: StaticImageURLOptions): string | null; - public fetch(): Promise; - public toJSON(): unknown; - public toString(): string; -} - -export class GuildScheduledEvent< - S extends GuildScheduledEventStatus = GuildScheduledEventStatus, -> extends Base { - private constructor(client: Client, data: RawGuildScheduledEventData); - public id: Snowflake; - public guildId: Snowflake; - public channelId: Snowflake | null; - public creatorId: Snowflake | null; - public name: string; - public description: string | null; - public scheduledStartTimestamp: number | null; - public scheduledEndTimestamp: number | null; - public privacyLevel: GuildScheduledEventPrivacyLevel; - public status: S; - public entityType: GuildScheduledEventEntityType; - public entityId: Snowflake | null; - public entityMetadata: GuildScheduledEventEntityMetadata; - public userCount: number | null; - public creator: User | null; - public recurrenceRule: GuildScheduledEventRecurrenceRule | null; - public readonly createdTimestamp: number; - public readonly createdAt: Date; - public readonly scheduledStartAt: Date; - public readonly scheduledEndAt: Date | null; - public readonly channel: VoiceChannel | StageChannel | null; - public readonly guild: Guild | null; - public readonly url: string; - public readonly image: string | null; - public readonly partial: false; - public coverImageURL(options?: StaticImageURLOptions): string | null; - public createInviteURL( - options?: CreateGuildScheduledEventInviteURLOptions, - ): Promise; - public edit>( - options: GuildScheduledEventEditOptions, - ): Promise>; - public fetch(force?: boolean): Promise>; - public delete(): Promise>; - public setName( - name: string, - reason?: string, - ): Promise>; - public setScheduledStartTime( - scheduledStartTime: DateResolvable, - reason?: string, - ): Promise>; - public setScheduledEndTime( - scheduledEndTime: DateResolvable, - reason?: string, - ): Promise>; - public setDescription( - description: string, - reason?: string, - ): Promise>; - public setStatus>( - status: T, - reason?: string, - ): Promise>; - public setLocation( - location: string, - reason?: string, - ): Promise>; - public fetchSubscribers( - options?: T, - ): Promise>; - public toString(): string; - public isActive(): this is GuildScheduledEvent<'ACTIVE'>; - public isCanceled(): this is GuildScheduledEvent<'CANCELED'>; - public isCompleted(): this is GuildScheduledEvent<'COMPLETED'>; - public isScheduled(): this is GuildScheduledEvent<'SCHEDULED'>; -} - -export interface GuildScheduledEventRecurrenceRule { - startTimestamp: number; - get startAt(): Date; - endTimestamp: number | null; - get endAt(): Date | null; - frequency: GuildScheduledEventRecurrenceRuleFrequency; - interval: number; - byWeekday: readonly GuildScheduledEventRecurrenceRuleWeekday[] | null; - byNWeekday: readonly GuildScheduledEventRecurrenceRuleNWeekday[] | null; - byMonth: readonly GuildScheduledEventRecurrenceRuleMonth[] | null; - byMonthDay: readonly number[] | null; - byYearDay: readonly number[] | null; - count: number | null; -} - -export interface GuildScheduledEventRecurrenceRuleNWeekday { - n: number; - day: GuildScheduledEventRecurrenceRuleWeekday; -} - -export class GuildTemplate extends Base { - private constructor(client: Client, data: RawGuildTemplateData); - public readonly createdTimestamp: number; - public readonly updatedTimestamp: number; - public readonly url: string; - public code: string; - public name: string; - public description: string | null; - public usageCount: number; - public creator: User; - public creatorId: Snowflake; - public createdAt: Date; - public updatedAt: Date; - public guild: Guild | null; - public guildId: Snowflake; - public serializedGuild: APITemplateSerializedSourceGuild; - public unSynced: boolean | null; - public createGuild( - name: string, - icon?: BufferResolvable | Base64Resolvable, - ): Promise; - public delete(): Promise; - public edit(options?: EditGuildTemplateOptions): Promise; - public sync(): Promise; - public static GUILD_TEMPLATES_PATTERN: RegExp; -} - -export class GuildPreviewEmoji extends BaseGuildEmoji { - private constructor( - client: Client, - data: RawGuildEmojiData, - guild: GuildPreview, - ); - public guild: GuildPreview; - public roles: Snowflake[]; -} - -export class HTTPError extends Error { - private constructor( - message: string, - name: string, - code: number, - request: unknown, - ); - public code: number; - public method: string; - public name: string; - public path: string; - public requestData: HTTPErrorData; -} - -// tslint:disable-next-line:no-empty-interface - Merge RateLimitData into RateLimitError to not have to type it again -export interface RateLimitError extends RateLimitData {} -export class RateLimitError extends Error { - private constructor(data: RateLimitData); - public name: 'RateLimitError'; -} - -export class Integration extends Base { - private constructor(client: Client, data: RawIntegrationData, guild: Guild); - public account: IntegrationAccount; - public application: IntegrationApplication | null; - public enabled: boolean; - public expireBehavior: number | undefined; - public expireGracePeriod: number | undefined; - public guild: Guild; - public id: Snowflake | string; - public name: string; - public role: Role | undefined; - public enableEmoticons: boolean | null; - public readonly roles: Collection; - public syncedAt: number | undefined; - public syncing: boolean | undefined; - public type: IntegrationType; - public user: User | null; - public subscriberCount: number | null; - public revoked: boolean | null; - public delete(reason?: string): Promise; -} - -export class IntegrationApplication extends Application { - private constructor(client: Client, data: RawIntegrationApplicationData); - public bot: User | null; - public termsOfServiceURL: string | null; - public privacyPolicyURL: string | null; - public rpcOrigins: string[]; - /** @deprecated This property is no longer being sent by the API. */ - public summary: string | null; - public hook: boolean | null; - public cover: string | null; - public verifyKey: string | null; -} - -export class Intents extends BitField { - public static FLAGS: Record; - public static resolve( - bit?: BitFieldResolvable, - ): number; - public static ALL: number; -} - -export type CacheType = 'cached' | 'raw' | undefined; - -export type CacheTypeReducer< - State extends CacheType, - CachedType, - RawType = CachedType, - PresentType = CachedType | RawType, - Fallback = PresentType | null, -> = [State] extends ['cached'] - ? CachedType - : [State] extends ['raw'] - ? RawType - : [State] extends ['raw' | 'cached'] - ? PresentType - : Fallback; - -export class Interaction extends Base { - // This a technique used to brand different cached types. Or else we'll get `never` errors on typeguard checks. - private readonly _cacheType: Cached; - protected constructor(client: Client, data: RawInteractionData); - public applicationId: Snowflake; - public readonly channel: CacheTypeReducer< - Cached, - GuildTextBasedChannel | null, - GuildTextBasedChannel | null, - GuildTextBasedChannel | null, - TextBasedChannel | null - >; - public channelId: Snowflake | null; - public readonly createdAt: Date; - public readonly createdTimestamp: number; - public readonly guild: CacheTypeReducer; - public guildId: CacheTypeReducer; - public id: Snowflake; - public member: CacheTypeReducer< - Cached, - GuildMember, - APIInteractionGuildMember - >; - public readonly token: string; - public type: InteractionType; - public user: User; - public version: number; - public appPermissions: Readonly | null; - public memberPermissions: CacheTypeReducer>; - public locale: string; - public guildLocale: CacheTypeReducer; - public inGuild(): this is Interaction<'raw' | 'cached'>; - public inCachedGuild(): this is Interaction<'cached'>; - public inRawGuild(): this is Interaction<'raw'>; - public isApplicationCommand(): this is BaseCommandInteraction; - public isButton(): this is ButtonInteraction; - public isCommand(): this is CommandInteraction; - public isAutocomplete(): this is AutocompleteInteraction; - public isContextMenu(): this is ContextMenuInteraction; - public isUserContextMenu(): this is UserContextMenuInteraction; - public isMessageContextMenu(): this is MessageContextMenuInteraction; - public isMessageComponent(): this is MessageComponentInteraction; - public isModalSubmit(): this is ModalSubmitInteraction; - public isSelectMenu(): this is SelectMenuInteraction; - public isRepliable(): this is this & InteractionResponseFields; -} - -export class InteractionCollector extends Collector< - Snowflake, - T -> { - public constructor(client: Client, options?: InteractionCollectorOptions); - private _handleMessageDeletion(message: Message): void; - private _handleChannelDeletion(channel: NonThreadGuildBasedChannel): void; - private _handleGuildDeletion(guild: Guild): void; - - public channelId: Snowflake | null; - public componentType: MessageComponentType | null; - public readonly endReason: string | null; - public guildId: Snowflake | null; - public interactionType: InteractionType | null; - public messageId: Snowflake | null; - public options: InteractionCollectorOptions; - public total: number; - public users: Collection; - - public collect(interaction: Interaction): Snowflake; - public empty(): void; - public dispose(interaction: Interaction): Snowflake; - public on( - event: 'collect' | 'dispose', - listener: (interaction: T) => Awaitable, - ): this; - public on( - event: 'end', - listener: ( - collected: Collection, - reason: string, - ) => Awaitable, - ): this; - public on(event: string, listener: (...args: any[]) => Awaitable): this; - - public once( - event: 'collect' | 'dispose', - listener: (interaction: T) => Awaitable, - ): this; - public once( - event: 'end', - listener: ( - collected: Collection, - reason: string, - ) => Awaitable, - ): this; - public once( - event: string, - listener: (...args: any[]) => Awaitable, - ): this; -} - -export class InteractionWebhook extends PartialWebhookMixin() { - public constructor(client: Client, id: Snowflake, token: string); - public token: string; - public send( - options: string | MessagePayload | InteractionReplyOptions, - ): Promise; -} - -export class Invite extends Base { - private constructor(client: Client, data: RawInviteData); - public channel?: NonThreadGuildBasedChannel | GroupDMChannel; - public channelId?: Snowflake; - public code: string; - public readonly deletable: boolean; - public readonly createdAt: Date | null; - public createdTimestamp: number | null; - public readonly expiresAt: Date | null; - public readonly expiresTimestamp: number | null; - public guild: InviteGuild | Guild | null; - public inviter: User | null; - public inviterId: Snowflake | null; - public maxAge: number | null; - public maxUses: number | null; - public memberCount: number | null; - public presenceCount: number | null; - public type: InviteTypes | null; - public targetApplication: IntegrationApplication | null; - public targetUser: User | null; - public targetType: InviteTargetTypes | null; - public temporary: boolean | null; - public readonly url: string; - public uses: number | null; - public delete(reason?: string): Promise; - public toJSON(): unknown; - public toString(): string; - public static INVITES_PATTERN: RegExp; - public stageInstance: InviteStageInstance | null; - public guildScheduledEvent: GuildScheduledEvent | null; - public flags: Readonly; -} - -export class InviteStageInstance extends Base { - private constructor( - client: Client, - data: RawInviteStageInstance, - channelId: Snowflake, - guildId: Snowflake, - ); - public channelId: Snowflake; - public guildId: Snowflake; - public members: Collection; - public topic: string; - public participantCount: number; - public speakerCount: number; - public readonly channel: StageChannel | null; - public readonly guild: Guild | null; -} - -export class InviteGuild extends AnonymousGuild { - private constructor(client: Client, data: RawInviteGuildData); - public welcomeScreen: WelcomeScreen | null; -} - -export class LimitedCollection extends Collection { - public constructor( - options?: LimitedCollectionOptions, - iterable?: Iterable, - ); - public maxSize: number; - public keepOverLimit: - | ((value: V, key: K, collection: this) => boolean) - | null; - /** @deprecated Use Global Sweepers instead */ - public interval: NodeJS.Timeout | null; - /** @deprecated Use Global Sweepers instead */ - public sweepFilter: SweepFilter | null; - - /** @deprecated Use `Sweepers.filterByLifetime` instead */ - public static filterByLifetime( - options?: LifetimeFilterOptions, - ): SweepFilter; -} - -export type MessageCollectorOptionsParams< - T extends MessageComponentInteractableResolvable, - Cached extends boolean = boolean, -> = { - componentType?: T; -} & MessageComponentCollectorOptions[T]>; - -export type MessageChannelCollectorOptionsParams< - T extends MessageComponentInteractableResolvable, - Cached extends boolean = boolean, -> = { - componentType?: T; -} & MessageChannelComponentCollectorOptions[T]>; - -export type AwaitMessageCollectorOptionsParams< - T extends MessageComponentInteractableResolvable, - Cached extends boolean = boolean, -> = { componentType?: T } & Pick< - InteractionCollectorOptions[T]>, - keyof AwaitMessageComponentOptions ->; - -export interface StringMappedInteractionTypes< - Cached extends CacheType = CacheType, -> { - BUTTON: ButtonInteraction; - STRING_SELECT: SelectMenuInteraction; - USER_SELECT: SelectMenuInteraction; - ROLE_SELECT: SelectMenuInteraction; - MENTIONABLE_SELECT: SelectMenuInteraction; - CHANNEL_SELECT: SelectMenuInteraction; - ACTION_ROW: MessageComponentInteraction; -} - -export type WrapBooleanCache = If; - -export type MappedInteractionTypes = - EnumValueMapped< - typeof MessageComponentInteractables, - { - BUTTON: ButtonInteraction>; - STRING_SELECT: StringSelectInteraction>; - USER_SELECT: UserSelectInteraction>; - ROLE_SELECT: RoleSelectInteraction>; - MENTIONABLE_SELECT: MentionableSelectInteraction< - WrapBooleanCache - >; - CHANNEL_SELECT: ChannelSelectInteraction>; - ACTION_ROW: MessageComponentInteraction>; - TEXT_INPUT: ModalSubmitInteraction>; - } - >; - -export class Message extends Base { - private readonly _cacheType: Cached; - private constructor(client: Client, data: RawMessageData); - private _patch(data: RawPartialMessageData | RawMessageData): void; - - public activity: MessageActivity | null; - public applicationId: Snowflake | null; - public attachments: Collection; - public author: User; - public get bulkDeletable(): boolean; - public readonly channel: If; - public channelId: Snowflake; - public readonly cleanContent: string; - public components: TopLevelComponent[]; - public content: string; - public readonly createdAt: Date; - public createdTimestamp: number; - public readonly crosspostable: boolean; - public readonly deletable: boolean; - /** @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 */ - public deleted: boolean; - public readonly editable: boolean; - public readonly editedAt: Date | null; - public editedTimestamp: number | null; - public embeds: MessageEmbed[]; - public groupActivityApplication: Application | null; - public guildId: If; - public readonly guild: If; - public readonly hasThread: boolean; - public id: Snowflake; - public interaction: MessageInteraction | null; - public readonly member: GuildMember | null; - public mentions: MessageMentions; - public nonce: string | number | null; - public readonly partial: false; - public readonly pinnable: boolean; - public pinned: boolean; - public reactions: ReactionManager; - public stickers: Collection; - public system: boolean; - public readonly thread: ThreadChannel | null; - public tts: boolean; - public type: MessageType; - public readonly url: string; - public webhookId: Snowflake | null; - public poll: Poll | null; - public call: MessageCall | null; - public flags: Readonly; - public reference: MessageReference | null; - public messageSnapshots: Collection; - public position: number | null; - public awaitReactions( - options?: AwaitReactionsOptions, - ): Promise>; - public createReactionCollector( - options?: ReactionCollectorOptions, - ): ReactionCollector; - public delete(): Promise; - public edit( - content: string | MessageEditOptions | MessagePayload, - ): Promise; - public equals(message: Message, rawData: unknown): boolean; - public fetchReference(): Promise; - public fetchWebhook(): Promise; - public crosspost(): Promise; - public fetch(force?: boolean): Promise; - public pin(reason?: string): Promise; - public react( - emoji: EmojiIdentifierResolvable, - burst?: boolean, - ): Promise; - public removeAttachments(): Promise; - public reply( - options: string | MessagePayload | ReplyMessageOptions, - ): Promise; - public forward(channel: TextBasedChannelResolvable): Promise; - public resolveComponent(customId: string): MessageActionRowComponent | null; - public startThread(options: StartThreadOptions): Promise; - public suppressEmbeds(suppress?: boolean): Promise; - public toJSON(): unknown; - public toString(): string; - public unpin(reason?: string): Promise; - public inGuild(): this is Message & this; - - public readonly isMessage: true; - public clickButton(button: string): Promise; - public selectMenu( - menu: 0 | 1 | 2 | 3 | 4 | string, - vales: (UserResolvable | RoleResolvable | ChannelResolvable | string)[], - ): Promise; - public markUnread(): Promise; - public markRead(): Promise; - public report( - breadcrumbs: number[], - elements?: object, - ): Promise<{ report_id: Snowflake }>; - public vote(...ids: number[]): Promise; -} - -export class CallState extends Base { - private constructor(client: Client, data: any); - public channelId: Snowflake; - public region: string; - public readonly channel?: DMChannel | GroupDMChannel; - public readonly ringing: Collection; - public setRTCRegion(): Promise; -} -export class MessageActionRow< - T extends - | MessageActionRowComponent - | ModalActionRowComponent = MessageActionRowComponent, - U = T extends ModalActionRowComponent - ? ModalActionRowComponentResolvable - : MessageActionRowComponentResolvable, - V = T extends ModalActionRowComponent - ? APIActionRowComponent - : APIActionRowComponent, -> extends BaseMessageComponent { - // tslint:disable-next-line:ban-ts-ignore - // @ts-ignore (TS:2344, Caused by TypeScript 4.8) - // Fixed in DiscordJS >= 14.x / DiscordApiTypes >= 0.37.x, ignoring the type error here. - public constructor( - data?: MessageActionRow | MessageActionRowOptions | V, - ); - public type: 'ACTION_ROW'; - public components: T[]; - public addComponents(...components: U[] | U[][]): this; - public setComponents(...components: U[] | U[][]): this; - public spliceComponents( - index: number, - deleteCount: number, - ...components: U[] | U[][] - ): this; - public toJSON(): V; -} - -export class MessageAttachment { - public constructor( - attachment: BufferResolvable | Stream, - name?: string, - data?: RawMessageAttachmentData, - ); - - public attachment: BufferResolvable | Stream; - public contentType: string | null; - public description: string | null; - public duration: number | null; - public ephemeral: boolean; - public flags: Readonly; - public height: number | null; - public id: Snowflake; - public name: string | null; - public proxyURL: string; - public size: number; - public readonly spoiler: boolean; - public title: string | null; - public url: string; - public waveform: string | null; - public width: number | null; - public setDescription(description: string): this; - public setFile(attachment: BufferResolvable | Stream, name?: string): this; - public setName(name: string): this; - public setSpoiler(spoiler?: boolean): this; - public toJSON(): unknown; -} - -export class AttachmentFlags extends BitField { - public static FLAGS: Record; - public static resolve( - bit?: BitFieldResolvable, - ): number; -} - -export type AttachmentFlagsString = 'IS_REMIX'; - -export class MessageButton extends BaseMessageComponent { - public constructor( - data?: MessageButton | MessageButtonOptions | APIButtonComponent, - ); - public customId: string | null; - public disabled: boolean; - public emoji: APIPartialEmoji | null; - public label: string | null; - public style: MessageButtonStyle | null; - public type: 'BUTTON'; - public url: string | null; - public setCustomId(customId: string): this; - public setDisabled(disabled?: boolean): this; - public setEmoji(emoji: EmojiIdentifierResolvable): this; - public setLabel(label: string): this; - public setStyle(style: MessageButtonStyleResolvable): this; - public setURL(url: string): this; - public toJSON(): APIButtonComponent; - private static resolveStyle( - style: MessageButtonStyleResolvable, - ): MessageButtonStyle; -} - -export class UnfurledMediaItem { - public constructor(data?: UnfurledMediaItem | APIUnfurledMediaItem); - public url: string | null; - public toJSON(): APIUnfurledMediaItem; -} - -export class MediaGalleryItem { - public constructor(data?: MediaGalleryItem | APIMediaGalleryItem); - public media: UnfurledMediaItem; - public description: string | null; - public spoiler: boolean; - public toJSON(): APIMediaGalleryItem; -} - -export class MediaGalleryComponent extends BaseMessageComponent { - public constructor(data?: MediaGalleryComponent | APIMediaGalleryComponent); - public items: MediaGalleryItem[]; - public toJSON(): APIMediaGalleryComponent; -} - -export class FileComponent extends BaseMessageComponent { - public constructor(data?: FileComponent | APIFileComponent); - public file: UnfurledMediaItem; - public spoiler: boolean; - public toJSON(): APIFileComponent; -} - -export class SeparatorComponent extends BaseMessageComponent { - public constructor(data?: SeparatorComponent | APISeparatorComponent); - public spacing: SeparatorSpacingSizes; - public divider: boolean; - public toJSON(): APISeparatorComponent; -} - -export class TextDisplayComponent extends BaseMessageComponent { - public constructor(data?: TextDisplayComponent | APITextDisplayComponent); - public content: string | null; - public toJSON(): APITextDisplayComponent; -} - -export class ThumbnailComponent extends BaseMessageComponent { - public constructor(data?: ThumbnailComponent | APIThumbnailComponent); - public media: UnfurledMediaItem; - public description: string | null; - public spoiler: boolean; -} - -export class SectionComponent< - AccessoryType extends MessageButton | ThumbnailComponent = - | MessageButton - | ThumbnailComponent, -> extends BaseMessageComponent { - public constructor( - data?: SectionComponent | APISectionComponent, - ); - public components: TextDisplayComponent[]; - public accessory: AccessoryType[]; - public toJSON(): APISectionComponent; -} - -export type ComponentInContainer = - | MessageActionRow - | FileComponent - | MediaGalleryComponent - | SectionComponent - | SeparatorComponent - | TextDisplayComponent; - -export class ContainerComponent extends BaseMessageComponent { - public constructor(data?: ComponentInContainer | APIContainerComponent); - public components: ComponentInContainer[]; - public accentColor: number | null; - public readonly hexAccentColor: HexColorString | null; - public spoiler: boolean; - public toJSON(): APIContainerComponent; -} - -export class MessageCollector extends Collector { - public constructor( - channel: TextBasedChannel, - options?: MessageCollectorOptions, - ); - private _handleChannelDeletion(channel: NonThreadGuildBasedChannel): void; - private _handleGuildDeletion(guild: Guild): void; - - public channel: TextBasedChannel; - public readonly endReason: string | null; - public options: MessageCollectorOptions; - public received: number; - - public collect(message: Message): Snowflake | null; - public dispose(message: Message): Snowflake | null; -} - -export class MessageComponentInteraction< - Cached extends CacheType = CacheType, -> extends Interaction { - protected constructor( - client: Client, - data: RawMessageComponentInteractionData, - ); - public readonly component: CacheTypeReducer< - Cached, - MessageActionRowComponent, - Exclude< - APIMessageComponent, - APIActionRowComponent - >, - | MessageActionRowComponent - | Exclude< - APIMessageComponent, - APIActionRowComponent - >, - | MessageActionRowComponent - | Exclude< - APIMessageComponent, - APIActionRowComponent - > - >; - public componentType: Exclude; - public customId: string; - public channelId: Snowflake; - public deferred: boolean; - public ephemeral: boolean | null; - public message: GuildCacheMessage; - public replied: boolean; - public webhook: InteractionWebhook; - public awaitModalSubmit( - options: AwaitModalSubmitOptions, - ): Promise>; - public inGuild(): this is MessageComponentInteraction<'raw' | 'cached'>; - public inCachedGuild(): this is MessageComponentInteraction<'cached'>; - public inRawGuild(): this is MessageComponentInteraction<'raw'>; - public deferReply( - options: InteractionDeferReplyOptions & { fetchReply: true }, - ): Promise>; - public deferReply(options?: InteractionDeferReplyOptions): Promise; - public deferUpdate( - options: InteractionDeferUpdateOptions & { fetchReply: true }, - ): Promise>; - public deferUpdate(options?: InteractionDeferUpdateOptions): Promise; - public deleteReply(message?: MessageResolvable | '@original'): Promise; - public editReply( - options: string | MessagePayload | InteractionEditReplyOptions, - ): Promise>; - public fetchReply( - message?: MessageResolvable | '@original', - ): Promise>; - public followUp( - options: string | MessagePayload | InteractionReplyOptions, - ): Promise>; - public reply( - options: InteractionReplyOptions & { fetchReply: true }, - ): Promise>; - public reply( - options: string | MessagePayload | InteractionReplyOptions, - ): Promise; - public showModal(modal: Modal | ModalOptions): Promise; - public update( - options: InteractionUpdateOptions & { fetchReply: true }, - ): Promise>; - public update( - options: string | MessagePayload | InteractionUpdateOptions, - ): Promise; - - public static resolveType( - type: MessageComponentTypeResolvable, - ): MessageComponentType; -} - -export class MessageContextMenuInteraction< - Cached extends CacheType = CacheType, -> extends ContextMenuInteraction { - public readonly targetMessage: NonNullable< - CommandInteractionOption['message'] - >; - public inGuild(): this is MessageContextMenuInteraction<'raw' | 'cached'>; - public inCachedGuild(): this is MessageContextMenuInteraction<'cached'>; - public inRawGuild(): this is MessageContextMenuInteraction<'raw'>; -} - -export class MessageEmbed { - private _fieldEquals(field: EmbedField, other: EmbedField): boolean; - - public constructor(data?: MessageEmbed | MessageEmbedOptions | APIEmbed); - public author: MessageEmbedAuthor | null; - public color: number | null; - public readonly createdAt: Date | null; - public description: string | null; - public fields: EmbedField[]; - public footer: MessageEmbedFooter | null; - public readonly hexColor: HexColorString | null; - public image: MessageEmbedImage | null; - public readonly length: number; - public provider: MessageEmbedProvider | null; - public thumbnail: MessageEmbedThumbnail | null; - public timestamp: number | null; - public title: string | null; - /** @deprecated */ - public type: string; - public url: string | null; - public readonly video: MessageEmbedVideo | null; - /** @deprecated This method is a wrapper for {@link MessageEmbed#addFields}. Use that instead. */ - public addField(name: string, value: string, inline?: boolean): this; - public addFields(...fields: EmbedFieldData[] | EmbedFieldData[][]): this; - public setFields(...fields: EmbedFieldData[] | EmbedFieldData[][]): this; - public setAuthor(options: EmbedAuthorData | null): this; - /** @deprecated Supply a lone object of interface {@link EmbedAuthorData} instead. */ - public setAuthor(name: string, iconURL?: string, url?: string): this; - public setColor(color: ColorResolvable): this; - public setDescription(description: string): this; - public setFooter(options: EmbedFooterData | null): this; - /** @deprecated Supply a lone object of interface {@link EmbedFooterData} instead. */ - public setFooter(text: string, iconURL?: string): this; - public setImage(url: string): this; - public setThumbnail(url: string): this; - public setTimestamp(timestamp?: Date | number | null): this; - public setTitle(title: string): this; - public setURL(url: string): this; - public spliceFields( - index: number, - deleteCount: number, - ...fields: EmbedFieldData[] | EmbedFieldData[][] - ): this; - public equals(embed: MessageEmbed | APIEmbed): boolean; - public toJSON(): APIEmbed; - - public static normalizeField( - name: string, - value: string, - inline?: boolean, - ): Required; - public static normalizeFields( - ...fields: EmbedFieldData[] | EmbedFieldData[][] - ): Required[]; -} - -export interface WebEmbedOptions { - title?: string; - description?: string; - url?: string; - timestamp?: Date | number; - color?: ColorResolvable; - fields?: EmbedFieldData[]; - author?: Partial & { - icon_url?: string; - proxy_icon_url?: string; - }; - thumbnail?: Partial & { proxy_url?: string }; - image?: Partial & { proxy_url?: string }; - video?: Partial & { proxy_url?: string }; - footer?: Partial & { - icon_url?: string; - proxy_icon_url?: string; - }; - imageType?: 'thumbnail' | 'image'; - redirect?: string; -} - -export class WebEmbed { - public constructor(data?: WebEmbedOptions); - public author: MessageEmbedAuthor | null; - public baseURL: string | undefined; - public color: number | null; - public description: string | null; - public image: MessageEmbedImage | null; - public provider: MessageEmbedProvider | null; - public title: string | null; - public url: string | null; - public video: MessageEmbedVideo | null; - public imageType: 'thumbnail' | 'image'; - public redirect?: string; - public setAuthor(options: EmbedAuthorData | null): this; - public setColor(color: ColorResolvable): this; - public setDescription(description: string): this; - public setImage(url: string): this; - public setThumbnail(url: string): this; - public setVideo(url: string): this; - public setTitle(title: string): this; - public setURL(url: string): this; - public setProvider(options: MessageEmbedProvider | null): this; - public setRedirect(url: string): this; - public toString(): string; - public static hiddenEmbed: string; -} - -export class SessionManager extends CachedManager { - private constructor(client: Client, iterable: Iterable); - public currentSessionIdHash: string | null; - public readonly currentSession: Session | null; - public fetch(): Promise>; - public logoutAllDevices(): Promise; -} - -export class BillingManager extends BaseManager { - constructor(client: Client); - public paymentSources: Collection; - public fetchPaymentSources(): Promise>; - public guildBoosts: Collection; - public fetchGuildBoosts(): Promise>; - public currentSubscription: Collection; - public fetchCurrentSubscription(): Promise>; -} - -export class Session extends Base { - constructor(client: Client); - public id?: string; - public clientInfo?: SessionClientInfo; - public approxLastUsedTime: string; - public readonly createdTimestamp: number; - public readonly createdAt: Date; - public logout(): Promise; -} - -export interface SessionClientInfo { - location?: string; - platform?: string; - os?: string; -} - -export class GuildBoost extends Base { - constructor(client: Client, data: object); - public id: Snowflake; - public guildId?: Snowflake; - public readonly guild: Guild | null; - public subscriptionId: Snowflake; - public premiumGuildSubscriptionId?: Snowflake; - public ended?: boolean; - public canceled: boolean; - public cooldownEndsAt: Date; - public unsubscribe(): Promise; - public subscribe(guild: GuildResolvable): Promise; -} - -export class MessageFlags extends BitField { - public static FLAGS: Record; - public static resolve( - bit?: BitFieldResolvable, - ): number; -} - -export class MessageMentions { - private constructor( - message: Message, - users: APIUser[] | Collection, - roles: Snowflake[] | Collection, - everyone: boolean, - repliedUser?: APIUser | User, - ); - private _channels: Collection | null; - private readonly _content: string; - private _members: Collection | null; - private _parsedUsers: Collection | null; - - public readonly channels: Collection; - public readonly client: Client; - public everyone: boolean; - public readonly guild: Guild; - public has( - data: UserResolvable | RoleResolvable | ChannelResolvable, - options?: MessageMentionsHasOptions, - ): boolean; - public readonly members: Collection | null; - public readonly parsedUsers: Collection; - public repliedUser: User | null; - public roles: Collection; - public users: Collection; - public crosspostedChannels: Collection; - public toJSON(): unknown; - - public static CHANNELS_PATTERN: RegExp; - public static EVERYONE_PATTERN: RegExp; - public static ROLES_PATTERN: RegExp; - public static USERS_PATTERN: RegExp; -} - -export class MessagePayload { - public constructor( - target: MessageTarget, - options: MessageOptions | WebhookMessageOptions, - ); - public data: RawMessagePayloadData | null; - public readonly isUser: boolean; - public readonly isWebhook: boolean; - public readonly isMessage: boolean; - public readonly isMessageManager: boolean; - public readonly isInteraction: boolean; - public files: HTTPAttachmentData[] | null; - public options: MessageOptions | WebhookMessageOptions; - public target: MessageTarget; - - public static create( - target: MessageTarget, - options: string | MessageOptions | WebhookMessageOptions, - extra?: MessageOptions | WebhookMessageOptions, - ): MessagePayload; - public static resolveFile( - fileLike: BufferResolvable | Stream | FileOptions | MessageAttachment, - ): Promise; - - public makeContent(): string | undefined; - public resolveData(): this; - public resolveFiles(): Promise; -} - -export class MessageReaction { - private constructor( - client: Client, - data: RawMessageReactionData, - message: Message, - ); - private _emoji: GuildEmoji | ReactionEmoji; - - public burstColors: string[] | null; - public readonly client: Client; - public count: number; - public countDetails: ReactionCountDetailsData; - public readonly emoji: GuildEmoji | ReactionEmoji; - public me: boolean; - public meBurst: boolean; - public message: Message | PartialMessage; - public readonly partial: false; - public users: ReactionUserManager; - public remove(): Promise; - public fetch(): Promise; - public toJSON(): unknown; -} - -export interface ReactionCountDetailsData { - burst: number; - normal: number; -} -export interface MessageReactionEventDetails { - type: ReactionType; - burst: boolean; -} - -export class MessageSelectMenu extends BaseMessageComponent { - public constructor( - data?: - | MessageSelectMenu - | MessageSelectMenuOptions - | APISelectMenuComponent, - ); - public channelTypes: ChannelTypes[]; - public customId: string | null; - public disabled: boolean; - public maxValues: number | null; - public minValues: number | null; - public options: MessageSelectOption[]; - public placeholder: string | null; - public type: SelectMenuComponentType; - public addOptions( - ...options: MessageSelectOptionData[] | MessageSelectOptionData[][] - ): this; - public setOptions( - ...options: MessageSelectOptionData[] | MessageSelectOptionData[][] - ): this; - public setCustomId(customId: string): this; - public setDisabled(disabled?: boolean): this; - public setMaxValues(maxValues: number): this; - public setMinValues(minValues: number): this; - public setPlaceholder(placeholder: string): this; - public spliceOptions( - index: number, - deleteCount: number, - ...options: MessageSelectOptionData[] | MessageSelectOptionData[][] - ): this; - public toJSON(): APISelectMenuComponent; -} - -export class Modal { - public constructor(data?: Modal | ModalOptions); - public components: MessageActionRow[]; - public customId: string | null; - public title: string | null; - public readonly isMessage: false; - public readonly guildId: Snowflake | null; - public channelId: Snowflake; - public readonly channel: TextBasedChannel; - public readonly guild: Guild | null; - public readonly replied: boolean; - public reply(): Promise; - public toJSON(): RawModalSubmitInteractionData; -} - -export interface PollQuestionMedia { - text: string; -} - -export class Poll extends Base { - private constructor(client: Client, data: APIPoll, message: Message); - public readonly message: Message; - public question: PollQuestionMedia; - public answers: Collection; - public expiresTimestamp: number; - public get expiresAt(): Date; - public allowMultiselect: boolean; - public layoutType: PollLayoutTypes; - public resultsFinalized: boolean; - public end(): Promise; -} - -export class PollAnswer extends Base { - private constructor( - client: Client, - data: APIPollAnswer & { count?: number }, - poll: Poll, - ); - private _emoji: APIPartialEmoji | null; - public readonly poll: Poll; - public id: number; - public text: string | null; - public voteCount: number; - public get emoji(): GuildEmoji | Emoji | null; - public fetchVoters( - options?: BaseFetchPollAnswerVotersOptions, - ): Promise>; -} - -export interface PollData { - question: PollQuestionMedia; - answers: readonly PollAnswerData[]; - duration: number; - allowMultiselect: boolean; - layoutType?: PollLayoutTypes; -} - -export interface PollAnswerData { - text: string; - emoji?: EmojiIdentifierResolvable; -} - -export interface BaseFetchPollAnswerVotersOptions { - after?: Snowflake; - limit?: number; -} - -export interface FetchPollAnswerVotersOptions - extends BaseFetchPollAnswerVotersOptions { - messageId: Snowflake; - answerId: number; -} - -export interface MessageCall { - readonly endedAt: Date | null; - endedTimestamp: number | null; - participants: readonly Snowflake[]; -} - -export class ModalSubmitFieldsResolver { - constructor(components: PartialModalActionRow[]); - private readonly _fields: PartialTextInputData[]; - public getField(customId: string): PartialTextInputData; - public getTextInputValue(customId: string): string; -} - -export interface ModalMessageModalSubmitInteraction< - Cached extends CacheType = CacheType, -> extends ModalSubmitInteraction { - message: GuildCacheMessage; - channelId: Snowflake; - update( - options: InteractionUpdateOptions & { fetchReply: true }, - ): Promise>; - update( - options: string | MessagePayload | InteractionUpdateOptions, - ): Promise; - deferUpdate( - options: InteractionDeferUpdateOptions & { fetchReply: true }, - ): Promise>; - deferUpdate(options?: InteractionDeferUpdateOptions): Promise; - inGuild(): this is ModalMessageModalSubmitInteraction<'raw' | 'cached'>; - inCachedGuild(): this is ModalMessageModalSubmitInteraction<'cached'>; - inRawGuild(): this is ModalMessageModalSubmitInteraction<'raw'>; -} - -export class ModalSubmitInteraction< - Cached extends CacheType = CacheType, -> extends Interaction { - protected constructor(client: Client, data: RawModalSubmitInteractionData); - public customId: string; - public components: PartialModalActionRow[]; - public deferred: boolean; - public ephemeral: boolean | null; - public message: GuildCacheMessage | null; - public fields: ModalSubmitFieldsResolver; - public replied: false; - public webhook: InteractionWebhook; - public reply( - options: InteractionReplyOptions & { fetchReply: true }, - ): Promise>; - public reply( - options: string | MessagePayload | InteractionReplyOptions, - ): Promise; - public deleteReply(message?: MessageResolvable | '@original'): Promise; - public editReply( - options: string | MessagePayload | InteractionEditReplyOptions, - ): Promise>; - public deferReply( - options: InteractionDeferReplyOptions & { fetchReply: true }, - ): Promise>; - public deferReply(options?: InteractionDeferReplyOptions): Promise; - public deferUpdate( - options: InteractionDeferUpdateOptions & { fetchReply: true }, - ): Promise>; - public deferUpdate(options?: InteractionDeferUpdateOptions): Promise; - public fetchReply( - message?: MessageResolvable | '@original', - ): Promise>; - public followUp( - options: string | MessagePayload | InteractionReplyOptions, - ): Promise>; - public inGuild(): this is ModalSubmitInteraction<'raw' | 'cached'>; - public inCachedGuild(): this is ModalSubmitInteraction<'cached'>; - public inRawGuild(): this is ModalSubmitInteraction<'raw'>; - public isFromMessage(): this is ModalMessageModalSubmitInteraction; - public update( - options: InteractionUpdateOptions & { fetchReply: true }, - ): Promise>; - public update( - options: string | MessagePayload | InteractionUpdateOptions, - ): Promise; -} - -export class NewsChannel extends BaseGuildTextChannel { - public threads: GuildTextThreadManager; - public type: 'GUILD_NEWS'; - public addFollower( - channel: TextChannelResolvable, - reason?: string, - ): Promise; -} - -export class OAuth2Guild extends BaseGuild { - private constructor(client: Client, data: RawOAuth2GuildData); - public owner: boolean; - public permissions: Readonly; -} - -export class GroupDMChannel extends TextBasedChannelMixin(Channel, [ - 'fetchWebhooks', - 'createWebhook', - 'setRateLimitPerUser', - 'setNSFW', -]) { - private constructor(client: Client, data: RawPartialGroupDMChannelData); - public name: string | null; - public icon: string | null; - public flags: Readonly; - private _recipients: RawUserData[]; - public type: 'GROUP_DM'; - public ownerId: Snowflake; - public readonly recipients: Collection; - public readonly owner: User; - public iconURL(options?: StaticImageURLOptions): string | null; - public leave(slient?: boolean): Promise; - public edit(data: GroupDMChannelEditData): Promise; - public setIcon( - icon: BufferResolvable | Base64Resolvable | null, - ): Promise; - public setName(name: string): Promise; - public setOwner(owner: UserResolvable): Promise; - public addUser(user: UserResolvable): Promise; - public removeUser(user: UserResolvable): Promise; - public getInvite(): Promise; - public fetchAllInvite(): Promise>; - public deleteInvite(invite: InviteResolvable): Promise; - public sync(): void; - public ring(recipients?: UserResolvable[]): Promise; - public readonly voiceAdapterCreator: InternalDiscordGatewayAdapterCreator; - public readonly shard: WebSocketShard; - public readonly voiceUsers: Collection; -} - -export class PermissionOverwrites extends Base { - private constructor( - client: Client, - data: RawPermissionOverwriteData, - channel: NonThreadGuildBasedChannel, - ); - public allow: Readonly; - public readonly channel: NonThreadGuildBasedChannel; - public deny: Readonly; - public id: Snowflake; - public type: OverwriteType; - public edit( - options: PermissionOverwriteOptions, - reason?: string, - ): Promise; - public delete(reason?: string): Promise; - public toJSON(): unknown; - public static resolveOverwriteOptions( - options: PermissionOverwriteOptions, - initialPermissions: { - allow?: PermissionResolvable; - deny?: PermissionResolvable; - }, - ): ResolvedOverwriteOptions; - public static resolve( - overwrite: OverwriteResolvable, - guild: Guild, - ): APIOverwrite; -} - -export class Permissions extends BitField { - public any(permission: PermissionResolvable, checkAdmin?: boolean): boolean; - public has(permission: PermissionResolvable, checkAdmin?: boolean): boolean; - public missing( - bits: BitFieldResolvable, - checkAdmin?: boolean, - ): PermissionString[]; - public serialize(checkAdmin?: boolean): Record; - public toArray(): PermissionString[]; - - public static ALL: bigint; - public static DEFAULT: bigint; - public static STAGE_MODERATOR: bigint; - public static FLAGS: PermissionFlags; - public static resolve(permission?: PermissionResolvable): bigint; -} - -export class Presence extends Base { - protected constructor(client: Client, data?: RawPresenceData); - public activities: (Activity | CustomStatus | RichPresence | SpotifyRPC)[]; - public clientStatus: ClientPresenceStatusData | null; - public lastModified: number | null; - public guild: Guild | null; - public readonly member: GuildMember | null; - public status: PresenceStatus; - public readonly user: User | null; - public userId: Snowflake; - public equals(presence: Presence): boolean; -} - -export class ReactionCollector extends Collector< - Snowflake | string, - MessageReaction, - [User] -> { - public constructor(message: Message, options?: ReactionCollectorOptions); - private _handleChannelDeletion(channel: NonThreadGuildBasedChannel): void; - private _handleGuildDeletion(guild: Guild): void; - private _handleMessageDeletion(message: Message): void; - - public readonly endReason: string | null; - public message: Message; - public options: ReactionCollectorOptions; - public total: number; - public users: Collection; - - public static key(reaction: MessageReaction): Snowflake | string; - - public collect( - reaction: MessageReaction, - user: User, - ): Snowflake | string | null; - public dispose( - reaction: MessageReaction, - user: User, - ): Snowflake | string | null; - public empty(): void; - - public on( - event: 'collect' | 'dispose' | 'remove', - listener: (reaction: MessageReaction, user: User) => void, - ): this; - public on( - event: 'end', - listener: ( - collected: Collection, - reason: string, - ) => void, - ): this; - public on(event: string, listener: (...args: any[]) => void): this; - - public once( - event: 'collect' | 'dispose' | 'remove', - listener: (reaction: MessageReaction, user: User) => void, - ): this; - public once( - event: 'end', - listener: ( - collected: Collection, - reason: string, - ) => void, - ): this; - public once(event: string, listener: (...args: any[]) => void): this; -} - -export class ReactionEmoji extends Emoji { - private constructor(reaction: MessageReaction, emoji: RawReactionEmojiData); - public reaction: MessageReaction; - public toJSON(): unknown; -} - -export class RichPresenceAssets { - private constructor(activity: Activity, assets: RawRichPresenceAssets); - public readonly activity: Activity; - public largeImage: Snowflake | null; - public largeText: string | null; - public smallImage: Snowflake | null; - public smallText: string | null; - public largeImageURL(options?: StaticImageURLOptions): string | null; - public smallImageURL(options?: StaticImageURLOptions): string | null; - public static parseImage(image: string): string | null; - public toJSON(): unknown; - public setLargeImage(image?: string): this; - public setLargeText(text?: string): this; - public setSmallImage(image?: string): this; - public setSmallText(text?: string): this; -} - -export interface RoleColors { - primaryColor: number; - secondaryColor: number | null; - tertiaryColor: number | null; -} - -export interface RoleColorsResolvable { - primaryColor: ColorResolvable; - secondaryColor?: ColorResolvable; - tertiaryColor?: ColorResolvable; -} - -export class Role extends Base { - private constructor(client: Client, data: RawRoleData, guild: Guild); - /** @deprecated Use {@link Role.colors} instead. */ - public color: number; - public colors: RoleColors; - public readonly createdAt: Date; - public readonly createdTimestamp: number; - /** @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 */ - public deleted: boolean; - public readonly editable: boolean; - public flags: Readonly; - public guild: Guild; - public readonly hexColor: HexColorString; - public hoist: boolean; - public id: Snowflake; - public managed: boolean; - public readonly members: Collection; - public mentionable: boolean; - public name: string; - public permissions: Readonly; - public readonly position: number; - public rawPosition: number; - public tags: RoleTagData | null; - public comparePositionTo(role: RoleResolvable): number; - public icon: string | null; - public unicodeEmoji: string | null; - public delete(reason?: string): Promise; - public edit(data: RoleData, reason?: string): Promise; - public equals(role: Role): boolean; - public iconURL(options?: StaticImageURLOptions): string | null; - public permissionsIn( - channel: NonThreadGuildBasedChannel | Snowflake, - checkAdmin?: boolean, - ): Readonly; - /** @deprecated Use {@link Role.setColors} instead. */ - public setColor(color: ColorResolvable, reason?: string): Promise; - public setColors( - colors: RoleColorsResolvable, - reason?: string, - ): Promise; - public setHoist(hoist?: boolean, reason?: string): Promise; - public setMentionable(mentionable?: boolean, reason?: string): Promise; - public setName(name: string, reason?: string): Promise; - public setPermissions( - permissions: PermissionResolvable, - reason?: string, - ): Promise; - public setIcon( - icon: BufferResolvable | Base64Resolvable | EmojiResolvable | null, - reason?: string, - ): Promise; - public setPosition( - position: number, - options?: SetRolePositionOptions, - ): Promise; - public setUnicodeEmoji( - unicodeEmoji: string | null, - reason?: string, - ): Promise; - public fetchMemberIds(): Promise; - public toJSON(): unknown; - public toString(): RoleMention; - - /** @deprecated Use {@link RoleManager.comparePositions} instead. */ - public static comparePositions(role1: Role, role2: Role): number; -} - -export class RoleFlags extends BitField { - public static FLAGS: Record; - public static resolve( - bit?: BitFieldResolvable, - ): number; -} - -export type RoleFlagsString = 'IN_PROMPT'; - -export class Speaking extends BitField { - public static FLAGS: Record; - public static resolve( - bit?: BitFieldResolvable, - ): number; -} - -export type SpeakingString = 'SPEAKING' | 'SOUNDSHARE' | 'PRIORITY_SPEAKING'; - -export class BaseSelectMenuInteraction< - Cached extends CacheType = CacheType, -> extends MessageComponentInteraction { - public constructor(client: Client, data: RawMessageSelectMenuInteractionData); - public readonly component: CacheTypeReducer< - Cached, - MessageSelectMenu, - APISelectMenuComponent, - MessageSelectMenu | APISelectMenuComponent, - MessageSelectMenu | APISelectMenuComponent - >; - public componentType: SelectMenuComponentType; - public values: string[]; - public inGuild(): this is SelectMenuInteraction<'raw' | 'cached'>; - public inCachedGuild(): this is SelectMenuInteraction<'cached'>; - public inRawGuild(): this is SelectMenuInteraction<'raw'>; -} - -export class ChannelSelectInteraction< - Cached extends CacheType = CacheType, -> extends BaseSelectMenuInteraction { - public componentType: 'CHANNEL_SELECT'; - public channels: Collection< - Snowflake, - CacheTypeReducer< - Cached, - Channel, - APIChannel, - Channel | APIChannel, - Channel | APIChannel - > - >; - public inGuild(): this is ChannelSelectInteraction<'raw' | 'cached'>; - public inCachedGuild(): this is ChannelSelectInteraction<'cached'>; - public inRawGuild(): this is ChannelSelectInteraction<'raw'>; -} - -export class MentionableSelectInteraction< - Cached extends CacheType = CacheType, -> extends BaseSelectMenuInteraction { - public componentType: 'MENTIONABLE_SELECT'; - public channels?: Collection< - Snowflake, - CacheTypeReducer< - Cached, - Channel, - APIChannel, - Channel | APIChannel, - Channel | APIChannel - > - >; - public members?: Collection< - Snowflake, - CacheTypeReducer< - Cached, - GuildMember, - APIGuildMember, - GuildMember | APIGuildMember, - GuildMember | APIGuildMember - > - >; - public roles?: Collection< - Snowflake, - CacheTypeReducer - >; - public users?: Collection; - public inGuild(): this is MentionableSelectInteraction<'raw' | 'cached'>; - public inCachedGuild(): this is MentionableSelectInteraction<'cached'>; - public inRawGuild(): this is MentionableSelectInteraction<'raw'>; -} - -export class RoleSelectInteraction< - Cached extends CacheType = CacheType, -> extends BaseSelectMenuInteraction { - public componentType: 'ROLE_SELECT'; - public roles: Collection< - Snowflake, - CacheTypeReducer - >; - public inGuild(): this is RoleSelectInteraction<'raw' | 'cached'>; - public inCachedGuild(): this is RoleSelectInteraction<'cached'>; - public inRawGuild(): this is RoleSelectInteraction<'raw'>; -} - -export class StringSelectInteraction< - Cached extends CacheType = CacheType, -> extends BaseSelectMenuInteraction { - public componentType: 'STRING_SELECT'; - public roles: Collection< - Snowflake, - CacheTypeReducer - >; - public inGuild(): this is StringSelectInteraction<'raw' | 'cached'>; - public inCachedGuild(): this is StringSelectInteraction<'cached'>; - public inRawGuild(): this is StringSelectInteraction<'raw'>; -} - -export class UserSelectInteraction< - Cached extends CacheType = CacheType, -> extends BaseSelectMenuInteraction { - public componentType: 'USER_SELECT'; - public members?: Collection< - Snowflake, - CacheTypeReducer< - Cached, - GuildMember, - APIGuildMember, - GuildMember | APIGuildMember, - GuildMember | APIGuildMember - > - >; - public users: Collection; - public inGuild(): this is UserSelectInteraction<'raw' | 'cached'>; - public inCachedGuild(): this is UserSelectInteraction<'cached'>; - public inRawGuild(): this is UserSelectInteraction<'raw'>; -} - -export type SelectMenuInteraction = - | StringSelectInteraction - | ChannelSelectInteraction - | MentionableSelectInteraction - | RoleSelectInteraction - | UserSelectInteraction; - -export interface ShardEventTypes { - spawn: [process: ChildProcess | Worker]; - death: [process: ChildProcess | Worker]; - disconnect: []; - ready: []; - reconnecting: []; - error: [error: Error]; - message: [message: any]; -} - -/** @deprecated This will be removed in the next major version */ -export class Shard extends EventEmitter { - private constructor(manager: ShardingManager, id: number); - private _evals: Map>; - private _exitListener: (...args: any[]) => void; - private _fetches: Map>; - private _handleExit(respawn?: boolean, timeout?: number): void; - private _handleMessage(message: unknown): void; - private incrementMaxListeners(emitter: EventEmitter | ChildProcess): void; - private decrementMaxListeners(emitter: EventEmitter | ChildProcess): void; - - public args: string[]; - public execArgv: string[]; - public env: unknown; - public id: number; - public manager: ShardingManager; - public process: ChildProcess | null; - public ready: boolean; - public worker: Worker | null; - public eval(script: string): Promise; - public eval(fn: (client: Client) => T): Promise; - public eval( - fn: (client: Client, context: Serialized

) => T, - context: P, - ): Promise; - public fetchClientValue(prop: string): Promise; - public kill(): void; - public respawn(options?: { - delay?: number; - timeout?: number; - }): Promise; - public send(message: unknown): Promise; - public spawn(timeout?: number): Promise; - - public on( - event: K, - listener: (...args: ShardEventTypes[K]) => Awaitable, - ): this; - - public once( - event: K, - listener: (...args: ShardEventTypes[K]) => Awaitable, - ): this; -} - -/** @deprecated This will be removed in the next major version */ -export class ShardClientUtil { - private constructor(client: Client, mode: ShardingManagerMode); - private _handleMessage(message: unknown): void; - private _respond(type: string, message: unknown): void; - private incrementMaxListeners(emitter: EventEmitter | ChildProcess): void; - private decrementMaxListeners(emitter: EventEmitter | ChildProcess): void; - - public client: Client; - public readonly count: number; - public readonly ids: number[]; - public mode: ShardingManagerMode; - public parentPort: MessagePort | null; - public broadcastEval( - fn: (client: Client) => Awaitable, - ): Promise[]>; - public broadcastEval( - fn: (client: Client) => Awaitable, - options: { shard: number }, - ): Promise>; - public broadcastEval( - fn: (client: Client, context: Serialized

) => Awaitable, - options: { context: P }, - ): Promise[]>; - public broadcastEval( - fn: (client: Client, context: Serialized

) => Awaitable, - options: { context: P; shard: number }, - ): Promise>; - public fetchClientValues(prop: string): Promise; - public fetchClientValues(prop: string, shard: number): Promise; - public respawnAll(options?: MultipleShardRespawnOptions): Promise; - public send(message: unknown): Promise; - - public static singleton( - client: Client, - mode: ShardingManagerMode, - ): ShardClientUtil; - public static shardIdForGuildId( - guildId: Snowflake, - shardCount: number, - ): number; -} - -/** @deprecated This will be removed in the next major version */ -export class ShardingManager extends EventEmitter { - public constructor(file: string, options?: ShardingManagerOptions); - private _performOnShards(method: string, args: unknown[]): Promise; - private _performOnShards( - method: string, - args: unknown[], - shard: number, - ): Promise; - - public file: string; - public respawn: boolean; - public shardArgs: string[]; - public shards: Collection; - public token: string | null; - public totalShards: number | 'auto'; - public shardList: number[] | 'auto'; - public broadcast(message: unknown): Promise; - public broadcastEval( - fn: (client: Client) => Awaitable, - ): Promise[]>; - public broadcastEval( - fn: (client: Client) => Awaitable, - options: { shard: number }, - ): Promise>; - public broadcastEval( - fn: (client: Client, context: Serialized

) => Awaitable, - options: { context: P }, - ): Promise[]>; - public broadcastEval( - fn: (client: Client, context: Serialized

) => Awaitable, - options: { context: P; shard: number }, - ): Promise>; - public createShard(id: number): Shard; - public fetchClientValues(prop: string): Promise; - public fetchClientValues(prop: string, shard: number): Promise; - public respawnAll( - options?: MultipleShardRespawnOptions, - ): Promise>; - public spawn( - options?: MultipleShardSpawnOptions, - ): Promise>; - - public on( - event: 'shardCreate', - listener: (shard: Shard) => Awaitable, - ): this; - - public once( - event: 'shardCreate', - listener: (shard: Shard) => Awaitable, - ): this; -} - -export interface FetchRecommendedShardsOptions { - guildsPerShard?: number; - multipleOf?: number; -} - -export class SnowflakeUtil extends null { - private constructor(); - public static deconstruct(snowflake: Snowflake): DeconstructedSnowflake; - public static generate(timestamp?: number | Date): Snowflake; - public static timestampFrom(snowflake: Snowflake): number; - public static readonly EPOCH: number; -} - -export class StageChannel extends BaseGuildVoiceChannel { - public readonly stageInstance: StageInstance | null; - public topic: string | null; - public type: 'GUILD_STAGE_VOICE'; - public createStageInstance( - options: StageInstanceCreateOptions, - ): Promise; - public setTopic(topic: string): Promise; -} - -export class DirectoryChannel extends Channel { - public flags: Readonly; -} - -export class StageInstance extends Base { - private constructor( - client: Client, - data: RawStageInstanceData, - channel: StageChannel, - ); - public id: Snowflake; - /** @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 */ - public deleted: boolean; - public guildId: Snowflake; - public channelId: Snowflake; - public topic: string; - public privacyLevel: PrivacyLevel; - public discoverableDisabled: boolean | null; - public guildScheduledEventId?: Snowflake; - public readonly channel: StageChannel | null; - public readonly guild: Guild | null; - public get guildScheduledEvent(): GuildScheduledEvent | null; - public edit(options: StageInstanceEditOptions): Promise; - public delete(): Promise; - public setTopic(topic: string): Promise; - public readonly createdTimestamp: number; - public readonly createdAt: Date; -} - -export class Sticker extends Base { - private constructor(client: Client, data: RawStickerData); - /** @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 */ - public deleted: boolean; - public readonly createdTimestamp: number; - public readonly createdAt: Date; - public available: boolean | null; - public description: string | null; - public format: StickerFormatType; - public readonly guild: Guild | null; - public guildId: Snowflake | null; - public id: Snowflake; - public name: string; - public packId: Snowflake | null; - public readonly partial: boolean; - public sortValue: number | null; - public tags: string[] | null; - public type: StickerType | null; - public user: User | null; - public readonly url: string; - public fetch(): Promise; - public fetchPack(): Promise; - public fetchUser(): Promise; - public edit(data?: GuildStickerEditData, reason?: string): Promise; - public delete(reason?: string): Promise; - public equals(other: Sticker | unknown): boolean; -} - -export class StickerPack extends Base { - private constructor(client: Client, data: RawStickerPackData); - public readonly createdTimestamp: number; - public readonly createdAt: Date; - public bannerId: Snowflake | null; - public readonly coverSticker: Sticker | null; - public coverStickerId: Snowflake | null; - public description: string; - public id: Snowflake; - public name: string; - public skuId: Snowflake; - public stickers: Collection; - public bannerURL(options?: StaticImageURLOptions): string | null; -} - -/** @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/6309018858647) for more information */ -export class StoreChannel extends GuildChannel { - private constructor( - guild: Guild, - data?: RawGuildChannelData, - client?: Client, - ); - public createInvite(options?: CreateInviteOptions): Promise; - public fetchInvites(cache?: boolean): Promise>; - /** @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/6309018858647) for more information */ - public clone(options?: GuildChannelCloneOptions): Promise; - public nsfw: boolean; - public type: 'GUILD_STORE'; -} - -export class Sweepers { - public constructor(client: Client, options: SweeperOptions); - public readonly client: Client; - public intervals: Record; - public options: SweeperOptions; - - public sweepApplicationCommands( - filter: CollectionSweepFilter< - SweeperDefinitions['applicationCommands'][0], - SweeperDefinitions['applicationCommands'][1] - >, - ): number; - public sweepBans( - filter: CollectionSweepFilter< - SweeperDefinitions['bans'][0], - SweeperDefinitions['bans'][1] - >, - ): number; - public sweepEmojis( - filter: CollectionSweepFilter< - SweeperDefinitions['emojis'][0], - SweeperDefinitions['emojis'][1] - >, - ): number; - public sweepInvites( - filter: CollectionSweepFilter< - SweeperDefinitions['invites'][0], - SweeperDefinitions['invites'][1] - >, - ): number; - public sweepGuildMembers( - filter: CollectionSweepFilter< - SweeperDefinitions['guildMembers'][0], - SweeperDefinitions['guildMembers'][1] - >, - ): number; - public sweepMessages( - filter: CollectionSweepFilter< - SweeperDefinitions['messages'][0], - SweeperDefinitions['messages'][1] - >, - ): number; - public sweepPresences( - filter: CollectionSweepFilter< - SweeperDefinitions['presences'][0], - SweeperDefinitions['presences'][1] - >, - ): number; - public sweepReactions( - filter: CollectionSweepFilter< - SweeperDefinitions['reactions'][0], - SweeperDefinitions['reactions'][1] - >, - ): number; - public sweepStageInstances( - filter: CollectionSweepFilter< - SweeperDefinitions['stageInstances'][0], - SweeperDefinitions['stageInstances'][1] - >, - ): number; - public sweepStickers( - filter: CollectionSweepFilter< - SweeperDefinitions['stickers'][0], - SweeperDefinitions['stickers'][1] - >, - ): number; - public sweepThreadMembers( - filter: CollectionSweepFilter< - SweeperDefinitions['threadMembers'][0], - SweeperDefinitions['threadMembers'][1] - >, - ): number; - public sweepThreads( - filter: CollectionSweepFilter< - SweeperDefinitions['threads'][0], - SweeperDefinitions['threads'][1] - >, - ): number; - public sweepUsers( - filter: CollectionSweepFilter< - SweeperDefinitions['users'][0], - SweeperDefinitions['users'][1] - >, - ): number; - public sweepVoiceStates( - filter: CollectionSweepFilter< - SweeperDefinitions['voiceStates'][0], - SweeperDefinitions['voiceStates'][1] - >, - ): number; - - public static archivedThreadSweepFilter( - lifetime?: number, - ): GlobalSweepFilter< - SweeperDefinitions['threads'][0], - SweeperDefinitions['threads'][1] - >; - public static expiredInviteSweepFilter( - lifetime?: number, - ): GlobalSweepFilter< - SweeperDefinitions['invites'][0], - SweeperDefinitions['invites'][1] - >; - public static filterByLifetime( - options?: LifetimeFilterOptions, - ): GlobalSweepFilter; - public static outdatedMessageSweepFilter( - lifetime?: number, - ): GlobalSweepFilter< - SweeperDefinitions['messages'][0], - SweeperDefinitions['messages'][1] - >; -} - -export class SystemChannelFlags extends BitField { - public static FLAGS: Record; - public static resolve( - bit?: BitFieldResolvable, - ): number; -} - -export class Team extends Base { - private constructor(client: Client, data: RawTeamData); - public id: Snowflake; - public name: string; - public icon: string | null; - public ownerId: Snowflake | null; - public members: Collection; - - public readonly owner: TeamMember | null; - public readonly createdAt: Date; - public readonly createdTimestamp: number; - - public iconURL(options?: StaticImageURLOptions): string | null; - public toJSON(): unknown; - public toString(): string; -} - -export class TeamMember extends Base { - private constructor(team: Team, data: RawTeamMemberData); - public team: Team; - public readonly id: Snowflake; - /** @deprecated Use {@link role} instead. */ - public permissions: string[]; - public membershipState: MembershipState; - public role: TeamMemberRole; - public user: User; - - public toString(): UserMention; -} - -export class TextChannel extends BaseGuildTextChannel { - public rateLimitPerUser: number; - public threads: GuildTextThreadManager; - public type: 'GUILD_TEXT'; -} - -export interface GuildForumTagEmoji { - id: Snowflake | null; - name: string | null; -} - -export interface GuildForumTag { - id: Snowflake; - name: string; - moderated: boolean; - emoji: GuildForumTagEmoji | null; -} - -export type GuildForumTagData = Partial & { name: string }; - -export interface DefaultReactionEmoji { - id: Snowflake | null; - name: string | null; -} - -export abstract class ThreadOnlyChannel extends TextBasedChannelMixin( - GuildChannel, - [ - 'send', - 'lastMessage', - 'lastPinAt', - 'sendTyping', - 'createMessageCollector', - 'awaitMessages', - 'messages', - ], -) { - public type: 'GUILD_FORUM' | 'GUILD_MEDIA'; - public threads: GuildForumThreadManager; - public availableTags: GuildForumTag[]; - public defaultReactionEmoji: DefaultReactionEmoji | null; - public defaultThreadRateLimitPerUser: number | null; - public rateLimitPerUser: number | null; - public defaultAutoArchiveDuration: ThreadAutoArchiveDuration | null; - public nsfw: boolean; - public topic: string | null; - public defaultSortOrder: SortOrderTypes | null; - public setAvailableTags( - tags: GuildForumTagData[], - reason?: string, - ): Promise; - public setDefaultReactionEmoji( - emojiId: DefaultReactionEmoji | null, - reason?: string, - ): Promise; - public setDefaultThreadRateLimitPerUser( - rateLimit: number, - reason?: string, - ): Promise; - public createInvite(options?: CreateInviteOptions): Promise; - public fetchInvites(cache?: boolean): Promise>; - public setDefaultAutoArchiveDuration( - defaultAutoArchiveDuration: ThreadAutoArchiveDuration, - reason?: string, - ): Promise; - public setTopic(topic: string | null, reason?: string): Promise; - public setDefaultSortOrder( - defaultSortOrder: SortOrderTypes | null, - reason?: string, - ): Promise; -} - -export class ForumChannel extends ThreadOnlyChannel { - public type: 'GUILD_FORUM'; - public defaultForumLayout: ForumLayoutTypes; - public setDefaultForumLayout( - defaultForumLayout: ForumLayoutTypes, - reason?: string, - ): Promise; -} - -export class MediaChannel extends ThreadOnlyChannel { - public type: 'GUILD_MEDIA'; -} - -export class TextInputComponent extends BaseMessageComponent { - public constructor(data?: TextInputComponent | TextInputComponentOptions); - public customId: string | null; - public label: string | null; - public required: boolean; - public maxLength: number | null; - public minLength: number | null; - public placeholder: string | null; - public style: TextInputStyle; - public value: string | null; - public setValue(value: string): this; - public toJSON(): RawTextInputComponentData; - public static resolveStyle(style: TextInputStyleResolvable): TextInputStyle; -} - -export class ThreadChannel extends TextBasedChannelMixin(Channel, [ - 'fetchWebhooks', - 'createWebhook', - 'setNSFW', -]) { - private constructor( - guild: Guild, - data?: RawThreadChannelData, - client?: Client, - ); - public archived: boolean | null; - public readonly archivedAt: Date | null; - public archiveTimestamp: number | null; - public readonly createdAt: Date | null; - private _createdTimestamp: number | null; - public readonly createdTimestamp: number | null; - public autoArchiveDuration: ThreadAutoArchiveDuration | null; - public readonly editable: boolean; - public guild: Guild; - public guildId: Snowflake; - public readonly guildMembers: Collection; - public invitable: boolean | null; - public readonly joinable: boolean; - public readonly joined: boolean; - public locked: boolean | null; - public readonly manageable: boolean; - public readonly viewable: boolean; - public readonly sendable: boolean; - public memberCount: number | null; - public messageCount: number | null; - public members: ThreadMemberManager; - public name: string; - public ownerId: Snowflake; - public readonly parent: - | TextChannel - | NewsChannel - | ForumChannel - | MediaChannel - | null; - public parentId: Snowflake | null; - public rateLimitPerUser: number | null; - public type: ThreadChannelTypes; - public flags: Readonly; - public appliedTags: Snowflake[]; - public totalMessageSent: number | null; - public readonly unarchivable: boolean; - public isPrivate(): this is this & { - readonly createdTimestamp: number; - readonly createdAt: Date; - type: 'GUILD_PRIVATE_THREAD'; - }; - public delete(reason?: string): Promise; - public edit(data: ThreadEditData, reason?: string): Promise; - public join(): Promise; - public leave(): Promise; - public permissionsFor( - memberOrRole: GuildMember | Role, - checkAdmin?: boolean, - ): Readonly; - public permissionsFor( - memberOrRole: GuildMemberResolvable | RoleResolvable, - checkAdmin?: boolean, - ): Readonly | null; - public fetchOwner(options?: BaseFetchOptions): Promise; - public fetchStarterMessage( - options?: BaseFetchOptions, - ): Promise; - public setArchived( - archived?: boolean, - reason?: string, - ): Promise; - public setAutoArchiveDuration( - autoArchiveDuration: ThreadAutoArchiveDuration | 'MAX', - reason?: string, - ): Promise; - public setInvitable( - invitable?: boolean, - reason?: string, - ): Promise; - public setLocked(locked?: boolean, reason?: string): Promise; - public setName(name: string, reason?: string): Promise; - public setAppliedTags( - appliedTags: Snowflake[], - reason?: string, - ): Promise; - public pin(reason?: string): Promise; - public unpin(reason?: string): Promise; -} - -export class ThreadMember< - HasMemberData extends boolean = boolean, -> extends Base { - private constructor( - thread: ThreadChannel, - data?: RawThreadMemberData, - extra?: unknown, - ); - public flags: ThreadMemberFlags; - public readonly guildMember: HasMemberData extends true - ? GuildMember - : GuildMember | null; - public id: Snowflake; - public readonly joinedAt: Date | null; - public joinedTimestamp: number | null; - public readonly manageable: boolean; - private member: If; - public thread: ThreadChannel; - public readonly user: User | null; - public remove(reason?: string): Promise; -} - -export class ThreadMemberFlags extends BitField { - public static FLAGS: Record; - public static resolve( - bit?: BitFieldResolvable, - ): number; -} - -export class TOTP { - private static hex2dec(hex: string): number; - private static dec2hex(dec: number): string; - private static base32ToBuffer(str: string): ArrayBuffer; - private static asciiToBuffer(str: string): ArrayBuffer; - private static hex2buf(hex: string): ArrayBuffer; - private static buf2hex(buf: ArrayBuffer): string; - private static readonly base32: { [key: number]: number }; - private static readonly crypto: SubtleCrypto; - public static generate( - key: string, - options?: generateOptions, - ): Promise<{ otp: string; expires: number }>; -} - -export type TOTPAlgorithm = 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512'; -export type TOTPEncoding = 'hex' | 'ascii'; - -export interface generateOptions { - digits: number; - algorithm: TOTPAlgorithm; - encoding: TOTPEncoding; - period: number; - timestamp: number; -} - -export class Typing extends Base { - private constructor( - channel: TextBasedChannel, - user: PartialUser, - data?: RawTypingData, - ); - public channel: TextBasedChannel; - public user: PartialUser; - public startedTimestamp: number; - public readonly startedAt: Date; - public readonly guild: Guild | null; - public readonly member: GuildMember | null; - public inGuild(): this is this & { - channel: TextChannel | NewsChannel | ThreadChannel; - readonly guild: Guild; - }; -} - -export interface UserPrimaryGuild { - badge: string | null; - identityEnabled: boolean | null; - identityGuildId: Snowflake | null; - tag: string | null; -} - -export interface AvatarDecorationData { - asset: string; - skuId: Snowflake; -} - -export interface NameplateData { - asset: string; - label: string; - palette: NameplatePalette; - skuId: Snowflake; -} - -export interface Collectibles { - nameplate: NameplateData | null; -} - -export class User extends PartialTextBasedChannel(Base) { - protected constructor(client: Client, data: RawUserData); - private _equals(user: APIUser): boolean; - - public accentColor: number | null | undefined; - public avatar: string | null; - /** @deprecated Use {@link User.avatarDecorationData} instead */ - public readonly avatarDecoration: string | null; - public avatarDecorationData: AvatarDecorationData | null; - public banner: string | null | undefined; - public bannerColor: string | null | undefined; - public bot: boolean; - public readonly createdAt: Date; - public readonly createdTimestamp: number; - public collectibles: Collectibles | null; - public discriminator: string; - public readonly displayName: string; - public readonly defaultAvatarURL: string; - public readonly dmChannel: DMChannel | null; - public flags: Readonly | null; - public globalName: string | null; - public readonly hexAccentColor: HexColorString | null | undefined; - public id: Snowflake; - public readonly partial: false; - public system: boolean; - public readonly tag: string; - public username: string; - public readonly note: string | undefined; - public readonly voice?: VoiceState; - public readonly relationship: RelationshipTypes; - public readonly friendNickname: string | null | undefined; - public primaryGuild: UserPrimaryGuild | null; - /** @deprecated Use {@link User.primaryGuild} instead */ - public clan: PrimaryGuild | null; - public avatarURL(options?: ImageURLOptions): string | null; - public avatarDecorationURL(): string | null; - public bannerURL(options?: ImageURLOptions): string | null; - /** @deprecated Use {@link User.guildTagBadgeURL} instead */ - public clanBadgeURL(): string | null; - public guildTagBadgeURL(options?: ImageURLOptions): string | null; - public createDM(force?: boolean): Promise; - public deleteDM(): Promise; - public displayAvatarURL(options?: ImageURLOptions): string; - public equals(user: User): boolean; - public fetch(force?: boolean): Promise; - public setNote(note: string | null | undefined): Promise; - public toString(): UserMention; - public getProfile(guildId?: Snowflake): Promise; - public sendFriendRequest(): Promise; - public deleteRelationship(): Promise; -} - -export class UserContextMenuInteraction< - Cached extends CacheType = CacheType, -> extends ContextMenuInteraction { - public readonly targetUser: User; - public readonly targetMember: CacheTypeReducer< - Cached, - GuildMember, - APIInteractionGuildMember - >; - public inGuild(): this is UserContextMenuInteraction<'raw' | 'cached'>; - public inCachedGuild(): this is UserContextMenuInteraction<'cached'>; - public inRawGuild(): this is UserContextMenuInteraction<'raw'>; -} - -export class UserFlags extends BitField { - public static FLAGS: Record; - public static resolve( - bit?: BitFieldResolvable, - ): number; -} - -export class Util extends null { - private constructor(); - /** @deprecated When not using with `makeCache` use `Sweepers.archivedThreadSweepFilter` instead */ - public static archivedThreadSweepFilter( - lifetime?: number, - ): SweepFilter; - public static basename(path: string, ext?: string): string; - public static cleanContent(str: string, channel: TextBasedChannel): string; - /** @deprecated Use {@link MessageOptions.allowedMentions} to control mentions in a message instead. */ - public static removeMentions(str: string): string; - private static _removeMentions(str: string): string; - public static cloneObject(obj: unknown): unknown; - public static discordSort< - K, - V extends { rawPosition: number; id: Snowflake }, - >(collection: Collection): Collection; - public static escapeMarkdown( - text: string, - options?: EscapeMarkdownOptions, - ): string; - public static escapeCodeBlock(text: string): string; - public static escapeInlineCode(text: string): string; - public static escapeBold(text: string): string; - public static escapeItalic(text: string): string; - public static escapeUnderline(text: string): string; - public static escapeStrikethrough(text: string): string; - public static escapeSpoiler(text: string): string; - public static escapeEscape(text: string): string; - public static escapeHeading(text: string): string; - public static escapeBulletedList(text: string): string; - public static escapeNumberedList(text: string): string; - public static escapeMaskedLink(text: string): string; - public static cleanCodeBlockContent(text: string): string; - public static fetchRecommendedShards( - token: string, - options?: FetchRecommendedShardsOptions, - ): Promise; - public static flatten( - obj: unknown, - ...props: Record[] - ): unknown; - public static makeError(obj: MakeErrorOptions): Error; - public static makePlainError(err: Error): MakeErrorOptions; - public static mergeDefault(def: unknown, given: unknown): unknown; - public static moveElementInArray( - array: unknown[], - element: unknown, - newIndex: number, - offset?: boolean, - ): number; - public static parseEmoji( - text: string, - ): { animated: boolean; name: string; id: Snowflake | null } | null; - public static resolveColor(color: ColorResolvable): number; - public static resolvePartialEmoji( - emoji: EmojiIdentifierResolvable, - ): Partial | null; - public static verifyString( - data: string, - error?: typeof Error, - errorMessage?: string, - allowEmpty?: boolean, - ): string; - public static setPosition( - item: T, - position: number, - relative: boolean, - sorted: Collection, - route: unknown, - reason?: string, - ): Promise<{ id: Snowflake; position: number }[]>; - /** @deprecated This will be removed in the next major version. */ - public static splitMessage(text: string, options?: SplitOptions): string[]; - /** @deprecated This will be removed in the next major version. */ - public static resolveAutoArchiveMaxLimit( - guild: Guild, - ): Exclude; - public static calculateUserDefaultAvatarIndex(userId: Snowflake): number; -} - -export class Formatters extends null { - public static blockQuote: typeof blockQuote; - public static bold: typeof bold; - public static channelMention: typeof channelMention; - public static chatInputApplicationCommandMention< - N extends string, - G extends string, - S extends string, - I extends Snowflake, - >( - commandName: N, - subcommandGroupName: G, - subcommandName: S, - commandId: I, - ): ``; - public static chatInputApplicationCommandMention< - N extends string, - S extends string, - I extends Snowflake, - >(commandName: N, subcommandName: S, commandId: I): ``; - public static chatInputApplicationCommandMention< - N extends string, - I extends Snowflake, - >(commandName: N, commandId: I): ``; - public static codeBlock: typeof codeBlock; - public static formatEmoji: typeof formatEmoji; - public static hideLinkEmbed: typeof hideLinkEmbed; - public static hyperlink: typeof hyperlink; - public static inlineCode: typeof inlineCode; - public static italic: typeof italic; - public static quote: typeof quote; - public static roleMention: typeof roleMention; - public static spoiler: typeof spoiler; - public static strikethrough: typeof strikethrough; - public static time: typeof time; - public static TimestampStyles: typeof TimestampStyles; - public static TimestampStylesString: TimestampStylesString; - public static underscore: typeof underscore; - public static userMention: typeof userMention; -} - -export class VoiceChannel extends BaseGuildVoiceChannel { - /** @deprecated Use manageable instead */ - public readonly editable: boolean; - public readonly speakable: boolean; - public type: 'GUILD_VOICE'; -} - -export class VoiceChannelEffect { - private constructor( - data: GatewayVoiceChannelEffectSendDispatchData, - guild: Guild, - ); - public guild: Guild; - public channelId: Snowflake; - public userId: Snowflake; - public emoji: Emoji | null; - public animationType: VoiceChannelEffectSendAnimationType | null; - public animationId: number | null; - public soundId: Snowflake | number | null; - public soundVolume: number | null; - public get channel(): VoiceChannel | null; -} - -export class VoiceRegion { - private constructor(data: RawVoiceRegionData); - public custom: boolean; - public deprecated: boolean; - public id: string; - public name: string; - public optimal: boolean; - /** @deprecated This property is no longer being sent by the API. */ - public vip: boolean; - public toJSON(): unknown; -} - -export class VoiceState extends Base { - private constructor(guild: Guild, data: RawVoiceStateData); - public readonly channel: - | VoiceBasedChannel - | DMChannel - | GroupDMChannel - | null; - public channelId: Snowflake | null; - public readonly deaf: boolean | null; - public guild: Guild; - public id: Snowflake; - public readonly member: GuildMember | null; - public readonly user: User | null; - public readonly mute: boolean | null; - public selfDeaf: boolean | null; - public selfMute: boolean | null; - public serverDeaf: boolean | null; - public serverMute: boolean | null; - public sessionId: string | null; - public streaming: boolean; - public selfVideo: boolean | null; - public suppress: boolean; - public requestToSpeakTimestamp: number | null; - - public setDeaf(deaf?: boolean, reason?: string): Promise; - public setMute(mute?: boolean, reason?: string): Promise; - public disconnect(reason?: string): Promise; - public setChannel( - channel: GuildVoiceChannelResolvable | null, - reason?: string, - ): Promise; - public setRequestToSpeak(request?: boolean): Promise; - public setSuppressed(suppressed?: boolean): Promise; - public setStatus(status?: string): Promise; - public getPreview(): Promise; - public postPreview(base64Image: string): Promise; - public fetch(force?: boolean): Promise; -} - -export class Webhook extends WebhookMixin() { - private constructor(client: Client, data?: RawWebhookData); - public avatar: string; - public avatarURL(options?: StaticImageURLOptions): string | null; - public readonly channel: - | TextChannel - | VoiceChannel - | NewsChannel - | ForumChannel - | MediaChannel - | null; - public channelId: Snowflake; - public client: Client; - public guildId: Snowflake; - public name: string; - public owner: User | APIUser | null; - public sourceGuild: Guild | APIPartialGuild | null; - public sourceChannel: NewsChannel | APIPartialChannel | null; - public token: string | null; - public type: WebhookType; - public isIncoming(): this is this & { token: string }; - public isChannelFollower(): this is this & { - sourceGuild: Guild | APIPartialGuild; - sourceChannel: NewsChannel | APIPartialChannel; - }; -} - -export class WebhookClient extends WebhookMixin(BaseClient) { - public constructor(data: WebhookClientData, options?: WebhookClientOptions); - public client: this; - public options: WebhookClientOptions; - public token: string; - public editMessage( - message: MessageResolvable, - options: string | MessagePayload | WebhookEditMessageOptions, - ): Promise; - public fetchMessage( - message: Snowflake, - options?: WebhookFetchMessageOptions, - ): Promise; - /* tslint:disable:unified-signatures */ - /** @deprecated */ - public fetchMessage(message: Snowflake, cache?: boolean): Promise; - /* tslint:enable:unified-signatures */ - public send( - options: string | MessagePayload | WebhookMessageOptions, - ): Promise; -} - -export class WebSocketManager extends EventEmitter { - private constructor(client: Client); - private totalShards: number | string; - private shardQueue: Set; - private packetQueue: unknown[]; - private destroyed: boolean; - private reconnecting: boolean; - - public readonly client: Client; - public gateway: string | null; - public shards: Collection; - public status: Status; - public readonly ping: number; - - public on( - event: WSEventType, - listener: (data: any, shardId: number) => void, - ): this; - public once( - event: WSEventType, - listener: (data: any, shardId: number) => void, - ): this; - - private debug(message: string, shard?: WebSocketShard): void; - private connect(): Promise; - private createShards(): Promise; - private reconnect(): Promise; - public broadcast(packet: unknown): void; - private destroy(): void; - private handlePacket(packet?: unknown, shard?: WebSocketShard): boolean; - private checkShardsReady(): void; - private triggerClientReady(): void; -} - -export interface WebSocketShardEvents { - ready: []; - resumed: []; - invalidSession: []; - destroyed: []; - close: [event: CloseEvent]; - allReady: [unavailableGuilds?: Set]; -} - -export class WebSocketShard extends EventEmitter { - private constructor(manager: WebSocketManager, id: number); - private sequence: number; - private closeSequence: number; - private resumeURL: string | null; - private sessionId: string | null; - private lastPingTimestamp: number; - private lastHeartbeatAcked: boolean; - private ratelimit: { - queue: unknown[]; - total: number; - remaining: number; - time: 60e3; - timer: NodeJS.Timeout | null; - }; - private connection: WebSocket | null; - private helloTimeout: NodeJS.Timeout | null; - private eventsAttached: boolean; - private expectedGuilds: Set | null; - private readyTimeout: NodeJS.Timeout | null; - private closeEmitted: boolean; - private wsCloseTimeout: NodeJS.Timeout | null; - - public manager: WebSocketManager; - public id: number; - public status: Status; - public ping: number; - - private debug(message: string): void; - private connect(): Promise; - private onOpen(): void; - private onMessage(event: MessageEvent): void; - private onError(error: ErrorEvent | unknown): void; - private onClose(event: CloseEvent): void; - private onPacket(packet: unknown): void; - private checkReady(): void; - private setHelloTimeout(time?: number): void; - private setWsCloseTimeout(time?: number): void; - private setHeartbeatTimer(time: number): void; - private sendHeartbeat(): void; - private ackHeartbeat(): void; - private identify(): void; - private identifyNew(): void; - private identifyResume(): void; - private _send(data: unknown): void; - private processQueue(): void; - private destroy(destroyOptions?: { - closeCode?: number; - reset?: boolean; - emit?: boolean; - log?: boolean; - }): void; - private emitClose(event?: CloseEvent): void; - private _cleanupConnection(): void; - private _emitDestroyed(): void; - - public send(data: unknown, important?: boolean): void; - - public on( - event: K, - listener: (...args: WebSocketShardEvents[K]) => Awaitable, - ): this; - - public once( - event: K, - listener: (...args: WebSocketShardEvents[K]) => Awaitable, - ): this; -} - -export class Widget extends Base { - private constructor(client: Client, data: RawWidgetData); - private _patch(data: RawWidgetData): void; - public fetch(): Promise; - public id: Snowflake; - public name: string; - public instantInvite?: string; - public channels: Collection; - public members: Collection; - public presenceCount: number; -} - -export class WidgetMember extends Base { - private constructor(client: Client, data: RawWidgetMemberData); - public id: string; - public username: string; - public discriminator: string; - public avatar: string | null; - public status: PresenceStatus; - public deaf: boolean | null; - public mute: boolean | null; - public selfDeaf: boolean | null; - public selfMute: boolean | null; - public suppress: boolean | null; - public channelId: Snowflake | null; - public avatarURL: string; - public activity: WidgetActivity | null; -} - -export class WelcomeChannel extends Base { - private constructor(guild: Guild, data: RawWelcomeChannelData); - private _emoji: Omit; - public channelId: Snowflake; - public guild: Guild | InviteGuild; - public description: string; - public readonly channel: - | TextChannel - | NewsChannel - | StoreChannel - | ForumChannel - | MediaChannel - | null; - public readonly emoji: GuildEmoji | Emoji; -} - -export class WelcomeScreen extends Base { - private constructor(guild: Guild, data: RawWelcomeScreenData); - public readonly enabled: boolean; - public guild: Guild | InviteGuild; - public description: string | null; - public welcomeChannels: Collection; -} - -//#endregion - -//#region Constants - -export type EnumHolder = { [P in keyof T]: T[P] }; - -export type ExcludeEnum = Exclude< - keyof T | T[keyof T], - K | T[K] ->; - -export const Constants: { - ActivityTypes: EnumHolder; - APIErrors: APIErrors; - ApplicationCommandOptionTypes: EnumHolder< - typeof ApplicationCommandOptionTypes - >; - ApplicationCommandPermissionTypes: EnumHolder< - typeof ApplicationCommandPermissionTypes - >; - ApplicationCommandTypes: EnumHolder; - ApplicationRoleConnectionMetadataTypes: EnumHolder< - typeof ApplicationRoleConnectionMetadataTypes - >; - AutoModerationActionTypes: EnumHolder; - AutoModerationRuleEventTypes: EnumHolder; - AutoModerationRuleKeywordPresetTypes: EnumHolder< - typeof AutoModerationRuleKeywordPresetTypes - >; - AutoModerationRuleTriggerTypes: EnumHolder< - typeof AutoModerationRuleTriggerTypes - >; - ChannelTypes: EnumHolder; - ClientApplicationAssetTypes: ConstantsClientApplicationAssetTypes; - Colors: ConstantsColors; - DefaultMessageNotificationLevels: EnumHolder< - typeof DefaultMessageNotificationLevels - >; - Endpoints: { - CDN(root: string): { - AppAsset( - appId: Snowflake, - hash: string, - { - format, - size, - }: { format: AllowedImageFormat; size: AllowedImageSize }, - ): string; - AppIcon( - appId: Snowflake, - hash: string, - { - format, - size, - }: { format: AllowedImageFormat; size: AllowedImageSize }, - ): string; - Asset(name: string): string; - Avatar( - userId: Snowflake, - hash: string, - format: DynamicImageFormat, - size: AllowedImageSize, - dynamic: boolean, - ): string; - AvatarDecoration(hash: string): string; - GuildTagBadge(guildId: Snowflake, hash: string): string; - Banner( - id: Snowflake, - hash: string, - format: DynamicImageFormat, - size: AllowedImageSize, - dynamic: boolean, - ): string; - DefaultAvatar(index: number): string; - DiscoverySplash( - guildId: Snowflake, - hash: string, - format: AllowedImageFormat, - size: AllowedImageSize, - ): string; - Emoji(emojiId: Snowflake, format: DynamicImageFormat): string; - GDMIcon( - channelId: Snowflake, - hash: string, - format: AllowedImageFormat, - size: AllowedImageSize, - ): string; - GuildMemberAvatar( - guildId: Snowflake, - memberId: Snowflake, - hash: string, - format?: DynamicImageFormat, - size?: AllowedImageSize, - dynamic?: boolean, - ): string; - GuildMemberBanner( - guildId: Snowflake, - memberId: Snowflake, - hash: string, - format?: DynamicImageFormat, - size?: AllowedImageSize, - dynamic?: boolean, - ): string; - Icon( - guildId: Snowflake, - hash: string, - format: DynamicImageFormat, - size: AllowedImageSize, - dynamic: boolean, - ): string; - RoleIcon( - roleId: Snowflake, - hash: string, - format: AllowedImageFormat, - size: AllowedImageSize, - ): string; - Splash( - guildId: Snowflake, - hash: string, - format: AllowedImageFormat, - size: AllowedImageSize, - ): string; - Sticker(stickerId: Snowflake, stickerFormat: StickerFormatType): string; - StickerPackBanner( - bannerId: Snowflake, - format: AllowedImageFormat, - size: AllowedImageSize, - ): string; - TeamIcon( - teamId: Snowflake, - hash: string, - { - format, - size, - }: { format: AllowedImageFormat; size: AllowedImageSize }, - ): string; - GuildScheduledEventCover( - scheduledEventId: Snowflake, - coverHash: string, - format: AllowedImageFormat, - size: AllowedImageSize, - ): string; - }; - botGateway: string; - invite(root: string, code: string, eventId?: Snowflake): string; - scheduledEvent( - root: string, - guildId: Snowflake, - eventId: Snowflake, - ): string; - }; - Events: ConstantsEvents; - ExplicitContentFilterLevels: EnumHolder; - GuildScheduledEventEntityTypes: EnumHolder< - typeof GuildScheduledEventEntityTypes - >; - GuildScheduledEventPrivacyLevels: EnumHolder< - typeof GuildScheduledEventPrivacyLevels - >; - GuildScheduledEventStatuses: EnumHolder; - HolographicStyles: { - PRIMARY: 11_127_295; - SECONDARY: 16_759_788; - TERTIARY: 16_761_760; - }; - IntegrationExpireBehaviors: IntegrationExpireBehaviors[]; - SelectMenuComponentTypes: EnumHolder; - RelationshipTypes: EnumHolder; - MembershipStates: EnumHolder; - MessageButtonStyles: EnumHolder; - MessageComponentTypes: EnumHolder; - MessageTypes: MessageType[]; - MFALevels: EnumHolder; - NSFWLevels: EnumHolder; - Opcodes: ConstantsOpcodes; - VoiceOpcodes: ConstantsVoiceOpcodes; - OverwriteTypes: EnumHolder; - Package: { - [key: string]: unknown; - bugs: { url: string }; - dependencies: Record; - description: string; - devDependencies: Record; - engines: Record; - homepage: string; - keywords: string[]; - license: string; - main: string; - name: string; - repository: { type: string; url: string }; - scripts: Record; - types: string; - version: string; - }; - PartialTypes: { - [K in PartialTypes]: K; - }; - PremiumTiers: EnumHolder; - PrivacyLevels: EnumHolder; - ShardEvents: ConstantsShardEvents; - Status: ConstantsStatus; - StickerFormatTypes: EnumHolder; - StickerTypes: EnumHolder; - SweeperKeys: SweeperKey[]; - SystemMessageTypes: SystemMessageType[]; - TextBasedChannelTypes: TextBasedChannelTypes[]; - TextInputStyles: EnumHolder; - ThreadChannelTypes: ThreadChannelTypes[]; - UserAgent: string; - ciphers: string[]; - VerificationLevels: EnumHolder; - VideoQualityModes: EnumHolder; - VoiceBasedChannelTypes: VoiceBasedChannelTypes[]; - WebhookTypes: EnumHolder; - WSCodes: { - 1_000: 'WS_CLOSE_REQUESTED'; - 1_011: 'INTERNAL_ERROR'; - 4_004: 'TOKEN_INVALID'; - 4_010: 'SHARDING_INVALID'; - 4_011: 'SHARDING_REQUIRED'; - 4_013: 'INVALID_INTENTS'; - 4_014: 'DISALLOWED_INTENTS'; - }; - WSEvents: { - [K in WSEventType]: K; - }; -}; - -export const version: string; - -//#endregion - -//#region Managers - -export abstract class BaseManager { - protected constructor(client: Client); - public readonly client: Client; -} - -export abstract class DataManager extends BaseManager { - protected constructor(client: Client, holds: Constructable); - public readonly holds: Constructable; - public readonly cache: Collection; - public resolve(resolvable: Holds): Holds; - public resolve(resolvable: R): Holds | null; - public resolveId(resolvable: K | Holds): K; - public resolveId(resolvable: R): K | null; - public valueOf(): Collection; -} - -export abstract class CachedManager extends DataManager< - K, - Holds, - R -> { - protected constructor( - client: Client, - holds: Constructable, - iterable?: Iterable, - ); - private readonly _cache: Collection; - private _add( - data: unknown, - cache?: boolean, - { id, extras }?: { id: K; extras: unknown[] }, - ): Holds; -} - -export type ApplicationCommandDataResolvable = - | ApplicationCommandData - | RESTPostAPIApplicationCommandsJSONBody - | SlashCommandBuilder - | ContextMenuCommandBuilder; - -export class ApplicationCommandManager< - ApplicationCommandScope = ApplicationCommand<{ guild: GuildResolvable }>, - PermissionsOptionsExtras = { guild: GuildResolvable }, - PermissionsGuildType = null, -> extends CachedManager< - Snowflake, - ApplicationCommandScope, - ApplicationCommandResolvable -> { - protected constructor(client: Client, iterable?: Iterable); - public permissions: ApplicationCommandPermissionsManager< - { command?: ApplicationCommandResolvable } & PermissionsOptionsExtras, - { command: ApplicationCommandResolvable } & PermissionsOptionsExtras, - PermissionsOptionsExtras, - PermissionsGuildType, - null - >; - private commandPath({ - id, - guildId, - }: { - id?: Snowflake; - guildId?: Snowflake; - }): unknown; - public create( - command: ApplicationCommandDataResolvable, - guildId?: Snowflake, - ): Promise; - public delete( - command: ApplicationCommandResolvable, - guildId?: Snowflake, - ): Promise; - public edit( - command: ApplicationCommandResolvable, - data: Partial, - ): Promise; - public edit( - command: ApplicationCommandResolvable, - data: Partial, - guildId: Snowflake, - ): Promise; - public fetch( - id: Snowflake, - options: FetchApplicationCommandOptions & { guildId: Snowflake }, - ): Promise; - public fetch( - options: FetchApplicationCommandOptions, - ): Promise>; - public fetch( - id: Snowflake, - options?: FetchApplicationCommandOptions, - ): Promise; - public fetch( - id?: Snowflake, - options?: FetchApplicationCommandOptions, - ): Promise>; - public set( - commands: ApplicationCommandDataResolvable[], - ): Promise>; - public set( - commands: ApplicationCommandDataResolvable[], - guildId: Snowflake, - ): Promise>; - private static transformCommand( - command: ApplicationCommandDataResolvable, - ): RESTPostAPIApplicationCommandsJSONBody; -} - -export class ApplicationCommandPermissionsManager< - BaseOptions, - FetchSingleOptions, - FullPermissionsOptions, - GuildType, - CommandIdType, -> extends BaseManager { - private constructor(manager: ApplicationCommandManager | ApplicationCommand); - private manager: ApplicationCommandManager | ApplicationCommand; - - public client: Client; - public commandId: CommandIdType; - public guild: GuildType; - public guildId: Snowflake | null; - public add( - options: FetchSingleOptions & { - permissions: ApplicationCommandPermissionData[]; - }, - ): Promise; - public has( - options: FetchSingleOptions & { - permissionId: UserResolvable | RoleResolvable; - }, - ): Promise; - public fetch( - options: FetchSingleOptions, - ): Promise; - public fetch( - options: BaseOptions, - ): Promise>; - public remove( - options: - | (FetchSingleOptions & { - users: UserResolvable | UserResolvable[]; - roles?: RoleResolvable | RoleResolvable[]; - }) - | (FetchSingleOptions & { - users?: UserResolvable | UserResolvable[]; - roles: RoleResolvable | RoleResolvable[]; - }), - ): Promise; - public set( - options: FetchSingleOptions & { - permissions: ApplicationCommandPermissionData[]; - }, - ): Promise; - public set( - options: FullPermissionsOptions & { - fullPermissions: GuildApplicationCommandPermissionData[]; - }, - ): Promise>; - private permissionsPath(guildId: Snowflake, commandId?: Snowflake): unknown; - private static transformPermissions( - permissions: ApplicationCommandPermissionData, - received: true, - ): Omit & { - type: keyof ApplicationCommandPermissionTypes; - }; - private static transformPermissions( - permissions: ApplicationCommandPermissionData, - ): APIApplicationCommandPermission; -} - -export class BaseGuildEmojiManager extends CachedManager< - Snowflake, - GuildEmoji, - EmojiResolvable -> { - protected constructor(client: Client, iterable?: Iterable); - public resolveIdentifier(emoji: EmojiIdentifierResolvable): string | null; -} - -export class ChannelManager extends CachedManager< - Snowflake, - AnyChannel, - ChannelResolvable -> { - private constructor(client: Client, iterable: Iterable); - public fetch( - id: Snowflake, - options?: FetchChannelOptions, - ): Promise; - public createGroupDM(recipients?: UserResolvable[]): Promise; -} - -export class RelationshipManager extends BaseManager { - constructor( - client: Client, - data: { - user: RawUserData; - type: RelationshipTypes; - since?: string; - nickname: string | null | undefined; - id: Snowflake; - }[], - ); - public cache: Collection; - public friendNicknames: Collection; - public sinceCache: Collection; - public readonly friendCache: Collection; - public readonly blockedCache: Collection; - public readonly incomingCache: Collection; - public readonly outgoingCache: Collection; - public toJSON(): { - type: RelationshipTypes; - since: string; - nickname: string | null | undefined; - id: Snowflake; - }[]; - public resolveId(user: UserResolvable): Snowflake | undefined; - public fetch( - user?: UserResolvable, - options?: BaseFetchOptions, - ): Promise; - public deleteRelationship(user: UserResolvable): Promise; - public sendFriendRequest(options: UserResolvable): Promise; - public addFriend(user: UserResolvable): Promise; - public setNickname( - user: UserResolvable, - nickname: string | null | undefined, - ): Promise; - public addBlocked(user: UserResolvable): Promise; -} - -export class UserNoteManager extends BaseManager { - constructor(client: Client, users: { [key: Snowflake]: string }[]); - public cache: Collection; - private _reload(data: { [key: Snowflake]: string }): this; - public updateNote( - id: Snowflake, - note: string | null | undefined, - ): Promise; - public fetch( - user: UserResolvable, - options?: BaseFetchOptions, - ): Promise; -} - -export type FetchGuildApplicationCommandFetchOptions = Omit< - FetchApplicationCommandOptions, - 'guildId' ->; - -export class ClientUserSettingManager extends BaseManager { - private constructor(client: Client); - public readonly raw: RawUserSettingsData; - public locale?: string; - public activityDisplay?: boolean; - public allowDMsFromGuild?: boolean; - public displayImage?: boolean; - public linkedImageDisplay?: boolean; - public autoplayGIF?: boolean; - public previewLink?: boolean; - public animatedEmoji?: boolean; - public allowTTS?: boolean; - public compactMode?: boolean; - public convertEmoticons?: boolean; - public DMScanLevel?: 0 | 1 | 2; - public theme?: 'dark' | 'light'; - public developerMode?: boolean; - public afkTimeout?: number; - public stickerAnimationMode?: 0 | 1 | 2; - public showEmojiReactions?: boolean; - public disableDMfromGuilds: Collection; - public fetch(): Promise; - public edit(data: Partial): Promise; - public toggleCompactMode(): Promise; - public setTheme(value: 'dark' | 'light'): Promise; - public setCustomStatus( - value?: CustomStatusOption | CustomStatus, - ): Promise; - public restrictedGuilds(status: boolean): Promise; - public addRestrictedGuild(guildId: GuildResolvable): Promise; - public removeRestrictedGuild(guildId: GuildResolvable): Promise; -} - -export class GuildSettingManager extends BaseManager { - private constructor(guild: Guild); - public readonly raw?: RawGuildSettingsData; - public suppressEveryone?: boolean; - public suppressRoles?: boolean; - public muteScheduledEvents?: boolean; - public messageNotifications?: number; - public flags?: number; - public mobilePush?: boolean; - public muted?: boolean; - public muteConfig?: MuteConfigData; - public hideMutedChannels?: boolean; - public channelOverrides?: object[]; - public notifyHighlights?: number; - public version?: number; - public guildId?: Snowflake; - public readonly guild?: Guild; - public edit(data: Partial): Promise; -} - -export interface CustomStatusOption { - text?: string | null; - expires_at?: string | null; - emoji?: EmojiIdentifierResolvable | null; - status?: PresenceStatusData | null; -} - -// Source: https://luna.gitlab.io/discord-unofficial-docs/user_settings.html -export interface RawUserSettingsData { - afk_timeout?: number; - allow_accessibility_detection?: boolean; - animate_emoji?: boolean; - animate_stickers?: number; - contact_sync_enabled?: boolean; - convert_emoticons?: boolean; - custom_status?: { - text?: string; - expires_at?: string | null; - emoji_name?: string; - emoji_id?: Snowflake | null; - }; - default_guilds_restricted?: boolean; - detect_platform_accounts?: boolean; - developer_mode?: boolean; - disable_games_tab?: boolean; - enable_tts_command?: boolean; - explicit_content_filter?: number; - friend_discovery_flags?: number; - friend_source_flags?: { - all?: boolean; - mutual_friends?: boolean; - mututal_guilds?: boolean; - }; - gif_auto_play?: boolean; - guild_folders?: { id?: Snowflake; guild_ids?: Snowflake[]; name?: string }[]; - guild_positions?: number[]; - inline_attachment_media?: boolean; - inline_embed_media?: boolean; - locale?: string; - message_display_compact?: boolean; - native_phone_integration_enabled?: boolean; - render_embeds?: boolean; - render_reactions?: boolean; - restricted_guilds?: any[]; - show_current_game?: boolean; - status?: PresenceStatusData; - stream_notifications_enabled?: boolean; - theme?: 'dark' | 'light'; - timezone_offset?: number; - view_nsfw_guilds?: boolean; -} - -export interface RawGuildSettingsData { - guild_id: Snowflake; - suppress_everyone: boolean; - suppress_roles: boolean; - mute_scheduled_events: boolean; - message_notifications: 2; - flags: 0; - mobile_push: boolean; - muted: boolean; - mute_config?: RawMuteConfigData; - hide_muted_channels: boolean; - channel_overrides: RawGuildChannelSettingsData[]; - notify_highlights: number; - version: number; -} - -export interface RawGuildChannelSettingsData { - channel_id: Snowflake; - message_notifications: number; - muted: boolean; - mute_config?: RawMuteConfigData; - collapsed: boolean; -} - -export interface RawMuteConfigData { - end_time: string; - selected_time_window: number; -} - -export interface MuteConfigData { - endTime: Date; - selectedTimeWindow: number; -} - -export type MappedGuildChannelTypes = EnumValueMapped< - typeof ChannelTypes, - { - GUILD_CATEGORY: CategoryChannel; - } -> & - MappedChannelCategoryTypes; - -export type GuildChannelTypes = - | CategoryChannelTypes - | ChannelTypes.GUILD_CATEGORY - | 'GUILD_CATEGORY'; - -export class GuildChannelManager extends CachedManager< - Snowflake, - GuildBasedChannel, - GuildChannelResolvable -> { - private constructor(guild: Guild, iterable?: Iterable); - public readonly channelCountWithoutThreads: number; - public guild: Guild; - - public create< - T extends Exclude< - GuildChannelTypes, - 'GUILD_STORE' | ChannelTypes.GUILD_STORE - >, - >( - name: string, - options: GuildChannelCreateOptions & { type: T }, - ): Promise; - - /** @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/6309018858647) for more information */ - public create( - name: string, - options: GuildChannelCreateOptions & { - type: 'GUILD_STORE' | ChannelTypes.GUILD_STORE; - }, - ): Promise; - public create( - name: string, - options?: GuildChannelCreateOptions, - ): Promise; - public createWebhook( - channel: GuildChannelResolvable, - name: string, - options?: - | TextChannel - | NewsChannel - | VoiceChannel - | StageChannel - | ForumChannel - | MediaChannel - | Snowflake, - ): Promise; - public addFollower( - channel: NewsChannel | Snowflake, - targetChannel: TextChannelResolvable, - reason?: string, - ): Promise; - public edit( - channel: GuildChannelResolvable, - data: ChannelData, - reason?: string, - ): Promise; - public fetch( - id: Snowflake, - options?: BaseFetchOptions, - ): Promise; - public fetch( - id?: undefined, - options?: BaseFetchOptions, - ): Promise>; - public fetchWebhooks( - channel: GuildChannelResolvable, - ): Promise>; - public setPosition( - channel: GuildChannelResolvable, - position: number, - options?: SetChannelPositionOptions, - ): Promise; - public setPositions( - channelPositions: readonly ChannelPosition[], - ): Promise; - public delete( - channel: GuildChannelResolvable, - reason?: string, - ): Promise; -} - -export class GuildEmojiManager extends BaseGuildEmojiManager { - private constructor(guild: Guild, iterable?: Iterable); - public guild: Guild; - public create( - attachment: BufferResolvable | Base64Resolvable, - name: string, - options?: GuildEmojiCreateOptions, - ): Promise; - public fetch(id: Snowflake, options?: BaseFetchOptions): Promise; - public fetch( - id?: undefined, - options?: BaseFetchOptions, - ): Promise>; - public fetchAuthor(emoji: EmojiResolvable): Promise; - public delete(emoji: EmojiResolvable, reason?: string): Promise; - public edit( - emoji: EmojiResolvable, - data: GuildEmojiEditData, - reason?: string, - ): Promise; -} - -export class GuildEmojiRoleManager extends DataManager< - Snowflake, - Role, - RoleResolvable -> { - private constructor(emoji: GuildEmoji); - public emoji: GuildEmoji; - public guild: Guild; - public add( - roleOrRoles: - | RoleResolvable - | readonly RoleResolvable[] - | Collection, - ): Promise; - public set( - roles: readonly RoleResolvable[] | Collection, - ): Promise; - public remove( - roleOrRoles: - | RoleResolvable - | readonly RoleResolvable[] - | Collection, - ): Promise; -} - -export class GuildManager extends CachedManager< - Snowflake, - Guild, - GuildResolvable -> { - private constructor(client: Client, iterable?: Iterable); - public create(name: string, options?: GuildCreateOptions): Promise; - public fetch(options: Snowflake | FetchGuildOptions): Promise; - public fetch( - options?: FetchGuildsOptions, - ): Promise>; - public setIncidentActions( - guild: GuildResolvable, - incidentActions: IncidentActionsEditOptions, - ): Promise; -} - -export class GuildMemberManager extends CachedManager< - Snowflake, - GuildMember, - GuildMemberResolvable -> { - private constructor(guild: Guild, iterable?: Iterable); - public guild: Guild; - public get me(): GuildMember | null; - public add( - user: UserResolvable, - options: AddGuildMemberOptions & { fetchWhenExisting: false }, - ): Promise; - public add( - user: UserResolvable, - options: AddGuildMemberOptions, - ): Promise; - public addRole( - user: UserResolvable, - role: RoleResolvable, - reason?: string, - ): Promise; - public ban( - user: UserResolvable, - options?: BanOptions, - ): Promise; - public edit( - user: UserResolvable, - data: GuildMemberEditData, - reason?: string, - ): Promise; - public fetch( - options: - | UserResolvable - | FetchMemberOptions - | (FetchMembersOptions & { user: UserResolvable }), - ): Promise; - public fetch( - options?: FetchMembersOptions, - ): Promise>; - public fetchMe(options?: BaseFetchOptions): Promise; - public kick( - user: UserResolvable, - reason?: string, - ): Promise; - public prune( - options: GuildPruneMembersOptions & { dry?: false; count: false }, - ): Promise; - public prune(options?: GuildPruneMembersOptions): Promise; - public removeRole( - user: UserResolvable, - role: RoleResolvable, - reason?: string, - ): Promise; - public search( - options: GuildSearchMembersOptions, - ): Promise>; - public unban(user: UserResolvable, reason?: string): Promise; - public fetchByMemberSafety( - timeout?: number, - ): Promise>; - /** @deprecated This method will not be usable until an effective MFA implementation is in place. */ - public bulkBan( - users: Collection | readonly UserResolvable[], - options?: BulkBanOptions, - ): Promise; -} - -export class GuildBanManager extends CachedManager< - Snowflake, - GuildBan, - GuildBanResolvable -> { - private constructor(guild: Guild, iterable?: Iterable); - public guild: Guild; - public create( - user: UserResolvable, - options?: BanOptions, - ): Promise; - public fetch(options: UserResolvable | FetchBanOptions): Promise; - public fetch( - options?: FetchBansOptions, - ): Promise>; - public remove(user: UserResolvable, reason?: string): Promise; - /** @deprecated This method will not be usable until an effective MFA implementation is in place. */ - public bulkCreate( - users: Collection | readonly UserResolvable[], - options?: BulkBanOptions, - ): Promise; -} - -export class GuildInviteManager extends DataManager< - string, - Invite, - InviteResolvable -> { - private constructor(guild: Guild, iterable?: Iterable); - public guild: Guild; - public create( - channel: GuildInvitableChannelResolvable, - options?: CreateInviteOptions, - ): Promise; - public fetch(options: InviteResolvable | FetchInviteOptions): Promise; - public fetch( - options?: FetchInvitesOptions, - ): Promise>; - public delete(invite: InviteResolvable, reason?: string): Promise; -} - -export class GuildScheduledEventManager extends CachedManager< - Snowflake, - GuildScheduledEvent, - GuildScheduledEventResolvable -> { - private constructor( - guild: Guild, - iterable?: Iterable, - ); - public guild: Guild; - public create( - options: GuildScheduledEventCreateOptions, - ): Promise; - public fetch(): Promise>; - public fetch< - T extends - | GuildScheduledEventResolvable - | FetchGuildScheduledEventOptions - | FetchGuildScheduledEventsOptions, - >(options?: T): Promise>; - public edit< - S extends GuildScheduledEventStatus, - T extends GuildScheduledEventSetStatusArg, - >( - guildScheduledEvent: GuildScheduledEventResolvable, - options: GuildScheduledEventEditOptions, - ): Promise>; - public delete( - guildScheduledEvent: GuildScheduledEventResolvable, - ): Promise; - public fetchSubscribers( - guildScheduledEvent: GuildScheduledEventResolvable, - options?: T, - ): Promise>; -} - -export class GuildStickerManager extends CachedManager< - Snowflake, - Sticker, - StickerResolvable -> { - private constructor(guild: Guild, iterable?: Iterable); - public guild: Guild; - public create( - file: BufferResolvable | Stream | FileOptions | MessageAttachment, - name: string, - tags: string, - options?: GuildStickerCreateOptions, - ): Promise; - public edit( - sticker: StickerResolvable, - data?: GuildStickerEditData, - reason?: string, - ): Promise; - public delete(sticker: StickerResolvable, reason?: string): Promise; - public fetch(id: Snowflake, options?: BaseFetchOptions): Promise; - public fetch( - id?: Snowflake, - options?: BaseFetchOptions, - ): Promise>; - public fetchUser(sticker: StickerResolvable): Promise; -} - -export class GuildMemberRoleManager extends DataManager< - Snowflake, - Role, - RoleResolvable -> { - private constructor(member: GuildMember); - public readonly hoist: Role | null; - public readonly icon: Role | null; - public readonly color: Role | null; - public readonly highest: Role; - public readonly premiumSubscriberRole: Role | null; - public readonly botRole: Role | null; - public member: GuildMember; - public guild: Guild; - - public add( - roleOrRoles: - | RoleResolvable - | readonly RoleResolvable[] - | Collection, - reason?: string, - ): Promise; - public set( - roles: readonly RoleResolvable[] | Collection, - reason?: string, - ): Promise; - public remove( - roleOrRoles: - | RoleResolvable - | readonly RoleResolvable[] - | Collection, - reason?: string, - ): Promise; -} - -export class MessageManager extends CachedManager< - Snowflake, - Message, - MessageResolvable -> { - private constructor( - channel: TextBasedChannel, - iterable?: Iterable, - ); - public channel: TextBasedChannel; - public cache: Collection; - public crosspost(message: MessageResolvable): Promise; - public delete(message: MessageResolvable): Promise; - public edit( - message: MessageResolvable, - options: string | MessagePayload | MessageEditOptions, - ): Promise; - public fetch( - message: Snowflake, - options?: BaseFetchOptions, - ): Promise; - public fetch( - options?: ChannelLogsQueryOptions, - cacheOptions?: BaseFetchOptions, - ): Promise>; - public fetchPinned(cache?: boolean): Promise>; - public react( - message: MessageResolvable, - emoji: EmojiIdentifierResolvable, - burst?: boolean, - ): Promise; - public pin(message: MessageResolvable, reason?: string): Promise; - public unpin(message: MessageResolvable, reason?: string): Promise; - public search(options: MessageSearchOptions): Promise; - public endPoll(messageId: Snowflake): Promise; - public fetchPollAnswerVoters( - options: FetchPollAnswerVotersOptions, - ): Promise>; -} - -export interface MessageSearchOptions { - authors: UserResolvable[]; - content: string; - mentions: UserResolvable[]; - has: ('link' | 'embed' | 'file' | 'video' | 'image' | 'sound' | 'sticker')[]; - maxId: Snowflake; - minId: Snowflake; - channels: TextChannelResolvable[]; - pinned: boolean; - nsfw: boolean; - offset: number; - limit: number; - sortBy: 'relevant' | 'timestamp'; - sortOrder: 'asc' | 'desc'; -} - -export interface MessageSearchResult { - messages: Collection; - total: number; -} - -export class PermissionOverwriteManager extends CachedManager< - Snowflake, - PermissionOverwrites, - PermissionOverwriteResolvable -> { - private constructor( - client: Client, - iterable?: Iterable, - ); - public set( - overwrites: - | readonly OverwriteResolvable[] - | Collection, - reason?: string, - ): Promise; - private upsert( - userOrRole: RoleResolvable | UserResolvable, - options: PermissionOverwriteOptions, - overwriteOptions?: GuildChannelOverwriteOptions, - existing?: PermissionOverwrites, - ): Promise; - public create( - userOrRole: RoleResolvable | UserResolvable, - options: PermissionOverwriteOptions, - overwriteOptions?: GuildChannelOverwriteOptions, - ): Promise; - public edit( - userOrRole: RoleResolvable | UserResolvable, - options: PermissionOverwriteOptions, - overwriteOptions?: GuildChannelOverwriteOptions, - ): Promise; - public delete( - userOrRole: RoleResolvable | UserResolvable, - reason?: string, - ): Promise; -} - -export class PresenceManager extends CachedManager< - Snowflake, - Presence, - PresenceResolvable -> { - private constructor(client: Client, iterable?: Iterable); - public fetch(): Promise>; -} - -export class ReactionManager extends CachedManager< - Snowflake | string, - MessageReaction, - MessageReactionResolvable -> { - private constructor( - message: Message, - iterable?: Iterable, - ); - public message: Message; - public removeAll(): Promise; -} - -export class ReactionUserManager extends CachedManager< - Snowflake, - User, - UserResolvable -> { - private constructor( - reaction: MessageReaction, - iterable?: Iterable, - ); - public reaction: MessageReaction; - public fetch( - options?: FetchReactionUsersOptions, - ): Promise>; - public remove(user?: UserResolvable): Promise; -} - -export class RoleManager extends CachedManager< - Snowflake, - Role, - RoleResolvable -> { - private constructor(guild: Guild, iterable?: Iterable); - public readonly everyone: Role; - public readonly highest: Role; - public guild: Guild; - public readonly premiumSubscriberRole: Role | null; - public botRoleFor(user: UserResolvable): Role | null; - public fetch(id: Snowflake, options?: BaseFetchOptions): Promise; - public fetch( - id?: undefined, - options?: BaseFetchOptions, - ): Promise>; - public create(options?: CreateRoleOptions): Promise; - public edit( - role: RoleResolvable, - options: RoleData, - reason?: string, - ): Promise; - public delete(role: RoleResolvable, reason?: string): Promise; - public setPosition( - role: RoleResolvable, - position: number, - options?: SetRolePositionOptions, - ): Promise; - public setPositions(rolePositions: readonly RolePosition[]): Promise; - public comparePositions(role1: RoleResolvable, role2: RoleResolvable): number; - public fetchMemberCounts(): Promise>; - public fetchMemberIds(role: RoleResolvable): Promise; -} - -export class StageInstanceManager extends CachedManager< - Snowflake, - StageInstance, - StageInstanceResolvable -> { - private constructor(guild: Guild, iterable?: Iterable); - public guild: Guild; - public create( - channel: StageChannelResolvable, - options: StageInstanceCreateOptions, - ): Promise; - public fetch( - channel: StageChannelResolvable, - options?: BaseFetchOptions, - ): Promise; - public edit( - channel: StageChannelResolvable, - options: StageInstanceEditOptions, - ): Promise; - public delete(channel: StageChannelResolvable): Promise; -} - -export class ThreadManager extends CachedManager< - Snowflake, - ThreadChannel, - ThreadChannelResolvable -> { - protected constructor( - channel: TextChannel | NewsChannel, - iterable?: Iterable, - ); - public channel: TextChannel | NewsChannel; - public fetch( - options: ThreadChannelResolvable, - cacheOptions?: BaseFetchOptions, - ): Promise; - public fetch( - options?: FetchChannelThreadsOptions, - cacheOptions?: { cache?: boolean }, - ): Promise; - public fetchArchived( - options?: FetchChannelThreadsOptions, - cache?: boolean, - ): Promise; - public fetchActive( - cache?: boolean, - options?: FetchChannelThreadsOptions, - ): Promise; -} - -export class GuildTextThreadManager extends ThreadManager { - public create( - options: GuildTextThreadCreateOptions, - ): Promise; -} - -export class GuildForumThreadManager extends ThreadManager { - public create(options: GuildForumThreadCreateOptions): Promise; -} - -export class ThreadMemberManager extends CachedManager< - Snowflake, - ThreadMember, - ThreadMemberResolvable -> { - private constructor( - thread: ThreadChannel, - iterable?: Iterable, - ); - public thread: ThreadChannel; - public get me(): ThreadMember | null; - public add( - member: UserResolvable | '@me', - reason?: string, - ): Promise; - public fetch( - options?: FetchThreadMembersWithoutGuildMemberDataOptions, - ): Promise>; - public fetch( - member: ThreadMember, - options?: FetchMemberOptions, - ): Promise>; - public fetch( - member: Snowflake, - options: FetchThreadMemberOptions & { withMember: true }, - ): Promise>; - public fetch( - options: FetchThreadMembersWithGuildMemberDataOptions, - ): Promise>>; - public fetch( - member: UserResolvable, - options?: FetchThreadMemberOptions, - ): Promise; - - /** @deprecated Use `fetch(options)` instead. */ - public fetch( - cache: boolean, - options?: FetchThreadMembersOptions, - ): Promise>; - - public fetch( - x: undefined, - options: FetchThreadMembersWithGuildMemberDataOptions, - ): Promise>>; - public fetch( - x: undefined, - options?: FetchThreadMembersWithoutGuildMemberDataOptions, - ): Promise>; - - public fetchMe(options?: BaseFetchOptions): Promise; - public remove(id: Snowflake | '@me', reason?: string): Promise; -} - -export class UserManager extends CachedManager< - Snowflake, - User, - UserResolvable -> { - private constructor(client: Client, iterable?: Iterable); - private dmChannel(userId: Snowflake): DMChannel | null; - public createDM( - user: UserResolvable, - options?: BaseFetchOptions, - ): Promise; - public deleteDM(user: UserResolvable): Promise; - public fetch(user: UserResolvable, options?: BaseFetchOptions): Promise; - public send( - user: UserResolvable, - options: string | MessagePayload | MessageOptions, - ): Promise; -} - -export class VoiceStateManager extends CachedManager< - Snowflake, - VoiceState, - typeof VoiceState -> { - private constructor(guild: Guild, iterable?: Iterable); - public guild: Guild; - public fetch( - member: GuildMemberResolvable | '@me', - options?: BaseFetchOptions, - ): Promise; -} - -//#endregion - -//#region Mixins - -// Model the TextBasedChannel mixin system, allowing application of these fields -// to the classes that use these methods without having to manually add them -// to each of those classes - -export type Constructable = abstract new (...args: any[]) => T; -export function PartialTextBasedChannel( - Base?: Constructable, -): Constructable; -export function TextBasedChannelMixin< - T, - I extends keyof TextBasedChannelFields = never, ->( - Base?: Constructable, - ignore?: I[], -): Constructable>; - -export interface PartialTextBasedChannelFields { - send(options: string | MessagePayload | MessageOptions): Promise; -} - -export interface TextBasedChannelFields extends PartialTextBasedChannelFields { - lastMessageId: Snowflake | null; - readonly lastMessage: Message | null; - lastPinTimestamp: number | null; - readonly lastPinAt: Date | null; - messages: MessageManager; - awaitMessages( - options?: AwaitMessagesOptions, - ): Promise>; - createMessageCollector(options?: MessageCollectorOptions): MessageCollector; - createWebhook( - name: string, - options?: ChannelWebhookCreateOptions, - ): Promise; - setRateLimitPerUser(rateLimitPerUser: number, reason?: string): Promise; - setNSFW(nsfw?: boolean, reason?: string): Promise; - fetchWebhooks(): Promise>; - sendTyping(): Promise< - | { message_send_cooldown_ms: number; thread_create_cooldown_ms: number } - | undefined - >; - sendSlash( - target: UserResolvable, - commandName: string, - ...args: any[] - ): Promise; -} - -export function PartialWebhookMixin( - Base?: Constructable, -): Constructable; -export function WebhookMixin( - Base?: Constructable, -): Constructable; - -export interface PartialWebhookFields { - id: Snowflake; - readonly url: string; - deleteMessage( - message: MessageResolvable | APIMessage | '@original', - threadId?: Snowflake, - ): Promise; - editMessage( - message: MessageResolvable | '@original', - options: string | MessagePayload | WebhookEditMessageOptions, - ): Promise; - fetchMessage( - message: Snowflake | '@original', - options?: WebhookFetchMessageOptions, - ): Promise; - /* tslint:disable:unified-signatures */ - /** @deprecated */ - fetchMessage( - message: Snowflake | '@original', - cache?: boolean, - ): Promise; - /* tslint:enable:unified-signatures */ - send( - options: string | MessagePayload | Omit, - ): Promise; -} - -export interface WebhookFields extends PartialWebhookFields { - readonly createdAt: Date; - readonly createdTimestamp: number; - delete(reason?: string): Promise; - edit(options: WebhookEditData, reason?: string): Promise; - sendSlackMessage(body: unknown): Promise; -} - -//#endregion - -//#region Typedefs - -export type ActivityFlagsString = - | 'INSTANCE' - | 'JOIN' - | 'SPECTATE' - | 'JOIN_REQUEST' - | 'SYNC' - | 'PLAY' - | 'PARTY_PRIVACY_FRIENDS' - | 'PARTY_PRIVACY_VOICE_CHANNEL' - | 'EMBEDDED'; - -export type PurchasedFlagsString = - | 'NITRO_CLASSIC' - | 'NITRO' - | 'GUILD_BOOST' - | 'NITRO_BASIC'; - -export type PremiumUsageFlagsString = - | 'PREMIUM_DISCRIMINATOR' - | 'ANIMATED_AVATAR' - | 'PROFILE_BANNER'; - -export type InviteFlagsString = - | 'IS_GUEST_INVITE' - | 'IS_VIEWED' - | 'IS_ENHANCED' - | 'IS_APPLICATION_BYPASS'; - -export type ActivitiesOptions = Omit; - -export interface ActivityOptions { - name: string; - state?: string; - url?: string; - type?: ActivityType; - shardId?: number | readonly number[]; -} - -export type ActivityPlatform = - | 'desktop' - | 'samsung' - | 'xbox' - | 'ios' - | 'android' - | 'embedded' - | 'ps4' - | 'ps5'; - -export type ActivityType = keyof typeof ActivityTypes; - -export interface AddGuildMemberOptions { - accessToken: string; - nick?: string; - roles?: Collection | RoleResolvable[]; - mute?: boolean; - deaf?: boolean; - force?: boolean; - fetchWhenExisting?: boolean; -} - -export type AllowedImageFormat = 'webp' | 'png' | 'jpg' | 'jpeg'; - -export type AllowedImageSize = - | 16 - | 32 - | 56 - | 64 - | 96 - | 128 - | 256 - | 300 - | 512 - | 600 - | 1024 - | 2048 - | 4096; - -export type AllowedPartial = - | User - | Channel - | GuildMember - | Message - | MessageReaction - | GuildScheduledEvent - | ThreadMember; - -export type AllowedThreadTypeForNewsChannel = 'GUILD_NEWS_THREAD' | 10; - -export type AllowedThreadTypeForTextChannel = - | 'GUILD_PUBLIC_THREAD' - | 'GUILD_PRIVATE_THREAD' - | 11 - | 12; - -export interface ClientApplicationInstallParams { - scopes: InviteScope[]; - permissions: Readonly; -} - -export interface APIErrors { - UNKNOWN_ACCOUNT: 10001; - UNKNOWN_APPLICATION: 10002; - UNKNOWN_CHANNEL: 10003; - UNKNOWN_GUILD: 10004; - UNKNOWN_INTEGRATION: 10005; - UNKNOWN_INVITE: 10006; - UNKNOWN_MEMBER: 10007; - UNKNOWN_MESSAGE: 10008; - UNKNOWN_OVERWRITE: 10009; - UNKNOWN_PROVIDER: 10010; - UNKNOWN_ROLE: 10011; - UNKNOWN_TOKEN: 10012; - UNKNOWN_USER: 10013; - UNKNOWN_EMOJI: 10014; - UNKNOWN_WEBHOOK: 10015; - UNKNOWN_WEBHOOK_SERVICE: 10016; - UNKNOWN_SESSION: 10020; - UNKNOWN_BAN: 10026; - UNKNOWN_SKU: 10027; - UNKNOWN_STORE_LISTING: 10028; - UNKNOWN_ENTITLEMENT: 10029; - UNKNOWN_BUILD: 10030; - UNKNOWN_LOBBY: 10031; - UNKNOWN_BRANCH: 10032; - UNKNOWN_STORE_DIRECTORY_LAYOUT: 10033; - UNKNOWN_REDISTRIBUTABLE: 10036; - UNKNOWN_GIFT_CODE: 10038; - UNKNOWN_STREAM: 10049; - UNKNOWN_PREMIUM_SERVER_SUBSCRIBE_COOLDOWN: 10050; - UNKNOWN_GUILD_TEMPLATE: 10057; - UNKNOWN_DISCOVERABLE_SERVER_CATEGORY: 10059; - UNKNOWN_STICKER: 10060; - UNKNOWN_INTERACTION: 10062; - UNKNOWN_APPLICATION_COMMAND: 10063; - UNKNOWN_APPLICATION_COMMAND_PERMISSIONS: 10066; - UNKNOWN_STAGE_INSTANCE: 10067; - UNKNOWN_GUILD_MEMBER_VERIFICATION_FORM: 10068; - UNKNOWN_GUILD_WELCOME_SCREEN: 10069; - UNKNOWN_GUILD_SCHEDULED_EVENT: 10070; - UNKNOWN_GUILD_SCHEDULED_EVENT_USER: 10071; - BOT_PROHIBITED_ENDPOINT: 20001; - BOT_ONLY_ENDPOINT: 20002; - CANNOT_SEND_EXPLICIT_CONTENT: 20009; - NOT_AUTHORIZED: 20012; - SLOWMODE_RATE_LIMIT: 20016; - ACCOUNT_OWNER_ONLY: 20018; - ANNOUNCEMENT_EDIT_LIMIT_EXCEEDED: 20022; - CHANNEL_HIT_WRITE_RATELIMIT: 20028; - SERVER_HIT_WRITE_RATELIMIT: 20029; - CONTENT_NOT_ALLOWED: 20031; - GUILD_PREMIUM_LEVEL_TOO_LOW: 20035; - MAXIMUM_GUILDS: 30001; - MAXIMUM_FRIENDS: 30002; - MAXIMUM_PINS: 30003; - MAXIMUM_RECIPIENTS: 30004; - MAXIMUM_ROLES: 30005; - MAXIMUM_WEBHOOKS: 30007; - MAXIMUM_EMOJIS: 30008; - MAXIMUM_REACTIONS: 30010; - MAXIMUM_CHANNELS: 30013; - MAXIMUM_ATTACHMENTS: 30015; - MAXIMUM_INVITES: 30016; - MAXIMUM_ANIMATED_EMOJIS: 30018; - MAXIMUM_SERVER_MEMBERS: 30019; - MAXIMUM_NUMBER_OF_SERVER_CATEGORIES: 30030; - GUILD_ALREADY_HAS_TEMPLATE: 30031; - MAXIMUM_THREAD_PARTICIPANTS: 30033; - MAXIMUM_NON_GUILD_MEMBERS_BANS: 30035; - MAXIMUM_BAN_FETCHES: 30037; - MAXIMUM_NUMBER_OF_UNCOMPLETED_GUILD_SCHEDULED_EVENTS_REACHED: 30038; - MAXIMUM_NUMBER_OF_STICKERS_REACHED: 30039; - MAXIMUM_PRUNE_REQUESTS: 30040; - MAXIMUM_GUILD_WIDGET_SETTINGS_UPDATE: 30042; - MAXIMUM_NUMBER_OF_PREMIUM_EMOJIS: 30056; - UNAUTHORIZED: 40001; - ACCOUNT_VERIFICATION_REQUIRED: 40002; - DIRECT_MESSAGES_TOO_FAST: 40003; - REQUEST_ENTITY_TOO_LARGE: 40005; - FEATURE_TEMPORARILY_DISABLED: 40006; - USER_BANNED: 40007; - TARGET_USER_NOT_CONNECTED_TO_VOICE: 40032; - ALREADY_CROSSPOSTED: 40033; - MISSING_ACCESS: 50001; - INVALID_ACCOUNT_TYPE: 50002; - CANNOT_EXECUTE_ON_DM: 50003; - EMBED_DISABLED: 50004; - CANNOT_EDIT_MESSAGE_BY_OTHER: 50005; - CANNOT_SEND_EMPTY_MESSAGE: 50006; - CANNOT_MESSAGE_USER: 50007; - CANNOT_SEND_MESSAGES_IN_VOICE_CHANNEL: 50008; - CHANNEL_VERIFICATION_LEVEL_TOO_HIGH: 50009; - OAUTH2_APPLICATION_BOT_ABSENT: 50010; - MAXIMUM_OAUTH2_APPLICATIONS: 50011; - INVALID_OAUTH_STATE: 50012; - MISSING_PERMISSIONS: 50013; - INVALID_AUTHENTICATION_TOKEN: 50014; - NOTE_TOO_LONG: 50015; - INVALID_BULK_DELETE_QUANTITY: 50016; - CANNOT_PIN_MESSAGE_IN_OTHER_CHANNEL: 50019; - INVALID_OR_TAKEN_INVITE_CODE: 50020; - CANNOT_EXECUTE_ON_SYSTEM_MESSAGE: 50021; - CANNOT_EXECUTE_ON_CHANNEL_TYPE: 50024; - INVALID_OAUTH_TOKEN: 50025; - MISSING_OAUTH_SCOPE: 50026; - INVALID_WEBHOOK_TOKEN: 50027; - INVALID_ROLE: 50028; - INVALID_RECIPIENTS: 50033; - BULK_DELETE_MESSAGE_TOO_OLD: 50034; - INVALID_FORM_BODY: 50035; - INVITE_ACCEPTED_TO_GUILD_NOT_CONTAINING_BOT: 50036; - INVALID_API_VERSION: 50041; - FILE_UPLOADED_EXCEEDS_MAXIMUM_SIZE: 50045; - INVALID_FILE_UPLOADED: 50046; - CANNOT_SELF_REDEEM_GIFT: 50054; - INVALID_GUILD: 50055; - INVALID_MESSAGE_TYPE: 50068; - PAYMENT_SOURCE_REQUIRED: 50070; - CANNOT_DELETE_COMMUNITY_REQUIRED_CHANNEL: 50074; - INVALID_STICKER_SENT: 50081; - INVALID_OPERATION_ON_ARCHIVED_THREAD: 50083; - INVALID_THREAD_NOTIFICATION_SETTINGS: 50084; - PARAMETER_EARLIER_THAN_CREATION: 50085; - GUILD_NOT_AVAILABLE_IN_LOCATION: 50095; - GUILD_MONETIZATION_REQUIRED: 50097; - INSUFFICIENT_BOOSTS: 50101; - INVALID_JSON: 50109; - CANNOT_MIX_SUBSCRIPTION_AND_NON_SUBSCRIPTION_ROLES_FOR_EMOJI: 50144; - VOICE_MESSAGES_DO_NOT_SUPPORT_ADDITIONAL_CONTENT: 50159; - VOICE_MESSAGES_MUST_HAVE_A_SINGLE_AUDIO_ATTACHMENT: 50160; - VOICE_MESSAGES_MUST_HAVE_SUPPORTING_METADATA: 50161; - VOICE_MESSAGES_CANNOT_BE_EDITED: 50162; - YOU_CANNOT_SEND_VOICE_MESSAGES_IN_THIS_CHANNEL: 50173; - CANNOT_CONVERT_PREMIUM_EMOJI_TO_NORMAL_EMOJI: 50145; - TWO_FACTOR_REQUIRED: 60003; - NO_USERS_WITH_DISCORDTAG_EXIST: 80004; - REACTION_BLOCKED: 90001; - RESOURCE_OVERLOADED: 130000; - STAGE_ALREADY_OPEN: 150006; - CANNOT_REPLY_WITHOUT_READ_MESSAGE_HISTORY_PERMISSION: 160002; - MESSAGE_ALREADY_HAS_THREAD: 160004; - THREAD_LOCKED: 160005; - MAXIMUM_ACTIVE_THREADS: 160006; - MAXIMUM_ACTIVE_ANNOUNCEMENT_THREADS: 160007; - INVALID_JSON_FOR_UPLOADED_LOTTIE_FILE: 170001; - UPLOADED_LOTTIES_CANNOT_CONTAIN_RASTERIZED_IMAGES: 170002; - STICKER_MAXIMUM_FRAMERATE_EXCEEDED: 170003; - STICKER_FRAME_COUNT_EXCEEDS_MAXIMUM_OF_1000_FRAMES: 170004; - LOTTIE_ANIMATION_MAXIMUM_DIMENSIONS_EXCEEDED: 170005; - STICKER_FRAME_RATE_IS_TOO_SMALL_OR_TOO_LARGE: 170006; - STICKER_ANIMATION_DURATION_EXCEEDS_MAXIMUM_OF_5_SECONDS: 170007; - CANNOT_UPDATE_A_FINISHED_EVENT: 180000; - FAILED_TO_CREATE_STAGE_NEEDED_FOR_STAGE_EVENT: 180002; -} - -export interface APIRequest { - method: 'get' | 'post' | 'delete' | 'patch' | 'put'; - options: unknown; - path: string; - retries: number; - route: string; -} - -export interface ApplicationAsset { - name: string; - id: Snowflake; - type: 'BIG' | 'SMALL'; -} - -export interface BaseApplicationCommandData { - name: string; - nameLocalizations?: LocalizationMap; - /** @deprecated Use {@link defaultMemberPermissions} and {@link dmPermission} instead. */ - defaultPermission?: boolean; - defaultMemberPermissions?: PermissionResolvable | null; - dmPermission?: boolean; -} - -export type CommandOptionDataTypeResolvable = - | ApplicationCommandOptionType - | ApplicationCommandOptionTypes; - -export type CommandOptionChannelResolvableType = - | ApplicationCommandOptionTypes.CHANNEL - | 'CHANNEL'; - -export type CommandOptionChoiceResolvableType = - | ApplicationCommandOptionTypes.STRING - | 'STRING' - | CommandOptionNumericResolvableType; - -export type CommandOptionNumericResolvableType = - | ApplicationCommandOptionTypes.NUMBER - | 'NUMBER' - | ApplicationCommandOptionTypes.INTEGER - | 'INTEGER'; - -export type CommandOptionSubOptionResolvableType = - | ApplicationCommandOptionTypes.SUB_COMMAND - | 'SUB_COMMAND' - | ApplicationCommandOptionTypes.SUB_COMMAND_GROUP - | 'SUB_COMMAND_GROUP'; - -export type CommandOptionNonChoiceResolvableType = Exclude< - CommandOptionDataTypeResolvable, - | CommandOptionChoiceResolvableType - | CommandOptionSubOptionResolvableType - | CommandOptionChannelResolvableType ->; - -export interface BaseApplicationCommandOptionsData { - name: string; - nameLocalizations?: LocalizationMap; - description: string; - descriptionLocalizations?: LocalizationMap; - required?: boolean; - autocomplete?: never; -} - -export interface UserApplicationCommandData extends BaseApplicationCommandData { - type: 'USER' | ApplicationCommandTypes.USER; -} - -export interface MessageApplicationCommandData - extends BaseApplicationCommandData { - type: 'MESSAGE' | ApplicationCommandTypes.MESSAGE; -} - -export interface ChatInputApplicationCommandData - extends BaseApplicationCommandData { - description: string; - descriptionLocalizations?: LocalizationMap; - type?: 'CHAT_INPUT' | ApplicationCommandTypes.CHAT_INPUT; - options?: ApplicationCommandOptionData[]; -} - -export type ApplicationCommandData = - | UserApplicationCommandData - | MessageApplicationCommandData - | ChatInputApplicationCommandData; - -export interface ApplicationCommandChannelOptionData - extends BaseApplicationCommandOptionsData { - type: CommandOptionChannelResolvableType; - channelTypes?: ExcludeEnum[]; - channel_types?: Exclude[]; -} - -export interface ApplicationCommandChannelOption - extends BaseApplicationCommandOptionsData { - type: 'CHANNEL'; - channelTypes?: (keyof typeof ChannelTypes)[]; -} - -export interface ApplicationCommandAutocompleteOption - extends Omit { - type: - | 'STRING' - | 'NUMBER' - | 'INTEGER' - | ApplicationCommandOptionTypes.STRING - | ApplicationCommandOptionTypes.NUMBER - | ApplicationCommandOptionTypes.INTEGER; - autocomplete: true; -} - -export interface ApplicationCommandChoicesData - extends Omit { - type: CommandOptionChoiceResolvableType; - choices?: ApplicationCommandOptionChoiceData[]; - autocomplete?: false; -} - -export interface ApplicationCommandChoicesOption - extends Omit { - type: CommandOptionChoiceResolvableType; - choices?: ApplicationCommandOptionChoiceData[]; - autocomplete?: false; -} - -export interface ApplicationCommandNumericOptionData - extends ApplicationCommandChoicesData { - type: CommandOptionNumericResolvableType; - minValue?: number; - min_value?: number; - maxValue?: number; - max_value?: number; -} - -export interface ApplicationCommandStringOptionData - extends ApplicationCommandChoicesData { - type: ApplicationCommandOptionTypes.STRING; - minLength?: number; - min_length?: number; - maxLength?: number; - max_length?: number; -} - -export interface ApplicationCommandNumericOption - extends ApplicationCommandChoicesOption { - type: CommandOptionNumericResolvableType; - minValue?: number; - maxValue?: number; -} - -export interface ApplicationCommandStringOption - extends ApplicationCommandChoicesOption { - type: ApplicationCommandOptionTypes.STRING; - minLength?: number; - maxLength?: number; -} - -export interface ApplicationCommandSubGroupData - extends Omit { - type: 'SUB_COMMAND_GROUP' | ApplicationCommandOptionTypes.SUB_COMMAND_GROUP; - options?: ApplicationCommandSubCommandData[]; -} - -export interface ApplicationCommandSubGroup - extends Omit { - type: 'SUB_COMMAND_GROUP'; - options?: ApplicationCommandSubCommand[]; -} - -export interface ApplicationCommandSubCommandData - extends Omit { - type: 'SUB_COMMAND' | ApplicationCommandOptionTypes.SUB_COMMAND; - options?: ( - | ApplicationCommandChoicesData - | ApplicationCommandNonOptionsData - | ApplicationCommandChannelOptionData - | ApplicationCommandAutocompleteOption - | ApplicationCommandNumericOptionData - | ApplicationCommandStringOptionData - )[]; -} - -export interface ApplicationCommandSubCommand - extends Omit { - type: 'SUB_COMMAND'; - options?: ( - | ApplicationCommandChoicesOption - | ApplicationCommandNonOptions - | ApplicationCommandChannelOption - )[]; -} - -export interface ApplicationCommandNonOptionsData - extends BaseApplicationCommandOptionsData { - type: CommandOptionNonChoiceResolvableType; -} - -export interface ApplicationCommandNonOptions - extends BaseApplicationCommandOptionsData { - type: Exclude< - CommandOptionNonChoiceResolvableType, - ApplicationCommandOptionTypes - >; -} - -export type ApplicationCommandOptionData = - | ApplicationCommandSubGroupData - | ApplicationCommandNonOptionsData - | ApplicationCommandChannelOptionData - | ApplicationCommandChoicesData - | ApplicationCommandAutocompleteOption - | ApplicationCommandNumericOptionData - | ApplicationCommandStringOptionData - | ApplicationCommandSubCommandData; - -export type ApplicationCommandOption = - | ApplicationCommandSubGroup - | ApplicationCommandNonOptions - | ApplicationCommandChannelOption - | ApplicationCommandChoicesOption - | ApplicationCommandNumericOption - | ApplicationCommandStringOption - | ApplicationCommandSubCommand; - -export interface ApplicationCommandOptionChoiceData { - name: string; - nameLocalizations?: LocalizationMap; - value: string | number; -} - -export type ApplicationCommandType = keyof typeof ApplicationCommandTypes; - -export type ApplicationCommandOptionType = - keyof typeof ApplicationCommandOptionTypes; - -export type AutoModerationRuleTriggerType = - keyof typeof AutoModerationRuleTriggerTypes; - -export type AutoModerationRuleKeywordPresetType = - keyof typeof AutoModerationRuleKeywordPresetTypes; - -export type AutoModerationActionType = keyof typeof AutoModerationActionTypes; - -export type AutoModerationRuleEventType = - keyof typeof AutoModerationRuleEventTypes; - -export class AutoModerationActionExecution { - private constructor( - data: GatewayAutoModerationActionExecutionDispatchData, - guild: Guild, - ); - public guild: Guild; - public action: AutoModerationAction; - public ruleId: Snowflake; - public ruleTriggerType: AutoModerationRuleTriggerType; - public userId: Snowflake; - public channelId: Snowflake | null; - public messageId: Snowflake | null; - public alertSystemMessageId: Snowflake | null; - public content: string; - public matchedKeyword: string | null; - public matchedContent: string | null; - public get autoModerationRule(): AutoModerationRule | null; -} - -export class AutoModerationRule extends Base { - private constructor( - client: Client, - data: APIAutoModerationRule, - guild: Guild, - ); - public id: Snowflake; - public guild: Guild; - public name: string; - public creatorId: Snowflake; - public eventType: AutoModerationRuleEventType; - public triggerType: AutoModerationRuleTriggerType; - public triggerMetadata: AutoModerationTriggerMetadata; - public actions: AutoModerationAction[]; - public enabled: boolean; - public exemptRoles: Collection; - public exemptChannels: Collection; - public edit( - options: AutoModerationRuleEditOptions, - ): Promise; - public delete(reason?: string): Promise; - public setName(name: string, reason?: string): Promise; - public setEventType( - eventType: AutoModerationRuleEventType | AutoModerationRuleEventTypes, - reason?: string, - ): Promise; - public setKeywordFilter( - keywordFilter: string[], - reason?: string, - ): Promise; - public setRegexPatterns( - regexPatterns: string[], - reason?: string, - ): Promise; - public setPresets( - presets: AutoModerationRuleKeywordPresetType[], - reason?: string, - ): Promise; - public setAllowList( - allowList: string[], - reason?: string, - ): Promise; - public setMentionRaidProtectionEnabled( - mentionRaidProtectionEnabled: boolean, - reason?: string, - ): Promise; - public setMentionTotalLimit( - mentionTotalLimit: number, - reason?: string, - ): Promise; - public setActions( - actions: AutoModerationActionOptions[], - reason?: string, - ): Promise; - public setEnabled( - enabled?: boolean, - reason?: string, - ): Promise; - public setExemptRoles( - roles: Collection | RoleResolvable[], - reason?: string, - ): Promise; - public setExemptChannels( - channels: - | Collection - | GuildChannelResolvable[], - reason?: string, - ): Promise; -} - -export class AutoModerationRuleManager extends CachedManager< - Snowflake, - AutoModerationRule, - AutoModerationRuleResolvable -> { - private constructor(guild: Guild, iterable: unknown); - public guild: Guild; - public create( - options: AutoModerationRuleCreateOptions, - ): Promise; - public edit( - autoModerationRule: AutoModerationRuleResolvable, - options: AutoModerationRuleEditOptions, - ): Promise; - public fetch( - options: AutoModerationRuleResolvable | FetchAutoModerationRuleOptions, - ): Promise; - public fetch( - options?: FetchAutoModerationRulesOptions, - ): Promise>; - public delete( - autoModerationRule: AutoModerationRuleResolvable, - reason?: string, - ): Promise; -} - -export interface ApplicationCommandPermissionData { - id: Snowflake; - type: ApplicationCommandPermissionType | ApplicationCommandPermissionTypes; - permission: boolean; -} - -export interface ApplicationCommandPermissionsUpdateData { - permissions: ApplicationCommandPermissions; - id: Snowflake; - guildId: Snowflake; - applicationId: Snowflake; -} - -export interface ApplicationCommandPermissions - extends ApplicationCommandPermissionData { - type: ApplicationCommandPermissionType; -} - -export type ApplicationCommandPermissionType = - keyof typeof ApplicationCommandPermissionTypes; - -export type ApplicationCommandResolvable = ApplicationCommand | Snowflake; - -export type ApplicationFlagsString = - | 'APPLICATION_AUTO_MODERATION_RULE_CREATE_BADGE' - | 'GATEWAY_PRESENCE' - | 'GATEWAY_PRESENCE_LIMITED' - | 'GATEWAY_GUILD_MEMBERS' - | 'GATEWAY_GUILD_MEMBERS_LIMITED' - | 'VERIFICATION_PENDING_GUILD_LIMIT' - | 'EMBEDDED' - | 'GATEWAY_MESSAGE_CONTENT' - | 'GATEWAY_MESSAGE_CONTENT_LIMITED' - | 'APPLICATION_COMMAND_BADGE'; - -export interface ApplicationRoleConnectionMetadataEditOptions { - name: string; - nameLocalizations?: LocalizationMap | null; - description: string; - descriptionLocalizations?: LocalizationMap | null; - key: string; - type: ApplicationRoleConnectionMetadataTypes; -} - -export interface AutoModerationAction { - type: AutoModerationActionType | AutoModerationActionTypes; - metadata: AutoModerationActionMetadata; -} - -export interface AutoModerationActionMetadata { - channelId: Snowflake | null; - durationSeconds: number | null; - customMessage: string | null; -} - -export interface AutoModerationTriggerMetadata { - keywordFilter: string[]; - regexPatterns: string[]; - presets: ( - | AutoModerationRuleKeywordPresetType - | AutoModerationRuleKeywordPresetTypes - )[]; - allowList: string[]; - mentionRaidProtectionEnabled: boolean; - mentionTotalLimit: number | null; -} - -export interface FetchAutoModerationRuleOptions extends BaseFetchOptions { - autoModerationRule: AutoModerationRuleResolvable; -} - -export interface FetchAutoModerationRulesOptions { - cache?: boolean; -} - -export interface AutoModerationRuleCreateOptions { - name: string; - eventType: AutoModerationRuleEventType | AutoModerationRuleEventTypes; - triggerType: AutoModerationRuleTriggerType | AutoModerationRuleTriggerTypes; - triggerMetadata?: AutoModerationTriggerMetadataOptions; - actions: AutoModerationActionOptions[]; - enabled?: boolean; - exemptRoles?: Collection | RoleResolvable[]; - exemptChannels?: - | Collection - | GuildChannelResolvable[]; - reason?: string; -} - -export interface AutoModerationRuleEditOptions - extends Partial> {} - -export interface AutoModerationTriggerMetadataOptions - extends Partial {} - -export interface AutoModerationActionOptions { - type: AutoModerationActionType | AutoModerationActionTypes; - metadata?: AutoModerationActionMetadataOptions; -} - -export interface AutoModerationActionMetadataOptions - extends Partial> { - channel: GuildTextChannelResolvable | ThreadChannel; -} - -export type AuditLogChange = { - [SourceElement in APIAuditLogChange as SourceElement['key']]: { - key: SourceElement['key']; - old?: SourceElement['old_value']; - new?: SourceElement['new_value']; - }; -}[APIAuditLogChange['key']]; - -export type Awaitable = T | PromiseLike; - -export type AwaitMessageComponentOptions< - T extends MessageComponentInteraction, -> = Omit< - MessageComponentCollectorOptions, - 'max' | 'maxComponents' | 'maxUsers' ->; - -export interface AwaitMessagesOptions extends MessageCollectorOptions { - errors?: string[]; -} - -export type AwaitModalSubmitOptions = Omit< - ModalSubmitInteractionCollectorOptions, - 'max' | 'maxComponents' | 'maxUsers' -> & { - time: number; -}; - -export interface AwaitReactionsOptions extends ReactionCollectorOptions { - errors?: string[]; -} - -export interface BanOptions { - /** @deprecated Use {@link deleteMessageSeconds} instead. */ - days?: number; - deleteMessageSeconds?: number; - reason?: string; -} - -export interface BulkBanOptions extends Omit {} - -export interface BulkBanResult { - bannedUsers: readonly Snowflake[]; - failedUsers: readonly Snowflake[]; -} - -export type Base64Resolvable = Buffer | Base64String; - -export type Base64String = string; - -export interface BaseFetchOptions { - cache?: boolean; - force?: boolean; -} - -export interface BaseMessageComponentOptions { - type?: MessageComponentType | MessageComponentTypes; -} - -export type BitFieldResolvable = - | RecursiveReadonlyArray>> - | T - | N - | `${bigint}` - | Readonly>; - -export type BufferResolvable = Buffer | string; - -export interface Caches { - ApplicationCommandManager: [ - manager: typeof ApplicationCommandManager, - holds: typeof ApplicationCommand, - ]; - AutoModerationRuleManager: [ - manager: typeof AutoModerationRuleManager, - holds: typeof AutoModerationRule, - ]; - BaseGuildEmojiManager: [ - manager: typeof BaseGuildEmojiManager, - holds: typeof GuildEmoji, - ]; - GuildEmojiManager: [ - manager: typeof GuildEmojiManager, - holds: typeof GuildEmoji, - ]; - // TODO: ChannelManager: [manager: typeof ChannelManager, holds: typeof Channel]; - // TODO: GuildChannelManager: [manager: typeof GuildChannelManager, holds: typeof GuildChannel]; - // TODO: GuildManager: [manager: typeof GuildManager, holds: typeof Guild]; - GuildMemberManager: [ - manager: typeof GuildMemberManager, - holds: typeof GuildMember, - ]; - GuildBanManager: [manager: typeof GuildBanManager, holds: typeof GuildBan]; - GuildInviteManager: [ - manager: typeof GuildInviteManager, - holds: typeof Invite, - ]; - GuildScheduledEventManager: [ - manager: typeof GuildScheduledEventManager, - holds: typeof GuildScheduledEvent, - ]; - GuildStickerManager: [ - manager: typeof GuildStickerManager, - holds: typeof Sticker, - ]; - MessageManager: [manager: typeof MessageManager, holds: typeof Message]; - // TODO: PermissionOverwriteManager: [manager: typeof PermissionOverwriteManager, holds: typeof PermissionOverwrites]; - PresenceManager: [manager: typeof PresenceManager, holds: typeof Presence]; - ReactionManager: [ - manager: typeof ReactionManager, - holds: typeof MessageReaction, - ]; - ReactionUserManager: [ - manager: typeof ReactionUserManager, - holds: typeof User, - ]; - // TODO: RoleManager: [manager: typeof RoleManager, holds: typeof Role]; - StageInstanceManager: [ - manager: typeof StageInstanceManager, - holds: typeof StageInstance, - ]; - ThreadManager: [manager: typeof ThreadManager, holds: typeof ThreadChannel]; - ThreadMemberManager: [ - manager: typeof ThreadMemberManager, - holds: typeof ThreadMember, - ]; - UserManager: [manager: typeof UserManager, holds: typeof User]; - VoiceStateManager: [ - manager: typeof VoiceStateManager, - holds: typeof VoiceState, - ]; -} - -export type CacheConstructors = { - [K in keyof Caches]: Caches[K][0] & { name: K }; -}; - -// This doesn't actually work the way it looks 😢. -// Narrowing the type of `manager.name` doesn't propagate type information to `holds` and the return type. -export type CacheFactory = ( - manager: CacheConstructors[keyof Caches], - holds: Caches[(typeof manager)['name']][1], -) => (typeof manager)['prototype'] extends DataManager - ? Collection - : never; - -export type CacheWithLimitsOptions = { - [K in keyof Caches]?: Caches[K][0]['prototype'] extends DataManager< - infer K, - infer V, - any - > - ? LimitedCollectionOptions | number - : never; -}; -export interface CategoryCreateChannelOptions { - permissionOverwrites?: - | OverwriteResolvable[] - | Collection; - topic?: string; - type?: ExcludeEnum< - typeof ChannelTypes, - | 'DM' - | 'GROUP_DM' - | 'UNKNOWN' - | 'GUILD_PUBLIC_THREAD' - | 'GUILD_NEWS_THREAD' - | 'GUILD_PRIVATE_THREAD' - | 'GUILD_CATEGORY' - >; - nsfw?: boolean; - bitrate?: number; - userLimit?: number; - rateLimitPerUser?: number; - position?: number; - rtcRegion?: string; - videoQualityMode?: VideoQualityMode; - availableTags?: GuildForumTagData[]; - defaultReactionEmoji?: DefaultReactionEmoji; - defaultSortOrder?: SortOrderTypes; - defaultForumLayout?: ForumLayoutTypes; - defaultThreadRateLimitPerUser?: number; - reason?: string; -} - -export interface ChannelCreationOverwrites { - allow?: PermissionResolvable; - deny?: PermissionResolvable; - id: RoleResolvable | UserResolvable; -} - -export interface ChannelData { - name?: string; - type?: Pick; - position?: number; - topic?: string; - nsfw?: boolean; - bitrate?: number; - userLimit?: number; - parent?: CategoryChannelResolvable | null; - rateLimitPerUser?: number; - lockPermissions?: boolean; - permissionOverwrites?: - | readonly OverwriteResolvable[] - | Collection; - defaultAutoArchiveDuration?: ThreadAutoArchiveDuration | 'MAX'; - rtcRegion?: string | null; - videoQualityMode?: VideoQualityMode | null; - availableTags?: GuildForumTagData[]; - defaultReactionEmoji?: DefaultReactionEmoji; - defaultThreadRateLimitPerUser?: number; - defaultSortOrder?: SortOrderTypes | null; - defaultForumLayout?: ForumLayoutTypes; - flags?: ChannelFlagsResolvable; -} - -export interface ChannelLogsQueryOptions { - limit?: number; - before?: Snowflake; - after?: Snowflake; - around?: Snowflake; -} - -export type ChannelMention = `<#${Snowflake}>`; - -export interface ChannelPosition { - channel: NonThreadGuildBasedChannel | Snowflake; - lockPermissions?: boolean; - parent?: CategoryChannelResolvable | null; - position?: number; -} - -export type GuildTextChannelResolvable = TextChannel | NewsChannel | Snowflake; -export type ChannelResolvable = AnyChannel | Snowflake; - -export interface ChannelWebhookCreateOptions { - avatar?: BufferResolvable | Base64Resolvable | null; - reason?: string; -} - -export interface BaseClientEvents { - apiResponse: [request: APIRequest, response: Response]; - apiRequest: [request: APIRequest]; - debug: [message: string]; - rateLimit: [rateLimitData: RateLimitData]; - invalidRequestWarning: [invalidRequestWarningData: InvalidRequestWarningData]; -} - -export interface ClientEvents extends BaseClientEvents { - /** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */ - applicationCommandCreate: [command: ApplicationCommand]; - /** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */ - applicationCommandDelete: [command: ApplicationCommand]; - /** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */ - applicationCommandUpdate: [ - oldCommand: ApplicationCommand | null, - newCommand: ApplicationCommand, - ]; - applicationCommandPermissionsUpdate: [ - data: ApplicationCommandPermissionsUpdateData, - ]; - /** @deprecated This event is not received by user accounts. */ - autoModerationActionExecution: [ - autoModerationActionExecution: AutoModerationActionExecution, - ]; - /** @deprecated This event is not received by user accounts. */ - autoModerationRuleCreate: [autoModerationRule: AutoModerationRule]; - /** @deprecated This event is not received by user accounts. */ - autoModerationRuleDelete: [autoModerationRule: AutoModerationRule]; - /** @deprecated This event is not received by user accounts. */ - autoModerationRuleUpdate: [ - oldAutoModerationRule: AutoModerationRule | null, - newAutoModerationRule: AutoModerationRule, - ]; - cacheSweep: [message: string]; - channelCreate: [channel: NonThreadGuildBasedChannel]; - channelDelete: [channel: DMChannel | NonThreadGuildBasedChannel]; - channelPinsUpdate: [channel: TextBasedChannel, date: Date]; - channelUpdate: [ - oldChannel: DMChannel | NonThreadGuildBasedChannel, - newChannel: DMChannel | NonThreadGuildBasedChannel, - ]; - warn: [message: string]; - emojiCreate: [emoji: GuildEmoji]; - emojiDelete: [emoji: GuildEmoji]; - emojiUpdate: [oldEmoji: GuildEmoji, newEmoji: GuildEmoji]; - error: [error: Error]; - guildAvailable: [guild: Guild]; - guildBanAdd: [ban: GuildBan]; - guildBanRemove: [ban: GuildBan]; - guildCreate: [guild: Guild]; - guildDelete: [guild: Guild]; - guildUnavailable: [guild: Guild]; - guildIntegrationsUpdate: [guild: Guild]; - guildMemberAdd: [member: GuildMember]; - guildMemberAvailable: [member: GuildMember | PartialGuildMember]; - guildMemberRemove: [member: GuildMember | PartialGuildMember]; - guildMembersChunk: [ - members: Collection, - guild: Guild, - data: { - count: number; - index: number; - nonce: string | undefined; - notFound: unknown[]; - }, - ]; - guildMemberUpdate: [ - oldMember: GuildMember | PartialGuildMember, - newMember: GuildMember, - ]; - guildUpdate: [oldGuild: Guild, newGuild: Guild]; - inviteCreate: [invite: Invite]; - inviteDelete: [invite: Invite]; - /** @deprecated Use messageCreate instead */ - message: [message: Message]; - messageCreate: [message: Message]; - messageDelete: [message: Message | PartialMessage]; - messageReactionRemoveAll: [ - message: Message | PartialMessage, - reactions: Collection, - ]; - messageReactionRemoveEmoji: [ - reaction: MessageReaction | PartialMessageReaction, - ]; - messageDeleteBulk: [ - messages: Collection, - ]; - messageReactionAdd: [ - reaction: MessageReaction | PartialMessageReaction, - user: User | PartialUser, - details: MessageReactionEventDetails, - ]; - messageReactionRemove: [ - reaction: MessageReaction | PartialMessageReaction, - user: User | PartialUser, - details: MessageReactionEventDetails, - ]; - messageUpdate: [ - oldMessage: Message | PartialMessage, - newMessage: Message | PartialMessage, - ]; - presenceUpdate: [oldPresence: Presence | null, newPresence: Presence]; - ready: [client: Client]; - invalidated: []; - roleCreate: [role: Role]; - roleDelete: [role: Role]; - roleUpdate: [oldRole: Role, newRole: Role]; - threadCreate: [thread: ThreadChannel, newlyCreated: boolean]; - threadDelete: [thread: ThreadChannel]; - threadListSync: [threads: Collection]; - threadMemberUpdate: [oldMember: ThreadMember, newMember: ThreadMember]; - threadMembersUpdate: [ - oldMembers: Collection, - newMembers: Collection, - ]; - threadUpdate: [oldThread: ThreadChannel, newThread: ThreadChannel]; - typingStart: [typing: Typing]; - userUpdate: [oldUser: User | PartialUser, newUser: User]; - voiceChannelEffectSend: [voiceChannelEffect: VoiceChannelEffect]; - voiceStateUpdate: [oldState: VoiceState, newState: VoiceState]; - webhookUpdate: [ - channel: - | TextChannel - | NewsChannel - | VoiceChannel - | ForumChannel - | MediaChannel - | StageChannel, - ]; - shardDisconnect: [closeEvent: CloseEvent, shardId: number]; - shardError: [error: Error, shardId: number]; - shardReady: [shardId: number, unavailableGuilds: Set | undefined]; - shardReconnecting: [shardId: number]; - shardResume: [shardId: number, replayedEvents: number]; - stageInstanceCreate: [stageInstance: StageInstance]; - stageInstanceUpdate: [ - oldStageInstance: StageInstance | null, - newStageInstance: StageInstance, - ]; - stageInstanceDelete: [stageInstance: StageInstance]; - stickerCreate: [sticker: Sticker]; - stickerDelete: [sticker: Sticker]; - stickerUpdate: [oldSticker: Sticker, newSticker: Sticker]; - guildScheduledEventCreate: [guildScheduledEvent: GuildScheduledEvent]; - guildScheduledEventUpdate: [ - oldGuildScheduledEvent: - | GuildScheduledEvent - | PartialGuildScheduledEvent - | null, - newGuildScheduledEvent: GuildScheduledEvent, - ]; - guildScheduledEventDelete: [ - guildScheduledEvent: GuildScheduledEvent | PartialGuildScheduledEvent, - ]; - guildScheduledEventUserAdd: [ - guildScheduledEvent: GuildScheduledEvent | PartialGuildScheduledEvent, - user: User, - ]; - guildScheduledEventUserRemove: [ - guildScheduledEvent: GuildScheduledEvent, - PartialGuildScheduledEvent, - user: User, - ]; - guildAuditLogEntryCreate: [auditLogEntry: GuildAuditLogsEntry, guild: Guild]; - raw: [packet: any, shard: number]; - unhandledPacket: [packet: { t?: string; d: any }, shard: number]; - relationshipAdd: [userId: Snowflake, shouldNotify: boolean]; - relationshipRemove: [ - userId: Snowflake, - type: RelationshipTypes, - nickname: string | null, - ]; - relationshipUpdate: [ - userId: Snowflake, - oldData: { - nickname: string | null; - since: Date; - type: RelationshipTypes; - }, - newData: { - nickname: string | null; - since: Date; - type: RelationshipTypes; - }, - ]; - channelRecipientAdd: [channel: GroupDMChannel, user: User]; - channelRecipientRemove: [channel: GroupDMChannel, user: User]; - interactionModalCreate: [modal: Modal]; - callCreate: [call: CallState]; - callUpdate: [call: CallState]; - callDelete: [call: CallState]; - messagePollVoteAdd: [pollAnswer: PollAnswer, userId: Snowflake]; - messagePollVoteRemove: [pollAnswer: PollAnswer, userId: Snowflake]; -} - -export interface ClientFetchInviteOptions { - guildScheduledEventId?: Snowflake; -} - -export type CaptchaSolver = ( - captcha: Captcha, - UserAgent: string, -) => Promise; - -export interface ClientOptions { - DMChannelVoiceStatusSync?: number; - captchaRetryLimit?: number; - captchaSolver?: CaptchaSolver; - closeTimeout?: number; - makeCache?: CacheFactory; - /** @deprecated Pass the value of this property as `lifetime` to `sweepers.messages` instead. */ - messageCacheLifetime?: number; - /** @deprecated Pass the value of this property as `interval` to `sweepers.messages` instead. */ - messageSweepInterval?: number; - allowedMentions?: MessageMentionOptions; - invalidRequestWarningInterval?: number; - partials?: PartialTypes[]; - restWsBridgeTimeout?: number; - restTimeOffset?: number; - restRequestTimeout?: number; - restGlobalRateLimit?: number; - restSweepInterval?: number; - retryLimit?: number; - failIfNotExists?: boolean; - presence?: PresenceData; - waitGuildTimeout?: number; - sweepers?: SweeperOptions; - ws?: WebSocketOptions; - http?: HTTPOptions; - rejectOnRateLimit?: - | string[] - | ((data: RateLimitData) => boolean | Promise); - TOTPKey?: string; -} - -export type ClientPresenceStatus = 'online' | 'idle' | 'dnd'; - -export interface ClientPresenceStatusData { - web?: ClientPresenceStatus; - mobile?: ClientPresenceStatus; - desktop?: ClientPresenceStatus; -} - -export interface ClientUserEditData { - username?: string; - avatar?: BufferResolvable | Base64Resolvable | null; - banner?: BufferResolvable | Base64Resolvable | null; - bio?: string; -} - -export interface CloseEvent { - wasClean: boolean; - code: number; - reason: string; - target: WebSocket; -} - -export type CollectorFilter = ( - ...args: T -) => boolean | Promise; - -export interface CollectorOptions { - filter?: CollectorFilter; - time?: number; - idle?: number; - dispose?: boolean; -} - -export interface CollectorResetTimerOptions { - time?: number; - idle?: number; -} - -export type ColorResolvable = - | 'DEFAULT' - | 'WHITE' - | 'AQUA' - | 'GREEN' - | 'BLUE' - | 'YELLOW' - | 'PURPLE' - | 'LUMINOUS_VIVID_PINK' - | 'FUCHSIA' - | 'GOLD' - | 'ORANGE' - | 'RED' - | 'GREY' - | 'DARKER_GREY' - | 'NAVY' - | 'DARK_AQUA' - | 'DARK_GREEN' - | 'DARK_BLUE' - | 'DARK_PURPLE' - | 'DARK_VIVID_PINK' - | 'DARK_GOLD' - | 'DARK_ORANGE' - | 'DARK_RED' - | 'DARK_GREY' - | 'LIGHT_GREY' - | 'DARK_NAVY' - | 'BLURPLE' - | 'GREYPLE' - | 'DARK_BUT_NOT_BLACK' - | 'NOT_QUITE_BLACK' - | 'RANDOM' - | readonly [number, number, number] - | number - | HexColorString; - -export interface CommandInteractionOption< - Cached extends CacheType = CacheType, -> { - name: string; - type: ApplicationCommandOptionType; - value?: string | number | boolean; - focused?: boolean; - autocomplete?: boolean; - options?: CommandInteractionOption[]; - user?: User; - member?: CacheTypeReducer< - Cached, - GuildMember, - APIInteractionDataResolvedGuildMember - >; - channel?: CacheTypeReducer< - Cached, - GuildBasedChannel, - APIInteractionDataResolvedChannel - >; - role?: CacheTypeReducer; - message?: GuildCacheMessage; - attachment?: MessageAttachment; -} - -export interface CommandInteractionResolvedData< - Cached extends CacheType = CacheType, -> { - users?: Collection; - members?: Collection< - Snowflake, - CacheTypeReducer - >; - roles?: Collection>; - channels?: Collection< - Snowflake, - CacheTypeReducer - >; - messages?: Collection< - Snowflake, - CacheTypeReducer - >; - attachments?: Collection; -} - -export interface ConstantsClientApplicationAssetTypes { - SMALL: 1; - BIG: 2; -} - -export type AutocompleteFocusedOption = Pick< - CommandInteractionOption, - 'name' -> & { - focused: true; - type: - | 'STRING' - | 'INTEGER' - | 'NUMBER' - | ApplicationCommandOptionTypes.STRING - | ApplicationCommandOptionTypes.INTEGER - | ApplicationCommandOptionTypes.NUMBER; - value: string; -}; - -export interface ConstantsColors { - DEFAULT: 0x000000; - WHITE: 0xffffff; - AQUA: 0x1abc9c; - GREEN: 0x57f287; - BLUE: 0x3498db; - YELLOW: 0xfee75c; - PURPLE: 0x9b59b6; - LUMINOUS_VIVID_PINK: 0xe91e63; - FUCHSIA: 0xeb459e; - GOLD: 0xf1c40f; - ORANGE: 0xe67e22; - RED: 0xed4245; - GREY: 0x95a5a6; - NAVY: 0x34495e; - DARK_AQUA: 0x11806a; - DARK_GREEN: 0x1f8b4c; - DARK_BLUE: 0x206694; - DARK_PURPLE: 0x71368a; - DARK_VIVID_PINK: 0xad1457; - DARK_GOLD: 0xc27c0e; - DARK_ORANGE: 0xa84300; - DARK_RED: 0x992d22; - DARK_GREY: 0x979c9f; - DARKER_GREY: 0x7f8c8d; - LIGHT_GREY: 0xbcc0c0; - DARK_NAVY: 0x2c3e50; - BLURPLE: 0x5865f2; - GREYPLE: 0x99aab5; - DARK_BUT_NOT_BLACK: 0x2c2f33; - NOT_QUITE_BLACK: 0x23272a; -} - -export interface ConstantsEvents { - RATE_LIMIT: 'rateLimit'; - INVALID_REQUEST_WARNING: 'invalidRequestWarning'; - API_RESPONSE: 'apiResponse'; - API_REQUEST: 'apiRequest'; - CLIENT_READY: 'ready'; - /** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */ - APPLICATION_COMMAND_CREATE: 'applicationCommandCreate'; - /** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */ - APPLICATION_COMMAND_DELETE: 'applicationCommandDelete'; - APPLICATION_COMMAND_PERMISSIONS_UPDATE: 'applicationCommandPermissionsUpdate'; - /** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */ - APPLICATION_COMMAND_UPDATE: 'applicationCommandUpdate'; - /** @deprecated This event is not received by user accounts. */ - AUTO_MODERATION_ACTION_EXECUTION: 'autoModerationActionExecution'; - /** @deprecated This event is not received by user accounts. */ - AUTO_MODERATION_RULE_CREATE: 'autoModerationRuleCreate'; - /** @deprecated This event is not received by user accounts. */ - AUTO_MODERATION_RULE_DELETE: 'autoModerationRuleDelete'; - /** @deprecated This event is not received by user accounts. */ - AUTO_MODERATION_RULE_UPDATE: 'autoModerationRuleUpdate'; - GUILD_AVAILABLE: 'guildAvailable'; - GUILD_CREATE: 'guildCreate'; - GUILD_DELETE: 'guildDelete'; - GUILD_UPDATE: 'guildUpdate'; - GUILD_UNAVAILABLE: 'guildUnavailable'; - GUILD_MEMBER_ADD: 'guildMemberAdd'; - GUILD_MEMBER_REMOVE: 'guildMemberRemove'; - GUILD_MEMBER_UPDATE: 'guildMemberUpdate'; - GUILD_MEMBER_AVAILABLE: 'guildMemberAvailable'; - GUILD_MEMBERS_CHUNK: 'guildMembersChunk'; - GUILD_INTEGRATIONS_UPDATE: 'guildIntegrationsUpdate'; - GUILD_ROLE_CREATE: 'roleCreate'; - GUILD_ROLE_DELETE: 'roleDelete'; - INVITE_CREATE: 'inviteCreate'; - INVITE_DELETE: 'inviteDelete'; - GUILD_ROLE_UPDATE: 'roleUpdate'; - GUILD_EMOJI_CREATE: 'emojiCreate'; - GUILD_EMOJI_DELETE: 'emojiDelete'; - GUILD_EMOJI_UPDATE: 'emojiUpdate'; - GUILD_BAN_ADD: 'guildBanAdd'; - GUILD_BAN_REMOVE: 'guildBanRemove'; - CHANNEL_CREATE: 'channelCreate'; - CHANNEL_DELETE: 'channelDelete'; - CHANNEL_UPDATE: 'channelUpdate'; - CHANNEL_PINS_UPDATE: 'channelPinsUpdate'; - MESSAGE_CREATE: 'messageCreate'; - MESSAGE_DELETE: 'messageDelete'; - MESSAGE_UPDATE: 'messageUpdate'; - MESSAGE_BULK_DELETE: 'messageDeleteBulk'; - MESSAGE_REACTION_ADD: 'messageReactionAdd'; - MESSAGE_REACTION_REMOVE: 'messageReactionRemove'; - MESSAGE_REACTION_REMOVE_ALL: 'messageReactionRemoveAll'; - MESSAGE_REACTION_REMOVE_EMOJI: 'messageReactionRemoveEmoji'; - THREAD_CREATE: 'threadCreate'; - THREAD_DELETE: 'threadDelete'; - THREAD_UPDATE: 'threadUpdate'; - THREAD_LIST_SYNC: 'threadListSync'; - THREAD_MEMBER_UPDATE: 'threadMemberUpdate'; - THREAD_MEMBERS_UPDATE: 'threadMembersUpdate'; - USER_UPDATE: 'userUpdate'; - PRESENCE_UPDATE: 'presenceUpdate'; - VOICE_CHANNEL_EFFECT_SEND: 'voiceChannelEffectSend'; - VOICE_SERVER_UPDATE: 'voiceServerUpdate'; - VOICE_STATE_UPDATE: 'voiceStateUpdate'; - TYPING_START: 'typingStart'; - WEBHOOKS_UPDATE: 'webhookUpdate'; - ERROR: 'error'; - WARN: 'warn'; - DEBUG: 'debug'; - CACHE_SWEEP: 'cacheSweep'; - SHARD_DISCONNECT: 'shardDisconnect'; - SHARD_ERROR: 'shardError'; - SHARD_RECONNECTING: 'shardReconnecting'; - SHARD_READY: 'shardReady'; - SHARD_RESUME: 'shardResume'; - INVALIDATED: 'invalidated'; - RAW: 'raw'; - STAGE_INSTANCE_CREATE: 'stageInstanceCreate'; - STAGE_INSTANCE_UPDATE: 'stageInstanceUpdate'; - STAGE_INSTANCE_DELETE: 'stageInstanceDelete'; - GUILD_STICKER_CREATE: 'stickerCreate'; - GUILD_STICKER_DELETE: 'stickerDelete'; - GUILD_STICKER_UPDATE: 'stickerUpdate'; - GUILD_SCHEDULED_EVENT_CREATE: 'guildScheduledEventCreate'; - GUILD_SCHEDULED_EVENT_UPDATE: 'guildScheduledEventUpdate'; - GUILD_SCHEDULED_EVENT_DELETE: 'guildScheduledEventDelete'; - GUILD_SCHEDULED_EVENT_USER_ADD: 'guildScheduledEventUserAdd'; - GUILD_SCHEDULED_EVENT_USER_REMOVE: 'guildScheduledEventUserRemove'; - GUILD_AUDIT_LOG_ENTRY_CREATE: 'guildAuditLogEntryCreate'; - UNHANDLED_PACKET: 'unhandledPacket'; - RELATIONSHIP_ADD: 'relationshipAdd'; - RELATIONSHIP_UPDATE: 'relationshipUpdate'; - RELATIONSHIP_REMOVE: 'relationshipRemove'; - CHANNEL_RECIPIENT_ADD: 'channelRecipientAdd'; - CHANNEL_RECIPIENT_REMOVE: 'channelRecipientRemove'; - INTERACTION_MODAL_CREATE: 'interactionModalCreate'; - CALL_CREATE: 'callCreate'; - CALL_UPDATE: 'callUpdate'; - CALL_DELETE: 'callDelete'; - MESSAGE_POLL_VOTE_ADD: 'messagePollVoteAdd'; - MESSAGE_POLL_VOTE_REMOVE: 'messagePollVoteRemove'; -} - -export interface ConstantsVoiceOpcodes { - IDENTIFY: 0; - SELECT_PROTOCOL: 1; - READY: 2; - HEARTBEAT: 3; - SESSION_DESCRIPTION: 4; - SPEAKING: 5; - HEARTBEAT_ACK: 6; - RESUME: 7; - HELLO: 8; - RESUMED: 9; - SOURCES: 12; - CLIENT_DISCONNECT: 13; - SESSION_UPDATE: 14; - MEDIA_SINK_WANTS: 15; - VOICE_BACKEND_VERSION: 16; - CHANNEL_OPTIONS_UPDATE: 17; -} - -export interface ConstantsOpcodes { - DISPATCH: 0; - HEARTBEAT: 1; - IDENTIFY: 2; - STATUS_UPDATE: 3; - VOICE_STATE_UPDATE: 4; - VOICE_GUILD_PING: 5; - RESUME: 6; - RECONNECT: 7; - REQUEST_GUILD_MEMBERS: 8; - INVALID_SESSION: 9; - HELLO: 10; - HEARTBEAT_ACK: 11; - GUILD_SYNC: 12; - DM_UPDATE: 13; - GUILD_SUBSCRIPTIONS: 14; - LOBBY_CONNECT: 15; - LOBBY_DISCONNECT: 16; - LOBBY_VOICE_STATE_UPDATE: 17; - STREAM_CREATE: 18; - STREAM_DELETE: 19; - STREAM_WATCH: 20; - STREAM_PING: 21; - STREAM_SET_PAUSED: 22; - REQUEST_GUILD_APPLICATION_COMMANDS: 24; - EMBEDDED_ACTIVITY_LAUNCH: 25; - EMBEDDED_ACTIVITY_CLOSE: 26; - EMBEDDED_ACTIVITY_UPDATE: 27; - REQUEST_FORUM_UNREADS: 28; - REMOTE_COMMAND: 29; - GET_DELETED_ENTITY_IDS_NOT_MATCHING_HASH: 30; - REQUEST_SOUNDBOARD_SOUNDS: 31; - SPEED_TEST_CREATE: 32; - SPEED_TEST_DELETE: 33; - REQUEST_LAST_MESSAGES: 34; - SEARCH_RECENT_MEMBERS: 35; - REQUEST_CHANNEL_STATUSES: 36; - GUILD_SUBSCRIPTIONS_BULK: 37; -} - -export interface ConstantsShardEvents { - CLOSE: 'close'; - DESTROYED: 'destroyed'; - INVALID_SESSION: 'invalidSession'; - READY: 'ready'; - RESUMED: 'resumed'; - ALL_READY: 'allReady'; -} - -export interface ConstantsStatus { - READY: 0; - CONNECTING: 1; - RECONNECTING: 2; - IDLE: 3; - NEARLY: 4; - DISCONNECTED: 5; - WAITING_FOR_GUILDS: 6; - IDENTIFYING: 7; - RESUMING: 8; -} - -export interface CreateGuildScheduledEventInviteURLOptions - extends CreateInviteOptions { - channel?: GuildInvitableChannelResolvable; -} - -export interface CreateRoleOptions extends RoleData { - reason?: string; -} - -export interface StageInstanceCreateOptions { - topic: string; - privacyLevel?: PrivacyLevel | number; - sendStartNotification?: boolean; - guildScheduledEvent?: GuildScheduledEventResolvable; -} - -export interface CrosspostedChannel { - channelId: Snowflake; - guildId: Snowflake; - type: keyof typeof ChannelTypes; - name: string; -} - -export type DateResolvable = Date | number | string; - -export interface DeconstructedSnowflake { - timestamp: number; - readonly date: Date; - workerId: number; - processId: number; - increment: number; - binary: string; -} - -export type DefaultMessageNotificationLevel = - keyof typeof DefaultMessageNotificationLevels; - -export type DynamicImageFormat = AllowedImageFormat | 'gif'; - -export interface EditGuildTemplateOptions { - name?: string; - description?: string; -} - -export interface EmbedAuthorData { - name: string; - url?: string; - iconURL?: string; -} - -export interface EmbedField { - name: string; - value: string; - inline: boolean; -} - -export interface EmbedFieldData { - name: string; - value: string; - inline?: boolean; -} - -export interface EmbedFooterData { - text: string; - iconURL?: string; -} - -export type EmojiIdentifierResolvable = - | EmojiResolvable - | `${'' | 'a:'}${string}:${Snowflake}` - | `<${'' | 'a'}:${string}:${Snowflake}>` - | string; - -export type EmojiResolvable = Snowflake | GuildEmoji | ReactionEmoji; - -export interface ErrorEvent { - error: unknown; - message: string; - type: string; - target: WebSocket; -} - -export interface EscapeMarkdownOptions { - codeBlock?: boolean; - inlineCode?: boolean; - bold?: boolean; - italic?: boolean; - underline?: boolean; - strikethrough?: boolean; - spoiler?: boolean; - codeBlockContent?: boolean; - inlineCodeContent?: boolean; - escape?: boolean; - heading?: boolean; - bulletedList?: boolean; - numberedList?: boolean; - maskedLink?: boolean; -} - -export type ExplicitContentFilterLevel = - keyof typeof ExplicitContentFilterLevels; - -export interface FetchApplicationCommandOptions extends BaseFetchOptions { - guildId?: Snowflake; - locale?: LocaleString; - withLocalizations?: boolean; -} - -export interface FetchArchivedThreadOptions { - type?: 'public' | 'private'; - fetchAll?: boolean; - before?: ThreadChannelResolvable | DateResolvable; - limit?: number; -} - -export interface FetchChannelThreadsOptions { - archived?: boolean; - limit?: number; - offset?: number; - sort_by?: string; - sort_order?: string; -} - -export interface FetchBanOptions extends BaseFetchOptions { - user: UserResolvable; -} - -export interface FetchBansOptions { - limit?: number; - before?: Snowflake; - after?: Snowflake; - cache?: boolean; -} - -export interface FetchChannelOptions extends BaseFetchOptions { - allowUnknownGuild?: boolean; -} - -export interface FetchedThreads { - threads: Collection; - hasMore?: boolean; -} - -export interface FetchGuildOptions extends BaseFetchOptions { - guild: GuildResolvable; - withCounts?: boolean; -} - -export interface FetchGuildsOptions { - before?: Snowflake; - after?: Snowflake; - limit?: number; -} - -export interface FetchGuildScheduledEventOptions extends BaseFetchOptions { - guildScheduledEvent: GuildScheduledEventResolvable; - withUserCount?: boolean; -} - -export interface FetchGuildScheduledEventsOptions { - cache?: boolean; - withUserCount?: boolean; -} - -export interface FetchGuildScheduledEventSubscribersOptions { - limit?: number; - withMember?: boolean; -} - -interface FetchInviteOptions extends BaseFetchOptions { - code: string; -} - -interface FetchInvitesOptions { - channelId?: GuildInvitableChannelResolvable; - cache?: boolean; -} - -export interface FetchMemberOptions extends BaseFetchOptions { - user: UserResolvable; -} - -export interface FetchMembersOptions { - user?: UserResolvable | UserResolvable[]; - query?: string; - limit?: number; - withPresences?: boolean; - time?: number; - nonce?: string; - force?: boolean; -} - -export interface FetchReactionUsersOptions { - type?: ReactionTypes; - limit?: number; - after?: Snowflake; -} - -export interface FetchThreadMemberOptions extends BaseFetchOptions { - withMember?: boolean; -} - -export interface FetchThreadMembersWithGuildMemberDataOptions { - withMember: true; - after?: Snowflake; - limit?: number; - cache?: boolean; -} - -export interface FetchThreadMembersWithoutGuildMemberDataOptions { - withMember?: false; - cache?: boolean; -} - -export type FetchThreadMembersOptions = - | FetchThreadMembersWithGuildMemberDataOptions - | FetchThreadMembersWithoutGuildMemberDataOptions; - -export interface FetchThreadsOptions { - archived?: FetchArchivedThreadOptions; -} - -export interface FileOptions { - attachment: BufferResolvable | Stream; - name?: string; - description?: string; -} - -export type GlobalSweepFilter = () => - | ((value: V, key: K, collection: Collection) => boolean) - | null; - -export interface GuildApplicationCommandPermissionData { - id: Snowflake; - permissions: ApplicationCommandPermissionData[]; -} - -interface GuildAuditLogsTypes { - GUILD_UPDATE: ['GUILD', 'UPDATE']; - CHANNEL_CREATE: ['CHANNEL', 'CREATE']; - CHANNEL_UPDATE: ['CHANNEL', 'UPDATE']; - CHANNEL_DELETE: ['CHANNEL', 'DELETE']; - CHANNEL_OVERWRITE_CREATE: ['CHANNEL', 'CREATE']; - CHANNEL_OVERWRITE_UPDATE: ['CHANNEL', 'UPDATE']; - CHANNEL_OVERWRITE_DELETE: ['CHANNEL', 'DELETE']; - MEMBER_KICK: ['USER', 'DELETE']; - MEMBER_PRUNE: ['USER', 'DELETE']; - MEMBER_BAN_ADD: ['USER', 'DELETE']; - MEMBER_BAN_REMOVE: ['USER', 'CREATE']; - MEMBER_UPDATE: ['USER', 'UPDATE']; - MEMBER_ROLE_UPDATE: ['USER', 'UPDATE']; - MEMBER_MOVE: ['USER', 'UPDATE']; - MEMBER_DISCONNECT: ['USER', 'DELETE']; - BOT_ADD: ['USER', 'CREATE']; - ROLE_CREATE: ['ROLE', 'CREATE']; - ROLE_UPDATE: ['ROLE', 'UPDATE']; - ROLE_DELETE: ['ROLE', 'DELETE']; - INVITE_CREATE: ['INVITE', 'CREATE']; - INVITE_UPDATE: ['INVITE', 'UPDATE']; - INVITE_DELETE: ['INVITE', 'DELETE']; - WEBHOOK_CREATE: ['WEBHOOK', 'CREATE']; - WEBHOOK_UPDATE: ['WEBHOOK', 'UPDATE']; - WEBHOOK_DELETE: ['WEBHOOK', 'DELETE']; - EMOJI_CREATE: ['EMOJI', 'CREATE']; - EMOJI_UPDATE: ['EMOJI', 'UPDATE']; - EMOJI_DELETE: ['EMOJI', 'DELETE']; - MESSAGE_DELETE: ['MESSAGE', 'DELETE']; - MESSAGE_BULK_DELETE: ['MESSAGE', 'DELETE']; - MESSAGE_PIN: ['MESSAGE', 'CREATE']; - MESSAGE_UNPIN: ['MESSAGE', 'DELETE']; - INTEGRATION_CREATE: ['INTEGRATION', 'CREATE']; - INTEGRATION_UPDATE: ['INTEGRATION', 'UPDATE']; - INTEGRATION_DELETE: ['INTEGRATION', 'DELETE']; - STAGE_INSTANCE_CREATE: ['STAGE_INSTANCE', 'CREATE']; - STAGE_INSTANCE_UPDATE: ['STAGE_INSTANCE', 'UPDATE']; - STAGE_INSTANCE_DELETE: ['STAGE_INSTANCE', 'DELETE']; - STICKER_CREATE: ['STICKER', 'CREATE']; - STICKER_UPDATE: ['STICKER', 'UPDATE']; - STICKER_DELETE: ['STICKER', 'DELETE']; - GUILD_SCHEDULED_EVENT_CREATE: ['GUILD_SCHEDULED_EVENT', 'CREATE']; - GUILD_SCHEDULED_EVENT_UPDATE: ['GUILD_SCHEDULED_EVENT', 'UPDATE']; - GUILD_SCHEDULED_EVENT_DELETE: ['GUILD_SCHEDULED_EVENT', 'DELETE']; - THREAD_CREATE: ['THREAD', 'CREATE']; - THREAD_UPDATE: ['THREAD', 'UPDATE']; - THREAD_DELETE: ['THREAD', 'DELETE']; - APPLICATION_COMMAND_PERMISSION_UPDATE: [ - 'APPLICATION_COMMAND_PERMISSION', - 'UPDATE', - ]; - AUTO_MODERATION_RULE_CREATE: ['AUTO_MODERATION', 'CREATE']; - AUTO_MODERATION_RULE_UPDATE: ['AUTO_MODERATION', 'UPDATE']; - AUTO_MODERATION_RULE_DELETE: ['AUTO_MODERATION', 'DELETE']; - AUTO_MODERATION_BLOCK_MESSAGE: ['AUTO_MODERATION', 'CREATE']; - AUTO_MODERATION_FLAG_TO_CHANNEL: ['AUTO_MODERATION', 'CREATE']; - AUTO_MODERATION_USER_COMMUNICATION_DISABLED: ['AUTO_MODERATION', 'CREATE']; -} - -export interface GuildAuditLogsIds { - 1: 'GUILD_UPDATE'; - 10: 'CHANNEL_CREATE'; - 11: 'CHANNEL_UPDATE'; - 12: 'CHANNEL_DELETE'; - 13: 'CHANNEL_OVERWRITE_CREATE'; - 14: 'CHANNEL_OVERWRITE_UPDATE'; - 15: 'CHANNEL_OVERWRITE_DELETE'; - 20: 'MEMBER_KICK'; - 21: 'MEMBER_PRUNE'; - 22: 'MEMBER_BAN_ADD'; - 23: 'MEMBER_BAN_REMOVE'; - 24: 'MEMBER_UPDATE'; - 25: 'MEMBER_ROLE_UPDATE'; - 26: 'MEMBER_MOVE'; - 27: 'MEMBER_DISCONNECT'; - 28: 'BOT_ADD'; - 30: 'ROLE_CREATE'; - 31: 'ROLE_UPDATE'; - 32: 'ROLE_DELETE'; - 40: 'INVITE_CREATE'; - 41: 'INVITE_UPDATE'; - 42: 'INVITE_DELETE'; - 50: 'WEBHOOK_CREATE'; - 51: 'WEBHOOK_UPDATE'; - 52: 'WEBHOOK_DELETE'; - 60: 'EMOJI_CREATE'; - 61: 'EMOJI_UPDATE'; - 62: 'EMOJI_DELETE'; - 72: 'MESSAGE_DELETE'; - 73: 'MESSAGE_BULK_DELETE'; - 74: 'MESSAGE_PIN'; - 75: 'MESSAGE_UNPIN'; - 80: 'INTEGRATION_CREATE'; - 81: 'INTEGRATION_UPDATE'; - 82: 'INTEGRATION_DELETE'; - 83: 'STAGE_INSTANCE_CREATE'; - 84: 'STAGE_INSTANCE_UPDATE'; - 85: 'STAGE_INSTANCE_DELETE'; - 90: 'STICKER_CREATE'; - 91: 'STICKER_UPDATE'; - 92: 'STICKER_DELETE'; - 100: 'GUILD_SCHEDULED_EVENT_CREATE'; - 101: 'GUILD_SCHEDULED_EVENT_UPDATE'; - 102: 'GUILD_SCHEDULED_EVENT_DELETE'; - 110: 'THREAD_CREATE'; - 111: 'THREAD_UPDATE'; - 112: 'THREAD_DELETE'; - 121: 'APPLICATION_COMMAND_PERMISSION_UPDATE'; - 140: 'AUTO_MODERATION_RULE_CREATE'; - 141: 'AUTO_MODERATION_RULE_UPDATE'; - 142: 'AUTO_MODERATION_RULE_DELETE'; - 143: 'AUTO_MODERATION_BLOCK_MESSAGE'; - 144: 'AUTO_MODERATION_FLAG_TO_CHANNEL'; - 145: 'AUTO_MODERATION_USER_COMMUNICATION_DISABLED'; -} - -export type GuildAuditLogsActions = { - [Key in keyof GuildAuditLogsIds as GuildAuditLogsIds[Key]]: Key; -} & { ALL: null }; - -export type GuildAuditLogsAction = keyof GuildAuditLogsActions; - -export type GuildAuditLogsActionType = - | GuildAuditLogsTypes[keyof GuildAuditLogsTypes][1] - | 'ALL'; - -export interface GuildAuditLogsEntryExtraField { - MEMBER_PRUNE: { removed: number; days: number }; - MEMBER_MOVE: { - channel: VoiceBasedChannel | { id: Snowflake }; - count: number; - }; - MESSAGE_DELETE: { - channel: GuildTextBasedChannel | { id: Snowflake }; - count: number; - }; - MESSAGE_BULK_DELETE: { - channel: GuildTextBasedChannel | { id: Snowflake }; - count: number; - }; - MESSAGE_PIN: { - channel: GuildTextBasedChannel | { id: Snowflake }; - messageId: Snowflake; - }; - MESSAGE_UNPIN: { - channel: GuildTextBasedChannel | { id: Snowflake }; - messageId: Snowflake; - }; - MEMBER_DISCONNECT: { count: number }; - CHANNEL_OVERWRITE_CREATE: - | Role - | GuildMember - | { id: Snowflake; name: string; type: OverwriteTypes.role } - | { id: Snowflake; type: OverwriteTypes.member }; - CHANNEL_OVERWRITE_UPDATE: - | Role - | GuildMember - | { id: Snowflake; name: string; type: OverwriteTypes.role } - | { id: Snowflake; type: OverwriteTypes.member }; - CHANNEL_OVERWRITE_DELETE: - | Role - | GuildMember - | { id: Snowflake; name: string; type: OverwriteTypes.role } - | { id: Snowflake; type: OverwriteTypes.member }; - STAGE_INSTANCE_CREATE: StageChannel | { id: Snowflake }; - STAGE_INSTANCE_DELETE: StageChannel | { id: Snowflake }; - STAGE_INSTANCE_UPDATE: StageChannel | { id: Snowflake }; - APPLICATION_COMMAND_PERMISSION_UPDATE: { - applicationId: Snowflake; - }; - AUTO_MODERATION_BLOCK_MESSAGE: { - autoModerationRuleName: string; - autoModerationRuleTriggerType: AutoModerationRuleTriggerType; - channel: GuildTextBasedChannel | { id: Snowflake }; - }; - AUTO_MODERATION_FLAG_TO_CHANNEL: { - autoModerationRuleName: string; - autoModerationRuleTriggerType: AutoModerationRuleTriggerType; - channel: GuildTextBasedChannel | { id: Snowflake }; - }; - AUTO_MODERATION_USER_COMMUNICATIONDISABLED: { - autoModerationRuleName: string; - autoModerationRuleTriggerType: AutoModerationRuleTriggerType; - channel: GuildTextBasedChannel | { id: Snowflake }; - }; -} - -export interface GuildAuditLogsEntryTargetField< - TActionType extends GuildAuditLogsActionType, -> { - USER: User | null; - GUILD: Guild; - WEBHOOK: Webhook; - INVITE: Invite; - MESSAGE: TActionType extends 'MESSAGE_BULK_DELETE' - ? Guild | { id: Snowflake } - : User; - INTEGRATION: Integration; - CHANNEL: NonThreadGuildBasedChannel | { id: Snowflake; [x: string]: unknown }; - THREAD: ThreadChannel | { id: Snowflake; [x: string]: unknown }; - STAGE_INSTANCE: StageInstance; - STICKER: Sticker; - GUILD_SCHEDULED_EVENT: GuildScheduledEvent; - APPLICATION_COMMAND: ApplicationCommand | { id: Snowflake }; - AUTO_MODERATION: AutoModerationRule; -} - -export interface GuildAuditLogsFetchOptions< - T extends GuildAuditLogsResolvable, -> { - before?: Snowflake | GuildAuditLogsEntry; - after?: Snowflake | GuildAuditLogsEntry; - limit?: number; - user?: UserResolvable; - type?: T; -} - -export type GuildAuditLogsResolvable = - | keyof GuildAuditLogsIds - | GuildAuditLogsAction - | null; - -export type GuildAuditLogsTarget = - | GuildAuditLogsTypes[keyof GuildAuditLogsTypes][0] - | 'ALL' - | 'UNKNOWN'; - -export type GuildAuditLogsTargets = { - [Key in GuildAuditLogsTarget]?: string; -}; - -export type GuildBanResolvable = GuildBan | UserResolvable; - -export interface GuildChannelOverwriteOptions { - reason?: string; - type?: number; -} - -export type GuildChannelResolvable = Snowflake | GuildBasedChannel; - -export interface GuildChannelCreateOptions - extends Omit { - parent?: CategoryChannelResolvable; - type?: ExcludeEnum< - typeof ChannelTypes, - | 'DM' - | 'GROUP_DM' - | 'UNKNOWN' - | 'GUILD_PUBLIC_THREAD' - | 'GUILD_NEWS_THREAD' - | 'GUILD_PRIVATE_THREAD' - >; -} - -export interface GuildChannelCloneOptions extends GuildChannelCreateOptions { - name?: string; -} - -export interface GuildChannelOverwriteOptions { - reason?: string; - type?: number; -} - -export interface GuildCreateOptions { - afkChannelId?: Snowflake | number; - afkTimeout?: number; - channels?: PartialChannelData[]; - defaultMessageNotifications?: DefaultMessageNotificationLevel | number; - explicitContentFilter?: ExplicitContentFilterLevel | number; - icon?: BufferResolvable | Base64Resolvable | null; - roles?: PartialRoleData[]; - systemChannelFlags?: SystemChannelFlagsResolvable; - systemChannelId?: Snowflake | number; - verificationLevel?: VerificationLevel | number; -} - -export interface GuildWidgetSettings { - enabled: boolean; - channel: NonThreadGuildBasedChannel | null; -} - -export interface GuildEditData { - name?: string; - verificationLevel?: VerificationLevel | number | null; - explicitContentFilter?: ExplicitContentFilterLevel | number | null; - defaultMessageNotifications?: DefaultMessageNotificationLevel | number | null; - afkChannel?: VoiceChannelResolvable | null; - systemChannel?: TextChannelResolvable | null; - systemChannelFlags?: SystemChannelFlagsResolvable; - afkTimeout?: number; - icon?: BufferResolvable | Base64Resolvable | null; - owner?: GuildMemberResolvable; - splash?: BufferResolvable | Base64Resolvable | null; - discoverySplash?: BufferResolvable | Base64Resolvable | null; - banner?: BufferResolvable | Base64Resolvable | null; - rulesChannel?: TextChannelResolvable | null; - publicUpdatesChannel?: TextChannelResolvable | null; - preferredLocale?: string | null; - safetyAlertsChannel?: TextChannelResolvable | null; - premiumProgressBarEnabled?: boolean; - description?: string | null; - features?: GuildFeatures[]; -} - -export interface GroupDMChannelEditData { - name?: string; - icon?: BufferResolvable | Base64Resolvable | null; - owner?: UserResolvable; -} - -export interface GuildEmojiCreateOptions { - roles?: Collection | RoleResolvable[]; - reason?: string; -} - -export interface GuildEmojiEditData { - name?: string; - roles?: Collection | RoleResolvable[]; -} - -export interface GuildStickerCreateOptions { - description?: string | null; - reason?: string; -} - -export interface GuildStickerEditData { - name?: string; - description?: string | null; - tags?: string; -} - -export type GuildFeatures = - | 'ANIMATED_ICON' - | 'AUTO_MODERATION' - | 'BANNER' - | 'COMMERCE' - | 'COMMUNITY' - | 'CREATOR_MONETIZABLE_PROVISIONAL' - | 'CREATOR_STORE_PAGE' - | 'DISCOVERABLE' - | 'FEATURABLE' - | 'INVITES_DISABLED' - | 'INVITE_SPLASH' - | 'MEMBER_VERIFICATION_GATE_ENABLED' - | 'NEWS' - | 'PARTNERED' - | 'PREVIEW_ENABLED' - | 'VANITY_URL' - | 'VERIFIED' - | 'VIP_REGIONS' - | 'WELCOME_SCREEN_ENABLED' - | 'TICKETED_EVENTS_ENABLED' - | 'MORE_STICKERS' - | 'THREE_DAY_THREAD_ARCHIVE' - | 'SEVEN_DAY_THREAD_ARCHIVE' - | 'PRIVATE_THREADS' - | 'ROLE_ICONS' - | 'RAID_ALERTS_DISABLED' - | 'ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE' - | 'ROLE_SUBSCRIPTIONS_ENABLED'; - -export interface GuildMemberEditData { - nick?: string | null; - roles?: Collection | readonly RoleResolvable[]; - mute?: boolean; - deaf?: boolean; - channel?: GuildVoiceChannelResolvable | null; - communicationDisabledUntil?: DateResolvable | null; - flags?: GuildMemberFlagsResolvable; - avatar?: BufferResolvable | Base64Resolvable | null; - banner?: BufferResolvable | Base64Resolvable | null; - bio?: string | null; -} - -export type GuildMemberFlagsString = - | 'DID_REJOIN' - | 'COMPLETED_ONBOARDING' - | 'BYPASSES_VERIFICATION' - | 'STARTED_ONBOARDING'; - -export type GuildMemberFlagsResolvable = BitFieldResolvable< - GuildMemberFlagsString, - number ->; - -export type GuildMemberResolvable = GuildMember | UserResolvable; - -export type GuildResolvable = - | Guild - | NonThreadGuildBasedChannel - | GuildMember - | GuildEmoji - | Invite - | Role - | Snowflake; - -export interface GuildPruneMembersOptions { - count?: boolean; - days?: number; - dry?: boolean; - reason?: string; - roles?: RoleResolvable[]; -} - -export interface GuildWidgetSettingsData { - enabled: boolean; - channel: GuildChannelResolvable | null; -} - -export interface GuildSearchMembersOptions { - query: string; - limit?: number; - cache?: boolean; -} - -// TODO: use conditional types for better TS support -export interface GuildScheduledEventCreateOptions { - name: string; - scheduledStartTime: DateResolvable; - scheduledEndTime?: DateResolvable; - privacyLevel: GuildScheduledEventPrivacyLevel | number; - entityType: GuildScheduledEventEntityType | number; - description?: string; - channel?: GuildVoiceChannelResolvable; - entityMetadata?: GuildScheduledEventEntityMetadataOptions; - image?: BufferResolvable | Base64Resolvable | null; - reason?: string; - recurrenceRule?: GuildScheduledEventRecurrenceRuleOptions; -} - -export type GuildScheduledEventRecurrenceRuleOptions = - | BaseGuildScheduledEventRecurrenceRuleOptions< - GuildScheduledEventRecurrenceRuleFrequency.Yearly, - { - byMonth: readonly GuildScheduledEventRecurrenceRuleMonth[]; - byMonthDay: readonly number[]; - } - > - | BaseGuildScheduledEventRecurrenceRuleOptions< - GuildScheduledEventRecurrenceRuleFrequency.Monthly, - { - byNWeekday: readonly GuildScheduledEventRecurrenceRuleNWeekday[]; - } - > - | BaseGuildScheduledEventRecurrenceRuleOptions< - | GuildScheduledEventRecurrenceRuleFrequency.Weekly - | GuildScheduledEventRecurrenceRuleFrequency.Daily, - { - byWeekday: readonly GuildScheduledEventRecurrenceRuleWeekday[]; - } - >; - -type BaseGuildScheduledEventRecurrenceRuleOptions< - Frequency extends GuildScheduledEventRecurrenceRuleFrequency, - Extra extends {}, -> = { - startAt: DateResolvable; - interval: number; - frequency: Frequency; -} & Extra; - -export interface GuildScheduledEventEditOptions< - S extends GuildScheduledEventStatus, - T extends GuildScheduledEventSetStatusArg, -> extends Omit< - Partial, - 'channel' | 'recurrenceRule' - > { - channel?: GuildVoiceChannelResolvable | null; - status?: T | number; - recurrenceRule?: GuildScheduledEventRecurrenceRuleOptions | null; -} - -export interface GuildScheduledEventEntityMetadata { - location: string | null; -} - -export interface GuildScheduledEventEntityMetadataOptions { - location?: string; -} - -export type GuildScheduledEventEntityType = - keyof typeof GuildScheduledEventEntityTypes; - -export type GuildScheduledEventManagerFetchResult< - T extends - | GuildScheduledEventResolvable - | FetchGuildScheduledEventOptions - | FetchGuildScheduledEventsOptions, -> = T extends GuildScheduledEventResolvable | FetchGuildScheduledEventOptions - ? GuildScheduledEvent - : Collection; - -export type GuildScheduledEventManagerFetchSubscribersResult< - T extends FetchGuildScheduledEventSubscribersOptions, -> = T extends { withMember: true } - ? Collection> - : Collection>; - -export type GuildScheduledEventPrivacyLevel = - keyof typeof GuildScheduledEventPrivacyLevels; - -export type GuildScheduledEventResolvable = Snowflake | GuildScheduledEvent; - -export type GuildScheduledEventSetStatusArg< - T extends GuildScheduledEventStatus, -> = T extends 'SCHEDULED' - ? 'ACTIVE' | 'CANCELED' - : T extends 'ACTIVE' - ? 'COMPLETED' - : never; - -export type GuildScheduledEventStatus = - keyof typeof GuildScheduledEventStatuses; - -export interface GuildScheduledEventUser { - guildScheduledEventId: Snowflake; - user: User; - member: T extends true ? GuildMember : null; -} - -export type GuildTemplateResolvable = string; - -export type GuildVoiceChannelResolvable = VoiceBasedChannel | Snowflake; - -export type HexColorString = `#${string}`; - -export interface IncidentActions { - invitesDisabledUntil: Date | null; - dmsDisabledUntil: Date | null; - dmSpamDetectedAt: Date | null; - raidDetectedAt: Date | null; -} - -export interface IncidentActionsEditOptions { - invitesDisabledUntil?: DateResolvable | null | undefined; - dmsDisabledUntil?: DateResolvable | null | undefined; -} -export interface HTTPAttachmentData { - attachment: string | Buffer | Stream; - name: string; - file: Buffer | Stream; -} - -export interface HTTPErrorData { - json: unknown; - files: HTTPAttachmentData[]; - headers?: Record; -} - -export interface HTTPOptions { - agent?: Omit; - api?: string; - version?: number; - host?: string; - cdn?: string; - invite?: string; - template?: string; - headers?: Record; - scheduledEvent?: string; -} - -export interface ImageURLOptions extends Omit { - dynamic?: boolean; - format?: DynamicImageFormat; -} - -export type IntegrationType = - | 'twitch' - | 'youtube' - | 'discord' - | 'guild_subscription'; - -export interface InteractionCollectorOptions< - T extends Interaction, - Cached extends CacheType = CacheType, -> extends CollectorOptions<[T]> { - channel?: TextBasedChannelResolvable; - componentType?: MessageComponentType | MessageComponentTypes; - guild?: GuildResolvable; - interactionType?: InteractionType | InteractionTypes; - max?: number; - maxComponents?: number; - maxUsers?: number; - message?: CacheTypeReducer; -} - -export interface InteractionDeferReplyOptions { - ephemeral?: boolean; - fetchReply?: boolean; -} - -export type InteractionDeferUpdateOptions = Omit< - InteractionDeferReplyOptions, - 'ephemeral' ->; - -export interface InteractionReplyOptions - extends Omit { - ephemeral?: boolean; - fetchReply?: boolean; - flags?: BitFieldResolvable<'SUPPRESS_EMBEDS' | 'EPHEMERAL', number>; -} - -export type InteractionResponseType = keyof typeof InteractionResponseTypes; - -export type InteractionType = keyof typeof InteractionTypes; - -export interface InteractionUpdateOptions extends MessageEditOptions { - fetchReply?: boolean; -} - -export type IntentsString = - | 'GUILDS' - | 'GUILD_MEMBERS' - | 'GUILD_BANS' - | 'GUILD_EMOJIS_AND_STICKERS' - | 'GUILD_INTEGRATIONS' - | 'GUILD_WEBHOOKS' - | 'GUILD_INVITES' - | 'GUILD_VOICE_STATES' - | 'GUILD_PRESENCES' - | 'GUILD_MESSAGES' - | 'GUILD_MESSAGE_REACTIONS' - | 'GUILD_MESSAGE_TYPING' - | 'DIRECT_MESSAGES' - | 'DIRECT_MESSAGE_REACTIONS' - | 'DIRECT_MESSAGE_TYPING' - | 'MESSAGE_CONTENT' - | 'GUILD_SCHEDULED_EVENTS' - | 'AUTO_MODERATION_CONFIGURATION' - | 'AUTO_MODERATION_EXECUTION'; - -export type GuildInvitableChannelResolvable = - | TextChannel - | VoiceChannel - | NewsChannel - | StoreChannel - | StageChannel - | Snowflake; - -export interface CreateInviteOptions { - temporary?: boolean; - maxAge?: number; - maxUses?: number; - unique?: boolean; - reason?: string; - targetApplication?: ApplicationResolvable; - targetUser?: UserResolvable; - targetType?: InviteTargetTypes; -} - -export type IntegrationExpireBehaviors = 'REMOVE_ROLE' | 'KICK'; - -export type InviteResolvable = string; - -export type InviteScope = - | 'applications.builds.read' - | 'applications.commands' - | 'applications.entitlements' - | 'applications.store.update' - | 'bot' - | 'connections' - | 'email' - | 'identify' - | 'guilds' - | 'guilds.join' - | 'gdm.join' - | 'webhook.incoming' - | 'role_connections.write'; - -export interface LifetimeFilterOptions { - excludeFromSweep?: ( - value: V, - key: K, - collection: LimitedCollection, - ) => boolean; - getComparisonTimestamp?: ( - value: V, - key: K, - collection: LimitedCollection, - ) => number; - lifetime?: number; -} - -export interface MakeErrorOptions { - name: string; - message: string; - stack: string; -} - -export type MemberMention = UserMention | `<@!${Snowflake}>`; - -export type MembershipState = keyof typeof MembershipStates; - -export type MessageActionRowComponent = MessageButton | MessageSelectMenu; - -export type MessageActionRowComponentOptions = - | (Required & MessageButtonOptions) - | (Required & MessageSelectMenuOptions); - -export type MessageActionRowComponentResolvable = - | MessageActionRowComponent - | MessageActionRowComponentOptions - | APIMessageActionRowComponent; - -export type ModalActionRowComponent = TextInputComponent; - -export type ModalActionRowComponentOptions = TextInputComponentOptions; - -export type ModalActionRowComponentResolvable = - | ModalActionRowComponent - | ModalActionRowComponentOptions - | APIModalActionRowComponent; - -export interface MessageActionRowOptions< - T extends - | MessageActionRowComponentResolvable - | ModalActionRowComponentResolvable = MessageActionRowComponentResolvable, -> extends BaseMessageComponentOptions { - components: T[]; -} - -export interface MessageActivity { - partyId: string; - type: MessageActivityType; -} - -export interface BaseButtonOptions extends BaseMessageComponentOptions { - type: 'BUTTON' | MessageComponentTypes.BUTTON; - disabled?: boolean; - emoji?: EmojiIdentifierResolvable; - label?: string; -} - -export interface LinkButtonOptions extends BaseButtonOptions { - style: 'LINK' | MessageButtonStyles.LINK; - url: string; -} - -export interface InteractionButtonOptions extends BaseButtonOptions { - style: ExcludeEnum; - customId: string; -} - -export type MessageButtonOptions = InteractionButtonOptions | LinkButtonOptions; - -export type MessageButtonStyle = keyof typeof MessageButtonStyles; - -export type MessageButtonStyleResolvable = - | MessageButtonStyle - | MessageButtonStyles; - -export interface MessageCollectorOptions extends CollectorOptions<[Message]> { - max?: number; - maxProcessed?: number; -} - -export type MessageComponent = - | BaseMessageComponent - | MessageActionRow - | MessageButton - | MessageSelectMenu; - -export type MessageComponentCollectorOptions< - T extends MessageComponentInteraction | ModalSubmitInteraction, -> = Omit< - InteractionCollectorOptions, - 'channel' | 'message' | 'guild' | 'interactionType' ->; - -export type MessageChannelComponentCollectorOptions< - T extends MessageComponentInteraction | ModalSubmitInteraction, -> = Omit< - InteractionCollectorOptions, - 'channel' | 'guild' | 'interactionType' ->; - -export type MessageComponentOptions = - | BaseMessageComponentOptions - | MessageActionRowOptions - | MessageButtonOptions - | MessageSelectMenuOptions; - -export type MessageComponentType = keyof typeof MessageComponentTypes; - -export type MessageComponentInteractableType = - keyof typeof MessageComponentInteractables; - -export type MessageComponentTypeResolvable = - | MessageComponentType - | MessageComponentTypes; - -export type MessageComponentInteractableResolvable = - | MessageComponentInteractableType - | MessageComponentInteractables; - -export type GuildForumThreadMessageCreateOptions = Omit< - MessageOptions, - 'poll' -> & - Pick; - -export type TopLevelComponent = - | MessageActionRow - | ContainerComponent - | FileComponent - | MediaGalleryComponent - | SectionComponent - | SeparatorComponent - | TextDisplayComponent; - -export interface MessageEditOptions { - attachments?: MessageAttachment[]; - content?: string | null; - embeds?: (MessageEmbed | MessageEmbedOptions | APIEmbed)[] | null; - files?: (FileOptions | BufferResolvable | Stream | MessageAttachment)[]; - flags?: BitFieldResolvable; - allowedMentions?: MessageMentionOptions; - components?: ( - | MessageActionRow - | (Required & MessageActionRowOptions) - )[]; -} - -export interface MessageEmbedAuthor { - name: string; - url?: string; - iconURL?: string; - proxyIconURL?: string; -} - -export interface MessageEmbedFooter { - text: string; - iconURL?: string; - proxyIconURL?: string; -} - -export interface MessageEmbedImage { - url: string; - proxyURL?: string; - height?: number; - width?: number; -} - -export interface MessageEmbedOptions { - title?: string; - description?: string; - url?: string; - timestamp?: Date | number; - color?: ColorResolvable; - fields?: EmbedFieldData[]; - author?: Partial & { - icon_url?: string; - proxy_icon_url?: string; - }; - thumbnail?: Partial & { proxy_url?: string }; - image?: Partial & { proxy_url?: string }; - video?: Partial & { proxy_url?: string }; - footer?: Partial & { - icon_url?: string; - proxy_icon_url?: string; - }; -} - -export interface MessageEmbedProvider { - name: string; - url: string; -} - -export interface MessageEmbedThumbnail { - url: string; - proxyURL?: string; - height?: number; - width?: number; -} - -export interface MessageEmbedVideo { - url?: string; - proxyURL?: string; - height?: number; - width?: number; -} - -export interface MessageEvent { - data: WebSocket.Data; - type: string; - target: WebSocket; -} - -export type MessageFlagsString = - | 'CROSSPOSTED' - | 'IS_CROSSPOST' - | 'SUPPRESS_EMBEDS' - | 'SOURCE_MESSAGE_DELETED' - | 'URGENT' - | 'HAS_THREAD' - | 'EPHEMERAL' - | 'LOADING' - | 'FAILED_TO_MENTION_SOME_ROLES_IN_THREAD' - | 'GUILD_FEED_HIDDEN' - | 'SHOULD_SHOW_LINK_NOT_DISCORD_WARNING' - | 'SUPPRESS_NOTIFICATIONS' - | 'IS_VOICE_MESSAGE' - | 'HAS_SNAPSHOT' - | 'IS_COMPONENTS_V2'; - -export interface MessageInteraction { - id: Snowflake; - type: InteractionType; - commandName: string; - user: User; -} - -export interface MessageMentionsHasOptions { - ignoreDirect?: boolean; - ignoreRoles?: boolean; - ignoreRepliedUser?: boolean; - ignoreEveryone?: boolean; -} - -export interface MessageMentionOptions { - parse?: MessageMentionTypes[]; - roles?: Snowflake[]; - users?: Snowflake[]; - repliedUser?: boolean; -} - -export type MessageMentionTypes = 'roles' | 'users' | 'everyone'; - -export interface MessageSnapshot - extends Partialize< - Message, - null, - Exclude< - keyof Message, - | 'attachments' - | 'client' - | 'components' - | 'content' - | 'createdTimestamp' - | 'editedTimestamp' - | 'embeds' - | 'flags' - | 'mentions' - | 'stickers' - | 'type' - > - > {} - -export interface MessageOptions { - activity?: MessageActivity; - tts?: boolean; - nonce?: string | number; - content?: string | null; - embeds?: (MessageEmbed | MessageEmbedOptions | APIEmbed)[]; - components?: ( - | MessageActionRow - | (Required & MessageActionRowOptions) - )[]; - allowedMentions?: MessageMentionOptions; - files?: (FileOptions | BufferResolvable | Stream | MessageAttachment)[]; - reply?: ReplyOptions; - forward?: ForwardOptions; - stickers?: StickerResolvable[]; - attachments?: MessageAttachment[]; - flags?: BitFieldResolvable< - 'SUPPRESS_EMBEDS' | 'SUPPRESS_NOTIFICATIONS' | 'IS_VOICE_MESSAGE', - number - >; - poll?: Poll; -} - -export type MessageReactionResolvable = MessageReaction | Snowflake | string; - -export interface MessageReference { - channelId: Snowflake; - guildId: Snowflake | undefined; - messageId: Snowflake | undefined; - type: MessageReferenceTypes; -} - -export type MessageResolvable = Message | Snowflake; - -export interface BaseMessageSelectMenuOptions { - type?: SelectMenuComponentType | SelectMenuComponentTypes; - customId?: string; - disabled?: boolean; - maxValues?: number; - minValues?: number; - placeholder?: string; -} - -export interface StringMessageSelectMenuOptions - extends BaseMessageSelectMenuOptions { - type?: 'STRING_SELECT' | SelectMenuComponentTypes.STRING_SELECT; - options?: MessageSelectOptionData[]; -} - -export interface ChannelMessageSelectMenuOptions - extends BaseMessageSelectMenuOptions { - type?: 'CHANNEL_SELECT' | SelectMenuComponentTypes.CHANNEL_SELECT; - channelTypes?: ChannelTypes[]; -} - -export interface OtherMessageSelectMenuOptions - extends BaseMessageSelectMenuOptions { - type?: ExcludeEnum< - typeof SelectMenuComponentTypes, - 'CHANNEL_SELECT' | 'STRING_SELECT' - >; -} - -export type MessageSelectMenuOptions = - | StringMessageSelectMenuOptions - | ChannelMessageSelectMenuOptions - | OtherMessageSelectMenuOptions; - -export interface MessageSelectOption { - default: boolean; - description: string | null; - emoji: APIPartialEmoji | null; - label: string; - value: string; -} - -export interface MessageSelectOptionData { - default?: boolean; - description?: string; - emoji?: EmojiIdentifierResolvable; - label: string; - value: string; -} - -export type MessageTarget = - | Interaction - | InteractionWebhook - | TextBasedChannel - | User - | GuildMember - | Webhook - | WebhookClient - | Message - | MessageManager; - -export type MessageType = keyof typeof MessageTypes; - -export type MFALevel = keyof typeof MFALevels; - -export interface ModalOptions { - components: - | MessageActionRow[] - | MessageActionRowOptions[]; - customId: string; - title: string; -} - -export type ModalSubmitInteractionCollectorOptions< - T extends ModalSubmitInteraction, -> = Omit< - InteractionCollectorOptions, - 'channel' | 'message' | 'guild' | 'interactionType' ->; - -export interface MultipleShardRespawnOptions { - shardDelay?: number; - respawnDelay?: number; - timeout?: number; -} - -export interface MultipleShardSpawnOptions { - amount?: number | 'auto'; - delay?: number; - timeout?: number; -} - -export type NSFWLevel = keyof typeof NSFWLevels; - -export interface OverwriteData { - allow?: PermissionResolvable; - deny?: PermissionResolvable; - id: GuildMemberResolvable | RoleResolvable; - type?: OverwriteType; -} - -export type OverwriteResolvable = PermissionOverwrites | OverwriteData; - -export type OverwriteType = 'member' | 'role'; - -export interface PartialModalActionRow { - type: MessageComponentType; - components: PartialTextInputData[]; -} - -export interface PartialTextInputData { - value: string; - // TODO: use dapi types - type: MessageComponentType; - customId: string; -} - -export type PermissionFlags = Record; - -export type PermissionOverwriteOptions = Partial< - Record ->; - -export type PermissionResolvable = BitFieldResolvable; - -export type PermissionOverwriteResolvable = - | UserResolvable - | RoleResolvable - | PermissionOverwrites; - -export type PermissionString = - | 'CREATE_INSTANT_INVITE' - | 'KICK_MEMBERS' - | 'BAN_MEMBERS' - | 'ADMINISTRATOR' - | 'MANAGE_CHANNELS' - | 'MANAGE_GUILD' - | 'ADD_REACTIONS' - | 'VIEW_AUDIT_LOG' - | 'PRIORITY_SPEAKER' - | 'STREAM' - | 'VIEW_CHANNEL' - | 'SEND_MESSAGES' - | 'SEND_TTS_MESSAGES' - | 'MANAGE_MESSAGES' - | 'EMBED_LINKS' - | 'ATTACH_FILES' - | 'READ_MESSAGE_HISTORY' - | 'MENTION_EVERYONE' - | 'USE_EXTERNAL_EMOJIS' - | 'VIEW_GUILD_INSIGHTS' - | 'CONNECT' - | 'SPEAK' - | 'MUTE_MEMBERS' - | 'DEAFEN_MEMBERS' - | 'MOVE_MEMBERS' - | 'USE_VAD' - | 'CHANGE_NICKNAME' - | 'MANAGE_NICKNAMES' - | 'MANAGE_ROLES' - | 'MANAGE_WEBHOOKS' - | 'MANAGE_EMOJIS_AND_STICKERS' - | 'USE_APPLICATION_COMMANDS' - | 'REQUEST_TO_SPEAK' - | 'MANAGE_THREADS' - | 'USE_PUBLIC_THREADS' - | 'CREATE_PUBLIC_THREADS' - | 'USE_PRIVATE_THREADS' - | 'CREATE_PRIVATE_THREADS' - | 'USE_EXTERNAL_STICKERS' - | 'SEND_MESSAGES_IN_THREADS' - | 'START_EMBEDDED_ACTIVITIES' - | 'MODERATE_MEMBERS' - | 'MANAGE_EVENTS' - | 'VIEW_CREATOR_MONETIZATION_ANALYTICS' - | 'USE_SOUNDBOARD' - | 'CREATE_GUILD_EXPRESSIONS' - | 'CREATE_EVENTS' - | 'USE_EXTERNAL_SOUNDS' - | 'SEND_VOICE_MESSAGES' - | 'USE_CLYDE_AI' - | 'SET_VOICE_CHANNEL_STATUS' - | 'SEND_POLLS' - | 'USE_EXTERNAL_APPS'; - -export type RecursiveArray = ReadonlyArray>; - -export type RecursiveReadonlyArray = ReadonlyArray< - T | RecursiveReadonlyArray ->; - -export interface PartialRecipient { - username: string; -} - -export type PremiumTier = keyof typeof PremiumTiers; - -export interface PresenceData { - status?: PresenceStatusData; - afk?: boolean; - activities?: (ActivitiesOptions | RichPresence | SpotifyRPC | CustomStatus)[]; - shardId?: number | number[]; -} - -export type PresenceResolvable = Presence | UserResolvable | Snowflake; - -export interface PartialChannelData { - id?: Snowflake | number; - parentId?: Snowflake | number; - type?: ExcludeEnum< - typeof ChannelTypes, - | 'DM' - | 'GROUP_DM' - | 'GUILD_NEWS' - | 'GUILD_STORE' - | 'UNKNOWN' - | 'GUILD_NEWS_THREAD' - | 'GUILD_PUBLIC_THREAD' - | 'GUILD_PRIVATE_THREAD' - | 'GUILD_STAGE_VOICE' - >; - name: string; - topic?: string; - nsfw?: boolean; - bitrate?: number; - userLimit?: number; - rtcRegion?: string | null; - videoQualityMode?: VideoQualityMode; - permissionOverwrites?: PartialOverwriteData[]; - rateLimitPerUser?: number; - availableTags?: GuildForumTagData[]; - defaultReactionEmoji?: DefaultReactionEmoji; - defaultThreadRateLimitPerUser?: number; -} - -export type Partialize< - T extends AllowedPartial, - N extends keyof T | null = null, - M extends keyof T | null = null, - E extends keyof T | '' = '', -> = { - readonly client: Client; - id: Snowflake; - partial: true; -} & { - [K in keyof Omit]: K extends N - ? null - : K extends M - ? T[K] | null - : T[K]; -}; - -export interface PartialDMChannel - extends Partialize { - lastMessageId: undefined; -} - -export interface PartialGuildMember - extends Partialize {} - -export interface PartialMessage - extends Partialize< - Message, - 'type' | 'system' | 'pinned' | 'tts', - 'content' | 'cleanContent' | 'author' - > {} - -export interface PartialMessageReaction - extends Partialize {} - -export interface PartialGuildScheduledEvent - extends Partialize< - GuildScheduledEvent, - 'userCount', - 'status' | 'privacyLevel' | 'name' | 'entityType' - > {} - -export interface PartialOverwriteData { - id: Snowflake | number; - type?: OverwriteType; - allow?: PermissionResolvable; - deny?: PermissionResolvable; -} - -export interface PartialRoleData extends RoleData { - id?: Snowflake | number; -} - -export type PartialTypes = - | 'USER' - | 'CHANNEL' - | 'GUILD_MEMBER' - | 'MESSAGE' - | 'REACTION' - | 'GUILD_SCHEDULED_EVENT'; - -export interface PartialUser - extends Partialize {} - -export type PresenceStatusData = ClientPresenceStatus | 'invisible'; - -export type PresenceStatus = PresenceStatusData | 'offline'; - -export type PrivacyLevel = keyof typeof PrivacyLevels; - -export interface RateLimitData { - timeout: number; - limit: number; - method: string; - path: string; - route: string; - global: boolean; -} - -export interface InvalidRequestWarningData { - count: number; - remainingTime: number; -} - -export interface ReactionCollectorOptions - extends CollectorOptions<[MessageReaction, User]> { - max?: number; - maxEmojis?: number; - maxUsers?: number; -} - -export interface ReplyOptions { - messageReference: MessageResolvable; - failIfNotExists?: boolean; -} - -export interface BaseForwardOptions { - message: MessageResolvable; - channel?: TextBasedChannelResolvable; - guild?: GuildResolvable; -} - -export type ForwardOptionsWithMandatoryChannel = BaseForwardOptions & - Required>; - -export interface ForwardOptionsWithOptionalChannel extends BaseForwardOptions { - message: Exclude; -} - -export type ForwardOptions = - | ForwardOptionsWithMandatoryChannel - | ForwardOptionsWithOptionalChannel; - -export interface ReplyMessageOptions - extends Omit { - failIfNotExists?: boolean; -} -export interface ResolvedOverwriteOptions { - allow: Permissions; - deny: Permissions; -} - -export interface RoleData { - name?: string; - /** @deprecated Use {@link RoleData.colors} instead. */ - color?: ColorResolvable; - colors?: RoleColorsResolvable; - hoist?: boolean; - position?: number; - permissions?: PermissionResolvable; - mentionable?: boolean; - icon?: BufferResolvable | Base64Resolvable | EmojiResolvable | null; - unicodeEmoji?: string | null; -} - -export type RoleMention = '@everyone' | `<@&${Snowflake}>`; - -export interface RolePosition { - role: RoleResolvable; - position: number; -} - -export type RoleResolvable = Role | Snowflake; - -export interface RoleTagData { - botId?: Snowflake; - integrationId?: Snowflake; - premiumSubscriberRole?: true; - subscriptionListingId?: Snowflake; - availableForPurchase?: true; - guildConnections?: true; -} - -export interface SetChannelPositionOptions { - relative?: boolean; - reason?: string; -} - -export interface SetParentOptions { - lockPermissions?: boolean; - reason?: string; -} - -export interface SetRolePositionOptions { - relative?: boolean; - reason?: string; -} - -export type ShardingManagerMode = 'process' | 'worker'; - -export interface ShardingManagerOptions { - totalShards?: number | 'auto'; - shardList?: number[] | 'auto'; - mode?: ShardingManagerMode; - respawn?: boolean; - shardArgs?: string[]; - token?: string; - execArgv?: string[]; -} - -export { Snowflake }; - -export interface SplitOptions { - maxLength?: number; - char?: string | string[] | RegExp | RegExp[]; - prepend?: string; - append?: string; -} - -export interface StaticImageURLOptions { - format?: AllowedImageFormat; - size?: AllowedImageSize; -} - -export type StageInstanceResolvable = StageInstance | Snowflake; - -export interface StartThreadOptions { - name: string; - autoArchiveDuration?: ThreadAutoArchiveDuration | 'MAX'; - reason?: string; - rateLimitPerUser?: number; -} - -export type Status = number; - -export type VoiceStatus = number; - -export type StickerFormatType = keyof typeof StickerFormatTypes; - -export type StickerResolvable = Sticker | Snowflake; - -export type StickerType = keyof typeof StickerTypes; - -export type SystemChannelFlagsString = - | 'SUPPRESS_JOIN_NOTIFICATIONS' - | 'SUPPRESS_PREMIUM_SUBSCRIPTIONS' - | 'SUPPRESS_GUILD_REMINDER_NOTIFICATIONS' - | 'SUPPRESS_JOIN_NOTIFICATION_REPLIES' - | 'SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATIONS' - | 'SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATION_REPLIES'; - -export type SystemChannelFlagsResolvable = BitFieldResolvable< - SystemChannelFlagsString, - number ->; - -export type ChannelFlagsResolvable = BitFieldResolvable< - ChannelFlagsString, - number ->; - -export type SelectMenuComponentType = keyof typeof SelectMenuComponentTypes; - -export type SystemMessageType = Exclude< - MessageType, - 'DEFAULT' | 'REPLY' | 'APPLICATION_COMMAND' | 'CONTEXT_MENU_COMMAND' ->; - -export type StageChannelResolvable = StageChannel | Snowflake; - -export interface StageInstanceEditOptions { - topic?: string; - privacyLevel?: PrivacyLevel | number; -} - -export type SweeperKey = keyof SweeperDefinitions; - -export type CollectionSweepFilter = ( - value: V, - key: K, - collection: Collection, -) => boolean; - -export type SweepFilter = ( - collection: LimitedCollection, -) => - | ((value: V, key: K, collection: LimitedCollection) => boolean) - | null; - -export interface SweepOptions { - interval: number; - filter: GlobalSweepFilter; -} - -export interface LifetimeSweepOptions { - interval: number; - lifetime: number; - filter?: never; -} - -export interface SweeperDefinitions { - applicationCommands: [Snowflake, ApplicationCommand]; - autoModerationRules: [Snowflake, AutoModerationRule]; - bans: [Snowflake, GuildBan]; - emojis: [Snowflake, GuildEmoji]; - invites: [string, Invite, true]; - guildMembers: [Snowflake, GuildMember]; - messages: [Snowflake, Message, true]; - presences: [Snowflake, Presence]; - reactions: [string | Snowflake, MessageReaction]; - stageInstances: [Snowflake, StageInstance]; - stickers: [Snowflake, Sticker]; - threadMembers: [Snowflake, ThreadMember]; - threads: [Snowflake, ThreadChannel, true]; - users: [Snowflake, User]; - voiceStates: [Snowflake, VoiceState]; -} - -export type SweeperOptions = { - [K in keyof SweeperDefinitions]?: SweeperDefinitions[K][2] extends true - ? - | SweepOptions - | LifetimeSweepOptions - : SweepOptions; -}; - -export interface LimitedCollectionOptions { - maxSize?: number; - keepOverLimit?: ( - value: V, - key: K, - collection: LimitedCollection, - ) => boolean; - /** @deprecated Use Global Sweepers instead */ - sweepFilter?: SweepFilter; - /** @deprecated Use Global Sweepers instead */ - sweepInterval?: number; -} - -export type AnyChannel = - | CategoryChannel - | DMChannel - | PartialDMChannel - | GroupDMChannel - | NewsChannel - | StageChannel - | StoreChannel - | TextChannel - | ThreadChannel - | VoiceChannel - | ForumChannel - | MediaChannel; - -export type TextBasedChannel = Exclude< - Extract, - ForumChannel | MediaChannel ->; - -export type TextBasedChannelTypes = TextBasedChannel['type']; - -export interface TextInputComponentOptions extends BaseMessageComponentOptions { - customId?: string; - label?: string; - minLength?: number; - maxLength?: number; - placeholder?: string; - required?: boolean; - style?: TextInputStyleResolvable; - value?: string; -} - -export type TextInputStyle = keyof typeof TextInputStyles; - -export type TextInputStyleResolvable = TextInputStyle | TextInputStyles; -export interface IntegrationAccount { - id: string | Snowflake; - name: string; -} - -export type VoiceBasedChannel = Extract; - -export type GuildBasedChannel = Extract; - -export type NonThreadGuildBasedChannel = Exclude< - GuildBasedChannel, - ThreadChannel ->; - -export type GuildTextBasedChannel = Extract< - GuildBasedChannel, - TextBasedChannel ->; - -export type TextChannelResolvable = Snowflake | TextChannel; - -export type TextBasedChannelResolvable = Snowflake | TextBasedChannel; - -export type ThreadAutoArchiveDuration = 60 | 1440 | 4320 | 10080; - -export type ThreadChannelResolvable = ThreadChannel | Snowflake; - -export type ThreadChannelTypes = - | 'GUILD_NEWS_THREAD' - | 'GUILD_PUBLIC_THREAD' - | 'GUILD_PRIVATE_THREAD'; - -export interface GuildTextThreadCreateOptions - extends StartThreadOptions { - startMessage?: MessageResolvable; - type?: AllowedThreadType; - invitable?: AllowedThreadType extends 'GUILD_PRIVATE_THREAD' | 12 - ? boolean - : never; - rateLimitPerUser?: number; -} - -export interface GuildForumThreadCreateOptions extends StartThreadOptions { - message: GuildForumThreadMessageCreateOptions | MessagePayload; - appliedTags?: Snowflake[]; -} - -export interface ThreadEditData { - name?: string; - archived?: boolean; - autoArchiveDuration?: ThreadAutoArchiveDuration | 'MAX'; - rateLimitPerUser?: number; - locked?: boolean; - invitable?: boolean; - appliedTags?: Snowflake[]; - flags?: ChannelFlagsResolvable; -} - -export type ThreadMemberFlagsString = ''; - -export type ThreadMemberResolvable = ThreadMember | UserResolvable; - -export type UserFlagsString = - | 'DISCORD_EMPLOYEE' - | 'PARTNERED_SERVER_OWNER' - | 'HYPESQUAD_EVENTS' - | 'BUGHUNTER_LEVEL_1' - | 'HOUSE_BRAVERY' - | 'HOUSE_BRILLIANCE' - | 'HOUSE_BALANCE' - | 'EARLY_SUPPORTER' - | 'TEAM_USER' - | 'BUGHUNTER_LEVEL_2' - | 'VERIFIED_BOT' - | 'EARLY_VERIFIED_BOT_DEVELOPER' - | 'DISCORD_CERTIFIED_MODERATOR' - | 'BOT_HTTP_INTERACTIONS' - | 'ACTIVE_DEVELOPER'; - -export type UserMention = `<@${Snowflake}>`; - -export type UserResolvable = - | User - | Snowflake - | Message - | GuildMember - | ThreadMember; - -export interface Vanity { - code: string | null; - uses: number; -} - -export type VerificationLevel = keyof typeof VerificationLevels; - -export type VideoQualityMode = keyof typeof VideoQualityModes; - -export type VoiceBasedChannelTypes = VoiceBasedChannel['type']; - -export type VoiceChannelResolvable = Snowflake | VoiceChannel; - -export type WebhookClientData = - | WebhookClientDataIdWithToken - | WebhookClientDataURL; - -export interface WebhookClientDataIdWithToken { - id: Snowflake; - token: string; -} - -export interface WebhookClientDataURL { - url: string; -} - -export type WebhookClientOptions = Pick< - ClientOptions, - | 'allowedMentions' - | 'restTimeOffset' - | 'restRequestTimeout' - | 'retryLimit' - | 'http' ->; - -export interface WebhookEditData { - name?: string; - avatar?: BufferResolvable | null; - channel?: - | GuildTextChannelResolvable - | VoiceChannel - | StageChannel - | ForumChannel - | MediaChannel; -} - -export type WebhookEditMessageOptions = Pick< - WebhookMessageOptions, - | 'content' - | 'embeds' - | 'files' - | 'allowedMentions' - | 'components' - | 'attachments' - | 'threadId' ->; -export interface InteractionEditReplyOptions extends WebhookEditMessageOptions { - message?: MessageResolvable | '@original'; -} - -export interface WebhookFetchMessageOptions { - cache?: boolean; - threadId?: Snowflake; -} - -export interface WebhookMessageOptions - extends Omit { - username?: string; - avatarURL?: string; - threadId?: Snowflake; - threadName?: string; - appliedTags?: Snowflake[]; - withComponents?: boolean; -} - -export type WebhookType = keyof typeof WebhookTypes; - -export interface WebSocketOptions { - agent?: Omit; - compress?: boolean; - properties?: WebSocketProperties; -} - -export interface WebSocketProperties { - os?: string; - browser?: string; - device?: string; - /** @deprecated Use {@link os} instead. */ - $os?: string; - /** @deprecated Use {@link browser} instead. */ - $browser?: string; - /** @deprecated Use {@link device} instead. */ - $device?: string; -} - -export interface WidgetActivity { - name: string; -} - -export interface WidgetChannel { - id: Snowflake; - name: string; - position: number; -} - -export interface WelcomeChannelData { - description: string; - channel: - | TextChannel - | NewsChannel - | StoreChannel - | ForumChannel - | MediaChannel - | Snowflake; - emoji?: EmojiIdentifierResolvable; -} - -export interface WelcomeScreenEditData { - enabled?: boolean; - description?: string; - welcomeChannels?: WelcomeChannelData[]; -} - -export type WSEventType = - | 'READY' - | 'RESUMED' - | 'APPLICATION_COMMAND_CREATE' - | 'APPLICATION_COMMAND_DELETE' - | 'APPLICATION_COMMAND_PERMISSIONS_UPDATE' - | 'APPLICATION_COMMAND_UPDATE' - | 'AUTO_MODERATION_ACTION_EXECUTION' - | 'AUTO_MODERATION_RULE_CREATE' - | 'AUTO_MODERATION_RULE_DELETE' - | 'AUTO_MODERATION_RULE_UPDATE' - | 'GUILD_CREATE' - | 'GUILD_DELETE' - | 'GUILD_UPDATE' - | 'INVITE_CREATE' - | 'INVITE_DELETE' - | 'GUILD_MEMBER_ADD' - | 'GUILD_MEMBER_REMOVE' - | 'GUILD_MEMBER_UPDATE' - | 'GUILD_MEMBERS_CHUNK' - | 'GUILD_ROLE_CREATE' - | 'GUILD_ROLE_DELETE' - | 'GUILD_ROLE_UPDATE' - | 'GUILD_BAN_ADD' - | 'GUILD_BAN_REMOVE' - | 'GUILD_EMOJIS_UPDATE' - | 'GUILD_INTEGRATIONS_UPDATE' - | 'CHANNEL_CREATE' - | 'CHANNEL_DELETE' - | 'CHANNEL_UPDATE' - | 'CHANNEL_PINS_UPDATE' - | 'MESSAGE_CREATE' - | 'MESSAGE_DELETE' - | 'MESSAGE_UPDATE' - | 'MESSAGE_DELETE_BULK' - | 'MESSAGE_REACTION_ADD' - | 'MESSAGE_REACTION_REMOVE' - | 'MESSAGE_REACTION_REMOVE_ALL' - | 'MESSAGE_REACTION_REMOVE_EMOJI' - | 'THREAD_CREATE' - | 'THREAD_UPDATE' - | 'THREAD_DELETE' - | 'THREAD_LIST_SYNC' - | 'THREAD_MEMBER_UPDATE' - | 'THREAD_MEMBERS_UPDATE' - | 'USER_UPDATE' - | 'PRESENCE_UPDATE' - | 'TYPING_START' - | 'VOICE_STATE_UPDATE' - | 'VOICE_SERVER_UPDATE' - | 'WEBHOOKS_UPDATE' - | 'INTERACTION_CREATE' - | 'STAGE_INSTANCE_CREATE' - | 'STAGE_INSTANCE_UPDATE' - | 'STAGE_INSTANCE_DELETE' - | 'GUILD_STICKERS_UPDATE'; - -export type Serialized = T extends symbol | bigint | (() => any) - ? never - : T extends number | string | boolean | undefined - ? T - : T extends { toJSON(): infer R } - ? R - : T extends ReadonlyArray - ? Serialized[] - : T extends ReadonlyMap | ReadonlySet - ? {} - : { [K in keyof T]: Serialized }; - -//#endregion - -//#region Voice - -/** - * @internal Use `DiscordGatewayAdapterLibraryMethods` from `@discordjs/voice` instead. - */ -export interface InternalDiscordGatewayAdapterLibraryMethods { - onVoiceServerUpdate(data: GatewayVoiceServerUpdateDispatchData): void; - onVoiceStateUpdate(data: GatewayVoiceStateUpdateDispatchData): void; - destroy(): void; -} - -/** - * @internal Use `DiscordGatewayAdapterImplementerMethods` from `@discordjs/voice` instead. - */ -export interface InternalDiscordGatewayAdapterImplementerMethods { - sendPayload(payload: unknown): boolean; - destroy(): void; -} - -/** - * @internal Use `DiscordGatewayAdapterCreator` from `@discordjs/voice` instead. - */ -export type InternalDiscordGatewayAdapterCreator = ( - methods: InternalDiscordGatewayAdapterLibraryMethods, -) => InternalDiscordGatewayAdapterImplementerMethods; - -//#endregion diff --git a/vendor/discord.js-selfbot-v13/typings/index.test-d.ts b/vendor/discord.js-selfbot-v13/typings/index.test-d.ts deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/discord.js-selfbot-v13/typings/rawDataTypes.d.ts b/vendor/discord.js-selfbot-v13/typings/rawDataTypes.d.ts deleted file mode 100644 index aa93f69..0000000 --- a/vendor/discord.js-selfbot-v13/typings/rawDataTypes.d.ts +++ /dev/null @@ -1,429 +0,0 @@ -// These are aggregate types that are used in the typings file but do not exist as actual exported values. -// To prevent them from showing up in an editor, they are imported from here instead of exporting them there directly. - -import { - APIActionRowComponent, - APIActionRowComponentTypes, - APIApplication, - APIApplicationCommand, - APIApplicationCommandInteraction, - APIAuditLog, - APIAuditLogEntry, - APIBan, - APIChannel, - APIEmoji, - APIExtendedInvite, - APIGuildIntegration, - APIGuildIntegrationApplication, - APIGuildMember, - APIGuildPreview, - APIGuildScheduledEvent, - APIGuildWelcomeScreen, - APIGuildWelcomeScreenChannel, - APIGuildWidget, - APIGuildWidgetMember, - APIInteractionDataResolvedChannel, - APIInteractionDataResolvedGuildMember, - APIInteractionGuildMember, - APIInvite, - APIInviteStageInstance, - APIMessage, - APIMessageButtonInteractionData, - APIMessageComponentInteraction, - APIMessageSelectMenuInteractionData, - APIModalSubmitInteraction, - APIOverwrite, - APIPartialChannel, - APIPartialEmoji, - APIPartialGuild, - APIReaction, - APIRole, - APIStageInstance, - APISticker, - APIStickerItem, - APIStickerPack, - APITeam, - APITeamMember, - APITemplate, - APITextInputComponent, - APIThreadMember, - APIUnavailableGuild, - APIUser, - APIVoiceRegion, - APIWebhook, - GatewayActivity, - GatewayActivityAssets, - GatewayActivityEmoji, - GatewayGuildBanAddDispatchData, - GatewayGuildMemberAddDispatchData, - GatewayGuildMemberUpdateDispatchData, - GatewayInteractionCreateDispatchData, - GatewayInviteCreateDispatchData, - GatewayInviteDeleteDispatchData, - GatewayMessageReactionAddDispatchData, - GatewayMessageUpdateDispatchData, - GatewayPresenceUpdate, - GatewayReadyDispatchData, - GatewayTypingStartDispatchData, - GatewayVoiceState, - GuildDefaultMessageNotifications, - GuildExplicitContentFilter, - GuildFeature, - GuildHubType, - GuildMFALevel, - GuildNSFWLevel, - GuildPremiumTier, - GuildSystemChannelFlags, - GuildVerificationLevel, - LocalizationMap, - Permissions, - RESTAPIPartialCurrentUserGuild, - RESTGetAPIWebhookWithTokenResult, - RESTPatchAPIChannelMessageJSONBody, - RESTPatchAPICurrentGuildMemberNicknameJSONBody, - RESTPatchAPIInteractionFollowupJSONBody, - RESTPatchAPIInteractionOriginalResponseJSONBody, - RESTPatchAPIWebhookWithTokenJSONBody, - RESTPostAPIChannelMessageJSONBody, - RESTPostAPIInteractionCallbackFormDataBody, - RESTPostAPIInteractionFollowupJSONBody, - RESTPostAPIWebhookWithTokenJSONBody, - Snowflake, -} from 'discord-api-types/v10'; -import { Guild, GuildChannel, PermissionOverwrites } from '.'; -import type { - ApplicationRoleConnectionMetadataTypes, - AutoModerationActionTypes, - AutoModerationRuleEventTypes, - AutoModerationRuleKeywordPresetTypes, - AutoModerationRuleTriggerTypes, - MessageComponentTypes, - SeparatorSpacingSizes, -} from './enums'; - -export type RawActivityData = GatewayActivity; - -export type RawApplicationData = - | RawClientApplicationData - | RawIntegrationApplicationData; -export type RawClientApplicationData = - | GatewayReadyDispatchData['application'] - | APIMessage['application']; -export type RawIntegrationApplicationData = - | APIGuildIntegrationApplication - | Partial; - -export type RawApplicationCommandData = APIApplicationCommand; - -export type RawChannelData = - | RawGuildChannelData - | RawThreadChannelData - | RawDMChannelData - | RawPartialGroupDMChannelData; -export type RawDMChannelData = APIChannel | APIInteractionDataResolvedChannel; -export type RawGuildChannelData = - | APIChannel - | APIInteractionDataResolvedChannel - | Required; -export type RawPartialGroupDMChannelData = - | APIChannel - | Required; -export type RawThreadChannelData = - | APIChannel - | APIInteractionDataResolvedChannel; - -export type RawEmojiData = - | RawGuildEmojiData - | RawReactionEmojiData - | GatewayActivityEmoji - | Omit, 'animated'>; -export type RawGuildEmojiData = APIEmoji; -export type RawReactionEmojiData = APIEmoji | APIPartialEmoji; - -export type RawGuildAuditLogData = APIAuditLog; - -export type RawGuildAuditLogEntryData = APIAuditLogEntry; - -export type RawGuildBanData = GatewayGuildBanAddDispatchData | APIBan; - -export type RawGuildData = APIGuild | APIUnavailableGuild; -export type RawAnonymousGuildData = RawGuildData | RawInviteGuildData; -export type RawBaseGuildData = RawAnonymousGuildData | RawOAuth2GuildData; -export type RawInviteGuildData = APIPartialGuild; -export type RawOAuth2GuildData = RESTAPIPartialCurrentUserGuild; - -export type RawGuildMemberData = - | APIGuildMember - | APIInteractionGuildMember - | APIInteractionDataResolvedGuildMember - | GatewayGuildMemberAddDispatchData - | GatewayGuildMemberUpdateDispatchData - | Required - | { user: { id: Snowflake } }; -export type RawThreadMemberData = APIThreadMember; - -export type RawGuildPreviewData = APIGuildPreview; - -export type RawGuildScheduledEventData = APIGuildScheduledEvent; - -export type RawGuildTemplateData = APITemplate; - -export type RawIntegrationData = APIGuildIntegration; - -export type RawInteractionData = GatewayInteractionCreateDispatchData; -export type RawCommandInteractionData = APIApplicationCommandInteraction; -export type RawMessageComponentInteractionData = APIMessageComponentInteraction; -export type RawMessageButtonInteractionData = APIMessageButtonInteractionData; -export type RawMessageSelectMenuInteractionData = - APIMessageSelectMenuInteractionData; - -export type RawTextInputComponentData = APITextInputComponent; -export type RawModalSubmitInteractionData = APIModalSubmitInteraction; - -export type RawInviteData = - | APIExtendedInvite - | APIInvite - | (GatewayInviteCreateDispatchData & { channel: GuildChannel; guild: Guild }) - | (GatewayInviteDeleteDispatchData & { channel: GuildChannel; guild: Guild }); - -export type RawInviteStageInstance = APIInviteStageInstance; - -export type RawMessageData = APIMessage; -export type RawPartialMessageData = GatewayMessageUpdateDispatchData; - -export interface RawMessageAttachmentData { - id: Snowflake; - filename: string; - description?: string; - content_type?: string; - size: number; - url: string; - proxy_url: string; - height?: number | null; - width?: number | null; - ephemeral?: boolean; - duration_secs?: number; - waveform?: string; -} - -export type RawMessagePayloadData = - | RESTPostAPIChannelMessageJSONBody - | RESTPatchAPIChannelMessageJSONBody - | RESTPostAPIWebhookWithTokenJSONBody - | RESTPatchAPIWebhookWithTokenJSONBody - | RESTPostAPIInteractionCallbackFormDataBody - | RESTPatchAPIInteractionOriginalResponseJSONBody - | RESTPostAPIInteractionFollowupJSONBody - | RESTPatchAPIInteractionFollowupJSONBody; - -export type RawMessageReactionData = - | APIReaction - | GatewayMessageReactionAddDispatchData; - -export type RawPermissionOverwriteData = APIOverwrite | PermissionOverwrites; - -export type RawPresenceData = GatewayPresenceUpdate; - -export type RawRoleData = APIRole; - -export type RawRichPresenceAssets = GatewayActivityAssets; - -export type RawStageInstanceData = - | APIStageInstance - | (Partial & - Pick); - -export type RawStickerData = APISticker | APIStickerItem; - -export type RawStickerPackData = APIStickerPack; - -export type RawTeamData = APITeam; - -export type RawTeamMemberData = APITeamMember; - -export type RawTypingData = GatewayTypingStartDispatchData; - -export type RawUserData = - | (APIUser & { member?: Omit }) - | (GatewayPresenceUpdate['user'] & Pick); - -export type RawVoiceRegionData = APIVoiceRegion; - -export type RawVoiceStateData = - | GatewayVoiceState - | Omit; - -export type RawWebhookData = - | APIWebhook - | RESTGetAPIWebhookWithTokenResult - | (Partial & Required>); - -export type RawWelcomeChannelData = APIGuildWelcomeScreenChannel; - -export type RawWelcomeScreenData = APIGuildWelcomeScreen; - -export type RawWidgetData = APIGuildWidget; - -export type RawWidgetMemberData = APIGuildWidgetMember; - -export interface GatewayAutoModerationActionExecutionDispatchData { - guild_id: Snowflake; - action: APIAutoModerationAction; - rule_id: Snowflake; - rule_trigger_type: AutoModerationRuleTriggerTypes; - user_id: Snowflake; - channel_id?: Snowflake; - message_id?: Snowflake; - alert_system_message_id?: Snowflake; - content: string; - matched_keyword: string | null; - matched_content: string | null; -} - -export interface APIAutoModerationAction { - type: AutoModerationActionTypes; - metadata?: APIAutoModerationActionMetadata; -} -export interface APIAutoModerationActionMetadata { - channel_id?: Snowflake; - duration_seconds?: number; - custom_message?: string; -} - -export interface APIAutoModerationRule { - id: Snowflake; - guild_id: Snowflake; - name: string; - creator_id: Snowflake; - event_type: AutoModerationRuleEventTypes; - trigger_type: AutoModerationRuleTriggerTypes; - trigger_metadata: APIAutoModerationRuleTriggerMetadata; - actions: APIAutoModerationAction[]; - enabled: boolean; - exempt_roles: Snowflake[]; - exempt_channels: Snowflake[]; -} - -export interface APIAutoModerationRuleTriggerMetadata { - keyword_filter?: string[]; - presets?: AutoModerationRuleKeywordPresetTypes[]; - allow_list?: string[]; - regex_patterns?: string[]; - mention_total_limit?: number; - mention_raid_protection_enabled?: boolean; -} - -export interface APIGuild extends APIPartialGuild { - icon_hash?: string | null; - discovery_splash: string | null; - owner?: boolean; - owner_id: Snowflake; - permissions?: Permissions; - region: string; - afk_channel_id: Snowflake | null; - afk_timeout: number; - widget_enabled?: boolean; - widget_channel_id?: Snowflake | null; - verification_level: GuildVerificationLevel; - default_message_notifications: GuildDefaultMessageNotifications; - explicit_content_filter: GuildExplicitContentFilter; - roles: APIRole[]; - emojis: APIEmoji[]; - features: GuildFeature[]; - mfa_level: GuildMFALevel; - application_id: Snowflake | null; - system_channel_id: Snowflake | null; - system_channel_flags: GuildSystemChannelFlags; - rules_channel_id: Snowflake | null; - max_presences?: number | null; - max_members?: number; - vanity_url_code: string | null; - description: string | null; - banner: string | null; - premium_tier: GuildPremiumTier; - premium_subscription_count?: number; - preferred_locale: string; - public_updates_channel_id: Snowflake | null; - max_video_channel_users?: number; - approximate_member_count?: number; - approximate_presence_count?: number; - welcome_screen?: APIGuildWelcomeScreen; - nsfw_level: GuildNSFWLevel; - stickers: APISticker[]; - premium_progress_bar_enabled: boolean; - hub_type: GuildHubType | null; - safety_alerts_channel_id: Snowflake | null; -} - -export interface APIApplicationRoleConnectionMetadata { - type: ApplicationRoleConnectionMetadataTypes; - key: string; - name: string; - name_localizations?: LocalizationMap; - description: string; - description_localizations?: LocalizationMap; -} - -export interface APIBaseComponent { - type: T; - id?: number; -} - -export interface APIUnfurledMediaItem { - url: string; -} - -export interface APIMediaGalleryItem { - media: APIUnfurledMediaItem; - description: string; - spoiler: boolean; -} - -export interface APISeparatorComponent - extends APIBaseComponent { - spacing: SeparatorSpacingSizes; - divider: boolean; -} - -export interface APITextDisplayComponent - extends APIBaseComponent { - content: string; -} - -export interface APIThumbnailComponent - extends APIBaseComponent { - media: APIUnfurledMediaItem; - description: string; - spoiler: boolean; -} - -export interface APIFileComponent - extends APIBaseComponent { - file: APIUnfurledMediaItem; - spoiler: boolean; -} - -export interface APIMediaGalleryComponent - extends APIBaseComponent { - items: APIMediaGalleryItem; -} - -export interface APISectionComponent - extends APIBaseComponent { - components: APITextDisplayComponent[]; - accessory: APIThumbnailComponent | APIMessageButtonInteractionData; -} - -export type APIContainerComponents = - | APIActionRowComponent - | APITextDisplayComponent - | APISectionComponent - | APIMediaGalleryComponent - | APISeparatorComponent - | APIFileComponent; -export interface APIContainerComponent - extends APIBaseComponent { - components: APIContainerComponents[]; - accent_color: number; - spoiler: boolean; -} diff --git a/vendor/drizzle-orm b/vendor/drizzle-orm new file mode 160000 index 0000000..c5d4f0c --- /dev/null +++ b/vendor/drizzle-orm @@ -0,0 +1 @@ +Subproject commit c5d4f0c4a742479ed78785e317ed4857311300f0