oceanic.js 1.10.1-dev.97cef9c → 1.10.1-dev.9b37972
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +5 -5
- package/esm.mjs +2 -0
- package/package.json +5 -5
- package/dist/lib/Client.d.ts +0 -91
- package/dist/lib/Client.js +0 -254
- package/dist/lib/Constants.d.ts +0 -1121
- package/dist/lib/Constants.js +0 -1401
- package/dist/lib/gateway/Shard.d.ts +0 -77
- package/dist/lib/gateway/Shard.js +0 -1582
- package/dist/lib/gateway/ShardManager.d.ts +0 -26
- package/dist/lib/gateway/ShardManager.js +0 -304
- package/dist/lib/index.d.ts +0 -83
- package/dist/lib/index.js +0 -166
- package/dist/lib/rest/Bucket.d.ts +0 -33
- package/dist/lib/rest/Bucket.js +0 -78
- package/dist/lib/rest/DiscordHTTPError.d.ts +0 -16
- package/dist/lib/rest/DiscordHTTPError.js +0 -65
- package/dist/lib/rest/DiscordRESTError.d.ts +0 -19
- package/dist/lib/rest/DiscordRESTError.js +0 -89
- package/dist/lib/rest/OAuthHelper.d.ts +0 -60
- package/dist/lib/rest/OAuthHelper.js +0 -180
- package/dist/lib/rest/RESTManager.d.ts +0 -42
- package/dist/lib/rest/RESTManager.js +0 -82
- package/dist/lib/rest/RequestHandler.d.ts +0 -28
- package/dist/lib/rest/RequestHandler.js +0 -313
- package/dist/lib/rest/SequentialBucket.d.ts +0 -25
- package/dist/lib/rest/SequentialBucket.js +0 -76
- package/dist/lib/routes/Applications.d.ts +0 -171
- package/dist/lib/routes/Applications.js +0 -447
- package/dist/lib/routes/Channels.d.ts +0 -391
- package/dist/lib/routes/Channels.js +0 -1107
- package/dist/lib/routes/Guilds.d.ts +0 -606
- package/dist/lib/routes/Guilds.js +0 -1669
- package/dist/lib/routes/Interactions.d.ts +0 -74
- package/dist/lib/routes/Interactions.js +0 -141
- package/dist/lib/routes/Miscellaneous.d.ts +0 -25
- package/dist/lib/routes/Miscellaneous.js +0 -54
- package/dist/lib/routes/OAuth.d.ts +0 -105
- package/dist/lib/routes/OAuth.js +0 -309
- package/dist/lib/routes/Users.d.ts +0 -32
- package/dist/lib/routes/Users.js +0 -59
- package/dist/lib/routes/Webhooks.d.ts +0 -128
- package/dist/lib/routes/Webhooks.js +0 -264
- package/dist/lib/structures/AnnouncementChannel.d.ts +0 -36
- package/dist/lib/structures/AnnouncementChannel.js +0 -47
- package/dist/lib/structures/AnnouncementThreadChannel.d.ts +0 -18
- package/dist/lib/structures/AnnouncementThreadChannel.js +0 -27
- package/dist/lib/structures/Application.d.ts +0 -68
- package/dist/lib/structures/Application.js +0 -178
- package/dist/lib/structures/ApplicationCommand.d.ts +0 -74
- package/dist/lib/structures/ApplicationCommand.js +0 -141
- package/dist/lib/structures/Attachment.d.ts +0 -34
- package/dist/lib/structures/Attachment.js +0 -64
- package/dist/lib/structures/AuditLogEntry.d.ts +0 -25
- package/dist/lib/structures/AuditLogEntry.js +0 -53
- package/dist/lib/structures/AutoModerationRule.d.ts +0 -49
- package/dist/lib/structures/AutoModerationRule.js +0 -139
- package/dist/lib/structures/AutocompleteInteraction.d.ts +0 -62
- package/dist/lib/structures/AutocompleteInteraction.js +0 -115
- package/dist/lib/structures/Base.d.ts +0 -20
- package/dist/lib/structures/Base.js +0 -58
- package/dist/lib/structures/BaseEntitlement.d.ts +0 -19
- package/dist/lib/structures/BaseEntitlement.js +0 -44
- package/dist/lib/structures/CategoryChannel.d.ts +0 -41
- package/dist/lib/structures/CategoryChannel.js +0 -105
- package/dist/lib/structures/Channel.d.ts +0 -20
- package/dist/lib/structures/Channel.js +0 -91
- package/dist/lib/structures/ClientApplication.d.ts +0 -153
- package/dist/lib/structures/ClientApplication.js +0 -220
- package/dist/lib/structures/CommandInteraction.d.ts +0 -127
- package/dist/lib/structures/CommandInteraction.js +0 -297
- package/dist/lib/structures/ComponentInteraction.d.ts +0 -137
- package/dist/lib/structures/ComponentInteraction.js +0 -311
- package/dist/lib/structures/Entitlement.d.ts +0 -12
- package/dist/lib/structures/Entitlement.js +0 -26
- package/dist/lib/structures/ExtendedUser.d.ts +0 -26
- package/dist/lib/structures/ExtendedUser.js +0 -57
- package/dist/lib/structures/ForumChannel.d.ts +0 -11
- package/dist/lib/structures/ForumChannel.js +0 -19
- package/dist/lib/structures/GroupChannel.d.ts +0 -62
- package/dist/lib/structures/GroupChannel.js +0 -133
- package/dist/lib/structures/Guild.d.ts +0 -654
- package/dist/lib/structures/Guild.js +0 -1319
- package/dist/lib/structures/GuildChannel.d.ts +0 -34
- package/dist/lib/structures/GuildChannel.js +0 -75
- package/dist/lib/structures/GuildPreview.d.ts +0 -50
- package/dist/lib/structures/GuildPreview.js +0 -119
- package/dist/lib/structures/GuildScheduledEvent.d.ts +0 -60
- package/dist/lib/structures/GuildScheduledEvent.js +0 -154
- package/dist/lib/structures/GuildTemplate.d.ts +0 -55
- package/dist/lib/structures/GuildTemplate.js +0 -126
- package/dist/lib/structures/Integration.d.ts +0 -54
- package/dist/lib/structures/Integration.js +0 -156
- package/dist/lib/structures/Interaction.d.ts +0 -40
- package/dist/lib/structures/Interaction.js +0 -91
- package/dist/lib/structures/InteractionResolvedChannel.d.ts +0 -28
- package/dist/lib/structures/InteractionResolvedChannel.js +0 -45
- package/dist/lib/structures/Invite.d.ts +0 -64
- package/dist/lib/structures/Invite.js +0 -193
- package/dist/lib/structures/InviteGuild.d.ts +0 -52
- package/dist/lib/structures/InviteGuild.js +0 -88
- package/dist/lib/structures/MediaChannel.d.ts +0 -11
- package/dist/lib/structures/MediaChannel.js +0 -19
- package/dist/lib/structures/Member.d.ts +0 -122
- package/dist/lib/structures/Member.js +0 -255
- package/dist/lib/structures/Message.d.ts +0 -183
- package/dist/lib/structures/Message.js +0 -455
- package/dist/lib/structures/ModalSubmitInteraction.d.ts +0 -128
- package/dist/lib/structures/ModalSubmitInteraction.js +0 -240
- package/dist/lib/structures/OAuthApplication.d.ts +0 -79
- package/dist/lib/structures/OAuthApplication.js +0 -210
- package/dist/lib/structures/OAuthGuild.d.ts +0 -35
- package/dist/lib/structures/OAuthGuild.js +0 -61
- package/dist/lib/structures/PartialApplication.d.ts +0 -30
- package/dist/lib/structures/PartialApplication.js +0 -67
- package/dist/lib/structures/Permission.d.ts +0 -21
- package/dist/lib/structures/Permission.js +0 -68
- package/dist/lib/structures/PermissionOverwrite.d.ts +0 -26
- package/dist/lib/structures/PermissionOverwrite.js +0 -49
- package/dist/lib/structures/PingInteraction.d.ts +0 -16
- package/dist/lib/structures/PingInteraction.js +0 -26
- package/dist/lib/structures/PrivateChannel.d.ts +0 -90
- package/dist/lib/structures/PrivateChannel.js +0 -131
- package/dist/lib/structures/PrivateThreadChannel.d.ts +0 -18
- package/dist/lib/structures/PrivateThreadChannel.js +0 -27
- package/dist/lib/structures/PublicThreadChannel.d.ts +0 -21
- package/dist/lib/structures/PublicThreadChannel.js +0 -37
- package/dist/lib/structures/Role.d.ts +0 -50
- package/dist/lib/structures/Role.js +0 -131
- package/dist/lib/structures/SKU.d.ts +0 -32
- package/dist/lib/structures/SKU.js +0 -53
- package/dist/lib/structures/StageChannel.d.ts +0 -33
- package/dist/lib/structures/StageChannel.js +0 -44
- package/dist/lib/structures/StageInstance.d.ts +0 -36
- package/dist/lib/structures/StageInstance.js +0 -94
- package/dist/lib/structures/Team.d.ts +0 -22
- package/dist/lib/structures/Team.js +0 -67
- package/dist/lib/structures/TestEntitlement.d.ts +0 -10
- package/dist/lib/structures/TestEntitlement.js +0 -21
- package/dist/lib/structures/TextChannel.d.ts +0 -34
- package/dist/lib/structures/TextChannel.js +0 -46
- package/dist/lib/structures/TextableChannel.d.ts +0 -158
- package/dist/lib/structures/TextableChannel.js +0 -276
- package/dist/lib/structures/TextableVoiceChannel.d.ts +0 -39
- package/dist/lib/structures/TextableVoiceChannel.js +0 -81
- package/dist/lib/structures/ThreadChannel.d.ts +0 -159
- package/dist/lib/structures/ThreadChannel.js +0 -295
- package/dist/lib/structures/ThreadOnlyChannel.d.ts +0 -99
- package/dist/lib/structures/ThreadOnlyChannel.js +0 -233
- package/dist/lib/structures/ThreadableChannel.d.ts +0 -36
- package/dist/lib/structures/ThreadableChannel.js +0 -58
- package/dist/lib/structures/UnavailableGuild.d.ts +0 -11
- package/dist/lib/structures/UnavailableGuild.js +0 -21
- package/dist/lib/structures/User.d.ts +0 -82
- package/dist/lib/structures/User.js +0 -168
- package/dist/lib/structures/VoiceChannel.d.ts +0 -20
- package/dist/lib/structures/VoiceChannel.js +0 -35
- package/dist/lib/structures/VoiceState.d.ts +0 -51
- package/dist/lib/structures/VoiceState.js +0 -140
- package/dist/lib/structures/Webhook.d.ts +0 -129
- package/dist/lib/structures/Webhook.js +0 -206
- package/dist/lib/types/applications.d.ts +0 -448
- package/dist/lib/types/audit-log.d.ts +0 -121
- package/dist/lib/types/auto-moderation.d.ts +0 -99
- package/dist/lib/types/channels.d.ts +0 -1150
- package/dist/lib/types/client.d.ts +0 -228
- package/dist/lib/types/events.d.ts +0 -260
- package/dist/lib/types/gateway-raw.d.ts +0 -567
- package/dist/lib/types/gateway.d.ts +0 -338
- package/dist/lib/types/guild-template.d.ts +0 -33
- package/dist/lib/types/guilds.d.ts +0 -854
- package/dist/lib/types/index.d.ts +0 -18
- package/dist/lib/types/interactions.d.ts +0 -376
- package/dist/lib/types/json.d.ts +0 -709
- package/dist/lib/types/misc.d.ts +0 -13
- package/dist/lib/types/oauth.d.ts +0 -201
- package/dist/lib/types/request-handler.d.ts +0 -52
- package/dist/lib/types/scheduled-events.d.ts +0 -88
- package/dist/lib/types/shared.d.ts +0 -9
- package/dist/lib/types/users.d.ts +0 -45
- package/dist/lib/types/voice.d.ts +0 -45
- package/dist/lib/types/webhooks.d.ts +0 -73
- package/dist/lib/util/Collection.d.ts +0 -47
- package/dist/lib/util/Collection.js +0 -78
- package/dist/lib/util/Errors.d.ts +0 -29
- package/dist/lib/util/Errors.js +0 -56
- package/dist/lib/util/Routes.d.ts +0 -124
- package/dist/lib/util/Routes.js +0 -243
- package/dist/lib/util/SimpleCollection.d.ts +0 -12
- package/dist/lib/util/SimpleCollection.js +0 -81
- package/dist/lib/util/TypedCollection.d.ts +0 -24
- package/dist/lib/util/TypedCollection.js +0 -76
- package/dist/lib/util/TypedEmitter.d.ts +0 -19
- package/dist/lib/util/TypedEmitter.js +0 -19
- package/dist/lib/util/Util.d.ts +0 -52
- package/dist/lib/util/Util.js +0 -469
- package/dist/lib/util/interactions/InteractionOptionsWrapper.d.ts +0 -170
- package/dist/lib/util/interactions/InteractionOptionsWrapper.js +0 -213
- package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +0 -24
- package/dist/lib/util/interactions/MessageInteractionResponse.js +0 -28
- package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.d.ts +0 -24
- package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.js +0 -34
- package/dist/lib/util/interactions/SelectMenuValuesWrapper.d.ts +0 -60
- package/dist/lib/util/interactions/SelectMenuValuesWrapper.js +0 -124
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
/** @module TypedCollection */
|
|
5
|
-
const Collection_1 = tslib_1.__importDefault(require("./Collection"));
|
|
6
|
-
const Base_1 = tslib_1.__importDefault(require("../structures/Base"));
|
|
7
|
-
/** This is an internal class, you should not use it in your projects. If you want a collection type for your own projects, look at {@link Collection}. */
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
-
class TypedCollection extends Collection_1.default {
|
|
10
|
-
#baseObject;
|
|
11
|
-
extraOptions;
|
|
12
|
-
limit;
|
|
13
|
-
constructor(baseObject, client, limit = Infinity, extraOptions) {
|
|
14
|
-
super();
|
|
15
|
-
if (!(baseObject.prototype instanceof Base_1.default)) {
|
|
16
|
-
throw new TypeError("baseObject must be a class that extends Base.");
|
|
17
|
-
}
|
|
18
|
-
this.#baseObject = baseObject;
|
|
19
|
-
this.limit = limit;
|
|
20
|
-
this.extraOptions = {
|
|
21
|
-
construct: extraOptions?.construct ?? ((data, ...extra) => new baseObject(data, client, ...extra)),
|
|
22
|
-
delete: extraOptions?.delete ?? (() => { })
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/** @hidden */
|
|
26
|
-
add(value) {
|
|
27
|
-
if ("id" in value) {
|
|
28
|
-
if (this.limit === 0) {
|
|
29
|
-
return value;
|
|
30
|
-
}
|
|
31
|
-
this.set(value.id, value);
|
|
32
|
-
if (this.limit && this.size > this.limit) {
|
|
33
|
-
const iter = this.keys();
|
|
34
|
-
while (this.size > this.limit) {
|
|
35
|
-
this.delete(iter.next().value);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return value;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
const err = new Error(`${this.constructor.name}#add: value must have an id property`);
|
|
42
|
-
Object.defineProperty(err, "_object", { value });
|
|
43
|
-
throw err;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
clear() {
|
|
47
|
-
for (const key of this.keys()) {
|
|
48
|
-
this.extraOptions.delete(key);
|
|
49
|
-
}
|
|
50
|
-
super.clear();
|
|
51
|
-
}
|
|
52
|
-
delete(key) {
|
|
53
|
-
this.extraOptions.delete(key);
|
|
54
|
-
return super.delete(key);
|
|
55
|
-
}
|
|
56
|
-
/** @hidden */
|
|
57
|
-
update(value, ...extra) {
|
|
58
|
-
if (value instanceof this.#baseObject) {
|
|
59
|
-
if ("update" in value) {
|
|
60
|
-
value["update"].call(value, value);
|
|
61
|
-
}
|
|
62
|
-
return value;
|
|
63
|
-
}
|
|
64
|
-
// if the object does not have a direct id, we're forced to construct a whole new object
|
|
65
|
-
let item = "id" in value && value.id ? this.get(value.id) : undefined;
|
|
66
|
-
if (!item) {
|
|
67
|
-
item = this.add(this.extraOptions.construct(value, ...extra));
|
|
68
|
-
}
|
|
69
|
-
else if ("update" in item) {
|
|
70
|
-
item["update"].call(item, value);
|
|
71
|
-
}
|
|
72
|
-
return item;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
exports.default = TypedCollection;
|
|
76
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVHlwZWRDb2xsZWN0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vbGliL3V0aWwvVHlwZWRDb2xsZWN0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDhCQUE4QjtBQUM5QixzRUFBc0M7QUFFdEMsc0VBQXNDO0FBU3RDLDBKQUEwSjtBQUMxSiw4REFBOEQ7QUFDOUQsTUFBcUIsZUFBOEYsU0FBUSxvQkFBcUI7SUFDNUksV0FBVyxDQUFvQjtJQUMvQixZQUFZLENBQWtDO0lBQzlDLEtBQUssQ0FBUztJQUNkLFlBQVksVUFBNkIsRUFBRSxNQUFjLEVBQUUsS0FBSyxHQUFHLFFBQVEsRUFBRSxZQUFvQztRQUM3RyxLQUFLLEVBQUUsQ0FBQztRQUNSLElBQUksQ0FBQyxDQUFDLFVBQVUsQ0FBQyxTQUFTLFlBQVksY0FBSSxDQUFDLEVBQUUsQ0FBQztZQUMxQyxNQUFNLElBQUksU0FBUyxDQUFDLCtDQUErQyxDQUFDLENBQUM7UUFDekUsQ0FBQztRQUNELElBQUksQ0FBQyxXQUFXLEdBQUcsVUFBVSxDQUFDO1FBQzlCLElBQUksQ0FBQyxLQUFLLEdBQUcsS0FBSyxDQUFDO1FBQ25CLElBQUksQ0FBQyxZQUFZLEdBQUc7WUFDaEIsU0FBUyxFQUFFLFlBQVksRUFBRSxTQUFTLElBQUksQ0FBQyxDQUFDLElBQUksRUFBRSxHQUFHLEtBQUssRUFBSyxFQUFFLENBQUMsSUFBSSxVQUFVLENBQUMsSUFBSSxFQUFFLE1BQU0sRUFBRSxHQUFHLEtBQUssQ0FBQyxDQUFD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sQ0FBQyxLQUFVLEVBQUUsR0FBRyxLQUFLLENBQUMsQ0FBQyxDQUFDO1FBQ3ZFLENBQUM7YUFBTSxJQUFJLFFBQVEsSUFBSSxJQUFJLEVBQUUsQ0FBQztZQUMxQixJQUFJLENBQUMsUUFBUSxDQUFDLENBQUMsSUFBSSxDQUFDLElBQUksRUFBRSxLQUFLLENBQUMsQ0FBQztRQUNyQyxDQUFDO1FBQ0QsT0FBTyxJQUFJLENBQUM7SUFDaEIsQ0FBQztDQUNKO0FBdEVELGtDQXNFQyJ9
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import EventEmitter from "node:events";
|
|
3
|
-
declare interface TypedEmitter<Events extends Record<string | symbol, any>> extends EventEmitter {
|
|
4
|
-
addListener<K extends keyof Events>(event: K, listener: (...args: Events[K]) => void): this;
|
|
5
|
-
emit<K extends keyof Events>(eventName: K, ...args: Events[K]): boolean;
|
|
6
|
-
listenerCount(eventName: keyof Events): number;
|
|
7
|
-
listeners(eventName: keyof Events): Array<Function>;
|
|
8
|
-
off<K extends keyof Events>(event: K, listener: (...args: Events[K]) => void): this;
|
|
9
|
-
on<K extends keyof Events>(event: K, listener: (...args: Events[K]) => void): this;
|
|
10
|
-
once<K extends keyof Events>(event: K, listener: (...args: Events[K]) => void): this;
|
|
11
|
-
prependListener<K extends keyof Events>(event: K, listener: (...args: Events[K]) => void): this;
|
|
12
|
-
prependOnceListener<K extends keyof Events>(event: K, listener: (...args: Events[K]) => void): this;
|
|
13
|
-
rawListeners(eventName: keyof Events): Array<Function>;
|
|
14
|
-
removeAllListeners(event?: keyof Events): this;
|
|
15
|
-
removeListener<K extends keyof Events>(event: K, listener: (...args: Events[K]) => void): this;
|
|
16
|
-
}
|
|
17
|
-
declare class TypedEmitter<Events extends Record<string | symbol, any>> extends EventEmitter {
|
|
18
|
-
}
|
|
19
|
-
export default TypedEmitter;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
/** @module TypedEmitter */
|
|
5
|
-
const Errors_1 = require("./Errors");
|
|
6
|
-
const node_events_1 = tslib_1.__importDefault(require("node:events"));
|
|
7
|
-
class TypedEmitter extends node_events_1.default {
|
|
8
|
-
emit(eventName, ...args) {
|
|
9
|
-
if (this.listenerCount(eventName) === 0) {
|
|
10
|
-
if (eventName === "error") {
|
|
11
|
-
throw new Errors_1.UncaughtError(args[0]);
|
|
12
|
-
}
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
return super.emit(eventName, ...args);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.default = TypedEmitter;
|
|
19
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVHlwZWRFbWl0dGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vbGliL3V0aWwvVHlwZWRFbWl0dGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDJCQUEyQjtBQUMzQixxQ0FBeUM7QUFDekMsc0VBQXVDO0FBbUJ2QyxNQUFNLFlBQTBELFNBQVEscUJBQVk7SUFDdkUsSUFBSSxDQUF5QixTQUFZLEVBQUUsR0FBRyxJQUFlO1FBQ2xFLElBQUksSUFBSSxDQUFDLGFBQWEsQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLEVBQUUsQ0FBQztZQUN0QyxJQUFJLFNBQVMsS0FBSyxPQUFPLEVBQUUsQ0FBQztnQkFDeEIsTUFBTSxJQUFJLHNCQUFhLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7WUFDckMsQ0FBQztZQUNELE9BQU8sS0FBSyxDQUFDO1FBQ2pCLENBQUM7UUFDRCxPQUFPLEtBQUssQ0FBQyxJQUFJLENBQUMsU0FBbUIsRUFBRSxHQUFHLElBQWtCLENBQUMsQ0FBQztJQUNsRSxDQUFDO0NBQ0o7QUFFRCxrQkFBZSxZQUFZLENBQUMifQ==
|
package/dist/lib/util/Util.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type Client from "../Client";
|
|
3
|
-
import { type ImageFormat } from "../Constants";
|
|
4
|
-
import type { AllowedMentions, AnyChannel, AnyThreadChannel, Component, Embed, EmbedOptions, MessageActionRow, ModalActionRow, RawAllowedMentions, RawChannel, RawComponent, RawEmbed, RawEmbedOptions, RawMessageActionRow, RawModalActionRow, RawThreadChannel, ToComponentFromRaw, ToRawFromComponent } from "../types/channels";
|
|
5
|
-
import type { RawMember, RawSticker, RESTMember, Sticker } from "../types/guilds";
|
|
6
|
-
import type { ApplicationCommandOptions, RawApplicationCommandOption } from "../types/applications";
|
|
7
|
-
import Member from "../structures/Member";
|
|
8
|
-
import type { AnyTextableChannel, CollectionLimitsOptions, GuildEmoji, ModalSubmitComponentsActionRow, RawGuildEmoji, RawMessage, RawModalSubmitComponents, RawModalSubmitComponentsActionRow, ToModalSubmitComponentFromRaw, Uncached, RawBaseEntitlement } from "../types";
|
|
9
|
-
import Message from "../structures/Message";
|
|
10
|
-
import Entitlement from "../structures/Entitlement";
|
|
11
|
-
import TestEntitlement from "../structures/TestEntitlement";
|
|
12
|
-
/** A general set of utilities. These are intentionally poorly documented, as they serve almost no usefulness to outside developers. */
|
|
13
|
-
export default class Util {
|
|
14
|
-
#private;
|
|
15
|
-
constructor(client: Client);
|
|
16
|
-
static rawEmbeds(embeds: RawEmbed): Embed;
|
|
17
|
-
static rawEmbeds(embeds: Array<RawEmbed>): Array<Embed>;
|
|
18
|
-
static rawMessageComponents(components: RawMessageActionRow): MessageActionRow;
|
|
19
|
-
static rawMessageComponents(components: Array<RawMessageActionRow>): Array<MessageActionRow>;
|
|
20
|
-
static rawModalComponents(components: RawModalActionRow): ModalActionRow;
|
|
21
|
-
static rawModalComponents(components: Array<RawModalActionRow>): Array<ModalActionRow>;
|
|
22
|
-
/** @hidden intentionally not documented - this is an internal function */
|
|
23
|
-
_convertImage(image: Buffer | string, name: string): string;
|
|
24
|
-
/** @hidden intended for internal use only */
|
|
25
|
-
_getLimit(name: Exclude<keyof CollectionLimitsOptions, "users">, id?: string): number;
|
|
26
|
-
_setLimit(values?: Record<string, number> | number, defaultValue?: number): Record<string, number> | number;
|
|
27
|
-
componentToParsed<T extends RawComponent>(component: T): ToComponentFromRaw<T>;
|
|
28
|
-
componentToRaw<T extends Component>(component: T): ToRawFromComponent<T>;
|
|
29
|
-
componentsToParsed<T extends RawModalActionRow | RawMessageActionRow>(components: Array<T>): T extends RawModalActionRow ? Array<ModalActionRow> : T extends RawMessageActionRow ? Array<MessageActionRow> : never;
|
|
30
|
-
componentsToRaw<T extends ModalActionRow | MessageActionRow>(components: Array<T>): T extends ModalActionRow ? Array<RawModalActionRow> : T extends MessageActionRow ? Array<RawMessageActionRow> : never;
|
|
31
|
-
convertEmoji(raw: RawGuildEmoji): GuildEmoji;
|
|
32
|
-
convertImage(img: Buffer | string): string;
|
|
33
|
-
convertSticker(raw: RawSticker): Sticker;
|
|
34
|
-
embedsToParsed(embeds: Array<RawEmbed>): Array<Embed>;
|
|
35
|
-
embedsToRaw(embeds: Array<EmbedOptions>): Array<RawEmbedOptions>;
|
|
36
|
-
formatAllowedMentions(allowed?: AllowedMentions): RawAllowedMentions;
|
|
37
|
-
formatImage(url: string, format?: ImageFormat, size?: number): string;
|
|
38
|
-
getMagic(file: Buffer, len?: number): string;
|
|
39
|
-
modalSubmitComponentToParsed<T extends RawModalSubmitComponents>(component: T): ToModalSubmitComponentFromRaw<T>;
|
|
40
|
-
modalSubmitComponentsToParsed<T extends RawModalSubmitComponentsActionRow>(components: Array<T>): Array<ModalSubmitComponentsActionRow>;
|
|
41
|
-
optionToParsed(option: RawApplicationCommandOption): ApplicationCommandOptions;
|
|
42
|
-
optionToRaw(option: ApplicationCommandOptions): RawApplicationCommandOption;
|
|
43
|
-
updateChannel<T extends AnyChannel>(channelData: RawChannel): T;
|
|
44
|
-
/** @internal */
|
|
45
|
-
updateEntitlement<T extends Entitlement | TestEntitlement = Entitlement | TestEntitlement>(data: RawBaseEntitlement): T;
|
|
46
|
-
/** @internal */
|
|
47
|
-
updateMember(guildID: string, memberID: string, member: RawMember | RESTMember): Member;
|
|
48
|
-
/** @internal */
|
|
49
|
-
updateMessage<T extends AnyTextableChannel | Uncached>(data: RawMessage): Message<T>;
|
|
50
|
-
/** @internal */
|
|
51
|
-
updateThread<T extends AnyThreadChannel>(threadData: RawThreadChannel): T;
|
|
52
|
-
}
|