oceanic.js 1.10.3-dev.c6c9f52 → 1.10.3-dev.ca8b6e8

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 (205) hide show
  1. package/dist/lib/Client.d.ts +99 -0
  2. package/dist/lib/Client.js +263 -0
  3. package/dist/lib/Constants.d.ts +1215 -0
  4. package/dist/lib/Constants.js +1513 -0
  5. package/dist/lib/gateway/Shard.d.ts +83 -0
  6. package/dist/lib/gateway/Shard.js +1621 -0
  7. package/dist/lib/gateway/ShardManager.d.ts +29 -0
  8. package/dist/lib/gateway/ShardManager.js +300 -0
  9. package/dist/lib/index.d.ts +84 -0
  10. package/dist/lib/index.js +168 -0
  11. package/dist/lib/rest/Bucket.d.ts +33 -0
  12. package/dist/lib/rest/Bucket.js +78 -0
  13. package/dist/lib/rest/DiscordHTTPError.d.ts +16 -0
  14. package/dist/lib/rest/DiscordHTTPError.js +65 -0
  15. package/dist/lib/rest/DiscordRESTError.d.ts +19 -0
  16. package/dist/lib/rest/DiscordRESTError.js +89 -0
  17. package/dist/lib/rest/OAuthHelper.d.ts +62 -0
  18. package/dist/lib/rest/OAuthHelper.js +183 -0
  19. package/dist/lib/rest/RESTManager.d.ts +42 -0
  20. package/dist/lib/rest/RESTManager.js +82 -0
  21. package/dist/lib/rest/RequestHandler.d.ts +28 -0
  22. package/dist/lib/rest/RequestHandler.js +313 -0
  23. package/dist/lib/rest/SequentialBucket.d.ts +25 -0
  24. package/dist/lib/rest/SequentialBucket.js +76 -0
  25. package/dist/lib/routes/Applications.d.ts +171 -0
  26. package/dist/lib/routes/Applications.js +447 -0
  27. package/dist/lib/routes/Channels.d.ts +408 -0
  28. package/dist/lib/routes/Channels.js +1160 -0
  29. package/dist/lib/routes/Guilds.d.ts +606 -0
  30. package/dist/lib/routes/Guilds.js +1669 -0
  31. package/dist/lib/routes/Interactions.d.ts +74 -0
  32. package/dist/lib/routes/Interactions.js +141 -0
  33. package/dist/lib/routes/Miscellaneous.d.ts +31 -0
  34. package/dist/lib/routes/Miscellaneous.js +69 -0
  35. package/dist/lib/routes/OAuth.d.ts +108 -0
  36. package/dist/lib/routes/OAuth.js +312 -0
  37. package/dist/lib/routes/Users.d.ts +32 -0
  38. package/dist/lib/routes/Users.js +59 -0
  39. package/dist/lib/routes/Webhooks.d.ts +128 -0
  40. package/dist/lib/routes/Webhooks.js +265 -0
  41. package/dist/lib/structures/AnnouncementChannel.d.ts +36 -0
  42. package/dist/lib/structures/AnnouncementChannel.js +47 -0
  43. package/dist/lib/structures/AnnouncementThreadChannel.d.ts +18 -0
  44. package/dist/lib/structures/AnnouncementThreadChannel.js +27 -0
  45. package/dist/lib/structures/Application.d.ts +102 -0
  46. package/dist/lib/structures/Application.js +189 -0
  47. package/dist/lib/structures/ApplicationCommand.d.ts +74 -0
  48. package/dist/lib/structures/ApplicationCommand.js +141 -0
  49. package/dist/lib/structures/Attachment.d.ts +34 -0
  50. package/dist/lib/structures/Attachment.js +64 -0
  51. package/dist/lib/structures/AuditLogEntry.d.ts +25 -0
  52. package/dist/lib/structures/AuditLogEntry.js +53 -0
  53. package/dist/lib/structures/AutoModerationRule.d.ts +49 -0
  54. package/dist/lib/structures/AutoModerationRule.js +139 -0
  55. package/dist/lib/structures/AutocompleteInteraction.d.ts +62 -0
  56. package/dist/lib/structures/AutocompleteInteraction.js +115 -0
  57. package/dist/lib/structures/Base.d.ts +20 -0
  58. package/dist/lib/structures/Base.js +58 -0
  59. package/dist/lib/structures/BaseEntitlement.d.ts +19 -0
  60. package/dist/lib/structures/BaseEntitlement.js +44 -0
  61. package/dist/lib/structures/CategoryChannel.d.ts +41 -0
  62. package/dist/lib/structures/CategoryChannel.js +105 -0
  63. package/dist/lib/structures/Channel.d.ts +20 -0
  64. package/dist/lib/structures/Channel.js +91 -0
  65. package/dist/lib/structures/ClientApplication.d.ts +153 -0
  66. package/dist/lib/structures/ClientApplication.js +220 -0
  67. package/dist/lib/structures/CommandInteraction.d.ts +127 -0
  68. package/dist/lib/structures/CommandInteraction.js +297 -0
  69. package/dist/lib/structures/ComponentInteraction.d.ts +137 -0
  70. package/dist/lib/structures/ComponentInteraction.js +311 -0
  71. package/dist/lib/structures/Entitlement.d.ts +12 -0
  72. package/dist/lib/structures/Entitlement.js +26 -0
  73. package/dist/lib/structures/ExtendedUser.d.ts +26 -0
  74. package/dist/lib/structures/ExtendedUser.js +57 -0
  75. package/dist/lib/structures/ForumChannel.d.ts +11 -0
  76. package/dist/lib/structures/ForumChannel.js +19 -0
  77. package/dist/lib/structures/GroupChannel.d.ts +62 -0
  78. package/dist/lib/structures/GroupChannel.js +133 -0
  79. package/dist/lib/structures/Guild.d.ts +654 -0
  80. package/dist/lib/structures/Guild.js +1319 -0
  81. package/dist/lib/structures/GuildChannel.d.ts +34 -0
  82. package/dist/lib/structures/GuildChannel.js +75 -0
  83. package/dist/lib/structures/GuildPreview.d.ts +50 -0
  84. package/dist/lib/structures/GuildPreview.js +119 -0
  85. package/dist/lib/structures/GuildScheduledEvent.d.ts +60 -0
  86. package/dist/lib/structures/GuildScheduledEvent.js +154 -0
  87. package/dist/lib/structures/GuildTemplate.d.ts +55 -0
  88. package/dist/lib/structures/GuildTemplate.js +126 -0
  89. package/dist/lib/structures/Integration.d.ts +54 -0
  90. package/dist/lib/structures/Integration.js +156 -0
  91. package/dist/lib/structures/Interaction.d.ts +40 -0
  92. package/dist/lib/structures/Interaction.js +90 -0
  93. package/dist/lib/structures/InteractionResolvedChannel.d.ts +28 -0
  94. package/dist/lib/structures/InteractionResolvedChannel.js +45 -0
  95. package/dist/lib/structures/Invite.d.ts +64 -0
  96. package/dist/lib/structures/Invite.js +193 -0
  97. package/dist/lib/structures/InviteGuild.d.ts +52 -0
  98. package/dist/lib/structures/InviteGuild.js +88 -0
  99. package/dist/lib/structures/MediaChannel.d.ts +11 -0
  100. package/dist/lib/structures/MediaChannel.js +19 -0
  101. package/dist/lib/structures/Member.d.ts +122 -0
  102. package/dist/lib/structures/Member.js +255 -0
  103. package/dist/lib/structures/Message.d.ts +194 -0
  104. package/dist/lib/structures/Message.js +477 -0
  105. package/dist/lib/structures/ModalSubmitInteraction.d.ts +128 -0
  106. package/dist/lib/structures/ModalSubmitInteraction.js +240 -0
  107. package/dist/lib/structures/OAuthApplication.d.ts +79 -0
  108. package/dist/lib/structures/OAuthApplication.js +210 -0
  109. package/dist/lib/structures/OAuthGuild.d.ts +35 -0
  110. package/dist/lib/structures/OAuthGuild.js +61 -0
  111. package/dist/lib/structures/PartialApplication.d.ts +30 -0
  112. package/dist/lib/structures/PartialApplication.js +67 -0
  113. package/dist/lib/structures/Permission.d.ts +21 -0
  114. package/dist/lib/structures/Permission.js +68 -0
  115. package/dist/lib/structures/PermissionOverwrite.d.ts +26 -0
  116. package/dist/lib/structures/PermissionOverwrite.js +49 -0
  117. package/dist/lib/structures/PingInteraction.d.ts +16 -0
  118. package/dist/lib/structures/PingInteraction.js +26 -0
  119. package/dist/lib/structures/Poll.d.ts +28 -0
  120. package/dist/lib/structures/Poll.js +78 -0
  121. package/dist/lib/structures/PrivateChannel.d.ts +90 -0
  122. package/dist/lib/structures/PrivateChannel.js +131 -0
  123. package/dist/lib/structures/PrivateThreadChannel.d.ts +18 -0
  124. package/dist/lib/structures/PrivateThreadChannel.js +27 -0
  125. package/dist/lib/structures/PublicThreadChannel.d.ts +21 -0
  126. package/dist/lib/structures/PublicThreadChannel.js +37 -0
  127. package/dist/lib/structures/Role.d.ts +52 -0
  128. package/dist/lib/structures/Role.js +137 -0
  129. package/dist/lib/structures/SKU.d.ts +32 -0
  130. package/dist/lib/structures/SKU.js +53 -0
  131. package/dist/lib/structures/StageChannel.d.ts +33 -0
  132. package/dist/lib/structures/StageChannel.js +44 -0
  133. package/dist/lib/structures/StageInstance.d.ts +36 -0
  134. package/dist/lib/structures/StageInstance.js +94 -0
  135. package/dist/lib/structures/Team.d.ts +22 -0
  136. package/dist/lib/structures/Team.js +67 -0
  137. package/dist/lib/structures/TestEntitlement.d.ts +10 -0
  138. package/dist/lib/structures/TestEntitlement.js +21 -0
  139. package/dist/lib/structures/TextChannel.d.ts +34 -0
  140. package/dist/lib/structures/TextChannel.js +46 -0
  141. package/dist/lib/structures/TextableChannel.d.ts +158 -0
  142. package/dist/lib/structures/TextableChannel.js +276 -0
  143. package/dist/lib/structures/TextableVoiceChannel.d.ts +39 -0
  144. package/dist/lib/structures/TextableVoiceChannel.js +81 -0
  145. package/dist/lib/structures/ThreadChannel.d.ts +159 -0
  146. package/dist/lib/structures/ThreadChannel.js +295 -0
  147. package/dist/lib/structures/ThreadOnlyChannel.d.ts +99 -0
  148. package/dist/lib/structures/ThreadOnlyChannel.js +233 -0
  149. package/dist/lib/structures/ThreadableChannel.d.ts +36 -0
  150. package/dist/lib/structures/ThreadableChannel.js +58 -0
  151. package/dist/lib/structures/UnavailableGuild.d.ts +11 -0
  152. package/dist/lib/structures/UnavailableGuild.js +21 -0
  153. package/dist/lib/structures/User.d.ts +82 -0
  154. package/dist/lib/structures/User.js +168 -0
  155. package/dist/lib/structures/VoiceChannel.d.ts +20 -0
  156. package/dist/lib/structures/VoiceChannel.js +35 -0
  157. package/dist/lib/structures/VoiceState.d.ts +51 -0
  158. package/dist/lib/structures/VoiceState.js +140 -0
  159. package/dist/lib/structures/Webhook.d.ts +129 -0
  160. package/dist/lib/structures/Webhook.js +206 -0
  161. package/dist/lib/types/applications.d.ts +466 -0
  162. package/dist/lib/types/audit-log.d.ts +122 -0
  163. package/dist/lib/types/auto-moderation.d.ts +99 -0
  164. package/dist/lib/types/channels.d.ts +1244 -0
  165. package/dist/lib/types/client.d.ts +228 -0
  166. package/dist/lib/types/events.d.ts +265 -0
  167. package/dist/lib/types/gateway-raw.d.ts +584 -0
  168. package/dist/lib/types/gateway.d.ts +351 -0
  169. package/dist/lib/types/guild-template.d.ts +33 -0
  170. package/dist/lib/types/guilds.d.ts +855 -0
  171. package/dist/lib/types/index.d.ts +18 -0
  172. package/dist/lib/types/interactions.d.ts +377 -0
  173. package/dist/lib/types/json.d.ts +742 -0
  174. package/dist/lib/types/misc.d.ts +28 -0
  175. package/dist/lib/types/oauth.d.ts +201 -0
  176. package/dist/lib/types/request-handler.d.ts +52 -0
  177. package/dist/lib/types/scheduled-events.d.ts +88 -0
  178. package/dist/lib/types/shared.d.ts +9 -0
  179. package/dist/lib/types/users.d.ts +45 -0
  180. package/dist/lib/types/voice.d.ts +45 -0
  181. package/dist/lib/types/webhooks.d.ts +74 -0
  182. package/dist/lib/util/Collection.d.ts +47 -0
  183. package/dist/lib/util/Collection.js +78 -0
  184. package/dist/lib/util/Errors.d.ts +29 -0
  185. package/dist/lib/util/Errors.js +56 -0
  186. package/dist/lib/util/Routes.d.ts +127 -0
  187. package/dist/lib/util/Routes.js +248 -0
  188. package/dist/lib/util/SimpleCollection.d.ts +12 -0
  189. package/dist/lib/util/SimpleCollection.js +81 -0
  190. package/dist/lib/util/TypedCollection.d.ts +24 -0
  191. package/dist/lib/util/TypedCollection.js +76 -0
  192. package/dist/lib/util/TypedEmitter.d.ts +19 -0
  193. package/dist/lib/util/TypedEmitter.js +19 -0
  194. package/dist/lib/util/Util.d.ts +58 -0
  195. package/dist/lib/util/Util.js +535 -0
  196. package/dist/lib/util/interactions/InteractionOptionsWrapper.d.ts +170 -0
  197. package/dist/lib/util/interactions/InteractionOptionsWrapper.js +213 -0
  198. package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +24 -0
  199. package/dist/lib/util/interactions/MessageInteractionResponse.js +28 -0
  200. package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.d.ts +24 -0
  201. package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.js +34 -0
  202. package/dist/lib/util/interactions/SelectMenuValuesWrapper.d.ts +60 -0
  203. package/dist/lib/util/interactions/SelectMenuValuesWrapper.js +124 -0
  204. package/dist/package.json +1 -1
  205. package/package.json +1 -1
