@buape/carbon 0.4.2 → 0.6.0
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/README.md +15 -3
- package/dist/package.json +22 -5
- package/dist/src/abstracts/BaseChannel.d.ts +22 -21
- package/dist/src/abstracts/BaseChannel.d.ts.map +1 -1
- package/dist/src/abstracts/BaseChannel.js +37 -27
- package/dist/src/abstracts/BaseChannel.js.map +1 -1
- package/dist/src/abstracts/BaseComponentInteraction.d.ts +3 -2
- package/dist/src/abstracts/BaseComponentInteraction.d.ts.map +1 -1
- package/dist/src/abstracts/BaseComponentInteraction.js +3 -4
- package/dist/src/abstracts/BaseComponentInteraction.js.map +1 -1
- package/dist/src/abstracts/BaseGuildChannel.d.ts +12 -10
- package/dist/src/abstracts/BaseGuildChannel.d.ts.map +1 -1
- package/dist/src/abstracts/BaseGuildChannel.js +35 -22
- package/dist/src/abstracts/BaseGuildChannel.js.map +1 -1
- package/dist/src/abstracts/BaseGuildTextChannel.d.ts +13 -9
- package/dist/src/abstracts/BaseGuildTextChannel.d.ts.map +1 -1
- package/dist/src/abstracts/BaseGuildTextChannel.js +25 -9
- package/dist/src/abstracts/BaseGuildTextChannel.js.map +1 -1
- package/dist/src/abstracts/BaseInteraction.d.ts +10 -24
- package/dist/src/abstracts/BaseInteraction.d.ts.map +1 -1
- package/dist/src/abstracts/BaseInteraction.js +21 -15
- package/dist/src/abstracts/BaseInteraction.js.map +1 -1
- package/dist/src/abstracts/GuildThreadOnlyChannel.d.ts +14 -13
- package/dist/src/abstracts/GuildThreadOnlyChannel.d.ts.map +1 -1
- package/dist/src/abstracts/GuildThreadOnlyChannel.js +31 -16
- package/dist/src/abstracts/GuildThreadOnlyChannel.js.map +1 -1
- package/dist/src/abstracts/Plugin.d.ts +14 -0
- package/dist/src/abstracts/Plugin.d.ts.map +1 -0
- package/dist/src/abstracts/Plugin.js +4 -0
- package/dist/src/abstracts/Plugin.js.map +1 -0
- package/dist/src/adapters/bun/index.d.ts +16 -0
- package/dist/src/adapters/bun/index.d.ts.map +1 -0
- package/dist/src/adapters/bun/index.js +20 -0
- package/dist/src/adapters/bun/index.js.map +1 -0
- package/dist/src/adapters/cloudflare/index.d.ts +16 -0
- package/dist/src/adapters/cloudflare/index.d.ts.map +1 -0
- package/dist/src/adapters/cloudflare/index.js +17 -0
- package/dist/src/adapters/cloudflare/index.js.map +1 -0
- package/dist/src/adapters/next/index.d.ts +14 -0
- package/dist/src/adapters/next/index.d.ts.map +1 -0
- package/dist/src/adapters/next/index.js +17 -0
- package/dist/src/adapters/next/index.js.map +1 -0
- package/dist/src/adapters/node/index.d.ts +16 -0
- package/dist/src/adapters/node/index.d.ts.map +1 -0
- package/dist/src/adapters/node/index.js +20 -0
- package/dist/src/adapters/node/index.js.map +1 -0
- package/dist/src/adapters/shared.d.ts +10 -0
- package/dist/src/adapters/shared.d.ts.map +1 -0
- package/dist/src/adapters/shared.js +2 -0
- package/dist/src/adapters/shared.js.map +1 -0
- package/dist/src/classes/Button.d.ts +0 -4
- package/dist/src/classes/Button.d.ts.map +1 -1
- package/dist/src/classes/Button.js +6 -0
- package/dist/src/classes/Button.js.map +1 -1
- package/dist/src/classes/Client.d.ts +72 -59
- package/dist/src/classes/Client.d.ts.map +1 -1
- package/dist/src/classes/Client.js +125 -111
- package/dist/src/classes/Client.js.map +1 -1
- package/dist/src/classes/Embed.d.ts +2 -1
- package/dist/src/classes/Embed.d.ts.map +1 -1
- package/dist/src/classes/Embed.js +12 -10
- package/dist/src/classes/Embed.js.map +1 -1
- package/dist/src/createHandle.d.ts +20 -0
- package/dist/src/createHandle.d.ts.map +1 -0
- package/dist/src/createHandle.js +57 -0
- package/dist/src/createHandle.js.map +1 -0
- package/dist/src/factories/channelFactory.d.ts +1 -1
- package/dist/src/factories/channelFactory.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/internals/AutocompleteInteraction.d.ts +2 -3
- package/dist/src/internals/AutocompleteInteraction.d.ts.map +1 -1
- package/dist/src/internals/AutocompleteInteraction.js +2 -8
- package/dist/src/internals/AutocompleteInteraction.js.map +1 -1
- package/dist/src/internals/CommandHandler.d.ts.map +1 -1
- package/dist/src/internals/CommandHandler.js +4 -2
- package/dist/src/internals/CommandHandler.js.map +1 -1
- package/dist/src/internals/CommandInteraction.d.ts +3 -4
- package/dist/src/internals/CommandInteraction.d.ts.map +1 -1
- package/dist/src/internals/CommandInteraction.js +6 -12
- package/dist/src/internals/CommandInteraction.js.map +1 -1
- package/dist/src/internals/ModalInteraction.d.ts +3 -2
- package/dist/src/internals/ModalInteraction.d.ts.map +1 -1
- package/dist/src/internals/ModalInteraction.js +3 -3
- package/dist/src/internals/ModalInteraction.js.map +1 -1
- package/dist/src/internals/OptionsHandler.d.ts +8 -12
- package/dist/src/internals/OptionsHandler.d.ts.map +1 -1
- package/dist/src/internals/OptionsHandler.js +27 -9
- package/dist/src/internals/OptionsHandler.js.map +1 -1
- package/dist/src/plugins/linked-roles/LinkedRoles.d.ts +61 -0
- package/dist/src/plugins/linked-roles/LinkedRoles.d.ts.map +1 -0
- package/dist/src/plugins/linked-roles/LinkedRoles.js +196 -0
- package/dist/src/plugins/linked-roles/LinkedRoles.js.map +1 -0
- package/dist/src/plugins/linked-roles/index.d.ts +3 -0
- package/dist/src/plugins/linked-roles/index.d.ts.map +1 -0
- package/dist/src/plugins/linked-roles/index.js +3 -0
- package/dist/src/plugins/linked-roles/index.js.map +1 -0
- package/dist/src/plugins/linked-roles/types.d.ts +94 -0
- package/dist/src/plugins/linked-roles/types.d.ts.map +1 -0
- package/dist/src/plugins/linked-roles/types.js +39 -0
- package/dist/src/plugins/linked-roles/types.js.map +1 -0
- package/dist/src/structures/DmChannel.d.ts +7 -6
- package/dist/src/structures/DmChannel.d.ts.map +1 -1
- package/dist/src/structures/DmChannel.js +7 -6
- package/dist/src/structures/DmChannel.js.map +1 -1
- package/dist/src/structures/GroupDmChannel.d.ts +17 -19
- package/dist/src/structures/GroupDmChannel.d.ts.map +1 -1
- package/dist/src/structures/GroupDmChannel.js +48 -41
- package/dist/src/structures/GroupDmChannel.js.map +1 -1
- package/dist/src/structures/Guild.d.ts +29 -28
- package/dist/src/structures/Guild.d.ts.map +1 -1
- package/dist/src/structures/Guild.js +82 -57
- package/dist/src/structures/Guild.js.map +1 -1
- package/dist/src/structures/GuildAnnouncementChannel.d.ts +3 -4
- package/dist/src/structures/GuildAnnouncementChannel.d.ts.map +1 -1
- package/dist/src/structures/GuildAnnouncementChannel.js +1 -3
- package/dist/src/structures/GuildAnnouncementChannel.js.map +1 -1
- package/dist/src/structures/GuildCategoryChannel.d.ts +3 -3
- package/dist/src/structures/GuildCategoryChannel.d.ts.map +1 -1
- package/dist/src/structures/GuildCategoryChannel.js +0 -1
- package/dist/src/structures/GuildCategoryChannel.js.map +1 -1
- package/dist/src/structures/GuildForumChannel.d.ts +4 -3
- package/dist/src/structures/GuildForumChannel.d.ts.map +1 -1
- package/dist/src/structures/GuildForumChannel.js +4 -3
- package/dist/src/structures/GuildForumChannel.js.map +1 -1
- package/dist/src/structures/GuildMediaChannel.d.ts +3 -7
- package/dist/src/structures/GuildMediaChannel.d.ts.map +1 -1
- package/dist/src/structures/GuildMediaChannel.js +1 -6
- package/dist/src/structures/GuildMediaChannel.js.map +1 -1
- package/dist/src/structures/GuildMember.d.ts +28 -26
- package/dist/src/structures/GuildMember.d.ts.map +1 -1
- package/dist/src/structures/GuildMember.js +95 -57
- package/dist/src/structures/GuildMember.js.map +1 -1
- package/dist/src/structures/GuildStageOrVoiceChannel.d.ts +12 -11
- package/dist/src/structures/GuildStageOrVoiceChannel.d.ts.map +1 -1
- package/dist/src/structures/GuildStageOrVoiceChannel.js +22 -13
- package/dist/src/structures/GuildStageOrVoiceChannel.js.map +1 -1
- package/dist/src/structures/GuildTextChannel.d.ts +6 -6
- package/dist/src/structures/GuildTextChannel.d.ts.map +1 -1
- package/dist/src/structures/GuildTextChannel.js +9 -7
- package/dist/src/structures/GuildTextChannel.js.map +1 -1
- package/dist/src/structures/GuildThreadChannel.d.ts +14 -13
- package/dist/src/structures/GuildThreadChannel.d.ts.map +1 -1
- package/dist/src/structures/GuildThreadChannel.js +59 -28
- package/dist/src/structures/GuildThreadChannel.js.map +1 -1
- package/dist/src/structures/Message.d.ts +50 -41
- package/dist/src/structures/Message.d.ts.map +1 -1
- package/dist/src/structures/Message.js +163 -93
- package/dist/src/structures/Message.js.map +1 -1
- package/dist/src/structures/Role.d.ts +27 -25
- package/dist/src/structures/Role.d.ts.map +1 -1
- package/dist/src/structures/Role.js +100 -61
- package/dist/src/structures/Role.js.map +1 -1
- package/dist/src/structures/User.d.ts +34 -32
- package/dist/src/structures/User.d.ts.map +1 -1
- package/dist/src/structures/User.js +97 -64
- package/dist/src/structures/User.js.map +1 -1
- package/dist/src/types.d.ts +37 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils.d.ts +17 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +16 -5
- package/dist/src/utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +23 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Routes } from "discord-api-types/v10";
|
|
2
2
|
import { BaseChannel } from "../abstracts/BaseChannel.js";
|
|
3
3
|
import { Message } from "./Message.js";
|
|
4
4
|
import { User } from "./User.js";
|
|
@@ -9,51 +9,72 @@ export class GroupDmChannel extends BaseChannel {
|
|
|
9
9
|
/**
|
|
10
10
|
* The name of the channel.
|
|
11
11
|
*/
|
|
12
|
-
name
|
|
12
|
+
get name() {
|
|
13
|
+
if (!this.rawData)
|
|
14
|
+
return undefined;
|
|
15
|
+
return this.rawData.name;
|
|
16
|
+
}
|
|
13
17
|
/**
|
|
14
18
|
* The recipients of the channel.
|
|
15
19
|
*/
|
|
16
|
-
recipients
|
|
17
|
-
|
|
20
|
+
get recipients() {
|
|
21
|
+
if (!this.rawData)
|
|
22
|
+
return undefined;
|
|
23
|
+
const recipients = this.rawData.recipients ?? [];
|
|
24
|
+
return recipients.map((u) => new User(this.client, u));
|
|
25
|
+
}
|
|
18
26
|
/**
|
|
19
27
|
* The ID of the application that created the channel, if it was created by a bot.
|
|
20
28
|
*/
|
|
21
|
-
applicationId
|
|
29
|
+
get applicationId() {
|
|
30
|
+
if (!this.rawData)
|
|
31
|
+
return undefined;
|
|
32
|
+
return this.rawData.application_id ?? null;
|
|
33
|
+
}
|
|
22
34
|
/**
|
|
23
35
|
* The icon hash of the channel.
|
|
24
36
|
*/
|
|
25
|
-
icon
|
|
37
|
+
get icon() {
|
|
38
|
+
if (!this.rawData)
|
|
39
|
+
return undefined;
|
|
40
|
+
return this.rawData.icon ?? null;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get the URL of the channel's icon.
|
|
44
|
+
*/
|
|
45
|
+
get iconUrl() {
|
|
46
|
+
if (!this.rawData)
|
|
47
|
+
return undefined;
|
|
48
|
+
if (!this.icon)
|
|
49
|
+
return null;
|
|
50
|
+
return `https://cdn.discordapp.com/channel-icons/${this.id}/${this.icon}.png`;
|
|
51
|
+
}
|
|
26
52
|
/**
|
|
27
53
|
* The ID of the user who created the channel.
|
|
28
54
|
*/
|
|
29
|
-
ownerId
|
|
55
|
+
get ownerId() {
|
|
56
|
+
if (!this.rawData)
|
|
57
|
+
return undefined;
|
|
58
|
+
return this.rawData.owner_id ?? null;
|
|
59
|
+
}
|
|
30
60
|
/**
|
|
31
61
|
* The ID of the last message sent in the channel.
|
|
32
62
|
*
|
|
33
63
|
* @remarks
|
|
34
64
|
* This might not always resolve to a message. The ID still stays a part of the channel's data, even if the message is deleted.
|
|
35
65
|
*/
|
|
36
|
-
lastMessageId
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
managed;
|
|
41
|
-
setSpecificData(data) {
|
|
42
|
-
this.name = data.name;
|
|
43
|
-
this.recipients = data.recipients?.map((x) => new User(this.client, x));
|
|
44
|
-
this.applicationId = data.application_id;
|
|
45
|
-
this.icon = data.icon;
|
|
46
|
-
this.ownerId = data.owner_id;
|
|
47
|
-
this.lastMessageId = data.last_message_id;
|
|
48
|
-
this.managed = data.managed;
|
|
66
|
+
get lastMessageId() {
|
|
67
|
+
if (!this.rawData)
|
|
68
|
+
return undefined;
|
|
69
|
+
return this.rawData.last_message_id ?? null;
|
|
49
70
|
}
|
|
50
71
|
/**
|
|
51
|
-
*
|
|
72
|
+
* Whether the channel is managed by an Oauth2 application.
|
|
52
73
|
*/
|
|
53
|
-
get
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
74
|
+
get managed() {
|
|
75
|
+
if (!this.rawData)
|
|
76
|
+
return undefined;
|
|
77
|
+
return this.rawData.managed ?? false;
|
|
57
78
|
}
|
|
58
79
|
/**
|
|
59
80
|
* Get the owner of the channel.
|
|
@@ -76,7 +97,7 @@ export class GroupDmChannel extends BaseChannel {
|
|
|
76
97
|
return null;
|
|
77
98
|
return new Message(this.client, {
|
|
78
99
|
id: this.lastMessageId,
|
|
79
|
-
|
|
100
|
+
channelId: this.id
|
|
80
101
|
});
|
|
81
102
|
}
|
|
82
103
|
/**
|
|
@@ -89,21 +110,7 @@ export class GroupDmChannel extends BaseChannel {
|
|
|
89
110
|
name
|
|
90
111
|
}
|
|
91
112
|
});
|
|
92
|
-
this.name
|
|
93
|
-
}
|
|
94
|
-
async addRecipient(user) {
|
|
95
|
-
await this.client.rest.put(Routes.channelRecipient(this.id, typeof user === "string" ? user : user.id));
|
|
96
|
-
if (this.recipients)
|
|
97
|
-
this.recipients.push(typeof user === "string" ? new User(this.client, user) : user);
|
|
98
|
-
else
|
|
99
|
-
this.recipients = [
|
|
100
|
-
typeof user === "string" ? new User(this.client, user) : user
|
|
101
|
-
];
|
|
102
|
-
}
|
|
103
|
-
async removeRecipient(user) {
|
|
104
|
-
await this.client.rest.delete(Routes.channelRecipient(this.id, typeof user === "string" ? user : user.id));
|
|
105
|
-
if (this.recipients)
|
|
106
|
-
this.recipients = this.recipients.filter((x) => x.id !== (typeof user === "string" ? user : user.id));
|
|
113
|
+
this.setField("name", name);
|
|
107
114
|
}
|
|
108
115
|
}
|
|
109
116
|
//# sourceMappingURL=GroupDmChannel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupDmChannel.js","sourceRoot":"","sources":["../../../src/structures/GroupDmChannel.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GroupDmChannel.js","sourceRoot":"","sources":["../../../src/structures/GroupDmChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAEzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;GAEG;AACH,MAAM,OAAO,cAEX,SAAQ,WAA2C;IAGpD;;OAEG;IACH,IAAI,IAAI;QACP,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAkB,CAAA;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAA;IACzB,CAAC;IAED;;OAEG;IACH,IAAI,UAAU;QACb,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAkB,CAAA;QAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAA;QAChD,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAA;IACvD,CAAC;IAED;;OAEG;IACH,IAAI,aAAa;QAChB,IAAI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IAED;;;;;;;OAOG;IACH,IAAI,WAAW;QACd,IAAI,CAAC,IAAI,CAAC,aAAa;YAAE,OAAO,IAAI,CAAA;QACpC,OAAO,IAAI,OAAO,CAAO,IAAI,CAAC,MAAM,EAAE;YACrC,EAAE,EAAE,IAAI,CAAC,aAAa;YACtB,SAAS,EAAE,IAAI,CAAC,EAAE;SAClB,CAAC,CAAA;IACH,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO,CAAC,IAAY;QACzB,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YACrD,IAAI,EAAE;gBACL,IAAI;aACJ;SACD,CAAC,CAAA;QACF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;IAC5B,CAAC;CAqBD"}
|
|
@@ -1,43 +1,56 @@
|
|
|
1
1
|
import { type APIGuild, type RESTPostAPIGuildRoleJSONBody } from "discord-api-types/v10";
|
|
2
2
|
import { Base } from "../abstracts/Base.js";
|
|
3
3
|
import type { Client } from "../classes/Client.js";
|
|
4
|
+
import type { IfPartial } from "../utils.js";
|
|
4
5
|
import { GuildMember } from "./GuildMember.js";
|
|
5
6
|
import { Role } from "./Role.js";
|
|
6
|
-
export declare class Guild extends Base {
|
|
7
|
+
export declare class Guild<IsPartial extends boolean = false> extends Base {
|
|
8
|
+
constructor(client: Client, rawDataOrId: IsPartial extends true ? string : APIGuild);
|
|
9
|
+
private rawData;
|
|
10
|
+
private setData;
|
|
7
11
|
/**
|
|
8
12
|
* The ID of the guild
|
|
9
13
|
*/
|
|
10
|
-
id: string;
|
|
14
|
+
readonly id: string;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the guild is a partial guild (meaning it does not have all the data).
|
|
17
|
+
* If this is true, you should use {@link Guild.fetch} to get the full data of the guild.
|
|
18
|
+
*/
|
|
19
|
+
get partial(): IfPartial<IsPartial, false, true>;
|
|
11
20
|
/**
|
|
12
21
|
* The name of the guild.
|
|
13
22
|
*/
|
|
14
|
-
name
|
|
23
|
+
get name(): IfPartial<IsPartial, string>;
|
|
15
24
|
/**
|
|
16
25
|
* The description of the guild.
|
|
17
26
|
*/
|
|
18
|
-
description
|
|
27
|
+
get description(): IfPartial<IsPartial, string | null>;
|
|
19
28
|
/**
|
|
20
29
|
* The icon hash of the guild.
|
|
21
30
|
* You can use {@link Guild.iconUrl} to get the URL of the icon.
|
|
22
31
|
*/
|
|
23
|
-
icon
|
|
32
|
+
get icon(): IfPartial<IsPartial, string | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Get the URL of the guild's icon
|
|
35
|
+
*/
|
|
36
|
+
get iconUrl(): IfPartial<IsPartial, string | null>;
|
|
24
37
|
/**
|
|
25
38
|
* The splash hash of the guild.
|
|
26
39
|
* You can use {@link Guild.splashUrl} to get the URL of the splash.
|
|
27
40
|
*/
|
|
28
|
-
splash
|
|
41
|
+
get splash(): IfPartial<IsPartial, string | null>;
|
|
42
|
+
/**
|
|
43
|
+
* Get the URL of the guild's splash
|
|
44
|
+
*/
|
|
45
|
+
get splashUrl(): IfPartial<IsPartial, string | null>;
|
|
29
46
|
/**
|
|
30
47
|
* The ID of the owner of the guild.
|
|
31
48
|
*/
|
|
32
|
-
ownerId
|
|
49
|
+
get ownerId(): IfPartial<IsPartial, string>;
|
|
33
50
|
/**
|
|
34
|
-
*
|
|
35
|
-
* If this is true, you should use {@link Guild.fetch} to get the full data of the guild.
|
|
51
|
+
* Get all roles in the guild
|
|
36
52
|
*/
|
|
37
|
-
|
|
38
|
-
private rawData;
|
|
39
|
-
constructor(client: Client, rawDataOrId: APIGuild | string);
|
|
40
|
-
private setData;
|
|
53
|
+
get roles(): IfPartial<IsPartial, Role[]>;
|
|
41
54
|
/**
|
|
42
55
|
* Fetch updated data for this guild.
|
|
43
56
|
* If the guild is partial, this will fetch all the data for the guild and populate the fields.
|
|
@@ -51,26 +64,14 @@ export declare class Guild extends Base {
|
|
|
51
64
|
/**
|
|
52
65
|
* Create a role in the guild
|
|
53
66
|
*/
|
|
54
|
-
createRole(data: RESTPostAPIGuildRoleJSONBody): Promise<Role
|
|
67
|
+
createRole(data: RESTPostAPIGuildRoleJSONBody): Promise<Role<false>>;
|
|
55
68
|
/**
|
|
56
69
|
* Get a member in the guild by ID
|
|
57
70
|
*/
|
|
58
|
-
fetchMember(memberId: string): Promise<GuildMember
|
|
59
|
-
/**
|
|
60
|
-
* Get the URL of the guild's icon
|
|
61
|
-
*/
|
|
62
|
-
get iconUrl(): string | null;
|
|
63
|
-
/**
|
|
64
|
-
* Get the URL of the guild's splash
|
|
65
|
-
*/
|
|
66
|
-
get splashUrl(): string | null;
|
|
67
|
-
/**
|
|
68
|
-
* Get all roles in the guild
|
|
69
|
-
*/
|
|
70
|
-
get roles(): Role[];
|
|
71
|
+
fetchMember(memberId: string): Promise<GuildMember<false, IsPartial>>;
|
|
71
72
|
/**
|
|
72
73
|
* Fetch a channel from the guild by ID
|
|
73
74
|
*/
|
|
74
|
-
fetchChannel(channelId: string): Promise<import("./DmChannel.js").DmChannel | import("./
|
|
75
|
+
fetchChannel(channelId: string): Promise<import("./DmChannel.js").DmChannel<false> | import("./GroupDmChannel.js").GroupDmChannel<false> | import("./GuildTextChannel.js").GuildTextChannel<false> | import("./GuildStageOrVoiceChannel.js").GuildVoiceChannel<false> | import("./GuildCategoryChannel.js").GuildCategoryChannel<false> | import("./GuildAnnouncementChannel.js").GuildAnnouncementChannel<false> | import("./GuildThreadChannel.js").GuildThreadChannel<import("discord-api-types/v10").ThreadChannelType, false> | import("./GuildStageOrVoiceChannel.js").GuildStageChannel<false> | import("./GuildForumChannel.js").GuildForumChannel<false> | import("./GuildMediaChannel.js").GuildMediaChannel | null>;
|
|
75
76
|
}
|
|
76
77
|
//# sourceMappingURL=Guild.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Guild.d.ts","sourceRoot":"","sources":["../../../src/structures/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I,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,CAGrD;IAED;;;OAGG;IACH,IAAI,IAAI,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,CAG9C;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,CAIjD;IAED;;;OAGG;IACH,IAAI,MAAM,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,CAGhD;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,CAInD;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,CAG1C;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAKxC;IAED;;;;OAIG;IACG,KAAK;IASX;;OAEG;IACG,KAAK;IAIX;;OAEG;IACG,UAAU,CAAC,IAAI,EAAE,4BAA4B;IASnD;;OAEG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM;IAOlC;;OAEG;IACG,YAAY,CAAC,SAAS,EAAE,MAAM;CAMpC"}
|
|
@@ -4,61 +4,111 @@ import { channelFactory } from "../factories/channelFactory.js";
|
|
|
4
4
|
import { GuildMember } from "./GuildMember.js";
|
|
5
5
|
import { Role } from "./Role.js";
|
|
6
6
|
export class Guild extends Base {
|
|
7
|
+
constructor(client, rawDataOrId) {
|
|
8
|
+
super(client);
|
|
9
|
+
if (typeof rawDataOrId === "string") {
|
|
10
|
+
this.id = rawDataOrId;
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
this.rawData = rawDataOrId;
|
|
14
|
+
this.id = rawDataOrId.id;
|
|
15
|
+
this.setData(rawDataOrId);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
rawData = null;
|
|
19
|
+
setData(data) {
|
|
20
|
+
if (!data)
|
|
21
|
+
throw new Error("Cannot set data without having data... smh");
|
|
22
|
+
this.rawData = data;
|
|
23
|
+
}
|
|
24
|
+
// private setField(key: keyof APIGuild, value: unknown) {
|
|
25
|
+
// if (!this.rawData)
|
|
26
|
+
// throw new Error("Cannot set field without having data... smh")
|
|
27
|
+
// Reflect.set(this.rawData, key, value)
|
|
28
|
+
// }
|
|
7
29
|
/**
|
|
8
30
|
* The ID of the guild
|
|
9
31
|
*/
|
|
10
32
|
id;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the guild is a partial guild (meaning it does not have all the data).
|
|
35
|
+
* If this is true, you should use {@link Guild.fetch} to get the full data of the guild.
|
|
36
|
+
*/
|
|
37
|
+
get partial() {
|
|
38
|
+
return (this.rawData === null);
|
|
39
|
+
}
|
|
11
40
|
/**
|
|
12
41
|
* The name of the guild.
|
|
13
42
|
*/
|
|
14
|
-
name
|
|
43
|
+
get name() {
|
|
44
|
+
if (!this.rawData)
|
|
45
|
+
return undefined;
|
|
46
|
+
return this.rawData.name;
|
|
47
|
+
}
|
|
15
48
|
/**
|
|
16
49
|
* The description of the guild.
|
|
17
50
|
*/
|
|
18
|
-
description
|
|
51
|
+
get description() {
|
|
52
|
+
if (!this.rawData)
|
|
53
|
+
return undefined;
|
|
54
|
+
return this.rawData.description;
|
|
55
|
+
}
|
|
19
56
|
/**
|
|
20
57
|
* The icon hash of the guild.
|
|
21
58
|
* You can use {@link Guild.iconUrl} to get the URL of the icon.
|
|
22
59
|
*/
|
|
23
|
-
icon
|
|
60
|
+
get icon() {
|
|
61
|
+
if (!this.rawData)
|
|
62
|
+
return undefined;
|
|
63
|
+
return this.rawData.icon;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get the URL of the guild's icon
|
|
67
|
+
*/
|
|
68
|
+
get iconUrl() {
|
|
69
|
+
if (!this.rawData)
|
|
70
|
+
return undefined;
|
|
71
|
+
if (!this.icon)
|
|
72
|
+
return null;
|
|
73
|
+
return `https://cdn.discordapp.com/icons/${this.id}/${this.icon}.png`;
|
|
74
|
+
}
|
|
24
75
|
/**
|
|
25
76
|
* The splash hash of the guild.
|
|
26
77
|
* You can use {@link Guild.splashUrl} to get the URL of the splash.
|
|
27
78
|
*/
|
|
28
|
-
splash
|
|
79
|
+
get splash() {
|
|
80
|
+
if (!this.rawData)
|
|
81
|
+
return undefined;
|
|
82
|
+
return this.rawData.splash;
|
|
83
|
+
}
|
|
29
84
|
/**
|
|
30
|
-
*
|
|
85
|
+
* Get the URL of the guild's splash
|
|
31
86
|
*/
|
|
32
|
-
|
|
87
|
+
get splashUrl() {
|
|
88
|
+
if (!this.rawData)
|
|
89
|
+
return undefined;
|
|
90
|
+
if (!this.splash)
|
|
91
|
+
return null;
|
|
92
|
+
return `https://cdn.discordapp.com/splashes/${this.id}/${this.splash}.png`;
|
|
93
|
+
}
|
|
33
94
|
/**
|
|
34
|
-
*
|
|
35
|
-
* If this is true, you should use {@link Guild.fetch} to get the full data of the guild.
|
|
95
|
+
* The ID of the owner of the guild.
|
|
36
96
|
*/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (typeof rawDataOrId === "string") {
|
|
42
|
-
this.id = rawDataOrId;
|
|
43
|
-
this.partial = true;
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
this.rawData = rawDataOrId;
|
|
47
|
-
this.id = rawDataOrId.id;
|
|
48
|
-
this.partial = false;
|
|
49
|
-
this.setData(rawDataOrId);
|
|
50
|
-
}
|
|
97
|
+
get ownerId() {
|
|
98
|
+
if (!this.rawData)
|
|
99
|
+
return undefined;
|
|
100
|
+
return this.rawData.owner_id;
|
|
51
101
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
this.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
this.
|
|
102
|
+
/**
|
|
103
|
+
* Get all roles in the guild
|
|
104
|
+
*/
|
|
105
|
+
get roles() {
|
|
106
|
+
if (!this.rawData)
|
|
107
|
+
return undefined;
|
|
108
|
+
const roles = this.rawData?.roles;
|
|
109
|
+
if (!roles)
|
|
110
|
+
throw new Error("Cannot get roles without having data... smh");
|
|
111
|
+
return roles.map((role) => new Role(this.client, role));
|
|
62
112
|
}
|
|
63
113
|
/**
|
|
64
114
|
* Fetch updated data for this guild.
|
|
@@ -95,31 +145,6 @@ export class Guild extends Base {
|
|
|
95
145
|
const member = (await this.client.rest.get(Routes.guildMember(this.id, memberId)));
|
|
96
146
|
return new GuildMember(this.client, member, this);
|
|
97
147
|
}
|
|
98
|
-
/**
|
|
99
|
-
* Get the URL of the guild's icon
|
|
100
|
-
*/
|
|
101
|
-
get iconUrl() {
|
|
102
|
-
return this.icon
|
|
103
|
-
? `https://cdn.discordapp.com/icons/${this.id}/${this.icon}.png`
|
|
104
|
-
: null;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Get the URL of the guild's splash
|
|
108
|
-
*/
|
|
109
|
-
get splashUrl() {
|
|
110
|
-
return this.splash
|
|
111
|
-
? `https://cdn.discordapp.com/splashes/${this.id}/${this.splash}.png`
|
|
112
|
-
: null;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Get all roles in the guild
|
|
116
|
-
*/
|
|
117
|
-
get roles() {
|
|
118
|
-
const roles = this.rawData?.roles;
|
|
119
|
-
if (!roles)
|
|
120
|
-
throw new Error("Cannot get roles without having data... smh");
|
|
121
|
-
return roles.map((role) => new Role(this.client, role));
|
|
122
|
-
}
|
|
123
148
|
/**
|
|
124
149
|
* Fetch a channel from the guild by ID
|
|
125
150
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Guild.js","sourceRoot":"","sources":["../../../src/structures/Guild.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,M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jC,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CACzC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,CACrC,CAAmB,CAAA;QACpB,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;IAClD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAAC,SAAiB;QACnC,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAC1C,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CACzB,CAAe,CAAA;QAChB,OAAO,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5C,CAAC;CACD"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { ChannelType } from "discord-api-types/v10";
|
|
1
|
+
import { type APIGuildTextChannel, type ChannelType } from "discord-api-types/v10";
|
|
2
2
|
import { BaseGuildTextChannel } from "../abstracts/BaseGuildTextChannel.js";
|
|
3
3
|
import type { GuildTextChannel } from "./GuildTextChannel.js";
|
|
4
4
|
/**
|
|
5
5
|
* Represents a guild announcement channel.
|
|
6
6
|
*/
|
|
7
|
-
export declare class GuildAnnouncementChannel extends BaseGuildTextChannel<ChannelType.GuildAnnouncement> {
|
|
8
|
-
|
|
9
|
-
protected setMoreSpecificData(): void;
|
|
7
|
+
export declare class GuildAnnouncementChannel<IsPartial extends boolean = false> extends BaseGuildTextChannel<ChannelType.GuildAnnouncement, IsPartial> {
|
|
8
|
+
rawData: APIGuildTextChannel<ChannelType.GuildAnnouncement> | null;
|
|
10
9
|
follow(targetChannel: GuildTextChannel | string): Promise<void>;
|
|
11
10
|
}
|
|
12
11
|
//# sourceMappingURL=GuildAnnouncementChannel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuildAnnouncementChannel.d.ts","sourceRoot":"","sources":["../../../src/structures/GuildAnnouncementChannel.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GuildAnnouncementChannel.d.ts","sourceRoot":"","sources":["../../../src/structures/GuildAnnouncementChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAEhB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D;;GAEG;AACH,qBAAa,wBAAwB,CACpC,SAAS,SAAS,OAAO,GAAG,KAAK,CAChC,SAAQ,oBAAoB,CAAC,WAAW,CAAC,iBAAiB,EAAE,SAAS,CAAC;IAC/D,OAAO,EAAE,mBAAmB,CAAC,WAAW,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAA;IAEpE,MAAM,CAAC,aAAa,EAAE,gBAAgB,GAAG,MAAM;CAQrD"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Routes } from "discord-api-types/v10";
|
|
2
2
|
import { BaseGuildTextChannel } from "../abstracts/BaseGuildTextChannel.js";
|
|
3
3
|
/**
|
|
4
4
|
* Represents a guild announcement channel.
|
|
5
5
|
*/
|
|
6
6
|
export class GuildAnnouncementChannel extends BaseGuildTextChannel {
|
|
7
|
-
type = ChannelType.GuildAnnouncement;
|
|
8
|
-
setMoreSpecificData() { }
|
|
9
7
|
async follow(targetChannel) {
|
|
10
8
|
await this.client.rest.put(Routes.channelFollowers(this.id), {
|
|
11
9
|
body: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuildAnnouncementChannel.js","sourceRoot":"","sources":["../../../src/structures/GuildAnnouncementChannel.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GuildAnnouncementChannel.js","sourceRoot":"","sources":["../../../src/structures/GuildAnnouncementChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAG3E;;GAEG;AACH,MAAM,OAAO,wBAEX,SAAQ,oBAA8D;IAGvE,KAAK,CAAC,MAAM,CAAC,aAAwC;QACpD,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YAC5D,IAAI,EAAE;gBACL,kBAAkB,EACjB,OAAO,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE;aACrE;SACD,CAAC,CAAA;IACH,CAAC;CACD"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ChannelType } from "discord-api-types/v10";
|
|
1
|
+
import type { APIGuildCategoryChannel, ChannelType } from "discord-api-types/v10";
|
|
2
2
|
import { BaseGuildChannel } from "../abstracts/BaseGuildChannel.js";
|
|
3
3
|
/**
|
|
4
4
|
* Represents a guild category channel.
|
|
5
5
|
*/
|
|
6
|
-
export declare class GuildCategoryChannel extends BaseGuildChannel<ChannelType.GuildCategory> {
|
|
7
|
-
|
|
6
|
+
export declare class GuildCategoryChannel<IsPartial extends boolean = false> extends BaseGuildChannel<ChannelType.GuildCategory, IsPartial> {
|
|
7
|
+
rawData: APIGuildCategoryChannel | null;
|
|
8
8
|
/**
|
|
9
9
|
* You cannot send a message to a category channel, so this method throws an error
|
|
10
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuildCategoryChannel.d.ts","sourceRoot":"","sources":["../../../src/structures/GuildCategoryChannel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"GuildCategoryChannel.d.ts","sourceRoot":"","sources":["../../../src/structures/GuildCategoryChannel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,uBAAuB,EACvB,WAAW,EACX,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAEnE;;GAEG;AACH,qBAAa,oBAAoB,CAChC,SAAS,SAAS,OAAO,GAAG,KAAK,CAChC,SAAQ,gBAAgB,CAAC,WAAW,CAAC,aAAa,EAAE,SAAS,CAAC;IACvD,OAAO,EAAE,uBAAuB,GAAG,IAAI,CAAA;IAE/C;;OAEG;IACY,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAGpC"}
|
|
@@ -3,7 +3,6 @@ import { BaseGuildChannel } from "../abstracts/BaseGuildChannel.js";
|
|
|
3
3
|
* Represents a guild category channel.
|
|
4
4
|
*/
|
|
5
5
|
export class GuildCategoryChannel extends BaseGuildChannel {
|
|
6
|
-
setSpecificData() { }
|
|
7
6
|
/**
|
|
8
7
|
* You cannot send a message to a category channel, so this method throws an error
|
|
9
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuildCategoryChannel.js","sourceRoot":"","sources":["../../../src/structures/GuildCategoryChannel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GuildCategoryChannel.js","sourceRoot":"","sources":["../../../src/structures/GuildCategoryChannel.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAEnE;;GAEG;AACH,MAAM,OAAO,oBAEX,SAAQ,gBAAsD;IAG/D;;OAEG;IACM,KAAK,CAAC,IAAI;QAClB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;IACvD,CAAC;CACD"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { APIGuildForumChannel, ChannelType, ForumLayoutType } from "discord-api-types/v10";
|
|
2
2
|
import { GuildThreadOnlyChannel } from "../abstracts/GuildThreadOnlyChannel.js";
|
|
3
|
+
import type { IfPartial } from "../utils.js";
|
|
3
4
|
/**
|
|
4
5
|
* Represents a guild forum channel.
|
|
5
6
|
*/
|
|
6
|
-
export declare class GuildForumChannel extends GuildThreadOnlyChannel<ChannelType.GuildForum> {
|
|
7
|
+
export declare class GuildForumChannel<IsPartial extends boolean = false> extends GuildThreadOnlyChannel<ChannelType.GuildForum, IsPartial> {
|
|
8
|
+
rawData: APIGuildForumChannel | null;
|
|
7
9
|
/**
|
|
8
10
|
* The default forum layout of the channel.
|
|
9
11
|
*/
|
|
10
|
-
defaultForumLayout
|
|
11
|
-
protected setMoreSpecificData(data: APIGuildForumChannel): void;
|
|
12
|
+
get defaultForumLayout(): IfPartial<IsPartial, ForumLayoutType | null>;
|
|
12
13
|
}
|
|
13
14
|
//# sourceMappingURL=GuildForumChannel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuildForumChannel.d.ts","sourceRoot":"","sources":["../../../src/structures/GuildForumChannel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAA;
|
|
1
|
+
{"version":3,"file":"GuildForumChannel.d.ts","sourceRoot":"","sources":["../../../src/structures/GuildForumChannel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C;;GAEG;AACH,qBAAa,iBAAiB,CAC7B,SAAS,SAAS,OAAO,GAAG,KAAK,CAChC,SAAQ,sBAAsB,CAAC,WAAW,CAAC,UAAU,EAAE,SAAS,CAAC;IAC1D,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAAA;IAE5C;;OAEG;IACH,IAAI,kBAAkB,IAAI,SAAS,CAAC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC,CAGrE;CACD"}
|
|
@@ -6,9 +6,10 @@ export class GuildForumChannel extends GuildThreadOnlyChannel {
|
|
|
6
6
|
/**
|
|
7
7
|
* The default forum layout of the channel.
|
|
8
8
|
*/
|
|
9
|
-
defaultForumLayout
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
get defaultForumLayout() {
|
|
10
|
+
if (!this.rawData)
|
|
11
|
+
return undefined;
|
|
12
|
+
return this.rawData.default_forum_layout;
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=GuildForumChannel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuildForumChannel.js","sourceRoot":"","sources":["../../../src/structures/GuildForumChannel.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAA;
|
|
1
|
+
{"version":3,"file":"GuildForumChannel.js","sourceRoot":"","sources":["../../../src/structures/GuildForumChannel.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAA;AAG/E;;GAEG;AACH,MAAM,OAAO,iBAEX,SAAQ,sBAAyD;IAGlE;;OAEG;IACH,IAAI,kBAAkB;QACrB,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAkB,CAAA;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,oBAA6B,CAAA;IAClD,CAAC;CACD"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { APIGuildMediaChannel, ChannelType } from "discord-api-types/v10";
|
|
2
2
|
import { GuildThreadOnlyChannel } from "../abstracts/GuildThreadOnlyChannel.js";
|
|
3
3
|
/**
|
|
4
|
-
* Represents a guild media channel (a forum channel
|
|
4
|
+
* Represents a guild media channel (a forum channel)
|
|
5
5
|
*/
|
|
6
6
|
export declare class GuildMediaChannel extends GuildThreadOnlyChannel<ChannelType.GuildMedia> {
|
|
7
|
-
|
|
8
|
-
* The default forum layout of the channel.
|
|
9
|
-
*/
|
|
10
|
-
defaultForumLayout?: ForumLayoutType;
|
|
11
|
-
protected setMoreSpecificData(): void;
|
|
7
|
+
rawData: APIGuildMediaChannel | null;
|
|
12
8
|
}
|
|
13
9
|
//# sourceMappingURL=GuildMediaChannel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuildMediaChannel.d.ts","sourceRoot":"","sources":["../../../src/structures/GuildMediaChannel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"GuildMediaChannel.d.ts","sourceRoot":"","sources":["../../../src/structures/GuildMediaChannel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAA;AAE/E;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,sBAAsB,CAAC,WAAW,CAAC,UAAU,CAAC;IAC5E,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAAA;CAC5C"}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { GuildThreadOnlyChannel } from "../abstracts/GuildThreadOnlyChannel.js";
|
|
2
2
|
/**
|
|
3
|
-
* Represents a guild media channel (a forum channel
|
|
3
|
+
* Represents a guild media channel (a forum channel)
|
|
4
4
|
*/
|
|
5
5
|
export class GuildMediaChannel extends GuildThreadOnlyChannel {
|
|
6
|
-
/**
|
|
7
|
-
* The default forum layout of the channel.
|
|
8
|
-
*/
|
|
9
|
-
defaultForumLayout;
|
|
10
|
-
setMoreSpecificData() { }
|
|
11
6
|
}
|
|
12
7
|
//# sourceMappingURL=GuildMediaChannel.js.map
|