(client, guildId)
| 943 | } |
| 944 | |
| 945 | export async function getApplicationSettings(client, guildId) { |
| 946 | if (!client.db) { |
| 947 | logger.warn('Database not available for getApplicationSettings'); |
| 948 | return { |
| 949 | enabled: false, |
| 950 | applicationChannelId: null, |
| 951 | logChannelId: null, |
| 952 | questions: [ |
| 953 | "Why do you want to join our staff team?", |
| 954 | "What experience do you have that would make you a good fit?", |
| 955 | "How much time can you dedicate to this role?" |
| 956 | ] |
| 957 | }; |
| 958 | } |
| 959 | |
| 960 | const key = getApplicationSettingsKey(guildId); |
| 961 | try { |
| 962 | const settings = await client.db.get(key, {}); |
| 963 | const unwrapped = unwrapReplitData(settings); |
| 964 | |
| 965 | const defaultSettings = { |
| 966 | enabled: false, |
| 967 | applicationChannelId: null, |
| 968 | logChannelId: null, |
| 969 | questions: [ |
| 970 | "Why do you want to join our staff team?", |
| 971 | "What experience do you have that would make you a good fit?", |
| 972 | "How much time can you dedicate to this role?" |
| 973 | ], |
| 974 | roles: { |
| 975 | admin: null, |
| 976 | reviewer: null, |
| 977 | accepted: null, |
| 978 | denied: null |
| 979 | }, |
| 980 | requiredRoles: [], |
| 981 | deniedRoles: [], |
| 982 | minAccountAge: 0, |
| 983 | maxApplications: 1, |
| 984 | cooldown: 7, |
| 985 | allowMultipleApplications: false, |
| 986 | requireVerification: false, |
| 987 | customWelcomeMessage: "", |
| 988 | pendingApplicationRetentionDays: 30, |
| 989 | reviewedApplicationRetentionDays: 14 |
| 990 | }; |
| 991 | |
| 992 | return { ...defaultSettings, ...unwrapped }; |
| 993 | } catch (error) { |
| 994 | logger.error(`Error getting application settings for guild ${guildId}:`, error); |
| 995 | return { |
| 996 | enabled: false, |
| 997 | applicationChannelId: null, |
| 998 | logChannelId: null, |
| 999 | questions: [ |
| 1000 | "Why do you want to join our staff team?", |
| 1001 | "What experience do you have that would make you a good fit?", |
| 1002 | "How much time can you dedicate to this role?" |
no test coverage detected