discord.js 15.0.0-dev.1746533165-c48cc74c4 → 15.0.0-dev.1746663224-f6da9495e
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
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.1746663224-f6da9495e",
|
|
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",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"src",
|
|
26
|
-
"typings"
|
|
26
|
+
"typings/*.d.ts",
|
|
27
|
+
"typings/*.d.mts"
|
|
27
28
|
],
|
|
28
29
|
"contributors": [
|
|
29
30
|
"Crawl <icrawltogo@gmail.com>",
|
|
@@ -61,8 +62,8 @@
|
|
|
61
62
|
"tslib": "^2.8.1",
|
|
62
63
|
"undici": "7.8.0",
|
|
63
64
|
"@discordjs/builders": "^1.11.1",
|
|
64
|
-
"@discordjs/collection": "^2.1.1",
|
|
65
65
|
"@discordjs/formatters": "^0.6.1",
|
|
66
|
+
"@discordjs/collection": "^2.1.1",
|
|
66
67
|
"@discordjs/util": "^1.1.1",
|
|
67
68
|
"@discordjs/rest": "^2.5.0",
|
|
68
69
|
"@discordjs/ws": "^2.0.2"
|
package/src/client/Client.js
CHANGED
|
@@ -441,7 +441,6 @@ class Client extends BaseClient {
|
|
|
441
441
|
const code = resolveInviteCode(invite);
|
|
442
442
|
const query = makeURLSearchParams({
|
|
443
443
|
with_counts: true,
|
|
444
|
-
with_expiration: true,
|
|
445
444
|
guild_scheduled_event_id: options?.guildScheduledEventId,
|
|
446
445
|
});
|
|
447
446
|
const data = await this.rest.get(Routes.invite(code), { query });
|
|
@@ -27,7 +27,7 @@ class PartialGroupDMChannel extends BaseChannel {
|
|
|
27
27
|
* The hash of the channel icon
|
|
28
28
|
* @type {?string}
|
|
29
29
|
*/
|
|
30
|
-
this.icon = data.icon;
|
|
30
|
+
this.icon = data.icon ?? null;
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Recipient data received in a {@link PartialGroupDMChannel}.
|
|
@@ -39,7 +39,7 @@ class PartialGroupDMChannel extends BaseChannel {
|
|
|
39
39
|
* The recipients of this Group DM Channel.
|
|
40
40
|
* @type {PartialRecipient[]}
|
|
41
41
|
*/
|
|
42
|
-
this.recipients = data.recipients;
|
|
42
|
+
this.recipients = data.recipients ?? [];
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* A manager of the messages belonging to this channel
|
package/src/util/Components.js
CHANGED
|
@@ -68,30 +68,7 @@ const { ComponentType } = require('discord-api-types/v10');
|
|
|
68
68
|
* @ignore
|
|
69
69
|
*/
|
|
70
70
|
function createComponent(data) {
|
|
71
|
-
|
|
72
|
-
return data;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
switch (data.type) {
|
|
76
|
-
case ComponentType.ActionRow:
|
|
77
|
-
return new ActionRow(data);
|
|
78
|
-
case ComponentType.Button:
|
|
79
|
-
return new ButtonComponent(data);
|
|
80
|
-
case ComponentType.StringSelect:
|
|
81
|
-
return new StringSelectMenuComponent(data);
|
|
82
|
-
case ComponentType.TextInput:
|
|
83
|
-
return new TextInputComponent(data);
|
|
84
|
-
case ComponentType.UserSelect:
|
|
85
|
-
return new UserSelectMenuComponent(data);
|
|
86
|
-
case ComponentType.RoleSelect:
|
|
87
|
-
return new RoleSelectMenuComponent(data);
|
|
88
|
-
case ComponentType.MentionableSelect:
|
|
89
|
-
return new MentionableSelectMenuComponent(data);
|
|
90
|
-
case ComponentType.ChannelSelect:
|
|
91
|
-
return new ChannelSelectMenuComponent(data);
|
|
92
|
-
default:
|
|
93
|
-
return new Component(data);
|
|
94
|
-
}
|
|
71
|
+
return data instanceof Component ? data : new (ComponentTypeToClass[data.type] ?? Component)(data);
|
|
95
72
|
}
|
|
96
73
|
|
|
97
74
|
exports.createComponent = createComponent;
|
|
@@ -105,3 +82,14 @@ const { RoleSelectMenuComponent } = require('../structures/RoleSelectMenuCompone
|
|
|
105
82
|
const { StringSelectMenuComponent } = require('../structures/StringSelectMenuComponent.js');
|
|
106
83
|
const { TextInputComponent } = require('../structures/TextInputComponent.js');
|
|
107
84
|
const { UserSelectMenuComponent } = require('../structures/UserSelectMenuComponent.js');
|
|
85
|
+
|
|
86
|
+
const ComponentTypeToClass = {
|
|
87
|
+
[ComponentType.ActionRow]: ActionRow,
|
|
88
|
+
[ComponentType.Button]: ButtonComponent,
|
|
89
|
+
[ComponentType.StringSelect]: StringSelectMenuComponent,
|
|
90
|
+
[ComponentType.TextInput]: TextInputComponent,
|
|
91
|
+
[ComponentType.UserSelect]: UserSelectMenuComponent,
|
|
92
|
+
[ComponentType.RoleSelect]: RoleSelectMenuComponent,
|
|
93
|
+
[ComponentType.MentionableSelect]: MentionableSelectMenuComponent,
|
|
94
|
+
[ComponentType.ChannelSelect]: ChannelSelectMenuComponent,
|
|
95
|
+
};
|