diff options
author | Erkin Alp Güney <erkinalp9035@gmail.com> | 2022-04-28 21:51:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-28 21:51:35 +0300 |
commit | f033d1fb2b4c4d38662f7ff71affce911afc8289 (patch) | |
tree | a5f7ac8e4e910841caa8556cf1b585b3d0ac218f | |
parent | needs to be async (diff) | |
download | server-f033d1fb2b4c4d38662f7ff71affce911afc8289.tar.xz |
Update prune.ts
-rw-r--r-- | api/src/routes/guilds/#guild_id/prune.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/api/src/routes/guilds/#guild_id/prune.ts b/api/src/routes/guilds/#guild_id/prune.ts index 0dd4d610..0e587d22 100644 --- a/api/src/routes/guilds/#guild_id/prune.ts +++ b/api/src/routes/guilds/#guild_id/prune.ts @@ -11,6 +11,10 @@ export const inactiveMembers = async (guild_id: string, user_id: string, days: n //Snowflake should have `generateFromTime` method? Or similar? var minId = BigInt(date.valueOf() - Snowflake.EPOCH) << BigInt(22); + /** + idea: ability to customise the cutoff variable + possible candidates: public read receipt, last presence, last VC leave + **/ var members = await Member.find({ where: [ { @@ -47,7 +51,7 @@ export const inactiveMembers = async (guild_id: string, user_id: string, days: n return members; }; -router.get("/", route({ permission: "KICK_MEMBERS" }), async (req: Request, res: Response) => { +router.get("/", route({}), async (req: Request, res: Response) => { const days = parseInt(req.query.days as string); var roles = req.query.include_roles; @@ -65,7 +69,7 @@ export interface PruneSchema { days: number; } -router.post("/", route({ permission: "KICK_MEMBERS" }), async (req: Request, res: Response) => { +router.post("/", route({ permission: "KICK_MEMBERS", right: "KICK_BAN_MEMBERS" }), async (req: Request, res: Response) => { const days = parseInt(req.body.days); var roles = req.query.include_roles; |