diff options
Diffstat (limited to 'src/models/Role.ts')
-rw-r--r-- | src/models/Role.ts | 20 |
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"); |