Initial commit of Discord bot
This commit is contained in:
191
node_modules/@discordjs/ws/LICENSE
generated
vendored
Normal file
191
node_modules/@discordjs/ws/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,191 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Copyright 2022 Noel Buechler
|
||||
Copyright 2022 Denis Cristea
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
204
node_modules/@discordjs/ws/README.md
generated
vendored
Normal file
204
node_modules/@discordjs/ws/README.md
generated
vendored
Normal file
@@ -0,0 +1,204 @@
|
||||
<div align="center">
|
||||
<br />
|
||||
<p>
|
||||
<a href="https://discord.js.org"><img src="https://discord.js.org/static/logo.svg" width="546" alt="discord.js" /></a>
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
<a href="https://discord.gg/djs"><img src="https://img.shields.io/discord/222078108977594368?color=5865F2&logo=discord&logoColor=white" alt="Discord server" /></a>
|
||||
<a href="https://www.npmjs.com/package/@discordjs/ws"><img src="https://img.shields.io/npm/v/@discordjs/ws.svg?maxAge=3600" alt="npm version" /></a>
|
||||
<a href="https://www.npmjs.com/package/@discordjs/ws"><img src="https://img.shields.io/npm/dt/@discordjs/ws.svg?maxAge=3600" alt="npm downloads" /></a>
|
||||
<a href="https://github.com/discordjs/discord.js/actions"><img src="https://github.com/discordjs/discord.js/actions/workflows/test.yml/badge.svg" alt="Build status" /></a>
|
||||
<a href="https://codecov.io/gh/discordjs/discord.js" ><img src="https://codecov.io/gh/discordjs/discord.js/branch/main/graph/badge.svg?precision=2&flag=ws" alt="Code coverage" /></a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://vercel.com/?utm_source=discordjs&utm_campaign=oss"><img src="https://raw.githubusercontent.com/discordjs/discord.js/main/.github/powered-by-vercel.svg" alt="Vercel" /></a>
|
||||
<a href="https://www.cloudflare.com"><img src="https://raw.githubusercontent.com/discordjs/discord.js/main/.github/powered-by-workers.png" alt="Cloudflare Workers" height="44" /></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
## About
|
||||
|
||||
`@discordjs/ws` is a powerful wrapper around Discord's gateway.
|
||||
|
||||
## Installation
|
||||
|
||||
**Node.js 16.11.0 or newer is required.**
|
||||
|
||||
```sh
|
||||
npm install @discordjs/ws
|
||||
yarn add @discordjs/ws
|
||||
pnpm add @discordjs/ws
|
||||
bun add @discordjs/ws
|
||||
```
|
||||
|
||||
### Optional packages
|
||||
|
||||
- [zlib-sync](https://www.npmjs.com/package/zlib-sync) for WebSocket data compression and inflation (`npm install zlib-sync`)
|
||||
- [bufferutil](https://www.npmjs.com/package/bufferutil) for a much faster WebSocket connection (`npm install bufferutil`)
|
||||
|
||||
## Example usage
|
||||
|
||||
```ts
|
||||
import { WebSocketManager, WebSocketShardEvents, CompressionMethod } from '@discordjs/ws';
|
||||
import { REST } from '@discordjs/rest';
|
||||
|
||||
const rest = new REST().setToken(process.env.DISCORD_TOKEN);
|
||||
// This example will spawn Discord's recommended shard count, all under the current process.
|
||||
const manager = new WebSocketManager({
|
||||
token: process.env.DISCORD_TOKEN,
|
||||
intents: 0, // for no intents
|
||||
rest,
|
||||
// uncomment if you have zlib-sync installed and want to use compression
|
||||
// compression: CompressionMethod.ZlibStream,
|
||||
});
|
||||
|
||||
manager.on(WebSocketShardEvents.Dispatch, (event) => {
|
||||
// Process gateway events here.
|
||||
});
|
||||
|
||||
await manager.connect();
|
||||
```
|
||||
|
||||
### Specify shards
|
||||
|
||||
```ts
|
||||
// Spawn 4 shards
|
||||
const manager = new WebSocketManager({
|
||||
token: process.env.DISCORD_TOKEN,
|
||||
intents: 0,
|
||||
rest,
|
||||
shardCount: 4,
|
||||
});
|
||||
|
||||
// The manager also supports being responsible for only a subset of your shards:
|
||||
|
||||
// Your bot will run 8 shards overall
|
||||
// This manager will only take care of 0, 2, 4, and 6
|
||||
const manager = new WebSocketManager({
|
||||
token: process.env.DISCORD_TOKEN,
|
||||
intents: 0,
|
||||
rest,
|
||||
shardCount: 8,
|
||||
shardIds: [0, 2, 4, 6],
|
||||
});
|
||||
|
||||
// Alternatively, if your shards are consecutive, you can pass in a range
|
||||
const manager = new WebSocketManager({
|
||||
token: process.env.DISCORD_TOKEN,
|
||||
intents: 0,
|
||||
rest,
|
||||
shardCount: 8,
|
||||
shardIds: {
|
||||
start: 0,
|
||||
end: 4,
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
### Specify `worker_threads`
|
||||
|
||||
You can also have the shards spawn in worker threads:
|
||||
|
||||
```ts
|
||||
import { WebSocketManager, WorkerShardingStrategy } from '@discordjs/ws';
|
||||
import { REST } from '@discordjs/rest';
|
||||
|
||||
const rest = new REST().setToken(process.env.DISCORD_TOKEN);
|
||||
const manager = new WebSocketManager({
|
||||
token: process.env.DISCORD_TOKEN,
|
||||
intents: 0,
|
||||
rest,
|
||||
shardCount: 6,
|
||||
// This will cause 3 workers to spawn, 2 shards per each
|
||||
buildStrategy: (manager) => new WorkerShardingStrategy(manager, { shardsPerWorker: 2 }),
|
||||
// Or maybe you want all your shards under a single worker
|
||||
buildStrategy: (manager) => new WorkerShardingStrategy(manager, { shardsPerWorker: 'all' }),
|
||||
});
|
||||
```
|
||||
|
||||
**Note**: By default, this will cause the workers to effectively only be responsible for the WebSocket connection, they simply pass up all the events back to the main process for the manager to emit. If you want to have the workers handle events as well, you can pass in a `workerPath` option to the `WorkerShardingStrategy` constructor:
|
||||
|
||||
```ts
|
||||
import { WebSocketManager, WorkerShardingStrategy } from '@discordjs/ws';
|
||||
import { REST } from '@discordjs/rest';
|
||||
|
||||
const rest = new REST().setToken(process.env.DISCORD_TOKEN);
|
||||
const manager = new WebSocketManager({
|
||||
token: process.env.DISCORD_TOKEN,
|
||||
intents: 0,
|
||||
rest,
|
||||
buildStrategy: (manager) =>
|
||||
new WorkerShardingStrategy(manager, {
|
||||
shardsPerWorker: 2,
|
||||
workerPath: './worker.js',
|
||||
// Optionally, if you have custom messaging, like for analytic collection, you can use this:
|
||||
async unknownPayloadHandler(data: any) {
|
||||
// handle data here :3
|
||||
},
|
||||
}),
|
||||
});
|
||||
```
|
||||
|
||||
And your `worker.ts` file:
|
||||
|
||||
```ts
|
||||
import { WorkerBootstrapper, WebSocketShardEvents } from '@discordjs/ws';
|
||||
import { parentPort } from 'node:worker_threads';
|
||||
|
||||
const bootstrapper = new WorkerBootstrapper();
|
||||
void bootstrapper.bootstrap({
|
||||
// Those will be sent to the main thread for the manager to emit
|
||||
forwardEvents: [
|
||||
WebSocketShardEvents.Closed,
|
||||
WebSocketShardEvents.Debug,
|
||||
WebSocketShardEvents.Hello,
|
||||
WebSocketShardEvents.Ready,
|
||||
WebSocketShardEvents.Resumed,
|
||||
],
|
||||
shardCallback: (shard) => {
|
||||
shard.on(WebSocketShardEvents.Dispatch, (event) => {
|
||||
// Process gateway events here however you want (e.g. send them through a message broker)
|
||||
// You also have access to shard.id if you need it
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
// This will go to `unknownPayloadHandler` in the main thread, or be ignored if not provided
|
||||
parentPort!.postMessage({ custom: 'data' });
|
||||
```
|
||||
|
||||
## Links
|
||||
|
||||
- [Website][website] ([source][website-source])
|
||||
- [Documentation][documentation]
|
||||
- [Guide][guide] ([source][guide-source])
|
||||
Also see the v13 to v14 [Update Guide][guide-update], which includes updated and removed items from the library.
|
||||
- [discord.js Discord server][discord]
|
||||
- [Discord API Discord server][discord-api]
|
||||
- [GitHub][source]
|
||||
- [npm][npm]
|
||||
- [Related libraries][related-libs]
|
||||
|
||||
## Contributing
|
||||
|
||||
Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
|
||||
[documentation][documentation].
|
||||
See [the contribution guide][contributing] if you'd like to submit a PR.
|
||||
|
||||
## Help
|
||||
|
||||
If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [discord.js Server][discord].
|
||||
|
||||
[website]: https://discord.js.org
|
||||
[website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
|
||||
[documentation]: https://discord.js.org/docs/packages/ws/stable
|
||||
[guide]: https://discordjs.guide/
|
||||
[guide-source]: https://github.com/discordjs/guide
|
||||
[guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html
|
||||
[discord]: https://discord.gg/djs
|
||||
[discord-api]: https://discord.gg/discord-api
|
||||
[source]: https://github.com/discordjs/discord.js/tree/main/packages/ws
|
||||
[npm]: https://www.npmjs.com/package/@discordjs/ws
|
||||
[related-libs]: https://discord.com/developers/docs/topics/community-resources#libraries
|
||||
[contributing]: https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md
|
||||
2
node_modules/@discordjs/ws/dist/defaultWorker.d.mts
generated
vendored
Normal file
2
node_modules/@discordjs/ws/dist/defaultWorker.d.mts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
export { }
|
||||
2
node_modules/@discordjs/ws/dist/defaultWorker.d.ts
generated
vendored
Normal file
2
node_modules/@discordjs/ws/dist/defaultWorker.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
export { }
|
||||
1058
node_modules/@discordjs/ws/dist/defaultWorker.js
generated
vendored
Normal file
1058
node_modules/@discordjs/ws/dist/defaultWorker.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/@discordjs/ws/dist/defaultWorker.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/dist/defaultWorker.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1040
node_modules/@discordjs/ws/dist/defaultWorker.mjs
generated
vendored
Normal file
1040
node_modules/@discordjs/ws/dist/defaultWorker.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/@discordjs/ws/dist/defaultWorker.mjs.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/dist/defaultWorker.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
704
node_modules/@discordjs/ws/dist/index.d.mts
generated
vendored
Normal file
704
node_modules/@discordjs/ws/dist/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,704 @@
|
||||
import * as _discordjs_util from '@discordjs/util';
|
||||
import { Awaitable } from '@discordjs/util';
|
||||
import { GatewayDispatchPayload, GatewayReadyDispatchData, GatewaySendPayload, GatewayOpcodes, GatewayIntentBits, GatewayIdentifyProperties, GatewayPresenceUpdateData, APIGatewayBotInfo } from 'discord-api-types/v10';
|
||||
import * as _discordjs_collection from '@discordjs/collection';
|
||||
import { Collection } from '@discordjs/collection';
|
||||
import { AsyncEventEmitter } from '@vladfrangu/async_event_emitter';
|
||||
import { REST } from '@discordjs/rest';
|
||||
import { AsyncQueue } from '@sapphire/async-queue';
|
||||
|
||||
declare enum WebSocketShardEvents {
|
||||
Closed = "closed",
|
||||
Debug = "debug",
|
||||
Dispatch = "dispatch",
|
||||
Error = "error",
|
||||
HeartbeatComplete = "heartbeat",
|
||||
Hello = "hello",
|
||||
Ready = "ready",
|
||||
Resumed = "resumed"
|
||||
}
|
||||
declare enum WebSocketShardStatus {
|
||||
Idle = 0,
|
||||
Connecting = 1,
|
||||
Resuming = 2,
|
||||
Ready = 3
|
||||
}
|
||||
declare enum WebSocketShardDestroyRecovery {
|
||||
Reconnect = 0,
|
||||
Resume = 1
|
||||
}
|
||||
interface WebSocketShardEventsMap {
|
||||
[WebSocketShardEvents.Closed]: [{
|
||||
code: number;
|
||||
}];
|
||||
[WebSocketShardEvents.Debug]: [payload: {
|
||||
message: string;
|
||||
}];
|
||||
[WebSocketShardEvents.Dispatch]: [payload: {
|
||||
data: GatewayDispatchPayload;
|
||||
}];
|
||||
[WebSocketShardEvents.Error]: [payload: {
|
||||
error: Error;
|
||||
}];
|
||||
[WebSocketShardEvents.Hello]: [];
|
||||
[WebSocketShardEvents.Ready]: [payload: {
|
||||
data: GatewayReadyDispatchData;
|
||||
}];
|
||||
[WebSocketShardEvents.Resumed]: [];
|
||||
[WebSocketShardEvents.HeartbeatComplete]: [payload: {
|
||||
ackAt: number;
|
||||
heartbeatAt: number;
|
||||
latency: number;
|
||||
}];
|
||||
}
|
||||
interface WebSocketShardDestroyOptions {
|
||||
code?: number;
|
||||
reason?: string;
|
||||
recover?: WebSocketShardDestroyRecovery;
|
||||
}
|
||||
declare enum CloseCodes {
|
||||
Normal = 1000,
|
||||
Resuming = 4200
|
||||
}
|
||||
interface SendRateLimitState {
|
||||
resetAt: number;
|
||||
sent: number;
|
||||
}
|
||||
declare class WebSocketShard extends AsyncEventEmitter<WebSocketShardEventsMap> {
|
||||
#private;
|
||||
private connection;
|
||||
private useIdentifyCompress;
|
||||
private inflate;
|
||||
private readonly textDecoder;
|
||||
private replayedEvents;
|
||||
private isAck;
|
||||
private sendRateLimitState;
|
||||
private initialHeartbeatTimeoutController;
|
||||
private heartbeatInterval;
|
||||
private lastHeartbeatAt;
|
||||
private initialConnectResolved;
|
||||
private failedToConnectDueToNetworkError;
|
||||
private readonly sendQueue;
|
||||
private readonly timeoutAbortControllers;
|
||||
private readonly strategy;
|
||||
readonly id: number;
|
||||
get status(): WebSocketShardStatus;
|
||||
constructor(strategy: IContextFetchingStrategy, id: number);
|
||||
connect(): Promise<void>;
|
||||
private internalConnect;
|
||||
destroy(options?: WebSocketShardDestroyOptions): Promise<void>;
|
||||
private waitForEvent;
|
||||
send(payload: GatewaySendPayload): Promise<void>;
|
||||
private identify;
|
||||
private resume;
|
||||
private heartbeat;
|
||||
private unpackMessage;
|
||||
private onMessage;
|
||||
private onError;
|
||||
private onClose;
|
||||
private debug;
|
||||
}
|
||||
|
||||
/**
|
||||
* Strategies responsible for spawning, initializing connections, destroying shards, and relaying events
|
||||
*/
|
||||
interface IShardingStrategy {
|
||||
/**
|
||||
* Initializes all the shards
|
||||
*/
|
||||
connect(): Awaitable<void>;
|
||||
/**
|
||||
* Destroys all the shards
|
||||
*/
|
||||
destroy(options?: Omit<WebSocketShardDestroyOptions, 'recover'>): Awaitable<void>;
|
||||
/**
|
||||
* Fetches the status of all the shards
|
||||
*/
|
||||
fetchStatus(): Awaitable<Collection<number, WebSocketShardStatus>>;
|
||||
/**
|
||||
* Sends a payload to a shard
|
||||
*/
|
||||
send(shardId: number, payload: GatewaySendPayload): Awaitable<void>;
|
||||
/**
|
||||
* Spawns all the shards
|
||||
*/
|
||||
spawn(shardIds: number[]): Awaitable<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* IdentifyThrottlers are responsible for dictating when a shard is allowed to identify.
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway#sharding-max-concurrency}
|
||||
*/
|
||||
interface IIdentifyThrottler {
|
||||
/**
|
||||
* Resolves once the given shard should be allowed to identify, or rejects if the operation was aborted.
|
||||
*/
|
||||
waitForIdentify(shardId: number, signal: AbortSignal): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple strategy that just spawns shards in the current process
|
||||
*/
|
||||
declare class SimpleShardingStrategy implements IShardingStrategy {
|
||||
private readonly manager;
|
||||
private readonly shards;
|
||||
constructor(manager: WebSocketManager);
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.spawn}
|
||||
*/
|
||||
spawn(shardIds: number[]): Promise<void>;
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.connect}
|
||||
*/
|
||||
connect(): Promise<void>;
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.destroy}
|
||||
*/
|
||||
destroy(options?: Omit<WebSocketShardDestroyOptions, 'recover'>): Promise<void>;
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.send}
|
||||
*/
|
||||
send(shardId: number, payload: GatewaySendPayload): Promise<void>;
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.fetchStatus}
|
||||
*/
|
||||
fetchStatus(): Promise<Collection<number, WebSocketShardStatus>>;
|
||||
}
|
||||
|
||||
/**
|
||||
* The state of a rate limit key's identify queue.
|
||||
*/
|
||||
interface IdentifyState {
|
||||
queue: AsyncQueue;
|
||||
resetsAt: number;
|
||||
}
|
||||
/**
|
||||
* Local, in-memory identify throttler.
|
||||
*/
|
||||
declare class SimpleIdentifyThrottler implements IIdentifyThrottler {
|
||||
private readonly maxConcurrency;
|
||||
private readonly states;
|
||||
constructor(maxConcurrency: number);
|
||||
/**
|
||||
* {@inheritDoc IIdentifyThrottler.waitForIdentify}
|
||||
*/
|
||||
waitForIdentify(shardId: number, signal: AbortSignal): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Valid encoding types
|
||||
*/
|
||||
declare enum Encoding {
|
||||
JSON = "json"
|
||||
}
|
||||
/**
|
||||
* Valid compression methods
|
||||
*/
|
||||
declare enum CompressionMethod {
|
||||
ZlibStream = "zlib-stream"
|
||||
}
|
||||
declare const DefaultDeviceProperty: `@discordjs/ws ${string}`;
|
||||
/**
|
||||
* Default options used by the manager
|
||||
*/
|
||||
declare const DefaultWebSocketManagerOptions: {
|
||||
readonly buildIdentifyThrottler: (manager: WebSocketManager) => Promise<SimpleIdentifyThrottler>;
|
||||
readonly buildStrategy: (manager: WebSocketManager) => SimpleShardingStrategy;
|
||||
readonly shardCount: null;
|
||||
readonly shardIds: null;
|
||||
readonly largeThreshold: null;
|
||||
readonly initialPresence: null;
|
||||
readonly identifyProperties: {
|
||||
readonly browser: `@discordjs/ws ${string}`;
|
||||
readonly device: `@discordjs/ws ${string}`;
|
||||
readonly os: NodeJS.Platform;
|
||||
};
|
||||
readonly version: "10";
|
||||
readonly encoding: Encoding;
|
||||
readonly compression: null;
|
||||
readonly retrieveSessionInfo: (shardId: number) => SessionInfo | null;
|
||||
readonly updateSessionInfo: (shardId: number, info: SessionInfo | null) => void;
|
||||
readonly handshakeTimeout: 30000;
|
||||
readonly helloTimeout: 60000;
|
||||
readonly readyTimeout: 15000;
|
||||
};
|
||||
declare const ImportantGatewayOpcodes: Set<GatewayOpcodes>;
|
||||
declare function getInitialSendRateLimitState(): SendRateLimitState;
|
||||
|
||||
/**
|
||||
* Represents a range of shard ids
|
||||
*/
|
||||
interface ShardRange {
|
||||
end: number;
|
||||
start: number;
|
||||
}
|
||||
/**
|
||||
* Session information for a given shard, used to resume a session
|
||||
*/
|
||||
interface SessionInfo {
|
||||
/**
|
||||
* URL to use when resuming
|
||||
*/
|
||||
resumeURL: string;
|
||||
/**
|
||||
* The sequence number of the last message sent by the shard
|
||||
*/
|
||||
sequence: number;
|
||||
/**
|
||||
* Session id for this shard
|
||||
*/
|
||||
sessionId: string;
|
||||
/**
|
||||
* The total number of shards at the time of this shard identifying
|
||||
*/
|
||||
shardCount: number;
|
||||
/**
|
||||
* The id of the shard
|
||||
*/
|
||||
shardId: number;
|
||||
}
|
||||
/**
|
||||
* Required options for the WebSocketManager
|
||||
*/
|
||||
interface RequiredWebSocketManagerOptions {
|
||||
/**
|
||||
* The intents to request
|
||||
*/
|
||||
intents: GatewayIntentBits | 0;
|
||||
/**
|
||||
* The REST instance to use for fetching gateway information
|
||||
*/
|
||||
rest: REST;
|
||||
/**
|
||||
* The token to use for identifying with the gateway
|
||||
*/
|
||||
token: string;
|
||||
}
|
||||
/**
|
||||
* Optional additional configuration for the WebSocketManager
|
||||
*/
|
||||
interface OptionalWebSocketManagerOptions {
|
||||
/**
|
||||
* Builds an identify throttler to use for this manager's shards
|
||||
*/
|
||||
buildIdentifyThrottler(manager: WebSocketManager): Awaitable<IIdentifyThrottler>;
|
||||
/**
|
||||
* Builds the strategy to use for sharding
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* const manager = new WebSocketManager({
|
||||
* token: process.env.DISCORD_TOKEN,
|
||||
* intents: 0, // for no intents
|
||||
* rest,
|
||||
* buildStrategy: (manager) => new WorkerShardingStrategy(manager, { shardsPerWorker: 2 }),
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
buildStrategy(manager: WebSocketManager): IShardingStrategy;
|
||||
/**
|
||||
* The compression method to use
|
||||
*
|
||||
* @defaultValue `null` (no compression)
|
||||
*/
|
||||
compression: CompressionMethod | null;
|
||||
/**
|
||||
* The encoding to use
|
||||
*
|
||||
* @defaultValue `'json'`
|
||||
*/
|
||||
encoding: Encoding;
|
||||
/**
|
||||
* How long to wait for a shard to connect before giving up
|
||||
*/
|
||||
handshakeTimeout: number | null;
|
||||
/**
|
||||
* How long to wait for a shard's HELLO packet before giving up
|
||||
*/
|
||||
helloTimeout: number | null;
|
||||
/**
|
||||
* Properties to send to the gateway when identifying
|
||||
*/
|
||||
identifyProperties: GatewayIdentifyProperties;
|
||||
/**
|
||||
* Initial presence data to send to the gateway when identifying
|
||||
*/
|
||||
initialPresence: GatewayPresenceUpdateData | null;
|
||||
/**
|
||||
* Value between 50 and 250, total number of members where the gateway will stop sending offline members in the guild member list
|
||||
*/
|
||||
largeThreshold: number | null;
|
||||
/**
|
||||
* How long to wait for a shard's READY packet before giving up
|
||||
*/
|
||||
readyTimeout: number | null;
|
||||
/**
|
||||
* Function used to retrieve session information (and attempt to resume) for a given shard
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* const manager = new WebSocketManager({
|
||||
* async retrieveSessionInfo(shardId): Awaitable<SessionInfo | null> {
|
||||
* // Fetch this info from redis or similar
|
||||
* return { sessionId: string, sequence: number };
|
||||
* // Return null if no information is found
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
retrieveSessionInfo(shardId: number): Awaitable<SessionInfo | null>;
|
||||
/**
|
||||
* The total number of shards across all WebsocketManagers you intend to instantiate.
|
||||
* Use `null` to use Discord's recommended shard count
|
||||
*/
|
||||
shardCount: number | null;
|
||||
/**
|
||||
* The ids of the shards this WebSocketManager should manage.
|
||||
* Use `null` to simply spawn 0 through `shardCount - 1`
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* const manager = new WebSocketManager({
|
||||
* shardIds: [1, 3, 7], // spawns shard 1, 3, and 7, nothing else
|
||||
* });
|
||||
* ```
|
||||
* @example
|
||||
* ```ts
|
||||
* const manager = new WebSocketManager({
|
||||
* shardIds: {
|
||||
* start: 3,
|
||||
* end: 6,
|
||||
* }, // spawns shards 3, 4, 5, and 6
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
shardIds: number[] | ShardRange | null;
|
||||
/**
|
||||
* Function used to store session information for a given shard
|
||||
*/
|
||||
updateSessionInfo(shardId: number, sessionInfo: SessionInfo | null): Awaitable<void>;
|
||||
/**
|
||||
* The gateway version to use
|
||||
*
|
||||
* @defaultValue `'10'`
|
||||
*/
|
||||
version: string;
|
||||
}
|
||||
interface WebSocketManagerOptions extends OptionalWebSocketManagerOptions, RequiredWebSocketManagerOptions {
|
||||
}
|
||||
interface CreateWebSocketManagerOptions extends Partial<OptionalWebSocketManagerOptions>, RequiredWebSocketManagerOptions {
|
||||
}
|
||||
interface ManagerShardEventsMap {
|
||||
[WebSocketShardEvents.Closed]: [{
|
||||
code: number;
|
||||
shardId: number;
|
||||
}];
|
||||
[WebSocketShardEvents.Debug]: [payload: {
|
||||
message: string;
|
||||
shardId: number;
|
||||
}];
|
||||
[WebSocketShardEvents.Dispatch]: [payload: {
|
||||
data: GatewayDispatchPayload;
|
||||
shardId: number;
|
||||
}];
|
||||
[WebSocketShardEvents.Error]: [payload: {
|
||||
error: Error;
|
||||
shardId: number;
|
||||
}];
|
||||
[WebSocketShardEvents.Hello]: [{
|
||||
shardId: number;
|
||||
}];
|
||||
[WebSocketShardEvents.Ready]: [payload: {
|
||||
data: GatewayReadyDispatchData;
|
||||
shardId: number;
|
||||
}];
|
||||
[WebSocketShardEvents.Resumed]: [{
|
||||
shardId: number;
|
||||
}];
|
||||
[WebSocketShardEvents.HeartbeatComplete]: [
|
||||
payload: {
|
||||
ackAt: number;
|
||||
heartbeatAt: number;
|
||||
latency: number;
|
||||
shardId: number;
|
||||
}
|
||||
];
|
||||
}
|
||||
declare class WebSocketManager extends AsyncEventEmitter<ManagerShardEventsMap> implements AsyncDisposable {
|
||||
/**
|
||||
* The options being used by this manager
|
||||
*/
|
||||
readonly options: WebSocketManagerOptions;
|
||||
/**
|
||||
* Internal cache for a GET /gateway/bot result
|
||||
*/
|
||||
private gatewayInformation;
|
||||
/**
|
||||
* Internal cache for the shard ids
|
||||
*/
|
||||
private shardIds;
|
||||
/**
|
||||
* Strategy used to manage shards
|
||||
*
|
||||
* @defaultValue `SimpleShardingStrategy`
|
||||
*/
|
||||
private readonly strategy;
|
||||
constructor(options: CreateWebSocketManagerOptions);
|
||||
/**
|
||||
* Fetches the gateway information from Discord - or returns it from cache if available
|
||||
*
|
||||
* @param force - Whether to ignore the cache and force a fresh fetch
|
||||
*/
|
||||
fetchGatewayInformation(force?: boolean): Promise<APIGatewayBotInfo>;
|
||||
/**
|
||||
* Updates your total shard count on-the-fly, spawning shards as needed
|
||||
*
|
||||
* @param shardCount - The new shard count to use
|
||||
*/
|
||||
updateShardCount(shardCount: number | null): Promise<this>;
|
||||
/**
|
||||
* Yields the total number of shards across for your bot, accounting for Discord recommendations
|
||||
*/
|
||||
getShardCount(): Promise<number>;
|
||||
/**
|
||||
* Yields the ids of the shards this manager should manage
|
||||
*/
|
||||
getShardIds(force?: boolean): Promise<number[]>;
|
||||
connect(): Promise<void>;
|
||||
destroy(options?: Omit<WebSocketShardDestroyOptions, 'recover'>): Awaitable<void>;
|
||||
send(shardId: number, payload: GatewaySendPayload): Awaitable<void>;
|
||||
fetchStatus(): Awaitable<_discordjs_collection.Collection<number, WebSocketShardStatus>>;
|
||||
[Symbol.asyncDispose](): Promise<void>;
|
||||
}
|
||||
|
||||
interface FetchingStrategyOptions extends Omit<WebSocketManagerOptions, 'buildIdentifyThrottler' | 'buildStrategy' | 'rest' | 'retrieveSessionInfo' | 'shardCount' | 'shardIds' | 'updateSessionInfo'> {
|
||||
readonly gatewayInformation: APIGatewayBotInfo;
|
||||
readonly shardCount: number;
|
||||
}
|
||||
/**
|
||||
* Strategies responsible solely for making manager information accessible
|
||||
*/
|
||||
interface IContextFetchingStrategy {
|
||||
readonly options: FetchingStrategyOptions;
|
||||
retrieveSessionInfo(shardId: number): Awaitable<SessionInfo | null>;
|
||||
updateSessionInfo(shardId: number, sessionInfo: SessionInfo | null): Awaitable<void>;
|
||||
/**
|
||||
* Resolves once the given shard should be allowed to identify
|
||||
* This should correctly handle the signal and reject with an abort error if the operation is aborted.
|
||||
* Other errors will cause the shard to reconnect.
|
||||
*/
|
||||
waitForIdentify(shardId: number, signal: AbortSignal): Promise<void>;
|
||||
}
|
||||
declare function managerToFetchingStrategyOptions(manager: WebSocketManager): Promise<FetchingStrategyOptions>;
|
||||
|
||||
declare class SimpleContextFetchingStrategy implements IContextFetchingStrategy {
|
||||
private readonly manager;
|
||||
readonly options: FetchingStrategyOptions;
|
||||
private static throttlerCache;
|
||||
private static ensureThrottler;
|
||||
constructor(manager: WebSocketManager, options: FetchingStrategyOptions);
|
||||
retrieveSessionInfo(shardId: number): Promise<SessionInfo | null>;
|
||||
updateSessionInfo(shardId: number, sessionInfo: SessionInfo | null): _discordjs_util.Awaitable<void>;
|
||||
waitForIdentify(shardId: number, signal: AbortSignal): Promise<void>;
|
||||
}
|
||||
|
||||
declare class WorkerContextFetchingStrategy implements IContextFetchingStrategy {
|
||||
readonly options: FetchingStrategyOptions;
|
||||
private readonly sessionPromises;
|
||||
private readonly waitForIdentifyPromises;
|
||||
constructor(options: FetchingStrategyOptions);
|
||||
retrieveSessionInfo(shardId: number): Promise<SessionInfo | null>;
|
||||
updateSessionInfo(shardId: number, sessionInfo: SessionInfo | null): void;
|
||||
waitForIdentify(shardId: number, signal: AbortSignal): Promise<void>;
|
||||
}
|
||||
|
||||
interface WorkerData extends FetchingStrategyOptions {
|
||||
shardIds: number[];
|
||||
}
|
||||
declare enum WorkerSendPayloadOp {
|
||||
Connect = 0,
|
||||
Destroy = 1,
|
||||
Send = 2,
|
||||
SessionInfoResponse = 3,
|
||||
ShardIdentifyResponse = 4,
|
||||
FetchStatus = 5
|
||||
}
|
||||
type WorkerSendPayload = {
|
||||
nonce: number;
|
||||
ok: boolean;
|
||||
op: WorkerSendPayloadOp.ShardIdentifyResponse;
|
||||
} | {
|
||||
nonce: number;
|
||||
op: WorkerSendPayloadOp.FetchStatus;
|
||||
shardId: number;
|
||||
} | {
|
||||
nonce: number;
|
||||
op: WorkerSendPayloadOp.SessionInfoResponse;
|
||||
session: SessionInfo | null;
|
||||
} | {
|
||||
op: WorkerSendPayloadOp.Connect;
|
||||
shardId: number;
|
||||
} | {
|
||||
op: WorkerSendPayloadOp.Destroy;
|
||||
options?: WebSocketShardDestroyOptions;
|
||||
shardId: number;
|
||||
} | {
|
||||
op: WorkerSendPayloadOp.Send;
|
||||
payload: GatewaySendPayload;
|
||||
shardId: number;
|
||||
};
|
||||
declare enum WorkerReceivePayloadOp {
|
||||
Connected = 0,
|
||||
Destroyed = 1,
|
||||
Event = 2,
|
||||
RetrieveSessionInfo = 3,
|
||||
UpdateSessionInfo = 4,
|
||||
WaitForIdentify = 5,
|
||||
FetchStatusResponse = 6,
|
||||
WorkerReady = 7,
|
||||
CancelIdentify = 8
|
||||
}
|
||||
type WorkerReceivePayload = {
|
||||
data: any;
|
||||
event: WebSocketShardEvents;
|
||||
op: WorkerReceivePayloadOp.Event;
|
||||
shardId: number;
|
||||
} | {
|
||||
nonce: number;
|
||||
op: WorkerReceivePayloadOp.CancelIdentify;
|
||||
} | {
|
||||
nonce: number;
|
||||
op: WorkerReceivePayloadOp.FetchStatusResponse;
|
||||
status: WebSocketShardStatus;
|
||||
} | {
|
||||
nonce: number;
|
||||
op: WorkerReceivePayloadOp.RetrieveSessionInfo;
|
||||
shardId: number;
|
||||
} | {
|
||||
nonce: number;
|
||||
op: WorkerReceivePayloadOp.WaitForIdentify;
|
||||
shardId: number;
|
||||
} | {
|
||||
op: WorkerReceivePayloadOp.Connected;
|
||||
shardId: number;
|
||||
} | {
|
||||
op: WorkerReceivePayloadOp.Destroyed;
|
||||
shardId: number;
|
||||
} | {
|
||||
op: WorkerReceivePayloadOp.UpdateSessionInfo;
|
||||
session: SessionInfo | null;
|
||||
shardId: number;
|
||||
} | {
|
||||
op: WorkerReceivePayloadOp.WorkerReady;
|
||||
};
|
||||
/**
|
||||
* Options for a {@link WorkerShardingStrategy}
|
||||
*/
|
||||
interface WorkerShardingStrategyOptions {
|
||||
/**
|
||||
* Dictates how many shards should be spawned per worker thread.
|
||||
*/
|
||||
shardsPerWorker: number | 'all';
|
||||
/**
|
||||
* Handles a payload not recognized by the handler.
|
||||
*/
|
||||
unknownPayloadHandler?(payload: any): unknown;
|
||||
/**
|
||||
* Path to the worker file to use. The worker requires quite a bit of setup, it is recommended you leverage the {@link WorkerBootstrapper} class.
|
||||
*/
|
||||
workerPath?: string;
|
||||
}
|
||||
/**
|
||||
* Strategy used to spawn threads in worker_threads
|
||||
*/
|
||||
declare class WorkerShardingStrategy implements IShardingStrategy {
|
||||
#private;
|
||||
private readonly manager;
|
||||
private readonly options;
|
||||
private readonly connectPromises;
|
||||
private readonly destroyPromises;
|
||||
private readonly fetchStatusPromises;
|
||||
private readonly waitForIdentifyControllers;
|
||||
private throttler?;
|
||||
constructor(manager: WebSocketManager, options: WorkerShardingStrategyOptions);
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.spawn}
|
||||
*/
|
||||
spawn(shardIds: number[]): Promise<void>;
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.connect}
|
||||
*/
|
||||
connect(): Promise<void>;
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.destroy}
|
||||
*/
|
||||
destroy(options?: Omit<WebSocketShardDestroyOptions, 'recover'>): Promise<void>;
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.send}
|
||||
*/
|
||||
send(shardId: number, data: GatewaySendPayload): void;
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.fetchStatus}
|
||||
*/
|
||||
fetchStatus(): Promise<Collection<number, WebSocketShardStatus>>;
|
||||
private setupWorker;
|
||||
private resolveWorkerPath;
|
||||
private waitForWorkerReady;
|
||||
private onMessage;
|
||||
private ensureThrottler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for bootstrapping the worker
|
||||
*/
|
||||
interface BootstrapOptions {
|
||||
/**
|
||||
* Shard events to just arbitrarily forward to the parent thread for the manager to emit
|
||||
* Note: By default, this will include ALL events
|
||||
* you most likely want to handle dispatch within the worker itself
|
||||
*/
|
||||
forwardEvents?: WebSocketShardEvents[];
|
||||
/**
|
||||
* Function to call when a shard is created for additional setup
|
||||
*/
|
||||
shardCallback?(shard: WebSocketShard): Awaitable<void>;
|
||||
}
|
||||
/**
|
||||
* Utility class for bootstrapping a worker thread to be used for sharding
|
||||
*/
|
||||
declare class WorkerBootstrapper {
|
||||
/**
|
||||
* The data passed to the worker thread
|
||||
*/
|
||||
protected readonly data: WorkerData;
|
||||
/**
|
||||
* The shards that are managed by this worker
|
||||
*/
|
||||
protected readonly shards: Collection<number, WebSocketShard>;
|
||||
constructor();
|
||||
/**
|
||||
* Helper method to initiate a shard's connection process
|
||||
*/
|
||||
protected connect(shardId: number): Promise<void>;
|
||||
/**
|
||||
* Helper method to destroy a shard
|
||||
*/
|
||||
protected destroy(shardId: number, options?: WebSocketShardDestroyOptions): Promise<void>;
|
||||
/**
|
||||
* Helper method to attach event listeners to the parentPort
|
||||
*/
|
||||
protected setupThreadEvents(): void;
|
||||
/**
|
||||
* Bootstraps the worker thread with the provided options
|
||||
*/
|
||||
bootstrap(options?: Readonly<BootstrapOptions>): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/ws#readme | @discordjs/ws} version
|
||||
* that you are currently using.
|
||||
*/
|
||||
declare const version: string;
|
||||
|
||||
export { type BootstrapOptions, CloseCodes, CompressionMethod, type CreateWebSocketManagerOptions, DefaultDeviceProperty, DefaultWebSocketManagerOptions, Encoding, type FetchingStrategyOptions, type IContextFetchingStrategy, type IIdentifyThrottler, type IShardingStrategy, type IdentifyState, ImportantGatewayOpcodes, type ManagerShardEventsMap, type OptionalWebSocketManagerOptions, type RequiredWebSocketManagerOptions, type SendRateLimitState, type SessionInfo, type ShardRange, SimpleContextFetchingStrategy, SimpleIdentifyThrottler, SimpleShardingStrategy, WebSocketManager, type WebSocketManagerOptions, WebSocketShard, type WebSocketShardDestroyOptions, WebSocketShardDestroyRecovery, WebSocketShardEvents, type WebSocketShardEventsMap, WebSocketShardStatus, WorkerBootstrapper, WorkerContextFetchingStrategy, type WorkerData, type WorkerReceivePayload, WorkerReceivePayloadOp, type WorkerSendPayload, WorkerSendPayloadOp, WorkerShardingStrategy, type WorkerShardingStrategyOptions, getInitialSendRateLimitState, managerToFetchingStrategyOptions, version };
|
||||
704
node_modules/@discordjs/ws/dist/index.d.ts
generated
vendored
Normal file
704
node_modules/@discordjs/ws/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,704 @@
|
||||
import * as _discordjs_util from '@discordjs/util';
|
||||
import { Awaitable } from '@discordjs/util';
|
||||
import { GatewayDispatchPayload, GatewayReadyDispatchData, GatewaySendPayload, GatewayOpcodes, GatewayIntentBits, GatewayIdentifyProperties, GatewayPresenceUpdateData, APIGatewayBotInfo } from 'discord-api-types/v10';
|
||||
import * as _discordjs_collection from '@discordjs/collection';
|
||||
import { Collection } from '@discordjs/collection';
|
||||
import { AsyncEventEmitter } from '@vladfrangu/async_event_emitter';
|
||||
import { REST } from '@discordjs/rest';
|
||||
import { AsyncQueue } from '@sapphire/async-queue';
|
||||
|
||||
declare enum WebSocketShardEvents {
|
||||
Closed = "closed",
|
||||
Debug = "debug",
|
||||
Dispatch = "dispatch",
|
||||
Error = "error",
|
||||
HeartbeatComplete = "heartbeat",
|
||||
Hello = "hello",
|
||||
Ready = "ready",
|
||||
Resumed = "resumed"
|
||||
}
|
||||
declare enum WebSocketShardStatus {
|
||||
Idle = 0,
|
||||
Connecting = 1,
|
||||
Resuming = 2,
|
||||
Ready = 3
|
||||
}
|
||||
declare enum WebSocketShardDestroyRecovery {
|
||||
Reconnect = 0,
|
||||
Resume = 1
|
||||
}
|
||||
interface WebSocketShardEventsMap {
|
||||
[WebSocketShardEvents.Closed]: [{
|
||||
code: number;
|
||||
}];
|
||||
[WebSocketShardEvents.Debug]: [payload: {
|
||||
message: string;
|
||||
}];
|
||||
[WebSocketShardEvents.Dispatch]: [payload: {
|
||||
data: GatewayDispatchPayload;
|
||||
}];
|
||||
[WebSocketShardEvents.Error]: [payload: {
|
||||
error: Error;
|
||||
}];
|
||||
[WebSocketShardEvents.Hello]: [];
|
||||
[WebSocketShardEvents.Ready]: [payload: {
|
||||
data: GatewayReadyDispatchData;
|
||||
}];
|
||||
[WebSocketShardEvents.Resumed]: [];
|
||||
[WebSocketShardEvents.HeartbeatComplete]: [payload: {
|
||||
ackAt: number;
|
||||
heartbeatAt: number;
|
||||
latency: number;
|
||||
}];
|
||||
}
|
||||
interface WebSocketShardDestroyOptions {
|
||||
code?: number;
|
||||
reason?: string;
|
||||
recover?: WebSocketShardDestroyRecovery;
|
||||
}
|
||||
declare enum CloseCodes {
|
||||
Normal = 1000,
|
||||
Resuming = 4200
|
||||
}
|
||||
interface SendRateLimitState {
|
||||
resetAt: number;
|
||||
sent: number;
|
||||
}
|
||||
declare class WebSocketShard extends AsyncEventEmitter<WebSocketShardEventsMap> {
|
||||
#private;
|
||||
private connection;
|
||||
private useIdentifyCompress;
|
||||
private inflate;
|
||||
private readonly textDecoder;
|
||||
private replayedEvents;
|
||||
private isAck;
|
||||
private sendRateLimitState;
|
||||
private initialHeartbeatTimeoutController;
|
||||
private heartbeatInterval;
|
||||
private lastHeartbeatAt;
|
||||
private initialConnectResolved;
|
||||
private failedToConnectDueToNetworkError;
|
||||
private readonly sendQueue;
|
||||
private readonly timeoutAbortControllers;
|
||||
private readonly strategy;
|
||||
readonly id: number;
|
||||
get status(): WebSocketShardStatus;
|
||||
constructor(strategy: IContextFetchingStrategy, id: number);
|
||||
connect(): Promise<void>;
|
||||
private internalConnect;
|
||||
destroy(options?: WebSocketShardDestroyOptions): Promise<void>;
|
||||
private waitForEvent;
|
||||
send(payload: GatewaySendPayload): Promise<void>;
|
||||
private identify;
|
||||
private resume;
|
||||
private heartbeat;
|
||||
private unpackMessage;
|
||||
private onMessage;
|
||||
private onError;
|
||||
private onClose;
|
||||
private debug;
|
||||
}
|
||||
|
||||
/**
|
||||
* Strategies responsible for spawning, initializing connections, destroying shards, and relaying events
|
||||
*/
|
||||
interface IShardingStrategy {
|
||||
/**
|
||||
* Initializes all the shards
|
||||
*/
|
||||
connect(): Awaitable<void>;
|
||||
/**
|
||||
* Destroys all the shards
|
||||
*/
|
||||
destroy(options?: Omit<WebSocketShardDestroyOptions, 'recover'>): Awaitable<void>;
|
||||
/**
|
||||
* Fetches the status of all the shards
|
||||
*/
|
||||
fetchStatus(): Awaitable<Collection<number, WebSocketShardStatus>>;
|
||||
/**
|
||||
* Sends a payload to a shard
|
||||
*/
|
||||
send(shardId: number, payload: GatewaySendPayload): Awaitable<void>;
|
||||
/**
|
||||
* Spawns all the shards
|
||||
*/
|
||||
spawn(shardIds: number[]): Awaitable<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* IdentifyThrottlers are responsible for dictating when a shard is allowed to identify.
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway#sharding-max-concurrency}
|
||||
*/
|
||||
interface IIdentifyThrottler {
|
||||
/**
|
||||
* Resolves once the given shard should be allowed to identify, or rejects if the operation was aborted.
|
||||
*/
|
||||
waitForIdentify(shardId: number, signal: AbortSignal): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple strategy that just spawns shards in the current process
|
||||
*/
|
||||
declare class SimpleShardingStrategy implements IShardingStrategy {
|
||||
private readonly manager;
|
||||
private readonly shards;
|
||||
constructor(manager: WebSocketManager);
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.spawn}
|
||||
*/
|
||||
spawn(shardIds: number[]): Promise<void>;
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.connect}
|
||||
*/
|
||||
connect(): Promise<void>;
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.destroy}
|
||||
*/
|
||||
destroy(options?: Omit<WebSocketShardDestroyOptions, 'recover'>): Promise<void>;
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.send}
|
||||
*/
|
||||
send(shardId: number, payload: GatewaySendPayload): Promise<void>;
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.fetchStatus}
|
||||
*/
|
||||
fetchStatus(): Promise<Collection<number, WebSocketShardStatus>>;
|
||||
}
|
||||
|
||||
/**
|
||||
* The state of a rate limit key's identify queue.
|
||||
*/
|
||||
interface IdentifyState {
|
||||
queue: AsyncQueue;
|
||||
resetsAt: number;
|
||||
}
|
||||
/**
|
||||
* Local, in-memory identify throttler.
|
||||
*/
|
||||
declare class SimpleIdentifyThrottler implements IIdentifyThrottler {
|
||||
private readonly maxConcurrency;
|
||||
private readonly states;
|
||||
constructor(maxConcurrency: number);
|
||||
/**
|
||||
* {@inheritDoc IIdentifyThrottler.waitForIdentify}
|
||||
*/
|
||||
waitForIdentify(shardId: number, signal: AbortSignal): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Valid encoding types
|
||||
*/
|
||||
declare enum Encoding {
|
||||
JSON = "json"
|
||||
}
|
||||
/**
|
||||
* Valid compression methods
|
||||
*/
|
||||
declare enum CompressionMethod {
|
||||
ZlibStream = "zlib-stream"
|
||||
}
|
||||
declare const DefaultDeviceProperty: `@discordjs/ws ${string}`;
|
||||
/**
|
||||
* Default options used by the manager
|
||||
*/
|
||||
declare const DefaultWebSocketManagerOptions: {
|
||||
readonly buildIdentifyThrottler: (manager: WebSocketManager) => Promise<SimpleIdentifyThrottler>;
|
||||
readonly buildStrategy: (manager: WebSocketManager) => SimpleShardingStrategy;
|
||||
readonly shardCount: null;
|
||||
readonly shardIds: null;
|
||||
readonly largeThreshold: null;
|
||||
readonly initialPresence: null;
|
||||
readonly identifyProperties: {
|
||||
readonly browser: `@discordjs/ws ${string}`;
|
||||
readonly device: `@discordjs/ws ${string}`;
|
||||
readonly os: NodeJS.Platform;
|
||||
};
|
||||
readonly version: "10";
|
||||
readonly encoding: Encoding;
|
||||
readonly compression: null;
|
||||
readonly retrieveSessionInfo: (shardId: number) => SessionInfo | null;
|
||||
readonly updateSessionInfo: (shardId: number, info: SessionInfo | null) => void;
|
||||
readonly handshakeTimeout: 30000;
|
||||
readonly helloTimeout: 60000;
|
||||
readonly readyTimeout: 15000;
|
||||
};
|
||||
declare const ImportantGatewayOpcodes: Set<GatewayOpcodes>;
|
||||
declare function getInitialSendRateLimitState(): SendRateLimitState;
|
||||
|
||||
/**
|
||||
* Represents a range of shard ids
|
||||
*/
|
||||
interface ShardRange {
|
||||
end: number;
|
||||
start: number;
|
||||
}
|
||||
/**
|
||||
* Session information for a given shard, used to resume a session
|
||||
*/
|
||||
interface SessionInfo {
|
||||
/**
|
||||
* URL to use when resuming
|
||||
*/
|
||||
resumeURL: string;
|
||||
/**
|
||||
* The sequence number of the last message sent by the shard
|
||||
*/
|
||||
sequence: number;
|
||||
/**
|
||||
* Session id for this shard
|
||||
*/
|
||||
sessionId: string;
|
||||
/**
|
||||
* The total number of shards at the time of this shard identifying
|
||||
*/
|
||||
shardCount: number;
|
||||
/**
|
||||
* The id of the shard
|
||||
*/
|
||||
shardId: number;
|
||||
}
|
||||
/**
|
||||
* Required options for the WebSocketManager
|
||||
*/
|
||||
interface RequiredWebSocketManagerOptions {
|
||||
/**
|
||||
* The intents to request
|
||||
*/
|
||||
intents: GatewayIntentBits | 0;
|
||||
/**
|
||||
* The REST instance to use for fetching gateway information
|
||||
*/
|
||||
rest: REST;
|
||||
/**
|
||||
* The token to use for identifying with the gateway
|
||||
*/
|
||||
token: string;
|
||||
}
|
||||
/**
|
||||
* Optional additional configuration for the WebSocketManager
|
||||
*/
|
||||
interface OptionalWebSocketManagerOptions {
|
||||
/**
|
||||
* Builds an identify throttler to use for this manager's shards
|
||||
*/
|
||||
buildIdentifyThrottler(manager: WebSocketManager): Awaitable<IIdentifyThrottler>;
|
||||
/**
|
||||
* Builds the strategy to use for sharding
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* const manager = new WebSocketManager({
|
||||
* token: process.env.DISCORD_TOKEN,
|
||||
* intents: 0, // for no intents
|
||||
* rest,
|
||||
* buildStrategy: (manager) => new WorkerShardingStrategy(manager, { shardsPerWorker: 2 }),
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
buildStrategy(manager: WebSocketManager): IShardingStrategy;
|
||||
/**
|
||||
* The compression method to use
|
||||
*
|
||||
* @defaultValue `null` (no compression)
|
||||
*/
|
||||
compression: CompressionMethod | null;
|
||||
/**
|
||||
* The encoding to use
|
||||
*
|
||||
* @defaultValue `'json'`
|
||||
*/
|
||||
encoding: Encoding;
|
||||
/**
|
||||
* How long to wait for a shard to connect before giving up
|
||||
*/
|
||||
handshakeTimeout: number | null;
|
||||
/**
|
||||
* How long to wait for a shard's HELLO packet before giving up
|
||||
*/
|
||||
helloTimeout: number | null;
|
||||
/**
|
||||
* Properties to send to the gateway when identifying
|
||||
*/
|
||||
identifyProperties: GatewayIdentifyProperties;
|
||||
/**
|
||||
* Initial presence data to send to the gateway when identifying
|
||||
*/
|
||||
initialPresence: GatewayPresenceUpdateData | null;
|
||||
/**
|
||||
* Value between 50 and 250, total number of members where the gateway will stop sending offline members in the guild member list
|
||||
*/
|
||||
largeThreshold: number | null;
|
||||
/**
|
||||
* How long to wait for a shard's READY packet before giving up
|
||||
*/
|
||||
readyTimeout: number | null;
|
||||
/**
|
||||
* Function used to retrieve session information (and attempt to resume) for a given shard
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* const manager = new WebSocketManager({
|
||||
* async retrieveSessionInfo(shardId): Awaitable<SessionInfo | null> {
|
||||
* // Fetch this info from redis or similar
|
||||
* return { sessionId: string, sequence: number };
|
||||
* // Return null if no information is found
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
retrieveSessionInfo(shardId: number): Awaitable<SessionInfo | null>;
|
||||
/**
|
||||
* The total number of shards across all WebsocketManagers you intend to instantiate.
|
||||
* Use `null` to use Discord's recommended shard count
|
||||
*/
|
||||
shardCount: number | null;
|
||||
/**
|
||||
* The ids of the shards this WebSocketManager should manage.
|
||||
* Use `null` to simply spawn 0 through `shardCount - 1`
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* const manager = new WebSocketManager({
|
||||
* shardIds: [1, 3, 7], // spawns shard 1, 3, and 7, nothing else
|
||||
* });
|
||||
* ```
|
||||
* @example
|
||||
* ```ts
|
||||
* const manager = new WebSocketManager({
|
||||
* shardIds: {
|
||||
* start: 3,
|
||||
* end: 6,
|
||||
* }, // spawns shards 3, 4, 5, and 6
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
shardIds: number[] | ShardRange | null;
|
||||
/**
|
||||
* Function used to store session information for a given shard
|
||||
*/
|
||||
updateSessionInfo(shardId: number, sessionInfo: SessionInfo | null): Awaitable<void>;
|
||||
/**
|
||||
* The gateway version to use
|
||||
*
|
||||
* @defaultValue `'10'`
|
||||
*/
|
||||
version: string;
|
||||
}
|
||||
interface WebSocketManagerOptions extends OptionalWebSocketManagerOptions, RequiredWebSocketManagerOptions {
|
||||
}
|
||||
interface CreateWebSocketManagerOptions extends Partial<OptionalWebSocketManagerOptions>, RequiredWebSocketManagerOptions {
|
||||
}
|
||||
interface ManagerShardEventsMap {
|
||||
[WebSocketShardEvents.Closed]: [{
|
||||
code: number;
|
||||
shardId: number;
|
||||
}];
|
||||
[WebSocketShardEvents.Debug]: [payload: {
|
||||
message: string;
|
||||
shardId: number;
|
||||
}];
|
||||
[WebSocketShardEvents.Dispatch]: [payload: {
|
||||
data: GatewayDispatchPayload;
|
||||
shardId: number;
|
||||
}];
|
||||
[WebSocketShardEvents.Error]: [payload: {
|
||||
error: Error;
|
||||
shardId: number;
|
||||
}];
|
||||
[WebSocketShardEvents.Hello]: [{
|
||||
shardId: number;
|
||||
}];
|
||||
[WebSocketShardEvents.Ready]: [payload: {
|
||||
data: GatewayReadyDispatchData;
|
||||
shardId: number;
|
||||
}];
|
||||
[WebSocketShardEvents.Resumed]: [{
|
||||
shardId: number;
|
||||
}];
|
||||
[WebSocketShardEvents.HeartbeatComplete]: [
|
||||
payload: {
|
||||
ackAt: number;
|
||||
heartbeatAt: number;
|
||||
latency: number;
|
||||
shardId: number;
|
||||
}
|
||||
];
|
||||
}
|
||||
declare class WebSocketManager extends AsyncEventEmitter<ManagerShardEventsMap> implements AsyncDisposable {
|
||||
/**
|
||||
* The options being used by this manager
|
||||
*/
|
||||
readonly options: WebSocketManagerOptions;
|
||||
/**
|
||||
* Internal cache for a GET /gateway/bot result
|
||||
*/
|
||||
private gatewayInformation;
|
||||
/**
|
||||
* Internal cache for the shard ids
|
||||
*/
|
||||
private shardIds;
|
||||
/**
|
||||
* Strategy used to manage shards
|
||||
*
|
||||
* @defaultValue `SimpleShardingStrategy`
|
||||
*/
|
||||
private readonly strategy;
|
||||
constructor(options: CreateWebSocketManagerOptions);
|
||||
/**
|
||||
* Fetches the gateway information from Discord - or returns it from cache if available
|
||||
*
|
||||
* @param force - Whether to ignore the cache and force a fresh fetch
|
||||
*/
|
||||
fetchGatewayInformation(force?: boolean): Promise<APIGatewayBotInfo>;
|
||||
/**
|
||||
* Updates your total shard count on-the-fly, spawning shards as needed
|
||||
*
|
||||
* @param shardCount - The new shard count to use
|
||||
*/
|
||||
updateShardCount(shardCount: number | null): Promise<this>;
|
||||
/**
|
||||
* Yields the total number of shards across for your bot, accounting for Discord recommendations
|
||||
*/
|
||||
getShardCount(): Promise<number>;
|
||||
/**
|
||||
* Yields the ids of the shards this manager should manage
|
||||
*/
|
||||
getShardIds(force?: boolean): Promise<number[]>;
|
||||
connect(): Promise<void>;
|
||||
destroy(options?: Omit<WebSocketShardDestroyOptions, 'recover'>): Awaitable<void>;
|
||||
send(shardId: number, payload: GatewaySendPayload): Awaitable<void>;
|
||||
fetchStatus(): Awaitable<_discordjs_collection.Collection<number, WebSocketShardStatus>>;
|
||||
[Symbol.asyncDispose](): Promise<void>;
|
||||
}
|
||||
|
||||
interface FetchingStrategyOptions extends Omit<WebSocketManagerOptions, 'buildIdentifyThrottler' | 'buildStrategy' | 'rest' | 'retrieveSessionInfo' | 'shardCount' | 'shardIds' | 'updateSessionInfo'> {
|
||||
readonly gatewayInformation: APIGatewayBotInfo;
|
||||
readonly shardCount: number;
|
||||
}
|
||||
/**
|
||||
* Strategies responsible solely for making manager information accessible
|
||||
*/
|
||||
interface IContextFetchingStrategy {
|
||||
readonly options: FetchingStrategyOptions;
|
||||
retrieveSessionInfo(shardId: number): Awaitable<SessionInfo | null>;
|
||||
updateSessionInfo(shardId: number, sessionInfo: SessionInfo | null): Awaitable<void>;
|
||||
/**
|
||||
* Resolves once the given shard should be allowed to identify
|
||||
* This should correctly handle the signal and reject with an abort error if the operation is aborted.
|
||||
* Other errors will cause the shard to reconnect.
|
||||
*/
|
||||
waitForIdentify(shardId: number, signal: AbortSignal): Promise<void>;
|
||||
}
|
||||
declare function managerToFetchingStrategyOptions(manager: WebSocketManager): Promise<FetchingStrategyOptions>;
|
||||
|
||||
declare class SimpleContextFetchingStrategy implements IContextFetchingStrategy {
|
||||
private readonly manager;
|
||||
readonly options: FetchingStrategyOptions;
|
||||
private static throttlerCache;
|
||||
private static ensureThrottler;
|
||||
constructor(manager: WebSocketManager, options: FetchingStrategyOptions);
|
||||
retrieveSessionInfo(shardId: number): Promise<SessionInfo | null>;
|
||||
updateSessionInfo(shardId: number, sessionInfo: SessionInfo | null): _discordjs_util.Awaitable<void>;
|
||||
waitForIdentify(shardId: number, signal: AbortSignal): Promise<void>;
|
||||
}
|
||||
|
||||
declare class WorkerContextFetchingStrategy implements IContextFetchingStrategy {
|
||||
readonly options: FetchingStrategyOptions;
|
||||
private readonly sessionPromises;
|
||||
private readonly waitForIdentifyPromises;
|
||||
constructor(options: FetchingStrategyOptions);
|
||||
retrieveSessionInfo(shardId: number): Promise<SessionInfo | null>;
|
||||
updateSessionInfo(shardId: number, sessionInfo: SessionInfo | null): void;
|
||||
waitForIdentify(shardId: number, signal: AbortSignal): Promise<void>;
|
||||
}
|
||||
|
||||
interface WorkerData extends FetchingStrategyOptions {
|
||||
shardIds: number[];
|
||||
}
|
||||
declare enum WorkerSendPayloadOp {
|
||||
Connect = 0,
|
||||
Destroy = 1,
|
||||
Send = 2,
|
||||
SessionInfoResponse = 3,
|
||||
ShardIdentifyResponse = 4,
|
||||
FetchStatus = 5
|
||||
}
|
||||
type WorkerSendPayload = {
|
||||
nonce: number;
|
||||
ok: boolean;
|
||||
op: WorkerSendPayloadOp.ShardIdentifyResponse;
|
||||
} | {
|
||||
nonce: number;
|
||||
op: WorkerSendPayloadOp.FetchStatus;
|
||||
shardId: number;
|
||||
} | {
|
||||
nonce: number;
|
||||
op: WorkerSendPayloadOp.SessionInfoResponse;
|
||||
session: SessionInfo | null;
|
||||
} | {
|
||||
op: WorkerSendPayloadOp.Connect;
|
||||
shardId: number;
|
||||
} | {
|
||||
op: WorkerSendPayloadOp.Destroy;
|
||||
options?: WebSocketShardDestroyOptions;
|
||||
shardId: number;
|
||||
} | {
|
||||
op: WorkerSendPayloadOp.Send;
|
||||
payload: GatewaySendPayload;
|
||||
shardId: number;
|
||||
};
|
||||
declare enum WorkerReceivePayloadOp {
|
||||
Connected = 0,
|
||||
Destroyed = 1,
|
||||
Event = 2,
|
||||
RetrieveSessionInfo = 3,
|
||||
UpdateSessionInfo = 4,
|
||||
WaitForIdentify = 5,
|
||||
FetchStatusResponse = 6,
|
||||
WorkerReady = 7,
|
||||
CancelIdentify = 8
|
||||
}
|
||||
type WorkerReceivePayload = {
|
||||
data: any;
|
||||
event: WebSocketShardEvents;
|
||||
op: WorkerReceivePayloadOp.Event;
|
||||
shardId: number;
|
||||
} | {
|
||||
nonce: number;
|
||||
op: WorkerReceivePayloadOp.CancelIdentify;
|
||||
} | {
|
||||
nonce: number;
|
||||
op: WorkerReceivePayloadOp.FetchStatusResponse;
|
||||
status: WebSocketShardStatus;
|
||||
} | {
|
||||
nonce: number;
|
||||
op: WorkerReceivePayloadOp.RetrieveSessionInfo;
|
||||
shardId: number;
|
||||
} | {
|
||||
nonce: number;
|
||||
op: WorkerReceivePayloadOp.WaitForIdentify;
|
||||
shardId: number;
|
||||
} | {
|
||||
op: WorkerReceivePayloadOp.Connected;
|
||||
shardId: number;
|
||||
} | {
|
||||
op: WorkerReceivePayloadOp.Destroyed;
|
||||
shardId: number;
|
||||
} | {
|
||||
op: WorkerReceivePayloadOp.UpdateSessionInfo;
|
||||
session: SessionInfo | null;
|
||||
shardId: number;
|
||||
} | {
|
||||
op: WorkerReceivePayloadOp.WorkerReady;
|
||||
};
|
||||
/**
|
||||
* Options for a {@link WorkerShardingStrategy}
|
||||
*/
|
||||
interface WorkerShardingStrategyOptions {
|
||||
/**
|
||||
* Dictates how many shards should be spawned per worker thread.
|
||||
*/
|
||||
shardsPerWorker: number | 'all';
|
||||
/**
|
||||
* Handles a payload not recognized by the handler.
|
||||
*/
|
||||
unknownPayloadHandler?(payload: any): unknown;
|
||||
/**
|
||||
* Path to the worker file to use. The worker requires quite a bit of setup, it is recommended you leverage the {@link WorkerBootstrapper} class.
|
||||
*/
|
||||
workerPath?: string;
|
||||
}
|
||||
/**
|
||||
* Strategy used to spawn threads in worker_threads
|
||||
*/
|
||||
declare class WorkerShardingStrategy implements IShardingStrategy {
|
||||
#private;
|
||||
private readonly manager;
|
||||
private readonly options;
|
||||
private readonly connectPromises;
|
||||
private readonly destroyPromises;
|
||||
private readonly fetchStatusPromises;
|
||||
private readonly waitForIdentifyControllers;
|
||||
private throttler?;
|
||||
constructor(manager: WebSocketManager, options: WorkerShardingStrategyOptions);
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.spawn}
|
||||
*/
|
||||
spawn(shardIds: number[]): Promise<void>;
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.connect}
|
||||
*/
|
||||
connect(): Promise<void>;
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.destroy}
|
||||
*/
|
||||
destroy(options?: Omit<WebSocketShardDestroyOptions, 'recover'>): Promise<void>;
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.send}
|
||||
*/
|
||||
send(shardId: number, data: GatewaySendPayload): void;
|
||||
/**
|
||||
* {@inheritDoc IShardingStrategy.fetchStatus}
|
||||
*/
|
||||
fetchStatus(): Promise<Collection<number, WebSocketShardStatus>>;
|
||||
private setupWorker;
|
||||
private resolveWorkerPath;
|
||||
private waitForWorkerReady;
|
||||
private onMessage;
|
||||
private ensureThrottler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for bootstrapping the worker
|
||||
*/
|
||||
interface BootstrapOptions {
|
||||
/**
|
||||
* Shard events to just arbitrarily forward to the parent thread for the manager to emit
|
||||
* Note: By default, this will include ALL events
|
||||
* you most likely want to handle dispatch within the worker itself
|
||||
*/
|
||||
forwardEvents?: WebSocketShardEvents[];
|
||||
/**
|
||||
* Function to call when a shard is created for additional setup
|
||||
*/
|
||||
shardCallback?(shard: WebSocketShard): Awaitable<void>;
|
||||
}
|
||||
/**
|
||||
* Utility class for bootstrapping a worker thread to be used for sharding
|
||||
*/
|
||||
declare class WorkerBootstrapper {
|
||||
/**
|
||||
* The data passed to the worker thread
|
||||
*/
|
||||
protected readonly data: WorkerData;
|
||||
/**
|
||||
* The shards that are managed by this worker
|
||||
*/
|
||||
protected readonly shards: Collection<number, WebSocketShard>;
|
||||
constructor();
|
||||
/**
|
||||
* Helper method to initiate a shard's connection process
|
||||
*/
|
||||
protected connect(shardId: number): Promise<void>;
|
||||
/**
|
||||
* Helper method to destroy a shard
|
||||
*/
|
||||
protected destroy(shardId: number, options?: WebSocketShardDestroyOptions): Promise<void>;
|
||||
/**
|
||||
* Helper method to attach event listeners to the parentPort
|
||||
*/
|
||||
protected setupThreadEvents(): void;
|
||||
/**
|
||||
* Bootstraps the worker thread with the provided options
|
||||
*/
|
||||
bootstrap(options?: Readonly<BootstrapOptions>): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/ws#readme | @discordjs/ws} version
|
||||
* that you are currently using.
|
||||
*/
|
||||
declare const version: string;
|
||||
|
||||
export { type BootstrapOptions, CloseCodes, CompressionMethod, type CreateWebSocketManagerOptions, DefaultDeviceProperty, DefaultWebSocketManagerOptions, Encoding, type FetchingStrategyOptions, type IContextFetchingStrategy, type IIdentifyThrottler, type IShardingStrategy, type IdentifyState, ImportantGatewayOpcodes, type ManagerShardEventsMap, type OptionalWebSocketManagerOptions, type RequiredWebSocketManagerOptions, type SendRateLimitState, type SessionInfo, type ShardRange, SimpleContextFetchingStrategy, SimpleIdentifyThrottler, SimpleShardingStrategy, WebSocketManager, type WebSocketManagerOptions, WebSocketShard, type WebSocketShardDestroyOptions, WebSocketShardDestroyRecovery, WebSocketShardEvents, type WebSocketShardEventsMap, WebSocketShardStatus, WorkerBootstrapper, WorkerContextFetchingStrategy, type WorkerData, type WorkerReceivePayload, WorkerReceivePayloadOp, type WorkerSendPayload, WorkerSendPayloadOp, WorkerShardingStrategy, type WorkerShardingStrategyOptions, getInitialSendRateLimitState, managerToFetchingStrategyOptions, version };
|
||||
1505
node_modules/@discordjs/ws/dist/index.js
generated
vendored
Normal file
1505
node_modules/@discordjs/ws/dist/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/@discordjs/ws/dist/index.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/dist/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1469
node_modules/@discordjs/ws/dist/index.mjs
generated
vendored
Normal file
1469
node_modules/@discordjs/ws/dist/index.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/@discordjs/ws/dist/index.mjs.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/dist/index.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
191
node_modules/@discordjs/ws/node_modules/@discordjs/collection/LICENSE
generated
vendored
Normal file
191
node_modules/@discordjs/ws/node_modules/@discordjs/collection/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,191 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Copyright 2021 Noel Buechler
|
||||
Copyright 2015 Amish Shah
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
67
node_modules/@discordjs/ws/node_modules/@discordjs/collection/README.md
generated
vendored
Normal file
67
node_modules/@discordjs/ws/node_modules/@discordjs/collection/README.md
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
<div align="center">
|
||||
<br />
|
||||
<p>
|
||||
<a href="https://discord.js.org"><img src="https://discord.js.org/static/logo.svg" width="546" alt="discord.js" /></a>
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
<a href="https://discord.gg/djs"><img src="https://img.shields.io/discord/222078108977594368?color=5865F2&logo=discord&logoColor=white" alt="Discord server" /></a>
|
||||
<a href="https://www.npmjs.com/package/@discordjs/collection"><img src="https://img.shields.io/npm/v/@discordjs/collection.svg?maxAge=3600" alt="npm version" /></a>
|
||||
<a href="https://www.npmjs.com/package/@discordjs/collection"><img src="https://img.shields.io/npm/dt/@discordjs/collection.svg?maxAge=3600" alt="npm downloads" /></a>
|
||||
<a href="https://github.com/discordjs/discord.js/actions"><img src="https://github.com/discordjs/discord.js/actions/workflows/test.yml/badge.svg" alt="Build status" /></a>
|
||||
<a href="https://codecov.io/gh/discordjs/discord.js" ><img src="https://codecov.io/gh/discordjs/discord.js/branch/main/graph/badge.svg?precision=2&flag=collection" alt="Code coverage" /></a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://vercel.com/?utm_source=discordjs&utm_campaign=oss"><img src="https://raw.githubusercontent.com/discordjs/discord.js/main/.github/powered-by-vercel.svg" alt="Vercel" /></a>
|
||||
<a href="https://www.cloudflare.com"><img src="https://raw.githubusercontent.com/discordjs/discord.js/main/.github/powered-by-workers.png" alt="Cloudflare Workers" height="44" /></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
## About
|
||||
|
||||
`@discordjs/collection` is a powerful utility data structure used in discord.js.
|
||||
|
||||
## Installation
|
||||
|
||||
**Node.js 18 or newer is required.**
|
||||
|
||||
```sh
|
||||
npm install @discordjs/collection
|
||||
yarn add @discordjs/collection
|
||||
pnpm add @discordjs/collection
|
||||
```
|
||||
|
||||
## Links
|
||||
|
||||
- [Website][website] ([source][website-source])
|
||||
- [Documentation][documentation]
|
||||
- [Guide][guide] ([source][guide-source])
|
||||
Also see the v13 to v14 [Update Guide][guide-update], which includes updated and removed items from the library.
|
||||
- [discord.js Discord server][discord]
|
||||
- [Discord API Discord server][discord-api]
|
||||
- [GitHub][source]
|
||||
- [npm][npm]
|
||||
- [Related libraries][related-libs]
|
||||
|
||||
## Contributing
|
||||
|
||||
Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
|
||||
[documentation][documentation].
|
||||
See [the contribution guide][contributing] if you'd like to submit a PR.
|
||||
|
||||
## Help
|
||||
|
||||
If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [discord.js Server][discord].
|
||||
|
||||
[website]: https://discord.js.org
|
||||
[website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
|
||||
[documentation]: https://discord.js.org/docs/packages/collection/stable
|
||||
[guide]: https://discordjs.guide/
|
||||
[guide-source]: https://github.com/discordjs/guide
|
||||
[guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html
|
||||
[discord]: https://discord.gg/djs
|
||||
[discord-api]: https://discord.gg/discord-api
|
||||
[source]: https://github.com/discordjs/discord.js/tree/main/packages/collection
|
||||
[npm]: https://www.npmjs.com/package/@discordjs/collection
|
||||
[related-libs]: https://discord.com/developers/docs/topics/community-resources#libraries
|
||||
[contributing]: https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md
|
||||
537
node_modules/@discordjs/ws/node_modules/@discordjs/collection/dist/index.d.mts
generated
vendored
Normal file
537
node_modules/@discordjs/ws/node_modules/@discordjs/collection/dist/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,537 @@
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
interface CollectionConstructor {
|
||||
new (): Collection<unknown, unknown>;
|
||||
new <Key, Value>(entries?: readonly (readonly [Key, Value])[] | null): Collection<Key, Value>;
|
||||
new <Key, Value>(iterable: Iterable<readonly [Key, Value]>): Collection<Key, Value>;
|
||||
readonly prototype: Collection<unknown, unknown>;
|
||||
readonly [Symbol.species]: CollectionConstructor;
|
||||
}
|
||||
/**
|
||||
* Represents an immutable version of a collection
|
||||
*/
|
||||
type ReadonlyCollection<Key, Value> = Omit<Collection<Key, Value>, 'clear' | 'delete' | 'ensure' | 'forEach' | 'get' | 'reverse' | 'set' | 'sort' | 'sweep'> & ReadonlyMap<Key, Value>;
|
||||
/**
|
||||
* Separate interface for the constructor so that emitted js does not have a constructor that overwrites itself
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
interface Collection<Key, Value> extends Map<Key, Value> {
|
||||
constructor: CollectionConstructor;
|
||||
}
|
||||
/**
|
||||
* A Map with additional utility methods. This is used throughout discord.js rather than Arrays for anything that has
|
||||
* an ID, for significantly improved performance and ease-of-use.
|
||||
*
|
||||
* @typeParam Key - The key type this collection holds
|
||||
* @typeParam Value - The value type this collection holds
|
||||
*/
|
||||
declare class Collection<Key, Value> extends Map<Key, Value> {
|
||||
/**
|
||||
* Obtains the value of the given key if it exists, otherwise sets and returns the value provided by the default value generator.
|
||||
*
|
||||
* @param key - The key to get if it exists, or set otherwise
|
||||
* @param defaultValueGenerator - A function that generates the default value
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.ensure(guildId, () => defaultGuildConfig);
|
||||
* ```
|
||||
*/
|
||||
ensure(key: Key, defaultValueGenerator: (key: Key, collection: this) => Value): Value;
|
||||
/**
|
||||
* Checks if all of the elements exist in the collection.
|
||||
*
|
||||
* @param keys - The keys of the elements to check for
|
||||
* @returns `true` if all of the elements exist, `false` if at least one does not exist.
|
||||
*/
|
||||
hasAll(...keys: Key[]): boolean;
|
||||
/**
|
||||
* Checks if any of the elements exist in the collection.
|
||||
*
|
||||
* @param keys - The keys of the elements to check for
|
||||
* @returns `true` if any of the elements exist, `false` if none exist.
|
||||
*/
|
||||
hasAny(...keys: Key[]): boolean;
|
||||
/**
|
||||
* Obtains the first value(s) in this collection.
|
||||
*
|
||||
* @param amount - Amount of values to obtain from the beginning
|
||||
* @returns A single value if no amount is provided or an array of values, starting from the end if amount is negative
|
||||
*/
|
||||
first(): Value | undefined;
|
||||
first(amount: number): Value[];
|
||||
/**
|
||||
* Obtains the first key(s) in this collection.
|
||||
*
|
||||
* @param amount - Amount of keys to obtain from the beginning
|
||||
* @returns A single key if no amount is provided or an array of keys, starting from the end if
|
||||
* amount is negative
|
||||
*/
|
||||
firstKey(): Key | undefined;
|
||||
firstKey(amount: number): Key[];
|
||||
/**
|
||||
* Obtains the last value(s) in this collection.
|
||||
*
|
||||
* @param amount - Amount of values to obtain from the end
|
||||
* @returns A single value if no amount is provided or an array of values, starting from the start if
|
||||
* amount is negative
|
||||
*/
|
||||
last(): Value | undefined;
|
||||
last(amount: number): Value[];
|
||||
/**
|
||||
* Obtains the last key(s) in this collection.
|
||||
*
|
||||
* @param amount - Amount of keys to obtain from the end
|
||||
* @returns A single key if no amount is provided or an array of keys, starting from the start if
|
||||
* amount is negative
|
||||
*/
|
||||
lastKey(): Key | undefined;
|
||||
lastKey(amount: number): Key[];
|
||||
/**
|
||||
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at()}.
|
||||
* Returns the item at a given index, allowing for positive and negative integers.
|
||||
* Negative integers count back from the last item in the collection.
|
||||
*
|
||||
* @param index - The index of the element to obtain
|
||||
*/
|
||||
at(index: number): Value | undefined;
|
||||
/**
|
||||
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at()}.
|
||||
* Returns the key at a given index, allowing for positive and negative integers.
|
||||
* Negative integers count back from the last item in the collection.
|
||||
*
|
||||
* @param index - The index of the key to obtain
|
||||
*/
|
||||
keyAt(index: number): Key | undefined;
|
||||
/**
|
||||
* Obtains unique random value(s) from this collection.
|
||||
*
|
||||
* @param amount - Amount of values to obtain randomly
|
||||
* @returns A single value if no amount is provided or an array of values
|
||||
*/
|
||||
random(): Value | undefined;
|
||||
random(amount: number): Value[];
|
||||
/**
|
||||
* Obtains unique random key(s) from this collection.
|
||||
*
|
||||
* @param amount - Amount of keys to obtain randomly
|
||||
* @returns A single key if no amount is provided or an array
|
||||
*/
|
||||
randomKey(): Key | undefined;
|
||||
randomKey(amount: number): Key[];
|
||||
/**
|
||||
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse | Array.reverse()}
|
||||
* but returns a Collection instead of an Array.
|
||||
*/
|
||||
reverse(): this;
|
||||
/**
|
||||
* Searches for a single item where the given function returns a truthy value. This behaves like
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find | Array.find()}.
|
||||
* All collections used in Discord.js are mapped using their `id` property, and if you want to find by id you
|
||||
* should use the `get` method. See
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get | MDN} for details.
|
||||
*
|
||||
* @param fn - The function to test with (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.find(user => user.username === 'Bob');
|
||||
* ```
|
||||
*/
|
||||
find<NewValue extends Value>(fn: (value: Value, key: Key, collection: this) => value is NewValue): NewValue | undefined;
|
||||
find(fn: (value: Value, key: Key, collection: this) => unknown): Value | undefined;
|
||||
find<This, NewValue extends Value>(fn: (this: This, value: Value, key: Key, collection: this) => value is NewValue, thisArg: This): NewValue | undefined;
|
||||
find<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): Value | undefined;
|
||||
/**
|
||||
* Searches for the key of a single item where the given function returns a truthy value. This behaves like
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex | Array.findIndex()},
|
||||
* but returns the key rather than the positional index.
|
||||
*
|
||||
* @param fn - The function to test with (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.findKey(user => user.username === 'Bob');
|
||||
* ```
|
||||
*/
|
||||
findKey<NewKey extends Key>(fn: (value: Value, key: Key, collection: this) => key is NewKey): NewKey | undefined;
|
||||
findKey(fn: (value: Value, key: Key, collection: this) => unknown): Key | undefined;
|
||||
findKey<This, NewKey extends Key>(fn: (this: This, value: Value, key: Key, collection: this) => key is NewKey, thisArg: This): NewKey | undefined;
|
||||
findKey<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): Key | undefined;
|
||||
/**
|
||||
* Searches for a last item where the given function returns a truthy value. This behaves like
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast | Array.findLast()}.
|
||||
*
|
||||
* @param fn - The function to test with (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
*/
|
||||
findLast<NewValue extends Value>(fn: (value: Value, key: Key, collection: this) => value is NewValue): NewValue | undefined;
|
||||
findLast(fn: (value: Value, key: Key, collection: this) => unknown): Value | undefined;
|
||||
findLast<This, NewValue extends Value>(fn: (this: This, value: Value, key: Key, collection: this) => value is NewValue, thisArg: This): NewValue | undefined;
|
||||
findLast<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): Value | undefined;
|
||||
/**
|
||||
* Searches for the key of a last item where the given function returns a truthy value. This behaves like
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex | Array.findLastIndex()},
|
||||
* but returns the key rather than the positional index.
|
||||
*
|
||||
* @param fn - The function to test with (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
*/
|
||||
findLastKey<NewKey extends Key>(fn: (value: Value, key: Key, collection: this) => key is NewKey): NewKey | undefined;
|
||||
findLastKey(fn: (value: Value, key: Key, collection: this) => unknown): Key | undefined;
|
||||
findLastKey<This, NewKey extends Key>(fn: (this: This, value: Value, key: Key, collection: this) => key is NewKey, thisArg: This): NewKey | undefined;
|
||||
findLastKey<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): Key | undefined;
|
||||
/**
|
||||
* Removes items that satisfy the provided filter function.
|
||||
*
|
||||
* @param fn - Function used to test (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @returns The number of removed entries
|
||||
*/
|
||||
sweep(fn: (value: Value, key: Key, collection: this) => unknown): number;
|
||||
sweep<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): number;
|
||||
/**
|
||||
* Identical to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter | Array.filter()},
|
||||
* but returns a Collection instead of an Array.
|
||||
*
|
||||
* @param fn - The function to test with (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.filter(user => user.username === 'Bob');
|
||||
* ```
|
||||
*/
|
||||
filter<NewKey extends Key>(fn: (value: Value, key: Key, collection: this) => key is NewKey): Collection<NewKey, Value>;
|
||||
filter<NewValue extends Value>(fn: (value: Value, key: Key, collection: this) => value is NewValue): Collection<Key, NewValue>;
|
||||
filter(fn: (value: Value, key: Key, collection: this) => unknown): Collection<Key, Value>;
|
||||
filter<This, NewKey extends Key>(fn: (this: This, value: Value, key: Key, collection: this) => key is NewKey, thisArg: This): Collection<NewKey, Value>;
|
||||
filter<This, NewValue extends Value>(fn: (this: This, value: Value, key: Key, collection: this) => value is NewValue, thisArg: This): Collection<Key, NewValue>;
|
||||
filter<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): Collection<Key, Value>;
|
||||
/**
|
||||
* Partitions the collection into two collections where the first collection
|
||||
* contains the items that passed and the second contains the items that failed.
|
||||
*
|
||||
* @param fn - Function used to test (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* const [big, small] = collection.partition(guild => guild.memberCount > 250);
|
||||
* ```
|
||||
*/
|
||||
partition<NewKey extends Key>(fn: (value: Value, key: Key, collection: this) => key is NewKey): [Collection<NewKey, Value>, Collection<Exclude<Key, NewKey>, Value>];
|
||||
partition<NewValue extends Value>(fn: (value: Value, key: Key, collection: this) => value is NewValue): [Collection<Key, NewValue>, Collection<Key, Exclude<Value, NewValue>>];
|
||||
partition(fn: (value: Value, key: Key, collection: this) => unknown): [Collection<Key, Value>, Collection<Key, Value>];
|
||||
partition<This, NewKey extends Key>(fn: (this: This, value: Value, key: Key, collection: this) => key is NewKey, thisArg: This): [Collection<NewKey, Value>, Collection<Exclude<Key, NewKey>, Value>];
|
||||
partition<This, NewValue extends Value>(fn: (this: This, value: Value, key: Key, collection: this) => value is NewValue, thisArg: This): [Collection<Key, NewValue>, Collection<Key, Exclude<Value, NewValue>>];
|
||||
partition<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): [Collection<Key, Value>, Collection<Key, Value>];
|
||||
/**
|
||||
* Maps each item into a Collection, then joins the results into a single Collection. Identical in behavior to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap | Array.flatMap()}.
|
||||
*
|
||||
* @param fn - Function that produces a new Collection
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.flatMap(guild => guild.members.cache);
|
||||
* ```
|
||||
*/
|
||||
flatMap<NewValue>(fn: (value: Value, key: Key, collection: this) => Collection<Key, NewValue>): Collection<Key, NewValue>;
|
||||
flatMap<NewValue, This>(fn: (this: This, value: Value, key: Key, collection: this) => Collection<Key, NewValue>, thisArg: This): Collection<Key, NewValue>;
|
||||
/**
|
||||
* Maps each item to another value into an array. Identical in behavior to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map | Array.map()}.
|
||||
*
|
||||
* @param fn - Function that produces an element of the new array, taking three arguments
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.map(user => user.tag);
|
||||
* ```
|
||||
*/
|
||||
map<NewValue>(fn: (value: Value, key: Key, collection: this) => NewValue): NewValue[];
|
||||
map<This, NewValue>(fn: (this: This, value: Value, key: Key, collection: this) => NewValue, thisArg: This): NewValue[];
|
||||
/**
|
||||
* Maps each item to another value into a collection. Identical in behavior to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map | Array.map()}.
|
||||
*
|
||||
* @param fn - Function that produces an element of the new collection, taking three arguments
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.mapValues(user => user.tag);
|
||||
* ```
|
||||
*/
|
||||
mapValues<NewValue>(fn: (value: Value, key: Key, collection: this) => NewValue): Collection<Key, NewValue>;
|
||||
mapValues<This, NewValue>(fn: (this: This, value: Value, key: Key, collection: this) => NewValue, thisArg: This): Collection<Key, NewValue>;
|
||||
/**
|
||||
* Checks if there exists an item that passes a test. Identical in behavior to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some | Array.some()}.
|
||||
*
|
||||
* @param fn - Function used to test (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.some(user => user.discriminator === '0000');
|
||||
* ```
|
||||
*/
|
||||
some(fn: (value: Value, key: Key, collection: this) => unknown): boolean;
|
||||
some<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): boolean;
|
||||
/**
|
||||
* Checks if all items passes a test. Identical in behavior to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every | Array.every()}.
|
||||
*
|
||||
* @param fn - Function used to test (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.every(user => !user.bot);
|
||||
* ```
|
||||
*/
|
||||
every<NewKey extends Key>(fn: (value: Value, key: Key, collection: this) => key is NewKey): this is Collection<NewKey, Value>;
|
||||
every<NewValue extends Value>(fn: (value: Value, key: Key, collection: this) => value is NewValue): this is Collection<Key, NewValue>;
|
||||
every(fn: (value: Value, key: Key, collection: this) => unknown): boolean;
|
||||
every<This, NewKey extends Key>(fn: (this: This, value: Value, key: Key, collection: this) => key is NewKey, thisArg: This): this is Collection<NewKey, Value>;
|
||||
every<This, NewValue extends Value>(fn: (this: This, value: Value, key: Key, collection: this) => value is NewValue, thisArg: This): this is Collection<Key, NewValue>;
|
||||
every<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): boolean;
|
||||
/**
|
||||
* Applies a function to produce a single value. Identical in behavior to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce | Array.reduce()}.
|
||||
*
|
||||
* @param fn - Function used to reduce, taking four arguments; `accumulator`, `currentValue`, `currentKey`,
|
||||
* and `collection`
|
||||
* @param initialValue - Starting value for the accumulator
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.reduce((acc, guild) => acc + guild.memberCount, 0);
|
||||
* ```
|
||||
*/
|
||||
reduce(fn: (accumulator: Value, value: Value, key: Key, collection: this) => Value, initialValue?: Value): Value;
|
||||
reduce<InitialValue>(fn: (accumulator: InitialValue, value: Value, key: Key, collection: this) => InitialValue, initialValue: InitialValue): InitialValue;
|
||||
/**
|
||||
* Applies a function to produce a single value. Identical in behavior to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight | Array.reduceRight()}.
|
||||
*
|
||||
* @param fn - Function used to reduce, taking four arguments; `accumulator`, `value`, `key`, and `collection`
|
||||
* @param initialValue - Starting value for the accumulator
|
||||
*/
|
||||
reduceRight(fn: (accumulator: Value, value: Value, key: Key, collection: this) => Value, initialValue?: Value): Value;
|
||||
reduceRight<InitialValue>(fn: (accumulator: InitialValue, value: Value, key: Key, collection: this) => InitialValue, initialValue: InitialValue): InitialValue;
|
||||
/**
|
||||
* Identical to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach | Map.forEach()},
|
||||
* but returns the collection instead of undefined.
|
||||
*
|
||||
* @param fn - Function to execute for each element
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection
|
||||
* .each(user => console.log(user.username))
|
||||
* .filter(user => user.bot)
|
||||
* .each(user => console.log(user.username));
|
||||
* ```
|
||||
*/
|
||||
each(fn: (value: Value, key: Key, collection: this) => void): this;
|
||||
each<This>(fn: (this: This, value: Value, key: Key, collection: this) => void, thisArg: This): this;
|
||||
/**
|
||||
* Runs a function on the collection and returns the collection.
|
||||
*
|
||||
* @param fn - Function to execute
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection
|
||||
* .tap(coll => console.log(coll.size))
|
||||
* .filter(user => user.bot)
|
||||
* .tap(coll => console.log(coll.size))
|
||||
* ```
|
||||
*/
|
||||
tap(fn: (collection: this) => void): this;
|
||||
tap<This>(fn: (this: This, collection: this) => void, thisArg: This): this;
|
||||
/**
|
||||
* Creates an identical shallow copy of this collection.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* const newColl = someColl.clone();
|
||||
* ```
|
||||
*/
|
||||
clone(): Collection<Key, Value>;
|
||||
/**
|
||||
* Combines this collection with others into a new collection. None of the source collections are modified.
|
||||
*
|
||||
* @param collections - Collections to merge
|
||||
* @example
|
||||
* ```ts
|
||||
* const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl);
|
||||
* ```
|
||||
*/
|
||||
concat(...collections: ReadonlyCollection<Key, Value>[]): Collection<Key, Value>;
|
||||
/**
|
||||
* Checks if this collection shares identical items with another.
|
||||
* This is different to checking for equality using equal-signs, because
|
||||
* the collections may be different objects, but contain the same data.
|
||||
*
|
||||
* @param collection - Collection to compare with
|
||||
* @returns Whether the collections have identical contents
|
||||
*/
|
||||
equals(collection: ReadonlyCollection<Key, Value>): boolean;
|
||||
/**
|
||||
* The sort method sorts the items of a collection in place and returns it.
|
||||
* The sort is not necessarily stable in Node 10 or older.
|
||||
* The default sort order is according to string Unicode code points.
|
||||
*
|
||||
* @param compareFunction - Specifies a function that defines the sort order.
|
||||
* If omitted, the collection is sorted according to each character's Unicode code point value, according to the string conversion of each element.
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);
|
||||
* ```
|
||||
*/
|
||||
sort(compareFunction?: Comparator<Key, Value>): this;
|
||||
/**
|
||||
* The intersection method returns a new collection containing the items where the key is present in both collections.
|
||||
*
|
||||
* @param other - The other Collection to filter against
|
||||
* @example
|
||||
* ```ts
|
||||
* const col1 = new Collection([['a', 1], ['b', 2]]);
|
||||
* const col2 = new Collection([['a', 1], ['c', 3]]);
|
||||
* const intersection = col1.intersection(col2);
|
||||
* console.log(col1.intersection(col2));
|
||||
* // => Collection { 'a' => 1 }
|
||||
* ```
|
||||
*/
|
||||
intersection(other: ReadonlyCollection<Key, any>): Collection<Key, Value>;
|
||||
/**
|
||||
* Returns a new collection containing the items where the key is present in either of the collections.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* If the collections have any items with the same key, the value from the first collection will be used.
|
||||
* @param other - The other Collection to filter against
|
||||
* @example
|
||||
* ```ts
|
||||
* const col1 = new Collection([['a', 1], ['b', 2]]);
|
||||
* const col2 = new Collection([['a', 1], ['b', 3], ['c', 3]]);
|
||||
* const union = col1.union(col2);
|
||||
* console.log(union);
|
||||
* // => Collection { 'a' => 1, 'b' => 2, 'c' => 3 }
|
||||
* ```
|
||||
*/
|
||||
union<OtherValue>(other: ReadonlyCollection<Key, OtherValue>): Collection<Key, OtherValue | Value>;
|
||||
/**
|
||||
* Returns a new collection containing the items where the key is present in this collection but not the other.
|
||||
*
|
||||
* @param other - The other Collection to filter against
|
||||
* @example
|
||||
* ```ts
|
||||
* const col1 = new Collection([['a', 1], ['b', 2]]);
|
||||
* const col2 = new Collection([['a', 1], ['c', 3]]);
|
||||
* console.log(col1.difference(col2));
|
||||
* // => Collection { 'b' => 2 }
|
||||
* console.log(col2.difference(col1));
|
||||
* // => Collection { 'c' => 3 }
|
||||
* ```
|
||||
*/
|
||||
difference(other: ReadonlyCollection<Key, any>): Collection<Key, Value>;
|
||||
/**
|
||||
* Returns a new collection containing only the items where the keys are present in either collection, but not both.
|
||||
*
|
||||
* @param other - The other Collection to filter against
|
||||
* @example
|
||||
* ```ts
|
||||
* const col1 = new Collection([['a', 1], ['b', 2]]);
|
||||
* const col2 = new Collection([['a', 1], ['c', 3]]);
|
||||
* const symmetricDifference = col1.symmetricDifference(col2);
|
||||
* console.log(col1.symmetricDifference(col2));
|
||||
* // => Collection { 'b' => 2, 'c' => 3 }
|
||||
* ```
|
||||
*/
|
||||
symmetricDifference<OtherValue>(other: ReadonlyCollection<Key, OtherValue>): Collection<Key, OtherValue | Value>;
|
||||
/**
|
||||
* Merges two Collections together into a new Collection.
|
||||
*
|
||||
* @param other - The other Collection to merge with
|
||||
* @param whenInSelf - Function getting the result if the entry only exists in this Collection
|
||||
* @param whenInOther - Function getting the result if the entry only exists in the other Collection
|
||||
* @param whenInBoth - Function getting the result if the entry exists in both Collections
|
||||
* @example
|
||||
* ```ts
|
||||
* // Sums up the entries in two collections.
|
||||
* coll.merge(
|
||||
* other,
|
||||
* x => ({ keep: true, value: x }),
|
||||
* y => ({ keep: true, value: y }),
|
||||
* (x, y) => ({ keep: true, value: x + y }),
|
||||
* );
|
||||
* ```
|
||||
* @example
|
||||
* ```ts
|
||||
* // Intersects two collections in a left-biased manner.
|
||||
* coll.merge(
|
||||
* other,
|
||||
* x => ({ keep: false }),
|
||||
* y => ({ keep: false }),
|
||||
* (x, _) => ({ keep: true, value: x }),
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
merge<OtherValue, ResultValue>(other: ReadonlyCollection<Key, OtherValue>, whenInSelf: (value: Value, key: Key) => Keep<ResultValue>, whenInOther: (valueOther: OtherValue, key: Key) => Keep<ResultValue>, whenInBoth: (value: Value, valueOther: OtherValue, key: Key) => Keep<ResultValue>): Collection<Key, ResultValue>;
|
||||
/**
|
||||
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed | Array.toReversed()}
|
||||
* but returns a Collection instead of an Array.
|
||||
*/
|
||||
toReversed(): Collection<Key, Value>;
|
||||
/**
|
||||
* The sorted method sorts the items of a collection and returns it.
|
||||
* The sort is not necessarily stable in Node 10 or older.
|
||||
* The default sort order is according to string Unicode code points.
|
||||
*
|
||||
* @param compareFunction - Specifies a function that defines the sort order.
|
||||
* If omitted, the collection is sorted according to each character's Unicode code point value,
|
||||
* according to the string conversion of each element.
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFunction?: Comparator<Key, Value>): Collection<Key, Value>;
|
||||
toJSON(): [Key, Value][];
|
||||
private static defaultSort;
|
||||
/**
|
||||
* Creates a Collection from a list of entries.
|
||||
*
|
||||
* @param entries - The list of entries
|
||||
* @param combine - Function to combine an existing entry with a new one
|
||||
* @example
|
||||
* ```ts
|
||||
* Collection.combineEntries([["a", 1], ["b", 2], ["a", 2]], (x, y) => x + y);
|
||||
* // returns Collection { "a" => 3, "b" => 2 }
|
||||
* ```
|
||||
*/
|
||||
static combineEntries<Key, Value>(entries: Iterable<[Key, Value]>, combine: (firstValue: Value, secondValue: Value, key: Key) => Value): Collection<Key, Value>;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
type Keep<Value> = {
|
||||
keep: false;
|
||||
} | {
|
||||
keep: true;
|
||||
value: Value;
|
||||
};
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
type Comparator<Key, Value> = (firstValue: Value, secondValue: Value, firstKey: Key, secondKey: Key) => number;
|
||||
|
||||
/**
|
||||
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/collection#readme | @discordjs/collection} version
|
||||
* that you are currently using.
|
||||
*/
|
||||
declare const version: string;
|
||||
|
||||
export { Collection, type CollectionConstructor, type Comparator, type Keep, type ReadonlyCollection, version };
|
||||
537
node_modules/@discordjs/ws/node_modules/@discordjs/collection/dist/index.d.ts
generated
vendored
Normal file
537
node_modules/@discordjs/ws/node_modules/@discordjs/collection/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,537 @@
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
interface CollectionConstructor {
|
||||
new (): Collection<unknown, unknown>;
|
||||
new <Key, Value>(entries?: readonly (readonly [Key, Value])[] | null): Collection<Key, Value>;
|
||||
new <Key, Value>(iterable: Iterable<readonly [Key, Value]>): Collection<Key, Value>;
|
||||
readonly prototype: Collection<unknown, unknown>;
|
||||
readonly [Symbol.species]: CollectionConstructor;
|
||||
}
|
||||
/**
|
||||
* Represents an immutable version of a collection
|
||||
*/
|
||||
type ReadonlyCollection<Key, Value> = Omit<Collection<Key, Value>, 'clear' | 'delete' | 'ensure' | 'forEach' | 'get' | 'reverse' | 'set' | 'sort' | 'sweep'> & ReadonlyMap<Key, Value>;
|
||||
/**
|
||||
* Separate interface for the constructor so that emitted js does not have a constructor that overwrites itself
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
interface Collection<Key, Value> extends Map<Key, Value> {
|
||||
constructor: CollectionConstructor;
|
||||
}
|
||||
/**
|
||||
* A Map with additional utility methods. This is used throughout discord.js rather than Arrays for anything that has
|
||||
* an ID, for significantly improved performance and ease-of-use.
|
||||
*
|
||||
* @typeParam Key - The key type this collection holds
|
||||
* @typeParam Value - The value type this collection holds
|
||||
*/
|
||||
declare class Collection<Key, Value> extends Map<Key, Value> {
|
||||
/**
|
||||
* Obtains the value of the given key if it exists, otherwise sets and returns the value provided by the default value generator.
|
||||
*
|
||||
* @param key - The key to get if it exists, or set otherwise
|
||||
* @param defaultValueGenerator - A function that generates the default value
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.ensure(guildId, () => defaultGuildConfig);
|
||||
* ```
|
||||
*/
|
||||
ensure(key: Key, defaultValueGenerator: (key: Key, collection: this) => Value): Value;
|
||||
/**
|
||||
* Checks if all of the elements exist in the collection.
|
||||
*
|
||||
* @param keys - The keys of the elements to check for
|
||||
* @returns `true` if all of the elements exist, `false` if at least one does not exist.
|
||||
*/
|
||||
hasAll(...keys: Key[]): boolean;
|
||||
/**
|
||||
* Checks if any of the elements exist in the collection.
|
||||
*
|
||||
* @param keys - The keys of the elements to check for
|
||||
* @returns `true` if any of the elements exist, `false` if none exist.
|
||||
*/
|
||||
hasAny(...keys: Key[]): boolean;
|
||||
/**
|
||||
* Obtains the first value(s) in this collection.
|
||||
*
|
||||
* @param amount - Amount of values to obtain from the beginning
|
||||
* @returns A single value if no amount is provided or an array of values, starting from the end if amount is negative
|
||||
*/
|
||||
first(): Value | undefined;
|
||||
first(amount: number): Value[];
|
||||
/**
|
||||
* Obtains the first key(s) in this collection.
|
||||
*
|
||||
* @param amount - Amount of keys to obtain from the beginning
|
||||
* @returns A single key if no amount is provided or an array of keys, starting from the end if
|
||||
* amount is negative
|
||||
*/
|
||||
firstKey(): Key | undefined;
|
||||
firstKey(amount: number): Key[];
|
||||
/**
|
||||
* Obtains the last value(s) in this collection.
|
||||
*
|
||||
* @param amount - Amount of values to obtain from the end
|
||||
* @returns A single value if no amount is provided or an array of values, starting from the start if
|
||||
* amount is negative
|
||||
*/
|
||||
last(): Value | undefined;
|
||||
last(amount: number): Value[];
|
||||
/**
|
||||
* Obtains the last key(s) in this collection.
|
||||
*
|
||||
* @param amount - Amount of keys to obtain from the end
|
||||
* @returns A single key if no amount is provided or an array of keys, starting from the start if
|
||||
* amount is negative
|
||||
*/
|
||||
lastKey(): Key | undefined;
|
||||
lastKey(amount: number): Key[];
|
||||
/**
|
||||
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at()}.
|
||||
* Returns the item at a given index, allowing for positive and negative integers.
|
||||
* Negative integers count back from the last item in the collection.
|
||||
*
|
||||
* @param index - The index of the element to obtain
|
||||
*/
|
||||
at(index: number): Value | undefined;
|
||||
/**
|
||||
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at()}.
|
||||
* Returns the key at a given index, allowing for positive and negative integers.
|
||||
* Negative integers count back from the last item in the collection.
|
||||
*
|
||||
* @param index - The index of the key to obtain
|
||||
*/
|
||||
keyAt(index: number): Key | undefined;
|
||||
/**
|
||||
* Obtains unique random value(s) from this collection.
|
||||
*
|
||||
* @param amount - Amount of values to obtain randomly
|
||||
* @returns A single value if no amount is provided or an array of values
|
||||
*/
|
||||
random(): Value | undefined;
|
||||
random(amount: number): Value[];
|
||||
/**
|
||||
* Obtains unique random key(s) from this collection.
|
||||
*
|
||||
* @param amount - Amount of keys to obtain randomly
|
||||
* @returns A single key if no amount is provided or an array
|
||||
*/
|
||||
randomKey(): Key | undefined;
|
||||
randomKey(amount: number): Key[];
|
||||
/**
|
||||
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse | Array.reverse()}
|
||||
* but returns a Collection instead of an Array.
|
||||
*/
|
||||
reverse(): this;
|
||||
/**
|
||||
* Searches for a single item where the given function returns a truthy value. This behaves like
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find | Array.find()}.
|
||||
* All collections used in Discord.js are mapped using their `id` property, and if you want to find by id you
|
||||
* should use the `get` method. See
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get | MDN} for details.
|
||||
*
|
||||
* @param fn - The function to test with (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.find(user => user.username === 'Bob');
|
||||
* ```
|
||||
*/
|
||||
find<NewValue extends Value>(fn: (value: Value, key: Key, collection: this) => value is NewValue): NewValue | undefined;
|
||||
find(fn: (value: Value, key: Key, collection: this) => unknown): Value | undefined;
|
||||
find<This, NewValue extends Value>(fn: (this: This, value: Value, key: Key, collection: this) => value is NewValue, thisArg: This): NewValue | undefined;
|
||||
find<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): Value | undefined;
|
||||
/**
|
||||
* Searches for the key of a single item where the given function returns a truthy value. This behaves like
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex | Array.findIndex()},
|
||||
* but returns the key rather than the positional index.
|
||||
*
|
||||
* @param fn - The function to test with (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.findKey(user => user.username === 'Bob');
|
||||
* ```
|
||||
*/
|
||||
findKey<NewKey extends Key>(fn: (value: Value, key: Key, collection: this) => key is NewKey): NewKey | undefined;
|
||||
findKey(fn: (value: Value, key: Key, collection: this) => unknown): Key | undefined;
|
||||
findKey<This, NewKey extends Key>(fn: (this: This, value: Value, key: Key, collection: this) => key is NewKey, thisArg: This): NewKey | undefined;
|
||||
findKey<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): Key | undefined;
|
||||
/**
|
||||
* Searches for a last item where the given function returns a truthy value. This behaves like
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast | Array.findLast()}.
|
||||
*
|
||||
* @param fn - The function to test with (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
*/
|
||||
findLast<NewValue extends Value>(fn: (value: Value, key: Key, collection: this) => value is NewValue): NewValue | undefined;
|
||||
findLast(fn: (value: Value, key: Key, collection: this) => unknown): Value | undefined;
|
||||
findLast<This, NewValue extends Value>(fn: (this: This, value: Value, key: Key, collection: this) => value is NewValue, thisArg: This): NewValue | undefined;
|
||||
findLast<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): Value | undefined;
|
||||
/**
|
||||
* Searches for the key of a last item where the given function returns a truthy value. This behaves like
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex | Array.findLastIndex()},
|
||||
* but returns the key rather than the positional index.
|
||||
*
|
||||
* @param fn - The function to test with (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
*/
|
||||
findLastKey<NewKey extends Key>(fn: (value: Value, key: Key, collection: this) => key is NewKey): NewKey | undefined;
|
||||
findLastKey(fn: (value: Value, key: Key, collection: this) => unknown): Key | undefined;
|
||||
findLastKey<This, NewKey extends Key>(fn: (this: This, value: Value, key: Key, collection: this) => key is NewKey, thisArg: This): NewKey | undefined;
|
||||
findLastKey<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): Key | undefined;
|
||||
/**
|
||||
* Removes items that satisfy the provided filter function.
|
||||
*
|
||||
* @param fn - Function used to test (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @returns The number of removed entries
|
||||
*/
|
||||
sweep(fn: (value: Value, key: Key, collection: this) => unknown): number;
|
||||
sweep<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): number;
|
||||
/**
|
||||
* Identical to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter | Array.filter()},
|
||||
* but returns a Collection instead of an Array.
|
||||
*
|
||||
* @param fn - The function to test with (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.filter(user => user.username === 'Bob');
|
||||
* ```
|
||||
*/
|
||||
filter<NewKey extends Key>(fn: (value: Value, key: Key, collection: this) => key is NewKey): Collection<NewKey, Value>;
|
||||
filter<NewValue extends Value>(fn: (value: Value, key: Key, collection: this) => value is NewValue): Collection<Key, NewValue>;
|
||||
filter(fn: (value: Value, key: Key, collection: this) => unknown): Collection<Key, Value>;
|
||||
filter<This, NewKey extends Key>(fn: (this: This, value: Value, key: Key, collection: this) => key is NewKey, thisArg: This): Collection<NewKey, Value>;
|
||||
filter<This, NewValue extends Value>(fn: (this: This, value: Value, key: Key, collection: this) => value is NewValue, thisArg: This): Collection<Key, NewValue>;
|
||||
filter<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): Collection<Key, Value>;
|
||||
/**
|
||||
* Partitions the collection into two collections where the first collection
|
||||
* contains the items that passed and the second contains the items that failed.
|
||||
*
|
||||
* @param fn - Function used to test (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* const [big, small] = collection.partition(guild => guild.memberCount > 250);
|
||||
* ```
|
||||
*/
|
||||
partition<NewKey extends Key>(fn: (value: Value, key: Key, collection: this) => key is NewKey): [Collection<NewKey, Value>, Collection<Exclude<Key, NewKey>, Value>];
|
||||
partition<NewValue extends Value>(fn: (value: Value, key: Key, collection: this) => value is NewValue): [Collection<Key, NewValue>, Collection<Key, Exclude<Value, NewValue>>];
|
||||
partition(fn: (value: Value, key: Key, collection: this) => unknown): [Collection<Key, Value>, Collection<Key, Value>];
|
||||
partition<This, NewKey extends Key>(fn: (this: This, value: Value, key: Key, collection: this) => key is NewKey, thisArg: This): [Collection<NewKey, Value>, Collection<Exclude<Key, NewKey>, Value>];
|
||||
partition<This, NewValue extends Value>(fn: (this: This, value: Value, key: Key, collection: this) => value is NewValue, thisArg: This): [Collection<Key, NewValue>, Collection<Key, Exclude<Value, NewValue>>];
|
||||
partition<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): [Collection<Key, Value>, Collection<Key, Value>];
|
||||
/**
|
||||
* Maps each item into a Collection, then joins the results into a single Collection. Identical in behavior to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap | Array.flatMap()}.
|
||||
*
|
||||
* @param fn - Function that produces a new Collection
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.flatMap(guild => guild.members.cache);
|
||||
* ```
|
||||
*/
|
||||
flatMap<NewValue>(fn: (value: Value, key: Key, collection: this) => Collection<Key, NewValue>): Collection<Key, NewValue>;
|
||||
flatMap<NewValue, This>(fn: (this: This, value: Value, key: Key, collection: this) => Collection<Key, NewValue>, thisArg: This): Collection<Key, NewValue>;
|
||||
/**
|
||||
* Maps each item to another value into an array. Identical in behavior to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map | Array.map()}.
|
||||
*
|
||||
* @param fn - Function that produces an element of the new array, taking three arguments
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.map(user => user.tag);
|
||||
* ```
|
||||
*/
|
||||
map<NewValue>(fn: (value: Value, key: Key, collection: this) => NewValue): NewValue[];
|
||||
map<This, NewValue>(fn: (this: This, value: Value, key: Key, collection: this) => NewValue, thisArg: This): NewValue[];
|
||||
/**
|
||||
* Maps each item to another value into a collection. Identical in behavior to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map | Array.map()}.
|
||||
*
|
||||
* @param fn - Function that produces an element of the new collection, taking three arguments
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.mapValues(user => user.tag);
|
||||
* ```
|
||||
*/
|
||||
mapValues<NewValue>(fn: (value: Value, key: Key, collection: this) => NewValue): Collection<Key, NewValue>;
|
||||
mapValues<This, NewValue>(fn: (this: This, value: Value, key: Key, collection: this) => NewValue, thisArg: This): Collection<Key, NewValue>;
|
||||
/**
|
||||
* Checks if there exists an item that passes a test. Identical in behavior to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some | Array.some()}.
|
||||
*
|
||||
* @param fn - Function used to test (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.some(user => user.discriminator === '0000');
|
||||
* ```
|
||||
*/
|
||||
some(fn: (value: Value, key: Key, collection: this) => unknown): boolean;
|
||||
some<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): boolean;
|
||||
/**
|
||||
* Checks if all items passes a test. Identical in behavior to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every | Array.every()}.
|
||||
*
|
||||
* @param fn - Function used to test (should return a boolean)
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.every(user => !user.bot);
|
||||
* ```
|
||||
*/
|
||||
every<NewKey extends Key>(fn: (value: Value, key: Key, collection: this) => key is NewKey): this is Collection<NewKey, Value>;
|
||||
every<NewValue extends Value>(fn: (value: Value, key: Key, collection: this) => value is NewValue): this is Collection<Key, NewValue>;
|
||||
every(fn: (value: Value, key: Key, collection: this) => unknown): boolean;
|
||||
every<This, NewKey extends Key>(fn: (this: This, value: Value, key: Key, collection: this) => key is NewKey, thisArg: This): this is Collection<NewKey, Value>;
|
||||
every<This, NewValue extends Value>(fn: (this: This, value: Value, key: Key, collection: this) => value is NewValue, thisArg: This): this is Collection<Key, NewValue>;
|
||||
every<This>(fn: (this: This, value: Value, key: Key, collection: this) => unknown, thisArg: This): boolean;
|
||||
/**
|
||||
* Applies a function to produce a single value. Identical in behavior to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce | Array.reduce()}.
|
||||
*
|
||||
* @param fn - Function used to reduce, taking four arguments; `accumulator`, `currentValue`, `currentKey`,
|
||||
* and `collection`
|
||||
* @param initialValue - Starting value for the accumulator
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.reduce((acc, guild) => acc + guild.memberCount, 0);
|
||||
* ```
|
||||
*/
|
||||
reduce(fn: (accumulator: Value, value: Value, key: Key, collection: this) => Value, initialValue?: Value): Value;
|
||||
reduce<InitialValue>(fn: (accumulator: InitialValue, value: Value, key: Key, collection: this) => InitialValue, initialValue: InitialValue): InitialValue;
|
||||
/**
|
||||
* Applies a function to produce a single value. Identical in behavior to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight | Array.reduceRight()}.
|
||||
*
|
||||
* @param fn - Function used to reduce, taking four arguments; `accumulator`, `value`, `key`, and `collection`
|
||||
* @param initialValue - Starting value for the accumulator
|
||||
*/
|
||||
reduceRight(fn: (accumulator: Value, value: Value, key: Key, collection: this) => Value, initialValue?: Value): Value;
|
||||
reduceRight<InitialValue>(fn: (accumulator: InitialValue, value: Value, key: Key, collection: this) => InitialValue, initialValue: InitialValue): InitialValue;
|
||||
/**
|
||||
* Identical to
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach | Map.forEach()},
|
||||
* but returns the collection instead of undefined.
|
||||
*
|
||||
* @param fn - Function to execute for each element
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection
|
||||
* .each(user => console.log(user.username))
|
||||
* .filter(user => user.bot)
|
||||
* .each(user => console.log(user.username));
|
||||
* ```
|
||||
*/
|
||||
each(fn: (value: Value, key: Key, collection: this) => void): this;
|
||||
each<This>(fn: (this: This, value: Value, key: Key, collection: this) => void, thisArg: This): this;
|
||||
/**
|
||||
* Runs a function on the collection and returns the collection.
|
||||
*
|
||||
* @param fn - Function to execute
|
||||
* @param thisArg - Value to use as `this` when executing the function
|
||||
* @example
|
||||
* ```ts
|
||||
* collection
|
||||
* .tap(coll => console.log(coll.size))
|
||||
* .filter(user => user.bot)
|
||||
* .tap(coll => console.log(coll.size))
|
||||
* ```
|
||||
*/
|
||||
tap(fn: (collection: this) => void): this;
|
||||
tap<This>(fn: (this: This, collection: this) => void, thisArg: This): this;
|
||||
/**
|
||||
* Creates an identical shallow copy of this collection.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* const newColl = someColl.clone();
|
||||
* ```
|
||||
*/
|
||||
clone(): Collection<Key, Value>;
|
||||
/**
|
||||
* Combines this collection with others into a new collection. None of the source collections are modified.
|
||||
*
|
||||
* @param collections - Collections to merge
|
||||
* @example
|
||||
* ```ts
|
||||
* const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl);
|
||||
* ```
|
||||
*/
|
||||
concat(...collections: ReadonlyCollection<Key, Value>[]): Collection<Key, Value>;
|
||||
/**
|
||||
* Checks if this collection shares identical items with another.
|
||||
* This is different to checking for equality using equal-signs, because
|
||||
* the collections may be different objects, but contain the same data.
|
||||
*
|
||||
* @param collection - Collection to compare with
|
||||
* @returns Whether the collections have identical contents
|
||||
*/
|
||||
equals(collection: ReadonlyCollection<Key, Value>): boolean;
|
||||
/**
|
||||
* The sort method sorts the items of a collection in place and returns it.
|
||||
* The sort is not necessarily stable in Node 10 or older.
|
||||
* The default sort order is according to string Unicode code points.
|
||||
*
|
||||
* @param compareFunction - Specifies a function that defines the sort order.
|
||||
* If omitted, the collection is sorted according to each character's Unicode code point value, according to the string conversion of each element.
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);
|
||||
* ```
|
||||
*/
|
||||
sort(compareFunction?: Comparator<Key, Value>): this;
|
||||
/**
|
||||
* The intersection method returns a new collection containing the items where the key is present in both collections.
|
||||
*
|
||||
* @param other - The other Collection to filter against
|
||||
* @example
|
||||
* ```ts
|
||||
* const col1 = new Collection([['a', 1], ['b', 2]]);
|
||||
* const col2 = new Collection([['a', 1], ['c', 3]]);
|
||||
* const intersection = col1.intersection(col2);
|
||||
* console.log(col1.intersection(col2));
|
||||
* // => Collection { 'a' => 1 }
|
||||
* ```
|
||||
*/
|
||||
intersection(other: ReadonlyCollection<Key, any>): Collection<Key, Value>;
|
||||
/**
|
||||
* Returns a new collection containing the items where the key is present in either of the collections.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* If the collections have any items with the same key, the value from the first collection will be used.
|
||||
* @param other - The other Collection to filter against
|
||||
* @example
|
||||
* ```ts
|
||||
* const col1 = new Collection([['a', 1], ['b', 2]]);
|
||||
* const col2 = new Collection([['a', 1], ['b', 3], ['c', 3]]);
|
||||
* const union = col1.union(col2);
|
||||
* console.log(union);
|
||||
* // => Collection { 'a' => 1, 'b' => 2, 'c' => 3 }
|
||||
* ```
|
||||
*/
|
||||
union<OtherValue>(other: ReadonlyCollection<Key, OtherValue>): Collection<Key, OtherValue | Value>;
|
||||
/**
|
||||
* Returns a new collection containing the items where the key is present in this collection but not the other.
|
||||
*
|
||||
* @param other - The other Collection to filter against
|
||||
* @example
|
||||
* ```ts
|
||||
* const col1 = new Collection([['a', 1], ['b', 2]]);
|
||||
* const col2 = new Collection([['a', 1], ['c', 3]]);
|
||||
* console.log(col1.difference(col2));
|
||||
* // => Collection { 'b' => 2 }
|
||||
* console.log(col2.difference(col1));
|
||||
* // => Collection { 'c' => 3 }
|
||||
* ```
|
||||
*/
|
||||
difference(other: ReadonlyCollection<Key, any>): Collection<Key, Value>;
|
||||
/**
|
||||
* Returns a new collection containing only the items where the keys are present in either collection, but not both.
|
||||
*
|
||||
* @param other - The other Collection to filter against
|
||||
* @example
|
||||
* ```ts
|
||||
* const col1 = new Collection([['a', 1], ['b', 2]]);
|
||||
* const col2 = new Collection([['a', 1], ['c', 3]]);
|
||||
* const symmetricDifference = col1.symmetricDifference(col2);
|
||||
* console.log(col1.symmetricDifference(col2));
|
||||
* // => Collection { 'b' => 2, 'c' => 3 }
|
||||
* ```
|
||||
*/
|
||||
symmetricDifference<OtherValue>(other: ReadonlyCollection<Key, OtherValue>): Collection<Key, OtherValue | Value>;
|
||||
/**
|
||||
* Merges two Collections together into a new Collection.
|
||||
*
|
||||
* @param other - The other Collection to merge with
|
||||
* @param whenInSelf - Function getting the result if the entry only exists in this Collection
|
||||
* @param whenInOther - Function getting the result if the entry only exists in the other Collection
|
||||
* @param whenInBoth - Function getting the result if the entry exists in both Collections
|
||||
* @example
|
||||
* ```ts
|
||||
* // Sums up the entries in two collections.
|
||||
* coll.merge(
|
||||
* other,
|
||||
* x => ({ keep: true, value: x }),
|
||||
* y => ({ keep: true, value: y }),
|
||||
* (x, y) => ({ keep: true, value: x + y }),
|
||||
* );
|
||||
* ```
|
||||
* @example
|
||||
* ```ts
|
||||
* // Intersects two collections in a left-biased manner.
|
||||
* coll.merge(
|
||||
* other,
|
||||
* x => ({ keep: false }),
|
||||
* y => ({ keep: false }),
|
||||
* (x, _) => ({ keep: true, value: x }),
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
merge<OtherValue, ResultValue>(other: ReadonlyCollection<Key, OtherValue>, whenInSelf: (value: Value, key: Key) => Keep<ResultValue>, whenInOther: (valueOther: OtherValue, key: Key) => Keep<ResultValue>, whenInBoth: (value: Value, valueOther: OtherValue, key: Key) => Keep<ResultValue>): Collection<Key, ResultValue>;
|
||||
/**
|
||||
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed | Array.toReversed()}
|
||||
* but returns a Collection instead of an Array.
|
||||
*/
|
||||
toReversed(): Collection<Key, Value>;
|
||||
/**
|
||||
* The sorted method sorts the items of a collection and returns it.
|
||||
* The sort is not necessarily stable in Node 10 or older.
|
||||
* The default sort order is according to string Unicode code points.
|
||||
*
|
||||
* @param compareFunction - Specifies a function that defines the sort order.
|
||||
* If omitted, the collection is sorted according to each character's Unicode code point value,
|
||||
* according to the string conversion of each element.
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFunction?: Comparator<Key, Value>): Collection<Key, Value>;
|
||||
toJSON(): [Key, Value][];
|
||||
private static defaultSort;
|
||||
/**
|
||||
* Creates a Collection from a list of entries.
|
||||
*
|
||||
* @param entries - The list of entries
|
||||
* @param combine - Function to combine an existing entry with a new one
|
||||
* @example
|
||||
* ```ts
|
||||
* Collection.combineEntries([["a", 1], ["b", 2], ["a", 2]], (x, y) => x + y);
|
||||
* // returns Collection { "a" => 3, "b" => 2 }
|
||||
* ```
|
||||
*/
|
||||
static combineEntries<Key, Value>(entries: Iterable<[Key, Value]>, combine: (firstValue: Value, secondValue: Value, key: Key) => Value): Collection<Key, Value>;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
type Keep<Value> = {
|
||||
keep: false;
|
||||
} | {
|
||||
keep: true;
|
||||
value: Value;
|
||||
};
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
type Comparator<Key, Value> = (firstValue: Value, secondValue: Value, firstKey: Key, secondKey: Key) => number;
|
||||
|
||||
/**
|
||||
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/collection#readme | @discordjs/collection} version
|
||||
* that you are currently using.
|
||||
*/
|
||||
declare const version: string;
|
||||
|
||||
export { Collection, type CollectionConstructor, type Comparator, type Keep, type ReadonlyCollection, version };
|
||||
567
node_modules/@discordjs/ws/node_modules/@discordjs/collection/dist/index.js
generated
vendored
Normal file
567
node_modules/@discordjs/ws/node_modules/@discordjs/collection/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,567 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/index.ts
|
||||
var src_exports = {};
|
||||
__export(src_exports, {
|
||||
Collection: () => Collection,
|
||||
version: () => version
|
||||
});
|
||||
module.exports = __toCommonJS(src_exports);
|
||||
|
||||
// src/collection.ts
|
||||
var Collection = class _Collection extends Map {
|
||||
static {
|
||||
__name(this, "Collection");
|
||||
}
|
||||
/**
|
||||
* Obtains the value of the given key if it exists, otherwise sets and returns the value provided by the default value generator.
|
||||
*
|
||||
* @param key - The key to get if it exists, or set otherwise
|
||||
* @param defaultValueGenerator - A function that generates the default value
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.ensure(guildId, () => defaultGuildConfig);
|
||||
* ```
|
||||
*/
|
||||
ensure(key, defaultValueGenerator) {
|
||||
if (this.has(key)) return this.get(key);
|
||||
if (typeof defaultValueGenerator !== "function") throw new TypeError(`${defaultValueGenerator} is not a function`);
|
||||
const defaultValue = defaultValueGenerator(key, this);
|
||||
this.set(key, defaultValue);
|
||||
return defaultValue;
|
||||
}
|
||||
/**
|
||||
* Checks if all of the elements exist in the collection.
|
||||
*
|
||||
* @param keys - The keys of the elements to check for
|
||||
* @returns `true` if all of the elements exist, `false` if at least one does not exist.
|
||||
*/
|
||||
hasAll(...keys) {
|
||||
return keys.every((key) => super.has(key));
|
||||
}
|
||||
/**
|
||||
* Checks if any of the elements exist in the collection.
|
||||
*
|
||||
* @param keys - The keys of the elements to check for
|
||||
* @returns `true` if any of the elements exist, `false` if none exist.
|
||||
*/
|
||||
hasAny(...keys) {
|
||||
return keys.some((key) => super.has(key));
|
||||
}
|
||||
first(amount) {
|
||||
if (amount === void 0) return this.values().next().value;
|
||||
if (amount < 0) return this.last(amount * -1);
|
||||
amount = Math.min(this.size, amount);
|
||||
const iter = this.values();
|
||||
return Array.from({ length: amount }, () => iter.next().value);
|
||||
}
|
||||
firstKey(amount) {
|
||||
if (amount === void 0) return this.keys().next().value;
|
||||
if (amount < 0) return this.lastKey(amount * -1);
|
||||
amount = Math.min(this.size, amount);
|
||||
const iter = this.keys();
|
||||
return Array.from({ length: amount }, () => iter.next().value);
|
||||
}
|
||||
last(amount) {
|
||||
const arr = [...this.values()];
|
||||
if (amount === void 0) return arr[arr.length - 1];
|
||||
if (amount < 0) return this.first(amount * -1);
|
||||
if (!amount) return [];
|
||||
return arr.slice(-amount);
|
||||
}
|
||||
lastKey(amount) {
|
||||
const arr = [...this.keys()];
|
||||
if (amount === void 0) return arr[arr.length - 1];
|
||||
if (amount < 0) return this.firstKey(amount * -1);
|
||||
if (!amount) return [];
|
||||
return arr.slice(-amount);
|
||||
}
|
||||
/**
|
||||
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at()}.
|
||||
* Returns the item at a given index, allowing for positive and negative integers.
|
||||
* Negative integers count back from the last item in the collection.
|
||||
*
|
||||
* @param index - The index of the element to obtain
|
||||
*/
|
||||
at(index) {
|
||||
index = Math.floor(index);
|
||||
const arr = [...this.values()];
|
||||
return arr.at(index);
|
||||
}
|
||||
/**
|
||||
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at()}.
|
||||
* Returns the key at a given index, allowing for positive and negative integers.
|
||||
* Negative integers count back from the last item in the collection.
|
||||
*
|
||||
* @param index - The index of the key to obtain
|
||||
*/
|
||||
keyAt(index) {
|
||||
index = Math.floor(index);
|
||||
const arr = [...this.keys()];
|
||||
return arr.at(index);
|
||||
}
|
||||
random(amount) {
|
||||
const arr = [...this.values()];
|
||||
if (amount === void 0) return arr[Math.floor(Math.random() * arr.length)];
|
||||
if (!arr.length || !amount) return [];
|
||||
return Array.from(
|
||||
{ length: Math.min(amount, arr.length) },
|
||||
() => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]
|
||||
);
|
||||
}
|
||||
randomKey(amount) {
|
||||
const arr = [...this.keys()];
|
||||
if (amount === void 0) return arr[Math.floor(Math.random() * arr.length)];
|
||||
if (!arr.length || !amount) return [];
|
||||
return Array.from(
|
||||
{ length: Math.min(amount, arr.length) },
|
||||
() => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse | Array.reverse()}
|
||||
* but returns a Collection instead of an Array.
|
||||
*/
|
||||
reverse() {
|
||||
const entries = [...this.entries()].reverse();
|
||||
this.clear();
|
||||
for (const [key, value] of entries) this.set(key, value);
|
||||
return this;
|
||||
}
|
||||
find(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
for (const [key, val] of this) {
|
||||
if (fn(val, key, this)) return val;
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
findKey(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
for (const [key, val] of this) {
|
||||
if (fn(val, key, this)) return key;
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
findLast(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
const entries = [...this.entries()];
|
||||
for (let index = entries.length - 1; index >= 0; index--) {
|
||||
const val = entries[index][1];
|
||||
const key = entries[index][0];
|
||||
if (fn(val, key, this)) return val;
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
findLastKey(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
const entries = [...this.entries()];
|
||||
for (let index = entries.length - 1; index >= 0; index--) {
|
||||
const key = entries[index][0];
|
||||
const val = entries[index][1];
|
||||
if (fn(val, key, this)) return key;
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
sweep(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
const previousSize = this.size;
|
||||
for (const [key, val] of this) {
|
||||
if (fn(val, key, this)) this.delete(key);
|
||||
}
|
||||
return previousSize - this.size;
|
||||
}
|
||||
filter(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
const results = new this.constructor[Symbol.species]();
|
||||
for (const [key, val] of this) {
|
||||
if (fn(val, key, this)) results.set(key, val);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
partition(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
const results = [
|
||||
new this.constructor[Symbol.species](),
|
||||
new this.constructor[Symbol.species]()
|
||||
];
|
||||
for (const [key, val] of this) {
|
||||
if (fn(val, key, this)) {
|
||||
results[0].set(key, val);
|
||||
} else {
|
||||
results[1].set(key, val);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
flatMap(fn, thisArg) {
|
||||
const collections = this.map(fn, thisArg);
|
||||
return new this.constructor[Symbol.species]().concat(...collections);
|
||||
}
|
||||
map(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
const iter = this.entries();
|
||||
return Array.from({ length: this.size }, () => {
|
||||
const [key, value] = iter.next().value;
|
||||
return fn(value, key, this);
|
||||
});
|
||||
}
|
||||
mapValues(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
const coll = new this.constructor[Symbol.species]();
|
||||
for (const [key, val] of this) coll.set(key, fn(val, key, this));
|
||||
return coll;
|
||||
}
|
||||
some(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
for (const [key, val] of this) {
|
||||
if (fn(val, key, this)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
every(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
for (const [key, val] of this) {
|
||||
if (!fn(val, key, this)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
reduce(fn, initialValue) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
let accumulator;
|
||||
const iterator = this.entries();
|
||||
if (initialValue === void 0) {
|
||||
if (this.size === 0) throw new TypeError("Reduce of empty collection with no initial value");
|
||||
accumulator = iterator.next().value[1];
|
||||
} else {
|
||||
accumulator = initialValue;
|
||||
}
|
||||
for (const [key, value] of iterator) {
|
||||
accumulator = fn(accumulator, value, key, this);
|
||||
}
|
||||
return accumulator;
|
||||
}
|
||||
reduceRight(fn, initialValue) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
const entries = [...this.entries()];
|
||||
let accumulator;
|
||||
let index;
|
||||
if (initialValue === void 0) {
|
||||
if (entries.length === 0) throw new TypeError("Reduce of empty collection with no initial value");
|
||||
accumulator = entries[entries.length - 1][1];
|
||||
index = entries.length - 1;
|
||||
} else {
|
||||
accumulator = initialValue;
|
||||
index = entries.length;
|
||||
}
|
||||
while (--index >= 0) {
|
||||
const key = entries[index][0];
|
||||
const val = entries[index][1];
|
||||
accumulator = fn(accumulator, val, key, this);
|
||||
}
|
||||
return accumulator;
|
||||
}
|
||||
each(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
for (const [key, value] of this) {
|
||||
fn(value, key, this);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
tap(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
fn(this);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Creates an identical shallow copy of this collection.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* const newColl = someColl.clone();
|
||||
* ```
|
||||
*/
|
||||
clone() {
|
||||
return new this.constructor[Symbol.species](this);
|
||||
}
|
||||
/**
|
||||
* Combines this collection with others into a new collection. None of the source collections are modified.
|
||||
*
|
||||
* @param collections - Collections to merge
|
||||
* @example
|
||||
* ```ts
|
||||
* const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl);
|
||||
* ```
|
||||
*/
|
||||
concat(...collections) {
|
||||
const newColl = this.clone();
|
||||
for (const coll of collections) {
|
||||
for (const [key, val] of coll) newColl.set(key, val);
|
||||
}
|
||||
return newColl;
|
||||
}
|
||||
/**
|
||||
* Checks if this collection shares identical items with another.
|
||||
* This is different to checking for equality using equal-signs, because
|
||||
* the collections may be different objects, but contain the same data.
|
||||
*
|
||||
* @param collection - Collection to compare with
|
||||
* @returns Whether the collections have identical contents
|
||||
*/
|
||||
equals(collection) {
|
||||
if (!collection) return false;
|
||||
if (this === collection) return true;
|
||||
if (this.size !== collection.size) return false;
|
||||
for (const [key, value] of this) {
|
||||
if (!collection.has(key) || value !== collection.get(key)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* The sort method sorts the items of a collection in place and returns it.
|
||||
* The sort is not necessarily stable in Node 10 or older.
|
||||
* The default sort order is according to string Unicode code points.
|
||||
*
|
||||
* @param compareFunction - Specifies a function that defines the sort order.
|
||||
* If omitted, the collection is sorted according to each character's Unicode code point value, according to the string conversion of each element.
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);
|
||||
* ```
|
||||
*/
|
||||
sort(compareFunction = _Collection.defaultSort) {
|
||||
const entries = [...this.entries()];
|
||||
entries.sort((a, b) => compareFunction(a[1], b[1], a[0], b[0]));
|
||||
super.clear();
|
||||
for (const [key, value] of entries) {
|
||||
super.set(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* The intersection method returns a new collection containing the items where the key is present in both collections.
|
||||
*
|
||||
* @param other - The other Collection to filter against
|
||||
* @example
|
||||
* ```ts
|
||||
* const col1 = new Collection([['a', 1], ['b', 2]]);
|
||||
* const col2 = new Collection([['a', 1], ['c', 3]]);
|
||||
* const intersection = col1.intersection(col2);
|
||||
* console.log(col1.intersection(col2));
|
||||
* // => Collection { 'a' => 1 }
|
||||
* ```
|
||||
*/
|
||||
intersection(other) {
|
||||
const coll = new this.constructor[Symbol.species]();
|
||||
for (const [key, value] of this) {
|
||||
if (other.has(key)) coll.set(key, value);
|
||||
}
|
||||
return coll;
|
||||
}
|
||||
/**
|
||||
* Returns a new collection containing the items where the key is present in either of the collections.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* If the collections have any items with the same key, the value from the first collection will be used.
|
||||
* @param other - The other Collection to filter against
|
||||
* @example
|
||||
* ```ts
|
||||
* const col1 = new Collection([['a', 1], ['b', 2]]);
|
||||
* const col2 = new Collection([['a', 1], ['b', 3], ['c', 3]]);
|
||||
* const union = col1.union(col2);
|
||||
* console.log(union);
|
||||
* // => Collection { 'a' => 1, 'b' => 2, 'c' => 3 }
|
||||
* ```
|
||||
*/
|
||||
union(other) {
|
||||
const coll = new this.constructor[Symbol.species](this);
|
||||
for (const [key, value] of other) {
|
||||
if (!coll.has(key)) coll.set(key, value);
|
||||
}
|
||||
return coll;
|
||||
}
|
||||
/**
|
||||
* Returns a new collection containing the items where the key is present in this collection but not the other.
|
||||
*
|
||||
* @param other - The other Collection to filter against
|
||||
* @example
|
||||
* ```ts
|
||||
* const col1 = new Collection([['a', 1], ['b', 2]]);
|
||||
* const col2 = new Collection([['a', 1], ['c', 3]]);
|
||||
* console.log(col1.difference(col2));
|
||||
* // => Collection { 'b' => 2 }
|
||||
* console.log(col2.difference(col1));
|
||||
* // => Collection { 'c' => 3 }
|
||||
* ```
|
||||
*/
|
||||
difference(other) {
|
||||
const coll = new this.constructor[Symbol.species]();
|
||||
for (const [key, value] of this) {
|
||||
if (!other.has(key)) coll.set(key, value);
|
||||
}
|
||||
return coll;
|
||||
}
|
||||
/**
|
||||
* Returns a new collection containing only the items where the keys are present in either collection, but not both.
|
||||
*
|
||||
* @param other - The other Collection to filter against
|
||||
* @example
|
||||
* ```ts
|
||||
* const col1 = new Collection([['a', 1], ['b', 2]]);
|
||||
* const col2 = new Collection([['a', 1], ['c', 3]]);
|
||||
* const symmetricDifference = col1.symmetricDifference(col2);
|
||||
* console.log(col1.symmetricDifference(col2));
|
||||
* // => Collection { 'b' => 2, 'c' => 3 }
|
||||
* ```
|
||||
*/
|
||||
symmetricDifference(other) {
|
||||
const coll = new this.constructor[Symbol.species]();
|
||||
for (const [key, value] of this) {
|
||||
if (!other.has(key)) coll.set(key, value);
|
||||
}
|
||||
for (const [key, value] of other) {
|
||||
if (!this.has(key)) coll.set(key, value);
|
||||
}
|
||||
return coll;
|
||||
}
|
||||
/**
|
||||
* Merges two Collections together into a new Collection.
|
||||
*
|
||||
* @param other - The other Collection to merge with
|
||||
* @param whenInSelf - Function getting the result if the entry only exists in this Collection
|
||||
* @param whenInOther - Function getting the result if the entry only exists in the other Collection
|
||||
* @param whenInBoth - Function getting the result if the entry exists in both Collections
|
||||
* @example
|
||||
* ```ts
|
||||
* // Sums up the entries in two collections.
|
||||
* coll.merge(
|
||||
* other,
|
||||
* x => ({ keep: true, value: x }),
|
||||
* y => ({ keep: true, value: y }),
|
||||
* (x, y) => ({ keep: true, value: x + y }),
|
||||
* );
|
||||
* ```
|
||||
* @example
|
||||
* ```ts
|
||||
* // Intersects two collections in a left-biased manner.
|
||||
* coll.merge(
|
||||
* other,
|
||||
* x => ({ keep: false }),
|
||||
* y => ({ keep: false }),
|
||||
* (x, _) => ({ keep: true, value: x }),
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
merge(other, whenInSelf, whenInOther, whenInBoth) {
|
||||
const coll = new this.constructor[Symbol.species]();
|
||||
const keys = /* @__PURE__ */ new Set([...this.keys(), ...other.keys()]);
|
||||
for (const key of keys) {
|
||||
const hasInSelf = this.has(key);
|
||||
const hasInOther = other.has(key);
|
||||
if (hasInSelf && hasInOther) {
|
||||
const result = whenInBoth(this.get(key), other.get(key), key);
|
||||
if (result.keep) coll.set(key, result.value);
|
||||
} else if (hasInSelf) {
|
||||
const result = whenInSelf(this.get(key), key);
|
||||
if (result.keep) coll.set(key, result.value);
|
||||
} else if (hasInOther) {
|
||||
const result = whenInOther(other.get(key), key);
|
||||
if (result.keep) coll.set(key, result.value);
|
||||
}
|
||||
}
|
||||
return coll;
|
||||
}
|
||||
/**
|
||||
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed | Array.toReversed()}
|
||||
* but returns a Collection instead of an Array.
|
||||
*/
|
||||
toReversed() {
|
||||
return new this.constructor[Symbol.species](this).reverse();
|
||||
}
|
||||
/**
|
||||
* The sorted method sorts the items of a collection and returns it.
|
||||
* The sort is not necessarily stable in Node 10 or older.
|
||||
* The default sort order is according to string Unicode code points.
|
||||
*
|
||||
* @param compareFunction - Specifies a function that defines the sort order.
|
||||
* If omitted, the collection is sorted according to each character's Unicode code point value,
|
||||
* according to the string conversion of each element.
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFunction = _Collection.defaultSort) {
|
||||
return new this.constructor[Symbol.species](this).sort((av, bv, ak, bk) => compareFunction(av, bv, ak, bk));
|
||||
}
|
||||
toJSON() {
|
||||
return [...this.entries()];
|
||||
}
|
||||
static defaultSort(firstValue, secondValue) {
|
||||
return Number(firstValue > secondValue) || Number(firstValue === secondValue) - 1;
|
||||
}
|
||||
/**
|
||||
* Creates a Collection from a list of entries.
|
||||
*
|
||||
* @param entries - The list of entries
|
||||
* @param combine - Function to combine an existing entry with a new one
|
||||
* @example
|
||||
* ```ts
|
||||
* Collection.combineEntries([["a", 1], ["b", 2], ["a", 2]], (x, y) => x + y);
|
||||
* // returns Collection { "a" => 3, "b" => 2 }
|
||||
* ```
|
||||
*/
|
||||
static combineEntries(entries, combine) {
|
||||
const coll = new _Collection();
|
||||
for (const [key, value] of entries) {
|
||||
if (coll.has(key)) {
|
||||
coll.set(key, combine(coll.get(key), value, key));
|
||||
} else {
|
||||
coll.set(key, value);
|
||||
}
|
||||
}
|
||||
return coll;
|
||||
}
|
||||
};
|
||||
|
||||
// src/index.ts
|
||||
var version = "2.1.1";
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Collection,
|
||||
version
|
||||
});
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@discordjs/ws/node_modules/@discordjs/collection/dist/index.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/@discordjs/collection/dist/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
541
node_modules/@discordjs/ws/node_modules/@discordjs/collection/dist/index.mjs
generated
vendored
Normal file
541
node_modules/@discordjs/ws/node_modules/@discordjs/collection/dist/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,541 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
|
||||
// src/collection.ts
|
||||
var Collection = class _Collection extends Map {
|
||||
static {
|
||||
__name(this, "Collection");
|
||||
}
|
||||
/**
|
||||
* Obtains the value of the given key if it exists, otherwise sets and returns the value provided by the default value generator.
|
||||
*
|
||||
* @param key - The key to get if it exists, or set otherwise
|
||||
* @param defaultValueGenerator - A function that generates the default value
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.ensure(guildId, () => defaultGuildConfig);
|
||||
* ```
|
||||
*/
|
||||
ensure(key, defaultValueGenerator) {
|
||||
if (this.has(key)) return this.get(key);
|
||||
if (typeof defaultValueGenerator !== "function") throw new TypeError(`${defaultValueGenerator} is not a function`);
|
||||
const defaultValue = defaultValueGenerator(key, this);
|
||||
this.set(key, defaultValue);
|
||||
return defaultValue;
|
||||
}
|
||||
/**
|
||||
* Checks if all of the elements exist in the collection.
|
||||
*
|
||||
* @param keys - The keys of the elements to check for
|
||||
* @returns `true` if all of the elements exist, `false` if at least one does not exist.
|
||||
*/
|
||||
hasAll(...keys) {
|
||||
return keys.every((key) => super.has(key));
|
||||
}
|
||||
/**
|
||||
* Checks if any of the elements exist in the collection.
|
||||
*
|
||||
* @param keys - The keys of the elements to check for
|
||||
* @returns `true` if any of the elements exist, `false` if none exist.
|
||||
*/
|
||||
hasAny(...keys) {
|
||||
return keys.some((key) => super.has(key));
|
||||
}
|
||||
first(amount) {
|
||||
if (amount === void 0) return this.values().next().value;
|
||||
if (amount < 0) return this.last(amount * -1);
|
||||
amount = Math.min(this.size, amount);
|
||||
const iter = this.values();
|
||||
return Array.from({ length: amount }, () => iter.next().value);
|
||||
}
|
||||
firstKey(amount) {
|
||||
if (amount === void 0) return this.keys().next().value;
|
||||
if (amount < 0) return this.lastKey(amount * -1);
|
||||
amount = Math.min(this.size, amount);
|
||||
const iter = this.keys();
|
||||
return Array.from({ length: amount }, () => iter.next().value);
|
||||
}
|
||||
last(amount) {
|
||||
const arr = [...this.values()];
|
||||
if (amount === void 0) return arr[arr.length - 1];
|
||||
if (amount < 0) return this.first(amount * -1);
|
||||
if (!amount) return [];
|
||||
return arr.slice(-amount);
|
||||
}
|
||||
lastKey(amount) {
|
||||
const arr = [...this.keys()];
|
||||
if (amount === void 0) return arr[arr.length - 1];
|
||||
if (amount < 0) return this.firstKey(amount * -1);
|
||||
if (!amount) return [];
|
||||
return arr.slice(-amount);
|
||||
}
|
||||
/**
|
||||
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at()}.
|
||||
* Returns the item at a given index, allowing for positive and negative integers.
|
||||
* Negative integers count back from the last item in the collection.
|
||||
*
|
||||
* @param index - The index of the element to obtain
|
||||
*/
|
||||
at(index) {
|
||||
index = Math.floor(index);
|
||||
const arr = [...this.values()];
|
||||
return arr.at(index);
|
||||
}
|
||||
/**
|
||||
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at()}.
|
||||
* Returns the key at a given index, allowing for positive and negative integers.
|
||||
* Negative integers count back from the last item in the collection.
|
||||
*
|
||||
* @param index - The index of the key to obtain
|
||||
*/
|
||||
keyAt(index) {
|
||||
index = Math.floor(index);
|
||||
const arr = [...this.keys()];
|
||||
return arr.at(index);
|
||||
}
|
||||
random(amount) {
|
||||
const arr = [...this.values()];
|
||||
if (amount === void 0) return arr[Math.floor(Math.random() * arr.length)];
|
||||
if (!arr.length || !amount) return [];
|
||||
return Array.from(
|
||||
{ length: Math.min(amount, arr.length) },
|
||||
() => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]
|
||||
);
|
||||
}
|
||||
randomKey(amount) {
|
||||
const arr = [...this.keys()];
|
||||
if (amount === void 0) return arr[Math.floor(Math.random() * arr.length)];
|
||||
if (!arr.length || !amount) return [];
|
||||
return Array.from(
|
||||
{ length: Math.min(amount, arr.length) },
|
||||
() => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse | Array.reverse()}
|
||||
* but returns a Collection instead of an Array.
|
||||
*/
|
||||
reverse() {
|
||||
const entries = [...this.entries()].reverse();
|
||||
this.clear();
|
||||
for (const [key, value] of entries) this.set(key, value);
|
||||
return this;
|
||||
}
|
||||
find(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
for (const [key, val] of this) {
|
||||
if (fn(val, key, this)) return val;
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
findKey(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
for (const [key, val] of this) {
|
||||
if (fn(val, key, this)) return key;
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
findLast(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
const entries = [...this.entries()];
|
||||
for (let index = entries.length - 1; index >= 0; index--) {
|
||||
const val = entries[index][1];
|
||||
const key = entries[index][0];
|
||||
if (fn(val, key, this)) return val;
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
findLastKey(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
const entries = [...this.entries()];
|
||||
for (let index = entries.length - 1; index >= 0; index--) {
|
||||
const key = entries[index][0];
|
||||
const val = entries[index][1];
|
||||
if (fn(val, key, this)) return key;
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
sweep(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
const previousSize = this.size;
|
||||
for (const [key, val] of this) {
|
||||
if (fn(val, key, this)) this.delete(key);
|
||||
}
|
||||
return previousSize - this.size;
|
||||
}
|
||||
filter(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
const results = new this.constructor[Symbol.species]();
|
||||
for (const [key, val] of this) {
|
||||
if (fn(val, key, this)) results.set(key, val);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
partition(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
const results = [
|
||||
new this.constructor[Symbol.species](),
|
||||
new this.constructor[Symbol.species]()
|
||||
];
|
||||
for (const [key, val] of this) {
|
||||
if (fn(val, key, this)) {
|
||||
results[0].set(key, val);
|
||||
} else {
|
||||
results[1].set(key, val);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
flatMap(fn, thisArg) {
|
||||
const collections = this.map(fn, thisArg);
|
||||
return new this.constructor[Symbol.species]().concat(...collections);
|
||||
}
|
||||
map(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
const iter = this.entries();
|
||||
return Array.from({ length: this.size }, () => {
|
||||
const [key, value] = iter.next().value;
|
||||
return fn(value, key, this);
|
||||
});
|
||||
}
|
||||
mapValues(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
const coll = new this.constructor[Symbol.species]();
|
||||
for (const [key, val] of this) coll.set(key, fn(val, key, this));
|
||||
return coll;
|
||||
}
|
||||
some(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
for (const [key, val] of this) {
|
||||
if (fn(val, key, this)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
every(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
for (const [key, val] of this) {
|
||||
if (!fn(val, key, this)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
reduce(fn, initialValue) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
let accumulator;
|
||||
const iterator = this.entries();
|
||||
if (initialValue === void 0) {
|
||||
if (this.size === 0) throw new TypeError("Reduce of empty collection with no initial value");
|
||||
accumulator = iterator.next().value[1];
|
||||
} else {
|
||||
accumulator = initialValue;
|
||||
}
|
||||
for (const [key, value] of iterator) {
|
||||
accumulator = fn(accumulator, value, key, this);
|
||||
}
|
||||
return accumulator;
|
||||
}
|
||||
reduceRight(fn, initialValue) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
const entries = [...this.entries()];
|
||||
let accumulator;
|
||||
let index;
|
||||
if (initialValue === void 0) {
|
||||
if (entries.length === 0) throw new TypeError("Reduce of empty collection with no initial value");
|
||||
accumulator = entries[entries.length - 1][1];
|
||||
index = entries.length - 1;
|
||||
} else {
|
||||
accumulator = initialValue;
|
||||
index = entries.length;
|
||||
}
|
||||
while (--index >= 0) {
|
||||
const key = entries[index][0];
|
||||
const val = entries[index][1];
|
||||
accumulator = fn(accumulator, val, key, this);
|
||||
}
|
||||
return accumulator;
|
||||
}
|
||||
each(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
for (const [key, value] of this) {
|
||||
fn(value, key, this);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
tap(fn, thisArg) {
|
||||
if (typeof fn !== "function") throw new TypeError(`${fn} is not a function`);
|
||||
if (thisArg !== void 0) fn = fn.bind(thisArg);
|
||||
fn(this);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Creates an identical shallow copy of this collection.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* const newColl = someColl.clone();
|
||||
* ```
|
||||
*/
|
||||
clone() {
|
||||
return new this.constructor[Symbol.species](this);
|
||||
}
|
||||
/**
|
||||
* Combines this collection with others into a new collection. None of the source collections are modified.
|
||||
*
|
||||
* @param collections - Collections to merge
|
||||
* @example
|
||||
* ```ts
|
||||
* const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl);
|
||||
* ```
|
||||
*/
|
||||
concat(...collections) {
|
||||
const newColl = this.clone();
|
||||
for (const coll of collections) {
|
||||
for (const [key, val] of coll) newColl.set(key, val);
|
||||
}
|
||||
return newColl;
|
||||
}
|
||||
/**
|
||||
* Checks if this collection shares identical items with another.
|
||||
* This is different to checking for equality using equal-signs, because
|
||||
* the collections may be different objects, but contain the same data.
|
||||
*
|
||||
* @param collection - Collection to compare with
|
||||
* @returns Whether the collections have identical contents
|
||||
*/
|
||||
equals(collection) {
|
||||
if (!collection) return false;
|
||||
if (this === collection) return true;
|
||||
if (this.size !== collection.size) return false;
|
||||
for (const [key, value] of this) {
|
||||
if (!collection.has(key) || value !== collection.get(key)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* The sort method sorts the items of a collection in place and returns it.
|
||||
* The sort is not necessarily stable in Node 10 or older.
|
||||
* The default sort order is according to string Unicode code points.
|
||||
*
|
||||
* @param compareFunction - Specifies a function that defines the sort order.
|
||||
* If omitted, the collection is sorted according to each character's Unicode code point value, according to the string conversion of each element.
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);
|
||||
* ```
|
||||
*/
|
||||
sort(compareFunction = _Collection.defaultSort) {
|
||||
const entries = [...this.entries()];
|
||||
entries.sort((a, b) => compareFunction(a[1], b[1], a[0], b[0]));
|
||||
super.clear();
|
||||
for (const [key, value] of entries) {
|
||||
super.set(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* The intersection method returns a new collection containing the items where the key is present in both collections.
|
||||
*
|
||||
* @param other - The other Collection to filter against
|
||||
* @example
|
||||
* ```ts
|
||||
* const col1 = new Collection([['a', 1], ['b', 2]]);
|
||||
* const col2 = new Collection([['a', 1], ['c', 3]]);
|
||||
* const intersection = col1.intersection(col2);
|
||||
* console.log(col1.intersection(col2));
|
||||
* // => Collection { 'a' => 1 }
|
||||
* ```
|
||||
*/
|
||||
intersection(other) {
|
||||
const coll = new this.constructor[Symbol.species]();
|
||||
for (const [key, value] of this) {
|
||||
if (other.has(key)) coll.set(key, value);
|
||||
}
|
||||
return coll;
|
||||
}
|
||||
/**
|
||||
* Returns a new collection containing the items where the key is present in either of the collections.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* If the collections have any items with the same key, the value from the first collection will be used.
|
||||
* @param other - The other Collection to filter against
|
||||
* @example
|
||||
* ```ts
|
||||
* const col1 = new Collection([['a', 1], ['b', 2]]);
|
||||
* const col2 = new Collection([['a', 1], ['b', 3], ['c', 3]]);
|
||||
* const union = col1.union(col2);
|
||||
* console.log(union);
|
||||
* // => Collection { 'a' => 1, 'b' => 2, 'c' => 3 }
|
||||
* ```
|
||||
*/
|
||||
union(other) {
|
||||
const coll = new this.constructor[Symbol.species](this);
|
||||
for (const [key, value] of other) {
|
||||
if (!coll.has(key)) coll.set(key, value);
|
||||
}
|
||||
return coll;
|
||||
}
|
||||
/**
|
||||
* Returns a new collection containing the items where the key is present in this collection but not the other.
|
||||
*
|
||||
* @param other - The other Collection to filter against
|
||||
* @example
|
||||
* ```ts
|
||||
* const col1 = new Collection([['a', 1], ['b', 2]]);
|
||||
* const col2 = new Collection([['a', 1], ['c', 3]]);
|
||||
* console.log(col1.difference(col2));
|
||||
* // => Collection { 'b' => 2 }
|
||||
* console.log(col2.difference(col1));
|
||||
* // => Collection { 'c' => 3 }
|
||||
* ```
|
||||
*/
|
||||
difference(other) {
|
||||
const coll = new this.constructor[Symbol.species]();
|
||||
for (const [key, value] of this) {
|
||||
if (!other.has(key)) coll.set(key, value);
|
||||
}
|
||||
return coll;
|
||||
}
|
||||
/**
|
||||
* Returns a new collection containing only the items where the keys are present in either collection, but not both.
|
||||
*
|
||||
* @param other - The other Collection to filter against
|
||||
* @example
|
||||
* ```ts
|
||||
* const col1 = new Collection([['a', 1], ['b', 2]]);
|
||||
* const col2 = new Collection([['a', 1], ['c', 3]]);
|
||||
* const symmetricDifference = col1.symmetricDifference(col2);
|
||||
* console.log(col1.symmetricDifference(col2));
|
||||
* // => Collection { 'b' => 2, 'c' => 3 }
|
||||
* ```
|
||||
*/
|
||||
symmetricDifference(other) {
|
||||
const coll = new this.constructor[Symbol.species]();
|
||||
for (const [key, value] of this) {
|
||||
if (!other.has(key)) coll.set(key, value);
|
||||
}
|
||||
for (const [key, value] of other) {
|
||||
if (!this.has(key)) coll.set(key, value);
|
||||
}
|
||||
return coll;
|
||||
}
|
||||
/**
|
||||
* Merges two Collections together into a new Collection.
|
||||
*
|
||||
* @param other - The other Collection to merge with
|
||||
* @param whenInSelf - Function getting the result if the entry only exists in this Collection
|
||||
* @param whenInOther - Function getting the result if the entry only exists in the other Collection
|
||||
* @param whenInBoth - Function getting the result if the entry exists in both Collections
|
||||
* @example
|
||||
* ```ts
|
||||
* // Sums up the entries in two collections.
|
||||
* coll.merge(
|
||||
* other,
|
||||
* x => ({ keep: true, value: x }),
|
||||
* y => ({ keep: true, value: y }),
|
||||
* (x, y) => ({ keep: true, value: x + y }),
|
||||
* );
|
||||
* ```
|
||||
* @example
|
||||
* ```ts
|
||||
* // Intersects two collections in a left-biased manner.
|
||||
* coll.merge(
|
||||
* other,
|
||||
* x => ({ keep: false }),
|
||||
* y => ({ keep: false }),
|
||||
* (x, _) => ({ keep: true, value: x }),
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
merge(other, whenInSelf, whenInOther, whenInBoth) {
|
||||
const coll = new this.constructor[Symbol.species]();
|
||||
const keys = /* @__PURE__ */ new Set([...this.keys(), ...other.keys()]);
|
||||
for (const key of keys) {
|
||||
const hasInSelf = this.has(key);
|
||||
const hasInOther = other.has(key);
|
||||
if (hasInSelf && hasInOther) {
|
||||
const result = whenInBoth(this.get(key), other.get(key), key);
|
||||
if (result.keep) coll.set(key, result.value);
|
||||
} else if (hasInSelf) {
|
||||
const result = whenInSelf(this.get(key), key);
|
||||
if (result.keep) coll.set(key, result.value);
|
||||
} else if (hasInOther) {
|
||||
const result = whenInOther(other.get(key), key);
|
||||
if (result.keep) coll.set(key, result.value);
|
||||
}
|
||||
}
|
||||
return coll;
|
||||
}
|
||||
/**
|
||||
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed | Array.toReversed()}
|
||||
* but returns a Collection instead of an Array.
|
||||
*/
|
||||
toReversed() {
|
||||
return new this.constructor[Symbol.species](this).reverse();
|
||||
}
|
||||
/**
|
||||
* The sorted method sorts the items of a collection and returns it.
|
||||
* The sort is not necessarily stable in Node 10 or older.
|
||||
* The default sort order is according to string Unicode code points.
|
||||
*
|
||||
* @param compareFunction - Specifies a function that defines the sort order.
|
||||
* If omitted, the collection is sorted according to each character's Unicode code point value,
|
||||
* according to the string conversion of each element.
|
||||
* @example
|
||||
* ```ts
|
||||
* collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFunction = _Collection.defaultSort) {
|
||||
return new this.constructor[Symbol.species](this).sort((av, bv, ak, bk) => compareFunction(av, bv, ak, bk));
|
||||
}
|
||||
toJSON() {
|
||||
return [...this.entries()];
|
||||
}
|
||||
static defaultSort(firstValue, secondValue) {
|
||||
return Number(firstValue > secondValue) || Number(firstValue === secondValue) - 1;
|
||||
}
|
||||
/**
|
||||
* Creates a Collection from a list of entries.
|
||||
*
|
||||
* @param entries - The list of entries
|
||||
* @param combine - Function to combine an existing entry with a new one
|
||||
* @example
|
||||
* ```ts
|
||||
* Collection.combineEntries([["a", 1], ["b", 2], ["a", 2]], (x, y) => x + y);
|
||||
* // returns Collection { "a" => 3, "b" => 2 }
|
||||
* ```
|
||||
*/
|
||||
static combineEntries(entries, combine) {
|
||||
const coll = new _Collection();
|
||||
for (const [key, value] of entries) {
|
||||
if (coll.has(key)) {
|
||||
coll.set(key, combine(coll.get(key), value, key));
|
||||
} else {
|
||||
coll.set(key, value);
|
||||
}
|
||||
}
|
||||
return coll;
|
||||
}
|
||||
};
|
||||
|
||||
// src/index.ts
|
||||
var version = "2.1.1";
|
||||
export {
|
||||
Collection,
|
||||
version
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
node_modules/@discordjs/ws/node_modules/@discordjs/collection/dist/index.mjs.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/@discordjs/collection/dist/index.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
86
node_modules/@discordjs/ws/node_modules/@discordjs/collection/package.json
generated
vendored
Normal file
86
node_modules/@discordjs/ws/node_modules/@discordjs/collection/package.json
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/package.json",
|
||||
"name": "@discordjs/collection",
|
||||
"version": "2.1.1",
|
||||
"description": "Utility data structure used in discord.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"require": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.js"
|
||||
},
|
||||
"import": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"default": "./dist/index.mjs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"directories": {
|
||||
"lib": "src",
|
||||
"test": "__tests__"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"contributors": [
|
||||
"Crawl <icrawltogo@gmail.com>",
|
||||
"Amish Shah <amishshah.2k@gmail.com>",
|
||||
"SpaceEEC <spaceeec@yahoo.com>",
|
||||
"Vlad Frangu <me@vladfrangu.dev>",
|
||||
"Aura Román <kyradiscord@gmail.com>"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"keywords": [
|
||||
"map",
|
||||
"collection",
|
||||
"utility"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/discordjs/discord.js.git",
|
||||
"directory": "packages/collection"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/discordjs/discord.js/issues"
|
||||
},
|
||||
"homepage": "https://discord.js.org",
|
||||
"funding": "https://github.com/discordjs/discord.js?sponsor",
|
||||
"devDependencies": {
|
||||
"@favware/cliff-jumper": "^4.1.0",
|
||||
"@types/node": "^18.19.45",
|
||||
"@vitest/coverage-v8": "^2.0.5",
|
||||
"cross-env": "^7.0.3",
|
||||
"esbuild-plugin-version-injector": "^1.2.1",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-neon": "^0.1.62",
|
||||
"eslint-formatter-pretty": "^6.0.1",
|
||||
"prettier": "^3.3.3",
|
||||
"tsup": "^8.2.4",
|
||||
"turbo": "^2.0.14",
|
||||
"typescript": "~5.5.4",
|
||||
"vitest": "^2.0.5",
|
||||
"@discordjs/scripts": "^0.1.0",
|
||||
"@discordjs/api-extractor": "^7.38.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"provenance": true
|
||||
},
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsc --noEmit && tsup",
|
||||
"build:docs": "tsc -p tsconfig.docs.json",
|
||||
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
|
||||
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
|
||||
"fmt": "pnpm run format",
|
||||
"docs": "pnpm run build:docs && api-extractor run --local --minify && generate-split-documentation",
|
||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/collection/*'",
|
||||
"release": "cliff-jumper"
|
||||
}
|
||||
}
|
||||
21
node_modules/@discordjs/ws/node_modules/discord-api-types/LICENSE
generated
vendored
Normal file
21
node_modules/@discordjs/ws/node_modules/discord-api-types/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 vladfrangu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
105
node_modules/@discordjs/ws/node_modules/discord-api-types/README.md
generated
vendored
Normal file
105
node_modules/@discordjs/ws/node_modules/discord-api-types/README.md
generated
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
# Discord API Types
|
||||
|
||||
[](https://github.com/discordjs/discord-api-types)
|
||||
|
||||
[](https://github.com/discordjs/discord-api-types/blob/main/LICENSE.md)
|
||||
[](https://www.npmjs.com/package/discord-api-types)
|
||||
[](https://deno.land/x/discord_api_types)
|
||||
[](https://www.patreon.com/vladfrangu)
|
||||
[](https://ko-fi.com/wolfgalvlad)
|
||||
[](https://github.com/sponsors/vladfrangu)
|
||||
[](https://vercel.com?utm_source=discordjs&utm_campaign=oss)
|
||||
|
||||
Simple type definitions for the [Discord API](https://discord.com/developers/docs/intro).
|
||||
|
||||
## Installation
|
||||
|
||||
Install with [npm](https://www.npmjs.com/) / [yarn](https://yarnpkg.com) / [pnpm](https://pnpm.js.org/):
|
||||
|
||||
```sh
|
||||
npm install discord-api-types
|
||||
yarn add discord-api-types
|
||||
pnpm add discord-api-types
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
You can only import this module by specifying the API version you want to target. Append `/v*` to the import path, where the `*` represents the API version. Below are some examples
|
||||
|
||||
```js
|
||||
const { APIUser } = require('discord-api-types/v10');
|
||||
```
|
||||
|
||||
```ts
|
||||
// TypeScript/ES Module support
|
||||
import { APIUser } from 'discord-api-types/v10';
|
||||
```
|
||||
|
||||
You may also import just certain parts of the module that you need. The possible values are: `globals`, `gateway`, `gateway/v*`, `payloads`, `payloads/v*`, `rest`, `rest/v*`, `rpc`, `rpc/v*`, `utils`, `utils/v*`, `voice`, and `voice/v*`. Below are some examples
|
||||
|
||||
```js
|
||||
const { GatewayVersion } = require('discord-api-types/gateway/v10');
|
||||
```
|
||||
|
||||
```ts
|
||||
// TypeScript/ES Module support
|
||||
import { GatewayVersion } from 'discord-api-types/gateway/v10';
|
||||
```
|
||||
|
||||
> _**Note:** The `v*` exports (`discord-api-types/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_
|
||||
|
||||
### Deno
|
||||
|
||||
We also provide typings compatible with the [deno](https://deno.land/) runtime. You have 3 ways you can import them:
|
||||
|
||||
1. Directly from GitHub
|
||||
|
||||
```ts
|
||||
// Importing a specific API version
|
||||
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v10.ts';
|
||||
```
|
||||
|
||||
2. From [deno.land/x](https://deno.land/x)
|
||||
|
||||
```ts
|
||||
// Importing a specific API version
|
||||
import { APIUser } from 'https://deno.land/x/discord_api_types/v10.ts';
|
||||
```
|
||||
|
||||
3. From [skypack.dev](https://www.skypack.dev/)
|
||||
|
||||
```ts
|
||||
// Importing a specific API version
|
||||
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts';
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
||||
The exports of each API version is split into three main parts:
|
||||
|
||||
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
|
||||
|
||||
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
|
||||
|
||||
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
|
||||
|
||||
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
|
||||
|
||||
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
|
||||
|
||||
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
|
||||
|
||||
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
|
||||
|
||||
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
|
||||
|
||||
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
|
||||
|
||||
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
|
||||
|
||||
**A note about how types are documented**: This package will add types only for known and documented properties that are present in Discord's [API Documentation repository](https://github.com/discord/discord-api-docs),
|
||||
that are mentioned in an open pull request, or known through other means _and have received the green light to be used_.
|
||||
Anything else will not be documented (for example client only types).
|
||||
|
||||
With that aside, we may allow certain types that are not documented in the [API Documentation repository](https://github.com/discord/discord-api-docs) on a case by case basis.
|
||||
They will be documented with an `@unstable` tag and are not subject with the same versioning rules.
|
||||
9
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/common.d.ts
generated
vendored
Normal file
9
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/common.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-query-string-params
|
||||
*/
|
||||
export interface GatewayURLQuery {
|
||||
v: string;
|
||||
encoding: 'etf' | 'json';
|
||||
compress?: 'zlib-stream';
|
||||
}
|
||||
//# sourceMappingURL=common.d.ts.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/common.d.ts.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/common.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["common.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,KAAK,GAAG,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,aAAa,CAAC;CACzB"}
|
||||
3
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/common.js
generated
vendored
Normal file
3
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/common.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=common.js.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/common.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/common.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"common.js","sourceRoot":"","sources":["common.ts"],"names":[],"mappings":""}
|
||||
2
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/index.d.ts
generated
vendored
Normal file
2
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './v10';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/index.d.ts.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAGA,cAAc,OAAO,CAAC"}
|
||||
20
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/index.js
generated
vendored
Normal file
20
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/index.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
// This file exports all the types available in the recommended gateway version
|
||||
// Thereby, things MAY break in the future. Try sticking to imports from a specific version
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("./v10"), exports);
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/index.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,2FAA2F;;;;;;;;;;;;;;;;AAE3F,wCAAsB"}
|
||||
8
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/index.mjs
generated
vendored
Normal file
8
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import mod from "./index.js";
|
||||
|
||||
export default mod;
|
||||
export const GatewayCloseCodes = mod.GatewayCloseCodes;
|
||||
export const GatewayDispatchEvents = mod.GatewayDispatchEvents;
|
||||
export const GatewayIntentBits = mod.GatewayIntentBits;
|
||||
export const GatewayOpcodes = mod.GatewayOpcodes;
|
||||
export const GatewayVersion = mod.GatewayVersion;
|
||||
1730
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v10.d.ts
generated
vendored
Normal file
1730
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v10.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v10.d.ts.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v10.d.ts.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
261
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v10.js
generated
vendored
Normal file
261
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v10.js
generated
vendored
Normal file
@@ -0,0 +1,261 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/gateway
|
||||
*/
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GatewayDispatchEvents = exports.GatewayIntentBits = exports.GatewayCloseCodes = exports.GatewayOpcodes = exports.GatewayVersion = void 0;
|
||||
__exportStar(require("./common"), exports);
|
||||
exports.GatewayVersion = '10';
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
|
||||
*/
|
||||
var GatewayOpcodes;
|
||||
(function (GatewayOpcodes) {
|
||||
/**
|
||||
* An event was dispatched
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Dispatch"] = 0] = "Dispatch";
|
||||
/**
|
||||
* A bidirectional opcode to maintain an active gateway connection.
|
||||
* Fired periodically by the client, or fired by the gateway to request an immediate heartbeat from the client.
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Heartbeat"] = 1] = "Heartbeat";
|
||||
/**
|
||||
* Starts a new session during the initial handshake
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Identify"] = 2] = "Identify";
|
||||
/**
|
||||
* Update the client's presence
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["PresenceUpdate"] = 3] = "PresenceUpdate";
|
||||
/**
|
||||
* Used to join/leave or move between voice channels
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["VoiceStateUpdate"] = 4] = "VoiceStateUpdate";
|
||||
/**
|
||||
* Resume a previous session that was disconnected
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Resume"] = 6] = "Resume";
|
||||
/**
|
||||
* You should attempt to reconnect and resume immediately
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Reconnect"] = 7] = "Reconnect";
|
||||
/**
|
||||
* Request information about offline guild members in a large guild
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["RequestGuildMembers"] = 8] = "RequestGuildMembers";
|
||||
/**
|
||||
* The session has been invalidated. You should reconnect and identify/resume accordingly
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["InvalidSession"] = 9] = "InvalidSession";
|
||||
/**
|
||||
* Sent immediately after connecting, contains the `heartbeat_interval` to use
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Hello"] = 10] = "Hello";
|
||||
/**
|
||||
* Sent in response to receiving a heartbeat to acknowledge that it has been received
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["HeartbeatAck"] = 11] = "HeartbeatAck";
|
||||
})(GatewayOpcodes || (exports.GatewayOpcodes = GatewayOpcodes = {}));
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
|
||||
*/
|
||||
var GatewayCloseCodes;
|
||||
(function (GatewayCloseCodes) {
|
||||
/**
|
||||
* We're not sure what went wrong. Try reconnecting?
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["UnknownError"] = 4000] = "UnknownError";
|
||||
/**
|
||||
* You sent an invalid Gateway opcode or an invalid payload for an opcode. Don't do that!
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#payload-structure
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["UnknownOpcode"] = 4001] = "UnknownOpcode";
|
||||
/**
|
||||
* You sent an invalid payload to us. Don't do that!
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#sending-events
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError";
|
||||
/**
|
||||
* You sent us a payload prior to identifying
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#identify
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated";
|
||||
/**
|
||||
* The account token sent with your identify payload is incorrect
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#identify
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed";
|
||||
/**
|
||||
* You sent more than one identify payload. Don't do that!
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated";
|
||||
/**
|
||||
* The sequence sent when resuming the session was invalid. Reconnect and start a new session
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#resume
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq";
|
||||
/**
|
||||
* Woah nelly! You're sending payloads to us too quickly. Slow it down! You will be disconnected on receiving this
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["RateLimited"] = 4008] = "RateLimited";
|
||||
/**
|
||||
* Your session timed out. Reconnect and start a new one
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["SessionTimedOut"] = 4009] = "SessionTimedOut";
|
||||
/**
|
||||
* You sent us an invalid shard when identifying
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#sharding
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["InvalidShard"] = 4010] = "InvalidShard";
|
||||
/**
|
||||
* The session would have handled too many guilds - you are required to shard your connection in order to connect
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#sharding
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired";
|
||||
/**
|
||||
* You sent an invalid version for the gateway
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["InvalidAPIVersion"] = 4012] = "InvalidAPIVersion";
|
||||
/**
|
||||
* You sent an invalid intent for a Gateway Intent. You may have incorrectly calculated the bitwise value
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#gateway-intents
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["InvalidIntents"] = 4013] = "InvalidIntents";
|
||||
/**
|
||||
* You sent a disallowed intent for a Gateway Intent. You may have tried to specify an intent that you have not
|
||||
* enabled or are not whitelisted for
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#gateway-intents
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#privileged-intents
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents";
|
||||
})(GatewayCloseCodes || (exports.GatewayCloseCodes = GatewayCloseCodes = {}));
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#list-of-intents
|
||||
*/
|
||||
var GatewayIntentBits;
|
||||
(function (GatewayIntentBits) {
|
||||
GatewayIntentBits[GatewayIntentBits["Guilds"] = 1] = "Guilds";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildMembers"] = 2] = "GuildMembers";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildModeration"] = 4] = "GuildModeration";
|
||||
/**
|
||||
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
|
||||
*/
|
||||
GatewayIntentBits[GatewayIntentBits["GuildBans"] = 4] = "GuildBans";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildEmojisAndStickers"] = 8] = "GuildEmojisAndStickers";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildIntegrations"] = 16] = "GuildIntegrations";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildWebhooks"] = 32] = "GuildWebhooks";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildInvites"] = 64] = "GuildInvites";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildVoiceStates"] = 128] = "GuildVoiceStates";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildPresences"] = 256] = "GuildPresences";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildMessages"] = 512] = "GuildMessages";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildMessageReactions"] = 1024] = "GuildMessageReactions";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildMessageTyping"] = 2048] = "GuildMessageTyping";
|
||||
GatewayIntentBits[GatewayIntentBits["DirectMessages"] = 4096] = "DirectMessages";
|
||||
GatewayIntentBits[GatewayIntentBits["DirectMessageReactions"] = 8192] = "DirectMessageReactions";
|
||||
GatewayIntentBits[GatewayIntentBits["DirectMessageTyping"] = 16384] = "DirectMessageTyping";
|
||||
GatewayIntentBits[GatewayIntentBits["MessageContent"] = 32768] = "MessageContent";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildScheduledEvents"] = 65536] = "GuildScheduledEvents";
|
||||
GatewayIntentBits[GatewayIntentBits["AutoModerationConfiguration"] = 1048576] = "AutoModerationConfiguration";
|
||||
GatewayIntentBits[GatewayIntentBits["AutoModerationExecution"] = 2097152] = "AutoModerationExecution";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildMessagePolls"] = 16777216] = "GuildMessagePolls";
|
||||
GatewayIntentBits[GatewayIntentBits["DirectMessagePolls"] = 33554432] = "DirectMessagePolls";
|
||||
})(GatewayIntentBits || (exports.GatewayIntentBits = GatewayIntentBits = {}));
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#receive-events
|
||||
*/
|
||||
var GatewayDispatchEvents;
|
||||
(function (GatewayDispatchEvents) {
|
||||
GatewayDispatchEvents["ApplicationCommandPermissionsUpdate"] = "APPLICATION_COMMAND_PERMISSIONS_UPDATE";
|
||||
GatewayDispatchEvents["ChannelCreate"] = "CHANNEL_CREATE";
|
||||
GatewayDispatchEvents["ChannelDelete"] = "CHANNEL_DELETE";
|
||||
GatewayDispatchEvents["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE";
|
||||
GatewayDispatchEvents["ChannelUpdate"] = "CHANNEL_UPDATE";
|
||||
GatewayDispatchEvents["GuildBanAdd"] = "GUILD_BAN_ADD";
|
||||
GatewayDispatchEvents["GuildBanRemove"] = "GUILD_BAN_REMOVE";
|
||||
GatewayDispatchEvents["GuildCreate"] = "GUILD_CREATE";
|
||||
GatewayDispatchEvents["GuildDelete"] = "GUILD_DELETE";
|
||||
GatewayDispatchEvents["GuildEmojisUpdate"] = "GUILD_EMOJIS_UPDATE";
|
||||
GatewayDispatchEvents["GuildIntegrationsUpdate"] = "GUILD_INTEGRATIONS_UPDATE";
|
||||
GatewayDispatchEvents["GuildMemberAdd"] = "GUILD_MEMBER_ADD";
|
||||
GatewayDispatchEvents["GuildMemberRemove"] = "GUILD_MEMBER_REMOVE";
|
||||
GatewayDispatchEvents["GuildMembersChunk"] = "GUILD_MEMBERS_CHUNK";
|
||||
GatewayDispatchEvents["GuildMemberUpdate"] = "GUILD_MEMBER_UPDATE";
|
||||
GatewayDispatchEvents["GuildRoleCreate"] = "GUILD_ROLE_CREATE";
|
||||
GatewayDispatchEvents["GuildRoleDelete"] = "GUILD_ROLE_DELETE";
|
||||
GatewayDispatchEvents["GuildRoleUpdate"] = "GUILD_ROLE_UPDATE";
|
||||
GatewayDispatchEvents["GuildStickersUpdate"] = "GUILD_STICKERS_UPDATE";
|
||||
GatewayDispatchEvents["GuildUpdate"] = "GUILD_UPDATE";
|
||||
GatewayDispatchEvents["IntegrationCreate"] = "INTEGRATION_CREATE";
|
||||
GatewayDispatchEvents["IntegrationDelete"] = "INTEGRATION_DELETE";
|
||||
GatewayDispatchEvents["IntegrationUpdate"] = "INTEGRATION_UPDATE";
|
||||
GatewayDispatchEvents["InteractionCreate"] = "INTERACTION_CREATE";
|
||||
GatewayDispatchEvents["InviteCreate"] = "INVITE_CREATE";
|
||||
GatewayDispatchEvents["InviteDelete"] = "INVITE_DELETE";
|
||||
GatewayDispatchEvents["MessageCreate"] = "MESSAGE_CREATE";
|
||||
GatewayDispatchEvents["MessageDelete"] = "MESSAGE_DELETE";
|
||||
GatewayDispatchEvents["MessageDeleteBulk"] = "MESSAGE_DELETE_BULK";
|
||||
GatewayDispatchEvents["MessageReactionAdd"] = "MESSAGE_REACTION_ADD";
|
||||
GatewayDispatchEvents["MessageReactionRemove"] = "MESSAGE_REACTION_REMOVE";
|
||||
GatewayDispatchEvents["MessageReactionRemoveAll"] = "MESSAGE_REACTION_REMOVE_ALL";
|
||||
GatewayDispatchEvents["MessageReactionRemoveEmoji"] = "MESSAGE_REACTION_REMOVE_EMOJI";
|
||||
GatewayDispatchEvents["MessageUpdate"] = "MESSAGE_UPDATE";
|
||||
GatewayDispatchEvents["PresenceUpdate"] = "PRESENCE_UPDATE";
|
||||
GatewayDispatchEvents["StageInstanceCreate"] = "STAGE_INSTANCE_CREATE";
|
||||
GatewayDispatchEvents["StageInstanceDelete"] = "STAGE_INSTANCE_DELETE";
|
||||
GatewayDispatchEvents["StageInstanceUpdate"] = "STAGE_INSTANCE_UPDATE";
|
||||
GatewayDispatchEvents["Ready"] = "READY";
|
||||
GatewayDispatchEvents["Resumed"] = "RESUMED";
|
||||
GatewayDispatchEvents["ThreadCreate"] = "THREAD_CREATE";
|
||||
GatewayDispatchEvents["ThreadDelete"] = "THREAD_DELETE";
|
||||
GatewayDispatchEvents["ThreadListSync"] = "THREAD_LIST_SYNC";
|
||||
GatewayDispatchEvents["ThreadMembersUpdate"] = "THREAD_MEMBERS_UPDATE";
|
||||
GatewayDispatchEvents["ThreadMemberUpdate"] = "THREAD_MEMBER_UPDATE";
|
||||
GatewayDispatchEvents["ThreadUpdate"] = "THREAD_UPDATE";
|
||||
GatewayDispatchEvents["TypingStart"] = "TYPING_START";
|
||||
GatewayDispatchEvents["UserUpdate"] = "USER_UPDATE";
|
||||
GatewayDispatchEvents["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE";
|
||||
GatewayDispatchEvents["VoiceStateUpdate"] = "VOICE_STATE_UPDATE";
|
||||
GatewayDispatchEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE";
|
||||
GatewayDispatchEvents["MessagePollVoteAdd"] = "MESSAGE_POLL_VOTE_ADD";
|
||||
GatewayDispatchEvents["MessagePollVoteRemove"] = "MESSAGE_POLL_VOTE_REMOVE";
|
||||
GatewayDispatchEvents["GuildScheduledEventCreate"] = "GUILD_SCHEDULED_EVENT_CREATE";
|
||||
GatewayDispatchEvents["GuildScheduledEventUpdate"] = "GUILD_SCHEDULED_EVENT_UPDATE";
|
||||
GatewayDispatchEvents["GuildScheduledEventDelete"] = "GUILD_SCHEDULED_EVENT_DELETE";
|
||||
GatewayDispatchEvents["GuildScheduledEventUserAdd"] = "GUILD_SCHEDULED_EVENT_USER_ADD";
|
||||
GatewayDispatchEvents["GuildScheduledEventUserRemove"] = "GUILD_SCHEDULED_EVENT_USER_REMOVE";
|
||||
GatewayDispatchEvents["AutoModerationRuleCreate"] = "AUTO_MODERATION_RULE_CREATE";
|
||||
GatewayDispatchEvents["AutoModerationRuleUpdate"] = "AUTO_MODERATION_RULE_UPDATE";
|
||||
GatewayDispatchEvents["AutoModerationRuleDelete"] = "AUTO_MODERATION_RULE_DELETE";
|
||||
GatewayDispatchEvents["AutoModerationActionExecution"] = "AUTO_MODERATION_ACTION_EXECUTION";
|
||||
GatewayDispatchEvents["GuildAuditLogEntryCreate"] = "GUILD_AUDIT_LOG_ENTRY_CREATE";
|
||||
GatewayDispatchEvents["EntitlementCreate"] = "ENTITLEMENT_CREATE";
|
||||
GatewayDispatchEvents["EntitlementUpdate"] = "ENTITLEMENT_UPDATE";
|
||||
GatewayDispatchEvents["EntitlementDelete"] = "ENTITLEMENT_DELETE";
|
||||
})(GatewayDispatchEvents || (exports.GatewayDispatchEvents = GatewayDispatchEvents = {}));
|
||||
// #endregion Shared
|
||||
//# sourceMappingURL=v10.js.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v10.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v10.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"v10.js","sourceRoot":"","sources":["v10.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AAsCH,2CAAyB;AAEZ,QAAA,cAAc,GAAG,IAAI,CAAC;AAEnC;;GAEG;AACH,IAAY,cA8CX;AA9CD,WAAY,cAAc;IACzB;;OAEG;IACH,2DAAQ,CAAA;IACR;;;OAGG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,2DAAQ,CAAA;IACR;;OAEG;IACH,uEAAc,CAAA;IACd;;OAEG;IACH,2EAAgB,CAAA;IAChB;;OAEG;IACH,uDAAU,CAAA;IACV;;OAEG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,iFAAmB,CAAA;IACnB;;OAEG;IACH,uEAAc,CAAA;IACd;;OAEG;IACH,sDAAK,CAAA;IACL;;OAEG;IACH,oEAAY,CAAA;AACb,CAAC,EA9CW,cAAc,8BAAd,cAAc,QA8CzB;AAED;;GAEG;AACH,IAAY,iBA8EX;AA9ED,WAAY,iBAAiB;IAC5B;;OAEG;IACH,4EAAoB,CAAA;IACpB;;;;OAIG;IACH,8EAAa,CAAA;IACb;;;;OAIG;IACH,0EAAW,CAAA;IACX;;;;OAIG;IACH,oFAAgB,CAAA;IAChB;;;;OAIG;IACH,4FAAoB,CAAA;IACpB;;OAEG;IACH,4FAAoB,CAAA;IACpB;;;;OAIG;IACH,wEAAkB,CAAA;IAClB;;OAEG;IACH,0EAAW,CAAA;IACX;;OAEG;IACH,kFAAe,CAAA;IACf;;;;OAIG;IACH,4EAAY,CAAA;IACZ;;;;OAIG;IACH,oFAAgB,CAAA;IAChB;;OAEG;IACH,sFAAiB,CAAA;IACjB;;;;OAIG;IACH,gFAAc,CAAA;IACd;;;;;;;OAOG;IACH,sFAAiB,CAAA;AAClB,CAAC,EA9EW,iBAAiB,iCAAjB,iBAAiB,QA8E5B;AAED;;GAEG;AACH,IAAY,iBA0BX;AA1BD,WAAY,iBAAiB;IAC5B,6DAAe,CAAA;IACf,yEAAqB,CAAA;IACrB,+EAAwB,CAAA;IACxB;;OAEG;IACH,mEAA2B,CAAA;IAC3B,6FAA+B,CAAA;IAC/B,oFAA0B,CAAA;IAC1B,4EAAsB,CAAA;IACtB,0EAAqB,CAAA;IACrB,mFAAyB,CAAA;IACzB,+EAAuB,CAAA;IACvB,6EAAsB,CAAA;IACtB,8FAA+B,CAAA;IAC/B,wFAA4B,CAAA;IAC5B,gFAAwB,CAAA;IACxB,gGAAgC,CAAA;IAChC,2FAA6B,CAAA;IAC7B,iFAAwB,CAAA;IACxB,6FAA8B,CAAA;IAC9B,6GAAqC,CAAA;IACrC,qGAAiC,CAAA;IACjC,0FAA2B,CAAA;IAC3B,4FAA4B,CAAA;AAC7B,CAAC,EA1BW,iBAAiB,iCAAjB,iBAAiB,QA0B5B;AAED;;GAEG;AACH,IAAY,qBAmEX;AAnED,WAAY,qBAAqB;IAChC,uGAA8E,CAAA;IAC9E,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,yDAAgC,CAAA;IAChC,sDAA6B,CAAA;IAC7B,4DAAmC,CAAA;IACnC,qDAA4B,CAAA;IAC5B,qDAA4B,CAAA;IAC5B,kEAAyC,CAAA;IACzC,8EAAqD,CAAA;IACrD,4DAAmC,CAAA;IACnC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,sEAA6C,CAAA;IAC7C,qDAA4B,CAAA;IAC5B,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,oEAA2C,CAAA;IAC3C,0EAAiD,CAAA;IACjD,iFAAwD,CAAA;IACxD,qFAA4D,CAAA;IAC5D,yDAAgC,CAAA;IAChC,2DAAkC,CAAA;IAClC,sEAA6C,CAAA;IAC7C,sEAA6C,CAAA;IAC7C,sEAA6C,CAAA;IAC7C,wCAAe,CAAA;IACf,4CAAmB,CAAA;IACnB,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,4DAAmC,CAAA;IACnC,sEAA6C,CAAA;IAC7C,oEAA2C,CAAA;IAC3C,uDAA8B,CAAA;IAC9B,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,kEAAyC,CAAA;IACzC,gEAAuC,CAAA;IACvC,2DAAkC,CAAA;IAClC,qEAA4C,CAAA;IAC5C,2EAAkD,CAAA;IAClD,mFAA0D,CAAA;IAC1D,mFAA0D,CAAA;IAC1D,mFAA0D,CAAA;IAC1D,sFAA6D,CAAA;IAC7D,4FAAmE,CAAA;IACnE,iFAAwD,CAAA;IACxD,iFAAwD,CAAA;IACxD,iFAAwD,CAAA;IACxD,2FAAkE,CAAA;IAClE,kFAAyD,CAAA;IACzD,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;AACzC,CAAC,EAnEW,qBAAqB,qCAArB,qBAAqB,QAmEhC;AAm3DD,oBAAoB"}
|
||||
8
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v10.mjs
generated
vendored
Normal file
8
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v10.mjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import mod from "./v10.js";
|
||||
|
||||
export default mod;
|
||||
export const GatewayCloseCodes = mod.GatewayCloseCodes;
|
||||
export const GatewayDispatchEvents = mod.GatewayDispatchEvents;
|
||||
export const GatewayIntentBits = mod.GatewayIntentBits;
|
||||
export const GatewayOpcodes = mod.GatewayOpcodes;
|
||||
export const GatewayVersion = mod.GatewayVersion;
|
||||
658
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v6.d.ts
generated
vendored
Normal file
658
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v6.d.ts
generated
vendored
Normal file
@@ -0,0 +1,658 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/gateway
|
||||
*/
|
||||
import type { APIChannel, APIEmoji, APIGuild, APIGuildMember, APIMessage, APIRole, APIUnavailableGuild, APIUser, GatewayActivity, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayVoiceState, InviteTargetUserType, PresenceUpdateStatus } from '../payloads/v6/index';
|
||||
export * from './common';
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export declare const GatewayVersion = "6";
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export declare enum GatewayOPCodes {
|
||||
Dispatch = 0,
|
||||
Heartbeat = 1,
|
||||
Identify = 2,
|
||||
PresenceUpdate = 3,
|
||||
VoiceStateUpdate = 4,
|
||||
Resume = 6,
|
||||
Reconnect = 7,
|
||||
RequestGuildMembers = 8,
|
||||
InvalidSession = 9,
|
||||
Hello = 10,
|
||||
HeartbeatAck = 11
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export declare enum GatewayCloseCodes {
|
||||
UnknownError = 4000,
|
||||
UnknownOpCode = 4001,
|
||||
DecodeError = 4002,
|
||||
NotAuthenticated = 4003,
|
||||
AuthenticationFailed = 4004,
|
||||
AlreadyAuthenticated = 4005,
|
||||
InvalidSeq = 4007,
|
||||
RateLimited = 4008,
|
||||
SessionTimedOut = 4009,
|
||||
InvalidShard = 4010,
|
||||
ShardingRequired = 4011,
|
||||
InvalidAPIVersion = 4012,
|
||||
InvalidIntents = 4013,
|
||||
DisallowedIntents = 4014
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export declare enum VoiceOPCodes {
|
||||
Identify = 0,
|
||||
SelectProtocol = 1,
|
||||
Ready = 2,
|
||||
Heartbeat = 3,
|
||||
SessionDescription = 4,
|
||||
Speaking = 5,
|
||||
HeartbeatAck = 6,
|
||||
Resume = 7,
|
||||
Hello = 8,
|
||||
Resumed = 9,
|
||||
ClientDisconnect = 13
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export declare enum VoiceCloseCodes {
|
||||
UnknownOpCode = 4001,
|
||||
NotAuthenticated = 4003,
|
||||
AuthenticationFailed = 4004,
|
||||
AlreadyAuthenticated = 4005,
|
||||
SessionNoLongerValid = 4006,
|
||||
SessionTimeout = 4009,
|
||||
ServerNotFound = 4011,
|
||||
UnknownProtocol = 4012,
|
||||
Disconnected = 4014,
|
||||
VoiceServerCrashed = 4015,
|
||||
UnknownEncryptionMode = 4016
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#list-of-intents
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export declare enum GatewayIntentBits {
|
||||
GUILDS = 1,
|
||||
GUILD_MEMBERS = 2,
|
||||
GUILD_BANS = 4,
|
||||
GUILD_EMOJIS = 8,
|
||||
GUILD_INTEGRATIONS = 16,
|
||||
GUILD_WEBHOOKS = 32,
|
||||
GUILD_INVITES = 64,
|
||||
GUILD_VOICE_STATES = 128,
|
||||
GUILD_PRESENCES = 256,
|
||||
GUILD_MESSAGES = 512,
|
||||
GUILD_MESSAGE_REACTIONS = 1024,
|
||||
GUILD_MESSAGE_TYPING = 2048,
|
||||
DIRECT_MESSAGES = 4096,
|
||||
DIRECT_MESSAGE_REACTIONS = 8192,
|
||||
DIRECT_MESSAGE_TYPING = 16384
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export declare enum GatewayDispatchEvents {
|
||||
Ready = "READY",
|
||||
Resumed = "RESUMED",
|
||||
ChannelCreate = "CHANNEL_CREATE",
|
||||
ChannelUpdate = "CHANNEL_UPDATE",
|
||||
ChannelDelete = "CHANNEL_DELETE",
|
||||
ChannelPinsUpdate = "CHANNEL_PINS_UPDATE",
|
||||
GuildCreate = "GUILD_CREATE",
|
||||
GuildUpdate = "GUILD_UPDATE",
|
||||
GuildDelete = "GUILD_DELETE",
|
||||
GuildBanAdd = "GUILD_BAN_ADD",
|
||||
GuildBanRemove = "GUILD_BAN_REMOVE",
|
||||
GuildEmojisUpdate = "GUILD_EMOJIS_UPDATE",
|
||||
GuildIntegrationsUpdate = "GUILD_INTEGRATIONS_UPDATE",
|
||||
GuildMemberAdd = "GUILD_MEMBER_ADD",
|
||||
GuildMemberRemove = "GUILD_MEMBER_REMOVE",
|
||||
GuildMemberUpdate = "GUILD_MEMBER_UPDATE",
|
||||
GuildMembersChunk = "GUILD_MEMBERS_CHUNK",
|
||||
GuildRoleCreate = "GUILD_ROLE_CREATE",
|
||||
GuildRoleUpdate = "GUILD_ROLE_UPDATE",
|
||||
GuildRoleDelete = "GUILD_ROLE_DELETE",
|
||||
InviteCreate = "INVITE_CREATE",
|
||||
InviteDelete = "INVITE_DELETE",
|
||||
MessageCreate = "MESSAGE_CREATE",
|
||||
MessageUpdate = "MESSAGE_UPDATE",
|
||||
MessageDelete = "MESSAGE_DELETE",
|
||||
MessageDeleteBulk = "MESSAGE_DELETE_BULK",
|
||||
MessageReactionAdd = "MESSAGE_REACTION_ADD",
|
||||
MessageReactionRemove = "MESSAGE_REACTION_REMOVE",
|
||||
MessageReactionRemoveAll = "MESSAGE_REACTION_REMOVE_ALL",
|
||||
MessageReactionRemoveEmoji = "MESSAGE_REACTION_REMOVE_EMOJI",
|
||||
PresenceUpdate = "PRESENCE_UPDATE",
|
||||
TypingStart = "TYPING_START",
|
||||
UserUpdate = "USER_UPDATE",
|
||||
VoiceStateUpdate = "VOICE_STATE_UPDATE",
|
||||
VoiceServerUpdate = "VOICE_SERVER_UPDATE",
|
||||
WebhooksUpdate = "WEBHOOKS_UPDATE"
|
||||
}
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewaySendPayload = GatewayHeartbeat | GatewayIdentify | GatewayRequestGuildMembers | GatewayResume | GatewayUpdatePresence | GatewayVoiceStateUpdate;
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayReceivePayload = GatewayDispatchPayload | GatewayHeartbeatAck | GatewayHeartbeatRequest | GatewayHello | GatewayInvalidSession | GatewayReconnect;
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayDispatchPayload = GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayGuildBanModifyDispatch | GatewayGuildDeleteDispatch | GatewayGuildEmojisUpdateDispatch | GatewayGuildIntegrationsUpdateDispatch | GatewayGuildMemberAddDispatch | GatewayGuildMemberRemoveDispatch | GatewayGuildMembersChunkDispatch | GatewayGuildMemberUpdateDispatch | GatewayGuildModifyDispatch | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch | GatewayMessageCreateDispatch | GatewayMessageDeleteBulkDispatch | GatewayMessageDeleteDispatch | GatewayMessageReactionAddDispatch | GatewayMessageReactionRemoveAllDispatch | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch | GatewayReadyDispatch | GatewayResumedDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceServerUpdateDispatch | GatewayVoiceStateUpdateDispatch | GatewayWebhooksUpdateDispatch;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#hello
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayHello extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.Hello;
|
||||
d: {
|
||||
heartbeat_interval: number;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#heartbeating
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayHeartbeatRequest extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.Heartbeat;
|
||||
d: never;
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#heartbeating-example-gateway-heartbeat-ack
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayHeartbeatAck extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.HeartbeatAck;
|
||||
d: never;
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invalid-session
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayInvalidSession extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.InvalidSession;
|
||||
d: boolean;
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#reconnect
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayReconnect extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.Reconnect;
|
||||
d: never;
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#ready
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayReadyDispatch = DataPayload<GatewayDispatchEvents.Ready, {
|
||||
v: number;
|
||||
user: APIUser;
|
||||
session_id: string;
|
||||
private_channels: [];
|
||||
guilds: APIUnavailableGuild[];
|
||||
shard?: [number, number];
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#resumed
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed, never>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-create
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-update
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-delete
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelModifyDispatch = DataPayload<GatewayDispatchEvents.ChannelCreate | GatewayDispatchEvents.ChannelDelete | GatewayDispatchEvents.ChannelUpdate, APIChannel>;
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelCreateDispatch = GatewayChannelModifyDispatch;
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelUpdateDispatch = GatewayChannelModifyDispatch;
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-pins-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelPinsUpdateDispatch = DataPayload<GatewayDispatchEvents.ChannelPinsUpdate, {
|
||||
guild_id?: string;
|
||||
channel_id: string;
|
||||
last_pin_timestamp?: string;
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildModifyDispatch = DataPayload<GatewayDispatchEvents.GuildCreate | GatewayDispatchEvents.GuildUpdate, APIGuild>;
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch;
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-delete
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildDelete, APIUnavailableGuild>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-ban-add
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-ban-remove
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildBanModifyDispatch = DataPayload<GatewayDispatchEvents.GuildBanAdd | GatewayDispatchEvents.GuildBanRemove, {
|
||||
guild_id: string;
|
||||
user: APIUser;
|
||||
}>;
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildBanAddDispatch = GatewayGuildBanModifyDispatch;
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-emojis-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildEmojisUpdateDispatch = DataPayload<GatewayDispatchEvents.GuildEmojisUpdate, {
|
||||
guild_id: string;
|
||||
emojis: APIEmoji[];
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-integrations-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildIntegrationsUpdateDispatch = DataPayload<GatewayDispatchEvents.GuildIntegrationsUpdate, {
|
||||
guild_id: string;
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-add
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildMemberAddDispatch = DataPayload<GatewayDispatchEvents.GuildMemberAdd, APIGuildMember & {
|
||||
guild_id: string;
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-remove
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildMemberRemoveDispatch = DataPayload<GatewayDispatchEvents.GuildMemberRemove, {
|
||||
guild_id: string;
|
||||
user: APIUser;
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildMemberUpdateDispatch = DataPayload<GatewayDispatchEvents.GuildMemberUpdate, Omit<APIGuildMember, 'deaf' | 'mute'> & {
|
||||
guild_id: string;
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-members-chunk
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildMembersChunkDispatch = DataPayload<GatewayDispatchEvents.GuildMembersChunk, {
|
||||
guild_id: string;
|
||||
members: APIGuildMember[];
|
||||
chunk_index?: number;
|
||||
chunk_count?: number;
|
||||
not_found?: unknown[];
|
||||
presences?: RawGatewayPresenceUpdate[];
|
||||
nonce?: string;
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildRoleModifyDispatch = DataPayload<GatewayDispatchEvents.GuildRoleCreate | GatewayDispatchEvents.GuildRoleUpdate, {
|
||||
guild_id: string;
|
||||
role: APIRole;
|
||||
}>;
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildRoleCreateDispatch = GatewayGuildRoleModifyDispatch;
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-delete
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildRoleDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildRoleDelete, {
|
||||
guild_id: string;
|
||||
role_id: string;
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invite-create
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayInviteCreateDispatch = DataPayload<GatewayDispatchEvents.InviteCreate, {
|
||||
channel_id: string;
|
||||
code: string;
|
||||
created_at: number;
|
||||
guild_id?: string;
|
||||
inviter?: APIUser;
|
||||
max_age: number;
|
||||
max_uses: number;
|
||||
target_user?: APIUser;
|
||||
target_user_type?: InviteTargetUserType;
|
||||
temporary: boolean;
|
||||
uses: 0;
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invite-delete
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayInviteDeleteDispatch = DataPayload<GatewayDispatchEvents.InviteDelete, {
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
code: string;
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-create
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageCreateDispatch = DataPayload<GatewayDispatchEvents.MessageCreate, APIMessage>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatch = DataPayload<GatewayDispatchEvents.MessageUpdate, Partial<APIMessage> & {
|
||||
id: string;
|
||||
channel_id: string;
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageDeleteDispatch = DataPayload<GatewayDispatchEvents.MessageDelete, {
|
||||
id: string;
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete-bulk
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageDeleteBulkDispatch = DataPayload<GatewayDispatchEvents.MessageDeleteBulk, {
|
||||
ids: string[];
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-add
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageReactionAddDispatch = ReactionData<GatewayDispatchEvents.MessageReactionAdd>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = ReactionData<GatewayDispatchEvents.MessageReactionRemove, 'member'>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveAllDispatch = DataPayload<GatewayDispatchEvents.MessageReactionRemoveAll, MessageReactionRemoveData>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveEmojiDispatch = DataPayload<GatewayDispatchEvents.MessageReactionRemoveEmoji, MessageReactionRemoveData & {
|
||||
emoji: APIEmoji;
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#presence-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayPresenceUpdateDispatch = DataPayload<GatewayDispatchEvents.PresenceUpdate, RawGatewayPresenceUpdate>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#typing-start
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayTypingStartDispatch = DataPayload<GatewayDispatchEvents.TypingStart, {
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
user_id: string;
|
||||
timestamp: number;
|
||||
member?: APIGuildMember;
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#user-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayUserUpdateDispatch = DataPayload<GatewayDispatchEvents.UserUpdate, APIUser>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#voice-state-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayVoiceStateUpdateDispatch = DataPayload<GatewayDispatchEvents.VoiceStateUpdate, GatewayVoiceState>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#voice-server-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayVoiceServerUpdateDispatch = DataPayload<GatewayDispatchEvents.VoiceServerUpdate, {
|
||||
token: string;
|
||||
guild_id: string;
|
||||
endpoint: string;
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#webhooks-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayWebhooksUpdateDispatch = DataPayload<GatewayDispatchEvents.WebhooksUpdate, {
|
||||
guild_id: string;
|
||||
channel_id: string;
|
||||
}>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#heartbeating
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayHeartbeat {
|
||||
op: GatewayOPCodes.Heartbeat;
|
||||
d: number;
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#identify-identify-connection-properties
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayIdentifyProperties {
|
||||
$os: string;
|
||||
$browser: string;
|
||||
$device: string;
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#identify
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayIdentify {
|
||||
op: GatewayOPCodes.Identify;
|
||||
d: {
|
||||
token: string;
|
||||
properties: GatewayIdentifyProperties;
|
||||
compress?: boolean;
|
||||
large_threshold?: number;
|
||||
shard?: [shard_id: number, shard_count: number];
|
||||
presence?: RawGatewayPresenceUpdate;
|
||||
guild_subscriptions?: boolean;
|
||||
intents?: number;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#resume
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayResume {
|
||||
op: GatewayOPCodes.Resume;
|
||||
d: {
|
||||
token: string;
|
||||
session_id: string;
|
||||
seq: number;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#request-guild-members
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayRequestGuildMembers {
|
||||
op: GatewayOPCodes.RequestGuildMembers;
|
||||
d: {
|
||||
guild_id: string[] | string;
|
||||
query?: string;
|
||||
limit: number;
|
||||
presences?: boolean;
|
||||
user_ids?: string[] | string;
|
||||
nonce?: string;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-voice-state
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayVoiceStateUpdate {
|
||||
op: GatewayOPCodes.VoiceStateUpdate;
|
||||
d: {
|
||||
guild_id: string;
|
||||
channel_id: string | null;
|
||||
self_mute: boolean;
|
||||
self_deaf: boolean;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-status
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayUpdatePresence {
|
||||
op: GatewayOPCodes.PresenceUpdate;
|
||||
d: GatewayPresenceUpdateData;
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-status-gateway-status-update-structure
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayPresenceUpdateData {
|
||||
since: number | null;
|
||||
game: GatewayActivity | null;
|
||||
status: PresenceUpdateStatus;
|
||||
afk: boolean;
|
||||
}
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
interface BasePayload {
|
||||
op: GatewayOPCodes;
|
||||
s: number;
|
||||
d?: unknown;
|
||||
t?: string;
|
||||
}
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
type NonDispatchPayload = Omit<BasePayload, 't'>;
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
interface DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends BasePayload {
|
||||
op: GatewayOPCodes.Dispatch;
|
||||
t: Event;
|
||||
d: D;
|
||||
}
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = DataPayload<E, Omit<{
|
||||
user_id: string;
|
||||
channel_id: string;
|
||||
message_id: string;
|
||||
guild_id?: string;
|
||||
member?: APIGuildMember;
|
||||
emoji: APIEmoji;
|
||||
}, O>>;
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
interface MessageReactionRemoveData {
|
||||
channel_id: string;
|
||||
message_id: string;
|
||||
guild_id?: string;
|
||||
}
|
||||
//# sourceMappingURL=v6.d.ts.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v6.d.ts.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v6.d.ts.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
173
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v6.js
generated
vendored
Normal file
173
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v6.js
generated
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/gateway
|
||||
*/
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GatewayDispatchEvents = exports.GatewayIntentBits = exports.VoiceCloseCodes = exports.VoiceOPCodes = exports.GatewayCloseCodes = exports.GatewayOPCodes = exports.GatewayVersion = void 0;
|
||||
__exportStar(require("./common"), exports);
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
exports.GatewayVersion = '6';
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
var GatewayOPCodes;
|
||||
(function (GatewayOPCodes) {
|
||||
GatewayOPCodes[GatewayOPCodes["Dispatch"] = 0] = "Dispatch";
|
||||
GatewayOPCodes[GatewayOPCodes["Heartbeat"] = 1] = "Heartbeat";
|
||||
GatewayOPCodes[GatewayOPCodes["Identify"] = 2] = "Identify";
|
||||
GatewayOPCodes[GatewayOPCodes["PresenceUpdate"] = 3] = "PresenceUpdate";
|
||||
GatewayOPCodes[GatewayOPCodes["VoiceStateUpdate"] = 4] = "VoiceStateUpdate";
|
||||
GatewayOPCodes[GatewayOPCodes["Resume"] = 6] = "Resume";
|
||||
GatewayOPCodes[GatewayOPCodes["Reconnect"] = 7] = "Reconnect";
|
||||
GatewayOPCodes[GatewayOPCodes["RequestGuildMembers"] = 8] = "RequestGuildMembers";
|
||||
GatewayOPCodes[GatewayOPCodes["InvalidSession"] = 9] = "InvalidSession";
|
||||
GatewayOPCodes[GatewayOPCodes["Hello"] = 10] = "Hello";
|
||||
GatewayOPCodes[GatewayOPCodes["HeartbeatAck"] = 11] = "HeartbeatAck";
|
||||
})(GatewayOPCodes || (exports.GatewayOPCodes = GatewayOPCodes = {}));
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
var GatewayCloseCodes;
|
||||
(function (GatewayCloseCodes) {
|
||||
GatewayCloseCodes[GatewayCloseCodes["UnknownError"] = 4000] = "UnknownError";
|
||||
GatewayCloseCodes[GatewayCloseCodes["UnknownOpCode"] = 4001] = "UnknownOpCode";
|
||||
GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError";
|
||||
GatewayCloseCodes[GatewayCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated";
|
||||
GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed";
|
||||
GatewayCloseCodes[GatewayCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated";
|
||||
GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq";
|
||||
GatewayCloseCodes[GatewayCloseCodes["RateLimited"] = 4008] = "RateLimited";
|
||||
GatewayCloseCodes[GatewayCloseCodes["SessionTimedOut"] = 4009] = "SessionTimedOut";
|
||||
GatewayCloseCodes[GatewayCloseCodes["InvalidShard"] = 4010] = "InvalidShard";
|
||||
GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired";
|
||||
GatewayCloseCodes[GatewayCloseCodes["InvalidAPIVersion"] = 4012] = "InvalidAPIVersion";
|
||||
GatewayCloseCodes[GatewayCloseCodes["InvalidIntents"] = 4013] = "InvalidIntents";
|
||||
GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents";
|
||||
})(GatewayCloseCodes || (exports.GatewayCloseCodes = GatewayCloseCodes = {}));
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
var VoiceOPCodes;
|
||||
(function (VoiceOPCodes) {
|
||||
VoiceOPCodes[VoiceOPCodes["Identify"] = 0] = "Identify";
|
||||
VoiceOPCodes[VoiceOPCodes["SelectProtocol"] = 1] = "SelectProtocol";
|
||||
VoiceOPCodes[VoiceOPCodes["Ready"] = 2] = "Ready";
|
||||
VoiceOPCodes[VoiceOPCodes["Heartbeat"] = 3] = "Heartbeat";
|
||||
VoiceOPCodes[VoiceOPCodes["SessionDescription"] = 4] = "SessionDescription";
|
||||
VoiceOPCodes[VoiceOPCodes["Speaking"] = 5] = "Speaking";
|
||||
VoiceOPCodes[VoiceOPCodes["HeartbeatAck"] = 6] = "HeartbeatAck";
|
||||
VoiceOPCodes[VoiceOPCodes["Resume"] = 7] = "Resume";
|
||||
VoiceOPCodes[VoiceOPCodes["Hello"] = 8] = "Hello";
|
||||
VoiceOPCodes[VoiceOPCodes["Resumed"] = 9] = "Resumed";
|
||||
VoiceOPCodes[VoiceOPCodes["ClientDisconnect"] = 13] = "ClientDisconnect";
|
||||
})(VoiceOPCodes || (exports.VoiceOPCodes = VoiceOPCodes = {}));
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
var VoiceCloseCodes;
|
||||
(function (VoiceCloseCodes) {
|
||||
VoiceCloseCodes[VoiceCloseCodes["UnknownOpCode"] = 4001] = "UnknownOpCode";
|
||||
VoiceCloseCodes[VoiceCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated";
|
||||
VoiceCloseCodes[VoiceCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed";
|
||||
VoiceCloseCodes[VoiceCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated";
|
||||
VoiceCloseCodes[VoiceCloseCodes["SessionNoLongerValid"] = 4006] = "SessionNoLongerValid";
|
||||
VoiceCloseCodes[VoiceCloseCodes["SessionTimeout"] = 4009] = "SessionTimeout";
|
||||
VoiceCloseCodes[VoiceCloseCodes["ServerNotFound"] = 4011] = "ServerNotFound";
|
||||
VoiceCloseCodes[VoiceCloseCodes["UnknownProtocol"] = 4012] = "UnknownProtocol";
|
||||
VoiceCloseCodes[VoiceCloseCodes["Disconnected"] = 4014] = "Disconnected";
|
||||
VoiceCloseCodes[VoiceCloseCodes["VoiceServerCrashed"] = 4015] = "VoiceServerCrashed";
|
||||
VoiceCloseCodes[VoiceCloseCodes["UnknownEncryptionMode"] = 4016] = "UnknownEncryptionMode";
|
||||
})(VoiceCloseCodes || (exports.VoiceCloseCodes = VoiceCloseCodes = {}));
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#list-of-intents
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
var GatewayIntentBits;
|
||||
(function (GatewayIntentBits) {
|
||||
GatewayIntentBits[GatewayIntentBits["GUILDS"] = 1] = "GUILDS";
|
||||
GatewayIntentBits[GatewayIntentBits["GUILD_MEMBERS"] = 2] = "GUILD_MEMBERS";
|
||||
GatewayIntentBits[GatewayIntentBits["GUILD_BANS"] = 4] = "GUILD_BANS";
|
||||
GatewayIntentBits[GatewayIntentBits["GUILD_EMOJIS"] = 8] = "GUILD_EMOJIS";
|
||||
GatewayIntentBits[GatewayIntentBits["GUILD_INTEGRATIONS"] = 16] = "GUILD_INTEGRATIONS";
|
||||
GatewayIntentBits[GatewayIntentBits["GUILD_WEBHOOKS"] = 32] = "GUILD_WEBHOOKS";
|
||||
GatewayIntentBits[GatewayIntentBits["GUILD_INVITES"] = 64] = "GUILD_INVITES";
|
||||
GatewayIntentBits[GatewayIntentBits["GUILD_VOICE_STATES"] = 128] = "GUILD_VOICE_STATES";
|
||||
GatewayIntentBits[GatewayIntentBits["GUILD_PRESENCES"] = 256] = "GUILD_PRESENCES";
|
||||
GatewayIntentBits[GatewayIntentBits["GUILD_MESSAGES"] = 512] = "GUILD_MESSAGES";
|
||||
GatewayIntentBits[GatewayIntentBits["GUILD_MESSAGE_REACTIONS"] = 1024] = "GUILD_MESSAGE_REACTIONS";
|
||||
GatewayIntentBits[GatewayIntentBits["GUILD_MESSAGE_TYPING"] = 2048] = "GUILD_MESSAGE_TYPING";
|
||||
GatewayIntentBits[GatewayIntentBits["DIRECT_MESSAGES"] = 4096] = "DIRECT_MESSAGES";
|
||||
GatewayIntentBits[GatewayIntentBits["DIRECT_MESSAGE_REACTIONS"] = 8192] = "DIRECT_MESSAGE_REACTIONS";
|
||||
GatewayIntentBits[GatewayIntentBits["DIRECT_MESSAGE_TYPING"] = 16384] = "DIRECT_MESSAGE_TYPING";
|
||||
})(GatewayIntentBits || (exports.GatewayIntentBits = GatewayIntentBits = {}));
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
var GatewayDispatchEvents;
|
||||
(function (GatewayDispatchEvents) {
|
||||
GatewayDispatchEvents["Ready"] = "READY";
|
||||
GatewayDispatchEvents["Resumed"] = "RESUMED";
|
||||
GatewayDispatchEvents["ChannelCreate"] = "CHANNEL_CREATE";
|
||||
GatewayDispatchEvents["ChannelUpdate"] = "CHANNEL_UPDATE";
|
||||
GatewayDispatchEvents["ChannelDelete"] = "CHANNEL_DELETE";
|
||||
GatewayDispatchEvents["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE";
|
||||
GatewayDispatchEvents["GuildCreate"] = "GUILD_CREATE";
|
||||
GatewayDispatchEvents["GuildUpdate"] = "GUILD_UPDATE";
|
||||
GatewayDispatchEvents["GuildDelete"] = "GUILD_DELETE";
|
||||
GatewayDispatchEvents["GuildBanAdd"] = "GUILD_BAN_ADD";
|
||||
GatewayDispatchEvents["GuildBanRemove"] = "GUILD_BAN_REMOVE";
|
||||
GatewayDispatchEvents["GuildEmojisUpdate"] = "GUILD_EMOJIS_UPDATE";
|
||||
GatewayDispatchEvents["GuildIntegrationsUpdate"] = "GUILD_INTEGRATIONS_UPDATE";
|
||||
GatewayDispatchEvents["GuildMemberAdd"] = "GUILD_MEMBER_ADD";
|
||||
GatewayDispatchEvents["GuildMemberRemove"] = "GUILD_MEMBER_REMOVE";
|
||||
GatewayDispatchEvents["GuildMemberUpdate"] = "GUILD_MEMBER_UPDATE";
|
||||
GatewayDispatchEvents["GuildMembersChunk"] = "GUILD_MEMBERS_CHUNK";
|
||||
GatewayDispatchEvents["GuildRoleCreate"] = "GUILD_ROLE_CREATE";
|
||||
GatewayDispatchEvents["GuildRoleUpdate"] = "GUILD_ROLE_UPDATE";
|
||||
GatewayDispatchEvents["GuildRoleDelete"] = "GUILD_ROLE_DELETE";
|
||||
GatewayDispatchEvents["InviteCreate"] = "INVITE_CREATE";
|
||||
GatewayDispatchEvents["InviteDelete"] = "INVITE_DELETE";
|
||||
GatewayDispatchEvents["MessageCreate"] = "MESSAGE_CREATE";
|
||||
GatewayDispatchEvents["MessageUpdate"] = "MESSAGE_UPDATE";
|
||||
GatewayDispatchEvents["MessageDelete"] = "MESSAGE_DELETE";
|
||||
GatewayDispatchEvents["MessageDeleteBulk"] = "MESSAGE_DELETE_BULK";
|
||||
GatewayDispatchEvents["MessageReactionAdd"] = "MESSAGE_REACTION_ADD";
|
||||
GatewayDispatchEvents["MessageReactionRemove"] = "MESSAGE_REACTION_REMOVE";
|
||||
GatewayDispatchEvents["MessageReactionRemoveAll"] = "MESSAGE_REACTION_REMOVE_ALL";
|
||||
GatewayDispatchEvents["MessageReactionRemoveEmoji"] = "MESSAGE_REACTION_REMOVE_EMOJI";
|
||||
GatewayDispatchEvents["PresenceUpdate"] = "PRESENCE_UPDATE";
|
||||
GatewayDispatchEvents["TypingStart"] = "TYPING_START";
|
||||
GatewayDispatchEvents["UserUpdate"] = "USER_UPDATE";
|
||||
GatewayDispatchEvents["VoiceStateUpdate"] = "VOICE_STATE_UPDATE";
|
||||
GatewayDispatchEvents["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE";
|
||||
GatewayDispatchEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE";
|
||||
})(GatewayDispatchEvents || (exports.GatewayDispatchEvents = GatewayDispatchEvents = {}));
|
||||
// #endregion Shared
|
||||
//# sourceMappingURL=v6.js.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v6.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v6.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"v6.js","sourceRoot":"","sources":["v6.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AAkBH,2CAAyB;AAEzB;;GAEG;AACU,QAAA,cAAc,GAAG,GAAG,CAAC;AAElC;;;;GAIG;AACH,IAAY,cAaX;AAbD,WAAY,cAAc;IACzB,2DAAQ,CAAA;IACR,6DAAS,CAAA;IACT,2DAAQ,CAAA;IACR,uEAAc,CAAA;IACd,2EAAgB,CAAA;IAEhB,uDAAU,CAAA;IACV,6DAAS,CAAA;IACT,iFAAmB,CAAA;IACnB,uEAAc,CAAA;IACd,sDAAK,CAAA;IACL,oEAAY,CAAA;AACb,CAAC,EAbW,cAAc,8BAAd,cAAc,QAazB;AAED;;;;GAIG;AACH,IAAY,iBAgBX;AAhBD,WAAY,iBAAiB;IAC5B,4EAAoB,CAAA;IACpB,8EAAa,CAAA;IACb,0EAAW,CAAA;IACX,oFAAgB,CAAA;IAChB,4FAAoB,CAAA;IACpB,4FAAoB,CAAA;IAEpB,wEAAkB,CAAA;IAClB,0EAAW,CAAA;IACX,kFAAe,CAAA;IACf,4EAAY,CAAA;IACZ,oFAAgB,CAAA;IAChB,sFAAiB,CAAA;IACjB,gFAAc,CAAA;IACd,sFAAiB,CAAA;AAClB,CAAC,EAhBW,iBAAiB,iCAAjB,iBAAiB,QAgB5B;AAED;;;;GAIG;AACH,IAAY,YAaX;AAbD,WAAY,YAAY;IACvB,uDAAQ,CAAA;IACR,mEAAc,CAAA;IACd,iDAAK,CAAA;IACL,yDAAS,CAAA;IACT,2EAAkB,CAAA;IAClB,uDAAQ,CAAA;IACR,+DAAY,CAAA;IACZ,mDAAM,CAAA;IACN,iDAAK,CAAA;IACL,qDAAO,CAAA;IAEP,wEAAqB,CAAA;AACtB,CAAC,EAbW,YAAY,4BAAZ,YAAY,QAavB;AAED;;;;GAIG;AACH,IAAY,eAgBX;AAhBD,WAAY,eAAe;IAC1B,0EAAqB,CAAA;IAErB,gFAAwB,CAAA;IACxB,wFAAoB,CAAA;IACpB,wFAAoB,CAAA;IACpB,wFAAoB,CAAA;IAEpB,4EAAsB,CAAA;IAEtB,4EAAsB,CAAA;IACtB,8EAAe,CAAA;IAEf,wEAAoB,CAAA;IACpB,oFAAkB,CAAA;IAClB,0FAAqB,CAAA;AACtB,CAAC,EAhBW,eAAe,+BAAf,eAAe,QAgB1B;AAED;;;;GAIG;AACH,IAAY,iBAgBX;AAhBD,WAAY,iBAAiB;IAC5B,6DAAe,CAAA;IACf,2EAAsB,CAAA;IACtB,qEAAmB,CAAA;IACnB,yEAAqB,CAAA;IACrB,sFAA2B,CAAA;IAC3B,8EAAuB,CAAA;IACvB,4EAAsB,CAAA;IACtB,uFAA2B,CAAA;IAC3B,iFAAwB,CAAA;IACxB,+EAAuB,CAAA;IACvB,kGAAiC,CAAA;IACjC,4FAA8B,CAAA;IAC9B,kFAAyB,CAAA;IACzB,oGAAkC,CAAA;IAClC,+FAA+B,CAAA;AAChC,CAAC,EAhBW,iBAAiB,iCAAjB,iBAAiB,QAgB5B;AAED;;;;GAIG;AACH,IAAY,qBAqCX;AArCD,WAAY,qBAAqB;IAChC,wCAAe,CAAA;IACf,4CAAmB,CAAA;IACnB,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,qDAA4B,CAAA;IAC5B,qDAA4B,CAAA;IAC5B,qDAA4B,CAAA;IAC5B,sDAA6B,CAAA;IAC7B,4DAAmC,CAAA;IACnC,kEAAyC,CAAA;IACzC,8EAAqD,CAAA;IACrD,4DAAmC,CAAA;IACnC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,oEAA2C,CAAA;IAC3C,0EAAiD,CAAA;IACjD,iFAAwD,CAAA;IACxD,qFAA4D,CAAA;IAC5D,2DAAkC,CAAA;IAClC,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,gEAAuC,CAAA;IACvC,kEAAyC,CAAA;IACzC,2DAAkC,CAAA;AACnC,CAAC,EArCW,qBAAqB,qCAArB,qBAAqB,QAqChC;AAmrBD,oBAAoB"}
|
||||
10
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v6.mjs
generated
vendored
Normal file
10
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v6.mjs
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import mod from "./v6.js";
|
||||
|
||||
export default mod;
|
||||
export const GatewayCloseCodes = mod.GatewayCloseCodes;
|
||||
export const GatewayDispatchEvents = mod.GatewayDispatchEvents;
|
||||
export const GatewayIntentBits = mod.GatewayIntentBits;
|
||||
export const GatewayOPCodes = mod.GatewayOPCodes;
|
||||
export const GatewayVersion = mod.GatewayVersion;
|
||||
export const VoiceCloseCodes = mod.VoiceCloseCodes;
|
||||
export const VoiceOPCodes = mod.VoiceOPCodes;
|
||||
1575
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v8.d.ts
generated
vendored
Normal file
1575
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v8.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v8.d.ts.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v8.d.ts.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
246
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v8.js
generated
vendored
Normal file
246
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v8.js
generated
vendored
Normal file
@@ -0,0 +1,246 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/gateway
|
||||
*/
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GatewayDispatchEvents = exports.GatewayIntentBits = exports.GatewayCloseCodes = exports.GatewayOpcodes = exports.GatewayVersion = void 0;
|
||||
__exportStar(require("./common"), exports);
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
exports.GatewayVersion = '8';
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
|
||||
*
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
var GatewayOpcodes;
|
||||
(function (GatewayOpcodes) {
|
||||
/**
|
||||
* An event was dispatched
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Dispatch"] = 0] = "Dispatch";
|
||||
/**
|
||||
* A bidirectional opcode to maintain an active gateway connection.
|
||||
* Fired periodically by the client, or fired by the gateway to request an immediate heartbeat from the client.
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Heartbeat"] = 1] = "Heartbeat";
|
||||
/**
|
||||
* Starts a new session during the initial handshake
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Identify"] = 2] = "Identify";
|
||||
/**
|
||||
* Update the client's presence
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["PresenceUpdate"] = 3] = "PresenceUpdate";
|
||||
/**
|
||||
* Used to join/leave or move between voice channels
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["VoiceStateUpdate"] = 4] = "VoiceStateUpdate";
|
||||
/**
|
||||
* Resume a previous session that was disconnected
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Resume"] = 6] = "Resume";
|
||||
/**
|
||||
* You should attempt to reconnect and resume immediately
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Reconnect"] = 7] = "Reconnect";
|
||||
/**
|
||||
* Request information about offline guild members in a large guild
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["RequestGuildMembers"] = 8] = "RequestGuildMembers";
|
||||
/**
|
||||
* The session has been invalidated. You should reconnect and identify/resume accordingly
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["InvalidSession"] = 9] = "InvalidSession";
|
||||
/**
|
||||
* Sent immediately after connecting, contains the `heartbeat_interval` to use
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Hello"] = 10] = "Hello";
|
||||
/**
|
||||
* Sent in response to receiving a heartbeat to acknowledge that it has been received
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["HeartbeatAck"] = 11] = "HeartbeatAck";
|
||||
})(GatewayOpcodes || (exports.GatewayOpcodes = GatewayOpcodes = {}));
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
|
||||
*
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
var GatewayCloseCodes;
|
||||
(function (GatewayCloseCodes) {
|
||||
/**
|
||||
* We're not sure what went wrong. Try reconnecting?
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["UnknownError"] = 4000] = "UnknownError";
|
||||
/**
|
||||
* You sent an invalid Gateway opcode or an invalid payload for an opcode. Don't do that!
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#payloads-and-opcodes
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["UnknownOpcode"] = 4001] = "UnknownOpcode";
|
||||
/**
|
||||
* You sent an invalid payload to us. Don't do that!
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#sending-payloads
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError";
|
||||
/**
|
||||
* You sent us a payload prior to identifying
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#identify
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated";
|
||||
/**
|
||||
* The account token sent with your identify payload is incorrect
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#identify
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed";
|
||||
/**
|
||||
* You sent more than one identify payload. Don't do that!
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated";
|
||||
/**
|
||||
* The sequence sent when resuming the session was invalid. Reconnect and start a new session
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#resume
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq";
|
||||
/**
|
||||
* Woah nelly! You're sending payloads to us too quickly. Slow it down! You will be disconnected on receiving this
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["RateLimited"] = 4008] = "RateLimited";
|
||||
/**
|
||||
* Your session timed out. Reconnect and start a new one
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["SessionTimedOut"] = 4009] = "SessionTimedOut";
|
||||
/**
|
||||
* You sent us an invalid shard when identifying
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#sharding
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["InvalidShard"] = 4010] = "InvalidShard";
|
||||
/**
|
||||
* The session would have handled too many guilds - you are required to shard your connection in order to connect
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#sharding
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired";
|
||||
/**
|
||||
* You sent an invalid version for the gateway
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["InvalidAPIVersion"] = 4012] = "InvalidAPIVersion";
|
||||
/**
|
||||
* You sent an invalid intent for a Gateway Intent. You may have incorrectly calculated the bitwise value
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#gateway-intents
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["InvalidIntents"] = 4013] = "InvalidIntents";
|
||||
/**
|
||||
* You sent a disallowed intent for a Gateway Intent. You may have tried to specify an intent that you have not
|
||||
* enabled or are not whitelisted for
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#gateway-intents
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#privileged-intents
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents";
|
||||
})(GatewayCloseCodes || (exports.GatewayCloseCodes = GatewayCloseCodes = {}));
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#list-of-intents
|
||||
*
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
var GatewayIntentBits;
|
||||
(function (GatewayIntentBits) {
|
||||
GatewayIntentBits[GatewayIntentBits["Guilds"] = 1] = "Guilds";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildMembers"] = 2] = "GuildMembers";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildBans"] = 4] = "GuildBans";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildEmojisAndStickers"] = 8] = "GuildEmojisAndStickers";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildIntegrations"] = 16] = "GuildIntegrations";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildWebhooks"] = 32] = "GuildWebhooks";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildInvites"] = 64] = "GuildInvites";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildVoiceStates"] = 128] = "GuildVoiceStates";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildPresences"] = 256] = "GuildPresences";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildMessages"] = 512] = "GuildMessages";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildMessageReactions"] = 1024] = "GuildMessageReactions";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildMessageTyping"] = 2048] = "GuildMessageTyping";
|
||||
GatewayIntentBits[GatewayIntentBits["DirectMessages"] = 4096] = "DirectMessages";
|
||||
GatewayIntentBits[GatewayIntentBits["DirectMessageReactions"] = 8192] = "DirectMessageReactions";
|
||||
GatewayIntentBits[GatewayIntentBits["DirectMessageTyping"] = 16384] = "DirectMessageTyping";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildScheduledEvents"] = 65536] = "GuildScheduledEvents";
|
||||
})(GatewayIntentBits || (exports.GatewayIntentBits = GatewayIntentBits = {}));
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
|
||||
*
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
var GatewayDispatchEvents;
|
||||
(function (GatewayDispatchEvents) {
|
||||
GatewayDispatchEvents["ChannelCreate"] = "CHANNEL_CREATE";
|
||||
GatewayDispatchEvents["ChannelDelete"] = "CHANNEL_DELETE";
|
||||
GatewayDispatchEvents["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE";
|
||||
GatewayDispatchEvents["ChannelUpdate"] = "CHANNEL_UPDATE";
|
||||
GatewayDispatchEvents["GuildBanAdd"] = "GUILD_BAN_ADD";
|
||||
GatewayDispatchEvents["GuildBanRemove"] = "GUILD_BAN_REMOVE";
|
||||
GatewayDispatchEvents["GuildCreate"] = "GUILD_CREATE";
|
||||
GatewayDispatchEvents["GuildDelete"] = "GUILD_DELETE";
|
||||
GatewayDispatchEvents["GuildEmojisUpdate"] = "GUILD_EMOJIS_UPDATE";
|
||||
GatewayDispatchEvents["GuildIntegrationsUpdate"] = "GUILD_INTEGRATIONS_UPDATE";
|
||||
GatewayDispatchEvents["GuildMemberAdd"] = "GUILD_MEMBER_ADD";
|
||||
GatewayDispatchEvents["GuildMemberRemove"] = "GUILD_MEMBER_REMOVE";
|
||||
GatewayDispatchEvents["GuildMembersChunk"] = "GUILD_MEMBERS_CHUNK";
|
||||
GatewayDispatchEvents["GuildMemberUpdate"] = "GUILD_MEMBER_UPDATE";
|
||||
GatewayDispatchEvents["GuildRoleCreate"] = "GUILD_ROLE_CREATE";
|
||||
GatewayDispatchEvents["GuildRoleDelete"] = "GUILD_ROLE_DELETE";
|
||||
GatewayDispatchEvents["GuildRoleUpdate"] = "GUILD_ROLE_UPDATE";
|
||||
GatewayDispatchEvents["GuildStickersUpdate"] = "GUILD_STICKERS_UPDATE";
|
||||
GatewayDispatchEvents["GuildUpdate"] = "GUILD_UPDATE";
|
||||
GatewayDispatchEvents["IntegrationCreate"] = "INTEGRATION_CREATE";
|
||||
GatewayDispatchEvents["IntegrationDelete"] = "INTEGRATION_DELETE";
|
||||
GatewayDispatchEvents["IntegrationUpdate"] = "INTEGRATION_UPDATE";
|
||||
GatewayDispatchEvents["InteractionCreate"] = "INTERACTION_CREATE";
|
||||
GatewayDispatchEvents["InviteCreate"] = "INVITE_CREATE";
|
||||
GatewayDispatchEvents["InviteDelete"] = "INVITE_DELETE";
|
||||
GatewayDispatchEvents["MessageCreate"] = "MESSAGE_CREATE";
|
||||
GatewayDispatchEvents["MessageDelete"] = "MESSAGE_DELETE";
|
||||
GatewayDispatchEvents["MessageDeleteBulk"] = "MESSAGE_DELETE_BULK";
|
||||
GatewayDispatchEvents["MessageReactionAdd"] = "MESSAGE_REACTION_ADD";
|
||||
GatewayDispatchEvents["MessageReactionRemove"] = "MESSAGE_REACTION_REMOVE";
|
||||
GatewayDispatchEvents["MessageReactionRemoveAll"] = "MESSAGE_REACTION_REMOVE_ALL";
|
||||
GatewayDispatchEvents["MessageReactionRemoveEmoji"] = "MESSAGE_REACTION_REMOVE_EMOJI";
|
||||
GatewayDispatchEvents["MessageUpdate"] = "MESSAGE_UPDATE";
|
||||
GatewayDispatchEvents["PresenceUpdate"] = "PRESENCE_UPDATE";
|
||||
GatewayDispatchEvents["StageInstanceCreate"] = "STAGE_INSTANCE_CREATE";
|
||||
GatewayDispatchEvents["StageInstanceDelete"] = "STAGE_INSTANCE_DELETE";
|
||||
GatewayDispatchEvents["StageInstanceUpdate"] = "STAGE_INSTANCE_UPDATE";
|
||||
GatewayDispatchEvents["Ready"] = "READY";
|
||||
GatewayDispatchEvents["Resumed"] = "RESUMED";
|
||||
GatewayDispatchEvents["TypingStart"] = "TYPING_START";
|
||||
GatewayDispatchEvents["UserUpdate"] = "USER_UPDATE";
|
||||
GatewayDispatchEvents["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE";
|
||||
GatewayDispatchEvents["VoiceStateUpdate"] = "VOICE_STATE_UPDATE";
|
||||
GatewayDispatchEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE";
|
||||
GatewayDispatchEvents["GuildScheduledEventCreate"] = "GUILD_SCHEDULED_EVENT_CREATE";
|
||||
GatewayDispatchEvents["GuildScheduledEventUpdate"] = "GUILD_SCHEDULED_EVENT_UPDATE";
|
||||
GatewayDispatchEvents["GuildScheduledEventDelete"] = "GUILD_SCHEDULED_EVENT_DELETE";
|
||||
GatewayDispatchEvents["GuildScheduledEventUserAdd"] = "GUILD_SCHEDULED_EVENT_USER_ADD";
|
||||
GatewayDispatchEvents["GuildScheduledEventUserRemove"] = "GUILD_SCHEDULED_EVENT_USER_REMOVE";
|
||||
})(GatewayDispatchEvents || (exports.GatewayDispatchEvents = GatewayDispatchEvents = {}));
|
||||
// #endregion Shared
|
||||
//# sourceMappingURL=v8.js.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v8.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v8.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"v8.js","sourceRoot":"","sources":["v8.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AA0BH,2CAAyB;AAEzB;;GAEG;AACU,QAAA,cAAc,GAAG,GAAG,CAAC;AAElC;;;;GAIG;AACH,IAAY,cA8CX;AA9CD,WAAY,cAAc;IACzB;;OAEG;IACH,2DAAQ,CAAA;IACR;;;OAGG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,2DAAQ,CAAA;IACR;;OAEG;IACH,uEAAc,CAAA;IACd;;OAEG;IACH,2EAAgB,CAAA;IAChB;;OAEG;IACH,uDAAU,CAAA;IACV;;OAEG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,iFAAmB,CAAA;IACnB;;OAEG;IACH,uEAAc,CAAA;IACd;;OAEG;IACH,sDAAK,CAAA;IACL;;OAEG;IACH,oEAAY,CAAA;AACb,CAAC,EA9CW,cAAc,8BAAd,cAAc,QA8CzB;AAED;;;;GAIG;AACH,IAAY,iBA8EX;AA9ED,WAAY,iBAAiB;IAC5B;;OAEG;IACH,4EAAoB,CAAA;IACpB;;;;OAIG;IACH,8EAAa,CAAA;IACb;;;;OAIG;IACH,0EAAW,CAAA;IACX;;;;OAIG;IACH,oFAAgB,CAAA;IAChB;;;;OAIG;IACH,4FAAoB,CAAA;IACpB;;OAEG;IACH,4FAAoB,CAAA;IACpB;;;;OAIG;IACH,wEAAkB,CAAA;IAClB;;OAEG;IACH,0EAAW,CAAA;IACX;;OAEG;IACH,kFAAe,CAAA;IACf;;;;OAIG;IACH,4EAAY,CAAA;IACZ;;;;OAIG;IACH,oFAAgB,CAAA;IAChB;;OAEG;IACH,sFAAiB,CAAA;IACjB;;;;OAIG;IACH,gFAAc,CAAA;IACd;;;;;;;OAOG;IACH,sFAAiB,CAAA;AAClB,CAAC,EA9EW,iBAAiB,iCAAjB,iBAAiB,QA8E5B;AAED;;;;GAIG;AACH,IAAY,iBAiBX;AAjBD,WAAY,iBAAiB;IAC5B,6DAAe,CAAA;IACf,yEAAqB,CAAA;IACrB,mEAAkB,CAAA;IAClB,6FAA+B,CAAA;IAC/B,oFAA0B,CAAA;IAC1B,4EAAsB,CAAA;IACtB,0EAAqB,CAAA;IACrB,mFAAyB,CAAA;IACzB,+EAAuB,CAAA;IACvB,6EAAsB,CAAA;IACtB,8FAA+B,CAAA;IAC/B,wFAA4B,CAAA;IAC5B,gFAAwB,CAAA;IACxB,gGAAgC,CAAA;IAChC,2FAA6B,CAAA;IAC7B,6FAA8B,CAAA;AAC/B,CAAC,EAjBW,iBAAiB,iCAAjB,iBAAiB,QAiB5B;AAED;;;;GAIG;AACH,IAAY,qBAkDX;AAlDD,WAAY,qBAAqB;IAChC,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,yDAAgC,CAAA;IAChC,sDAA6B,CAAA;IAC7B,4DAAmC,CAAA;IACnC,qDAA4B,CAAA;IAC5B,qDAA4B,CAAA;IAC5B,kEAAyC,CAAA;IACzC,8EAAqD,CAAA;IACrD,4DAAmC,CAAA;IACnC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,sEAA6C,CAAA;IAC7C,qDAA4B,CAAA;IAC5B,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,oEAA2C,CAAA;IAC3C,0EAAiD,CAAA;IACjD,iFAAwD,CAAA;IACxD,qFAA4D,CAAA;IAC5D,yDAAgC,CAAA;IAChC,2DAAkC,CAAA;IAClC,sEAA6C,CAAA;IAC7C,sEAA6C,CAAA;IAC7C,sEAA6C,CAAA;IAC7C,wCAAe,CAAA;IACf,4CAAmB,CAAA;IACnB,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,kEAAyC,CAAA;IACzC,gEAAuC,CAAA;IACvC,2DAAkC,CAAA;IAClC,mFAA0D,CAAA;IAC1D,mFAA0D,CAAA;IAC1D,mFAA0D,CAAA;IAC1D,sFAA6D,CAAA;IAC7D,4FAAmE,CAAA;AACpE,CAAC,EAlDW,qBAAqB,qCAArB,qBAAqB,QAkDhC;AAgoDD,oBAAoB"}
|
||||
8
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v8.mjs
generated
vendored
Normal file
8
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v8.mjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import mod from "./v8.js";
|
||||
|
||||
export default mod;
|
||||
export const GatewayCloseCodes = mod.GatewayCloseCodes;
|
||||
export const GatewayDispatchEvents = mod.GatewayDispatchEvents;
|
||||
export const GatewayIntentBits = mod.GatewayIntentBits;
|
||||
export const GatewayOpcodes = mod.GatewayOpcodes;
|
||||
export const GatewayVersion = mod.GatewayVersion;
|
||||
1730
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v9.d.ts
generated
vendored
Normal file
1730
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v9.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v9.d.ts.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v9.d.ts.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
260
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v9.js
generated
vendored
Normal file
260
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v9.js
generated
vendored
Normal file
@@ -0,0 +1,260 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/gateway
|
||||
*/
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GatewayDispatchEvents = exports.GatewayIntentBits = exports.GatewayCloseCodes = exports.GatewayOpcodes = exports.GatewayVersion = void 0;
|
||||
__exportStar(require("./common"), exports);
|
||||
exports.GatewayVersion = '9';
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
|
||||
*/
|
||||
var GatewayOpcodes;
|
||||
(function (GatewayOpcodes) {
|
||||
/**
|
||||
* An event was dispatched
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Dispatch"] = 0] = "Dispatch";
|
||||
/**
|
||||
* A bidirectional opcode to maintain an active gateway connection.
|
||||
* Fired periodically by the client, or fired by the gateway to request an immediate heartbeat from the client.
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Heartbeat"] = 1] = "Heartbeat";
|
||||
/**
|
||||
* Starts a new session during the initial handshake
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Identify"] = 2] = "Identify";
|
||||
/**
|
||||
* Update the client's presence
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["PresenceUpdate"] = 3] = "PresenceUpdate";
|
||||
/**
|
||||
* Used to join/leave or move between voice channels
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["VoiceStateUpdate"] = 4] = "VoiceStateUpdate";
|
||||
/**
|
||||
* Resume a previous session that was disconnected
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Resume"] = 6] = "Resume";
|
||||
/**
|
||||
* You should attempt to reconnect and resume immediately
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Reconnect"] = 7] = "Reconnect";
|
||||
/**
|
||||
* Request information about offline guild members in a large guild
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["RequestGuildMembers"] = 8] = "RequestGuildMembers";
|
||||
/**
|
||||
* The session has been invalidated. You should reconnect and identify/resume accordingly
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["InvalidSession"] = 9] = "InvalidSession";
|
||||
/**
|
||||
* Sent immediately after connecting, contains the `heartbeat_interval` to use
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["Hello"] = 10] = "Hello";
|
||||
/**
|
||||
* Sent in response to receiving a heartbeat to acknowledge that it has been received
|
||||
*/
|
||||
GatewayOpcodes[GatewayOpcodes["HeartbeatAck"] = 11] = "HeartbeatAck";
|
||||
})(GatewayOpcodes || (exports.GatewayOpcodes = GatewayOpcodes = {}));
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
|
||||
*/
|
||||
var GatewayCloseCodes;
|
||||
(function (GatewayCloseCodes) {
|
||||
/**
|
||||
* We're not sure what went wrong. Try reconnecting?
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["UnknownError"] = 4000] = "UnknownError";
|
||||
/**
|
||||
* You sent an invalid Gateway opcode or an invalid payload for an opcode. Don't do that!
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#payload-structure
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["UnknownOpcode"] = 4001] = "UnknownOpcode";
|
||||
/**
|
||||
* You sent an invalid payload to us. Don't do that!
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#sending-events
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError";
|
||||
/**
|
||||
* You sent us a payload prior to identifying
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#identify
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated";
|
||||
/**
|
||||
* The account token sent with your identify payload is incorrect
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#identify
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed";
|
||||
/**
|
||||
* You sent more than one identify payload. Don't do that!
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated";
|
||||
/**
|
||||
* The sequence sent when resuming the session was invalid. Reconnect and start a new session
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#resume
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq";
|
||||
/**
|
||||
* Woah nelly! You're sending payloads to us too quickly. Slow it down! You will be disconnected on receiving this
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["RateLimited"] = 4008] = "RateLimited";
|
||||
/**
|
||||
* Your session timed out. Reconnect and start a new one
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["SessionTimedOut"] = 4009] = "SessionTimedOut";
|
||||
/**
|
||||
* You sent us an invalid shard when identifying
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#sharding
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["InvalidShard"] = 4010] = "InvalidShard";
|
||||
/**
|
||||
* The session would have handled too many guilds - you are required to shard your connection in order to connect
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#sharding
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired";
|
||||
/**
|
||||
* You sent an invalid version for the gateway
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["InvalidAPIVersion"] = 4012] = "InvalidAPIVersion";
|
||||
/**
|
||||
* You sent an invalid intent for a Gateway Intent. You may have incorrectly calculated the bitwise value
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#gateway-intents
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["InvalidIntents"] = 4013] = "InvalidIntents";
|
||||
/**
|
||||
* You sent a disallowed intent for a Gateway Intent. You may have tried to specify an intent that you have not
|
||||
* enabled or are not whitelisted for
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#gateway-intents
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#privileged-intents
|
||||
*/
|
||||
GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents";
|
||||
})(GatewayCloseCodes || (exports.GatewayCloseCodes = GatewayCloseCodes = {}));
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#list-of-intents
|
||||
*/
|
||||
var GatewayIntentBits;
|
||||
(function (GatewayIntentBits) {
|
||||
GatewayIntentBits[GatewayIntentBits["Guilds"] = 1] = "Guilds";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildMembers"] = 2] = "GuildMembers";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildModeration"] = 4] = "GuildModeration";
|
||||
/**
|
||||
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
|
||||
*/
|
||||
GatewayIntentBits[GatewayIntentBits["GuildBans"] = 4] = "GuildBans";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildEmojisAndStickers"] = 8] = "GuildEmojisAndStickers";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildIntegrations"] = 16] = "GuildIntegrations";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildWebhooks"] = 32] = "GuildWebhooks";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildInvites"] = 64] = "GuildInvites";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildVoiceStates"] = 128] = "GuildVoiceStates";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildPresences"] = 256] = "GuildPresences";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildMessages"] = 512] = "GuildMessages";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildMessageReactions"] = 1024] = "GuildMessageReactions";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildMessageTyping"] = 2048] = "GuildMessageTyping";
|
||||
GatewayIntentBits[GatewayIntentBits["DirectMessages"] = 4096] = "DirectMessages";
|
||||
GatewayIntentBits[GatewayIntentBits["DirectMessageReactions"] = 8192] = "DirectMessageReactions";
|
||||
GatewayIntentBits[GatewayIntentBits["DirectMessageTyping"] = 16384] = "DirectMessageTyping";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildScheduledEvents"] = 65536] = "GuildScheduledEvents";
|
||||
GatewayIntentBits[GatewayIntentBits["AutoModerationConfiguration"] = 1048576] = "AutoModerationConfiguration";
|
||||
GatewayIntentBits[GatewayIntentBits["AutoModerationExecution"] = 2097152] = "AutoModerationExecution";
|
||||
GatewayIntentBits[GatewayIntentBits["GuildMessagePolls"] = 16777216] = "GuildMessagePolls";
|
||||
GatewayIntentBits[GatewayIntentBits["DirectMessagePolls"] = 33554432] = "DirectMessagePolls";
|
||||
})(GatewayIntentBits || (exports.GatewayIntentBits = GatewayIntentBits = {}));
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#receive-events
|
||||
*/
|
||||
var GatewayDispatchEvents;
|
||||
(function (GatewayDispatchEvents) {
|
||||
GatewayDispatchEvents["ApplicationCommandPermissionsUpdate"] = "APPLICATION_COMMAND_PERMISSIONS_UPDATE";
|
||||
GatewayDispatchEvents["ChannelCreate"] = "CHANNEL_CREATE";
|
||||
GatewayDispatchEvents["ChannelDelete"] = "CHANNEL_DELETE";
|
||||
GatewayDispatchEvents["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE";
|
||||
GatewayDispatchEvents["ChannelUpdate"] = "CHANNEL_UPDATE";
|
||||
GatewayDispatchEvents["GuildBanAdd"] = "GUILD_BAN_ADD";
|
||||
GatewayDispatchEvents["GuildBanRemove"] = "GUILD_BAN_REMOVE";
|
||||
GatewayDispatchEvents["GuildCreate"] = "GUILD_CREATE";
|
||||
GatewayDispatchEvents["GuildDelete"] = "GUILD_DELETE";
|
||||
GatewayDispatchEvents["GuildEmojisUpdate"] = "GUILD_EMOJIS_UPDATE";
|
||||
GatewayDispatchEvents["GuildIntegrationsUpdate"] = "GUILD_INTEGRATIONS_UPDATE";
|
||||
GatewayDispatchEvents["GuildMemberAdd"] = "GUILD_MEMBER_ADD";
|
||||
GatewayDispatchEvents["GuildMemberRemove"] = "GUILD_MEMBER_REMOVE";
|
||||
GatewayDispatchEvents["GuildMembersChunk"] = "GUILD_MEMBERS_CHUNK";
|
||||
GatewayDispatchEvents["GuildMemberUpdate"] = "GUILD_MEMBER_UPDATE";
|
||||
GatewayDispatchEvents["GuildRoleCreate"] = "GUILD_ROLE_CREATE";
|
||||
GatewayDispatchEvents["GuildRoleDelete"] = "GUILD_ROLE_DELETE";
|
||||
GatewayDispatchEvents["GuildRoleUpdate"] = "GUILD_ROLE_UPDATE";
|
||||
GatewayDispatchEvents["GuildStickersUpdate"] = "GUILD_STICKERS_UPDATE";
|
||||
GatewayDispatchEvents["GuildUpdate"] = "GUILD_UPDATE";
|
||||
GatewayDispatchEvents["IntegrationCreate"] = "INTEGRATION_CREATE";
|
||||
GatewayDispatchEvents["IntegrationDelete"] = "INTEGRATION_DELETE";
|
||||
GatewayDispatchEvents["IntegrationUpdate"] = "INTEGRATION_UPDATE";
|
||||
GatewayDispatchEvents["InteractionCreate"] = "INTERACTION_CREATE";
|
||||
GatewayDispatchEvents["InviteCreate"] = "INVITE_CREATE";
|
||||
GatewayDispatchEvents["InviteDelete"] = "INVITE_DELETE";
|
||||
GatewayDispatchEvents["MessageCreate"] = "MESSAGE_CREATE";
|
||||
GatewayDispatchEvents["MessageDelete"] = "MESSAGE_DELETE";
|
||||
GatewayDispatchEvents["MessageDeleteBulk"] = "MESSAGE_DELETE_BULK";
|
||||
GatewayDispatchEvents["MessageReactionAdd"] = "MESSAGE_REACTION_ADD";
|
||||
GatewayDispatchEvents["MessageReactionRemove"] = "MESSAGE_REACTION_REMOVE";
|
||||
GatewayDispatchEvents["MessageReactionRemoveAll"] = "MESSAGE_REACTION_REMOVE_ALL";
|
||||
GatewayDispatchEvents["MessageReactionRemoveEmoji"] = "MESSAGE_REACTION_REMOVE_EMOJI";
|
||||
GatewayDispatchEvents["MessageUpdate"] = "MESSAGE_UPDATE";
|
||||
GatewayDispatchEvents["PresenceUpdate"] = "PRESENCE_UPDATE";
|
||||
GatewayDispatchEvents["StageInstanceCreate"] = "STAGE_INSTANCE_CREATE";
|
||||
GatewayDispatchEvents["StageInstanceDelete"] = "STAGE_INSTANCE_DELETE";
|
||||
GatewayDispatchEvents["StageInstanceUpdate"] = "STAGE_INSTANCE_UPDATE";
|
||||
GatewayDispatchEvents["Ready"] = "READY";
|
||||
GatewayDispatchEvents["Resumed"] = "RESUMED";
|
||||
GatewayDispatchEvents["ThreadCreate"] = "THREAD_CREATE";
|
||||
GatewayDispatchEvents["ThreadDelete"] = "THREAD_DELETE";
|
||||
GatewayDispatchEvents["ThreadListSync"] = "THREAD_LIST_SYNC";
|
||||
GatewayDispatchEvents["ThreadMembersUpdate"] = "THREAD_MEMBERS_UPDATE";
|
||||
GatewayDispatchEvents["ThreadMemberUpdate"] = "THREAD_MEMBER_UPDATE";
|
||||
GatewayDispatchEvents["ThreadUpdate"] = "THREAD_UPDATE";
|
||||
GatewayDispatchEvents["TypingStart"] = "TYPING_START";
|
||||
GatewayDispatchEvents["UserUpdate"] = "USER_UPDATE";
|
||||
GatewayDispatchEvents["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE";
|
||||
GatewayDispatchEvents["VoiceStateUpdate"] = "VOICE_STATE_UPDATE";
|
||||
GatewayDispatchEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE";
|
||||
GatewayDispatchEvents["MessagePollVoteAdd"] = "MESSAGE_POLL_VOTE_ADD";
|
||||
GatewayDispatchEvents["MessagePollVoteRemove"] = "MESSAGE_POLL_VOTE_REMOVE";
|
||||
GatewayDispatchEvents["GuildScheduledEventCreate"] = "GUILD_SCHEDULED_EVENT_CREATE";
|
||||
GatewayDispatchEvents["GuildScheduledEventUpdate"] = "GUILD_SCHEDULED_EVENT_UPDATE";
|
||||
GatewayDispatchEvents["GuildScheduledEventDelete"] = "GUILD_SCHEDULED_EVENT_DELETE";
|
||||
GatewayDispatchEvents["GuildScheduledEventUserAdd"] = "GUILD_SCHEDULED_EVENT_USER_ADD";
|
||||
GatewayDispatchEvents["GuildScheduledEventUserRemove"] = "GUILD_SCHEDULED_EVENT_USER_REMOVE";
|
||||
GatewayDispatchEvents["AutoModerationRuleCreate"] = "AUTO_MODERATION_RULE_CREATE";
|
||||
GatewayDispatchEvents["AutoModerationRuleUpdate"] = "AUTO_MODERATION_RULE_UPDATE";
|
||||
GatewayDispatchEvents["AutoModerationRuleDelete"] = "AUTO_MODERATION_RULE_DELETE";
|
||||
GatewayDispatchEvents["AutoModerationActionExecution"] = "AUTO_MODERATION_ACTION_EXECUTION";
|
||||
GatewayDispatchEvents["GuildAuditLogEntryCreate"] = "GUILD_AUDIT_LOG_ENTRY_CREATE";
|
||||
GatewayDispatchEvents["EntitlementCreate"] = "ENTITLEMENT_CREATE";
|
||||
GatewayDispatchEvents["EntitlementUpdate"] = "ENTITLEMENT_UPDATE";
|
||||
GatewayDispatchEvents["EntitlementDelete"] = "ENTITLEMENT_DELETE";
|
||||
})(GatewayDispatchEvents || (exports.GatewayDispatchEvents = GatewayDispatchEvents = {}));
|
||||
// #endregion Shared
|
||||
//# sourceMappingURL=v9.js.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v9.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v9.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"v9.js","sourceRoot":"","sources":["v9.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AAsCH,2CAAyB;AAEZ,QAAA,cAAc,GAAG,GAAG,CAAC;AAElC;;GAEG;AACH,IAAY,cA8CX;AA9CD,WAAY,cAAc;IACzB;;OAEG;IACH,2DAAQ,CAAA;IACR;;;OAGG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,2DAAQ,CAAA;IACR;;OAEG;IACH,uEAAc,CAAA;IACd;;OAEG;IACH,2EAAgB,CAAA;IAChB;;OAEG;IACH,uDAAU,CAAA;IACV;;OAEG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,iFAAmB,CAAA;IACnB;;OAEG;IACH,uEAAc,CAAA;IACd;;OAEG;IACH,sDAAK,CAAA;IACL;;OAEG;IACH,oEAAY,CAAA;AACb,CAAC,EA9CW,cAAc,8BAAd,cAAc,QA8CzB;AAED;;GAEG;AACH,IAAY,iBA8EX;AA9ED,WAAY,iBAAiB;IAC5B;;OAEG;IACH,4EAAoB,CAAA;IACpB;;;;OAIG;IACH,8EAAa,CAAA;IACb;;;;OAIG;IACH,0EAAW,CAAA;IACX;;;;OAIG;IACH,oFAAgB,CAAA;IAChB;;;;OAIG;IACH,4FAAoB,CAAA;IACpB;;OAEG;IACH,4FAAoB,CAAA;IACpB;;;;OAIG;IACH,wEAAkB,CAAA;IAClB;;OAEG;IACH,0EAAW,CAAA;IACX;;OAEG;IACH,kFAAe,CAAA;IACf;;;;OAIG;IACH,4EAAY,CAAA;IACZ;;;;OAIG;IACH,oFAAgB,CAAA;IAChB;;OAEG;IACH,sFAAiB,CAAA;IACjB;;;;OAIG;IACH,gFAAc,CAAA;IACd;;;;;;;OAOG;IACH,sFAAiB,CAAA;AAClB,CAAC,EA9EW,iBAAiB,iCAAjB,iBAAiB,QA8E5B;AAED;;GAEG;AACH,IAAY,iBAyBX;AAzBD,WAAY,iBAAiB;IAC5B,6DAAe,CAAA;IACf,yEAAqB,CAAA;IACrB,+EAAwB,CAAA;IACxB;;OAEG;IACH,mEAA2B,CAAA;IAC3B,6FAA+B,CAAA;IAC/B,oFAA0B,CAAA;IAC1B,4EAAsB,CAAA;IACtB,0EAAqB,CAAA;IACrB,mFAAyB,CAAA;IACzB,+EAAuB,CAAA;IACvB,6EAAsB,CAAA;IACtB,8FAA+B,CAAA;IAC/B,wFAA4B,CAAA;IAC5B,gFAAwB,CAAA;IACxB,gGAAgC,CAAA;IAChC,2FAA6B,CAAA;IAC7B,6FAA8B,CAAA;IAC9B,6GAAqC,CAAA;IACrC,qGAAiC,CAAA;IACjC,0FAA2B,CAAA;IAC3B,4FAA4B,CAAA;AAC7B,CAAC,EAzBW,iBAAiB,iCAAjB,iBAAiB,QAyB5B;AAED;;GAEG;AACH,IAAY,qBAmEX;AAnED,WAAY,qBAAqB;IAChC,uGAA8E,CAAA;IAC9E,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,yDAAgC,CAAA;IAChC,sDAA6B,CAAA;IAC7B,4DAAmC,CAAA;IACnC,qDAA4B,CAAA;IAC5B,qDAA4B,CAAA;IAC5B,kEAAyC,CAAA;IACzC,8EAAqD,CAAA;IACrD,4DAAmC,CAAA;IACnC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,sEAA6C,CAAA;IAC7C,qDAA4B,CAAA;IAC5B,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,oEAA2C,CAAA;IAC3C,0EAAiD,CAAA;IACjD,iFAAwD,CAAA;IACxD,qFAA4D,CAAA;IAC5D,yDAAgC,CAAA;IAChC,2DAAkC,CAAA;IAClC,sEAA6C,CAAA;IAC7C,sEAA6C,CAAA;IAC7C,sEAA6C,CAAA;IAC7C,wCAAe,CAAA;IACf,4CAAmB,CAAA;IACnB,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,4DAAmC,CAAA;IACnC,sEAA6C,CAAA;IAC7C,oEAA2C,CAAA;IAC3C,uDAA8B,CAAA;IAC9B,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,kEAAyC,CAAA;IACzC,gEAAuC,CAAA;IACvC,2DAAkC,CAAA;IAClC,qEAA4C,CAAA;IAC5C,2EAAkD,CAAA;IAClD,mFAA0D,CAAA;IAC1D,mFAA0D,CAAA;IAC1D,mFAA0D,CAAA;IAC1D,sFAA6D,CAAA;IAC7D,4FAAmE,CAAA;IACnE,iFAAwD,CAAA;IACxD,iFAAwD,CAAA;IACxD,iFAAwD,CAAA;IACxD,2FAAkE,CAAA;IAClE,kFAAyD,CAAA;IACzD,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;AACzC,CAAC,EAnEW,qBAAqB,qCAArB,qBAAqB,QAmEhC;AAm3DD,oBAAoB"}
|
||||
8
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v9.mjs
generated
vendored
Normal file
8
node_modules/@discordjs/ws/node_modules/discord-api-types/gateway/v9.mjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import mod from "./v9.js";
|
||||
|
||||
export default mod;
|
||||
export const GatewayCloseCodes = mod.GatewayCloseCodes;
|
||||
export const GatewayDispatchEvents = mod.GatewayDispatchEvents;
|
||||
export const GatewayIntentBits = mod.GatewayIntentBits;
|
||||
export const GatewayOpcodes = mod.GatewayOpcodes;
|
||||
export const GatewayVersion = mod.GatewayVersion;
|
||||
92
node_modules/@discordjs/ws/node_modules/discord-api-types/globals.d.ts
generated
vendored
Normal file
92
node_modules/@discordjs/ws/node_modules/discord-api-types/globals.d.ts
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* https://discord.com/developers/docs/reference#snowflakes
|
||||
*/
|
||||
export type Snowflake = string;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export type Permissions = string;
|
||||
/**
|
||||
* https://discord.com/developers/docs/reference#message-formatting-formats
|
||||
*/
|
||||
export declare const FormattingPatterns: {
|
||||
/**
|
||||
* Regular expression for matching a user mention, strictly without a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
readonly User: RegExp;
|
||||
/**
|
||||
* Regular expression for matching a user mention, strictly with a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*
|
||||
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
|
||||
*/
|
||||
readonly UserWithNickname: RegExp;
|
||||
/**
|
||||
* Regular expression for matching a user mention, with or without a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*
|
||||
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
|
||||
*/
|
||||
readonly UserWithOptionalNickname: RegExp;
|
||||
/**
|
||||
* Regular expression for matching a channel mention
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
readonly Channel: RegExp;
|
||||
/**
|
||||
* Regular expression for matching a role mention
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
readonly Role: RegExp;
|
||||
/**
|
||||
* Regular expression for matching a application command mention
|
||||
*
|
||||
* The `fullName` (possibly including `name`, `subcommandOrGroup` and `subcommand`) and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
readonly SlashCommand: RegExp;
|
||||
/**
|
||||
* Regular expression for matching a custom emoji, either static or animated
|
||||
*
|
||||
* The `animated`, `name` and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
readonly Emoji: RegExp;
|
||||
/**
|
||||
* Regular expression for matching strictly an animated custom emoji
|
||||
*
|
||||
* The `animated`, `name` and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
readonly AnimatedEmoji: RegExp;
|
||||
/**
|
||||
* Regular expression for matching strictly a static custom emoji
|
||||
*
|
||||
* The `name` and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
readonly StaticEmoji: RegExp;
|
||||
/**
|
||||
* Regular expression for matching a timestamp, either default or custom styled
|
||||
*
|
||||
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
readonly Timestamp: RegExp;
|
||||
/**
|
||||
* Regular expression for matching strictly default styled timestamps
|
||||
*
|
||||
* The `timestamp` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
readonly DefaultStyledTimestamp: RegExp;
|
||||
/**
|
||||
* Regular expression for matching strictly custom styled timestamps
|
||||
*
|
||||
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
readonly StyledTimestamp: RegExp;
|
||||
};
|
||||
//# sourceMappingURL=globals.d.ts.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/globals.d.ts.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/globals.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["globals.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,kBAAkB;IAC9B;;;;OAIG;;IAEH;;;;;;OAMG;;IAEH;;;;;;OAMG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAIH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAGH;;;;OAIG;;IAEH;;;;OAIG;;CAEM,CAAC"}
|
||||
94
node_modules/@discordjs/ws/node_modules/discord-api-types/globals.js
generated
vendored
Normal file
94
node_modules/@discordjs/ws/node_modules/discord-api-types/globals.js
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FormattingPatterns = void 0;
|
||||
/**
|
||||
* https://discord.com/developers/docs/reference#message-formatting-formats
|
||||
*/
|
||||
exports.FormattingPatterns = {
|
||||
/**
|
||||
* Regular expression for matching a user mention, strictly without a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
User: /<@(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a user mention, strictly with a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*
|
||||
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
|
||||
*/
|
||||
UserWithNickname: /<@!(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a user mention, with or without a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*
|
||||
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
|
||||
*/
|
||||
UserWithOptionalNickname: /<@!?(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a channel mention
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
Channel: /<#(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a role mention
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
Role: /<@&(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a application command mention
|
||||
*
|
||||
* The `fullName` (possibly including `name`, `subcommandOrGroup` and `subcommand`) and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
SlashCommand:
|
||||
// eslint-disable-next-line unicorn/no-unsafe-regex
|
||||
/<\/(?<fullName>(?<name>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32})(?: (?<subcommandOrGroup>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?(?: (?<subcommand>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?):(?<id>\d{17,20})>/u,
|
||||
/**
|
||||
* Regular expression for matching a custom emoji, either static or animated
|
||||
*
|
||||
* The `animated`, `name` and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
Emoji: /<(?<animated>a)?:(?<name>\w{2,32}):(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching strictly an animated custom emoji
|
||||
*
|
||||
* The `animated`, `name` and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
AnimatedEmoji: /<(?<animated>a):(?<name>\w{2,32}):(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching strictly a static custom emoji
|
||||
*
|
||||
* The `name` and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
StaticEmoji: /<:(?<name>\w{2,32}):(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a timestamp, either default or custom styled
|
||||
*
|
||||
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
// eslint-disable-next-line prefer-named-capture-group
|
||||
Timestamp: /<t:(?<timestamp>-?\d{1,13})(:(?<style>[DFRTdft]))?>/,
|
||||
/**
|
||||
* Regular expression for matching strictly default styled timestamps
|
||||
*
|
||||
* The `timestamp` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
DefaultStyledTimestamp: /<t:(?<timestamp>-?\d{1,13})>/,
|
||||
/**
|
||||
* Regular expression for matching strictly custom styled timestamps
|
||||
*
|
||||
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
StyledTimestamp: /<t:(?<timestamp>-?\d{1,13}):(?<style>[DFRTdft])>/,
|
||||
};
|
||||
/**
|
||||
* Freezes the formatting patterns
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
Object.freeze(exports.FormattingPatterns);
|
||||
//# sourceMappingURL=globals.js.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/globals.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/globals.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"globals.js","sourceRoot":"","sources":["globals.ts"],"names":[],"mappings":";;;AAYA;;GAEG;AACU,QAAA,kBAAkB,GAAG;IACjC;;;;OAIG;IACH,IAAI,EAAE,qBAAqB;IAC3B;;;;;;OAMG;IACH,gBAAgB,EAAE,sBAAsB;IACxC;;;;;;OAMG;IACH,wBAAwB,EAAE,uBAAuB;IACjD;;;;OAIG;IACH,OAAO,EAAE,qBAAqB;IAC9B;;;;OAIG;IACH,IAAI,EAAE,sBAAsB;IAC5B;;;;OAIG;IACH,YAAY;IACX,mDAAmD;IACnD,2PAA2P;IAC5P;;;;OAIG;IACH,KAAK,EAAE,sDAAsD;IAC7D;;;;OAIG;IACH,aAAa,EAAE,qDAAqD;IACpE;;;;OAIG;IACH,WAAW,EAAE,uCAAuC;IACpD;;;;OAIG;IACH,sDAAsD;IACtD,SAAS,EAAE,qDAAqD;IAChE;;;;OAIG;IACH,sBAAsB,EAAE,8BAA8B;IACtD;;;;OAIG;IACH,eAAe,EAAE,kDAAkD;CAC1D,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,CAAC,0BAAkB,CAAC,CAAC"}
|
||||
4
node_modules/@discordjs/ws/node_modules/discord-api-types/globals.mjs
generated
vendored
Normal file
4
node_modules/@discordjs/ws/node_modules/discord-api-types/globals.mjs
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import mod from "./globals.js";
|
||||
|
||||
export default mod;
|
||||
export const FormattingPatterns = mod.FormattingPatterns;
|
||||
204
node_modules/@discordjs/ws/node_modules/discord-api-types/package.json
generated
vendored
Normal file
204
node_modules/@discordjs/ws/node_modules/discord-api-types/package.json
generated
vendored
Normal file
@@ -0,0 +1,204 @@
|
||||
{
|
||||
"name": "discord-api-types",
|
||||
"version": "0.37.83",
|
||||
"description": "Discord API typings that are kept up to date for use in bot library creation.",
|
||||
"homepage": "https://discord-api-types.dev",
|
||||
"exports": {
|
||||
"./globals": {
|
||||
"types": "./globals.d.ts",
|
||||
"require": "./globals.js",
|
||||
"import": "./globals.mjs"
|
||||
},
|
||||
"./v6": {
|
||||
"types": "./v6.d.ts",
|
||||
"require": "./v6.js",
|
||||
"import": "./v6.mjs"
|
||||
},
|
||||
"./v8": {
|
||||
"types": "./v8.d.ts",
|
||||
"require": "./v8.js",
|
||||
"import": "./v8.mjs"
|
||||
},
|
||||
"./v9": {
|
||||
"types": "./v9.d.ts",
|
||||
"require": "./v9.js",
|
||||
"import": "./v9.mjs"
|
||||
},
|
||||
"./v10": {
|
||||
"types": "./v10.d.ts",
|
||||
"require": "./v10.js",
|
||||
"import": "./v10.mjs"
|
||||
},
|
||||
"./gateway": {
|
||||
"types": "./gateway/index.d.ts",
|
||||
"require": "./gateway/index.js",
|
||||
"import": "./gateway/index.mjs"
|
||||
},
|
||||
"./gateway/v*": {
|
||||
"types": "./gateway/v*.d.ts",
|
||||
"require": "./gateway/v*.js",
|
||||
"import": "./gateway/v*.mjs"
|
||||
},
|
||||
"./payloads": {
|
||||
"types": "./payloads/index.d.ts",
|
||||
"require": "./payloads/index.js",
|
||||
"import": "./payloads/index.mjs"
|
||||
},
|
||||
"./payloads/v*": {
|
||||
"types": "./payloads/v*/index.d.ts",
|
||||
"require": "./payloads/v*/index.js",
|
||||
"import": "./payloads/v*/index.mjs"
|
||||
},
|
||||
"./rest": {
|
||||
"types": "./rest/index.d.ts",
|
||||
"require": "./rest/index.js",
|
||||
"import": "./rest/index.mjs"
|
||||
},
|
||||
"./rest/v*": {
|
||||
"types": "./rest/v*/index.d.ts",
|
||||
"require": "./rest/v*/index.js",
|
||||
"import": "./rest/v*/index.mjs"
|
||||
},
|
||||
"./rpc": {
|
||||
"types": "./rpc/index.d.ts",
|
||||
"require": "./rpc/index.js",
|
||||
"import": "./rpc/index.mjs"
|
||||
},
|
||||
"./rpc/v*": {
|
||||
"types": "./rpc/v*.d.ts",
|
||||
"require": "./rpc/v*.js",
|
||||
"import": "./rpc/v*.mjs"
|
||||
},
|
||||
"./voice": {
|
||||
"types": "./voice/index.d.ts",
|
||||
"require": "./voice/index.js",
|
||||
"import": "./voice/index.mjs"
|
||||
},
|
||||
"./voice/v*": {
|
||||
"types": "./voice/v*.d.ts",
|
||||
"require": "./voice/v*.js",
|
||||
"import": "./voice/v*.mjs"
|
||||
},
|
||||
"./utils": {
|
||||
"types": "./utils/index.d.ts",
|
||||
"require": "./utils/index.js",
|
||||
"import": "./utils/index.mjs"
|
||||
},
|
||||
"./utils/v*": {
|
||||
"types": "./utils/v*.d.ts",
|
||||
"require": "./utils/v*.js",
|
||||
"import": "./utils/v*.mjs"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build:ci": "tsc --noEmit --incremental false",
|
||||
"build:deno": "node ./scripts/deno.mjs",
|
||||
"build:node": "tsc && run-p esm:*",
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
||||
"ci:pr": "run-s changelog lint build:deno && node ./scripts/bump-website-version.mjs",
|
||||
"clean:deno": "rimraf deno/",
|
||||
"clean:node": "rimraf --glob \"{gateway,payloads,rest,rpc,voice,utils}/**/*.{js,mjs,d.ts,*map}\" \"{globals,v*}.{js,mjs,d.ts,*map}\"",
|
||||
"clean": "run-p clean:*",
|
||||
"esm:gateway": "gen-esm-wrapper ./gateway/index.js ./gateway/index.mjs",
|
||||
"esm:globals": "gen-esm-wrapper ./globals.js ./globals.mjs",
|
||||
"esm:payloads": "gen-esm-wrapper ./payloads/index.js ./payloads/index.mjs",
|
||||
"esm:rest": "gen-esm-wrapper ./rest/index.js ./rest/index.mjs",
|
||||
"esm:rpc": "gen-esm-wrapper ./rpc/index.js ./rpc/index.mjs",
|
||||
"esm:utils": "gen-esm-wrapper ./utils/index.js ./utils/index.mjs",
|
||||
"esm:versions": "node ./scripts/versions.mjs",
|
||||
"esm:voice": "gen-esm-wrapper ./voice/index.js ./voice/index.mjs",
|
||||
"lint": "prettier --write . && eslint --fix --ext mjs,ts \"{gateway,payloads,rest,rpc,voice,utils}/**/*.ts\" \"{globals,v*}.ts\" \"scripts/**/*.mjs\"",
|
||||
"postpublish": "run-s clean:node build:deno",
|
||||
"prepare": "tsc -p ./.eslint-plugin-local && (is-ci || husky)",
|
||||
"prepublishOnly": "run-s clean test:lint build:node",
|
||||
"test:lint": "prettier --check . && eslint --ext mjs,ts \"{gateway,payloads,rest,rpc,voice,utils}/**/*.ts\" \"{globals,v*}.ts\" \"scripts/**/*.mjs\"",
|
||||
"pretest:types": "tsc",
|
||||
"test:types": "tsd -t ./v10.d.ts",
|
||||
"posttest:types": "npm run clean:node"
|
||||
},
|
||||
"keywords": [
|
||||
"discord",
|
||||
"discord api",
|
||||
"types",
|
||||
"discordjs"
|
||||
],
|
||||
"author": "Vlad Frangu <kingdgrizzle@gmail.com>",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"{gateway,payloads,rest,rpc,voice,utils}/**/*.{js,js.map,d.ts,d.ts.map,mjs}",
|
||||
"{globals,v*}.{js,js.map,d.ts,d.ts.map,mjs}"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^19.0.3",
|
||||
"@commitlint/config-angular": "^19.0.3",
|
||||
"@favware/npm-deprecate": "^1.0.7",
|
||||
"@octokit/action": "^6.0.7",
|
||||
"@octokit/webhooks-types": "^7.3.2",
|
||||
"@sapphire/prettier-config": "^2.0.0",
|
||||
"@types/conventional-recommended-bump": "^9.0.3",
|
||||
"@types/node": "^20.11.24",
|
||||
"@typescript-eslint/utils": "^7.1.1",
|
||||
"conventional-changelog-cli": "^4.1.0",
|
||||
"conventional-recommended-bump": "^9.0.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-neon": "^0.1.59",
|
||||
"eslint-import-resolver-typescript": "^3.6.1",
|
||||
"eslint-plugin-local": "^4.2.1",
|
||||
"gen-esm-wrapper": "^1.1.3",
|
||||
"husky": "^9.0.11",
|
||||
"is-ci": "^3.0.1",
|
||||
"lint-staged": "^15.2.2",
|
||||
"npm-run-all2": "^6.0.0",
|
||||
"prettier": "^3.2.5",
|
||||
"pretty-quick": "^4.0.0",
|
||||
"rimraf": "^5.0.5",
|
||||
"tsd": "^0.31.0",
|
||||
"tsutils": "^3.21.0",
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"publishConfig": {
|
||||
"provenance": true
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/discordjs/discord-api-types"
|
||||
},
|
||||
"lint-staged": {
|
||||
"{gateway,payloads,rest,rpc,voice,utils}/**/*.{mjs,js,ts}": "eslint --fix --ext mjs,js,ts",
|
||||
"{globals,v*}.ts": "eslint --fix --ext mjs,js,ts"
|
||||
},
|
||||
"commitlint": {
|
||||
"extends": [
|
||||
"@commitlint/config-angular"
|
||||
],
|
||||
"rules": {
|
||||
"type-enum": [
|
||||
2,
|
||||
"always",
|
||||
[
|
||||
"chore",
|
||||
"build",
|
||||
"ci",
|
||||
"docs",
|
||||
"feat",
|
||||
"fix",
|
||||
"perf",
|
||||
"refactor",
|
||||
"revert",
|
||||
"style",
|
||||
"test",
|
||||
"types",
|
||||
"wip"
|
||||
]
|
||||
],
|
||||
"scope-case": [
|
||||
1,
|
||||
"always",
|
||||
"pascal-case"
|
||||
]
|
||||
}
|
||||
},
|
||||
"tsd": {
|
||||
"directory": "tests"
|
||||
}
|
||||
}
|
||||
326
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/common.d.ts
generated
vendored
Normal file
326
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/common.d.ts
generated
vendored
Normal file
@@ -0,0 +1,326 @@
|
||||
import type { LocaleString } from '../rest/common';
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
|
||||
*
|
||||
* These flags are exported as `BigInt`s and NOT numbers. Wrapping them in `Number()`
|
||||
* may cause issues, try to use BigInts as much as possible or modules that can
|
||||
* replicate them in some way
|
||||
*/
|
||||
export declare const PermissionFlagsBits: {
|
||||
/**
|
||||
* Allows creation of instant invites
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly CreateInstantInvite: bigint;
|
||||
/**
|
||||
* Allows kicking members
|
||||
*/
|
||||
readonly KickMembers: bigint;
|
||||
/**
|
||||
* Allows banning members
|
||||
*/
|
||||
readonly BanMembers: bigint;
|
||||
/**
|
||||
* Allows all permissions and bypasses channel permission overwrites
|
||||
*/
|
||||
readonly Administrator: bigint;
|
||||
/**
|
||||
* Allows management and editing of channels
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly ManageChannels: bigint;
|
||||
/**
|
||||
* Allows management and editing of the guild
|
||||
*/
|
||||
readonly ManageGuild: bigint;
|
||||
/**
|
||||
* Allows for the addition of reactions to messages
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly AddReactions: bigint;
|
||||
/**
|
||||
* Allows for viewing of audit logs
|
||||
*/
|
||||
readonly ViewAuditLog: bigint;
|
||||
/**
|
||||
* Allows for using priority speaker in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
readonly PrioritySpeaker: bigint;
|
||||
/**
|
||||
* Allows the user to go live
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
readonly Stream: bigint;
|
||||
/**
|
||||
* Allows guild members to view a channel, which includes reading messages in text channels and joining voice channels
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly ViewChannel: bigint;
|
||||
/**
|
||||
* Allows for sending messages in a channel and creating threads in a forum
|
||||
* (does not allow sending messages in threads)
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly SendMessages: bigint;
|
||||
/**
|
||||
* Allows for sending of `/tts` messages
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly SendTTSMessages: bigint;
|
||||
/**
|
||||
* Allows for deletion of other users messages
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly ManageMessages: bigint;
|
||||
/**
|
||||
* Links sent by users with this permission will be auto-embedded
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly EmbedLinks: bigint;
|
||||
/**
|
||||
* Allows for uploading images and files
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly AttachFiles: bigint;
|
||||
/**
|
||||
* Allows for reading of message history
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly ReadMessageHistory: bigint;
|
||||
/**
|
||||
* Allows for using the `@everyone` tag to notify all users in a channel,
|
||||
* and the `@here` tag to notify all online users in a channel
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly MentionEveryone: bigint;
|
||||
/**
|
||||
* Allows the usage of custom emojis from other servers
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly UseExternalEmojis: bigint;
|
||||
/**
|
||||
* Allows for viewing guild insights
|
||||
*/
|
||||
readonly ViewGuildInsights: bigint;
|
||||
/**
|
||||
* Allows for joining of a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
readonly Connect: bigint;
|
||||
/**
|
||||
* Allows for speaking in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
readonly Speak: bigint;
|
||||
/**
|
||||
* Allows for muting members in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
readonly MuteMembers: bigint;
|
||||
/**
|
||||
* Allows for deafening of members in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
readonly DeafenMembers: bigint;
|
||||
/**
|
||||
* Allows for moving of members between voice channels
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
readonly MoveMembers: bigint;
|
||||
/**
|
||||
* Allows for using voice-activity-detection in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
readonly UseVAD: bigint;
|
||||
/**
|
||||
* Allows for modification of own nickname
|
||||
*/
|
||||
readonly ChangeNickname: bigint;
|
||||
/**
|
||||
* Allows for modification of other users nicknames
|
||||
*/
|
||||
readonly ManageNicknames: bigint;
|
||||
/**
|
||||
* Allows management and editing of roles
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly ManageRoles: bigint;
|
||||
/**
|
||||
* Allows management and editing of webhooks
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly ManageWebhooks: bigint;
|
||||
/**
|
||||
* Allows management and editing of emojis, stickers, and soundboard sounds
|
||||
*
|
||||
* @deprecated This is the old name for {@apilink PermissionFlagsBits#ManageGuildExpressions}
|
||||
*/
|
||||
readonly ManageEmojisAndStickers: bigint;
|
||||
/**
|
||||
* Allows for editing and deleting emojis, stickers, and soundboard sounds created by all users
|
||||
*/
|
||||
readonly ManageGuildExpressions: bigint;
|
||||
/**
|
||||
* Allows members to use application commands, including slash commands and context menu commands
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly UseApplicationCommands: bigint;
|
||||
/**
|
||||
* Allows for requesting to speak in stage channels
|
||||
*
|
||||
* Applies to channel types: Stage
|
||||
*/
|
||||
readonly RequestToSpeak: bigint;
|
||||
/**
|
||||
* Allows for editing and deleting scheduled events created by all users
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
readonly ManageEvents: bigint;
|
||||
/**
|
||||
* Allows for deleting and archiving threads, and viewing all private threads
|
||||
*
|
||||
* Applies to channel types: Text
|
||||
*/
|
||||
readonly ManageThreads: bigint;
|
||||
/**
|
||||
* Allows for creating public and announcement threads
|
||||
*
|
||||
* Applies to channel types: Text
|
||||
*/
|
||||
readonly CreatePublicThreads: bigint;
|
||||
/**
|
||||
* Allows for creating private threads
|
||||
*
|
||||
* Applies to channel types: Text
|
||||
*/
|
||||
readonly CreatePrivateThreads: bigint;
|
||||
/**
|
||||
* Allows the usage of custom stickers from other servers
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly UseExternalStickers: bigint;
|
||||
/**
|
||||
* Allows for sending messages in threads
|
||||
*
|
||||
* Applies to channel types: Text
|
||||
*/
|
||||
readonly SendMessagesInThreads: bigint;
|
||||
/**
|
||||
* Allows for using Activities (applications with the {@apilink ApplicationFlags.Embedded} flag) in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
readonly UseEmbeddedActivities: bigint;
|
||||
/**
|
||||
* Allows for timing out users to prevent them from sending or reacting to messages in chat and threads,
|
||||
* and from speaking in voice and stage channels
|
||||
*/
|
||||
readonly ModerateMembers: bigint;
|
||||
/**
|
||||
* Allows for viewing role subscription insights
|
||||
*/
|
||||
readonly ViewCreatorMonetizationAnalytics: bigint;
|
||||
/**
|
||||
* Allows for using soundboard in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
readonly UseSoundboard: bigint;
|
||||
/**
|
||||
* Allows for creating emojis, stickers, and soundboard sounds, and editing and deleting those created by the current user
|
||||
*/
|
||||
readonly CreateGuildExpressions: bigint;
|
||||
/**
|
||||
* Allows for creating scheduled events, and editing and deleting those created by the current user
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
readonly CreateEvents: bigint;
|
||||
/**
|
||||
* Allows the usage of custom soundboard sounds from other servers
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
readonly UseExternalSounds: bigint;
|
||||
/**
|
||||
* Allows sending voice messages
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly SendVoiceMessages: bigint;
|
||||
/**
|
||||
* Allows sending polls
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
readonly SendPolls: bigint;
|
||||
};
|
||||
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json
|
||||
*/
|
||||
export interface RESTError {
|
||||
code: number;
|
||||
message: string;
|
||||
errors?: RESTErrorData;
|
||||
}
|
||||
export interface RESTErrorFieldInformation {
|
||||
code: string;
|
||||
message: string;
|
||||
}
|
||||
export interface RESTErrorGroupWrapper {
|
||||
_errors: RESTErrorData[];
|
||||
}
|
||||
export type RESTErrorData = RESTErrorFieldInformation | RESTErrorGroupWrapper | string | {
|
||||
[k: string]: RESTErrorData;
|
||||
};
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit-rate-limit-response-structure
|
||||
*/
|
||||
export interface RESTRateLimit {
|
||||
/**
|
||||
* An error code for some limits
|
||||
*
|
||||
* {@link RESTJSONErrorCodes}
|
||||
*/
|
||||
code?: number;
|
||||
/**
|
||||
* A value indicating if you are being globally rate limited or not
|
||||
*/
|
||||
global: boolean;
|
||||
/**
|
||||
* A message saying you are being rate limited.
|
||||
*/
|
||||
message: string;
|
||||
/**
|
||||
* The number of seconds to wait before submitting another request.
|
||||
*/
|
||||
retry_after: number;
|
||||
}
|
||||
//# sourceMappingURL=common.d.ts.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/common.d.ts.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/common.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;IAC/B;;;;OAIG;;IAEH;;OAEG;;IAGH;;OAEG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;;OAKG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;;OAKG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;CAEM,CAAC;AASX,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,MAAM,WAAW,yBAAyB;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACrC,OAAO,EAAE,aAAa,EAAE,CAAC;CACzB;AAED,MAAM,MAAM,aAAa,GAAG,yBAAyB,GAAG,qBAAqB,GAAG,MAAM,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,CAAC;AAExH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACpB"}
|
||||
293
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/common.js
generated
vendored
Normal file
293
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/common.js
generated
vendored
Normal file
@@ -0,0 +1,293 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.PermissionFlagsBits = void 0;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
|
||||
*
|
||||
* These flags are exported as `BigInt`s and NOT numbers. Wrapping them in `Number()`
|
||||
* may cause issues, try to use BigInts as much as possible or modules that can
|
||||
* replicate them in some way
|
||||
*/
|
||||
exports.PermissionFlagsBits = {
|
||||
/**
|
||||
* Allows creation of instant invites
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
CreateInstantInvite: 1n << 0n,
|
||||
/**
|
||||
* Allows kicking members
|
||||
*/
|
||||
// eslint-disable-next-line sonarjs/no-identical-expressions
|
||||
KickMembers: 1n << 1n,
|
||||
/**
|
||||
* Allows banning members
|
||||
*/
|
||||
BanMembers: 1n << 2n,
|
||||
/**
|
||||
* Allows all permissions and bypasses channel permission overwrites
|
||||
*/
|
||||
Administrator: 1n << 3n,
|
||||
/**
|
||||
* Allows management and editing of channels
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
ManageChannels: 1n << 4n,
|
||||
/**
|
||||
* Allows management and editing of the guild
|
||||
*/
|
||||
ManageGuild: 1n << 5n,
|
||||
/**
|
||||
* Allows for the addition of reactions to messages
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
AddReactions: 1n << 6n,
|
||||
/**
|
||||
* Allows for viewing of audit logs
|
||||
*/
|
||||
ViewAuditLog: 1n << 7n,
|
||||
/**
|
||||
* Allows for using priority speaker in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
PrioritySpeaker: 1n << 8n,
|
||||
/**
|
||||
* Allows the user to go live
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
Stream: 1n << 9n,
|
||||
/**
|
||||
* Allows guild members to view a channel, which includes reading messages in text channels and joining voice channels
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
ViewChannel: 1n << 10n,
|
||||
/**
|
||||
* Allows for sending messages in a channel and creating threads in a forum
|
||||
* (does not allow sending messages in threads)
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendMessages: 1n << 11n,
|
||||
/**
|
||||
* Allows for sending of `/tts` messages
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendTTSMessages: 1n << 12n,
|
||||
/**
|
||||
* Allows for deletion of other users messages
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
ManageMessages: 1n << 13n,
|
||||
/**
|
||||
* Links sent by users with this permission will be auto-embedded
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
EmbedLinks: 1n << 14n,
|
||||
/**
|
||||
* Allows for uploading images and files
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
AttachFiles: 1n << 15n,
|
||||
/**
|
||||
* Allows for reading of message history
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
ReadMessageHistory: 1n << 16n,
|
||||
/**
|
||||
* Allows for using the `@everyone` tag to notify all users in a channel,
|
||||
* and the `@here` tag to notify all online users in a channel
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
MentionEveryone: 1n << 17n,
|
||||
/**
|
||||
* Allows the usage of custom emojis from other servers
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
UseExternalEmojis: 1n << 18n,
|
||||
/**
|
||||
* Allows for viewing guild insights
|
||||
*/
|
||||
ViewGuildInsights: 1n << 19n,
|
||||
/**
|
||||
* Allows for joining of a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
Connect: 1n << 20n,
|
||||
/**
|
||||
* Allows for speaking in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
Speak: 1n << 21n,
|
||||
/**
|
||||
* Allows for muting members in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
MuteMembers: 1n << 22n,
|
||||
/**
|
||||
* Allows for deafening of members in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
DeafenMembers: 1n << 23n,
|
||||
/**
|
||||
* Allows for moving of members between voice channels
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
MoveMembers: 1n << 24n,
|
||||
/**
|
||||
* Allows for using voice-activity-detection in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
UseVAD: 1n << 25n,
|
||||
/**
|
||||
* Allows for modification of own nickname
|
||||
*/
|
||||
ChangeNickname: 1n << 26n,
|
||||
/**
|
||||
* Allows for modification of other users nicknames
|
||||
*/
|
||||
ManageNicknames: 1n << 27n,
|
||||
/**
|
||||
* Allows management and editing of roles
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
ManageRoles: 1n << 28n,
|
||||
/**
|
||||
* Allows management and editing of webhooks
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
ManageWebhooks: 1n << 29n,
|
||||
/**
|
||||
* Allows management and editing of emojis, stickers, and soundboard sounds
|
||||
*
|
||||
* @deprecated This is the old name for {@apilink PermissionFlagsBits#ManageGuildExpressions}
|
||||
*/
|
||||
ManageEmojisAndStickers: 1n << 30n,
|
||||
/**
|
||||
* Allows for editing and deleting emojis, stickers, and soundboard sounds created by all users
|
||||
*/
|
||||
ManageGuildExpressions: 1n << 30n,
|
||||
/**
|
||||
* Allows members to use application commands, including slash commands and context menu commands
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
UseApplicationCommands: 1n << 31n,
|
||||
/**
|
||||
* Allows for requesting to speak in stage channels
|
||||
*
|
||||
* Applies to channel types: Stage
|
||||
*/
|
||||
RequestToSpeak: 1n << 32n,
|
||||
/**
|
||||
* Allows for editing and deleting scheduled events created by all users
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
ManageEvents: 1n << 33n,
|
||||
/**
|
||||
* Allows for deleting and archiving threads, and viewing all private threads
|
||||
*
|
||||
* Applies to channel types: Text
|
||||
*/
|
||||
ManageThreads: 1n << 34n,
|
||||
/**
|
||||
* Allows for creating public and announcement threads
|
||||
*
|
||||
* Applies to channel types: Text
|
||||
*/
|
||||
CreatePublicThreads: 1n << 35n,
|
||||
/**
|
||||
* Allows for creating private threads
|
||||
*
|
||||
* Applies to channel types: Text
|
||||
*/
|
||||
CreatePrivateThreads: 1n << 36n,
|
||||
/**
|
||||
* Allows the usage of custom stickers from other servers
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
UseExternalStickers: 1n << 37n,
|
||||
/**
|
||||
* Allows for sending messages in threads
|
||||
*
|
||||
* Applies to channel types: Text
|
||||
*/
|
||||
SendMessagesInThreads: 1n << 38n,
|
||||
/**
|
||||
* Allows for using Activities (applications with the {@apilink ApplicationFlags.Embedded} flag) in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
UseEmbeddedActivities: 1n << 39n,
|
||||
/**
|
||||
* Allows for timing out users to prevent them from sending or reacting to messages in chat and threads,
|
||||
* and from speaking in voice and stage channels
|
||||
*/
|
||||
ModerateMembers: 1n << 40n,
|
||||
/**
|
||||
* Allows for viewing role subscription insights
|
||||
*/
|
||||
ViewCreatorMonetizationAnalytics: 1n << 41n,
|
||||
/**
|
||||
* Allows for using soundboard in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
UseSoundboard: 1n << 42n,
|
||||
/**
|
||||
* Allows for creating emojis, stickers, and soundboard sounds, and editing and deleting those created by the current user
|
||||
*/
|
||||
CreateGuildExpressions: 1n << 43n,
|
||||
/**
|
||||
* Allows for creating scheduled events, and editing and deleting those created by the current user
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
CreateEvents: 1n << 44n,
|
||||
/**
|
||||
* Allows the usage of custom soundboard sounds from other servers
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
UseExternalSounds: 1n << 45n,
|
||||
/**
|
||||
* Allows sending voice messages
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendVoiceMessages: 1n << 46n,
|
||||
/**
|
||||
* Allows sending polls
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendPolls: 1n << 49n,
|
||||
};
|
||||
/**
|
||||
* Freeze the object of bits, preventing any modifications to it
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
Object.freeze(exports.PermissionFlagsBits);
|
||||
//# sourceMappingURL=common.js.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/common.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/common.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"common.js","sourceRoot":"","sources":["common.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACU,QAAA,mBAAmB,GAAG;IAClC;;;;OAIG;IACH,mBAAmB,EAAE,EAAE,IAAI,EAAE;IAC7B;;OAEG;IACH,4DAA4D;IAC5D,WAAW,EAAE,EAAE,IAAI,EAAE;IACrB;;OAEG;IACH,UAAU,EAAE,EAAE,IAAI,EAAE;IACpB;;OAEG;IACH,aAAa,EAAE,EAAE,IAAI,EAAE;IACvB;;;;OAIG;IACH,cAAc,EAAE,EAAE,IAAI,EAAE;IACxB;;OAEG;IACH,WAAW,EAAE,EAAE,IAAI,EAAE;IACrB;;;;OAIG;IACH,YAAY,EAAE,EAAE,IAAI,EAAE;IACtB;;OAEG;IACH,YAAY,EAAE,EAAE,IAAI,EAAE;IACtB;;;;OAIG;IACH,eAAe,EAAE,EAAE,IAAI,EAAE;IACzB;;;;OAIG;IACH,MAAM,EAAE,EAAE,IAAI,EAAE;IAChB;;;;OAIG;IACH,WAAW,EAAE,EAAE,IAAI,GAAG;IACtB;;;;;OAKG;IACH,YAAY,EAAE,EAAE,IAAI,GAAG;IACvB;;;;OAIG;IACH,eAAe,EAAE,EAAE,IAAI,GAAG;IAC1B;;;;OAIG;IACH,cAAc,EAAE,EAAE,IAAI,GAAG;IACzB;;;;OAIG;IACH,UAAU,EAAE,EAAE,IAAI,GAAG;IACrB;;;;OAIG;IACH,WAAW,EAAE,EAAE,IAAI,GAAG;IACtB;;;;OAIG;IACH,kBAAkB,EAAE,EAAE,IAAI,GAAG;IAC7B;;;;;OAKG;IACH,eAAe,EAAE,EAAE,IAAI,GAAG;IAC1B;;;;OAIG;IACH,iBAAiB,EAAE,EAAE,IAAI,GAAG;IAC5B;;OAEG;IACH,iBAAiB,EAAE,EAAE,IAAI,GAAG;IAC5B;;;;OAIG;IACH,OAAO,EAAE,EAAE,IAAI,GAAG;IAClB;;;;OAIG;IACH,KAAK,EAAE,EAAE,IAAI,GAAG;IAChB;;;;OAIG;IACH,WAAW,EAAE,EAAE,IAAI,GAAG;IACtB;;;;OAIG;IACH,aAAa,EAAE,EAAE,IAAI,GAAG;IACxB;;;;OAIG;IACH,WAAW,EAAE,EAAE,IAAI,GAAG;IACtB;;;;OAIG;IACH,MAAM,EAAE,EAAE,IAAI,GAAG;IACjB;;OAEG;IACH,cAAc,EAAE,EAAE,IAAI,GAAG;IACzB;;OAEG;IACH,eAAe,EAAE,EAAE,IAAI,GAAG;IAC1B;;;;OAIG;IACH,WAAW,EAAE,EAAE,IAAI,GAAG;IACtB;;;;OAIG;IACH,cAAc,EAAE,EAAE,IAAI,GAAG;IACzB;;;;OAIG;IACH,uBAAuB,EAAE,EAAE,IAAI,GAAG;IAClC;;OAEG;IACH,sBAAsB,EAAE,EAAE,IAAI,GAAG;IACjC;;;;OAIG;IACH,sBAAsB,EAAE,EAAE,IAAI,GAAG;IACjC;;;;OAIG;IACH,cAAc,EAAE,EAAE,IAAI,GAAG;IACzB;;;;OAIG;IACH,YAAY,EAAE,EAAE,IAAI,GAAG;IACvB;;;;OAIG;IACH,aAAa,EAAE,EAAE,IAAI,GAAG;IACxB;;;;OAIG;IACH,mBAAmB,EAAE,EAAE,IAAI,GAAG;IAC9B;;;;OAIG;IACH,oBAAoB,EAAE,EAAE,IAAI,GAAG;IAC/B;;;;OAIG;IACH,mBAAmB,EAAE,EAAE,IAAI,GAAG;IAC9B;;;;OAIG;IACH,qBAAqB,EAAE,EAAE,IAAI,GAAG;IAChC;;;;OAIG;IACH,qBAAqB,EAAE,EAAE,IAAI,GAAG;IAChC;;;OAGG;IACH,eAAe,EAAE,EAAE,IAAI,GAAG;IAC1B;;OAEG;IACH,gCAAgC,EAAE,EAAE,IAAI,GAAG;IAC3C;;;;OAIG;IACH,aAAa,EAAE,EAAE,IAAI,GAAG;IACxB;;OAEG;IACH,sBAAsB,EAAE,EAAE,IAAI,GAAG;IACjC;;;;OAIG;IACH,YAAY,EAAE,EAAE,IAAI,GAAG;IACvB;;;;OAIG;IACH,iBAAiB,EAAE,EAAE,IAAI,GAAG;IAC5B;;;;OAIG;IACH,iBAAiB,EAAE,EAAE,IAAI,GAAG;IAC5B;;;;OAIG;IACH,SAAS,EAAE,EAAE,IAAI,GAAG;CACX,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,CAAC,2BAAmB,CAAC,CAAC"}
|
||||
2
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/index.d.ts
generated
vendored
Normal file
2
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './v10/index';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/index.d.ts.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAGA,cAAc,aAAa,CAAC"}
|
||||
20
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/index.js
generated
vendored
Normal file
20
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/index.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
// This file exports all the payloads available in the recommended API version
|
||||
// Thereby, things MAY break in the future. Try sticking to imports from a specific version
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("./v10/index"), exports);
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/index.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,2FAA2F;;;;;;;;;;;;;;;;AAE3F,8CAA4B"}
|
||||
76
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/index.mjs
generated
vendored
Normal file
76
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
import mod from "./index.js";
|
||||
|
||||
export default mod;
|
||||
export const APIApplicationCommandPermissionsConstant = mod.APIApplicationCommandPermissionsConstant;
|
||||
export const ActivityFlags = mod.ActivityFlags;
|
||||
export const ActivityPlatform = mod.ActivityPlatform;
|
||||
export const ActivityType = mod.ActivityType;
|
||||
export const AllowedMentionsTypes = mod.AllowedMentionsTypes;
|
||||
export const ApplicationCommandOptionType = mod.ApplicationCommandOptionType;
|
||||
export const ApplicationCommandPermissionType = mod.ApplicationCommandPermissionType;
|
||||
export const ApplicationCommandType = mod.ApplicationCommandType;
|
||||
export const ApplicationFlags = mod.ApplicationFlags;
|
||||
export const ApplicationRoleConnectionMetadataType = mod.ApplicationRoleConnectionMetadataType;
|
||||
export const AttachmentFlags = mod.AttachmentFlags;
|
||||
export const AuditLogEvent = mod.AuditLogEvent;
|
||||
export const AuditLogOptionsType = mod.AuditLogOptionsType;
|
||||
export const AutoModerationActionType = mod.AutoModerationActionType;
|
||||
export const AutoModerationRuleEventType = mod.AutoModerationRuleEventType;
|
||||
export const AutoModerationRuleKeywordPresetType = mod.AutoModerationRuleKeywordPresetType;
|
||||
export const AutoModerationRuleTriggerType = mod.AutoModerationRuleTriggerType;
|
||||
export const ButtonStyle = mod.ButtonStyle;
|
||||
export const ChannelFlags = mod.ChannelFlags;
|
||||
export const ChannelType = mod.ChannelType;
|
||||
export const ComponentType = mod.ComponentType;
|
||||
export const ConnectionService = mod.ConnectionService;
|
||||
export const ConnectionVisibility = mod.ConnectionVisibility;
|
||||
export const EmbedType = mod.EmbedType;
|
||||
export const EntitlementType = mod.EntitlementType;
|
||||
export const ForumLayoutType = mod.ForumLayoutType;
|
||||
export const GuildDefaultMessageNotifications = mod.GuildDefaultMessageNotifications;
|
||||
export const GuildExplicitContentFilter = mod.GuildExplicitContentFilter;
|
||||
export const GuildFeature = mod.GuildFeature;
|
||||
export const GuildHubType = mod.GuildHubType;
|
||||
export const GuildMFALevel = mod.GuildMFALevel;
|
||||
export const GuildMemberFlags = mod.GuildMemberFlags;
|
||||
export const GuildNSFWLevel = mod.GuildNSFWLevel;
|
||||
export const GuildOnboardingMode = mod.GuildOnboardingMode;
|
||||
export const GuildOnboardingPromptType = mod.GuildOnboardingPromptType;
|
||||
export const GuildPremiumTier = mod.GuildPremiumTier;
|
||||
export const GuildScheduledEventEntityType = mod.GuildScheduledEventEntityType;
|
||||
export const GuildScheduledEventPrivacyLevel = mod.GuildScheduledEventPrivacyLevel;
|
||||
export const GuildScheduledEventStatus = mod.GuildScheduledEventStatus;
|
||||
export const GuildSystemChannelFlags = mod.GuildSystemChannelFlags;
|
||||
export const GuildVerificationLevel = mod.GuildVerificationLevel;
|
||||
export const GuildWidgetStyle = mod.GuildWidgetStyle;
|
||||
export const IntegrationExpireBehavior = mod.IntegrationExpireBehavior;
|
||||
export const InteractionResponseType = mod.InteractionResponseType;
|
||||
export const InteractionType = mod.InteractionType;
|
||||
export const InviteTargetType = mod.InviteTargetType;
|
||||
export const InviteType = mod.InviteType;
|
||||
export const MembershipScreeningFieldType = mod.MembershipScreeningFieldType;
|
||||
export const MessageActivityType = mod.MessageActivityType;
|
||||
export const MessageFlags = mod.MessageFlags;
|
||||
export const MessageType = mod.MessageType;
|
||||
export const OAuth2Scopes = mod.OAuth2Scopes;
|
||||
export const OverwriteType = mod.OverwriteType;
|
||||
export const PermissionFlagsBits = mod.PermissionFlagsBits;
|
||||
export const PollLayoutType = mod.PollLayoutType;
|
||||
export const PresenceUpdateStatus = mod.PresenceUpdateStatus;
|
||||
export const RoleFlags = mod.RoleFlags;
|
||||
export const SKUFlags = mod.SKUFlags;
|
||||
export const SKUType = mod.SKUType;
|
||||
export const SelectMenuDefaultValueType = mod.SelectMenuDefaultValueType;
|
||||
export const SortOrderType = mod.SortOrderType;
|
||||
export const StageInstancePrivacyLevel = mod.StageInstancePrivacyLevel;
|
||||
export const StickerFormatType = mod.StickerFormatType;
|
||||
export const StickerType = mod.StickerType;
|
||||
export const TeamMemberMembershipState = mod.TeamMemberMembershipState;
|
||||
export const TeamMemberRole = mod.TeamMemberRole;
|
||||
export const TextInputStyle = mod.TextInputStyle;
|
||||
export const ThreadAutoArchiveDuration = mod.ThreadAutoArchiveDuration;
|
||||
export const ThreadMemberFlags = mod.ThreadMemberFlags;
|
||||
export const UserFlags = mod.UserFlags;
|
||||
export const UserPremiumType = mod.UserPremiumType;
|
||||
export const VideoQualityMode = mod.VideoQualityMode;
|
||||
export const WebhookType = mod.WebhookType;
|
||||
6
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/attachment.d.ts
generated
vendored
Normal file
6
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/attachment.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { Snowflake } from '../../../../../globals';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base';
|
||||
import type { ApplicationCommandOptionType } from './shared';
|
||||
export type APIApplicationCommandAttachmentOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;
|
||||
export type APIApplicationCommandInteractionDataAttachmentOption = APIInteractionDataOptionBase<ApplicationCommandOptionType.Attachment, Snowflake>;
|
||||
//# sourceMappingURL=attachment.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,+BAA+B,EAAE,4BAA4B,EAAE,MAAM,QAAQ,CAAC;AAC5F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAE7D,MAAM,MAAM,qCAAqC,GAChD,+BAA+B,CAAC,4BAA4B,CAAC,UAAU,CAAC,CAAC;AAE1E,MAAM,MAAM,oDAAoD,GAAG,4BAA4B,CAC9F,4BAA4B,CAAC,UAAU,EACvC,SAAS,CACT,CAAC"}
|
||||
3
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/attachment.js
generated
vendored
Normal file
3
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/attachment.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=attachment.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"attachment.js","sourceRoot":"","sources":["attachment.ts"],"names":[],"mappings":""}
|
||||
23
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts
generated
vendored
Normal file
23
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { LocalizationMap } from '../../../../../v10';
|
||||
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared';
|
||||
export interface APIApplicationCommandOptionBase<Type extends ApplicationCommandOptionType> {
|
||||
type: Type;
|
||||
name: string;
|
||||
name_localizations?: LocalizationMap | null;
|
||||
description: string;
|
||||
description_localizations?: LocalizationMap | null;
|
||||
required?: boolean;
|
||||
}
|
||||
export interface APIInteractionDataOptionBase<T extends ApplicationCommandOptionType, D> {
|
||||
name: string;
|
||||
type: T;
|
||||
value: D;
|
||||
}
|
||||
export type APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<Base extends APIApplicationCommandOptionBase<ApplicationCommandOptionType>, ChoiceType extends APIApplicationCommandOptionChoice> = (Base & {
|
||||
autocomplete: true;
|
||||
choices?: [];
|
||||
}) | (Base & {
|
||||
autocomplete?: false;
|
||||
choices?: ChoiceType[];
|
||||
});
|
||||
//# sourceMappingURL=base.d.ts.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,iCAAiC,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEhG,MAAM,WAAW,+BAA+B,CAAC,IAAI,SAAS,4BAA4B;IACzF,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B,CAAC,CAAC,SAAS,4BAA4B,EAAE,CAAC;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,CAAC,CAAC;CACT;AAED,MAAM,MAAM,2DAA2D,CACtE,IAAI,SAAS,+BAA+B,CAAC,4BAA4B,CAAC,EAC1E,UAAU,SAAS,iCAAiC,IAElD,CAAC,IAAI,GAAG;IACR,YAAY,EAAE,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,EAAE,CAAC;CACZ,CAAC,GACF,CAAC,IAAI,GAAG;IACR,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;CACtB,CAAC,CAAC"}
|
||||
3
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.js
generated
vendored
Normal file
3
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=base.js.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"base.js","sourceRoot":"","sources":["base.ts"],"names":[],"mappings":""}
|
||||
5
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/boolean.d.ts
generated
vendored
Normal file
5
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/boolean.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base';
|
||||
import type { ApplicationCommandOptionType } from './shared';
|
||||
export type APIApplicationCommandBooleanOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Boolean>;
|
||||
export type APIApplicationCommandInteractionDataBooleanOption = APIInteractionDataOptionBase<ApplicationCommandOptionType.Boolean, boolean>;
|
||||
//# sourceMappingURL=boolean.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["boolean.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,4BAA4B,EAAE,MAAM,QAAQ,CAAC;AAC5F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAE7D,MAAM,MAAM,kCAAkC,GAAG,+BAA+B,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;AAEvH,MAAM,MAAM,iDAAiD,GAAG,4BAA4B,CAC3F,4BAA4B,CAAC,OAAO,EACpC,OAAO,CACP,CAAC"}
|
||||
3
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/boolean.js
generated
vendored
Normal file
3
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/boolean.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=boolean.js.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/boolean.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/boolean.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"boolean.js","sourceRoot":"","sources":["boolean.ts"],"names":[],"mappings":""}
|
||||
9
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/channel.d.ts
generated
vendored
Normal file
9
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/channel.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { Snowflake } from '../../../../../globals';
|
||||
import type { ChannelType } from '../../../channel';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base';
|
||||
import type { ApplicationCommandOptionType } from './shared';
|
||||
export interface APIApplicationCommandChannelOption extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Channel> {
|
||||
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
|
||||
}
|
||||
export type APIApplicationCommandInteractionDataChannelOption = APIInteractionDataOptionBase<ApplicationCommandOptionType.Channel, Snowflake>;
|
||||
//# sourceMappingURL=channel.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,+BAA+B,EAAE,4BAA4B,EAAE,MAAM,QAAQ,CAAC;AAC5F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAE7D,MAAM,WAAW,kCAChB,SAAQ,+BAA+B,CAAC,4BAA4B,CAAC,OAAO,CAAC;IAC7E,aAAa,CAAC,EAAE,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;CAC7E;AAED,MAAM,MAAM,iDAAiD,GAAG,4BAA4B,CAC3F,4BAA4B,CAAC,OAAO,EACpC,SAAS,CACT,CAAC"}
|
||||
3
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/channel.js
generated
vendored
Normal file
3
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/channel.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=channel.js.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/channel.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/channel.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"channel.js","sourceRoot":"","sources":["channel.ts"],"names":[],"mappings":""}
|
||||
18
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/integer.d.ts
generated
vendored
Normal file
18
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/integer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { APIApplicationCommandOptionBase, APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper, APIInteractionDataOptionBase } from './base';
|
||||
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared';
|
||||
interface APIApplicationCommandIntegerOptionBase extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Integer> {
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
|
||||
*/
|
||||
max_value?: number;
|
||||
}
|
||||
export type APIApplicationCommandIntegerOption = APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<APIApplicationCommandIntegerOptionBase, APIApplicationCommandOptionChoice<number>>;
|
||||
export interface APIApplicationCommandInteractionDataIntegerOption extends APIInteractionDataOptionBase<ApplicationCommandOptionType.Integer, number> {
|
||||
focused?: boolean;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=integer.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"integer.d.ts","sourceRoot":"","sources":["integer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,+BAA+B,EAC/B,2DAA2D,EAC3D,4BAA4B,EAC5B,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,EAAE,iCAAiC,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEhG,UAAU,sCACT,SAAQ,+BAA+B,CAAC,4BAA4B,CAAC,OAAO,CAAC;IAC7E;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,kCAAkC,GAAG,2DAA2D,CAC3G,sCAAsC,EACtC,iCAAiC,CAAC,MAAM,CAAC,CACzC,CAAC;AAEF,MAAM,WAAW,iDAChB,SAAQ,4BAA4B,CAAC,4BAA4B,CAAC,OAAO,EAAE,MAAM,CAAC;IAClF,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB"}
|
||||
3
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/integer.js
generated
vendored
Normal file
3
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/integer.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=integer.js.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/integer.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/integer.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"integer.js","sourceRoot":"","sources":["integer.ts"],"names":[],"mappings":""}
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { Snowflake } from '../../../../../globals';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base';
|
||||
import type { ApplicationCommandOptionType } from './shared';
|
||||
export type APIApplicationCommandMentionableOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Mentionable>;
|
||||
export type APIApplicationCommandInteractionDataMentionableOption = APIInteractionDataOptionBase<ApplicationCommandOptionType.Mentionable, Snowflake>;
|
||||
//# sourceMappingURL=mentionable.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"mentionable.d.ts","sourceRoot":"","sources":["mentionable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,+BAA+B,EAAE,4BAA4B,EAAE,MAAM,QAAQ,CAAC;AAC5F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAE7D,MAAM,MAAM,sCAAsC,GACjD,+BAA+B,CAAC,4BAA4B,CAAC,WAAW,CAAC,CAAC;AAE3E,MAAM,MAAM,qDAAqD,GAAG,4BAA4B,CAC/F,4BAA4B,CAAC,WAAW,EACxC,SAAS,CACT,CAAC"}
|
||||
3
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/mentionable.js
generated
vendored
Normal file
3
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/mentionable.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=mentionable.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"mentionable.js","sourceRoot":"","sources":["mentionable.ts"],"names":[],"mappings":""}
|
||||
18
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/number.d.ts
generated
vendored
Normal file
18
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/number.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { APIApplicationCommandOptionBase, APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper, APIInteractionDataOptionBase } from './base';
|
||||
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared';
|
||||
interface APIApplicationCommandNumberOptionBase extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Number> {
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
|
||||
*/
|
||||
max_value?: number;
|
||||
}
|
||||
export type APIApplicationCommandNumberOption = APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<APIApplicationCommandNumberOptionBase, APIApplicationCommandOptionChoice<number>>;
|
||||
export interface APIApplicationCommandInteractionDataNumberOption extends APIInteractionDataOptionBase<ApplicationCommandOptionType.Number, number> {
|
||||
focused?: boolean;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=number.d.ts.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/number.d.ts.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/number.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["number.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,+BAA+B,EAC/B,2DAA2D,EAC3D,4BAA4B,EAC5B,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,EAAE,iCAAiC,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEhG,UAAU,qCACT,SAAQ,+BAA+B,CAAC,4BAA4B,CAAC,MAAM,CAAC;IAC5E;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,iCAAiC,GAAG,2DAA2D,CAC1G,qCAAqC,EACrC,iCAAiC,CAAC,MAAM,CAAC,CACzC,CAAC;AAEF,MAAM,WAAW,gDAChB,SAAQ,4BAA4B,CAAC,4BAA4B,CAAC,MAAM,EAAE,MAAM,CAAC;IACjF,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB"}
|
||||
3
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/number.js
generated
vendored
Normal file
3
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/number.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=number.js.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/number.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/number.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"number.js","sourceRoot":"","sources":["number.ts"],"names":[],"mappings":""}
|
||||
6
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/role.d.ts
generated
vendored
Normal file
6
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/role.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { Snowflake } from '../../../../../globals';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base';
|
||||
import type { ApplicationCommandOptionType } from './shared';
|
||||
export type APIApplicationCommandRoleOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Role>;
|
||||
export type APIApplicationCommandInteractionDataRoleOption = APIInteractionDataOptionBase<ApplicationCommandOptionType.Role, Snowflake>;
|
||||
//# sourceMappingURL=role.d.ts.map
|
||||
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/role.d.ts.map
generated
vendored
Normal file
1
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/role.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"role.d.ts","sourceRoot":"","sources":["role.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,+BAA+B,EAAE,4BAA4B,EAAE,MAAM,QAAQ,CAAC;AAC5F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAE7D,MAAM,MAAM,+BAA+B,GAAG,+BAA+B,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC;AAEjH,MAAM,MAAM,8CAA8C,GAAG,4BAA4B,CACxF,4BAA4B,CAAC,IAAI,EACjC,SAAS,CACT,CAAC"}
|
||||
3
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/role.js
generated
vendored
Normal file
3
node_modules/@discordjs/ws/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/role.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=role.js.map
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user