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

Method set

src/utils/database.js:63–77  ·  view source on GitHub ↗
(key, value, ttl = null)

Source from the content-addressed store, hash-verified

61 }
62
63 async set(key, value, ttl = null) {
64 if (this.useFallback) {
65 logger.debug(`[DEGRADED] Writing to memory: ${key}`);
66 }
67
68 if (typeof key === 'string' && /^guild:[^:]+:config$/.test(key)) {
69 const guildId = key.split(':')[1];
70 validateGuildConfigOrThrow(value, {
71 guildId,
72 errorCode: 'VALIDATION_FAILED'
73 });
74 }
75
76 return this.db.set(key, value, ttl);
77 }
78
79 async get(key, defaultValue = null) {
80 return this.db.get(key, defaultValue);

Callers 15

startWebServerMethod · 0.45
recordBlockedAttemptFunction · 0.45
incrementMethod · 0.45
decrementMethod · 0.45
setInDbFunction · 0.45
setGuildConfigFunction · 0.45
setBirthdayFunction · 0.45
deleteBirthdayFunction · 0.45
saveTicketDataFunction · 0.45
incrementTicketCounterFunction · 0.45
saveWelcomeConfigFunction · 0.45
saveApplicationRolesFunction · 0.45

Calls 1

Tested by

no test coverage detected