MCPcopy
hub / github.com/codebymitch/TitanBot / getApplicationSettings

Function getApplicationSettings

src/utils/database.js:945–1022  ·  view source on GitHub ↗
(client, guildId)

Source from the content-addressed store, hash-verified

943}
944
945export 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: [],
982minAccountAge: 0,
983 maxApplications: 1,
984cooldown: 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?"

Callers 10

handleSetupFunction · 0.90
apply.jsFile · 0.90
handleApplicationModalFunction · 0.90
executeFunction · 0.90
setupCollectorsFunction · 0.90
submitApplicationMethod · 0.90
updateSettingsMethod · 0.90
saveApplicationSettingsFunction · 0.85

Calls 3

unwrapReplitDataFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected