(key, value, ttl = null)
| 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); |
no test coverage detected