@spatulox/simplediscordbot 2.2.0 → 2.2.2
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/CHANGELOG.md +2 -2
- package/dist/index.d.mts +8 -9
- package/dist/index.d.ts +8 -9
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Date format : dd/mm/yyy
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
### 27/04/2026 - 2.2.
|
|
5
|
+
### 27/04/2026 - 2.2.1
|
|
6
6
|
- Add :
|
|
7
7
|
- Add a full wiki matching this version
|
|
8
8
|
- Changes:
|
|
9
9
|
- `DISCORD_BOT_DEV` now enable/disable the Bot.log.debug() / Log.debug()
|
|
10
10
|
- Removed `DISCORD_BOT_CLIENTID`
|
|
11
11
|
- Add overloading for `BotMessage.sendDM()` : Should now match all other `send()` from the framework for consistency
|
|
12
|
-
- Rework the type of `ComponentManagerField`
|
|
12
|
+
- Rework the type of `ComponentManagerField` : 'name' & 'value' are now optional. 'value' is now only mandatory when using 'thumbnailUrl' field with
|
|
13
13
|
- Fix :
|
|
14
14
|
- `Bot.interaction.xxx()` logic : some interaction were enable to pass some requirement because of a wrong check logic
|
|
15
15
|
- RoleManager : take the member.guild.role instead of member.role to assign an exsiting role to a GuildMember
|
package/dist/index.d.mts
CHANGED
|
@@ -753,24 +753,23 @@ declare class SelectMenuManager {
|
|
|
753
753
|
private static _createRowsToReturn;
|
|
754
754
|
}
|
|
755
755
|
|
|
756
|
-
type
|
|
756
|
+
type BasicText = {
|
|
757
757
|
separator?: SeparatorSpacingSize | false;
|
|
758
|
-
name?:
|
|
759
|
-
value?: never;
|
|
758
|
+
name?: string;
|
|
760
759
|
};
|
|
761
|
-
type
|
|
762
|
-
|
|
763
|
-
|
|
760
|
+
type OptionalText = BasicText & {
|
|
761
|
+
value?: string;
|
|
762
|
+
};
|
|
763
|
+
type RequiredText = BasicText & {
|
|
764
764
|
value: string;
|
|
765
765
|
};
|
|
766
|
-
type BasicComponentManagerField = OptionalText | RequiredText;
|
|
767
766
|
type ComponentManagerFieldThumbnail = RequiredText & {
|
|
768
767
|
thumbnailUrl: string;
|
|
769
768
|
};
|
|
770
|
-
type ComponentManagerFieldAccessory =
|
|
769
|
+
type ComponentManagerFieldAccessory = OptionalText & {
|
|
771
770
|
button: ButtonBuilder | ButtonBuilder[];
|
|
772
771
|
};
|
|
773
|
-
type ComponentManagerField = (ComponentManagerFieldAccessory | ComponentManagerFieldThumbnail |
|
|
772
|
+
type ComponentManagerField = (ComponentManagerFieldAccessory | ComponentManagerFieldThumbnail | OptionalText);
|
|
774
773
|
interface ComponentManagerCreate {
|
|
775
774
|
title?: string | null;
|
|
776
775
|
description?: string | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -753,24 +753,23 @@ declare class SelectMenuManager {
|
|
|
753
753
|
private static _createRowsToReturn;
|
|
754
754
|
}
|
|
755
755
|
|
|
756
|
-
type
|
|
756
|
+
type BasicText = {
|
|
757
757
|
separator?: SeparatorSpacingSize | false;
|
|
758
|
-
name?:
|
|
759
|
-
value?: never;
|
|
758
|
+
name?: string;
|
|
760
759
|
};
|
|
761
|
-
type
|
|
762
|
-
|
|
763
|
-
|
|
760
|
+
type OptionalText = BasicText & {
|
|
761
|
+
value?: string;
|
|
762
|
+
};
|
|
763
|
+
type RequiredText = BasicText & {
|
|
764
764
|
value: string;
|
|
765
765
|
};
|
|
766
|
-
type BasicComponentManagerField = OptionalText | RequiredText;
|
|
767
766
|
type ComponentManagerFieldThumbnail = RequiredText & {
|
|
768
767
|
thumbnailUrl: string;
|
|
769
768
|
};
|
|
770
|
-
type ComponentManagerFieldAccessory =
|
|
769
|
+
type ComponentManagerFieldAccessory = OptionalText & {
|
|
771
770
|
button: ButtonBuilder | ButtonBuilder[];
|
|
772
771
|
};
|
|
773
|
-
type ComponentManagerField = (ComponentManagerFieldAccessory | ComponentManagerFieldThumbnail |
|
|
772
|
+
type ComponentManagerField = (ComponentManagerFieldAccessory | ComponentManagerFieldThumbnail | OptionalText);
|
|
774
773
|
interface ComponentManagerCreate {
|
|
775
774
|
title?: string | null;
|
|
776
775
|
description?: string | null;
|
package/dist/index.js
CHANGED
|
@@ -1056,7 +1056,7 @@ var BotInteraction = class {
|
|
|
1056
1056
|
// package.json
|
|
1057
1057
|
var package_default = {
|
|
1058
1058
|
name: "@spatulox/simplediscordbot",
|
|
1059
|
-
version: "2.1
|
|
1059
|
+
version: "2.2.1",
|
|
1060
1060
|
author: "Spatulox",
|
|
1061
1061
|
description: "Simple discord bot framework to set up a bot under 30 secondes",
|
|
1062
1062
|
exports: {
|
|
@@ -2916,7 +2916,7 @@ var ComponentManager = class {
|
|
|
2916
2916
|
options.value && container.addTextDisplayComponents(new import_discord16.TextDisplayBuilder().setContent(options.value));
|
|
2917
2917
|
}
|
|
2918
2918
|
static field(container, field) {
|
|
2919
|
-
const hasText = "name" in field
|
|
2919
|
+
const hasText = ("name" in field || "value" in field) && (field.name || field.value);
|
|
2920
2920
|
if ("button" in field && Array.isArray(field.button) && field.button.length > 0) {
|
|
2921
2921
|
const actionRow = new import_discord16.ActionRowBuilder().addComponents(field.button);
|
|
2922
2922
|
if (hasText) this.fieldAddText(container, { name: field.name, value: field.value });
|
package/dist/index.mjs
CHANGED
|
@@ -1026,7 +1026,7 @@ var BotInteraction = class {
|
|
|
1026
1026
|
// package.json
|
|
1027
1027
|
var package_default = {
|
|
1028
1028
|
name: "@spatulox/simplediscordbot",
|
|
1029
|
-
version: "2.1
|
|
1029
|
+
version: "2.2.1",
|
|
1030
1030
|
author: "Spatulox",
|
|
1031
1031
|
description: "Simple discord bot framework to set up a bot under 30 secondes",
|
|
1032
1032
|
exports: {
|
|
@@ -2909,7 +2909,7 @@ var ComponentManager = class {
|
|
|
2909
2909
|
options.value && container.addTextDisplayComponents(new TextDisplayBuilder().setContent(options.value));
|
|
2910
2910
|
}
|
|
2911
2911
|
static field(container, field) {
|
|
2912
|
-
const hasText = "name" in field
|
|
2912
|
+
const hasText = ("name" in field || "value" in field) && (field.name || field.value);
|
|
2913
2913
|
if ("button" in field && Array.isArray(field.button) && field.button.length > 0) {
|
|
2914
2914
|
const actionRow = new ActionRowBuilder4().addComponents(field.button);
|
|
2915
2915
|
if (hasText) this.fieldAddText(container, { name: field.name, value: field.value });
|