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

Function buildUserErrorEmbed

src/utils/embeds.js:245–256  ·  view source on GitHub ↗
(errorType, description = '', options = {})

Source from the content-addressed store, hash-verified

243 * @param {{ titleOverride?: string }} [options]
244 */
245export 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
258function containsDiscordRenderable(content = '') {
259 return /<@!?&?\d+>|<#\d+>|\b\d{17,19}\b/.test(String(content));

Callers 9

replyUserErrorFunction · 0.90
handleInteractionErrorFunction · 0.90
respondUsageMethod · 0.90
deposit.jsFile · 0.90
rob.jsFile · 0.90
askQuestionFunction · 0.90
runSetupWizardFunction · 0.90
errorEmbedFunction · 0.85

Calls 1

createEmbedFunction · 0.85

Tested by

no test coverage detected