(client, guildId)
| 316 | }; |
| 317 | |
| 318 | export async function getGuildBirthdays(client, guildId) { |
| 319 | const key = getGuildBirthdaysKey(guildId); |
| 320 | try { |
| 321 | if (!client.db || typeof client.db.get !== "function") { |
| 322 | logger.error("Database client is not available for getGuildBirthdays."); |
| 323 | return {}; |
| 324 | } |
| 325 | |
| 326 | const rawData = await client.db.get(key, {}); |
| 327 | return unwrapReplitData(rawData) || {}; |
| 328 | } catch (error) { |
| 329 | logger.error(`Error retrieving birthdays for guild ${guildId}:`, error); |
| 330 | return {}; |
| 331 | } |
| 332 | } |
| 333 | |
| 334 | export async function setBirthday(client, guildId, userId, month, day) { |
| 335 | try { |
no test coverage detected