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.
Files changed (204) hide show
  1. package/dist/package.json +5 -5
  2. package/esm.mjs +2 -0
  3. package/package.json +5 -5
  4. package/dist/lib/Client.d.ts +0 -91
  5. package/dist/lib/Client.js +0 -254
  6. package/dist/lib/Constants.d.ts +0 -1121
  7. package/dist/lib/Constants.js +0 -1401
  8. package/dist/lib/gateway/Shard.d.ts +0 -77
  9. package/dist/lib/gateway/Shard.js +0 -1582
  10. package/dist/lib/gateway/ShardManager.d.ts +0 -26
  11. package/dist/lib/gateway/ShardManager.js +0 -304
  12. package/dist/lib/index.d.ts +0 -83
  13. package/dist/lib/index.js +0 -166
  14. package/dist/lib/rest/Bucket.d.ts +0 -33
  15. package/dist/lib/rest/Bucket.js +0 -78
  16. package/dist/lib/rest/DiscordHTTPError.d.ts +0 -16
  17. package/dist/lib/rest/DiscordHTTPError.js +0 -65
  18. package/dist/lib/rest/DiscordRESTError.d.ts +0 -19
  19. package/dist/lib/rest/DiscordRESTError.js +0 -89
  20. package/dist/lib/rest/OAuthHelper.d.ts +0 -60
  21. package/dist/lib/rest/OAuthHelper.js +0 -180
  22. package/dist/lib/rest/RESTManager.d.ts +0 -42
  23. package/dist/lib/rest/RESTManager.js +0 -82
  24. package/dist/lib/rest/RequestHandler.d.ts +0 -28
  25. package/dist/lib/rest/RequestHandler.js +0 -313
  26. package/dist/lib/rest/SequentialBucket.d.ts +0 -25
  27. package/dist/lib/rest/SequentialBucket.js +0 -76
  28. package/dist/lib/routes/Applications.d.ts +0 -171
  29. package/dist/lib/routes/Applications.js +0 -447
  30. package/dist/lib/routes/Channels.d.ts +0 -391
  31. package/dist/lib/routes/Channels.js +0 -1107
  32. package/dist/lib/routes/Guilds.d.ts +0 -606
  33. package/dist/lib/routes/Guilds.js +0 -1669
  34. package/dist/lib/routes/Interactions.d.ts +0 -74
  35. package/dist/lib/routes/Interactions.js +0 -141
  36. package/dist/lib/routes/Miscellaneous.d.ts +0 -25
  37. package/dist/lib/routes/Miscellaneous.js +0 -54
  38. package/dist/lib/routes/OAuth.d.ts +0 -105
  39. package/dist/lib/routes/OAuth.js +0 -309
  40. package/dist/lib/routes/Users.d.ts +0 -32
  41. package/dist/lib/routes/Users.js +0 -59
  42. package/dist/lib/routes/Webhooks.d.ts +0 -128
  43. package/dist/lib/routes/Webhooks.js +0 -264
  44. package/dist/lib/structures/AnnouncementChannel.d.ts +0 -36
  45. package/dist/lib/structures/AnnouncementChannel.js +0 -47
  46. package/dist/lib/structures/AnnouncementThreadChannel.d.ts +0 -18
  47. package/dist/lib/structures/AnnouncementThreadChannel.js +0 -27
  48. package/dist/lib/structures/Application.d.ts +0 -68
  49. package/dist/lib/structures/Application.js +0 -178
  50. package/dist/lib/structures/ApplicationCommand.d.ts +0 -74
  51. package/dist/lib/structures/ApplicationCommand.js +0 -141
  52. package/dist/lib/structures/Attachment.d.ts +0 -34
  53. package/dist/lib/structures/Attachment.js +0 -64
  54. package/dist/lib/structures/AuditLogEntry.d.ts +0 -25
  55. package/dist/lib/structures/AuditLogEntry.js +0 -53
  56. package/dist/lib/structures/AutoModerationRule.d.ts +0 -49
  57. package/dist/lib/structures/AutoModerationRule.js +0 -139
  58. package/dist/lib/structures/AutocompleteInteraction.d.ts +0 -62
  59. package/dist/lib/structures/AutocompleteInteraction.js +0 -115
  60. package/dist/lib/structures/Base.d.ts +0 -20
  61. package/dist/lib/structures/Base.js +0 -58
  62. package/dist/lib/structures/BaseEntitlement.d.ts +0 -19
  63. package/dist/lib/structures/BaseEntitlement.js +0 -44
  64. package/dist/lib/structures/CategoryChannel.d.ts +0 -41
  65. package/dist/lib/structures/CategoryChannel.js +0 -105
  66. package/dist/lib/structures/Channel.d.ts +0 -20
  67. package/dist/lib/structures/Channel.js +0 -91
  68. package/dist/lib/structures/ClientApplication.d.ts +0 -153
  69. package/dist/lib/structures/ClientApplication.js +0 -220
  70. package/dist/lib/structures/CommandInteraction.d.ts +0 -127
  71. package/dist/lib/structures/CommandInteraction.js +0 -297
  72. package/dist/lib/structures/ComponentInteraction.d.ts +0 -137
  73. package/dist/lib/structures/ComponentInteraction.js +0 -311
  74. package/dist/lib/structures/Entitlement.d.ts +0 -12
  75. package/dist/lib/structures/Entitlement.js +0 -26
  76. package/dist/lib/structures/ExtendedUser.d.ts +0 -26
  77. package/dist/lib/structures/ExtendedUser.js +0 -57
  78. package/dist/lib/structures/ForumChannel.d.ts +0 -11
  79. package/dist/lib/structures/ForumChannel.js +0 -19
  80. package/dist/lib/structures/GroupChannel.d.ts +0 -62
  81. package/dist/lib/structures/GroupChannel.js +0 -133
  82. package/dist/lib/structures/Guild.d.ts +0 -654
  83. package/dist/lib/structures/Guild.js +0 -1319
  84. package/dist/lib/structures/GuildChannel.d.ts +0 -34
  85. package/dist/lib/structures/GuildChannel.js +0 -75
  86. package/dist/lib/structures/GuildPreview.d.ts +0 -50
  87. package/dist/lib/structures/GuildPreview.js +0 -119
  88. package/dist/lib/structures/GuildScheduledEvent.d.ts +0 -60
  89. package/dist/lib/structures/GuildScheduledEvent.js +0 -154
  90. package/dist/lib/structures/GuildTemplate.d.ts +0 -55
  91. package/dist/lib/structures/GuildTemplate.js +0 -126
  92. package/dist/lib/structures/Integration.d.ts +0 -54
  93. package/dist/lib/structures/Integration.js +0 -156
  94. package/dist/lib/structures/Interaction.d.ts +0 -40
  95. package/dist/lib/structures/Interaction.js +0 -91
  96. package/dist/lib/structures/InteractionResolvedChannel.d.ts +0 -28
  97. package/dist/lib/structures/InteractionResolvedChannel.js +0 -45
  98. package/dist/lib/structures/Invite.d.ts +0 -64
  99. package/dist/lib/structures/Invite.js +0 -193
  100. package/dist/lib/structures/InviteGuild.d.ts +0 -52
  101. package/dist/lib/structures/InviteGuild.js +0 -88
  102. package/dist/lib/structures/MediaChannel.d.ts +0 -11
  103. package/dist/lib/structures/MediaChannel.js +0 -19
  104. package/dist/lib/structures/Member.d.ts +0 -122
  105. package/dist/lib/structures/Member.js +0 -255
  106. package/dist/lib/structures/Message.d.ts +0 -183
  107. package/dist/lib/structures/Message.js +0 -455
  108. package/dist/lib/structures/ModalSubmitInteraction.d.ts +0 -128
  109. package/dist/lib/structures/ModalSubmitInteraction.js +0 -240
  110. package/dist/lib/structures/OAuthApplication.d.ts +0 -79
  111. package/dist/lib/structures/OAuthApplication.js +0 -210
  112. package/dist/lib/structures/OAuthGuild.d.ts +0 -35
  113. package/dist/lib/structures/OAuthGuild.js +0 -61
  114. package/dist/lib/structures/PartialApplication.d.ts +0 -30
  115. package/dist/lib/structures/PartialApplication.js +0 -67
  116. package/dist/lib/structures/Permission.d.ts +0 -21
  117. package/dist/lib/structures/Permission.js +0 -68
  118. package/dist/lib/structures/PermissionOverwrite.d.ts +0 -26
  119. package/dist/lib/structures/PermissionOverwrite.js +0 -49
  120. package/dist/lib/structures/PingInteraction.d.ts +0 -16
  121. package/dist/lib/structures/PingInteraction.js +0 -26
  122. package/dist/lib/structures/PrivateChannel.d.ts +0 -90
  123. package/dist/lib/structures/PrivateChannel.js +0 -131
  124. package/dist/lib/structures/PrivateThreadChannel.d.ts +0 -18
  125. package/dist/lib/structures/PrivateThreadChannel.js +0 -27
  126. package/dist/lib/structures/PublicThreadChannel.d.ts +0 -21
  127. package/dist/lib/structures/PublicThreadChannel.js +0 -37
  128. package/dist/lib/structures/Role.d.ts +0 -50
  129. package/dist/lib/structures/Role.js +0 -131
  130. package/dist/lib/structures/SKU.d.ts +0 -32
  131. package/dist/lib/structures/SKU.js +0 -53
  132. package/dist/lib/structures/StageChannel.d.ts +0 -33
  133. package/dist/lib/structures/StageChannel.js +0 -44
  134. package/dist/lib/structures/StageInstance.d.ts +0 -36
  135. package/dist/lib/structures/StageInstance.js +0 -94
  136. package/dist/lib/structures/Team.d.ts +0 -22
  137. package/dist/lib/structures/Team.js +0 -67
  138. package/dist/lib/structures/TestEntitlement.d.ts +0 -10
  139. package/dist/lib/structures/TestEntitlement.js +0 -21
  140. package/dist/lib/structures/TextChannel.d.ts +0 -34
  141. package/dist/lib/structures/TextChannel.js +0 -46
  142. package/dist/lib/structures/TextableChannel.d.ts +0 -158
  143. package/dist/lib/structures/TextableChannel.js +0 -276
  144. package/dist/lib/structures/TextableVoiceChannel.d.ts +0 -39
  145. package/dist/lib/structures/TextableVoiceChannel.js +0 -81
  146. package/dist/lib/structures/ThreadChannel.d.ts +0 -159
  147. package/dist/lib/structures/ThreadChannel.js +0 -295
  148. package/dist/lib/structures/ThreadOnlyChannel.d.ts +0 -99
  149. package/dist/lib/structures/ThreadOnlyChannel.js +0 -233
  150. package/dist/lib/structures/ThreadableChannel.d.ts +0 -36
  151. package/dist/lib/structures/ThreadableChannel.js +0 -58
  152. package/dist/lib/structures/UnavailableGuild.d.ts +0 -11
  153. package/dist/lib/structures/UnavailableGuild.js +0 -21
  154. package/dist/lib/structures/User.d.ts +0 -82
  155. package/dist/lib/structures/User.js +0 -168
  156. package/dist/lib/structures/VoiceChannel.d.ts +0 -20
  157. package/dist/lib/structures/VoiceChannel.js +0 -35
  158. package/dist/lib/structures/VoiceState.d.ts +0 -51
  159. package/dist/lib/structures/VoiceState.js +0 -140
  160. package/dist/lib/structures/Webhook.d.ts +0 -129
  161. package/dist/lib/structures/Webhook.js +0 -206
  162. package/dist/lib/types/applications.d.ts +0 -448
  163. package/dist/lib/types/audit-log.d.ts +0 -121
  164. package/dist/lib/types/auto-moderation.d.ts +0 -99
  165. package/dist/lib/types/channels.d.ts +0 -1150
  166. package/dist/lib/types/client.d.ts +0 -228
  167. package/dist/lib/types/events.d.ts +0 -260
  168. package/dist/lib/types/gateway-raw.d.ts +0 -567
  169. package/dist/lib/types/gateway.d.ts +0 -338
  170. package/dist/lib/types/guild-template.d.ts +0 -33
  171. package/dist/lib/types/guilds.d.ts +0 -854
  172. package/dist/lib/types/index.d.ts +0 -18
  173. package/dist/lib/types/interactions.d.ts +0 -376
  174. package/dist/lib/types/json.d.ts +0 -709
  175. package/dist/lib/types/misc.d.ts +0 -13
  176. package/dist/lib/types/oauth.d.ts +0 -201
  177. package/dist/lib/types/request-handler.d.ts +0 -52
  178. package/dist/lib/types/scheduled-events.d.ts +0 -88
  179. package/dist/lib/types/shared.d.ts +0 -9
  180. package/dist/lib/types/users.d.ts +0 -45
  181. package/dist/lib/types/voice.d.ts +0 -45
  182. package/dist/lib/types/webhooks.d.ts +0 -73
  183. package/dist/lib/util/Collection.d.ts +0 -47
  184. package/dist/lib/util/Collection.js +0 -78
  185. package/dist/lib/util/Errors.d.ts +0 -29
  186. package/dist/lib/util/Errors.js +0 -56
  187. package/dist/lib/util/Routes.d.ts +0 -124
  188. package/dist/lib/util/Routes.js +0 -243
  189. package/dist/lib/util/SimpleCollection.d.ts +0 -12
  190. package/dist/lib/util/SimpleCollection.js +0 -81
  191. package/dist/lib/util/TypedCollection.d.ts +0 -24
  192. package/dist/lib/util/TypedCollection.js +0 -76
  193. package/dist/lib/util/TypedEmitter.d.ts +0 -19
  194. package/dist/lib/util/TypedEmitter.js +0 -19
  195. package/dist/lib/util/Util.d.ts +0 -52
  196. package/dist/lib/util/Util.js +0 -469
  197. package/dist/lib/util/interactions/InteractionOptionsWrapper.d.ts +0 -170
  198. package/dist/lib/util/interactions/InteractionOptionsWrapper.js +0 -213
  199. package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +0 -24
  200. package/dist/lib/util/interactions/MessageInteractionResponse.js +0 -28
  201. package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.d.ts +0 -24
  202. package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.js +0 -34
  203. package/dist/lib/util/interactions/SelectMenuValuesWrapper.d.ts +0 -60
  204. 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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ztZQUMxQixJQUFJLENBQUMsUUFBUSxDQUFDLENBQUMsSUFBSSxDQUFDLElBQUksRUFBRSxLQUFLLENBQUMsQ0FBQztRQUNyQyxDQUFDO1FBQ0QsT0FBTyxJQUFJLENBQUM7SUFDaEIsQ0FBQztDQUNKO0FBdEVELGtDQXNFQyJ9
@@ -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==
@@ -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
- }