@buape/carbon 0.12.0 → 0.13.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/dist/package.json +3 -3
- package/dist/src/abstracts/BaseGuildChannel.d.ts +1 -2
- package/dist/src/abstracts/BaseGuildChannel.d.ts.map +1 -1
- package/dist/src/abstracts/BaseGuildChannel.js.map +1 -1
- package/dist/src/abstracts/BaseInteraction.d.ts.map +1 -1
- package/dist/src/abstracts/BaseInteraction.js +1 -1
- package/dist/src/abstracts/BaseInteraction.js.map +1 -1
- package/dist/src/abstracts/BaseModalComponent.d.ts +10 -2
- package/dist/src/abstracts/BaseModalComponent.d.ts.map +1 -1
- package/dist/src/abstracts/BaseModalComponent.js +1 -1
- package/dist/src/abstracts/BaseModalComponent.js.map +1 -1
- package/dist/src/abstracts/GuildThreadOnlyChannel.d.ts +1 -2
- package/dist/src/abstracts/GuildThreadOnlyChannel.d.ts.map +1 -1
- package/dist/src/abstracts/GuildThreadOnlyChannel.js.map +1 -1
- package/dist/src/adapters/bun/index.d.ts +4 -3
- package/dist/src/adapters/bun/index.d.ts.map +1 -1
- package/dist/src/adapters/bun/index.js +2 -2
- package/dist/src/adapters/bun/index.js.map +1 -1
- package/dist/src/adapters/fetch/index.d.ts +4 -3
- package/dist/src/adapters/fetch/index.d.ts.map +1 -1
- package/dist/src/adapters/fetch/index.js +7 -2
- package/dist/src/adapters/fetch/index.js.map +1 -1
- package/dist/src/adapters/node/index.d.ts +4 -3
- package/dist/src/adapters/node/index.d.ts.map +1 -1
- package/dist/src/adapters/node/index.js +2 -2
- package/dist/src/adapters/node/index.js.map +1 -1
- package/dist/src/classes/ApplicationManager.d.ts +88 -0
- package/dist/src/classes/ApplicationManager.d.ts.map +1 -0
- package/dist/src/classes/ApplicationManager.js +179 -0
- package/dist/src/classes/ApplicationManager.js.map +1 -0
- package/dist/src/classes/Client.d.ts +9 -0
- package/dist/src/classes/Client.d.ts.map +1 -1
- package/dist/src/classes/Client.js +13 -3
- package/dist/src/classes/Client.js.map +1 -1
- package/dist/src/classes/Listener.d.ts +13 -0
- package/dist/src/classes/Listener.d.ts.map +1 -1
- package/dist/src/classes/Listener.js +27 -6
- package/dist/src/classes/Listener.js.map +1 -1
- package/dist/src/classes/RequestClient.d.ts.map +1 -1
- package/dist/src/classes/RequestClient.js +5 -3
- package/dist/src/classes/RequestClient.js.map +1 -1
- package/dist/src/classes/components/Button.d.ts.map +1 -1
- package/dist/src/classes/components/Button.js.map +1 -1
- package/dist/src/classes/components/FileUpload.d.ts +22 -0
- package/dist/src/classes/components/FileUpload.d.ts.map +1 -0
- package/dist/src/classes/components/FileUpload.js +36 -0
- package/dist/src/classes/components/FileUpload.js.map +1 -0
- package/dist/src/classes/components/Label.d.ts +3 -3
- package/dist/src/classes/components/Label.d.ts.map +1 -1
- package/dist/src/classes/components/Label.js +1 -1
- package/dist/src/classes/components/Label.js.map +1 -1
- package/dist/src/classes/components/TextInput.d.ts +0 -1
- package/dist/src/classes/components/TextInput.d.ts.map +1 -1
- package/dist/src/classes/components/TextInput.js +0 -1
- package/dist/src/classes/components/TextInput.js.map +1 -1
- package/dist/src/errors/DiscordError.d.ts.map +1 -1
- package/dist/src/errors/DiscordError.js.map +1 -1
- package/dist/src/index.d.ts +7 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/internals/CommandInteraction.d.ts.map +1 -1
- package/dist/src/internals/CommandInteraction.js +2 -1
- package/dist/src/internals/CommandInteraction.js.map +1 -1
- package/dist/src/internals/FieldsHandler.d.ts +4 -1
- package/dist/src/internals/FieldsHandler.d.ts.map +1 -1
- package/dist/src/internals/FieldsHandler.js +26 -3
- package/dist/src/internals/FieldsHandler.js.map +1 -1
- package/dist/src/internals/OptionsHandler.d.ts +3 -1
- package/dist/src/internals/OptionsHandler.d.ts.map +1 -1
- package/dist/src/internals/OptionsHandler.js +11 -3
- package/dist/src/internals/OptionsHandler.js.map +1 -1
- package/dist/src/plugins/client-manager/ClientManager.d.ts +151 -0
- package/dist/src/plugins/client-manager/ClientManager.d.ts.map +1 -0
- package/dist/src/plugins/client-manager/ClientManager.js +246 -0
- package/dist/src/plugins/client-manager/ClientManager.js.map +1 -0
- package/dist/src/plugins/client-manager/index.d.ts +2 -0
- package/dist/src/plugins/client-manager/index.d.ts.map +1 -0
- package/dist/src/plugins/client-manager/index.js +2 -0
- package/dist/src/plugins/client-manager/index.js.map +1 -0
- package/dist/src/plugins/command-data/CommandDataPlugin.d.ts.map +1 -1
- package/dist/src/plugins/command-data/CommandDataPlugin.js +3 -6
- package/dist/src/plugins/command-data/CommandDataPlugin.js.map +1 -1
- package/dist/src/plugins/gateway/BabyCache.d.ts +7 -0
- package/dist/src/plugins/gateway/BabyCache.d.ts.map +1 -0
- package/dist/src/plugins/gateway/BabyCache.js +6 -0
- package/dist/src/plugins/gateway/BabyCache.js.map +1 -0
- package/dist/src/plugins/gateway/GatewayPlugin.d.ts +4 -2
- package/dist/src/plugins/gateway/GatewayPlugin.d.ts.map +1 -1
- package/dist/src/plugins/gateway/GatewayPlugin.js +67 -21
- package/dist/src/plugins/gateway/GatewayPlugin.js.map +1 -1
- package/dist/src/plugins/gateway/InteractionEventListener.d.ts +8 -0
- package/dist/src/plugins/gateway/InteractionEventListener.d.ts.map +1 -0
- package/dist/src/plugins/gateway/InteractionEventListener.js +9 -0
- package/dist/src/plugins/gateway/InteractionEventListener.js.map +1 -0
- package/dist/src/plugins/gateway/types.d.ts +5 -0
- package/dist/src/plugins/gateway/types.d.ts.map +1 -1
- package/dist/src/plugins/gateway/types.js.map +1 -1
- package/dist/src/plugins/gateway-forwarder/GatewayForwarderPlugin.d.ts +1 -1
- package/dist/src/plugins/gateway-forwarder/GatewayForwarderPlugin.d.ts.map +1 -1
- package/dist/src/plugins/gateway-forwarder/GatewayForwarderPlugin.js +6 -6
- package/dist/src/plugins/gateway-forwarder/GatewayForwarderPlugin.js.map +1 -1
- package/dist/src/plugins/gateway-forwarder/ShardedGatewayForwarderPlugin.d.ts +0 -1
- package/dist/src/plugins/gateway-forwarder/ShardedGatewayForwarderPlugin.d.ts.map +1 -1
- package/dist/src/plugins/gateway-forwarder/ShardedGatewayForwarderPlugin.js +0 -4
- package/dist/src/plugins/gateway-forwarder/ShardedGatewayForwarderPlugin.js.map +1 -1
- package/dist/src/plugins/gateway-forwarder/index.d.ts +1 -1
- package/dist/src/plugins/gateway-forwarder/index.d.ts.map +1 -1
- package/dist/src/plugins/gateway-forwarder/index.js +1 -1
- package/dist/src/plugins/gateway-forwarder/index.js.map +1 -1
- package/dist/src/plugins/multi-app/ApplicationManager.d.ts +120 -0
- package/dist/src/plugins/multi-app/ApplicationManager.d.ts.map +1 -0
- package/dist/src/plugins/multi-app/ApplicationManager.js +207 -0
- package/dist/src/plugins/multi-app/ApplicationManager.js.map +1 -0
- package/dist/src/plugins/multi-app/index.d.ts +2 -0
- package/dist/src/plugins/multi-app/index.d.ts.map +1 -0
- package/dist/src/plugins/multi-app/index.js +2 -0
- package/dist/src/plugins/multi-app/index.js.map +1 -0
- package/dist/src/plugins/paginator/GoToPageModal.d.ts +1 -1
- package/dist/src/plugins/paginator/GoToPageModal.d.ts.map +1 -1
- package/dist/src/plugins/paginator/GoToPageModal.js +2 -2
- package/dist/src/plugins/paginator/GoToPageModal.js.map +1 -1
- package/dist/src/plugins/paginator/Paginator.d.ts.map +1 -1
- package/dist/src/plugins/paginator/Paginator.js +1 -1
- package/dist/src/plugins/paginator/Paginator.js.map +1 -1
- package/dist/src/plugins/paginator/index.d.ts +2 -0
- package/dist/src/plugins/paginator/index.d.ts.map +1 -1
- package/dist/src/plugins/paginator/index.js +2 -0
- package/dist/src/plugins/paginator/index.js.map +1 -1
- package/dist/src/plugins/sharding/index.d.ts +1 -1
- package/dist/src/plugins/sharding/index.js +1 -1
- package/dist/src/structures/DmChannel.d.ts.map +1 -1
- package/dist/src/structures/DmChannel.js.map +1 -1
- package/dist/src/structures/Emoji.d.ts +11 -0
- package/dist/src/structures/Emoji.d.ts.map +1 -1
- package/dist/src/structures/Emoji.js +20 -0
- package/dist/src/structures/Emoji.js.map +1 -1
- package/dist/src/structures/GroupDmChannel.d.ts +8 -1
- package/dist/src/structures/GroupDmChannel.d.ts.map +1 -1
- package/dist/src/structures/GroupDmChannel.js +13 -4
- package/dist/src/structures/GroupDmChannel.js.map +1 -1
- package/dist/src/structures/Guild.d.ts +70 -4
- package/dist/src/structures/Guild.d.ts.map +1 -1
- package/dist/src/structures/Guild.js +152 -21
- package/dist/src/structures/Guild.js.map +1 -1
- package/dist/src/structures/GuildMember.d.ts +8 -1
- package/dist/src/structures/GuildMember.d.ts.map +1 -1
- package/dist/src/structures/GuildMember.js +24 -9
- package/dist/src/structures/GuildMember.js.map +1 -1
- package/dist/src/structures/GuildScheduledEvent.d.ts +121 -0
- package/dist/src/structures/GuildScheduledEvent.d.ts.map +1 -0
- package/dist/src/structures/GuildScheduledEvent.js +228 -0
- package/dist/src/structures/GuildScheduledEvent.js.map +1 -0
- package/dist/src/structures/GuildThreadChannel.d.ts +1 -1
- package/dist/src/structures/GuildThreadChannel.d.ts.map +1 -1
- package/dist/src/structures/Role.d.ts +33 -12
- package/dist/src/structures/Role.d.ts.map +1 -1
- package/dist/src/structures/Role.js +58 -24
- package/dist/src/structures/Role.js.map +1 -1
- package/dist/src/structures/ThreadMember.d.ts.map +1 -1
- package/dist/src/structures/ThreadMember.js +0 -1
- package/dist/src/structures/ThreadMember.js.map +1 -1
- package/dist/src/structures/User.d.ts +16 -4
- package/dist/src/structures/User.d.ts.map +1 -1
- package/dist/src/structures/User.js +25 -9
- package/dist/src/structures/User.js.map +1 -1
- package/dist/src/structures/Webhook.d.ts +40 -19
- package/dist/src/structures/Webhook.d.ts.map +1 -1
- package/dist/src/structures/Webhook.js +70 -30
- package/dist/src/structures/Webhook.js.map +1 -1
- package/dist/src/types/index.d.ts +1 -1
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/listeners.d.ts +9 -7
- package/dist/src/types/listeners.d.ts.map +1 -1
- package/dist/src/types/listeners.js +3 -1
- package/dist/src/types/listeners.js.map +1 -1
- package/dist/src/utils/cdn.d.ts +31 -0
- package/dist/src/utils/cdn.d.ts.map +1 -0
- package/dist/src/utils/cdn.js +18 -0
- package/dist/src/utils/cdn.js.map +1 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +1 -0
- package/dist/src/utils/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Routes } from "discord-api-types/v10";
|
|
2
2
|
import { Base } from "../abstracts/Base.js";
|
|
3
|
+
import { buildCDNUrl } from "../utils/index.js";
|
|
4
|
+
import { Guild } from "./Guild.js";
|
|
3
5
|
export class Role extends Base {
|
|
4
|
-
constructor(client, rawDataOrId) {
|
|
6
|
+
constructor(client, rawDataOrId, guildId) {
|
|
5
7
|
super(client);
|
|
8
|
+
this._guildId = guildId;
|
|
6
9
|
if (typeof rawDataOrId === "string") {
|
|
7
10
|
this.id = rawDataOrId;
|
|
8
11
|
}
|
|
@@ -13,6 +16,7 @@ export class Role extends Base {
|
|
|
13
16
|
}
|
|
14
17
|
}
|
|
15
18
|
_rawData = null;
|
|
19
|
+
_guildId;
|
|
16
20
|
setData(data) {
|
|
17
21
|
if (!data)
|
|
18
22
|
throw new Error("Cannot set data without having data... smh");
|
|
@@ -35,6 +39,14 @@ export class Role extends Base {
|
|
|
35
39
|
* The ID of the role.
|
|
36
40
|
*/
|
|
37
41
|
id;
|
|
42
|
+
/**
|
|
43
|
+
* The ID of the guild this role belongs to
|
|
44
|
+
*/
|
|
45
|
+
get guildId() {
|
|
46
|
+
if (!this._guildId)
|
|
47
|
+
throw new Error("Guild ID is not available for this role. Use guild.fetchRole() to get a role with guild context.");
|
|
48
|
+
return this._guildId;
|
|
49
|
+
}
|
|
38
50
|
/**
|
|
39
51
|
* Whether the role is a partial role (meaning it does not have all the data).
|
|
40
52
|
* If this is true, you should use {@link Role.fetch} to get the full data of the role.
|
|
@@ -68,14 +80,22 @@ export class Role extends Base {
|
|
|
68
80
|
return this._rawData.icon ?? null;
|
|
69
81
|
}
|
|
70
82
|
/**
|
|
71
|
-
* Get the URL of the role's icon
|
|
83
|
+
* Get the URL of the role's icon with default settings (png format)
|
|
72
84
|
*/
|
|
73
85
|
get iconUrl() {
|
|
74
86
|
if (!this._rawData)
|
|
75
87
|
return undefined;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
88
|
+
return buildCDNUrl(`https://cdn.discordapp.com/role-icons/${this.id}`, this.icon);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Get the URL of the role's icon with custom format and size options
|
|
92
|
+
* @param options Optional format and size parameters
|
|
93
|
+
* @returns The icon URL or null if no icon is set
|
|
94
|
+
*/
|
|
95
|
+
getIconUrl(options) {
|
|
96
|
+
if (!this._rawData)
|
|
97
|
+
return undefined;
|
|
98
|
+
return buildCDNUrl(`https://cdn.discordapp.com/role-icons/${this.id}`, this.icon, options);
|
|
79
99
|
}
|
|
80
100
|
/**
|
|
81
101
|
* If this role is mentionable.
|
|
@@ -154,11 +174,10 @@ export class Role extends Base {
|
|
|
154
174
|
* Fetch updated data for this role.
|
|
155
175
|
* If the role is partial, this will fetch all the data for the role and populate the fields.
|
|
156
176
|
* If the role is not partial, all fields will be updated with new values from Discord.
|
|
157
|
-
* @param guildId The ID of the guild the role is in
|
|
158
177
|
* @returns A Promise that resolves to a non-partial Role
|
|
159
178
|
*/
|
|
160
|
-
async fetch(
|
|
161
|
-
const newData = (await this.client.rest.get(Routes.guildRole(guildId, this.id)));
|
|
179
|
+
async fetch() {
|
|
180
|
+
const newData = (await this.client.rest.get(Routes.guildRole(this.guildId, this.id)));
|
|
162
181
|
if (!newData)
|
|
163
182
|
throw new Error(`Role ${this.id} not found`);
|
|
164
183
|
this.setData(newData);
|
|
@@ -166,10 +185,11 @@ export class Role extends Base {
|
|
|
166
185
|
}
|
|
167
186
|
/**
|
|
168
187
|
* Set the name of the role
|
|
188
|
+
* @param name The new name for the role
|
|
169
189
|
* @param reason The reason for changing the name (will be shown in audit log)
|
|
170
190
|
*/
|
|
171
|
-
async setName(
|
|
172
|
-
await this.client.rest.patch(Routes.guildRole(guildId, this.id), {
|
|
191
|
+
async setName(name, reason) {
|
|
192
|
+
await this.client.rest.patch(Routes.guildRole(this.guildId, this.id), {
|
|
173
193
|
body: { name },
|
|
174
194
|
headers: reason ? { "X-Audit-Log-Reason": reason } : undefined
|
|
175
195
|
});
|
|
@@ -177,10 +197,11 @@ export class Role extends Base {
|
|
|
177
197
|
}
|
|
178
198
|
/**
|
|
179
199
|
* Set the color of the role
|
|
200
|
+
* @param color The new color for the role
|
|
180
201
|
* @param reason The reason for changing the color (will be shown in audit log)
|
|
181
202
|
*/
|
|
182
|
-
async setColor(
|
|
183
|
-
await this.client.rest.patch(Routes.guildRole(guildId, this.id), {
|
|
203
|
+
async setColor(color, reason) {
|
|
204
|
+
await this.client.rest.patch(Routes.guildRole(this.guildId, this.id), {
|
|
184
205
|
body: { color },
|
|
185
206
|
headers: reason ? { "X-Audit-Log-Reason": reason } : undefined
|
|
186
207
|
});
|
|
@@ -191,8 +212,8 @@ export class Role extends Base {
|
|
|
191
212
|
* @param icon The unicode emoji or icon URL to set
|
|
192
213
|
* @param reason The reason for changing the icon (will be shown in audit log)
|
|
193
214
|
*/
|
|
194
|
-
async setIcon(
|
|
195
|
-
await this.client.rest.patch(Routes.guildRole(guildId, this.id), {
|
|
215
|
+
async setIcon(icon, reason) {
|
|
216
|
+
await this.client.rest.patch(Routes.guildRole(this.guildId, this.id), {
|
|
196
217
|
body: { icon },
|
|
197
218
|
headers: reason ? { "X-Audit-Log-Reason": reason } : undefined
|
|
198
219
|
});
|
|
@@ -200,10 +221,11 @@ export class Role extends Base {
|
|
|
200
221
|
}
|
|
201
222
|
/**
|
|
202
223
|
* Set the mentionable status of the role
|
|
224
|
+
* @param mentionable Whether the role should be mentionable
|
|
203
225
|
* @param reason The reason for changing the mentionable status (will be shown in audit log)
|
|
204
226
|
*/
|
|
205
|
-
async setMentionable(
|
|
206
|
-
await this.client.rest.patch(Routes.guildRole(guildId, this.id), {
|
|
227
|
+
async setMentionable(mentionable, reason) {
|
|
228
|
+
await this.client.rest.patch(Routes.guildRole(this.guildId, this.id), {
|
|
207
229
|
body: { mentionable },
|
|
208
230
|
headers: reason ? { "X-Audit-Log-Reason": reason } : undefined
|
|
209
231
|
});
|
|
@@ -211,10 +233,11 @@ export class Role extends Base {
|
|
|
211
233
|
}
|
|
212
234
|
/**
|
|
213
235
|
* Set the hoisted status of the role
|
|
236
|
+
* @param hoisted Whether the role should be hoisted
|
|
214
237
|
* @param reason The reason for changing the hoisted status (will be shown in audit log)
|
|
215
238
|
*/
|
|
216
|
-
async setHoisted(
|
|
217
|
-
await this.client.rest.patch(Routes.guildRole(guildId, this.id), {
|
|
239
|
+
async setHoisted(hoisted, reason) {
|
|
240
|
+
await this.client.rest.patch(Routes.guildRole(this.guildId, this.id), {
|
|
218
241
|
body: { hoist: hoisted },
|
|
219
242
|
headers: reason ? { "X-Audit-Log-Reason": reason } : undefined
|
|
220
243
|
});
|
|
@@ -222,10 +245,11 @@ export class Role extends Base {
|
|
|
222
245
|
}
|
|
223
246
|
/**
|
|
224
247
|
* Set the position of the role
|
|
248
|
+
* @param position The new position for the role
|
|
225
249
|
* @param reason The reason for changing the position (will be shown in audit log)
|
|
226
250
|
*/
|
|
227
|
-
async setPosition(
|
|
228
|
-
await this.client.rest.patch(Routes.guildRole(guildId, this.id), {
|
|
251
|
+
async setPosition(position, reason) {
|
|
252
|
+
await this.client.rest.patch(Routes.guildRole(this.guildId, this.id), {
|
|
229
253
|
body: { position },
|
|
230
254
|
headers: reason ? { "X-Audit-Log-Reason": reason } : undefined
|
|
231
255
|
});
|
|
@@ -236,9 +260,9 @@ export class Role extends Base {
|
|
|
236
260
|
* @param permissions The permissions to set
|
|
237
261
|
* @param reason The reason for changing the permissions (will be shown in audit log)
|
|
238
262
|
*/
|
|
239
|
-
async setPermissions(
|
|
263
|
+
async setPermissions(permissions, reason) {
|
|
240
264
|
const permValue = permissions.reduce((acc, perm) => acc | perm, BigInt(0));
|
|
241
|
-
await this.client.rest.patch(Routes.guildRole(guildId, this.id), {
|
|
265
|
+
await this.client.rest.patch(Routes.guildRole(this.guildId, this.id), {
|
|
242
266
|
body: { permissions: permValue.toString() },
|
|
243
267
|
headers: reason ? { "X-Audit-Log-Reason": reason } : undefined
|
|
244
268
|
});
|
|
@@ -248,10 +272,20 @@ export class Role extends Base {
|
|
|
248
272
|
* Delete the role
|
|
249
273
|
* @param reason The reason for deleting the role (will be shown in audit log)
|
|
250
274
|
*/
|
|
251
|
-
async delete(
|
|
252
|
-
await this.client.rest.delete(Routes.guildRole(guildId, this.id), {
|
|
275
|
+
async delete(reason) {
|
|
276
|
+
await this.client.rest.delete(Routes.guildRole(this.guildId, this.id), {
|
|
253
277
|
headers: reason ? { "X-Audit-Log-Reason": reason } : undefined
|
|
254
278
|
});
|
|
255
279
|
}
|
|
280
|
+
/**
|
|
281
|
+
* Get the member count for this role
|
|
282
|
+
* @returns A Promise that resolves to the number of members with this role
|
|
283
|
+
*/
|
|
284
|
+
async fetchMemberCount() {
|
|
285
|
+
const guild = new Guild(this.client, this.guildId);
|
|
286
|
+
const roleMemberCounts = await guild.fetchRoleMemberCounts();
|
|
287
|
+
const roleCount = roleMemberCounts.find((r) => r.id === this.id);
|
|
288
|
+
return roleCount?.count ?? 0;
|
|
289
|
+
}
|
|
256
290
|
}
|
|
257
291
|
//# sourceMappingURL=Role.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Role.js","sourceRoot":"","sources":["../../../src/structures/Role.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9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AAI,CAAO;IACjD,OAAO,CAAC,OAAO;IAKf;;OAEG;IACH,IAAI,OAAO,IAAI,QAAQ,CAAC,eAAe,CAAC,CAMvC;IAED;;OAEG;IACI,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAElC;;OAEG;IACH,IAAI,EAAE,IAAI,MAAM,GAAG,SAAS,CAG3B;IACD;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,GAAG,SAAS,CAG/B;IACD,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,SAAS,CAGjC;IACD;;OAEG;IACH,IAAI,aAAa,IAAI,MAAM,CAG1B;IACD;;OAEG;IACH,IAAI,KAAK,IAAI,iBAAiB,CAG7B;IACD;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,SAAS;CAW9D"}
|
|
@@ -70,7 +70,6 @@ export class ThreadMember extends Base {
|
|
|
70
70
|
member(guildId) {
|
|
71
71
|
if (!this._rawData?.member || !this.user)
|
|
72
72
|
return undefined;
|
|
73
|
-
// biome-ignore lint/style/noParameterAssign:
|
|
74
73
|
guildId = guildId ?? this.guildId;
|
|
75
74
|
if (!guildId)
|
|
76
75
|
throw new Error("Cannot create GuildMember without a guild ID");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadMember.js","sourceRoot":"","sources":["../../../src/structures/ThreadMember.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,OAAO,YAAa,SAAQ,IAAI;IACrC,YAAY,MAAc,EAAE,OAAwB,EAAE,OAAgB;QACrE,KAAK,CAAC,MAAM,CAAC,CA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-api-types/v10";
|
|
2
2
|
import { Base } from "../abstracts/Base.js";
|
|
3
3
|
import type { Client } from "../classes/Client.js";
|
|
4
|
-
import type { MessagePayload } from "../types/index.js";
|
|
5
|
-
import type
|
|
4
|
+
import type { IfPartial, MessagePayload } from "../types/index.js";
|
|
5
|
+
import { type CDNUrlOptions } from "../utils/index.js";
|
|
6
6
|
import { Message } from "./Message.js";
|
|
7
7
|
export declare class User<IsPartial extends boolean = false> extends Base {
|
|
8
8
|
constructor(client: Client, rawDataOrId: IsPartial extends true ? string : APIUser);
|
|
@@ -52,18 +52,30 @@ export declare class User<IsPartial extends boolean = false> extends Base {
|
|
|
52
52
|
*/
|
|
53
53
|
get avatar(): IfPartial<IsPartial, string | null>;
|
|
54
54
|
/**
|
|
55
|
-
* Get the URL of the user's avatar
|
|
55
|
+
* Get the URL of the user's avatar with default settings (png format)
|
|
56
56
|
*/
|
|
57
57
|
get avatarUrl(): IfPartial<IsPartial, string | null>;
|
|
58
|
+
/**
|
|
59
|
+
* Get the URL of the user's avatar with custom format and size options
|
|
60
|
+
* @param options Optional format and size parameters
|
|
61
|
+
* @returns The avatar URL or null if no avatar is set
|
|
62
|
+
*/
|
|
63
|
+
getAvatarUrl(options?: CDNUrlOptions): IfPartial<IsPartial, string | null>;
|
|
58
64
|
/**
|
|
59
65
|
* The banner hash of the user.
|
|
60
66
|
* You can use {@link User.bannerUrl} to get the URL of the banner.
|
|
61
67
|
*/
|
|
62
68
|
get banner(): IfPartial<IsPartial, string | null>;
|
|
63
69
|
/**
|
|
64
|
-
* Get the URL of the user's banner
|
|
70
|
+
* Get the URL of the user's banner with default settings (png format)
|
|
65
71
|
*/
|
|
66
72
|
get bannerUrl(): IfPartial<IsPartial, string | null>;
|
|
73
|
+
/**
|
|
74
|
+
* Get the URL of the user's banner with custom format and size options
|
|
75
|
+
* @param options Optional format and size parameters
|
|
76
|
+
* @returns The banner URL or null if no banner is set
|
|
77
|
+
*/
|
|
78
|
+
getBannerUrl(options?: CDNUrlOptions): IfPartial<IsPartial, string | null>;
|
|
67
79
|
/**
|
|
68
80
|
* The accent color of the user.
|
|
69
81
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.d.ts","sourceRoot":"","sources":["../../../src/structures/User.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,YAAY,EAEjB,KAAK,OAAO,EAEZ,KAAK,SAAS,EACd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"User.d.ts","sourceRoot":"","sources":["../../../src/structures/User.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,YAAY,EAEjB,KAAK,OAAO,EAEZ,KAAK,SAAS,EACd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAEN,KAAK,aAAa,EAElB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,qBAAa,IAAI,CAAC,SAAS,SAAS,OAAO,GAAG,KAAK,CAAE,SAAQ,IAAI;gBAE/D,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,SAAS,SAAS,IAAI,GAAG,MAAM,GAAG,OAAO;IAYvD,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAO;IACzC,OAAO,CAAC,OAAO;IASf;;OAEG;IACH,IAAI,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,CAM/B;IAED;;OAEG;IACH,QAAQ,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AAG,IAAI,CAAC,CAGrD;IAED;;;OAGG;IACH,QAAQ,IAAI,MAAM;IAIlB;;;;;OAKG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAWnC;;OAEG;IACG,QAAQ,CAAC,MAAM,EAAE,MAAM;IAS7B;;OAEG;IACG,IAAI,CAAC,IAAI,EAAE,cAAc;CAU/B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Routes } from "discord-api-types/v10";
|
|
2
2
|
import { Base } from "../abstracts/Base.js";
|
|
3
|
-
import { serializePayload } from "../utils/index.js";
|
|
3
|
+
import { buildCDNUrl, serializePayload } from "../utils/index.js";
|
|
4
4
|
import { Message } from "./Message.js";
|
|
5
5
|
export class User extends Base {
|
|
6
6
|
constructor(client, rawDataOrId) {
|
|
@@ -102,14 +102,22 @@ export class User extends Base {
|
|
|
102
102
|
return this._rawData.avatar;
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
|
-
* Get the URL of the user's avatar
|
|
105
|
+
* Get the URL of the user's avatar with default settings (png format)
|
|
106
106
|
*/
|
|
107
107
|
get avatarUrl() {
|
|
108
108
|
if (!this._rawData)
|
|
109
109
|
return undefined;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
return buildCDNUrl(`https://cdn.discordapp.com/avatars/${this.id}`, this.avatar);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Get the URL of the user's avatar with custom format and size options
|
|
114
|
+
* @param options Optional format and size parameters
|
|
115
|
+
* @returns The avatar URL or null if no avatar is set
|
|
116
|
+
*/
|
|
117
|
+
getAvatarUrl(options) {
|
|
118
|
+
if (!this._rawData)
|
|
119
|
+
return undefined;
|
|
120
|
+
return buildCDNUrl(`https://cdn.discordapp.com/avatars/${this.id}`, this.avatar, options);
|
|
113
121
|
}
|
|
114
122
|
/**
|
|
115
123
|
* The banner hash of the user.
|
|
@@ -121,14 +129,22 @@ export class User extends Base {
|
|
|
121
129
|
return this._rawData.banner ?? null;
|
|
122
130
|
}
|
|
123
131
|
/**
|
|
124
|
-
* Get the URL of the user's banner
|
|
132
|
+
* Get the URL of the user's banner with default settings (png format)
|
|
125
133
|
*/
|
|
126
134
|
get bannerUrl() {
|
|
127
135
|
if (!this._rawData)
|
|
128
136
|
return undefined;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
137
|
+
return buildCDNUrl(`https://cdn.discordapp.com/banners/${this.id}`, this.banner);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Get the URL of the user's banner with custom format and size options
|
|
141
|
+
* @param options Optional format and size parameters
|
|
142
|
+
* @returns The banner URL or null if no banner is set
|
|
143
|
+
*/
|
|
144
|
+
getBannerUrl(options) {
|
|
145
|
+
if (!this._rawData)
|
|
146
|
+
return undefined;
|
|
147
|
+
return buildCDNUrl(`https://cdn.discordapp.com/banners/${this.id}`, this.banner, options);
|
|
132
148
|
}
|
|
133
149
|
/**
|
|
134
150
|
* The accent color of the user.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../../src/structures/User.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,MAAM,EAEN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../../src/structures/User.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,MAAM,EAEN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAG3C,OAAO,EACN,WAAW,EAEX,gBAAgB,EAChB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,OAAO,IAAwC,SAAQ,IAAI;IAChE,YACC,MAAc,EACd,WAAsD;QAEtD,KAAK,CAAC,MAAM,CAAC,CAAA;QACb,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AAE;YACrE,IAAI,EAAE;gBACL,YAAY,EAAE,MAAM;aACpB;SACD,CAAC,CAAiB,CAAA;QACnB,OAAO,SAAS,CAAA;IACjB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,IAAoB;QAC9B,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAC9C,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAC3C,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC,EACpC;YACC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;SAC5B,CACD,CAAe,CAAA;QAChB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACzC,CAAC;CACD"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import type { APIWebhook, RESTPatchAPIWebhookJSONBody, WebhookType } from "discord-api-types/v10";
|
|
2
|
-
import {
|
|
3
|
-
import type { Client } from "../classes/Client.js";
|
|
1
|
+
import type { APIMessage, APIUser, APIWebhook, RESTPatchAPIWebhookJSONBody, WebhookType } from "discord-api-types/v10";
|
|
2
|
+
import { RequestClient } from "../classes/RequestClient.js";
|
|
4
3
|
import type { IfPartial, MessagePayload } from "../types/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import { User } from "./User.js";
|
|
4
|
+
import { type CDNUrlOptions } from "../utils/index.js";
|
|
7
5
|
export type WebhookInput = APIWebhook | {
|
|
8
6
|
id: string;
|
|
9
7
|
token: string;
|
|
10
8
|
threadId?: string;
|
|
11
9
|
} | string;
|
|
12
|
-
export declare class Webhook<IsPartial extends boolean = false>
|
|
13
|
-
|
|
14
|
-
constructor(
|
|
10
|
+
export declare class Webhook<IsPartial extends boolean = false> {
|
|
11
|
+
rest: RequestClient;
|
|
12
|
+
constructor(rawData: APIWebhook);
|
|
13
|
+
constructor(idAndToken: {
|
|
15
14
|
id: string;
|
|
16
15
|
token: string;
|
|
17
16
|
threadId?: string;
|
|
18
17
|
});
|
|
19
|
-
constructor(
|
|
20
|
-
constructor(
|
|
18
|
+
constructor(url: string);
|
|
19
|
+
constructor(input: WebhookInput);
|
|
21
20
|
protected _rawData: APIWebhook | null;
|
|
22
21
|
private setData;
|
|
23
22
|
/**
|
|
@@ -58,7 +57,7 @@ export declare class Webhook<IsPartial extends boolean = false> extends Base {
|
|
|
58
57
|
* The user this webhook was created by
|
|
59
58
|
* Not returned when getting a webhook with its token
|
|
60
59
|
*/
|
|
61
|
-
get user(): IfPartial<IsPartial,
|
|
60
|
+
get user(): IfPartial<IsPartial, APIUser | undefined>;
|
|
62
61
|
/**
|
|
63
62
|
* The default name of the webhook
|
|
64
63
|
*/
|
|
@@ -68,9 +67,15 @@ export declare class Webhook<IsPartial extends boolean = false> extends Base {
|
|
|
68
67
|
*/
|
|
69
68
|
get avatar(): IfPartial<IsPartial, string | null>;
|
|
70
69
|
/**
|
|
71
|
-
* Get the URL of the webhook's avatar
|
|
70
|
+
* Get the URL of the webhook's avatar with default settings (png format)
|
|
72
71
|
*/
|
|
73
72
|
get avatarUrl(): IfPartial<IsPartial, string | null>;
|
|
73
|
+
/**
|
|
74
|
+
* Get the URL of the webhook's avatar with custom format and size options
|
|
75
|
+
* @param options Optional format and size parameters
|
|
76
|
+
* @returns The avatar URL or null if no avatar is set
|
|
77
|
+
*/
|
|
78
|
+
getAvatarUrl(options?: CDNUrlOptions): IfPartial<IsPartial, string | null>;
|
|
74
79
|
/**
|
|
75
80
|
* The bot/OAuth2 application that created this webhook
|
|
76
81
|
*/
|
|
@@ -89,7 +94,25 @@ export declare class Webhook<IsPartial extends boolean = false> extends Base {
|
|
|
89
94
|
* The url used for executing the webhook
|
|
90
95
|
* Only returned by the webhooks OAuth2 flow
|
|
91
96
|
*/
|
|
92
|
-
get url():
|
|
97
|
+
get url(): string;
|
|
98
|
+
urlWithOptions({
|
|
99
|
+
/**
|
|
100
|
+
* Waits for server confirmation of message send before response, and returns the created message body
|
|
101
|
+
*/
|
|
102
|
+
wait,
|
|
103
|
+
/**
|
|
104
|
+
* Specify the thread to use with this webhook
|
|
105
|
+
*/
|
|
106
|
+
threadId,
|
|
107
|
+
/**
|
|
108
|
+
* Whether to respect the components field of the request. When enabled, allows application-owned webhooks to use all components and non-owned webhooks to use non-interactive components
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
111
|
+
withComponents }: {
|
|
112
|
+
wait?: boolean;
|
|
113
|
+
threadId?: string;
|
|
114
|
+
withComponents?: boolean;
|
|
115
|
+
}): string;
|
|
93
116
|
/**
|
|
94
117
|
* Fetch this webhook's data
|
|
95
118
|
* @returns A Promise that resolves to a non-partial Webhook
|
|
@@ -110,17 +133,15 @@ export declare class Webhook<IsPartial extends boolean = false> extends Base {
|
|
|
110
133
|
* Send a message through this webhook
|
|
111
134
|
* @param data The data to send with the webhook
|
|
112
135
|
* @param threadId Optional ID of the thread to send the message to. If not provided, uses the webhook's thread ID.
|
|
113
|
-
* @returns A Promise that resolves to the created message
|
|
114
136
|
*/
|
|
115
|
-
send(data: MessagePayload, threadId?: string): Promise<
|
|
137
|
+
send<T extends true | false = false>(data: MessagePayload, threadId?: string, wait?: T): Promise<T extends true ? APIMessage : void>;
|
|
116
138
|
/**
|
|
117
139
|
* Edit a message sent by this webhook
|
|
118
140
|
* @param messageId The ID of the message to edit
|
|
119
141
|
* @param data The data to edit the message with
|
|
120
142
|
* @param threadId Optional ID of the thread to edit the message in. If not provided, uses the webhook's thread ID.
|
|
121
|
-
* @returns A Promise that resolves to the edited message
|
|
122
143
|
*/
|
|
123
|
-
edit(messageId: string, data: MessagePayload, threadId?: string): Promise<
|
|
144
|
+
edit(messageId: string, data: MessagePayload, threadId?: string): Promise<APIMessage>;
|
|
124
145
|
/**
|
|
125
146
|
* Delete a message sent by this webhook
|
|
126
147
|
* @param messageId The ID of the message to delete
|
|
@@ -132,8 +153,8 @@ export declare class Webhook<IsPartial extends boolean = false> extends Base {
|
|
|
132
153
|
* Get a message sent by this webhook
|
|
133
154
|
* @param messageId The ID of the message to get
|
|
134
155
|
* @param threadId Optional ID of the thread to get the message from. If not provided, uses the webhook's thread ID.
|
|
135
|
-
* @returns
|
|
156
|
+
* @returns The raw data of the message, which you can then use to create a Message instance
|
|
136
157
|
*/
|
|
137
|
-
getMessage(messageId: string, threadId?: string): Promise<
|
|
158
|
+
getMessage(messageId: string, threadId?: string): Promise<APIMessage>;
|
|
138
159
|
}
|
|
139
160
|
//# sourceMappingURL=Webhook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Webhook.d.ts","sourceRoot":"","sources":["../../../src/structures/Webhook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,
|
|
1
|
+
{"version":3,"file":"Webhook.d.ts","sourceRoot":"","sources":["../../../src/structures/Webhook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,EACV,OAAO,EACP,UAAU,EAGV,2BAA2B,EAE3B,WAAW,EACX,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAEN,KAAK,aAAa,EAElB,MAAM,mBAAmB,CAAA;AAE1B,MAAM,MAAM,YAAY,GACrB,UAAU,GACV;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAChD,MAAM,CAAA;AAET,qBAAa,OAAO,CAAC,SAAS,SAAS,OAAO,GAAG,KAAK;IACrD,IAAI,EAAE,aAAa,CAAA;gBACP,OAAO,EAAE,UAAU;gBACnB,UAAU,EAAE;QACvB,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,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