(buttons)
| 119 | } |
| 120 | |
| 121 | export 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 | } |
nothing calls this directly
no test coverage detected