@@ -0,0 +1,49 @@
1
+ /** @module AutoModerationRule */
2
+ import Base from "./Base";
3
+ import type User from "./User";
4
+ import type Guild from "./Guild";
5
+ import type Client from "../Client";
6
+ import type { AutoModerationAction, EditAutoModerationRuleOptions, RawAutoModerationRule, TriggerMetadata } from "../types/auto-moderation";
7
+ import type { AutoModerationEventTypes, AutoModerationTriggerTypes } from "../Constants";
8
+ import type { JSONAutoModerationRule } from "../types/json";
9
+ /** Represents an auto moderation rule. */
10
+ export default class AutoModerationRule extends Base {
11
+ private _cachedGuild?;
12
+ /** The actions that will execute when this rule is triggered. */
13
+ actions: Array<AutoModerationAction>;
14
+ /** The creator of this rule. */
15
+ creator?: User;
16
+ /** The ID of the creator of this rule. */
17
+ creatorID: string;
18
+ /** If this rule is enabled. */
19
+ enabled: boolean;
20
+ /** The [event type](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-event-types) of this rule. */
21
+ eventType: AutoModerationEventTypes;
22
+ /** The channels that are exempt from this rule. */
23
+ exemptChannels: Array<string>;
24
+ /** The roles that are exempt from this rule. */
25
+ exemptRoles: Array<string>;
26
+ /** The id of the guild this rule is in. */
27
+ guildID: string;
28
+ /** The name of this rule */
29
+ name: string;
30
+ /** The metadata of this rule's trigger. */
31
+ triggerMetadata: TriggerMetadata;
32
+ /** This rule's [trigger type](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types). */
33
+ triggerType: AutoModerationTriggerTypes;
34
+ constructor(data: RawAutoModerationRule, client: Client);
35
+ protected update(data: Partial<RawAutoModerationRule>): void;
36
+ /** The guild this rule is in. This will throw an error if the guild is not cached. */
37
+ get guild(): Guild;
38
+ /**
39
+ * Delete this auto moderation rule.
40
+ * @param reason The reason for deleting this rule.
41
+ */
42
+ deleteAutoModerationRule(reason?: string): Promise<void>;
43
+ /**
44
+ * Edit this auto moderation rule.
45
+ * @param options The options for editing the rule.
46
+ */
47
+ edit(options: EditAutoModerationRuleOptions): Promise<AutoModerationRule>;
48
+ toJSON(): JSONAutoModerationRule;
49
+ }
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /** @module AutoModerationRule */
5
+ const Base_1 = tslib_1.__importDefault(require("./Base"));
6
+ const Errors_1 = require("../util/Errors");
7
+ /** Represents an auto moderation rule. */
8
+ class AutoModerationRule extends Base_1.default {
9
+ _cachedGuild;
10
+ /** The actions that will execute when this rule is triggered. */
11
+ actions;
12
+ /** The creator of this rule. */
13
+ creator;
14
+ /** The ID of the creator of this rule. */
15
+ creatorID;
16
+ /** If this rule is enabled. */
17
+ enabled;
18
+ /** The [event type](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-event-types) of this rule. */
19
+ eventType;
20
+ /** The channels that are exempt from this rule. */
21
+ exemptChannels;
22
+ /** The roles that are exempt from this rule. */
23
+ exemptRoles;
24
+ /** The id of the guild this rule is in. */
25
+ guildID;
26
+ /** The name of this rule */
27
+ name;
28
+ /** The metadata of this rule's trigger. */
29
+ triggerMetadata;
30
+ /** This rule's [trigger type](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types). */
31
+ triggerType;
32
+ constructor(data, client) {
33
+ super(data.id, client);
34
+ this.actions = data.actions.map(a => ({
35
+ metadata: {
36
+ channelID: a.metadata.channel_id,
37
+ customMessage: a.metadata.custom_message,
38
+ durationSeconds: a.metadata.duration_seconds
39
+ },
40
+ type: a.type
41
+ }));
42
+ this.creator = client.users.get(data.creator_id);
43
+ this.creatorID = data.creator_id;
44
+ this.enabled = data.enabled;
45
+ this.eventType = data.event_type;
46
+ this.exemptChannels = data.exempt_channels;
47
+ this.exemptRoles = data.exempt_roles;
48
+ this.guildID = data.guild_id;
49
+ this.name = data.name;
50
+ this.triggerMetadata = {
51
+ allowList: data.trigger_metadata.allow_list,
52
+ keywordFilter: data.trigger_metadata.keyword_filter,
53
+ mentionRaidProtectionEnabled: data.trigger_metadata.mention_raid_protection_enabled,
54
+ mentionTotalLimit: data.trigger_metadata.mention_total_limit,
55
+ presets: data.trigger_metadata.presets,
56
+ regexPatterns: data.trigger_metadata.regex_patterns
57
+ };
58
+ this.triggerType = data.trigger_type;
59
+ this.update(data);
60
+ }
61
+ update(data) {
62
+ if (data.actions !== undefined) {
63
+ this.actions = data.actions.map(a => ({
64
+ metadata: {
65
+ channelID: a.metadata.channel_id,
66
+ customMessage: a.metadata.custom_message,
67
+ durationSeconds: a.metadata.duration_seconds
68
+ },
69
+ type: a.type
70
+ }));
71
+ }
72
+ if (data.enabled !== undefined) {
73
+ this.enabled = data.enabled;
74
+ }
75
+ if (data.event_type !== undefined) {
76
+ this.eventType = data.event_type;
77
+ }
78
+ if (data.exempt_channels !== undefined) {
79
+ this.exemptChannels = data.exempt_channels;
80
+ }
81
+ if (data.exempt_roles !== undefined) {
82
+ this.exemptRoles = data.exempt_roles;
83
+ }
84
+ if (data.name !== undefined) {
85
+ this.name = data.name;
86
+ }
87
+ if (data.trigger_metadata !== undefined) {
88
+ this.triggerMetadata = {
89
+ allowList: data.trigger_metadata.allow_list,
90
+ keywordFilter: data.trigger_metadata.keyword_filter,
91
+ mentionTotalLimit: data.trigger_metadata.mention_total_limit,
92
+ presets: data.trigger_metadata.presets,
93
+ regexPatterns: data.trigger_metadata.regex_patterns
94
+ };
95
+ }
96
+ if (data.trigger_type !== undefined) {
97
+ this.triggerType = data.trigger_type;
98
+ }
99
+ }
100
+ /** The guild this rule is in. This will throw an error if the guild is not cached. */
101
+ get guild() {
102
+ this._cachedGuild ??= this.client.guilds.get(this.guildID);
103
+ if (!this._cachedGuild) {
104
+ throw new Errors_1.UncachedError(this, "guild", "GUILDS", this.client);
105
+ }
106
+ return this._cachedGuild;
107
+ }
108
+ /**
109
+ * Delete this auto moderation rule.
110
+ * @param reason The reason for deleting this rule.
111
+ */
112
+ async deleteAutoModerationRule(reason) {
113
+ return this.client.rest.guilds.deleteAutoModerationRule(this.guildID, this.id, reason);
114
+ }
115
+ /**
116
+ * Edit this auto moderation rule.
117
+ * @param options The options for editing the rule.
118
+ */
119
+ async edit(options) {
120
+ return this.client.rest.guilds.editAutoModerationRule(this.guildID, this.id, options);
121
+ }
122
+ toJSON() {
123
+ return {
124
+ ...super.toJSON(),
125
+ actions: this.actions,
126
+ creatorID: this.creatorID,
127
+ enabled: this.enabled,
128
+ eventType: this.eventType,
129
+ exemptChannels: this.exemptChannels,
130
+ exemptRoles: this.exemptRoles,
131
+ guildID: this.guildID,
132
+ name: this.name,
133
+ triggerMetadata: this.triggerMetadata,
134
+ triggerType: this.triggerType
135
+ };
136
+ }
137
+ }
138
+ exports.default = AutoModerationRule;
139
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXV0b01vZGVyYXRpb25SdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vbGliL3N0cnVjdHVyZXMvQXV0b01vZGVyYXRpb25SdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLGlDQUFpQztBQUNqQywwREFBMEI7QUFPMUIsMkNBQStDO0FBRS9DLDBDQUEwQztBQUMxQyxNQUFxQixrQkFBbUIsU0FBUSxjQUFJO0lBQ3hDLFlBQVksQ0FBUztJQUM3QixpRUFBaUU7SUFDakUsT0FBTyxDQUE4QjtJQUNyQyxnQ0FBZ0M7SUFDaEMsT0FBTyxDQUFRO0lBQ2YsMENBQTBDO0lBQzFDLFNBQVMsQ0FBUztJQUNsQiwrQkFBK0I7SUFDL0IsT0FBTyxDQUFVO0lBQ2pCLDRJQUE0STtJQUM1SSxTQUFTLENBQTJCO0lBQ3BDLG1EQUFtRDtJQUNuRCxjQUFjLENBQWdCO0lBQzlCLGdEQUFnRDtJQUNoRCxXQUFXLENBQWdCO0lBQzNCLDJDQUEyQztJQUMzQyxPQUFPLENBQVM7SUFDaEIsNEJBQTRCO0lBQzVCLElBQUksQ0FBUztJQUNiLDRDQUE0QztJQUM1QyxlQUFlLENBQWtCO0lBQ2pDLDJJQUEyST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sR0FBRyxLQUFLLENBQUMsTUFBTSxFQUFFO1lBQ2pCLE9BQU8sRUFBVSxJQUFJLENBQUMsT0FBTztZQUM3QixTQUFTLEVBQVEsSUFBSSxDQUFDLFNBQVM7WUFDL0IsT0FBTyxFQUFVLElBQUksQ0FBQyxPQUFPO1lBQzdCLFNBQVMsRUFBUSxJQUFJLENBQUMsU0FBUztZQUMvQixjQUFjLEVBQUcsSUFBSSxDQUFDLGNBQWM7WUFDcEMsV0FBVyxFQUFNLElBQUksQ0FBQyxXQUFXO1lBQ2pDLE9BQU8sRUFBVSxJQUFJLENBQUMsT0FBTztZQUM3QixJQUFJLEVBQWEsSUFBSSxDQUFDLElBQUk7WUFDMUIsZUFBZSxFQUFFLElBQUksQ0FBQyxlQUFlO1lBQ3JDLFdBQVcsRUFBTSxJQUFJLENBQUMsV0FBVztTQUNwQyxDQUFDO0lBQ04sQ0FBQztDQUNKO0FBdklELHFDQXVJQyJ9
@@ -0,0 +1,62 @@
1
+ /** @module AutocompleteInteraction */
2
+ import Interaction from "./Interaction";
3
+ import type Member from "./Member";
4
+ import type User from "./User";
5
+ import type Guild from "./Guild";
6
+ import Permission from "./Permission";
7
+ import type PrivateChannel from "./PrivateChannel";
8
+ import type Entitlement from "./Entitlement";
9
+ import type TestEntitlement from "./TestEntitlement";
10
+ import { type InteractionTypes, type InteractionContextTypes } from "../Constants";
11
+ import type { AuthorizingIntegrationOwners, AutocompleteChoice, AutocompleteInteractionData, InteractionGuild, RawAutocompleteInteraction } from "../types/interactions";
12
+ import type Client from "../Client";
13
+ import type { AnyTextableGuildChannel, AnyInteractionChannel } from "../types/channels";
14
+ import type { JSONAutocompleteInteraction } from "../types/json";
15
+ import type { Uncached } from "../types/shared";
16
+ /** Represents an autocomplete interaction. */
17
+ export default class AutocompleteInteraction<T extends AnyInteractionChannel | Uncached = AnyInteractionChannel | Uncached> extends Interaction {
18
+ private _cachedChannel;
19
+ private _cachedGuild?;
20
+ /** The permissions the bot has in the channel this interaction was sent from. If in a dm/group dm, this will contain `ATTACH_FILES`, `EMBED_LINKS`, and `MENTION_EVERYONE`. In addition, `USE_EXTERNAL_EMOJIS` will be included for DMs with the app's bot user. */
21
+ appPermissions: Permission;
22
+ /** Details about the authorizing user or server for the installation(s) relevant to the interaction. See [Discord's docs](https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-authorizing-integration-owners-object) for more information. */
23
+ authorizingIntegrationOwners: AuthorizingIntegrationOwners;
24
+ /** The ID of the channel this interaction was sent from. */
25
+ channelID: string;
26
+ /** The context this interaction was sent from. */
27
+ context?: InteractionContextTypes;
28
+ /** The data associated with the interaction. */
29
+ data: AutocompleteInteractionData;
30
+ /** The entitlements for the user that created this interaction, and the guild it was created in. */
31
+ entitlements: Array<Entitlement | TestEntitlement>;
32
+ /** The id of the guild this interaction was sent from, if applicable. */
33
+ guildID: T extends AnyTextableGuildChannel ? string : string | null;
34
+ /** The preferred [locale](https://discord.com/developers/docs/reference#locales) of the guild this interaction was sent from, if applicable. */
35
+ guildLocale: T extends AnyTextableGuildChannel ? string : string | undefined;
36
+ /** The partial guild this interaction was sent from, if applicable. */
37
+ guildPartial?: T extends AnyTextableGuildChannel ? InteractionGuild : InteractionGuild | undefined;
38
+ /** The [locale](https://discord.com/developers/docs/reference#locales) of the invoking user. */
39
+ locale: string;
40
+ /** The member associated with the invoking user, if this interaction is sent from a guild. */
41
+ member: T extends AnyTextableGuildChannel ? Member : Member | null;
42
+ /** The permissions of the member associated with the invoking user, if this interaction is sent from a guild. */
43
+ memberPermissions: T extends AnyTextableGuildChannel ? Permission : Permission | null;
44
+ type: InteractionTypes.APPLICATION_COMMAND_AUTOCOMPLETE;
45
+ /** The user that invoked this interaction. */
46
+ user: User;
47
+ constructor(data: RawAutocompleteInteraction, client: Client);
48
+ /** The channel this interaction was sent from. */
49
+ get channel(): T extends AnyInteractionChannel ? T : undefined;
50
+ /** The guild this interaction was sent from, if applicable. This will throw an error if the guild is not cached. */
51
+ get guild(): T extends AnyTextableGuildChannel ? Guild : Guild | null;
52
+ /** Whether this interaction belongs to a cached guild channel. The only difference on using this method over a simple if statement is to easily update all the interaction properties typing definitions based on the channel it belongs to. */
53
+ inCachedGuildChannel(): this is AutocompleteInteraction<AnyTextableGuildChannel>;
54
+ /** Whether this interaction belongs to a private channel (PrivateChannel or uncached). The only difference on using this method over a simple if statement is to easily update all the interaction properties typing definitions based on the channel it belongs to. */
55
+ inPrivateChannel(): this is AutocompleteInteraction<PrivateChannel | Uncached>;
56
+ /**
57
+ * Acknowledge this interaction with a set of choices. This is an initial response, and more than one initial response cannot be used.
58
+ * @param choices The choices to send.
59
+ */
60
+ result(choices: Array<AutocompleteChoice>): Promise<void>;
61
+ toJSON(): JSONAutocompleteInteraction;
62
+ }
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /** @module AutocompleteInteraction */
5
+ const Interaction_1 = tslib_1.__importDefault(require("./Interaction"));
6
+ const Permission_1 = tslib_1.__importDefault(require("./Permission"));
7
+ const GuildChannel_1 = tslib_1.__importDefault(require("./GuildChannel"));
8
+ const Constants_1 = require("../Constants");
9
+ const InteractionOptionsWrapper_1 = tslib_1.__importDefault(require("../util/interactions/InteractionOptionsWrapper"));
10
+ const Errors_1 = require("../util/Errors");
11
+ /** Represents an autocomplete interaction. */
12
+ class AutocompleteInteraction extends Interaction_1.default {
13
+ _cachedChannel;
14
+ _cachedGuild;
15
+ /** The permissions the bot has in the channel this interaction was sent from. If in a dm/group dm, this will contain `ATTACH_FILES`, `EMBED_LINKS`, and `MENTION_EVERYONE`. In addition, `USE_EXTERNAL_EMOJIS` will be included for DMs with the app's bot user. */
16
+ appPermissions;
17
+ /** Details about the authorizing user or server for the installation(s) relevant to the interaction. See [Discord's docs](https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-authorizing-integration-owners-object) for more information. */
18
+ authorizingIntegrationOwners;
19
+ /** The ID of the channel this interaction was sent from. */
20
+ channelID;
21
+ /** The context this interaction was sent from. */
22
+ context;
23
+ /** The data associated with the interaction. */
24
+ data;
25
+ /** The entitlements for the user that created this interaction, and the guild it was created in. */
26
+ entitlements;
27
+ /** The id of the guild this interaction was sent from, if applicable. */
28
+ guildID;
29
+ /** The preferred [locale](https://discord.com/developers/docs/reference#locales) of the guild this interaction was sent from, if applicable. */
30
+ guildLocale;
31
+ /** The partial guild this interaction was sent from, if applicable. */
32
+ guildPartial;
33
+ /** The [locale](https://discord.com/developers/docs/reference#locales) of the invoking user. */
34
+ locale;
35
+ /** The member associated with the invoking user, if this interaction is sent from a guild. */
36
+ member;
37
+ /** The permissions of the member associated with the invoking user, if this interaction is sent from a guild. */
38
+ memberPermissions;
39
+ /** The user that invoked this interaction. */
40
+ user;
41
+ constructor(data, client) {
42
+ super(data, client);
43
+ this.appPermissions = new Permission_1.default(data.app_permissions ?? "0");
44
+ this.authorizingIntegrationOwners = data.authorizing_integration_owners;
45
+ this.channelID = data.channel_id;
46
+ this.context = data.context;
47
+ this.data = {
48
+ guildID: data.data.guild_id,
49
+ id: data.data.id,
50
+ name: data.data.name,
51
+ options: new InteractionOptionsWrapper_1.default(data.data.options ?? [], null),
52
+ type: data.data.type
53
+ };
54
+ this.entitlements = data.entitlements?.map(entitlement => client.util.updateEntitlement(entitlement)) ?? [];
55
+ this.guildID = (data.guild_id ?? null);
56
+ this.guildLocale = data.guild_locale;
57
+ this.guildPartial = data.guild;
58
+ this.locale = data.locale;
59
+ this.member = (data.member === undefined ? null : this.client.util.updateMember(data.guild_id, data.member.user.id, data.member));
60
+ this.memberPermissions = (data.member === undefined ? null : new Permission_1.default(data.member.permissions));
61
+ this.user = client.users.update(data.user ?? data.member.user);
62
+ }
63
+ /** The channel this interaction was sent from. */
64
+ get channel() {
65
+ return this._cachedChannel ??= this.client.getChannel(this.channelID);
66
+ }
67
+ /** The guild this interaction was sent from, if applicable. This will throw an error if the guild is not cached. */
68
+ get guild() {
69
+ if (this.guildID !== null && this._cachedGuild !== null) {
70
+ this._cachedGuild ??= this.client.guilds.get(this.guildID);
71
+ if (!this._cachedGuild) {
72
+ throw new Errors_1.UncachedError(this, "guild", "GUILDS", this.client);
73
+ }
74
+ return this._cachedGuild;
75
+ }
76
+ return this._cachedGuild === null ? this._cachedGuild : (this._cachedGuild = null);
77
+ }
78
+ /** Whether this interaction belongs to a cached guild channel. The only difference on using this method over a simple if statement is to easily update all the interaction properties typing definitions based on the channel it belongs to. */
79
+ inCachedGuildChannel() {
80
+ return this.channel instanceof GuildChannel_1.default;
81
+ }
82
+ /** Whether this interaction belongs to a private channel (PrivateChannel or uncached). The only difference on using this method over a simple if statement is to easily update all the interaction properties typing definitions based on the channel it belongs to. */
83
+ inPrivateChannel() {
84
+ return this.guildID === null;
85
+ }
86
+ /**
87
+ * Acknowledge this interaction with a set of choices. This is an initial response, and more than one initial response cannot be used.
88
+ * @param choices The choices to send.
89
+ */
90
+ async result(choices) {
91
+ if (this.acknowledged) {
92
+ throw new TypeError("Interactions cannot have more than one initial response.");
93
+ }
94
+ this.acknowledged = true;
95
+ return this.client.rest.interactions.createInteractionResponse(this.id, this.token, { type: Constants_1.InteractionResponseTypes.APPLICATION_COMMAND_AUTOCOMPLETE_RESULT, data: { choices } });
96
+ }
97
+ toJSON() {
98
+ return {
99
+ ...super.toJSON(),
100
+ appPermissions: this.appPermissions.toJSON(),
101
+ authorizingIntegrationOwners: this.authorizingIntegrationOwners,
102
+ channelID: this.channelID,
103
+ context: this.context,
104
+ data: this.data,
105
+ guildID: this.guildID ?? undefined,
106
+ guildLocale: this.guildLocale,
107
+ locale: this.locale,
108
+ member: this.member?.toJSON(),
109
+ type: this.type,
110
+ user: this.user.toJSON()
111
+ };
112
+ }
113
+ }
114
+ exports.default = AutocompleteInteraction;
115
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXV0b2NvbXBsZXRlSW50ZXJhY3Rpb24uanMiLCJzb3VyY2VSb290Ijo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QUFJLEVBQUUsRUFBRSxPQUFPLEVBQUUsRUFBRSxDQUFDLENBQUM7SUFDdkwsQ0FBQztJQUVRLE1BQU07UUFDWCxPQUFPO1lBQ0gsR0FBRyxLQUFLLENBQUMsTUFBTSxFQUFFO1lBQ2pCLGNBQWMsRUFBZ0IsSUFBSSxDQUFDLGNBQWMsQ0FBQyxNQUFNLEVBQUU7WUFDMUQsNEJBQTRCLEVBQUUsSUFBSSxDQUFDLDRCQUE0QjtZQUMvRCxTQUFTLEVBQXFCLElBQUksQ0FBQyxTQUFTO1lBQzVDLE9BQU8sRUFBdUIsSUFBSSxDQUFDLE9BQU87WUFDMUMsSUFBSSxFQUEwQixJQUFJLENBQUMsSUFBSTtZQUN2QyxPQUFPLEVBQXVCLElBQUksQ0FBQyxPQUFPLElBQUksU0FBUztZQUN2RCxXQUFXLEVBQW1CLElBQUksQ0FBQyxXQUFXO1lBQzlDLE1BQU0sRUFBd0IsSUFBSSxDQUFDLE1BQU07WUFDekMsTUFBTSxFQUF3QixJQUFJLENBQUMsTUFBTSxFQUFFLE1BQU0sRUFBRTtZQUNuRCxJQUFJLEVBQTBCLElBQUksQ0FBQyxJQUFJO1lBQ3ZDLElBQUksRUFBMEIsSUFBSSxDQUFDLElBQUksQ0FBQyxNQUFNLEVBQUU7U0FDbkQsQ0FBQztJQUNOLENBQUM7Q0FDSjtBQTlHRCwwQ0E4R0MifQ==
@@ -0,0 +1,20 @@
1
+ /// <reference types="node" />
2
+ /** @module Base */
3
+ import type Client from "../Client";
4
+ import type { JSONBase } from "../types/json";
5
+ import { inspect } from "node:util";
6
+ /** A base class which most other classes extend. */
7
+ export default abstract class Base {
8
+ client: Client;
9
+ id: string;
10
+ constructor(id: string, client: Client);
11
+ static generateID(timestamp?: number | Date): string;
12
+ static getCreatedAt(id: string): Date;
13
+ static getDiscordEpoch(id: string): number;
14
+ protected update(data: unknown): void;
15
+ get createdAt(): Date;
16
+ /** @hidden */
17
+ [inspect.custom](): this;
18
+ toJSON(): JSONBase;
19
+ toString(): string;
20
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const node_util_1 = require("node:util");
4
+ const DISCORD_EPOCH = 1420070400000;
5
+ /** A base class which most other classes extend. */
6
+ class Base {
7
+ client;
8
+ id;
9
+ constructor(id, client) {
10
+ this.id = id;
11
+ Object.defineProperty(this, "client", {
12
+ value: client,
13
+ enumerable: false,
14
+ writable: false,
15
+ configurable: false
16
+ });
17
+ }
18
+ static generateID(timestamp = Date.now()) {
19
+ if (timestamp instanceof Date) {
20
+ timestamp = timestamp.getTime();
21
+ }
22
+ return ((timestamp - DISCORD_EPOCH) << 22).toString();
23
+ }
24
+ static getCreatedAt(id) {
25
+ return new Date(Base.getDiscordEpoch(id) + DISCORD_EPOCH);
26
+ }
27
+ static getDiscordEpoch(id) {
28
+ return Number(BigInt(id) / 4194304n);
29
+ }
30
+ // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars
31
+ update(data) { }
32
+ get createdAt() {
33
+ return Base.getCreatedAt(this.id);
34
+ }
35
+ /** @hidden */
36
+ [node_util_1.inspect.custom]() {
37
+ // https://stackoverflow.com/questions/5905492/dynamic-function-name-in-javascript
38
+ const copy = new { [this.constructor.name]: class {
39
+ } }[this.constructor.name]();
40
+ for (const key in this) {
41
+ if (Object.hasOwn(this, key) && !key.startsWith("_") && this[key] !== undefined) {
42
+ copy[key] = this[key];
43
+ }
44
+ }
45
+ return copy;
46
+ }
47
+ toJSON() {
48
+ return {
49
+ createdAt: this.createdAt.getTime(),
50
+ id: this.id
51
+ };
52
+ }
53
+ toString() {
54
+ return `[${this.constructor.name} ${this.id}]`;
55
+ }
56
+ }
57
+ exports.default = Base;
58
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQmFzZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9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QUFJLElBQUksSUFBSSxDQUFDLEVBQUUsR0FBRyxDQUFDO0lBQ25ELENBQUM7Q0FDSjtBQTNERCx1QkEyREMifQ==
@@ -0,0 +1,19 @@
1
+ import Base from "./Base";
2
+ import type { EntitlementTypes } from "../Constants";
3
+ import type { RawBaseEntitlement } from "../types/applications";
4
+ import type Client from "../Client";
5
+ import type { JSONBaseEntitlement } from "../types";
6
+ /** Represents a base entitlement. See {@link TestEntitlement | TestEntitlement} and {@link Entitlement | Entitlement}. */
7
+ export default class BaseEntitlement extends Base {
8
+ applicationID: string;
9
+ consumed: boolean;
10
+ deleted: boolean;
11
+ giftCodeFlags: number;
12
+ guildID: string | null;
13
+ promotionID: string | null;
14
+ skuID: string;
15
+ type: EntitlementTypes;
16
+ userID: string | null;
17
+ constructor(data: RawBaseEntitlement, client: Client);
18
+ toJSON(): JSONBaseEntitlement;
19
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Base_1 = tslib_1.__importDefault(require("./Base"));
5
+ /** Represents a base entitlement. See {@link TestEntitlement | TestEntitlement} and {@link Entitlement | Entitlement}. */
6
+ class BaseEntitlement extends Base_1.default {
7
+ applicationID;
8
+ consumed;
9
+ deleted;
10
+ giftCodeFlags;
11
+ guildID;
12
+ promotionID;
13
+ skuID;
14
+ type;
15
+ userID;
16
+ constructor(data, client) {
17
+ super(data.id, client);
18
+ this.applicationID = data.application_id;
19
+ this.consumed = data.consumed;
20
+ this.deleted = data.deleted;
21
+ this.giftCodeFlags = data.gift_code_flags;
22
+ this.guildID = data.guild_id;
23
+ this.promotionID = data.promotion_id;
24
+ this.skuID = data.sku_id;
25
+ this.type = data.type;
26
+ this.userID = data.user_id;
27
+ }
28
+ toJSON() {
29
+ return {
30
+ ...super.toJSON(),
31
+ applicationID: this.applicationID,
32
+ consumed: this.consumed,
33
+ deleted: this.deleted,
34
+ giftCodeFlags: this.giftCodeFlags,
35
+ guildID: this.guildID,
36
+ promotionID: this.promotionID,
37
+ skuID: this.skuID,
38
+ type: this.type,
39
+ userID: this.userID
40
+ };
41
+ }
42
+ }
43
+ exports.default = BaseEntitlement;
44
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQmFzZUVudGl0bGVtZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vbGliL3N0cnVjdHVyZXMvQmFzZUVudGl0bGVtZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDBEQUEwQjtBQU0xQiwwSEFBMEg7QUFDMUgsTUFBcUIsZUFBZ0IsU0FBUSxjQUFJO0lBQzdDLGFBQWEsQ0FBUztJQUN0QixRQUFRLENBQVU7SUFDbEIsT0FBTyxDQUFVO0lBQ2pCLGFBQWEsQ0FBUztJQUN0QixPQUFPLENBQWdCO0lBQ3ZCLFdBQVcsQ0FBZ0I7SUFDM0IsS0FBSyxDQUFTO0lBQ2QsSUFBSSxDQUFtQjtJQUN2QixNQUFNLENBQWdCO0lBQ3RCLFlBQVksSUFBd0IsRUFBRSxNQUFjO1FBQ2hELEtBQUssQ0FBQyxJQUFJLENBQUMsRUFBRSxFQUFFLE1BQU0sQ0FBQyxDQUFDO1FBQ3ZCLElBQUksQ0FBQyxhQUFhLEdBQUcsSUFBSSxDQUFDLGNBQWMsQ0FBQztRQUN6QyxJQUFJLENBQUMsUUFBUSxHQUFHLElBQUksQ0FBQyxRQUFRLENBQUM7UUFDOUIsSUFBSSxDQUFDLE9BQU8sR0FBRyxJQUFJLENBQUMsT0FBTyxDQUFDO1FBQzVCLElBQUksQ0FBQyxhQUFhLEdBQUcsSUFBSSxDQUFDLGVBQWUsQ0FBQztRQUMxQyxJQUFJLENBQUMsT0FBTyxHQUFHLElBQUksQ0FBQyxRQUFRLENBQUM7UUFDN0IsSUFBSSxDQUFDLFdBQVcsR0FBRyxJQUFJLENBQUMsWUFBWSxDQUFDO1FBQ3JDLElBQUksQ0FBQyxLQUFLLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQztRQUN6QixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUM7UUFDdEIsSUFBSSxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUMsT0FBTyxDQUFDO0lBQy9CLENBQUM7SUFFUSxNQUFNO1FBQ1gsT0FBTztZQUNILEdBQUcsS0FBSyxDQUFDLE1BQU0sRUFBRTtZQUNqQixhQUFhLEVBQUUsSUFBSSxDQUFDLGFBQWE7WUFDakMsUUFBUSxFQUFPLElBQUksQ0FBQyxRQUFRO1lBQzVCLE9BQU8sRUFBUSxJQUFJLENBQUMsT0FBTztZQUMzQixhQUFhLEVBQUUsSUFBSSxDQUFDLGFBQWE7WUFDakMsT0FBTyxFQUFRLElBQUksQ0FBQyxPQUFPO1lBQzNCLFdBQVcsRUFBSSxJQUFJLENBQUMsV0FBVztZQUMvQixLQUFLLEVBQVUsSUFBSSxDQUFDLEtBQUs7WUFDekIsSUFBSSxFQUFXLElBQUksQ0FBQyxJQUFJO1lBQ3hCLE1BQU0sRUFBUyxJQUFJLENBQUMsTUFBTTtTQUM3QixDQUFDO0lBQ04sQ0FBQztDQUNKO0FBckNELGtDQXFDQyJ9
@@ -0,0 +1,41 @@
1
+ /** @module CategoryChannel */
2
+ import PermissionOverwrite from "./PermissionOverwrite";
3
+ import GuildChannel from "./GuildChannel";
4
+ import type Member from "./Member";
5
+ import Permission from "./Permission";
6
+ import type Client from "../Client";
7
+ import { type ChannelTypes } from "../Constants";
8
+ import TypedCollection from "../util/TypedCollection";
9
+ import type { EditPermissionOptions, RawCategoryChannel, RawOverwrite } from "../types/channels";
10
+ import type { JSONCategoryChannel } from "../types/json";
11
+ import Collection from "../util/Collection";
12
+ /** Represents a guild category channel. */
13
+ export default class CategoryChannel extends GuildChannel {
14
+ /** The permission overwrites of this channel. */
15
+ permissionOverwrites: TypedCollection<RawOverwrite, PermissionOverwrite>;
16
+ /** The position of this channel on the sidebar. */
17
+ position: number;
18
+ type: ChannelTypes.GUILD_CATEGORY;
19
+ constructor(data: RawCategoryChannel, client: Client);
20
+ protected update(data: Partial<RawCategoryChannel>): void;
21
+ /** The channels in this category. The returned collection is disposable. */
22
+ get channels(): Collection<string, GuildChannel>;
23
+ /**
24
+ * Delete a permission overwrite on this channel.
25
+ * @param overwriteID The ID of the permission overwrite to delete.
26
+ * @param reason The reason for deleting the permission overwrite.
27
+ */
28
+ deletePermission(overwriteID: string, reason?: string): Promise<void>;
29
+ /**
30
+ * Edit a permission overwrite on this channel.
31
+ * @param overwriteID The ID of the permission overwrite to edit.
32
+ * @param options The options for editing the permission overwrite.
33
+ */
34
+ editPermission(overwriteID: string, options: EditPermissionOptions): Promise<void>;
35
+ /**
36
+ * Get the permissions of a member. If providing an id, the member must be cached.
37
+ * @param member The member to get the permissions of.
38
+ */
39
+ permissionsOf(member: string | Member): Permission;
40
+ toJSON(): JSONCategoryChannel;
41
+ }