@buape/carbon 0.4.2 → 0.5.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 +1 -1
- 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 +7 -23
- package/dist/src/abstracts/BaseInteraction.d.ts.map +1 -1
- package/dist/src/abstracts/BaseInteraction.js +12 -12
- 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/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 +35 -0
- package/dist/src/classes/Client.d.ts.map +1 -1
- package/dist/src/classes/Client.js +52 -0
- package/dist/src/classes/Client.js.map +1 -1
- package/dist/src/factories/channelFactory.d.ts +1 -1
- package/dist/src/factories/channelFactory.d.ts.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/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 +16 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +9 -0
- package/dist/src/utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -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/Guild.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,QAAQ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AGrD;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,MAAM,sBAAsB,CAAA;AAE3C,OAAO,EAAE,cAAc,EAAE,M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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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuildMediaChannel.js","sourceRoot":"","sources":["../../../src/structures/GuildMediaChannel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAA;AAE/E;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,sBAA8C;
|
|
1
|
+
{"version":3,"file":"GuildMediaChannel.js","sourceRoot":"","sources":["../../../src/structures/GuildMediaChannel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAA;AAE/E;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,sBAA8C;CAEpF"}
|
|
@@ -1,63 +1,69 @@
|
|
|
1
1
|
import type { APIGuildMember, GuildMemberFlags } 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 type { Guild } from "./Guild.js";
|
|
5
6
|
import { Role } from "./Role.js";
|
|
6
7
|
import { User } from "./User.js";
|
|
7
|
-
export declare class GuildMember extends Base {
|
|
8
|
+
export declare class GuildMember<IsPartial extends false = false, IsGuildPartial extends boolean = false> extends Base {
|
|
9
|
+
constructor(client: Client, rawData: APIGuildMember, guild: Guild<IsGuildPartial>);
|
|
10
|
+
private rawData;
|
|
11
|
+
private setData;
|
|
12
|
+
private setField;
|
|
13
|
+
/**
|
|
14
|
+
* The guild object of the member.
|
|
15
|
+
*/
|
|
16
|
+
guild: Guild<IsGuildPartial>;
|
|
17
|
+
/**
|
|
18
|
+
* The user object of the member.
|
|
19
|
+
*/
|
|
20
|
+
user: User;
|
|
8
21
|
/**
|
|
9
22
|
* The guild-specific nickname of the member.
|
|
10
23
|
*/
|
|
11
|
-
nickname
|
|
24
|
+
get nickname(): IfPartial<IsPartial, string | null>;
|
|
12
25
|
/**
|
|
13
26
|
* The guild-specific avatar hash of the member.
|
|
14
27
|
* You can use {@link GuildMember.avatarUrl} to get the URL of the avatar.
|
|
15
28
|
*/
|
|
16
|
-
avatar
|
|
29
|
+
get avatar(): IfPartial<IsPartial, string | null>;
|
|
30
|
+
/**
|
|
31
|
+
* Get the URL of the member's guild-specific avatar
|
|
32
|
+
*/
|
|
33
|
+
get avatarUrl(): IfPartial<IsPartial, string | null>;
|
|
17
34
|
/**
|
|
18
35
|
* Is this member muted in Voice Channels?
|
|
19
36
|
*/
|
|
20
|
-
mute
|
|
37
|
+
get mute(): IfPartial<IsPartial, boolean>;
|
|
21
38
|
/**
|
|
22
39
|
* Is this member deafened in Voice Channels?
|
|
23
40
|
*/
|
|
24
|
-
deaf
|
|
41
|
+
get deaf(): IfPartial<IsPartial, boolean>;
|
|
25
42
|
/**
|
|
26
43
|
* The date since this member boosted the guild, if applicable.
|
|
27
44
|
*/
|
|
28
|
-
premiumSince
|
|
45
|
+
get premiumSince(): IfPartial<IsPartial, string | null>;
|
|
29
46
|
/**
|
|
30
47
|
* The flags of the member.
|
|
31
48
|
* @see https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-flags
|
|
32
49
|
*/
|
|
33
|
-
flags
|
|
50
|
+
get flags(): IfPartial<IsPartial, GuildMemberFlags>;
|
|
34
51
|
/**
|
|
35
52
|
* The roles of the member
|
|
36
53
|
*/
|
|
37
|
-
roles
|
|
54
|
+
get roles(): IfPartial<IsPartial, Role<true>[]>;
|
|
38
55
|
/**
|
|
39
56
|
* The joined date of the member
|
|
40
57
|
*/
|
|
41
|
-
joinedAt
|
|
58
|
+
get joinedAt(): IfPartial<IsPartial, string>;
|
|
42
59
|
/**
|
|
43
60
|
* The date when the member's communication privileges (timeout) will be reinstated
|
|
44
61
|
*/
|
|
45
|
-
communicationDisabledUntil
|
|
62
|
+
get communicationDisabledUntil(): IfPartial<IsPartial, string | null>;
|
|
46
63
|
/**
|
|
47
64
|
* Is this member yet to pass the guild's Membership Screening requirements?
|
|
48
65
|
*/
|
|
49
|
-
pending
|
|
50
|
-
/**
|
|
51
|
-
* The guild object of the member
|
|
52
|
-
*/
|
|
53
|
-
guild: Guild;
|
|
54
|
-
/**
|
|
55
|
-
* The user object of the member
|
|
56
|
-
*/
|
|
57
|
-
user?: User | null;
|
|
58
|
-
private rawData;
|
|
59
|
-
constructor(client: Client, rawData: APIGuildMember, guild: Guild);
|
|
60
|
-
private setData;
|
|
66
|
+
get pending(): IfPartial<IsPartial, boolean>;
|
|
61
67
|
/**
|
|
62
68
|
* Set the nickname of the member
|
|
63
69
|
*/
|
|
@@ -101,9 +107,5 @@ export declare class GuildMember extends Base {
|
|
|
101
107
|
* Set or remove a timeout for a member in the guild
|
|
102
108
|
*/
|
|
103
109
|
timeoutMember(communicationDisabledUntil: string): Promise<void>;
|
|
104
|
-
/**
|
|
105
|
-
* Get the URL of the member's guild-specific avatar
|
|
106
|
-
*/
|
|
107
|
-
get avatarUrl(): string | null;
|
|
108
110
|
}
|
|
109
111
|
//# sourceMappingURL=GuildMember.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuildMember.d.ts","sourceRoot":"","sources":["../../../src/structures/GuildMember.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,qBAAa,
|
|
1
|
+
{"version":3,"file":"GuildMember.d.ts","sourceRoot":"","sources":["../../../src/structures/GuildMember.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE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