mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-16 10:19:10 +00:00
chore: remove semi
This commit is contained in:
parent
4b75eaa0ab
commit
8fcc0dcbf9
64 changed files with 1073 additions and 1073 deletions
|
@ -1,13 +1,13 @@
|
|||
const Service = require('./Service');
|
||||
const LRU = require('lru-cache');
|
||||
const Service = require('./Service')
|
||||
const LRU = require('lru-cache')
|
||||
|
||||
class PresentationService extends Service {
|
||||
constructor(ctx) {
|
||||
super(ctx);
|
||||
this.M = ctx.M;
|
||||
this.discord = ctx.discord;
|
||||
super(ctx)
|
||||
this.M = ctx.M
|
||||
this.discord = ctx.discord
|
||||
|
||||
this.cache = new LRU({ max: 500, maxAge: 100 * 60 * 5 });
|
||||
this.cache = new LRU({ max: 500, maxAge: 100 * 60 * 5 })
|
||||
}
|
||||
|
||||
serverSlug(server) {
|
||||
|
@ -16,31 +16,31 @@ class PresentationService extends Service {
|
|||
name: server.name,
|
||||
ownerID: server.ownerID,
|
||||
icon: server.icon,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
async oldPresentableServers(collection, userId) {
|
||||
let servers = [];
|
||||
let servers = []
|
||||
|
||||
for (let server of collection.array()) {
|
||||
const gm = server.members.get(userId);
|
||||
const gm = server.members.get(userId)
|
||||
|
||||
servers.push(await this.presentableServer(server, gm));
|
||||
servers.push(await this.presentableServer(server, gm))
|
||||
}
|
||||
|
||||
return servers;
|
||||
return servers
|
||||
}
|
||||
|
||||
async presentableServers(collection, userId) {
|
||||
return collection.array().areduce(async (acc, server) => {
|
||||
const gm = server.members.get(userId);
|
||||
acc.push(await this.presentableServer(server, gm, { incRoles: false }));
|
||||
return acc;
|
||||
});
|
||||
const gm = server.members.get(userId)
|
||||
acc.push(await this.presentableServer(server, gm, { incRoles: false }))
|
||||
return acc
|
||||
})
|
||||
}
|
||||
|
||||
async presentableServer(server, gm, { incRoles = true } = {}) {
|
||||
const sd = await this.ctx.server.get(server.id);
|
||||
const sd = await this.ctx.server.get(server.id)
|
||||
|
||||
return {
|
||||
id: server.id,
|
||||
|
@ -58,7 +58,7 @@ class PresentationService extends Service {
|
|||
message: sd.message,
|
||||
categories: sd.categories,
|
||||
perms: this.discord.getPermissions(gm),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
async rolesByServer(server) {
|
||||
|
@ -70,8 +70,8 @@ class PresentationService extends Service {
|
|||
name: r.name,
|
||||
position: r.position,
|
||||
safe: this.discord.safeRole(server.id, r.id),
|
||||
}));
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = PresentationService;
|
||||
module.exports = PresentationService
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue