summary refs log tree commit diff
path: root/src/models/Role.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-14 15:01:27 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-14 15:01:27 +0200
commit9c62b43664f9808497cdaf5142ef071c4e01275d (patch)
treea2a8b0b0b72d2182229e332b158fd9310a1cb809 /src/models/Role.ts
parent:zap: export regex (diff)
parent:bug: fix Activity model (diff)
downloadserver-9c62b43664f9808497cdaf5142ef071c4e01275d.tar.xz
Merge branch 'main' of https://github.com/discord-open-source/discord-server-util into main
Diffstat (limited to 'src/models/Role.ts')
-rw-r--r--src/models/Role.ts19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/models/Role.ts b/src/models/Role.ts

index fe716593..c1111c84 100644 --- a/src/models/Role.ts +++ b/src/models/Role.ts
@@ -1,9 +1,10 @@ import { Schema, model, Types, Document } from "mongoose"; import db from "../util/Database"; +import toBigInt from "../util/toBigInt"; export interface Role { - id: bigint; - guild_id: bigint; + id: string; + guild_id: string; color: number; hoist: boolean; managed: boolean; @@ -12,28 +13,30 @@ export interface Role { permissions: bigint; position: number; tags?: { - bot_id?: bigint; + bot_id?: string; }; } export interface RoleDocument extends Document, Role { - id: bigint; + id: string; } export const RoleSchema = new Schema({ - id: Types.Long, - guild_id: Types.Long, + id: String, + guild_id: String, color: Number, hoist: Boolean, managed: Boolean, mentionable: Boolean, name: String, - permissions: Types.Long, + permissions: { type: String, get: toBigInt }, position: Number, tags: { - bot_id: Types.Long, + bot_id: String, }, }); +RoleSchema.set("removeResponse", ["guild_id"]); + // @ts-ignore export const RoleModel = db.model<RoleDocument>("Role", RoleSchema, "roles");