diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-10 12:50:45 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-10 12:50:45 +0200 |
commit | bffe2a85bdd3fb628c8cfe653a785d44a31c80a6 (patch) | |
tree | 97d8466e7bd05708255ff24ee340f30668a9c849 /api/src/routes/guilds | |
parent | Merge branch 'fosscord:master' into milestoneV1/routes/implement/emojis (diff) | |
parent | :see_no_evil: remove console.log (diff) | |
download | server-bffe2a85bdd3fb628c8cfe653a785d44a31c80a6.tar.xz |
Merge branch 'master' into pr/LoboMetalurgico/424
Diffstat (limited to 'api/src/routes/guilds')
-rw-r--r-- | api/src/routes/guilds/#guild_id/roles.ts | 9 | ||||
-rw-r--r-- | api/src/routes/guilds/templates/index.ts | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/api/src/routes/guilds/#guild_id/roles.ts b/api/src/routes/guilds/#guild_id/roles.ts index d1d60906..0a57c6a2 100644 --- a/api/src/routes/guilds/#guild_id/roles.ts +++ b/api/src/routes/guilds/#guild_id/roles.ts @@ -57,7 +57,7 @@ router.post("/", route({ body: "RoleModifySchema", permission: "MANAGE_ROLES" }) ...body, guild_id: guild_id, managed: false, - permissions: String(req.permission!.bitfield & (body.permissions || 0n)), + permissions: String(req.permission!.bitfield & (body.permissions || BigInt("0"))), tags: undefined }); @@ -105,7 +105,12 @@ router.patch("/:role_id", route({ body: "RoleModifySchema", permission: "MANAGE_ const { role_id, guild_id } = req.params; const body = req.body as RoleModifySchema; - const role = new Role({ ...body, id: role_id, guild_id, permissions: String(req.permission!.bitfield & (body.permissions || 0n)) }); + const role = new Role({ + ...body, + id: role_id, + guild_id, + permissions: String(req.permission!.bitfield & (body.permissions || BigInt("0"))) + }); await Promise.all([ role.save(), diff --git a/api/src/routes/guilds/templates/index.ts b/api/src/routes/guilds/templates/index.ts index b5e243e9..86316d23 100644 --- a/api/src/routes/guilds/templates/index.ts +++ b/api/src/routes/guilds/templates/index.ts @@ -47,7 +47,7 @@ router.post("/:code", route({ body: "GuildTemplateCreateSchema" }), async (req: managed: true, mentionable: true, name: "@everyone", - permissions: 2251804225n, + permissions: BigInt("2251804225"), position: 0, tags: null }).save() |