summary refs log tree commit diff
path: root/src/models/Emoji.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/Emoji.ts
parentmove guild arrays into seperate collections (diff)
downloadserver-8595646b72d42953814ffa2493630d15cfeeb857.tar.xz
:sparkles: mongoose Schemas
Diffstat (limited to 'src/models/Emoji.ts')
-rw-r--r--src/models/Emoji.ts25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/models/Emoji.ts b/src/models/Emoji.ts

index 1facc252..bbed9323 100644 --- a/src/models/Emoji.ts +++ b/src/models/Emoji.ts
@@ -1,12 +1,27 @@ -export interface Emoji { - allNamesString: string; // e.g. :thonk: +import { Schema, model, Types, Document } from "mongoose"; + +export interface Emoji extends Document { + id: bigint; animated: boolean; available: boolean; - guildId: bigint; - id: bigint; + guild_id: bigint; managed: boolean; name: string; require_colons: boolean; url: string; - roles: []; + roles: bigint[]; // roles this emoji is whitelisted to } + +export const EmojiSchema = new Schema({ + id: Types.Long, + animated: Boolean, + available: Boolean, + guild_id: Types.Long, + managed: Boolean, + name: String, + require_colons: Boolean, + url: String, + roles: [Types.Long], +}); + +export const EmojiModel = model<Emoji>("Emoji", EmojiSchema, "emojis");