MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / getLevelingConfig

Function getLevelingConfig

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

Source from the content-addressed store, hash-verified

730}
731
732export async function getLevelingConfig(client, guildId) {
733 const key = getLevelingKey(guildId);
734 try {
735 const config = await getFromDb(key, {
736 enabled: false,
737 xpPerMessage: 10,
738 xpPerMinute: 60,
739 cooldownEnabled: true,
740 messageLengthMultiplier: true,
741 levelUpMessages: true,
742 levelUpChannel: null,
743 roles: {},
744 milestones: {}
745 });
746
747 return config;
748 } catch (error) {
749 logger.error('Error getting leveling config:', error);
750 return {
751 enabled: false,
752 xpPerMessage: 10,
753 xpPerMinute: 60,
754 cooldownEnabled: true,
755 messageLengthMultiplier: true,
756 levelUpMessages: true,
757 levelUpChannel: null,
758 roles: {},
759 milestones: {}
760 };
761 }
762}
763
764export async function saveLevelingConfig(client, guildId, config) {
765 const key = getLevelingKey(guildId);

Callers 8

executeFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
handleLevelingFunction · 0.90

Calls 2

getLevelingKeyFunction · 0.85
getFromDbFunction · 0.85

Tested by

no test coverage detected