(errorType, description = '', options = {})
| 243 | * @param {{ titleOverride?: string }} [options] |
| 244 | */ |
| 245 | export function buildUserErrorEmbed(errorType, description = '', options = {}) { |
| 246 | const type = errorType || 'unknown'; |
| 247 | const title = options.titleOverride || USER_ERROR_TITLES[type] || USER_ERROR_TITLES.unknown; |
| 248 | const color = USER_ERROR_COLORS[type] || 'error'; |
| 249 | const body = description ? String(description).trim() : undefined; |
| 250 | |
| 251 | return createEmbed({ |
| 252 | title, |
| 253 | description: body, |
| 254 | color, |
| 255 | }); |
| 256 | } |
| 257 | |
| 258 | function containsDiscordRenderable(content = '') { |
| 259 | return /<@!?&?\d+>|<#\d+>|\b\d{17,19}\b/.test(String(content)); |
no test coverage detected