fixed settings commands, todo's
diff --git a/src/utils/database.ts b/src/utils/database.ts
index 7deb3c1..6eb735e 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -168,7 +168,7 @@
}
async write(hash: string, data: boolean, tags?: string[]) {
- await this.scanCache.insertOne({ hash: hash, data: data, tags: tags ?? [], addedAt: new Date() }); // TODO: cleanup function maybe
+ await this.scanCache.insertOne({ hash: hash, data: data, tags: tags ?? [], addedAt: new Date() });
}
async cleanup() {
diff --git a/src/utils/listToAndMore.ts b/src/utils/listToAndMore.ts
new file mode 100644
index 0000000..791ce40
--- /dev/null
+++ b/src/utils/listToAndMore.ts
@@ -0,0 +1,7 @@
+export default (list: string[], max: number) => {
+ // PineappleFan, Coded, Mini (and 10 more)
+ if(list.length > max) {
+ return list.slice(0, max).join(", ") + ` (and ${list.length - max} more)`;
+ }
+ return list.join(", ");
+}
\ No newline at end of file