mrmBot-Matrix/utils/collections.js

33 lines
770 B
JavaScript
Raw Normal View History

export const commands = new Map();
export const paths = new Map();
export const aliases = new Map();
export const info = new Map();
export const sounds = new Map();
export const categories = new Map();
class TimedMap extends Map {
set(key, value) {
super.set(key, value);
setTimeout(() => {
if (super.has(key)) super.delete(key);
}, 5000);
}
}
export const runningCommands = new TimedMap();
2021-08-09 13:33:16 +00:00
/*class Cache extends Map {
constructor(values) {
super(values);
this.maxValues = 2048;
}
set(key, value) {
super.set(key, value);
if (this.size > this.maxValues) this.delete(this.keys().next().value);
}
2021-08-09 13:33:16 +00:00
}*/
export const prefixCache = new Map();
export const disabledCache = new Map();
export const disabledCmdCache = new Map();