bibliogram/src/lib/structures/User.js

23 lines
586 B
JavaScript
Raw Normal View History

2020-01-14 14:38:33 +00:00
const constants = require("../constants")
2020-01-12 12:50:21 +00:00
const Timeline = require("./Timeline")
const BaseUser = require("./BaseUser")
require("../testimports")(constants, Timeline, BaseUser)
2020-01-12 12:50:21 +00:00
class User extends BaseUser {
2020-01-12 12:50:21 +00:00
/**
* @param {import("../types").GraphUser} data
*/
constructor(data) {
super()
2020-01-12 12:50:21 +00:00
this.data = data
this.following = data.edge_follow.count
this.followedBy = data.edge_followed_by.count
this.posts = data.edge_owner_to_timeline_media.count
this.timeline = new Timeline(this)
2020-01-14 14:38:33 +00:00
this.cachedAt = Date.now()
2020-04-04 14:57:31 +00:00
this.computeProxyProfilePic()
}
2020-01-12 12:50:21 +00:00
}
module.exports = User