@discordjs/structures 0.2.0-core-gateway-rl.1762368996-5fa92a1ea
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/LICENSE +191 -0
- package/README.md +70 -0
- package/dist/index.d.mts +1400 -0
- package/dist/index.d.ts +1400 -0
- package/dist/index.js +1951 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1884 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +97 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1400 @@
|
|
|
1
|
+
import { ChannelFlags, PermissionFlagsBits, GuildChannelType, ChannelType, ThreadChannelType, GuildTextChannelType, TextChannelType, APIChannel, APIPartialChannel, APIGuildForumTag, APIOverwrite, APIThreadMetadata, APINewsChannel, APIAnnouncementThreadChannel, APIGuildCategoryChannel, APIDMChannel, APIGuildForumChannel, APIGroupDMChannel, APIGuildMediaChannel, APIPrivateThreadChannel, APIPublicThreadChannel, APIGuildStageVoiceChannel, APITextChannel, APIGuildVoiceChannel, APIInvite, APIExtendedInvite, APIAvatarDecorationData, APIUser, APIConnection } from 'discord-api-types/v10';
|
|
2
|
+
|
|
3
|
+
type ReplaceOmittedWithUnknown<Omitted extends keyof Data | '', Data> = {
|
|
4
|
+
[Key in keyof Data]: Key extends Omitted ? unknown : Data[Key];
|
|
5
|
+
};
|
|
6
|
+
type CollapseUnion<Type> = Type extends infer Union ? {
|
|
7
|
+
[Key in keyof Union]: Union[Key];
|
|
8
|
+
} : never;
|
|
9
|
+
type OptionalPropertyNames<Type> = {
|
|
10
|
+
[Key in keyof Type]-?: {} extends {
|
|
11
|
+
[Prop in Key]: Type[Key];
|
|
12
|
+
} ? Key : never;
|
|
13
|
+
}[keyof Type];
|
|
14
|
+
type MergePrototype<Class1, Class2> = Pick<Class1, Exclude<keyof Class1, keyof Class2>> & Pick<Class2, Exclude<keyof Class2, OptionalPropertyNames<Class2>>> & Pick<Class2, Exclude<OptionalPropertyNames<Class2>, keyof Class1>> & {
|
|
15
|
+
[Prop in OptionalPropertyNames<Class2> & keyof Class1]: Class1[Prop] | Exclude<Class2[Prop], undefined>;
|
|
16
|
+
};
|
|
17
|
+
type MergePrototypes<ClassArray extends readonly unknown[]> = ClassArray extends [infer Class1] ? Class1 : ClassArray extends [infer Class1, ...infer Rest] ? MergePrototype<Class1, MergePrototypes<Rest>> : never;
|
|
18
|
+
interface RecursiveReadonlyArray<ItemType> extends ReadonlyArray<ItemType | RecursiveReadonlyArray<ItemType>> {
|
|
19
|
+
}
|
|
20
|
+
type EnumLike<Enum, Value> = Record<keyof Enum, Value>;
|
|
21
|
+
type If<Check, Value, True, False = never> = Check extends Value ? (Value extends Check ? True : False) : False;
|
|
22
|
+
type NonAbstract<Type extends abstract new (...args: any) => any> = Type extends abstract new (...args: infer Args) => infer Instance ? Pick<Type, keyof Type> & (new (...args: Args) => Instance) : never;
|
|
23
|
+
type Partialize<Type, Omitted extends keyof Type | ''> = Omit<Type, Omitted> & Partial<Pick<Type, Exclude<Omitted, ''>>>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Data that can be resolved to give a bit field. This can be:
|
|
27
|
+
* A bit number (this can be a number literal or a value taken from {@link (BitField:class).Flags})
|
|
28
|
+
* A string bit number
|
|
29
|
+
* An instance of BitField
|
|
30
|
+
* An Array of BitFieldResolvable
|
|
31
|
+
*/
|
|
32
|
+
type BitFieldResolvable<Flags extends string> = Flags | Readonly<BitField<Flags>> | RecursiveReadonlyArray<Flags | Readonly<BitField<Flags>> | bigint | number | `${bigint}`> | bigint | number | `${bigint}`;
|
|
33
|
+
/**
|
|
34
|
+
* Data structure that makes it easy to interact with a bit field.
|
|
35
|
+
*/
|
|
36
|
+
declare abstract class BitField<Flags extends string> {
|
|
37
|
+
/**
|
|
38
|
+
* Numeric bit field flags.
|
|
39
|
+
*
|
|
40
|
+
* @remarks Defined in extension classes
|
|
41
|
+
*/
|
|
42
|
+
static readonly Flags: EnumLike<unknown, bigint | number>;
|
|
43
|
+
static readonly DefaultBit: bigint;
|
|
44
|
+
/**
|
|
45
|
+
* Bitfield of the packed bits
|
|
46
|
+
*/
|
|
47
|
+
bitField: bigint;
|
|
48
|
+
['constructor']: NonAbstract<typeof BitField<Flags>>;
|
|
49
|
+
/**
|
|
50
|
+
* @param bits - Bit(s) to read from
|
|
51
|
+
*/
|
|
52
|
+
constructor(bits?: BitFieldResolvable<Flags>);
|
|
53
|
+
/**
|
|
54
|
+
* Checks whether the bit field has a bit, or any of multiple bits.
|
|
55
|
+
*
|
|
56
|
+
* @param bit - Bit(s) to check for
|
|
57
|
+
* @returns Whether the bit field has the bit(s)
|
|
58
|
+
*/
|
|
59
|
+
any(bit: BitFieldResolvable<Flags>): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Checks if this bit field equals another
|
|
62
|
+
*
|
|
63
|
+
* @param bit - Bit(s) to check for
|
|
64
|
+
* @returns Whether this bit field equals the other
|
|
65
|
+
*/
|
|
66
|
+
equals(bit: BitFieldResolvable<Flags>): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Checks whether the bit field has a bit, or multiple bits.
|
|
69
|
+
*
|
|
70
|
+
* @param bit - Bit(s) to check for
|
|
71
|
+
* @returns Whether the bit field has the bit(s)
|
|
72
|
+
*/
|
|
73
|
+
has(bit: BitFieldResolvable<Flags>, ..._hasParams: unknown[]): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Gets all given bits that are missing from the bit field.
|
|
76
|
+
*
|
|
77
|
+
* @param bits - Bit(s) to check for
|
|
78
|
+
* @param hasParams - Additional parameters for the has method, if any
|
|
79
|
+
* @returns A bit field containing the missing bits
|
|
80
|
+
*/
|
|
81
|
+
missing(bits: BitFieldResolvable<Flags>, ...hasParams: readonly unknown[]): Flags[];
|
|
82
|
+
/**
|
|
83
|
+
* Freezes these bits, making them immutable.
|
|
84
|
+
*
|
|
85
|
+
* @returns This bit field but frozen
|
|
86
|
+
*/
|
|
87
|
+
freeze(): Readonly<this>;
|
|
88
|
+
/**
|
|
89
|
+
* Adds bits to these ones.
|
|
90
|
+
*
|
|
91
|
+
* @param bits - Bits to add
|
|
92
|
+
* @returns These bits or new BitField if the instance is frozen.
|
|
93
|
+
*/
|
|
94
|
+
add(...bits: BitFieldResolvable<Flags>[]): BitField<Flags>;
|
|
95
|
+
/**
|
|
96
|
+
* Removes bits from these.
|
|
97
|
+
*
|
|
98
|
+
* @param bits - Bits to remove
|
|
99
|
+
* @returns These bits or new BitField if the instance is frozen.
|
|
100
|
+
*/
|
|
101
|
+
remove(...bits: BitFieldResolvable<Flags>[]): BitField<Flags>;
|
|
102
|
+
/**
|
|
103
|
+
* Gets an object mapping field names to a boolean indicating whether the bit is available.
|
|
104
|
+
*
|
|
105
|
+
* @param hasParams - Additional parameters for the has method, if any
|
|
106
|
+
* @returns An object mapping field names to a boolean indicating whether the bit is available
|
|
107
|
+
*/
|
|
108
|
+
serialize(...hasParams: readonly unknown[]): Partial<Record<keyof Flags, boolean>>;
|
|
109
|
+
/**
|
|
110
|
+
* Gets an Array of bit field names based on the bits available.
|
|
111
|
+
*
|
|
112
|
+
* @param hasParams - Additional parameters for the has method, if any
|
|
113
|
+
* @returns An Array of bit field names
|
|
114
|
+
*/
|
|
115
|
+
toArray(...hasParams: readonly unknown[]): Flags[];
|
|
116
|
+
toJSON(asNumber?: boolean): string | number;
|
|
117
|
+
valueOf(): bigint;
|
|
118
|
+
[Symbol.iterator](...hasParams: unknown[]): Generator<Flags, void, unknown>;
|
|
119
|
+
/**
|
|
120
|
+
* Resolves bit fields to their numeric form.
|
|
121
|
+
*
|
|
122
|
+
* @param bit - bit(s) to resolve
|
|
123
|
+
* @returns the numeric value of the bit fields
|
|
124
|
+
*/
|
|
125
|
+
static resolve<Flags extends string = string>(bit: BitFieldResolvable<Flags>): bigint;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Data structure that makes it easy to interact with a {@link (Channel:class).flags} bitfield.
|
|
130
|
+
*/
|
|
131
|
+
declare class ChannelFlagsBitField extends BitField<keyof ChannelFlags> {
|
|
132
|
+
/**
|
|
133
|
+
* Numeric guild channel flags.
|
|
134
|
+
*/
|
|
135
|
+
static readonly Flags: typeof ChannelFlags;
|
|
136
|
+
toJSON(): string | number;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Data structure that makes it easy to interact with a permission bit field. All {@link GuildMember}s have a set of
|
|
141
|
+
* permissions in their guild, and each channel in the guild may also have {@link PermissionOverwrite}s for the member
|
|
142
|
+
* that override their default permissions.
|
|
143
|
+
*/
|
|
144
|
+
declare class PermissionsBitField extends BitField<keyof typeof PermissionFlagsBits> {
|
|
145
|
+
/**
|
|
146
|
+
* Numeric permission flags.
|
|
147
|
+
*
|
|
148
|
+
* @see {@link https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags}
|
|
149
|
+
*/
|
|
150
|
+
static Flags: {
|
|
151
|
+
readonly CreateInstantInvite: bigint;
|
|
152
|
+
readonly KickMembers: bigint;
|
|
153
|
+
readonly BanMembers: bigint;
|
|
154
|
+
readonly Administrator: bigint;
|
|
155
|
+
readonly ManageChannels: bigint;
|
|
156
|
+
readonly ManageGuild: bigint;
|
|
157
|
+
readonly AddReactions: bigint;
|
|
158
|
+
readonly ViewAuditLog: bigint;
|
|
159
|
+
readonly PrioritySpeaker: bigint;
|
|
160
|
+
readonly Stream: bigint;
|
|
161
|
+
readonly ViewChannel: bigint;
|
|
162
|
+
readonly SendMessages: bigint;
|
|
163
|
+
readonly SendTTSMessages: bigint;
|
|
164
|
+
readonly ManageMessages: bigint;
|
|
165
|
+
readonly EmbedLinks: bigint;
|
|
166
|
+
readonly AttachFiles: bigint;
|
|
167
|
+
readonly ReadMessageHistory: bigint;
|
|
168
|
+
readonly MentionEveryone: bigint;
|
|
169
|
+
readonly UseExternalEmojis: bigint;
|
|
170
|
+
readonly ViewGuildInsights: bigint;
|
|
171
|
+
readonly Connect: bigint;
|
|
172
|
+
readonly Speak: bigint;
|
|
173
|
+
readonly MuteMembers: bigint;
|
|
174
|
+
readonly DeafenMembers: bigint;
|
|
175
|
+
readonly MoveMembers: bigint;
|
|
176
|
+
readonly UseVAD: bigint;
|
|
177
|
+
readonly ChangeNickname: bigint;
|
|
178
|
+
readonly ManageNicknames: bigint;
|
|
179
|
+
readonly ManageRoles: bigint;
|
|
180
|
+
readonly ManageWebhooks: bigint;
|
|
181
|
+
readonly ManageEmojisAndStickers: bigint;
|
|
182
|
+
readonly ManageGuildExpressions: bigint;
|
|
183
|
+
readonly UseApplicationCommands: bigint;
|
|
184
|
+
readonly RequestToSpeak: bigint;
|
|
185
|
+
readonly ManageEvents: bigint;
|
|
186
|
+
readonly ManageThreads: bigint;
|
|
187
|
+
readonly CreatePublicThreads: bigint;
|
|
188
|
+
readonly CreatePrivateThreads: bigint;
|
|
189
|
+
readonly UseExternalStickers: bigint;
|
|
190
|
+
readonly SendMessagesInThreads: bigint;
|
|
191
|
+
readonly UseEmbeddedActivities: bigint;
|
|
192
|
+
readonly ModerateMembers: bigint;
|
|
193
|
+
readonly ViewCreatorMonetizationAnalytics: bigint;
|
|
194
|
+
readonly UseSoundboard: bigint;
|
|
195
|
+
readonly CreateGuildExpressions: bigint;
|
|
196
|
+
readonly CreateEvents: bigint;
|
|
197
|
+
readonly UseExternalSounds: bigint;
|
|
198
|
+
readonly SendVoiceMessages: bigint;
|
|
199
|
+
readonly SendPolls: bigint;
|
|
200
|
+
readonly UseExternalApps: bigint;
|
|
201
|
+
readonly PinMessages: bigint;
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* Bit field representing every permission combined
|
|
205
|
+
*/
|
|
206
|
+
static readonly All: bigint;
|
|
207
|
+
/**
|
|
208
|
+
* Bit field representing the default permissions for users
|
|
209
|
+
*/
|
|
210
|
+
static readonly Default = 104324673n;
|
|
211
|
+
/**
|
|
212
|
+
* Bit field representing the permissions required for moderators of stage channels
|
|
213
|
+
*/
|
|
214
|
+
static readonly StageModerator: bigint;
|
|
215
|
+
/**
|
|
216
|
+
* Gets all given bits that are missing from the bit field.
|
|
217
|
+
*
|
|
218
|
+
* @param bits - Bit(s) to check for
|
|
219
|
+
* @param checkAdmin - Whether to allow the administrator permission to override
|
|
220
|
+
* @returns A bit field containing the missing permissions
|
|
221
|
+
*/
|
|
222
|
+
missing(bits: BitFieldResolvable<keyof typeof PermissionFlagsBits>, checkAdmin?: boolean): ("CreateInstantInvite" | "KickMembers" | "BanMembers" | "Administrator" | "ManageChannels" | "ManageGuild" | "AddReactions" | "ViewAuditLog" | "PrioritySpeaker" | "Stream" | "ViewChannel" | "SendMessages" | "SendTTSMessages" | "ManageMessages" | "EmbedLinks" | "AttachFiles" | "ReadMessageHistory" | "MentionEveryone" | "UseExternalEmojis" | "ViewGuildInsights" | "Connect" | "Speak" | "MuteMembers" | "DeafenMembers" | "MoveMembers" | "UseVAD" | "ChangeNickname" | "ManageNicknames" | "ManageRoles" | "ManageWebhooks" | "ManageEmojisAndStickers" | "ManageGuildExpressions" | "UseApplicationCommands" | "RequestToSpeak" | "ManageEvents" | "ManageThreads" | "CreatePublicThreads" | "CreatePrivateThreads" | "UseExternalStickers" | "SendMessagesInThreads" | "UseEmbeddedActivities" | "ModerateMembers" | "ViewCreatorMonetizationAnalytics" | "UseSoundboard" | "CreateGuildExpressions" | "CreateEvents" | "UseExternalSounds" | "SendVoiceMessages" | "SendPolls" | "UseExternalApps" | "PinMessages")[];
|
|
223
|
+
/**
|
|
224
|
+
* Checks whether the bit field has a permission, or any of multiple permissions.
|
|
225
|
+
*
|
|
226
|
+
* @param permission - Permission(s) to check for
|
|
227
|
+
* @param checkAdmin - Whether to allow the administrator permission to override
|
|
228
|
+
* @returns Whether the bit field has the permission(s)
|
|
229
|
+
*/
|
|
230
|
+
any(permission: BitFieldResolvable<keyof typeof PermissionFlagsBits>, checkAdmin?: boolean): boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Checks whether the bit field has a permission, or multiple permissions.
|
|
233
|
+
*
|
|
234
|
+
* @param permission - Permission(s) to check for
|
|
235
|
+
* @param checkAdmin - Whether to allow the administrator permission to override
|
|
236
|
+
* @returns Whether the bit field has the permission(s)
|
|
237
|
+
*/
|
|
238
|
+
has(permission: BitFieldResolvable<keyof typeof PermissionFlagsBits>, checkAdmin?: boolean): boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Gets an Array of bitfield names based on the permissions available.
|
|
241
|
+
*
|
|
242
|
+
* @returns An Array of permission names
|
|
243
|
+
*/
|
|
244
|
+
toArray(): ("CreateInstantInvite" | "KickMembers" | "BanMembers" | "Administrator" | "ManageChannels" | "ManageGuild" | "AddReactions" | "ViewAuditLog" | "PrioritySpeaker" | "Stream" | "ViewChannel" | "SendMessages" | "SendTTSMessages" | "ManageMessages" | "EmbedLinks" | "AttachFiles" | "ReadMessageHistory" | "MentionEveryone" | "UseExternalEmojis" | "ViewGuildInsights" | "Connect" | "Speak" | "MuteMembers" | "DeafenMembers" | "MoveMembers" | "UseVAD" | "ChangeNickname" | "ManageNicknames" | "ManageRoles" | "ManageWebhooks" | "ManageEmojisAndStickers" | "ManageGuildExpressions" | "UseApplicationCommands" | "RequestToSpeak" | "ManageEvents" | "ManageThreads" | "CreatePublicThreads" | "CreatePrivateThreads" | "UseExternalStickers" | "SendMessagesInThreads" | "UseEmbeddedActivities" | "ModerateMembers" | "ViewCreatorMonetizationAnalytics" | "UseSoundboard" | "CreateGuildExpressions" | "CreateEvents" | "UseExternalSounds" | "SendVoiceMessages" | "SendPolls" | "UseExternalApps" | "PinMessages")[];
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
declare const kData: unique symbol;
|
|
248
|
+
declare const kClone: unique symbol;
|
|
249
|
+
declare const kPatch: unique symbol;
|
|
250
|
+
declare const kExpiresTimestamp: unique symbol;
|
|
251
|
+
declare const kCreatedTimestamp: unique symbol;
|
|
252
|
+
declare const kArchiveTimestamp: unique symbol;
|
|
253
|
+
declare const kAllow: unique symbol;
|
|
254
|
+
declare const kDeny: unique symbol;
|
|
255
|
+
declare const kLastPinTimestamp: unique symbol;
|
|
256
|
+
declare const kMixinConstruct: unique symbol;
|
|
257
|
+
declare const kMixinToJSON: unique symbol;
|
|
258
|
+
|
|
259
|
+
declare const DataTemplatePropertyName = "DataTemplate";
|
|
260
|
+
declare const OptimizeDataPropertyName = "optimizeData";
|
|
261
|
+
/**
|
|
262
|
+
* Represents a data model from the Discord API
|
|
263
|
+
*
|
|
264
|
+
* @privateRemarks
|
|
265
|
+
* Explanation of the type complexity surround Structure:
|
|
266
|
+
*
|
|
267
|
+
* There are two layers of Omitted generics, one here, which allows omitting things at the library level so we do not accidentally
|
|
268
|
+
* access them, in addition to whatever the user does at the layer above.
|
|
269
|
+
*
|
|
270
|
+
* The second layer, in the exported structure is effectively a type cast that allows the getters types to match whatever data template is used
|
|
271
|
+
*
|
|
272
|
+
* In order to safely set and access this data, the constructor and patch take data as "partial" and forcibly assigns it to kData. To accommodate this,
|
|
273
|
+
* kData stores properties as `unknown` when it is omitted, which allows accessing the property in getters even when it may not actually be present.
|
|
274
|
+
* This is the most technically correct way of representing the value, especially since there is no way to guarantee runtime matches the "type cast."
|
|
275
|
+
*/
|
|
276
|
+
declare abstract class Structure<DataType extends {}, Omitted extends keyof DataType | '' = ''> {
|
|
277
|
+
/**
|
|
278
|
+
* A construct function used when mixing to allow mixins to set optimized property defaults
|
|
279
|
+
*
|
|
280
|
+
* @internal
|
|
281
|
+
* @remarks This should only be used to set defaults, setting optimized values should be done
|
|
282
|
+
* in the mixins `optimizeData` method, which will be called automatically.
|
|
283
|
+
* @param data - The full API data received by the Structure
|
|
284
|
+
*/
|
|
285
|
+
protected [kMixinConstruct]?(data: Partial<DataType>): void;
|
|
286
|
+
/**
|
|
287
|
+
* A function used when mixing to allow mixins to add properties to the result of toJSON
|
|
288
|
+
*
|
|
289
|
+
* @internal
|
|
290
|
+
* @remarks This should only be used to add properties that the mixin optimizes, if the raw
|
|
291
|
+
* JSON data is unchanged the property will already be returned.
|
|
292
|
+
* @param data - The result of the base class toJSON Structure before it gets returned
|
|
293
|
+
*/
|
|
294
|
+
protected [kMixinToJSON]?(data: Partial<DataType>): void;
|
|
295
|
+
/**
|
|
296
|
+
* The template used for removing data from the raw data stored for each Structure.
|
|
297
|
+
*
|
|
298
|
+
* @remarks This template should be overridden in all subclasses to provide more accurate type information.
|
|
299
|
+
* The template in the base {@link Structure} class will have no effect on most subclasses for this reason.
|
|
300
|
+
*/
|
|
301
|
+
protected static readonly DataTemplate: Record<string, unknown>;
|
|
302
|
+
/**
|
|
303
|
+
* @returns A cloned version of the data template, ready to create a new data object.
|
|
304
|
+
*/
|
|
305
|
+
private getDataTemplate;
|
|
306
|
+
/**
|
|
307
|
+
* The raw data from the API for this structure
|
|
308
|
+
*
|
|
309
|
+
* @internal
|
|
310
|
+
*/
|
|
311
|
+
protected [kData]: Readonly<ReplaceOmittedWithUnknown<Omitted, DataType>>;
|
|
312
|
+
/**
|
|
313
|
+
* Creates a new structure to represent API data
|
|
314
|
+
*
|
|
315
|
+
* @param data - the data from the API that this structure will represent
|
|
316
|
+
* @remarks To be made public in subclasses
|
|
317
|
+
* @internal
|
|
318
|
+
*/
|
|
319
|
+
constructor(data: Readonly<Partial<DataType>>, ..._rest: unknown[]);
|
|
320
|
+
/**
|
|
321
|
+
* Patches the raw data of this object in place
|
|
322
|
+
*
|
|
323
|
+
* @param data - the updated data from the API to patch with
|
|
324
|
+
* @remarks To be made public in subclasses
|
|
325
|
+
* @returns this
|
|
326
|
+
* @internal
|
|
327
|
+
*/
|
|
328
|
+
protected [kPatch](data: Readonly<Partial<DataType>>): this;
|
|
329
|
+
/**
|
|
330
|
+
* Creates a clone of this structure
|
|
331
|
+
*
|
|
332
|
+
* @returns a clone of this
|
|
333
|
+
* @internal
|
|
334
|
+
*/
|
|
335
|
+
protected [kClone](patchPayload?: Readonly<Partial<DataType>>): typeof this;
|
|
336
|
+
/**
|
|
337
|
+
* Function called to ensure stored raw data is in optimized formats, used in tandem with a data template
|
|
338
|
+
*
|
|
339
|
+
* @example created_timestamp is an ISO string, this can be stored in optimized form as a number
|
|
340
|
+
* @param _data - the raw data received from the API to optimize
|
|
341
|
+
* @remarks Implementation to be done in subclasses and mixins where needed.
|
|
342
|
+
* For typescript users, mixins must use the closest ancestors access modifier.
|
|
343
|
+
* @remarks Automatically called in Structure[kPatch] but must be called manually in the constructor
|
|
344
|
+
* of any class implementing this method.
|
|
345
|
+
* @remarks Additionally, when implementing, ensure to call `super._optimizeData` if any class in the super chain aside
|
|
346
|
+
* from Structure contains an implementation.
|
|
347
|
+
* Note: mixins do not need to call super ever as the process of mixing walks the prototype chain.
|
|
348
|
+
* @virtual
|
|
349
|
+
* @internal
|
|
350
|
+
*/
|
|
351
|
+
protected optimizeData(_data: Partial<DataType>): void;
|
|
352
|
+
/**
|
|
353
|
+
* Transforms this object to its JSON format with raw API data (or close to it),
|
|
354
|
+
* automatically called by `JSON.stringify()` when this structure is stringified
|
|
355
|
+
*
|
|
356
|
+
* @remarks
|
|
357
|
+
* The type of this data is determined by omissions at runtime and is only guaranteed for default omissions
|
|
358
|
+
* @privateRemarks
|
|
359
|
+
* When omitting properties at the library level, this must be overridden to re-add those properties
|
|
360
|
+
*/
|
|
361
|
+
toJSON(): DataType;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
interface ChannelPermissionMixin<Type extends Exclude<GuildChannelType, ChannelType.GuildDirectory | ThreadChannelType> = Exclude<GuildChannelType, ChannelType.GuildDirectory | ThreadChannelType>> extends Channel<Type> {
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* @remarks has an array of sub-structures {@link PermissionOverwrite} that extending mixins should add to their DataTemplate and _optimizeData
|
|
368
|
+
*/
|
|
369
|
+
declare class ChannelPermissionMixin<Type extends Exclude<GuildChannelType, ChannelType.GuildDirectory | ThreadChannelType> = Exclude<GuildChannelType, ChannelType.GuildDirectory | ThreadChannelType>> {
|
|
370
|
+
/**
|
|
371
|
+
* The sorting position of the channel
|
|
372
|
+
*/
|
|
373
|
+
get position(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["position"];
|
|
374
|
+
/**
|
|
375
|
+
* Indicates whether this channel can have permission overwrites
|
|
376
|
+
*/
|
|
377
|
+
isPermissionCapable(): this is ChannelPermissionMixin & this;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
interface ChannelWebhookMixin<Type extends ChannelType.GuildForum | ChannelType.GuildMedia | Exclude<GuildTextChannelType, ThreadChannelType> = ChannelType.GuildForum | ChannelType.GuildMedia | Exclude<GuildTextChannelType, ThreadChannelType>> extends Channel<Type> {
|
|
381
|
+
}
|
|
382
|
+
declare class ChannelWebhookMixin<Type extends ChannelType.GuildForum | ChannelType.GuildMedia | Exclude<GuildTextChannelType, ThreadChannelType> = ChannelType.GuildForum | ChannelType.GuildMedia | Exclude<GuildTextChannelType, ThreadChannelType>> {
|
|
383
|
+
/**
|
|
384
|
+
* Indicates whether this channel can have webhooks
|
|
385
|
+
*/
|
|
386
|
+
isWebhookCapable(): this is ChannelWebhookMixin & this;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
interface DMChannelMixin<Type extends ChannelType.DM | ChannelType.GroupDM = ChannelType.DM | ChannelType.GroupDM> extends Channel<Type> {
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* @remarks has recipients, an array of sub-structures {@link User} that extending mixins should add to their DataTemplate and _optimizeData
|
|
393
|
+
*/
|
|
394
|
+
declare class DMChannelMixin<Type extends ChannelType.DM | ChannelType.GroupDM = ChannelType.DM | ChannelType.GroupDM> {
|
|
395
|
+
/**
|
|
396
|
+
* The URL to this channel.
|
|
397
|
+
*/
|
|
398
|
+
get url(): `https://discord.com/channels/@me/${ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["id"]}`;
|
|
399
|
+
/**
|
|
400
|
+
* Indicates whether this channel is a DM or DM Group
|
|
401
|
+
*/
|
|
402
|
+
isDMBased(): this is DMChannelMixin & this;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
interface GuildChannelMixin<Type extends GuildChannelType = GuildChannelType> extends Channel<Type> {
|
|
406
|
+
}
|
|
407
|
+
declare class GuildChannelMixin<Type extends GuildChannelType = GuildChannelType> {
|
|
408
|
+
/**
|
|
409
|
+
* The flags that are applied to the channel.
|
|
410
|
+
*
|
|
411
|
+
* @privateRemarks The type of `flags` can be narrowed in Guild Channels and DMChannel to ChannelFlags, and in GroupDM channel
|
|
412
|
+
* to null, respecting Omit behaviors
|
|
413
|
+
*/
|
|
414
|
+
get flags(): ChannelFlagsBitField | null;
|
|
415
|
+
/**
|
|
416
|
+
* THe id of the guild this channel is in.
|
|
417
|
+
*/
|
|
418
|
+
get guildId(): NonNullable<ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["guild_id"]>;
|
|
419
|
+
/**
|
|
420
|
+
* The URL to this channel.
|
|
421
|
+
*/
|
|
422
|
+
get url(): `https://discord.com/channels/${NonNullable<ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["guild_id"]>}/${ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["id"]}`;
|
|
423
|
+
/**
|
|
424
|
+
* Indicates whether this channel is in a guild
|
|
425
|
+
*/
|
|
426
|
+
isGuildBased(): this is GuildChannelMixin & this;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
interface TextChannelMixin<Type extends TextChannelType = TextChannelType> extends Channel<Type> {
|
|
430
|
+
}
|
|
431
|
+
declare class TextChannelMixin<Type extends TextChannelType = TextChannelType> {
|
|
432
|
+
/**
|
|
433
|
+
* The id of the last message sent in this channel.
|
|
434
|
+
*/
|
|
435
|
+
get lastMessageId(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["last_message_id"] | undefined;
|
|
436
|
+
/**
|
|
437
|
+
* Indicates whether this channel can contain messages
|
|
438
|
+
*/
|
|
439
|
+
isTextBased(): this is TextChannelMixin & this;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
interface ThreadChannelMixin<Type extends ThreadChannelType = ThreadChannelType> extends Channel<Type> {
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* @remarks has a sub-structure {@link ThreadMetadata} that extending mixins should add to their DataTemplate and _optimizeData
|
|
446
|
+
*/
|
|
447
|
+
declare class ThreadChannelMixin<Type extends ThreadChannelType = ThreadChannelType> {
|
|
448
|
+
/**
|
|
449
|
+
* The approximate count of users in a thread, stops counting at 50
|
|
450
|
+
*/
|
|
451
|
+
get memberCount(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["member_count"] | undefined;
|
|
452
|
+
/**
|
|
453
|
+
* The number of messages (not including the initial message or deleted messages) in a thread.
|
|
454
|
+
*/
|
|
455
|
+
get messageCount(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["message_count"] | undefined;
|
|
456
|
+
/**
|
|
457
|
+
* The number of messages ever sent in a thread, it's similar to message_count on message creation,
|
|
458
|
+
* but will not decrement the number when a message is deleted.
|
|
459
|
+
*/
|
|
460
|
+
get totalMessageSent(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["total_message_sent"] | undefined;
|
|
461
|
+
/**
|
|
462
|
+
* Indicates whether this channel is a thread channel
|
|
463
|
+
*/
|
|
464
|
+
isThread(): this is ThreadChannelMixin & this;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
interface ThreadOnlyChannelMixin<Type extends ChannelType.GuildForum | ChannelType.GuildMedia = ChannelType.GuildForum | ChannelType.GuildMedia> extends Channel<Type> {
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* @remarks has an array of sub-structures {@link ForumTag} that extending mixins should add to their DataTemplate and _optimizeData
|
|
471
|
+
*/
|
|
472
|
+
declare class ThreadOnlyChannelMixin<Type extends ChannelType.GuildForum | ChannelType.GuildMedia = ChannelType.GuildForum | ChannelType.GuildMedia> {
|
|
473
|
+
/**
|
|
474
|
+
* The emoji to show in the add reaction button on a thread in this channel.
|
|
475
|
+
*/
|
|
476
|
+
get defaultReactionEmoji(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["default_reaction_emoji"];
|
|
477
|
+
/**
|
|
478
|
+
* The default sort order type used to order posts in this channel.
|
|
479
|
+
*
|
|
480
|
+
* @defaultValue `null` – indicates a preferred sort order hasn't been set.
|
|
481
|
+
*/
|
|
482
|
+
get defaultSortOrder(): NonNullable<ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["default_sort_order"]>;
|
|
483
|
+
/**
|
|
484
|
+
* Indicates whether this channel only allows thread creation
|
|
485
|
+
*/
|
|
486
|
+
isThreadOnly(): this is ThreadOnlyChannelMixin & this;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
interface VoiceChannelMixin<Type extends ChannelType.GuildStageVoice | ChannelType.GuildVoice = ChannelType.GuildStageVoice | ChannelType.GuildVoice> extends Channel<Type> {
|
|
490
|
+
}
|
|
491
|
+
declare class VoiceChannelMixin<Type extends ChannelType.GuildStageVoice | ChannelType.GuildVoice = ChannelType.GuildStageVoice | ChannelType.GuildVoice> extends TextChannelMixin<Type> {
|
|
492
|
+
/**
|
|
493
|
+
* The bitrate (in bits) of the voice channel.
|
|
494
|
+
*/
|
|
495
|
+
get bitrate(): NonNullable<ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["bitrate"]>;
|
|
496
|
+
/**
|
|
497
|
+
* The voice region id for this channel, automatic when set to null.
|
|
498
|
+
*/
|
|
499
|
+
get rtcRegion(): NonNullable<ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["rtc_region"]>;
|
|
500
|
+
/**
|
|
501
|
+
* The camera video quality mode of the voice channel, {@link discord-api-types/v10#(VideoQualityMode:enum) | Auto} when not present.
|
|
502
|
+
*/
|
|
503
|
+
get videoQualityMode(): NonNullable<ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["video_quality_mode"]>;
|
|
504
|
+
/**
|
|
505
|
+
* The user limit of the voice channel.
|
|
506
|
+
*/
|
|
507
|
+
get userLimit(): NonNullable<ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["user_limit"]>;
|
|
508
|
+
/**
|
|
509
|
+
* Indicates whether this channel has voice connection capabilities
|
|
510
|
+
*/
|
|
511
|
+
isVoiceBased(): this is VoiceChannelMixin & this;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
type PartialChannel = Channel<ChannelType, Exclude<keyof APIChannel, keyof APIPartialChannel>>;
|
|
515
|
+
/**
|
|
516
|
+
* The data stored by a {@link Channel} structure based on its {@link (Channel:class)."type"} property.
|
|
517
|
+
*/
|
|
518
|
+
type ChannelDataType<Type extends ChannelType | 'unknown'> = Type extends ChannelType ? Extract<APIChannel, {
|
|
519
|
+
type: Type;
|
|
520
|
+
}> : APIPartialChannel;
|
|
521
|
+
/**
|
|
522
|
+
* Represents any channel on Discord.
|
|
523
|
+
*
|
|
524
|
+
* @typeParam Type - Specify the type of the channel being constructed for more accurate data types
|
|
525
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
526
|
+
* @remarks Although this class _can_ be instantiated directly for any channel type,
|
|
527
|
+
* it's intended to be subclassed with the appropriate mixins for each channel type.
|
|
528
|
+
*/
|
|
529
|
+
declare class Channel<Type extends ChannelType | 'unknown' = ChannelType, Omitted extends keyof ChannelDataType<Type> | '' = ''> extends Structure<ChannelDataType<Type>, Omitted> {
|
|
530
|
+
/**
|
|
531
|
+
* The template used for removing data from the raw data stored for each Channel.
|
|
532
|
+
*
|
|
533
|
+
* @remarks This template is only guaranteed to apply to channels constructed directly via `new Channel()`.
|
|
534
|
+
* Use the appropriate subclass template to remove data from that channel type.
|
|
535
|
+
*/
|
|
536
|
+
static readonly DataTemplate: Partial<APIChannel>;
|
|
537
|
+
/**
|
|
538
|
+
* @param data - The raw data received from the API for the channel
|
|
539
|
+
*/
|
|
540
|
+
constructor(data: Partialize<ChannelDataType<Type>, Omitted>);
|
|
541
|
+
/**
|
|
542
|
+
* {@inheritDoc Structure.[kPatch]}
|
|
543
|
+
*
|
|
544
|
+
* @internal
|
|
545
|
+
*/
|
|
546
|
+
[kPatch](data: Partial<ChannelDataType<Type>>): this;
|
|
547
|
+
/**
|
|
548
|
+
* The id of the channel
|
|
549
|
+
*/
|
|
550
|
+
get id(): ReplaceOmittedWithUnknown<Omitted, ChannelDataType<Type>>["id"];
|
|
551
|
+
/**
|
|
552
|
+
* The type of the channel
|
|
553
|
+
*/
|
|
554
|
+
get type(): Type extends "unknown" ? number : Type;
|
|
555
|
+
/**
|
|
556
|
+
* The name of the channel, null for DMs
|
|
557
|
+
*
|
|
558
|
+
* @privateRemarks The type of `name` can be narrowed in Guild Channels and DM channels to string and null respectively,
|
|
559
|
+
* respecting Omit behaviors
|
|
560
|
+
*/
|
|
561
|
+
get name(): ReplaceOmittedWithUnknown<Omitted, ChannelDataType<Type>>["name"] | undefined;
|
|
562
|
+
/**
|
|
563
|
+
* The flags that are applied to the channel.
|
|
564
|
+
*
|
|
565
|
+
* @privateRemarks The type of `flags` can be narrowed in Guild Channels and DMChannel to ChannelFlags, and in GroupDM channel
|
|
566
|
+
* to null, respecting Omit behaviors
|
|
567
|
+
*/
|
|
568
|
+
get flags(): ChannelFlagsBitField | null;
|
|
569
|
+
/**
|
|
570
|
+
* The timestamp the channel was created at
|
|
571
|
+
*/
|
|
572
|
+
get createdTimestamp(): number | null;
|
|
573
|
+
/**
|
|
574
|
+
* The time the channel was created at
|
|
575
|
+
*/
|
|
576
|
+
get createdAt(): Date | null;
|
|
577
|
+
/**
|
|
578
|
+
* Indicates whether this channel is a thread channel
|
|
579
|
+
*
|
|
580
|
+
* @privateRemarks Overridden to `true` on `ThreadChannelMixin`
|
|
581
|
+
*/
|
|
582
|
+
isThread(): this is ThreadChannelMixin & this;
|
|
583
|
+
/**
|
|
584
|
+
* Indicates whether this channel can contain messages
|
|
585
|
+
*
|
|
586
|
+
* @privateRemarks Overridden to `true` on `TextChannelMixin`
|
|
587
|
+
*/
|
|
588
|
+
isTextBased(): this is TextChannelMixin & this;
|
|
589
|
+
/**
|
|
590
|
+
* Indicates whether this channel is in a guild
|
|
591
|
+
*
|
|
592
|
+
* @privateRemarks Overridden to `true` on `GuildChannelMixin`
|
|
593
|
+
*/
|
|
594
|
+
isGuildBased(): this is GuildChannelMixin & this;
|
|
595
|
+
/**
|
|
596
|
+
* Indicates whether this channel is a DM or DM Group
|
|
597
|
+
*
|
|
598
|
+
* @privateRemarks Overridden to `true` on `DMChannelMixin`
|
|
599
|
+
*/
|
|
600
|
+
isDMBased(): this is DMChannelMixin & this;
|
|
601
|
+
/**
|
|
602
|
+
* Indicates whether this channel has voice connection capabilities
|
|
603
|
+
*
|
|
604
|
+
* @privateRemarks Overridden to `true` on `VoiceChannelMixin`
|
|
605
|
+
*/
|
|
606
|
+
isVoiceBased(): this is VoiceChannelMixin & this;
|
|
607
|
+
/**
|
|
608
|
+
* Indicates whether this channel only allows thread creation
|
|
609
|
+
*
|
|
610
|
+
* @privateRemarks Overridden to `true` on `ThreadOnlyChannelMixin`
|
|
611
|
+
*/
|
|
612
|
+
isThreadOnly(): this is ThreadOnlyChannelMixin & this;
|
|
613
|
+
/**
|
|
614
|
+
* Indicates whether this channel can have permission overwrites
|
|
615
|
+
*
|
|
616
|
+
* @privateRemarks Overridden to `true` on `ChannelPermissionsMixin`
|
|
617
|
+
*/
|
|
618
|
+
isPermissionCapable(): this is ChannelPermissionMixin & this;
|
|
619
|
+
/**
|
|
620
|
+
* Indicates whether this channel can have webhooks
|
|
621
|
+
*
|
|
622
|
+
* @privateRemarks Overridden to `true` on `ChannelWebhooksMixin`
|
|
623
|
+
*/
|
|
624
|
+
isWebhookCapable(): this is ChannelWebhookMixin & this;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
interface AppliedTagsMixin extends Channel<ChannelType.PublicThread> {
|
|
628
|
+
}
|
|
629
|
+
declare class AppliedTagsMixin {
|
|
630
|
+
/**
|
|
631
|
+
* The ids of the set of tags that have been applied to a thread in a {@link (ForumChannel:class)} or a {@link (MediaChannel:class)}.
|
|
632
|
+
*/
|
|
633
|
+
get appliedTags(): readonly string[] | null;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
interface ChannelOwnerMixin<Type extends ChannelType.GroupDM | ThreadChannelType> extends Channel<Type> {
|
|
637
|
+
}
|
|
638
|
+
declare class ChannelOwnerMixin<Type extends ChannelType.GroupDM | ThreadChannelType> {
|
|
639
|
+
/**
|
|
640
|
+
* The id of the creator of the group DM or thread
|
|
641
|
+
*/
|
|
642
|
+
get ownerId(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["owner_id"] | undefined;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
declare class ChannelParentMixin<Type extends Exclude<GuildChannelType, ChannelType.GuildCategory | ChannelType.GuildDirectory>> extends GuildChannelMixin<Type> {
|
|
646
|
+
/**
|
|
647
|
+
* The id of the parent category for a channel (each parent category can contain up to 50 channels) or id of the parent channel for a thread
|
|
648
|
+
*/
|
|
649
|
+
get parentId(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["parent_id"] | undefined;
|
|
650
|
+
/**
|
|
651
|
+
* Whether the channel is nsfw
|
|
652
|
+
*/
|
|
653
|
+
get nsfw(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["nsfw"] | undefined;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
interface ChannelPinMixin<Type extends ChannelType.DM | ChannelType.GuildAnnouncement | ChannelType.GuildText | ThreadChannelType> extends Channel<Type> {
|
|
657
|
+
}
|
|
658
|
+
declare class ChannelPinMixin<Type extends ChannelType.DM | ChannelType.GuildAnnouncement | ChannelType.GuildText | ThreadChannelType> {
|
|
659
|
+
/**
|
|
660
|
+
* The timestamp of when the last pin in the channel happened
|
|
661
|
+
*/
|
|
662
|
+
protected [kLastPinTimestamp]: number | null;
|
|
663
|
+
/**
|
|
664
|
+
* The template used for removing data from the raw data stored for each Channel.
|
|
665
|
+
*/
|
|
666
|
+
static readonly DataTemplate: Partial<ChannelDataType<ChannelType.DM | ChannelType.GuildAnnouncement | ChannelType.GuildText | ThreadChannelType>>;
|
|
667
|
+
[kMixinConstruct](): void;
|
|
668
|
+
/**
|
|
669
|
+
* {@inheritDoc Structure.optimizeData}
|
|
670
|
+
*/
|
|
671
|
+
protected optimizeData(data: Partial<ChannelDataType<Type>>): void;
|
|
672
|
+
/**
|
|
673
|
+
* The timestamp of when the last pin in the channel happened.
|
|
674
|
+
*/
|
|
675
|
+
get lastPinTimestamp(): number | null;
|
|
676
|
+
/**
|
|
677
|
+
* The Date of when the last pin in the channel happened
|
|
678
|
+
*/
|
|
679
|
+
get lastPinAt(): Date | null;
|
|
680
|
+
/**
|
|
681
|
+
* Adds data from optimized properties omitted from [kData].
|
|
682
|
+
*
|
|
683
|
+
* @param data - the result of {@link (Structure:class).toJSON}
|
|
684
|
+
*/
|
|
685
|
+
protected [kMixinToJSON](data: Partial<ChannelDataType<Type>>): void;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
declare class ChannelSlowmodeMixin<Type extends GuildTextChannelType> extends TextChannelMixin<Type> {
|
|
689
|
+
/**
|
|
690
|
+
* The rate limit per user (slowmode) of this channel.
|
|
691
|
+
*/
|
|
692
|
+
get rateLimitPerUser(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["rate_limit_per_user"] | undefined;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
interface ChannelTopicMixin<Type extends ChannelType.GuildAnnouncement | ChannelType.GuildForum | ChannelType.GuildMedia | ChannelType.GuildText> extends Channel<Type> {
|
|
696
|
+
}
|
|
697
|
+
declare class ChannelTopicMixin<Type extends ChannelType.GuildAnnouncement | ChannelType.GuildForum | ChannelType.GuildMedia | ChannelType.GuildText> extends ChannelWebhookMixin<Type> {
|
|
698
|
+
/**
|
|
699
|
+
* The topic of this channel.
|
|
700
|
+
*/
|
|
701
|
+
get topic(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["topic"] | undefined;
|
|
702
|
+
/**
|
|
703
|
+
* The duration after which new threads get archived by default on this channel.
|
|
704
|
+
*/
|
|
705
|
+
get defaultAutoArchiveDuration(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["default_auto_archive_duration"] | undefined;
|
|
706
|
+
/**
|
|
707
|
+
* The default value for rate limit per user (slowmode) on new threads in this channel.
|
|
708
|
+
*/
|
|
709
|
+
get defaultThreadRateLimitPerUser(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["default_thread_rate_limit_per_user"] | undefined;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
interface GroupDMMixin extends Channel<ChannelType.GroupDM> {
|
|
713
|
+
}
|
|
714
|
+
declare class GroupDMMixin {
|
|
715
|
+
/**
|
|
716
|
+
* The icon hash of the group DM.
|
|
717
|
+
*/
|
|
718
|
+
get icon(): string | null | undefined;
|
|
719
|
+
/**
|
|
720
|
+
* Whether the channel is managed by an application via the `gdm.join` OAuth2 scope.
|
|
721
|
+
*/
|
|
722
|
+
get managed(): boolean | undefined;
|
|
723
|
+
/**
|
|
724
|
+
* The application id of the group DM creator if it is bot-created.
|
|
725
|
+
*/
|
|
726
|
+
get applicationId(): string | undefined;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* Represents metadata of a thread channel on Discord.
|
|
731
|
+
*
|
|
732
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
733
|
+
*/
|
|
734
|
+
declare class ForumTag<Omitted extends keyof APIGuildForumTag | '' = ''> extends Structure<APIGuildForumTag, Omitted> {
|
|
735
|
+
constructor(data: Partialize<APIGuildForumTag, Omitted>);
|
|
736
|
+
/**
|
|
737
|
+
* The id of the tag.
|
|
738
|
+
*/
|
|
739
|
+
get id(): "id" extends infer T ? T extends "id" ? T extends Omitted ? unknown : APIGuildForumTag[T] : never : never;
|
|
740
|
+
/**
|
|
741
|
+
* The name of the tag.
|
|
742
|
+
*/
|
|
743
|
+
get name(): "name" extends infer T ? T extends "name" ? T extends Omitted ? unknown : APIGuildForumTag[T] : never : never;
|
|
744
|
+
/**
|
|
745
|
+
* Whether this tag can only be added to or removed from threads by a member with the {@link discord-api-types/v10#(PermissionFlagsBits:variable) | ManageThreads} permission.
|
|
746
|
+
*/
|
|
747
|
+
get moderated(): "moderated" extends infer T ? T extends "moderated" ? T extends Omitted ? unknown : APIGuildForumTag[T] : never : never;
|
|
748
|
+
/**
|
|
749
|
+
* The id of a guild's custom emoji.
|
|
750
|
+
*/
|
|
751
|
+
get emojiId(): "emoji_id" extends infer T ? T extends "emoji_id" ? T extends Omitted ? unknown : APIGuildForumTag[T] : never : never;
|
|
752
|
+
/**
|
|
753
|
+
* The unicode character of the emoji.
|
|
754
|
+
*/
|
|
755
|
+
get emojiName(): "emoji_name" extends infer T ? T extends "emoji_name" ? T extends Omitted ? unknown : APIGuildForumTag[T] : never : never;
|
|
756
|
+
/**
|
|
757
|
+
* The textual representation of this tag's emoji. Either a unicode character or a guild emoji mention.
|
|
758
|
+
*/
|
|
759
|
+
get emoji(): string | NonNullable<"emoji_name" extends infer T ? T extends "emoji_name" ? T extends Omitted ? unknown : APIGuildForumTag[T] : never : never>;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* Represents metadata of a thread channel on Discord.
|
|
764
|
+
*
|
|
765
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
766
|
+
*/
|
|
767
|
+
declare class PermissionOverwrite<Omitted extends keyof APIOverwrite | '' = 'allow' | 'deny'> extends Structure<APIOverwrite, Omitted> {
|
|
768
|
+
protected [kAllow]: bigint | null;
|
|
769
|
+
protected [kDeny]: bigint | null;
|
|
770
|
+
constructor(data: Partialize<APIOverwrite, Omitted>);
|
|
771
|
+
/**
|
|
772
|
+
* The template used for removing data from the raw data stored for each ThreadMetadata
|
|
773
|
+
*
|
|
774
|
+
* @remarks This template has defaults, if you want to remove additional data and keep the defaults,
|
|
775
|
+
* use `Object.defineProperties`. To override the defaults, set this value directly.
|
|
776
|
+
*/
|
|
777
|
+
static readonly DataTemplate: Partial<APIOverwrite>;
|
|
778
|
+
/**
|
|
779
|
+
* {@inheritDoc Structure.optimizeData}
|
|
780
|
+
*/
|
|
781
|
+
protected optimizeData(data: Partial<APIOverwrite>): void;
|
|
782
|
+
/**
|
|
783
|
+
* The permission bit set allowed by this overwrite.
|
|
784
|
+
*/
|
|
785
|
+
get allow(): PermissionsBitField | null;
|
|
786
|
+
/**
|
|
787
|
+
* The permission bit set denied by this overwrite.
|
|
788
|
+
*/
|
|
789
|
+
get deny(): PermissionsBitField | null;
|
|
790
|
+
/**
|
|
791
|
+
* The role or user id for this overwrite.
|
|
792
|
+
*/
|
|
793
|
+
get id(): "id" extends infer T ? T extends "id" ? T extends Omitted ? unknown : APIOverwrite[T] : never : never;
|
|
794
|
+
/**
|
|
795
|
+
* The type of this overwrite.
|
|
796
|
+
*/
|
|
797
|
+
get type(): "type" extends infer T ? T extends "type" ? T extends Omitted ? unknown : APIOverwrite[T] : never : never;
|
|
798
|
+
/**
|
|
799
|
+
* {@inheritDoc Structure.toJSON}
|
|
800
|
+
*/
|
|
801
|
+
toJSON(): APIOverwrite;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Represents metadata of a thread channel on Discord.
|
|
806
|
+
*
|
|
807
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
808
|
+
*/
|
|
809
|
+
declare class ThreadMetadata<Omitted extends keyof APIThreadMetadata | '' = 'archive_timestamp' | 'create_timestamp'> extends Structure<APIThreadMetadata, Omitted> {
|
|
810
|
+
protected [kArchiveTimestamp]: number | null;
|
|
811
|
+
protected [kCreatedTimestamp]: number | null;
|
|
812
|
+
constructor(data: Partialize<APIThreadMetadata, Omitted>);
|
|
813
|
+
/**
|
|
814
|
+
* The template used for removing data from the raw data stored for each ThreadMetadata
|
|
815
|
+
*
|
|
816
|
+
* @remarks This template has defaults, if you want to remove additional data and keep the defaults,
|
|
817
|
+
* use `Object.defineProperties`. To override the defaults, set this value directly.
|
|
818
|
+
*/
|
|
819
|
+
static readonly DataTemplate: Partial<APIThreadMetadata>;
|
|
820
|
+
/**
|
|
821
|
+
* {@inheritDoc Structure.optimizeData}
|
|
822
|
+
*/
|
|
823
|
+
protected optimizeData(data: Partial<APIThreadMetadata>): void;
|
|
824
|
+
/**
|
|
825
|
+
* Whether the thread is archived.
|
|
826
|
+
*/
|
|
827
|
+
get archived(): "archived" extends infer T ? T extends "archived" ? T extends Omitted ? unknown : APIThreadMetadata[T] : never : never;
|
|
828
|
+
/**
|
|
829
|
+
* The timestamp when the thread's archive status was last changed, used for calculating recent activity.
|
|
830
|
+
*/
|
|
831
|
+
get archivedTimestamp(): number | null;
|
|
832
|
+
/**
|
|
833
|
+
* The timestamp when the thread was created; only populated for threads created after 2022-01-09.
|
|
834
|
+
*/
|
|
835
|
+
get createdTimestamp(): number | null;
|
|
836
|
+
/**
|
|
837
|
+
* The thread will stop showing in the channel list after auto_archive_duration minutes of inactivity,
|
|
838
|
+
*/
|
|
839
|
+
get autoArchiveDuration(): "auto_archive_duration" extends infer T ? T extends "auto_archive_duration" ? T extends Omitted ? unknown : APIThreadMetadata[T] : never : never;
|
|
840
|
+
/**
|
|
841
|
+
* Whether non-moderators can add other non-moderators to a thread; only available on private threads.
|
|
842
|
+
*/
|
|
843
|
+
get invitable(): ("invitable" extends infer T ? T extends "invitable" ? T extends Omitted ? unknown : APIThreadMetadata[T] : never : never) | undefined;
|
|
844
|
+
/**
|
|
845
|
+
* Whether the thread is locked; when a thread is locked, only users with {@link discord-api-types/v10#(PermissionFlagsBits:variable) | ManageThreads} can unarchive it.
|
|
846
|
+
*/
|
|
847
|
+
get locked(): "locked" extends infer T ? T extends "locked" ? T extends Omitted ? unknown : APIThreadMetadata[T] : never : never;
|
|
848
|
+
/**
|
|
849
|
+
* The time the thread was archived at
|
|
850
|
+
*/
|
|
851
|
+
get archivedAt(): Date | null;
|
|
852
|
+
/**
|
|
853
|
+
* The time the thread was created at
|
|
854
|
+
*/
|
|
855
|
+
get createdAt(): Date | null;
|
|
856
|
+
/**
|
|
857
|
+
* {@inheritDoc Structure.toJSON}
|
|
858
|
+
*/
|
|
859
|
+
toJSON(): APIThreadMetadata;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
type Mixinable<ClassType> = new (...args: unknown[]) => ClassType;
|
|
863
|
+
type MixinBase<BaseClass extends Structure<{}>> = BaseClass extends Structure<infer DataType, infer Omitted> ? Structure<DataType, Omitted> : never;
|
|
864
|
+
/**
|
|
865
|
+
* Copies the prototype (getters, setters, and methods) of all mixins to the destination class.
|
|
866
|
+
* For type information see {@link MixinTypes}
|
|
867
|
+
*
|
|
868
|
+
* @param destination - The class to apply the mixins to, must extend the base that the mixins expect it to.
|
|
869
|
+
* @param mixins - Classes that contain "pure" prototypes to be copied on top of the destination class prototype
|
|
870
|
+
* @remarks All mixins should be "pure" in that they only contain getters, setters, and methods.
|
|
871
|
+
* The runtime code will only copy these, and adding properties to the class only results
|
|
872
|
+
* in the types of the mixed class being wrong.
|
|
873
|
+
* @example
|
|
874
|
+
* ```
|
|
875
|
+
* // Interface merging on the mixin to give type access to props on the base and kData that are available once copied
|
|
876
|
+
* interface TextMixin extends Channel {}
|
|
877
|
+
* class TextMixin {
|
|
878
|
+
* // Methods / getters
|
|
879
|
+
* }
|
|
880
|
+
*
|
|
881
|
+
* // Interface merging on the mixed class to give it accurate type information within the declaration and when instantiated
|
|
882
|
+
* interface TextChannel extends MixinTypes<Channel, [TextMixin]> {}
|
|
883
|
+
* class TextChannel extends Channel {}
|
|
884
|
+
*
|
|
885
|
+
* // Apply for runtime
|
|
886
|
+
* Mixin(TextChannel, [TextMixin])
|
|
887
|
+
* ```
|
|
888
|
+
* @typeParam DestinationClass - The class to be mixed, ensures that the mixins provided can be used with this destination
|
|
889
|
+
*/
|
|
890
|
+
declare function Mixin<DestinationClass extends typeof Structure<{}>>(destination: DestinationClass, mixins: Mixinable<MixinBase<DestinationClass['prototype']>>[]): void;
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* Type utility to provide accurate types for the runtime effects of {@link Mixin}
|
|
894
|
+
*
|
|
895
|
+
* @typeParam BaseClass - The class that is being directly extended, must match the class that the mixins are expecting
|
|
896
|
+
* @typeParam Mixins - The mixins that will be applied to this class via a {@link Mixin} call
|
|
897
|
+
*/
|
|
898
|
+
type MixinTypes<BaseClass extends Structure<{}>, Mixins extends readonly MixinBase<BaseClass>[]> = CollapseUnion<
|
|
899
|
+
BaseClass extends Structure<infer DataType, infer Omitted>
|
|
900
|
+
? Mixins[number] extends Structure<DataType, Omitted>
|
|
901
|
+
? // prettier-ignore
|
|
902
|
+
Structure<DataType, Omitted>[typeof kData] extends
|
|
903
|
+
// @ts-expect-error kData is protected
|
|
904
|
+
Mixins[number][typeof kData]
|
|
905
|
+
? Omit<MergePrototypes<Mixins>, keyof BaseClass | typeof kMixinConstruct>
|
|
906
|
+
: never
|
|
907
|
+
: never
|
|
908
|
+
: never
|
|
909
|
+
>;
|
|
910
|
+
|
|
911
|
+
interface AnnouncementChannel<Omitted extends keyof APINewsChannel | '' = ''> extends MixinTypes<Channel<ChannelType.GuildAnnouncement>, [
|
|
912
|
+
TextChannelMixin<ChannelType.GuildAnnouncement>,
|
|
913
|
+
ChannelParentMixin<ChannelType.GuildAnnouncement>,
|
|
914
|
+
ChannelPermissionMixin<ChannelType.GuildAnnouncement>,
|
|
915
|
+
ChannelPinMixin<ChannelType.GuildAnnouncement>,
|
|
916
|
+
ChannelSlowmodeMixin<ChannelType.GuildAnnouncement>,
|
|
917
|
+
ChannelTopicMixin<ChannelType.GuildAnnouncement>
|
|
918
|
+
]> {
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* Sample Implementation of a structure for announcement channels, usable by direct end consumers.
|
|
922
|
+
*/
|
|
923
|
+
declare class AnnouncementChannel<Omitted extends keyof APINewsChannel | '' = ''> extends Channel<ChannelType.GuildAnnouncement, Omitted> {
|
|
924
|
+
constructor(data: Partialize<APINewsChannel, Omitted>);
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
interface AnnouncementThreadChannel<Omitted extends keyof APIAnnouncementThreadChannel | '' = ''> extends MixinTypes<Channel<ChannelType.AnnouncementThread>, [
|
|
928
|
+
TextChannelMixin<ChannelType.AnnouncementThread>,
|
|
929
|
+
ChannelOwnerMixin<ChannelType.AnnouncementThread>,
|
|
930
|
+
ChannelParentMixin<ChannelType.AnnouncementThread>,
|
|
931
|
+
ChannelPinMixin<ChannelType.AnnouncementThread>,
|
|
932
|
+
ChannelSlowmodeMixin<ChannelType.AnnouncementThread>,
|
|
933
|
+
GuildChannelMixin<ChannelType.AnnouncementThread>,
|
|
934
|
+
ThreadChannelMixin<ChannelType.AnnouncementThread>
|
|
935
|
+
]> {
|
|
936
|
+
}
|
|
937
|
+
/**
|
|
938
|
+
* Sample Implementation of a structure for announcement threads, usable by direct end consumers.
|
|
939
|
+
*/
|
|
940
|
+
declare class AnnouncementThreadChannel<Omitted extends keyof APIAnnouncementThreadChannel | '' = ''> extends Channel<ChannelType.AnnouncementThread, Omitted> {
|
|
941
|
+
constructor(data: Partialize<APIAnnouncementThreadChannel, Omitted>);
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
interface CategoryChannel<Omitted extends keyof APIGuildCategoryChannel | '' = ''> extends MixinTypes<Channel<ChannelType.GuildCategory>, [
|
|
945
|
+
ChannelPermissionMixin<ChannelType.GuildCategory>,
|
|
946
|
+
GuildChannelMixin<ChannelType.GuildCategory>
|
|
947
|
+
]> {
|
|
948
|
+
}
|
|
949
|
+
/**
|
|
950
|
+
* Sample Implementation of a structure for category channels, usable by direct end consumers.
|
|
951
|
+
*/
|
|
952
|
+
declare class CategoryChannel<Omitted extends keyof APIGuildCategoryChannel | '' = ''> extends Channel<ChannelType.GuildCategory, Omitted> {
|
|
953
|
+
constructor(data: Partialize<APIGuildCategoryChannel, Omitted>);
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
interface DMChannel<Omitted extends keyof APIDMChannel | '' = ''> extends MixinTypes<Channel<ChannelType.DM>, [
|
|
957
|
+
DMChannelMixin<ChannelType.DM>,
|
|
958
|
+
TextChannelMixin<ChannelType.DM>,
|
|
959
|
+
ChannelPinMixin<ChannelType.DM>
|
|
960
|
+
]> {
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* Sample Implementation of a structure for dm channels, usable by direct end consumers.
|
|
964
|
+
*/
|
|
965
|
+
declare class DMChannel<Omitted extends keyof APIDMChannel | '' = ''> extends Channel<ChannelType.DM, Omitted> {
|
|
966
|
+
constructor(data: Partialize<APIDMChannel, Omitted>);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
interface ForumChannel<Omitted extends keyof APIGuildForumChannel | '' = ''> extends MixinTypes<Channel<ChannelType.GuildForum>, [
|
|
970
|
+
ChannelParentMixin<ChannelType.GuildForum>,
|
|
971
|
+
ChannelPermissionMixin<ChannelType.GuildForum>,
|
|
972
|
+
ChannelTopicMixin<ChannelType.GuildForum>,
|
|
973
|
+
ThreadOnlyChannelMixin<ChannelType.GuildForum>
|
|
974
|
+
]> {
|
|
975
|
+
}
|
|
976
|
+
/**
|
|
977
|
+
* Sample Implementation of a structure for forum channels, usable by direct end consumers.
|
|
978
|
+
*/
|
|
979
|
+
declare class ForumChannel<Omitted extends keyof APIGuildForumChannel | '' = ''> extends Channel<ChannelType.GuildForum, Omitted> {
|
|
980
|
+
constructor(data: Partialize<APIGuildForumChannel, Omitted>);
|
|
981
|
+
/**
|
|
982
|
+
* The default forum layout view used to display posts in this channel.
|
|
983
|
+
* Defaults to 0, which indicates a layout view has not been set by a channel admin.
|
|
984
|
+
*/
|
|
985
|
+
get defaultForumLayout(): "default_forum_layout" extends infer T ? T extends "default_forum_layout" ? T extends Omitted ? unknown : APIGuildForumChannel[T] : never : never;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
interface GroupDMChannel<Omitted extends keyof APIGroupDMChannel | '' = ''> extends MixinTypes<Channel<ChannelType.GroupDM>, [
|
|
989
|
+
DMChannelMixin<ChannelType.GroupDM>,
|
|
990
|
+
TextChannelMixin<ChannelType.GroupDM>,
|
|
991
|
+
ChannelOwnerMixin<ChannelType.GroupDM>,
|
|
992
|
+
GroupDMMixin
|
|
993
|
+
]> {
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* Sample Implementation of a structure for group dm channels, usable by direct end consumers.
|
|
997
|
+
*/
|
|
998
|
+
declare class GroupDMChannel<Omitted extends keyof APIGroupDMChannel | '' = ''> extends Channel<ChannelType.GroupDM, Omitted> {
|
|
999
|
+
constructor(data: Partialize<APIGroupDMChannel, Omitted>);
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
interface MediaChannel<Omitted extends keyof APIGuildMediaChannel | '' = ''> extends MixinTypes<Channel<ChannelType.GuildMedia>, [
|
|
1003
|
+
ChannelParentMixin<ChannelType.GuildMedia>,
|
|
1004
|
+
ChannelPermissionMixin<ChannelType.GuildMedia>,
|
|
1005
|
+
ChannelTopicMixin<ChannelType.GuildMedia>,
|
|
1006
|
+
ThreadOnlyChannelMixin<ChannelType.GuildMedia>
|
|
1007
|
+
]> {
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* Sample Implementation of a structure for media channels, usable by direct end consumers.
|
|
1011
|
+
*/
|
|
1012
|
+
declare class MediaChannel<Omitted extends keyof APIGuildMediaChannel | '' = ''> extends Channel<ChannelType.GuildMedia, Omitted> {
|
|
1013
|
+
constructor(data: Partialize<APIGuildMediaChannel, Omitted>);
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
interface PrivateThreadChannel<Omitted extends keyof APIPrivateThreadChannel | '' = ''> extends MixinTypes<Channel<ChannelType.PrivateThread>, [
|
|
1017
|
+
TextChannelMixin<ChannelType.PrivateThread>,
|
|
1018
|
+
ChannelOwnerMixin<ChannelType.PrivateThread>,
|
|
1019
|
+
ChannelParentMixin<ChannelType.PrivateThread>,
|
|
1020
|
+
ChannelPinMixin<ChannelType.PrivateThread>,
|
|
1021
|
+
ChannelSlowmodeMixin<ChannelType.PrivateThread>,
|
|
1022
|
+
ThreadChannelMixin<ChannelType.PrivateThread>
|
|
1023
|
+
]> {
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* Sample Implementation of a structure for private thread channels, usable by direct end consumers.
|
|
1027
|
+
*/
|
|
1028
|
+
declare class PrivateThreadChannel<Omitted extends keyof APIPrivateThreadChannel | '' = ''> extends Channel<ChannelType.PrivateThread, Omitted> {
|
|
1029
|
+
constructor(data: Partialize<APIPrivateThreadChannel, Omitted>);
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
interface PublicThreadChannel<Omitted extends keyof APIPublicThreadChannel | '' = ''> extends MixinTypes<Channel<ChannelType.PublicThread>, [
|
|
1033
|
+
TextChannelMixin<ChannelType.PublicThread>,
|
|
1034
|
+
ChannelOwnerMixin<ChannelType.PublicThread>,
|
|
1035
|
+
ChannelParentMixin<ChannelType.PublicThread>,
|
|
1036
|
+
ChannelPinMixin<ChannelType.PublicThread>,
|
|
1037
|
+
ChannelSlowmodeMixin<ChannelType.PublicThread>,
|
|
1038
|
+
ThreadChannelMixin<ChannelType.PublicThread>,
|
|
1039
|
+
AppliedTagsMixin
|
|
1040
|
+
]> {
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* Sample Implementation of a structure for public thread channels, usable by direct end consumers.
|
|
1044
|
+
*/
|
|
1045
|
+
declare class PublicThreadChannel<Omitted extends keyof APIPublicThreadChannel | '' = ''> extends Channel<ChannelType.PublicThread, Omitted> {
|
|
1046
|
+
constructor(data: Partialize<APIPublicThreadChannel, Omitted>);
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
interface StageChannel<Omitted extends keyof APIGuildStageVoiceChannel | '' = ''> extends MixinTypes<Channel<ChannelType.GuildStageVoice>, [
|
|
1050
|
+
ChannelParentMixin<ChannelType.GuildStageVoice>,
|
|
1051
|
+
ChannelPermissionMixin<ChannelType.GuildStageVoice>,
|
|
1052
|
+
ChannelSlowmodeMixin<ChannelType.GuildStageVoice>,
|
|
1053
|
+
ChannelWebhookMixin<ChannelType.GuildStageVoice>,
|
|
1054
|
+
VoiceChannelMixin<ChannelType.GuildStageVoice>
|
|
1055
|
+
]> {
|
|
1056
|
+
}
|
|
1057
|
+
declare class StageChannel<Omitted extends keyof APIGuildStageVoiceChannel | '' = ''> extends Channel<ChannelType.GuildStageVoice, Omitted> {
|
|
1058
|
+
constructor(data: Partialize<APIGuildStageVoiceChannel, Omitted>);
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
interface TextChannel<Omitted extends keyof APITextChannel | '' = ''> extends MixinTypes<Channel<ChannelType.GuildText>, [
|
|
1062
|
+
TextChannelMixin<ChannelType.GuildText>,
|
|
1063
|
+
ChannelParentMixin<ChannelType.GuildText>,
|
|
1064
|
+
ChannelPermissionMixin<ChannelType.GuildText>,
|
|
1065
|
+
ChannelPinMixin<ChannelType.GuildText>,
|
|
1066
|
+
ChannelSlowmodeMixin<ChannelType.GuildText>,
|
|
1067
|
+
ChannelTopicMixin<ChannelType.GuildText>
|
|
1068
|
+
]> {
|
|
1069
|
+
}
|
|
1070
|
+
declare class TextChannel<Omitted extends keyof APITextChannel | '' = ''> extends Channel<ChannelType.GuildText, Omitted> {
|
|
1071
|
+
constructor(data: Partialize<APITextChannel, Omitted>);
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
interface VoiceChannel<Omitted extends keyof APIGuildVoiceChannel | '' = ''> extends MixinTypes<Channel<ChannelType.GuildVoice>, [
|
|
1075
|
+
ChannelParentMixin<ChannelType.GuildVoice>,
|
|
1076
|
+
ChannelPermissionMixin<ChannelType.GuildVoice>,
|
|
1077
|
+
ChannelSlowmodeMixin<ChannelType.GuildVoice>,
|
|
1078
|
+
ChannelWebhookMixin<ChannelType.GuildVoice>,
|
|
1079
|
+
VoiceChannelMixin<ChannelType.GuildVoice>
|
|
1080
|
+
]> {
|
|
1081
|
+
}
|
|
1082
|
+
declare class VoiceChannel<Omitted extends keyof APIGuildVoiceChannel | '' = ''> extends Channel<ChannelType.GuildVoice, Omitted> {
|
|
1083
|
+
constructor(data: Partialize<APIGuildVoiceChannel, Omitted>);
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
interface APIActualInvite extends APIInvite, Partial<Omit<APIExtendedInvite, keyof APIInvite>> {
|
|
1087
|
+
}
|
|
1088
|
+
/**
|
|
1089
|
+
* Represents an invitation to a Discord channel
|
|
1090
|
+
*
|
|
1091
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
1092
|
+
*/
|
|
1093
|
+
declare class Invite<Omitted extends keyof APIActualInvite | '' = 'created_at' | 'expires_at'> extends Structure<APIActualInvite, Omitted> {
|
|
1094
|
+
/**
|
|
1095
|
+
* The template used for removing data from the raw data stored for each Invite
|
|
1096
|
+
*
|
|
1097
|
+
* @remarks This template has defaults, if you want to remove additional data and keep the defaults,
|
|
1098
|
+
* use `Object.defineProperties`. To override the defaults, set this value directly.
|
|
1099
|
+
*/
|
|
1100
|
+
static readonly DataTemplate: Partial<APIActualInvite>;
|
|
1101
|
+
/**
|
|
1102
|
+
* Optimized storage of {@link discord-api-types/v10#(APIActualInvite:interface).expires_at}
|
|
1103
|
+
*
|
|
1104
|
+
* @internal
|
|
1105
|
+
*/
|
|
1106
|
+
protected [kExpiresTimestamp]: number | null;
|
|
1107
|
+
/**
|
|
1108
|
+
* Optimized storage of {@link discord-api-types/v10#(APIActualInvite:interface).created_at}
|
|
1109
|
+
*
|
|
1110
|
+
* @internal
|
|
1111
|
+
*/
|
|
1112
|
+
protected [kCreatedTimestamp]: number | null;
|
|
1113
|
+
/**
|
|
1114
|
+
* @param data - The raw data received from the API for the invite
|
|
1115
|
+
*/
|
|
1116
|
+
constructor(data: Partialize<APIActualInvite, Omitted>);
|
|
1117
|
+
/**
|
|
1118
|
+
* {@inheritDoc Structure.[kPatch]}
|
|
1119
|
+
*
|
|
1120
|
+
* @internal
|
|
1121
|
+
*/
|
|
1122
|
+
[kPatch](data: Partial<APIActualInvite>): this;
|
|
1123
|
+
/**
|
|
1124
|
+
* {@inheritDoc Structure.optimizeData}
|
|
1125
|
+
*
|
|
1126
|
+
* @internal
|
|
1127
|
+
*/
|
|
1128
|
+
protected optimizeData(data: Partial<APIActualInvite>): void;
|
|
1129
|
+
/**
|
|
1130
|
+
* The code for this invite
|
|
1131
|
+
*/
|
|
1132
|
+
get code(): "code" extends infer T ? T extends "code" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never;
|
|
1133
|
+
/**
|
|
1134
|
+
* The target type (for voice channel invites)
|
|
1135
|
+
*/
|
|
1136
|
+
get targetType(): ("target_type" extends infer T ? T extends "target_type" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never) | undefined;
|
|
1137
|
+
/**
|
|
1138
|
+
* The type of this invite
|
|
1139
|
+
*/
|
|
1140
|
+
get type(): "type" extends infer T ? T extends "type" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never;
|
|
1141
|
+
/**
|
|
1142
|
+
* The approximate number of online members of the guild this invite is for
|
|
1143
|
+
*
|
|
1144
|
+
* @remarks Only available when the invite was fetched from `GET /invites/<code>` with counts
|
|
1145
|
+
*/
|
|
1146
|
+
get approximatePresenceCount(): ("approximate_presence_count" extends infer T ? T extends "approximate_presence_count" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never) | undefined;
|
|
1147
|
+
/**
|
|
1148
|
+
* The approximate total number of members of the guild this invite is for
|
|
1149
|
+
*
|
|
1150
|
+
* @remarks Only available when the invite was fetched from `GET /invites/<code>` with counts
|
|
1151
|
+
*/
|
|
1152
|
+
get approximateMemberCount(): ("approximate_member_count" extends infer T ? T extends "approximate_member_count" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never) | undefined;
|
|
1153
|
+
/**
|
|
1154
|
+
* The timestamp this invite will expire at
|
|
1155
|
+
*/
|
|
1156
|
+
get expiresTimestamp(): number | null;
|
|
1157
|
+
/**
|
|
1158
|
+
* The time the invite will expire at
|
|
1159
|
+
*/
|
|
1160
|
+
get expiresAt(): Date | null;
|
|
1161
|
+
/**
|
|
1162
|
+
* The number of times this invite has been used
|
|
1163
|
+
*/
|
|
1164
|
+
get uses(): ("uses" extends infer T ? T extends "uses" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never) | undefined;
|
|
1165
|
+
/**
|
|
1166
|
+
* The maximum number of times this invite can be used
|
|
1167
|
+
*/
|
|
1168
|
+
get maxUses(): ("max_uses" extends infer T ? T extends "max_uses" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never) | undefined;
|
|
1169
|
+
/**
|
|
1170
|
+
* The maximum age of the invite, in seconds, 0 for non-expiring
|
|
1171
|
+
*/
|
|
1172
|
+
get maxAge(): ("max_age" extends infer T ? T extends "max_age" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never) | undefined;
|
|
1173
|
+
/**
|
|
1174
|
+
* Whether this invite only grants temporary membership
|
|
1175
|
+
*/
|
|
1176
|
+
get temporary(): ("temporary" extends infer T ? T extends "temporary" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never) | undefined;
|
|
1177
|
+
/**
|
|
1178
|
+
* The timestamp this invite was created at
|
|
1179
|
+
*/
|
|
1180
|
+
get createdTimestamp(): number | null;
|
|
1181
|
+
/**
|
|
1182
|
+
* The time the invite was created at
|
|
1183
|
+
*/
|
|
1184
|
+
get createdAt(): Date | null;
|
|
1185
|
+
/**
|
|
1186
|
+
* The URL to the invite
|
|
1187
|
+
*/
|
|
1188
|
+
get url(): string | null;
|
|
1189
|
+
/**
|
|
1190
|
+
* When concatenated with a string, this automatically concatenates the invite's URL instead of the object.
|
|
1191
|
+
*
|
|
1192
|
+
* @returns The URL to the invite or an empty string if it doesn't have a code
|
|
1193
|
+
*/
|
|
1194
|
+
toString(): string;
|
|
1195
|
+
/**
|
|
1196
|
+
* {@inheritDoc Structure.toJSON}
|
|
1197
|
+
*/
|
|
1198
|
+
toJSON(): APIActualInvite;
|
|
1199
|
+
/**
|
|
1200
|
+
* Returns the primitive value of the specified object.
|
|
1201
|
+
*/
|
|
1202
|
+
valueOf(): Object;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
/**
|
|
1206
|
+
* Represents metadata of an avatar decoration of a User.
|
|
1207
|
+
*
|
|
1208
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
1209
|
+
*/
|
|
1210
|
+
declare class AvatarDecorationData<Omitted extends keyof APIAvatarDecorationData | '' = ''> extends Structure<APIAvatarDecorationData, Omitted> {
|
|
1211
|
+
/**
|
|
1212
|
+
* The template used for removing data from the raw data stored for each Connection
|
|
1213
|
+
*/
|
|
1214
|
+
static readonly DataTemplate: Partial<APIAvatarDecorationData>;
|
|
1215
|
+
/**
|
|
1216
|
+
* @param data - The raw data received from the API for the connection
|
|
1217
|
+
*/
|
|
1218
|
+
constructor(data: Partialize<APIAvatarDecorationData, Omitted>);
|
|
1219
|
+
/**
|
|
1220
|
+
* The id of the SKU this avatar decoration is part of.
|
|
1221
|
+
*/
|
|
1222
|
+
get skuId(): "sku_id" extends infer T ? T extends "sku_id" ? T extends Omitted ? unknown : APIAvatarDecorationData[T] : never : never;
|
|
1223
|
+
/**
|
|
1224
|
+
* The asset of this avatar decoration.
|
|
1225
|
+
*/
|
|
1226
|
+
get asset(): "asset" extends infer T ? T extends "asset" ? T extends Omitted ? unknown : APIAvatarDecorationData[T] : never : never;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
/**
|
|
1230
|
+
* Represents any user on Discord.
|
|
1231
|
+
*
|
|
1232
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
1233
|
+
* @remarks has a substructure `AvatarDecorationData`, which needs to be instantiated and stored by an extending class using it
|
|
1234
|
+
*/
|
|
1235
|
+
declare class User<Omitted extends keyof APIUser | '' = ''> extends Structure<APIUser, Omitted> {
|
|
1236
|
+
/**
|
|
1237
|
+
* The template used for removing data from the raw data stored for each User
|
|
1238
|
+
*/
|
|
1239
|
+
static readonly DataTemplate: Partial<APIUser>;
|
|
1240
|
+
/**
|
|
1241
|
+
* @param data - The raw data received from the API for the user
|
|
1242
|
+
*/
|
|
1243
|
+
constructor(data: Partialize<APIUser, Omitted>);
|
|
1244
|
+
/**
|
|
1245
|
+
* {@inheritDoc Structure.[kPatch]}
|
|
1246
|
+
*
|
|
1247
|
+
* @internal
|
|
1248
|
+
*/
|
|
1249
|
+
[kPatch](data: Partial<APIUser>): this;
|
|
1250
|
+
/**
|
|
1251
|
+
* The user's id
|
|
1252
|
+
*/
|
|
1253
|
+
get id(): "id" extends infer T ? T extends "id" ? T extends Omitted ? unknown : APIUser[T] : never : never;
|
|
1254
|
+
/**
|
|
1255
|
+
* The username of the user
|
|
1256
|
+
*/
|
|
1257
|
+
get username(): "username" extends infer T ? T extends "username" ? T extends Omitted ? unknown : APIUser[T] : never : never;
|
|
1258
|
+
/**
|
|
1259
|
+
* The user's 4 digit tag, if a bot
|
|
1260
|
+
*/
|
|
1261
|
+
get discriminator(): "discriminator" extends infer T ? T extends "discriminator" ? T extends Omitted ? unknown : APIUser[T] : never : never;
|
|
1262
|
+
/**
|
|
1263
|
+
* The user's display name, the application name for bots
|
|
1264
|
+
*/
|
|
1265
|
+
get globalName(): "global_name" extends infer T ? T extends "global_name" ? T extends Omitted ? unknown : APIUser[T] : never : never;
|
|
1266
|
+
/**
|
|
1267
|
+
* The name displayed in the client for this user when no nickname is set
|
|
1268
|
+
*/
|
|
1269
|
+
get displayName(): ("username" extends infer T ? T extends "username" ? T extends Omitted ? unknown : APIUser[T] : never : never) | NonNullable<"global_name" extends infer T_1 ? T_1 extends "global_name" ? T_1 extends Omitted ? unknown : APIUser[T_1] : never : never>;
|
|
1270
|
+
/**
|
|
1271
|
+
* The user avatar's hash
|
|
1272
|
+
*/
|
|
1273
|
+
get avatar(): "avatar" extends infer T ? T extends "avatar" ? T extends Omitted ? unknown : APIUser[T] : never : never;
|
|
1274
|
+
/**
|
|
1275
|
+
* Whether the user is a bot
|
|
1276
|
+
*/
|
|
1277
|
+
get bot(): false | NonNullable<"bot" extends infer T ? T extends "bot" ? T extends Omitted ? unknown : APIUser[T] : never : never>;
|
|
1278
|
+
/**
|
|
1279
|
+
* Whether the user is an Official Discord System user
|
|
1280
|
+
*/
|
|
1281
|
+
get system(): false | NonNullable<"system" extends infer T ? T extends "system" ? T extends Omitted ? unknown : APIUser[T] : never : never>;
|
|
1282
|
+
/**
|
|
1283
|
+
* Whether the user has mfa enabled
|
|
1284
|
+
*
|
|
1285
|
+
* @remarks This property is only set when the user was fetched with an OAuth2 token and the `identify` scope
|
|
1286
|
+
*/
|
|
1287
|
+
get mfaEnabled(): ("mfa_enabled" extends infer T ? T extends "mfa_enabled" ? T extends Omitted ? unknown : APIUser[T] : never : never) | undefined;
|
|
1288
|
+
/**
|
|
1289
|
+
* The user's banner hash
|
|
1290
|
+
*
|
|
1291
|
+
* @remarks This property is only set when the user was manually fetched
|
|
1292
|
+
*/
|
|
1293
|
+
get banner(): ("banner" extends infer T ? T extends "banner" ? T extends Omitted ? unknown : APIUser[T] : never : never) | undefined;
|
|
1294
|
+
/**
|
|
1295
|
+
* The base 10 accent color of the user's banner
|
|
1296
|
+
*
|
|
1297
|
+
* @remarks This property is only set when the user was manually fetched
|
|
1298
|
+
*/
|
|
1299
|
+
get accentColor(): ("accent_color" extends infer T ? T extends "accent_color" ? T extends Omitted ? unknown : APIUser[T] : never : never) | undefined;
|
|
1300
|
+
/**
|
|
1301
|
+
* The user's primary Discord language
|
|
1302
|
+
*
|
|
1303
|
+
* @remarks This property is only set when the user was fetched with an Oauth2 token and the `identify` scope
|
|
1304
|
+
*/
|
|
1305
|
+
get locale(): ("locale" extends infer T ? T extends "locale" ? T extends Omitted ? unknown : APIUser[T] : never : never) | undefined;
|
|
1306
|
+
/**
|
|
1307
|
+
* Whether the email on the user's account has been verified
|
|
1308
|
+
*
|
|
1309
|
+
* @remarks This property is only set when the user was fetched with an OAuth2 token and the `email` scope
|
|
1310
|
+
*/
|
|
1311
|
+
get verified(): ("verified" extends infer T ? T extends "verified" ? T extends Omitted ? unknown : APIUser[T] : never : never) | undefined;
|
|
1312
|
+
/**
|
|
1313
|
+
* The user's email
|
|
1314
|
+
*
|
|
1315
|
+
* @remarks This property is only set when the user was fetched with an OAuth2 token and the `email` scope
|
|
1316
|
+
*/
|
|
1317
|
+
get email(): ("email" extends infer T ? T extends "email" ? T extends Omitted ? unknown : APIUser[T] : never : never) | undefined;
|
|
1318
|
+
/**
|
|
1319
|
+
* The type of nitro subscription on the user's account
|
|
1320
|
+
*
|
|
1321
|
+
* @remarks This property is only set when the user was fetched with an OAuth2 token and the `identify` scope
|
|
1322
|
+
*/
|
|
1323
|
+
get premiumType(): ("premium_type" extends infer T ? T extends "premium_type" ? T extends Omitted ? unknown : APIUser[T] : never : never) | undefined;
|
|
1324
|
+
/**
|
|
1325
|
+
* The timestamp the user was created at
|
|
1326
|
+
*/
|
|
1327
|
+
get createdTimestamp(): number | null;
|
|
1328
|
+
/**
|
|
1329
|
+
* The time the user was created at
|
|
1330
|
+
*/
|
|
1331
|
+
get createdAt(): Date | null;
|
|
1332
|
+
/**
|
|
1333
|
+
* The hexadecimal version of the user accent color, with a leading hash
|
|
1334
|
+
*
|
|
1335
|
+
* @remarks This property is only set when the user was manually fetched
|
|
1336
|
+
*/
|
|
1337
|
+
get hexAccentColor(): string | ("accent_color" extends infer T ? T extends "accent_color" ? T extends Omitted ? unknown : APIUser[T] : never : never) | undefined;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
/**
|
|
1341
|
+
* Represents a user's connection on Discord.
|
|
1342
|
+
*
|
|
1343
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
1344
|
+
*/
|
|
1345
|
+
declare class Connection<Omitted extends keyof APIConnection | '' = ''> extends Structure<APIConnection, Omitted> {
|
|
1346
|
+
/**
|
|
1347
|
+
* The template used for removing data from the raw data stored for each Connection
|
|
1348
|
+
*/
|
|
1349
|
+
static readonly DataTemplate: Partial<APIConnection>;
|
|
1350
|
+
/**
|
|
1351
|
+
* @param data - The raw data received from the API for the connection
|
|
1352
|
+
*/
|
|
1353
|
+
constructor(data: Partialize<APIConnection, Omitted>);
|
|
1354
|
+
/**
|
|
1355
|
+
* {@inheritDoc Structure.[kPatch]}
|
|
1356
|
+
*
|
|
1357
|
+
* @internal
|
|
1358
|
+
*/
|
|
1359
|
+
[kPatch](data: Partial<APIConnection>): this;
|
|
1360
|
+
/**
|
|
1361
|
+
* The id of the connection account
|
|
1362
|
+
*/
|
|
1363
|
+
get id(): "id" extends infer T ? T extends "id" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
|
|
1364
|
+
/**
|
|
1365
|
+
* The username of the connection account
|
|
1366
|
+
*/
|
|
1367
|
+
get name(): "name" extends infer T ? T extends "name" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
|
|
1368
|
+
/**
|
|
1369
|
+
* The type of service this connection is for
|
|
1370
|
+
*/
|
|
1371
|
+
get type(): "type" extends infer T ? T extends "type" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
|
|
1372
|
+
/**
|
|
1373
|
+
* Whether the connection is revoked
|
|
1374
|
+
*/
|
|
1375
|
+
get revoked(): false | NonNullable<"revoked" extends infer T ? T extends "revoked" ? T extends Omitted ? unknown : APIConnection[T] : never : never>;
|
|
1376
|
+
/**
|
|
1377
|
+
* Whether the connection is verified
|
|
1378
|
+
*/
|
|
1379
|
+
get verified(): "verified" extends infer T ? T extends "verified" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
|
|
1380
|
+
/**
|
|
1381
|
+
* Whether friend sync is enabled for this connection
|
|
1382
|
+
*/
|
|
1383
|
+
get friendSync(): "friend_sync" extends infer T ? T extends "friend_sync" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
|
|
1384
|
+
/**
|
|
1385
|
+
* Whether activities related to this connection are shown in the users presence
|
|
1386
|
+
*/
|
|
1387
|
+
get showActivity(): "show_activity" extends infer T ? T extends "show_activity" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
|
|
1388
|
+
/**
|
|
1389
|
+
* Whether this connection has an Oauth2 token for console voice transfer
|
|
1390
|
+
*/
|
|
1391
|
+
get twoWayLink(): "two_way_link" extends infer T ? T extends "two_way_link" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
|
|
1392
|
+
/**
|
|
1393
|
+
* The visibility state for this connection
|
|
1394
|
+
*/
|
|
1395
|
+
get visibility(): "visibility" extends infer T ? T extends "visibility" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
declare function extendTemplate<SuperTemplate extends Record<string, unknown>>(superTemplate: SuperTemplate, additions: Record<string, unknown>): Record<string, unknown> & SuperTemplate;
|
|
1399
|
+
|
|
1400
|
+
export { type APIActualInvite, AnnouncementChannel, AnnouncementThreadChannel, AppliedTagsMixin, AvatarDecorationData, BitField, type BitFieldResolvable, CategoryChannel, Channel, type ChannelDataType, ChannelFlagsBitField, ChannelOwnerMixin, ChannelParentMixin, ChannelPermissionMixin, ChannelPinMixin, ChannelSlowmodeMixin, ChannelTopicMixin, ChannelWebhookMixin, type CollapseUnion, Connection, DMChannel, DMChannelMixin, DataTemplatePropertyName, type EnumLike, ForumChannel, ForumTag, GroupDMChannel, GroupDMMixin, GuildChannelMixin, type If, Invite, MediaChannel, type MergePrototype, type MergePrototypes, Mixin, type MixinBase, type MixinTypes, type Mixinable, type NonAbstract, OptimizeDataPropertyName, type OptionalPropertyNames, type PartialChannel, type Partialize, PermissionOverwrite, PermissionsBitField, PrivateThreadChannel, PublicThreadChannel, type RecursiveReadonlyArray, type ReplaceOmittedWithUnknown, StageChannel, Structure, TextChannel, TextChannelMixin, ThreadChannelMixin, ThreadMetadata, ThreadOnlyChannelMixin, User, VoiceChannel, VoiceChannelMixin, extendTemplate };
|