get specific ban

This commit is contained in:
Flam3rboy 2021-02-23 22:44:12 +01:00
parent 72204ed419
commit 47ad1c2713
2 changed files with 13 additions and 0 deletions

View File

@ -20,6 +20,15 @@ router.get("/", async (req: Request, res: Response) => {
return res.json(bans);
});
router.get("/:user", async (req: Request, res: Response) => {
const guild_id = BigInt(req.params.id);
const user_id = BigInt(req.params.ban);
var ban = await BanModel.findOne({ guild_id: guild_id, user_id: user_id }).exec();
if (!ban) throw new HTTPError("Ban not found", 404);
return res.json(ban);
});
router.post("/:userid", check(BanCreateSchema), async (req: Request, res: Response) => {
const guild_id = BigInt(req.params.id);
const banned_user_id = BigInt(req.params.userid);

View File

@ -49,4 +49,8 @@ router.get("/:member", async (req: Request, res: Response) => {
return res.json(member);
});
router.put("/:member", async (req: Request, res: Response) => {
// https://discord.com/developers/docs/resources/guild#add-guild-member
});
export default router;