Sets a maximum age (minimum one day) for script storage values, after which they are deleted
สคริปต์นี้ไม่ควรถูกติดตั้งโดยตรง มันเป็นคลังสำหรับสคริปต์อื่น ๆ เพื่อบรรจุด้วยคำสั่งเมทา // @require https://update.greasyfork.org/scripts/562172/1732034/Temporary-Script-Storage.js
ตัวอย่างการใช้งาน:
const persistentStorage = new TTLStorage();
await persistentStorage.ready();
setInterval(() => persistentStorage.sweepExpiredEntries(), 1000 * 60 * 60 * 24);
persistentStorage.set("key1", "hello");
const msg = persistentStorage.get("key1");