(client, guildId, userId, month, day)
| 332 | } |
| 333 | |
| 334 | export 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 | |
| 352 | export async function deleteBirthday(client, guildId, userId) { |
| 353 | try { |
no test coverage detected