Change KeyValue time
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user