galactic-bot/structure/extensions/User.js

27 lines
531 B
JavaScript
Raw Normal View History

2020-04-08 18:08:46 +02:00
const { Structures } = require('discord.js');
const User = Structures.extend('User', (User) => {
class ExtendedUser extends User {
constructor(...args) {
super(...args);
2020-04-08 18:08:46 +02:00
this._settings = null; //internal cache of current users' settings; should ALWAYS stay the same as database.
this._cached = Date.now();
2020-04-08 18:08:46 +02:00
}
get timeSinceCached() {
return Date.now()-this._cached;
}
2020-04-08 18:08:46 +02:00
}
return ExtendedUser;
});
module.exports = User;