(title, body = '', color = 'primary')
| 260 | } |
| 261 | |
| 262 | function buildNotificationEmbed(title, body = '', color = 'primary') { |
| 263 | const defaultTitle = NOTIFICATION_DEFAULT_TITLES[color] || NOTIFICATION_DEFAULT_TITLES.primary; |
| 264 | let titleText = String(title || '').trim(); |
| 265 | let bodyText = body ? String(body).trim() : ''; |
| 266 | |
| 267 | if (titleText && containsDiscordRenderable(titleText)) { |
| 268 | bodyText = bodyText ? `${titleText}\n\n${bodyText}` : titleText; |
| 269 | titleText = defaultTitle; |
| 270 | } |
| 271 | |
| 272 | return createEmbed({ |
| 273 | title: titleText || defaultTitle, |
| 274 | description: bodyText || undefined, |
| 275 | color, |
| 276 | }); |
| 277 | } |
| 278 | |
| 279 | /** |
| 280 | * @deprecated Prefer buildUserErrorEmbed or replyUserError from errorHandler.js. |
no test coverage detected