(client, guildId, roleId)
| 1147 | } |
| 1148 | |
| 1149 | export async function getApplicationRoleSettings(client, guildId, roleId) { |
| 1150 | try { |
| 1151 | if (!client.db || typeof client.db.get !== "function") { |
| 1152 | return { questions: null, logChannelId: null }; |
| 1153 | } |
| 1154 | |
| 1155 | const key = getApplicationRoleSettingsKey(guildId, roleId); |
| 1156 | const settings = await client.db.get(key, {}); |
| 1157 | return unwrapReplitData(settings) || { questions: null, logChannelId: null }; |
| 1158 | } catch (error) { |
| 1159 | logger.error(`Error getting application role settings for ${guildId}:${roleId}:`, error); |
| 1160 | return { questions: null, logChannelId: null }; |
| 1161 | } |
| 1162 | } |
| 1163 | |
| 1164 | export async function saveApplicationRoleSettings(client, guildId, roleId, settings) { |
| 1165 | try { |
no test coverage detected