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

Function setGuildConfig

src/utils/database.js:270–291  ·  view source on GitHub ↗
(client, guildId, config, context = {})

Source from the content-addressed store, hash-verified

268}
269
270export async function setGuildConfig(client, guildId, config, context = {}) {
271 try {
272 if (!client.db || typeof client.db.set !== "function") {
273 logger.error("Database client is not available for setGuildConfig");
274 return false;
275 }
276
277 const key = getGuildConfigKey(guildId);
278 const validated = validateGuildConfigOrThrow(config, { guildId, ...context });
279 await client.db.set(key, validated);
280 return true;
281 } catch (error) {
282 logger.error(`Error saving config for guild ${guildId}`, {
283 error,
284 traceId: context.traceId,
285 guildId,
286 userId: context.userId,
287 command: context.command
288 });
289 return false;
290 }
291}
292
293export { DatabaseWrapper, pgDb };
294

Callers 15

executeFunction · 0.90
executeFunction · 0.90
handleSetupFunction · 0.90
handleSetupFunction · 0.90
executeFunction · 0.90
handleChannelFunction · 0.90
handleRoleFunction · 0.90
handleMessageFunction · 0.90
handleButtonTextFunction · 0.90
executeFunction · 0.90
handleCriteriaFunction · 0.90
handleRoleFunction · 0.90

Calls 3

getGuildConfigKeyFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected