MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / deleteBirthday

Function deleteBirthday

src/utils/database.js:352–370  ·  view source on GitHub ↗
(client, guildId, userId)

Source from the content-addressed store, hash-verified

350}
351
352export async function deleteBirthday(client, guildId, userId) {
353 try {
354 if (!client.db || typeof client.db.set !== "function") {
355 logger.error("Database client is not available for deleteBirthday.");
356 return false;
357 }
358
359 const key = getGuildBirthdaysKey(guildId);
360 const birthdays = await getGuildBirthdays(client, guildId);
361 if (birthdays[userId]) {
362 delete birthdays[userId];
363 await client.db.set(key, birthdays);
364 }
365 return true;
366 } catch (error) {
367 logger.error(`Error deleting birthday for user ${userId} in guild ${guildId}:`, error);
368 return false;
369 }
370}
371
372export function getMonthName(monthNum) {
373 const months = [

Callers 4

executeFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90

Calls 3

getGuildBirthdaysKeyFunction · 0.85
getGuildBirthdaysFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected