Change KeyValue time

This commit is contained in:
Frostbide
2025-06-25 11:43:53 -07:00
parent 7e8ae0a04e
commit 77c5fc4e95
2 changed files with 12 additions and 9 deletions

View File

@@ -1,14 +1,13 @@
function main(context) {
const { bot } = context;
bot.KeyValue = class {
constructor(time) {
this.time = time;
constructor() {
this.map = new Map();
}
store(key, value) {
store(key, value, time) {
this.map.set(key, value);
setTimeout(() => this.map.delete(key), this.time);
setTimeout(() => this.map.delete(key), time);
}
get(key) {