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

Function errorEmbed

src/utils/embeds.js:282–295  ·  view source on GitHub ↗
(title, detail = null, options = {})

Source from the content-addressed store, hash-verified

280 * @deprecated Prefer buildUserErrorEmbed or replyUserError from errorHandler.js.
281 */
282export function errorEmbed(title, detail = null, options = {}) {
283 const { showDetails = process.env.NODE_ENV !== 'production' } = options;
284 let body = detail;
285
286 if (detail && showDetails && typeof detail !== 'string') {
287 const detailText = detail.message || String(detail);
288 body = formatCodeBlock(detailText);
289 }
290
291 const description = body ? String(body).trim() : '';
292 const titleOverride = title && title !== 'Error' ? title : undefined;
293
294 return buildUserErrorEmbed('unknown', description, { titleOverride });
295}
296
297/** @param {string} titleOrBody - With one arg: body text. With two args: title and body. */
298export function successEmbed(title, body = '') {

Callers

nothing calls this directly

Calls 2

formatCodeBlockFunction · 0.85
buildUserErrorEmbedFunction · 0.85

Tested by

no test coverage detected