(client, guildId, userId)
| 350 | } |
| 351 | |
| 352 | export 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 | |
| 372 | export function getMonthName(monthNum) { |
| 373 | const months = [ |
no test coverage detected