ReplyUtils: Make component recreation compatible with multi-row components

This commit is contained in:
2023-04-05 16:47:13 +02:00
parent 4b598cadbf
commit a1c9f9f32e
2 changed files with 8 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ module.exports = {
name: "ReplyUtils",
recreateComponents: function(components) {
console.log("Recreating components");
let newComponents = [];
for (let i = 0; i < components.length; i++) {
let row = new ActionRowBuilder();
for (let j = 0; j < components[i].components.length; j++) {
@@ -21,7 +22,8 @@ module.exports = {
}
row.addComponents(button);
}
return row;
newComponents.push(row);
}
return newComponents;
},
}