replapi-it
Version:
An all-in-one API for replit.com
48 lines (46 loc) • 1.41 kB
JavaScript
const Collection = require('../structures/collection');
const Notification = require('../structures/notification');
class NotificationManager{
constructor(client) {
this.
this.cache = new Collection();
this.
return await this.
}, 60000)
this.
let c = await notifications;
c.forEach(notification => {
this.
})
if (c.size) {
await this.markAsRead();
}
})
}
async fetch(options = {}) {
options = {cache: true, seen: false, limit: 10, ...options};
let res = await this.
let notifications = res.notifications.items;
let c = new Collection();
for (let n of notifications) {
let notification = new Notification(this.
await notification.update(n);
if (options.cache) this.cache.set(notification.id, notification);
c.set(notification.id, notification);
}
return c;
}
async markAsRead() {
await this.
this.
}
startEvents() {
this.
}
stopEvents() {
this.
}
}
module.exports = NotificationManager;