refactor: require target for message actions

This commit is contained in:
Peter Steinberger
2026-01-17 04:06:14 +00:00
parent 87cecd0268
commit 6e4d86f426
38 changed files with 517 additions and 184 deletions

View File

@@ -39,6 +39,12 @@ export class DirectoryCache<T> {
this.cache.set(key, { value, fetchedAt: Date.now() });
}
clearMatching(match: (key: string) => boolean): void {
for (const key of this.cache.keys()) {
if (match(key)) this.cache.delete(key);
}
}
clear(cfg?: ClawdbotConfig): void {
this.cache.clear();
if (cfg) this.lastConfigRef = cfg;