discord.js 15.0.0-dev.1753660951-593369dbb → 15.0.0-dev.1754006526-8f5ac55d8
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/package.json +9 -9
- package/src/structures/Guild.js +0 -38
- package/src/structures/GuildTemplate.js +0 -43
- package/typings/index.d.mts +0 -3
- package/typings/index.d.ts +0 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "discord.js",
|
|
4
|
-
"version": "15.0.0-dev.
|
|
4
|
+
"version": "15.0.0-dev.1754006526-8f5ac55d8",
|
|
5
5
|
"description": "A powerful library for interacting with the Discord API",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"types": "./typings/index.d.ts",
|
|
@@ -61,12 +61,12 @@
|
|
|
61
61
|
"magic-bytes.js": "^1.12.1",
|
|
62
62
|
"tslib": "^2.8.1",
|
|
63
63
|
"undici": "7.11.0",
|
|
64
|
-
"@discordjs/
|
|
65
|
-
"@discordjs/
|
|
66
|
-
"@discordjs/
|
|
67
|
-
"@discordjs/
|
|
68
|
-
"@discordjs/ws": "^3.0.0-dev.
|
|
69
|
-
"@discordjs/
|
|
64
|
+
"@discordjs/builders": "^2.0.0-dev.1754006523-8f5ac55d8",
|
|
65
|
+
"@discordjs/collection": "^3.0.0-dev.1754006524-8f5ac55d8",
|
|
66
|
+
"@discordjs/formatters": "^1.0.0-dev.1754006528-8f5ac55d8",
|
|
67
|
+
"@discordjs/util": "^2.0.0-dev.1754006532-8f5ac55d8",
|
|
68
|
+
"@discordjs/ws": "^3.0.0-dev.1754006534-8f5ac55d8",
|
|
69
|
+
"@discordjs/rest": "^3.0.0-dev.1754006531-8f5ac55d8"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@favware/cliff-jumper": "^4.1.0",
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"turbo": "^2.5.4",
|
|
84
84
|
"typescript": "~5.8.3",
|
|
85
85
|
"@discordjs/api-extractor": "^7.52.7",
|
|
86
|
-
"@discordjs/
|
|
87
|
-
"@discordjs/
|
|
86
|
+
"@discordjs/docgen": "^0.12.1",
|
|
87
|
+
"@discordjs/scripts": "^0.1.0"
|
|
88
88
|
},
|
|
89
89
|
"engines": {
|
|
90
90
|
"node": ">=22.12.0"
|
package/src/structures/Guild.js
CHANGED
|
@@ -1434,29 +1434,6 @@ class Guild extends AnonymousGuild {
|
|
|
1434
1434
|
return this;
|
|
1435
1435
|
}
|
|
1436
1436
|
|
|
1437
|
-
/**
|
|
1438
|
-
* Sets the guild's MFA level
|
|
1439
|
-
* <info>An elevated MFA level requires guild moderators to have 2FA enabled.</info>
|
|
1440
|
-
*
|
|
1441
|
-
* @param {GuildMFALevel} level The MFA level
|
|
1442
|
-
* @param {string} [reason] Reason for changing the guild's MFA level
|
|
1443
|
-
* @returns {Promise<Guild>}
|
|
1444
|
-
* @example
|
|
1445
|
-
* // Set the MFA level of the guild to Elevated
|
|
1446
|
-
* guild.setMFALevel(GuildMFALevel.Elevated)
|
|
1447
|
-
* .then(guild => console.log("Set guild's MFA level to Elevated"))
|
|
1448
|
-
* .catch(console.error);
|
|
1449
|
-
*/
|
|
1450
|
-
async setMFALevel(level, reason) {
|
|
1451
|
-
await this.client.rest.post(Routes.guildMFA(this.id), {
|
|
1452
|
-
body: {
|
|
1453
|
-
level,
|
|
1454
|
-
},
|
|
1455
|
-
reason,
|
|
1456
|
-
});
|
|
1457
|
-
return this;
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
1437
|
/**
|
|
1461
1438
|
* Leaves the guild.
|
|
1462
1439
|
*
|
|
@@ -1473,21 +1450,6 @@ class Guild extends AnonymousGuild {
|
|
|
1473
1450
|
return this;
|
|
1474
1451
|
}
|
|
1475
1452
|
|
|
1476
|
-
/**
|
|
1477
|
-
* Deletes the guild.
|
|
1478
|
-
*
|
|
1479
|
-
* @returns {Promise<Guild>}
|
|
1480
|
-
* @example
|
|
1481
|
-
* // Delete a guild
|
|
1482
|
-
* guild.delete()
|
|
1483
|
-
* .then(guild => console.log(`Deleted the guild ${guild}`))
|
|
1484
|
-
* .catch(console.error);
|
|
1485
|
-
*/
|
|
1486
|
-
async delete() {
|
|
1487
|
-
await this.client.rest.delete(Routes.guild(this.id));
|
|
1488
|
-
return this;
|
|
1489
|
-
}
|
|
1490
|
-
|
|
1491
1453
|
/**
|
|
1492
1454
|
* Sets whether this guild's invites are disabled.
|
|
1493
1455
|
*
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const { setTimeout, clearTimeout } = require('node:timers');
|
|
4
3
|
const { RouteBases, Routes } = require('discord-api-types/v10');
|
|
5
|
-
const { resolveImage } = require('../util/DataResolver.js');
|
|
6
|
-
const { Events } = require('../util/Events.js');
|
|
7
4
|
const { Base } = require('./Base.js');
|
|
8
5
|
|
|
9
6
|
/**
|
|
@@ -127,46 +124,6 @@ class GuildTemplate extends Base {
|
|
|
127
124
|
return this;
|
|
128
125
|
}
|
|
129
126
|
|
|
130
|
-
/**
|
|
131
|
-
* Creates a guild based on this template.
|
|
132
|
-
* <warn>This is only available to bots in fewer than 10 guilds.</warn>
|
|
133
|
-
*
|
|
134
|
-
* @param {string} name The name of the guild
|
|
135
|
-
* @param {BufferResolvable|Base64Resolvable} [icon] The icon for the guild
|
|
136
|
-
* @returns {Promise<Guild>}
|
|
137
|
-
*/
|
|
138
|
-
async createGuild(name, icon) {
|
|
139
|
-
const { client } = this;
|
|
140
|
-
const data = await client.rest.post(Routes.template(this.code), {
|
|
141
|
-
body: {
|
|
142
|
-
name,
|
|
143
|
-
icon: await resolveImage(icon),
|
|
144
|
-
},
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
if (client.guilds.cache.has(data.id)) return client.guilds.cache.get(data.id);
|
|
148
|
-
|
|
149
|
-
return new Promise(resolve => {
|
|
150
|
-
function resolveGuild(guild) {
|
|
151
|
-
client.off(Events.GuildCreate, handleGuild);
|
|
152
|
-
client.decrementMaxListeners();
|
|
153
|
-
resolve(guild);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
client.incrementMaxListeners();
|
|
157
|
-
client.on(Events.GuildCreate, handleGuild);
|
|
158
|
-
|
|
159
|
-
const timeout = setTimeout(() => resolveGuild(client.guilds._add(data)), 10_000).unref();
|
|
160
|
-
|
|
161
|
-
function handleGuild(guild) {
|
|
162
|
-
if (guild.id === data.id) {
|
|
163
|
-
clearTimeout(timeout);
|
|
164
|
-
resolveGuild(guild);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
|
|
170
127
|
/**
|
|
171
128
|
* Options used to edit a guild template.
|
|
172
129
|
*
|
package/typings/index.d.mts
CHANGED
|
@@ -1438,7 +1438,6 @@ export class Guild extends AnonymousGuild {
|
|
|
1438
1438
|
public widgetEnabled: boolean | null;
|
|
1439
1439
|
public get maximumBitrate(): number;
|
|
1440
1440
|
public createTemplate(name: string, description?: string): Promise<GuildTemplate>;
|
|
1441
|
-
public delete(): Promise<Guild>;
|
|
1442
1441
|
public discoverySplashURL(options?: ImageURLOptions): string | null;
|
|
1443
1442
|
public edit(options: GuildEditOptions): Promise<Guild>;
|
|
1444
1443
|
public editOnboarding(options: GuildOnboardingEditOptions): Promise<GuildOnboarding>;
|
|
@@ -1489,7 +1488,6 @@ export class Guild extends AnonymousGuild {
|
|
|
1489
1488
|
public setVerificationLevel(verificationLevel: GuildVerificationLevel | null, reason?: string): Promise<Guild>;
|
|
1490
1489
|
public setPremiumProgressBarEnabled(enabled?: boolean, reason?: string): Promise<Guild>;
|
|
1491
1490
|
public setWidgetSettings(settings: GuildWidgetSettingsData, reason?: string): Promise<Guild>;
|
|
1492
|
-
public setMFALevel(level: GuildMFALevel, reason?: string): Promise<Guild>;
|
|
1493
1491
|
public toJSON(): unknown;
|
|
1494
1492
|
}
|
|
1495
1493
|
|
|
@@ -1824,7 +1822,6 @@ export class GuildTemplate extends Base {
|
|
|
1824
1822
|
public guildId: Snowflake;
|
|
1825
1823
|
public serializedGuild: APITemplateSerializedSourceGuild;
|
|
1826
1824
|
public unSynced: boolean | null;
|
|
1827
|
-
public createGuild(name: string, icon?: Base64Resolvable | BufferResolvable): Promise<Guild>;
|
|
1828
1825
|
public delete(): Promise<GuildTemplate>;
|
|
1829
1826
|
public edit(options?: GuildTemplateEditOptions): Promise<GuildTemplate>;
|
|
1830
1827
|
public sync(): Promise<GuildTemplate>;
|
package/typings/index.d.ts
CHANGED
|
@@ -1438,7 +1438,6 @@ export class Guild extends AnonymousGuild {
|
|
|
1438
1438
|
public widgetEnabled: boolean | null;
|
|
1439
1439
|
public get maximumBitrate(): number;
|
|
1440
1440
|
public createTemplate(name: string, description?: string): Promise<GuildTemplate>;
|
|
1441
|
-
public delete(): Promise<Guild>;
|
|
1442
1441
|
public discoverySplashURL(options?: ImageURLOptions): string | null;
|
|
1443
1442
|
public edit(options: GuildEditOptions): Promise<Guild>;
|
|
1444
1443
|
public editOnboarding(options: GuildOnboardingEditOptions): Promise<GuildOnboarding>;
|
|
@@ -1489,7 +1488,6 @@ export class Guild extends AnonymousGuild {
|
|
|
1489
1488
|
public setVerificationLevel(verificationLevel: GuildVerificationLevel | null, reason?: string): Promise<Guild>;
|
|
1490
1489
|
public setPremiumProgressBarEnabled(enabled?: boolean, reason?: string): Promise<Guild>;
|
|
1491
1490
|
public setWidgetSettings(settings: GuildWidgetSettingsData, reason?: string): Promise<Guild>;
|
|
1492
|
-
public setMFALevel(level: GuildMFALevel, reason?: string): Promise<Guild>;
|
|
1493
1491
|
public toJSON(): unknown;
|
|
1494
1492
|
}
|
|
1495
1493
|
|
|
@@ -1824,7 +1822,6 @@ export class GuildTemplate extends Base {
|
|
|
1824
1822
|
public guildId: Snowflake;
|
|
1825
1823
|
public serializedGuild: APITemplateSerializedSourceGuild;
|
|
1826
1824
|
public unSynced: boolean | null;
|
|
1827
|
-
public createGuild(name: string, icon?: Base64Resolvable | BufferResolvable): Promise<Guild>;
|
|
1828
1825
|
public delete(): Promise<GuildTemplate>;
|
|
1829
1826
|
public edit(options?: GuildTemplateEditOptions): Promise<GuildTemplate>;
|
|
1830
1827
|
public sync(): Promise<GuildTemplate>;
|