catto.js 0.9.4 → 0.9.5
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/MessageBuilder.js +29 -22
- package/package.json +1 -1
package/MessageBuilder.js
CHANGED
|
@@ -59,37 +59,44 @@ class MessageBuilder {
|
|
|
59
59
|
if (!this.data.components) {
|
|
60
60
|
this.data.components = [];
|
|
61
61
|
}
|
|
62
|
-
if (
|
|
63
|
-
this.data.components[
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
this.data.components[
|
|
62
|
+
if (basic.row) {
|
|
63
|
+
if (!this.data.components[(basic.row - 1)]) {
|
|
64
|
+
this.data.components[(basic.row - 1)] = new Discord.ActionRowBuilder();
|
|
65
|
+
}
|
|
66
|
+
this.data.components[(basic.row - 1)].addComponents(btn);
|
|
67
67
|
} else {
|
|
68
|
-
if (!this.data.components[
|
|
69
|
-
this.data.components[
|
|
68
|
+
if (!this.data.components[0]) {
|
|
69
|
+
this.data.components[0] = new Discord.ActionRowBuilder();
|
|
70
70
|
}
|
|
71
|
-
if (this.data.components[
|
|
72
|
-
this.data.components[
|
|
71
|
+
if (this.data.components[0].components.length < 5) {
|
|
72
|
+
this.data.components[0].addComponents(btn);
|
|
73
73
|
} else {
|
|
74
|
-
if (!this.data.components[
|
|
75
|
-
this.data.components[
|
|
74
|
+
if (!this.data.components[1]) {
|
|
75
|
+
this.data.components[1] = new Discord.ActionRowBuilder();
|
|
76
76
|
}
|
|
77
|
-
if (this.data.components[
|
|
78
|
-
this.data.components[
|
|
77
|
+
if (this.data.components[1].components.length < 5) {
|
|
78
|
+
this.data.components[1].addComponents(btn);
|
|
79
79
|
} else {
|
|
80
|
-
if (!this.data.components[
|
|
81
|
-
this.data.components[
|
|
80
|
+
if (!this.data.components[2]) {
|
|
81
|
+
this.data.components[2] = new Discord.ActionRowBuilder();
|
|
82
82
|
}
|
|
83
|
-
if (this.data.components[
|
|
84
|
-
this.data.components[
|
|
83
|
+
if (this.data.components[2].components.length < 5) {
|
|
84
|
+
this.data.components[2].addComponents(btn);
|
|
85
85
|
} else {
|
|
86
|
-
if (!this.data.components[
|
|
87
|
-
this.data.components[
|
|
86
|
+
if (!this.data.components[3]) {
|
|
87
|
+
this.data.components[3] = new Discord.ActionRowBuilder();
|
|
88
88
|
}
|
|
89
|
-
if (this.data.components[
|
|
90
|
-
this.data.components[
|
|
89
|
+
if (this.data.components[3].components.length < 5) {
|
|
90
|
+
this.data.components[3].addComponents(btn);
|
|
91
91
|
} else {
|
|
92
|
-
|
|
92
|
+
if (!this.data.components[4]) {
|
|
93
|
+
this.data.components[4] = new Discord.ActionRowBuilder();
|
|
94
|
+
}
|
|
95
|
+
if (this.data.components[4].components.length < 5) {
|
|
96
|
+
this.data.components[4].addComponents(btn);
|
|
97
|
+
} else {
|
|
98
|
+
throw new Error("Can't have more than 25 buttons in a single message.");
|
|
99
|
+
}
|
|
93
100
|
}
|
|
94
101
|
}
|
|
95
102
|
}
|