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

Function setBirthday

src/utils/database.js:334–350  ·  view source on GitHub ↗
(client, guildId, userId, month, day)

Source from the content-addressed store, hash-verified

332}
333
334export async function setBirthday(client, guildId, userId, month, day) {
335 try {
336 if (!client.db || typeof client.db.set !== "function") {
337 logger.error("Database client is not available for setBirthday.");
338 return false;
339 }
340
341 const key = getGuildBirthdaysKey(guildId);
342 const birthdays = await getGuildBirthdays(client, guildId);
343 birthdays[userId] = { month, day };
344 await client.db.set(key, birthdays);
345 return true;
346 } catch (error) {
347 logger.error(`Error setting birthday for user ${userId} in guild ${guildId}:`, error);
348 return false;
349 }
350}
351
352export async function deleteBirthday(client, guildId, userId) {
353 try {

Callers 1

executeFunction · 0.90

Calls 3

getGuildBirthdaysKeyFunction · 0.85
getGuildBirthdaysFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected