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

Function getJoinToCreateConfig

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

Source from the content-addressed store, hash-verified

1359}
1360
1361export async function getJoinToCreateConfig(client, guildId) {
1362 if (!client.db) {
1363 logger.warn('Database not available for getJoinToCreateConfig');
1364 return {
1365 enabled: false,
1366 triggerChannels: [],
1367 categoryId: null,
1368 channelNameTemplate: "{username}'s Room",
1369 userLimit: 0,
1370 bitrate: 64000,
1371 temporaryChannels: {}
1372 };
1373 }
1374
1375 const key = getJoinToCreateConfigKey(guildId);
1376 try {
1377 const config = await client.db.get(key, {});
1378 const unwrapped = unwrapReplitData(config);
1379
1380 return {
1381 enabled: unwrapped.enabled || false,
1382 triggerChannels: unwrapped.triggerChannels || [],
1383 categoryId: unwrapped.categoryId || null,
1384 channelNameTemplate: unwrapped.channelNameTemplate || "{username}'s Room",
1385 userLimit: unwrapped.userLimit || 0,
1386 bitrate: unwrapped.bitrate || 64000,
1387 temporaryChannels: unwrapped.temporaryChannels || {},
1388 ...unwrapped
1389 };
1390 } catch (error) {
1391 logger.error(`Error getting Join to Create config for guild ${guildId}:`, error);
1392 return {
1393 enabled: false,
1394 triggerChannels: [],
1395 categoryId: null,
1396 channelNameTemplate: "{username}'s Room",
1397 userLimit: 0,
1398 bitrate: 64000,
1399 temporaryChannels: {}
1400 };
1401 }
1402}
1403
1404export async function saveJoinToCreateConfig(client, guildId, config) {
1405 const key = getJoinToCreateConfigKey(guildId);

Callers 15

executeFunction · 0.90
initializeJoinToCreateFunction · 0.90
updateChannelConfigFunction · 0.90
removeTriggerChannelFunction · 0.90
getConfigurationFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
transferChannelOwnershipFunction · 0.90
saveJoinToCreateConfigFunction · 0.85
updateJoinToCreateConfigFunction · 0.85
addJoinToCreateTriggerFunction · 0.85

Calls 3

getJoinToCreateConfigKeyFunction · 0.85
unwrapReplitDataFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected