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-02-13 09:30:21 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-13 09:30:21 +0100
commit8595646b72d42953814ffa2493630d15cfeeb857 (patch)
tree4cf5222fcab42d47f9642093ccffe289084daf19 /src/models/Role.ts
parentmove guild arrays into seperate collections (diff)
downloadserver-8595646b72d42953814ffa2493630d15cfeeb857.tar.xz
:sparkles: mongoose Schemas
Diffstat (limited to 'src/models/Role.ts')
-rw-r--r--src/models/Role.ts20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/models/Role.ts b/src/models/Role.ts

index e0f2f863..d35bd57c 100644 --- a/src/models/Role.ts +++ b/src/models/Role.ts
@@ -1,4 +1,6 @@ -export interface Role { +import { Schema, model, Types, Document } from "mongoose"; + +export interface Role extends Document { id: bigint; color: number; hoist: boolean; @@ -11,3 +13,19 @@ export interface Role { bot_id?: bigint; }; } + +export const RoleSchema = new Schema({ + id: Types.Long, + color: Number, + hoist: Boolean, + managed: Boolean, + mentionable: Boolean, + name: String, + permissions: Types.Long, + position: Number, + tags: { + bot_id: Types.Long, + }, +}); + +export const RoleModel = model<Role>("Role", RoleSchema, "roles");