Files
custom_discordjs/structures/messages/MessageActionRow.js
T

20 lines
441 B
JavaScript
Raw Normal View History

2023-04-08 16:33:58 -04:00
export class MessageActionRow {
/** @type {Object[]} */
components;
addComponent(comp) {
if (this.components.length > 5) throw "MAXIMUM SIZE REACHED!";
this.components.push(comp);
}
toObj() {
const o = {type: 1, components: []};
for (const k of this.components) {
o.components.push(k.toObj());
}
return o;
}
constructor() { this.components = []; }
}