MCPcopy Create free account
hub / github.com/codebymitch/TitanBot / createButtonRow

Function createButtonRow

src/utils/components.js:121–150  ·  view source on GitHub ↗
(buttons)

Source from the content-addressed store, hash-verified

119}
120
121export function createButtonRow(buttons) {
122 const row = new ActionRowBuilder();
123
124 if (!Array.isArray(buttons) || buttons.length === 0) {
125 return row;
126 }
127
128 for (const button of buttons.slice(0, 5)) {
129 if (!button) continue;
130
131 try {
132 if (button.url) {
133 row.addComponents(createLinkButton(button.label, button.url, button.emoji));
134 } else {
135 row.addComponents(createButton(
136 button.customId,
137 button.label,
138 button.style || 'primary',
139 button.emoji,
140 button.disabled || false
141 ));
142 }
143 } catch (error) {
144
145 continue;
146 }
147 }
148
149 return row;
150}

Callers

nothing calls this directly

Calls 2

createLinkButtonFunction · 0.85
createButtonFunction · 0.85

Tested by

no test coverage detected