MCPcopy
hub / github.com/codebymitch/TitanBot / buildNotificationEmbed

Function buildNotificationEmbed

src/utils/embeds.js:262–277  ·  view source on GitHub ↗
(title, body = '', color = 'primary')

Source from the content-addressed store, hash-verified

260}
261
262function 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.

Callers 3

successEmbedFunction · 0.85
infoEmbedFunction · 0.85
warningEmbedFunction · 0.85

Calls 2

createEmbedFunction · 0.85

Tested by

no test coverage detected