From f22b6d3f0b530058b538c33670a5600e5d3b4abd Mon Sep 17 00:00:00 2001
From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com>
Date: Sat, 27 Mar 2021 21:25:49 +0100
Subject: :art: update Message timestamp to use Date
---
src/models/Message.ts | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
(limited to 'src/models/Message.ts')
diff --git a/src/models/Message.ts b/src/models/Message.ts
index 88291f9f..81f617d3 100644
--- a/src/models/Message.ts
+++ b/src/models/Message.ts
@@ -12,8 +12,8 @@ export interface Message {
webhook_id?: bigint;
application_id: bigint;
content: string;
- timestamp: number;
- edited_timestamp: number;
+ timestamp: Date;
+ edited_timestamp: Date;
tts: boolean;
mention_everyone: boolean;
mention_user_ids: bigint[];
@@ -77,7 +77,7 @@ export interface Embed {
type?: string; // type of embed (always "rich" for webhook embeds)
description?: string; // description of embed
url?: string; // url of embed
- timestamp?: number; // timestamp of embed content
+ timestamp?: Date; // timestamp of embed content
color?: number; // color code of the embed
footer?: {
text: string;
@@ -161,7 +161,7 @@ export const Embed = {
type: String, // type of embed (always "rich" for webhook embeds)
description: String, // description of embed
url: String, // url of embed
- timestamp: Number, // timestamp of embed content
+ timestamp: Date, // timestamp of embed content
color: Number, // color code of the embed
footer: {
text: String,
@@ -198,8 +198,8 @@ export const MessageSchema = new Schema({
guild_id: Types.Long,
application_id: Types.Long,
content: String,
- timestamp: Number,
- edited_timestamp: Number,
+ timestamp: Date,
+ edited_timestamp: Date,
tts: Boolean,
mention_everyone: Boolean,
mention_user_ids: [Types.Long],
--
cgit 1.5.1
From 9d06aa09bf8e1b44766d502a5549ac49fcb79e4c Mon Sep 17 00:00:00 2001
From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com>
Date: Sat, 27 Mar 2021 21:51:45 +0100
Subject: :art: Message
---
dist/models/Message.d.ts | 14 +++++++-------
src/models/Message.ts | 14 +++++++-------
2 files changed, 14 insertions(+), 14 deletions(-)
(limited to 'src/models/Message.ts')
diff --git a/dist/models/Message.d.ts b/dist/models/Message.d.ts
index cd0fc7a0..a823ce5e 100644
--- a/dist/models/Message.d.ts
+++ b/dist/models/Message.d.ts
@@ -6,20 +6,20 @@ export interface Message {
guild_id?: bigint;
author_id?: bigint;
webhook_id?: bigint;
- application_id: bigint;
- content: string;
+ application_id?: bigint;
+ content?: string;
timestamp: Date;
- edited_timestamp: Date;
- tts: boolean;
- mention_everyone: boolean;
+ edited_timestamp?: Date;
+ tts?: boolean;
+ mention_everyone?: boolean;
mention_user_ids: bigint[];
mention_role_ids: bigint[];
mention_channels_ids: bigint[];
attachments: Attachment[];
embeds: Embed[];
- reactions?: Reaction[];
+ reactions: Reaction[];
nonce?: string | number;
- pinned: boolean;
+ pinned?: boolean;
type: MessageType;
activity?: {
type: number;
diff --git a/src/models/Message.ts b/src/models/Message.ts
index 81f617d3..e80ec1f8 100644
--- a/src/models/Message.ts
+++ b/src/models/Message.ts
@@ -10,20 +10,20 @@ export interface Message {
guild_id?: bigint;
author_id?: bigint;
webhook_id?: bigint;
- application_id: bigint;
- content: string;
+ application_id?: bigint;
+ content?: string;
timestamp: Date;
- edited_timestamp: Date;
- tts: boolean;
- mention_everyone: boolean;
+ edited_timestamp?: Date;
+ tts?: boolean;
+ mention_everyone?: boolean;
mention_user_ids: bigint[];
mention_role_ids: bigint[];
mention_channels_ids: bigint[];
attachments: Attachment[];
embeds: Embed[];
- reactions?: Reaction[];
+ reactions: Reaction[];
nonce?: string | number;
- pinned: boolean;
+ pinned?: boolean;
type: MessageType;
activity?: {
type: number;
--
cgit 1.5.1
From 7685e19835afdf0b403a676c16ada663ddcbc29d Mon Sep 17 00:00:00 2001
From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com>
Date: Tue, 6 Apr 2021 18:01:49 +0200
Subject: :art: Convert id bigint to string
---
dist/models/Activity.d.ts | 10 ++--
dist/models/Activity.js | 4 +-
dist/models/Activity.js.map | 2 +-
dist/models/Application.d.ts | 6 +--
dist/models/AuditLog.d.ts | 56 ++++++++++----------
dist/models/AuditLog.js | 32 ++++++------
dist/models/AuditLog.js.map | 2 +-
dist/models/Ban.d.ts | 6 +--
dist/models/Ban.js | 6 +--
dist/models/Ban.js.map | 2 +-
dist/models/Channel.d.ts | 16 +++---
dist/models/Channel.js | 14 ++---
dist/models/Channel.js.map | 2 +-
dist/models/Emoji.d.ts | 6 +--
dist/models/Emoji.js | 6 +--
dist/models/Emoji.js.map | 2 +-
dist/models/Event.d.ts | 110 +++++++++++++++++++--------------------
dist/models/Event.js | 6 +--
dist/models/Event.js.map | 2 +-
dist/models/Guild.d.ts | 18 +++----
dist/models/Guild.js | 16 +++---
dist/models/Guild.js.map | 2 +-
dist/models/Interaction.d.ts | 8 +--
dist/models/Invite.d.ts | 8 +--
dist/models/Invite.js | 10 ++--
dist/models/Invite.js.map | 2 +-
dist/models/Member.d.ts | 10 ++--
dist/models/Member.js | 8 +--
dist/models/Member.js.map | 2 +-
dist/models/Message.d.ts | 38 +++++++-------
dist/models/Message.js | 28 +++++-----
dist/models/Message.js.map | 2 +-
dist/models/Role.d.ts | 8 +--
dist/models/Role.js | 6 +--
dist/models/Role.js.map | 2 +-
dist/models/User.d.ts | 20 ++++----
dist/models/User.js | 16 +++---
dist/models/User.js.map | 2 +-
dist/models/VoiceState.d.ts | 6 +--
dist/models/VoiceState.js | 6 +--
dist/models/VoiceState.js.map | 2 +-
dist/util/Permissions.d.ts | 6 +--
src/models/Activity.ts | 10 ++--
src/models/Application.ts | 6 +--
src/models/AuditLog.ts | 66 ++++++++++++------------
src/models/Ban.ts | 12 ++---
src/models/Channel.ts | 34 ++++++-------
src/models/Emoji.ts | 12 ++---
src/models/Event.ts | 116 +++++++++++++++++++++---------------------
src/models/Guild.ts | 34 ++++++-------
src/models/Interaction.ts | 8 +--
src/models/Invite.ts | 22 ++++----
src/models/Member.ts | 18 +++----
src/models/Message.ts | 62 +++++++++++-----------
src/models/Role.ts | 14 ++---
src/models/User.ts | 36 ++++++-------
src/models/VoiceState.ts | 12 ++---
src/util/Permissions.ts | 8 +--
src/util/Snowflake.ts | 2 +-
59 files changed, 493 insertions(+), 495 deletions(-)
(limited to 'src/models/Message.ts')
diff --git a/dist/models/Activity.d.ts b/dist/models/Activity.d.ts
index dfa0815e..57462d60 100644
--- a/dist/models/Activity.d.ts
+++ b/dist/models/Activity.d.ts
@@ -3,7 +3,7 @@ import { ClientStatus, Status } from "./Status";
import { Types } from "mongoose";
export interface Presence {
user: User;
- guild_id?: bigint;
+ guild_id?: string;
status: Status;
activities: Activity[];
client_status: ClientStatus;
@@ -17,12 +17,12 @@ export interface Activity {
start?: number;
end?: number;
}[];
- application_id?: bigint;
+ application_id?: string;
details?: string;
state?: string;
emoji?: {
name: string;
- id?: bigint;
+ id?: string;
amimated?: boolean;
};
party?: {
@@ -52,12 +52,12 @@ export declare const Activity: {
$start: NumberConstructor;
$end: NumberConstructor;
}[];
- $application_id: typeof Types.Long;
+ $application_id: StringConstructor;
$details: StringConstructor;
$state: StringConstructor;
$emoji: {
$name: StringConstructor;
- $id: typeof Types.Long;
+ $id: StringConstructor;
$amimated: BooleanConstructor;
};
$party: {
diff --git a/dist/models/Activity.js b/dist/models/Activity.js
index 020856db..d9a19ead 100644
--- a/dist/models/Activity.js
+++ b/dist/models/Activity.js
@@ -13,12 +13,12 @@ exports.Activity = {
$end: Number,
},
],
- $application_id: mongoose_1.Types.Long,
+ $application_id: String,
$details: String,
$state: String,
$emoji: {
$name: String,
- $id: mongoose_1.Types.Long,
+ $id: String,
$amimated: Boolean,
},
$party: {
diff --git a/dist/models/Activity.js.map b/dist/models/Activity.js.map
index 786f0184..8ce7d191 100644
--- a/dist/models/Activity.js.map
+++ b/dist/models/Activity.js.map
@@ -1 +1 @@
-{"version":3,"file":"Activity.js","sourceRoot":"","sources":["../../src/models/Activity.ts"],"names":[],"mappings":";;;AAEA,uCAA0D;AA8C7C,QAAA,QAAQ,GAAG;IACvB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE;QACZ;YACC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,MAAM;SACZ;KACD;IACD,eAAe,EAAE,gBAAK,CAAC,IAAI;IAC3B,QAAQ,EAAE,MAAM;IAChB,MAAM,EAAE,MAAM;IACd,MAAM,EAAE;QACP,KAAK,EAAE,MAAM;QACb,GAAG,EAAE,gBAAK,CAAC,IAAI;QACf,SAAS,EAAE,OAAO;KAClB;IACD,MAAM,EAAE;QACP,GAAG,EAAE,MAAM;QACX,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;KACvB;IACD,OAAO,EAAE;QACR,YAAY,EAAE,MAAM;QACpB,WAAW,EAAE,MAAM;QACnB,YAAY,EAAE,MAAM;QACpB,WAAW,EAAE,MAAM;KACnB;IACD,QAAQ,EAAE;QACT,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,MAAM;QACjB,MAAM,EAAE,MAAM;KACd;IACD,SAAS,EAAE,OAAO;IAClB,MAAM,EAAE,gBAAK,CAAC,IAAI;CAClB,CAAC;AAEF,IAAY,YAMX;AAND,WAAY,YAAY;IACvB,+CAAQ,CAAA;IACR,yDAAa,CAAA;IACb,yDAAa,CAAA;IACb,mDAAU,CAAA;IACV,yDAAa,CAAA;AACd,CAAC,EANW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAMvB"}
\ No newline at end of file
+{"version":3,"file":"Activity.js","sourceRoot":"","sources":["../../src/models/Activity.ts"],"names":[],"mappings":";;;AAEA,uCAA0D;AA8C7C,QAAA,QAAQ,GAAG;IACvB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE;QACZ;YACC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,MAAM;SACZ;KACD;IACD,eAAe,EAAE,MAAM;IACvB,QAAQ,EAAE,MAAM;IAChB,MAAM,EAAE,MAAM;IACd,MAAM,EAAE;QACP,KAAK,EAAE,MAAM;QACb,GAAG,EAAE,MAAM;QACX,SAAS,EAAE,OAAO;KAClB;IACD,MAAM,EAAE;QACP,GAAG,EAAE,MAAM;QACX,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;KACvB;IACD,OAAO,EAAE;QACR,YAAY,EAAE,MAAM;QACpB,WAAW,EAAE,MAAM;QACnB,YAAY,EAAE,MAAM;QACpB,WAAW,EAAE,MAAM;KACnB;IACD,QAAQ,EAAE;QACT,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,MAAM;QACjB,MAAM,EAAE,MAAM;KACd;IACD,SAAS,EAAE,OAAO;IAClB,MAAM,EAAE,gBAAK,CAAC,IAAI;CAClB,CAAC;AAEF,IAAY,YAMX;AAND,WAAY,YAAY;IACvB,+CAAQ,CAAA;IACR,yDAAa,CAAA;IACb,yDAAa,CAAA;IACb,mDAAU,CAAA;IACV,yDAAa,CAAA;AACd,CAAC,EANW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAMvB"}
\ No newline at end of file
diff --git a/dist/models/Application.d.ts b/dist/models/Application.d.ts
index 53483c49..68e026bb 100644
--- a/dist/models/Application.d.ts
+++ b/dist/models/Application.d.ts
@@ -1,6 +1,6 @@
export interface ApplicationCommand {
- id: bigint;
- application_id: bigint;
+ id: string;
+ application_id: string;
name: string;
description: string;
options?: ApplicationCommandOption[];
@@ -28,7 +28,7 @@ export declare enum ApplicationCommandOptionType {
ROLE = 8
}
export interface ApplicationCommandInteractionData {
- id: bigint;
+ id: string;
name: string;
options?: ApplicationCommandInteractionDataOption[];
}
diff --git a/dist/models/AuditLog.d.ts b/dist/models/AuditLog.d.ts
index 902513a3..76c21807 100644
--- a/dist/models/AuditLog.d.ts
+++ b/dist/models/AuditLog.d.ts
@@ -1,5 +1,5 @@
///
-import { Schema, Document, Types } from "mongoose";
+import { Schema, Document } from "mongoose";
import { ChannelPermissionOverwrite } from "./Channel";
import { PublicUser } from "./User";
export interface AuditLogResponse {
@@ -9,17 +9,17 @@ export interface AuditLogResponse {
integrations: [];
}
export interface AuditLogEntries {
- target_id?: bigint;
- user_id: bigint;
- id: bigint;
+ target_id?: string;
+ user_id: string;
+ id: string;
action_type: AuditLogEvents;
options?: {
delete_member_days?: string;
members_removed?: string;
- channel_id?: bigint;
- messaged_id?: bigint;
+ channel_id?: string;
+ messaged_id?: string;
count?: string;
- id?: bigint;
+ id?: string;
type?: string;
role_name?: string;
};
@@ -38,13 +38,13 @@ export interface AuditLogChangeValue {
splash_hash?: string;
discovery_splash_hash?: string;
banner_hash?: string;
- owner_id?: bigint;
+ owner_id?: string;
region?: string;
preferred_locale?: string;
- afk_channel_id?: bigint;
+ afk_channel_id?: string;
afk_timeout?: number;
- rules_channel_id?: bigint;
- public_updates_channel_id?: bigint;
+ rules_channel_id?: string;
+ public_updates_channel_id?: string;
mfa_level?: number;
verification_level?: number;
explicit_content_filter?: number;
@@ -54,14 +54,14 @@ export interface AuditLogChangeValue {
$remove?: {}[];
prune_delete_days?: number;
widget_enabled?: boolean;
- widget_channel_id?: bigint;
- system_channel_id?: bigint;
+ widget_channel_id?: string;
+ system_channel_id?: string;
position?: number;
topic?: string;
bitrate?: number;
permission_overwrites?: ChannelPermissionOverwrite[];
nsfw?: boolean;
- application_id?: bigint;
+ application_id?: string;
rate_limit_per_user?: number;
permissions?: string;
color?: number;
@@ -70,8 +70,8 @@ export interface AuditLogChangeValue {
allow?: string;
deny?: string;
code?: string;
- channel_id?: bigint;
- inviter_id?: bigint;
+ channel_id?: string;
+ inviter_id?: string;
max_uses?: number;
uses?: number;
max_age?: number;
@@ -80,7 +80,7 @@ export interface AuditLogChangeValue {
mute?: boolean;
nick?: string;
avatar_hash?: string;
- id?: bigint;
+ id?: string;
type?: number;
enable_emoticons?: boolean;
expire_behavior?: number;
@@ -88,7 +88,7 @@ export interface AuditLogChangeValue {
user_limit?: number;
}
export interface AuditLogEntriesDocument extends Document, AuditLogEntries {
- id: bigint;
+ id: string;
}
export declare const AuditLogChanges: {
name: StringConstructor;
@@ -97,13 +97,13 @@ export declare const AuditLogChanges: {
splash_hash: StringConstructor;
discovery_splash_hash: StringConstructor;
banner_hash: StringConstructor;
- owner_id: typeof Types.Long;
+ owner_id: StringConstructor;
region: StringConstructor;
preferred_locale: StringConstructor;
- afk_channel_id: typeof Types.Long;
+ afk_channel_id: StringConstructor;
afk_timeout: NumberConstructor;
- rules_channel_id: typeof Types.Long;
- public_updates_channel_id: typeof Types.Long;
+ rules_channel_id: StringConstructor;
+ public_updates_channel_id: StringConstructor;
mfa_level: NumberConstructor;
verification_level: NumberConstructor;
explicit_content_filter: NumberConstructor;
@@ -113,14 +113,14 @@ export declare const AuditLogChanges: {
$remove: {}[];
prune_delete_days: NumberConstructor;
widget_enabled: BooleanConstructor;
- widget_channel_id: typeof Types.Long;
- system_channel_id: typeof Types.Long;
+ widget_channel_id: StringConstructor;
+ system_channel_id: StringConstructor;
position: NumberConstructor;
topic: StringConstructor;
bitrate: NumberConstructor;
permission_overwrites: {}[];
nsfw: BooleanConstructor;
- application_id: typeof Types.Long;
+ application_id: StringConstructor;
rate_limit_per_user: NumberConstructor;
permissions: StringConstructor;
color: NumberConstructor;
@@ -129,8 +129,8 @@ export declare const AuditLogChanges: {
allow: StringConstructor;
deny: StringConstructor;
code: StringConstructor;
- channel_id: typeof Types.Long;
- inviter_id: typeof Types.Long;
+ channel_id: StringConstructor;
+ inviter_id: StringConstructor;
max_uses: NumberConstructor;
uses: NumberConstructor;
max_age: NumberConstructor;
@@ -139,7 +139,7 @@ export declare const AuditLogChanges: {
mute: BooleanConstructor;
nick: StringConstructor;
avatar_hash: StringConstructor;
- id: typeof Types.Long;
+ id: StringConstructor;
type: NumberConstructor;
enable_emoticons: BooleanConstructor;
expire_behavior: NumberConstructor;
diff --git a/dist/models/AuditLog.js b/dist/models/AuditLog.js
index 53df5c30..2a76e5b7 100644
--- a/dist/models/AuditLog.js
+++ b/dist/models/AuditLog.js
@@ -13,13 +13,13 @@ exports.AuditLogChanges = {
splash_hash: String,
discovery_splash_hash: String,
banner_hash: String,
- owner_id: mongoose_1.Types.Long,
+ owner_id: String,
region: String,
preferred_locale: String,
- afk_channel_id: mongoose_1.Types.Long,
+ afk_channel_id: String,
afk_timeout: Number,
- rules_channel_id: mongoose_1.Types.Long,
- public_updates_channel_id: mongoose_1.Types.Long,
+ rules_channel_id: String,
+ public_updates_channel_id: String,
mfa_level: Number,
verification_level: Number,
explicit_content_filter: Number,
@@ -29,14 +29,14 @@ exports.AuditLogChanges = {
$remove: [{}],
prune_delete_days: Number,
widget_enabled: Boolean,
- widget_channel_id: mongoose_1.Types.Long,
- system_channel_id: mongoose_1.Types.Long,
+ widget_channel_id: String,
+ system_channel_id: String,
position: Number,
topic: String,
bitrate: Number,
permission_overwrites: [{}],
nsfw: Boolean,
- application_id: mongoose_1.Types.Long,
+ application_id: String,
rate_limit_per_user: Number,
permissions: String,
color: Number,
@@ -45,8 +45,8 @@ exports.AuditLogChanges = {
allow: String,
deny: String,
code: String,
- channel_id: mongoose_1.Types.Long,
- inviter_id: mongoose_1.Types.Long,
+ channel_id: String,
+ inviter_id: String,
max_uses: Number,
uses: Number,
max_age: Number,
@@ -55,7 +55,7 @@ exports.AuditLogChanges = {
mute: Boolean,
nick: String,
avatar_hash: String,
- id: mongoose_1.Types.Long,
+ id: String,
type: Number,
enable_emoticons: Boolean,
expire_behavior: Number,
@@ -63,17 +63,17 @@ exports.AuditLogChanges = {
user_limit: Number,
};
exports.AuditLogSchema = new mongoose_1.Schema({
- target_id: mongoose_1.Types.Long,
- user_id: { type: mongoose_1.Types.Long, required: true },
- id: { type: mongoose_1.Types.Long, required: true },
+ target_id: String,
+ user_id: { type: String, required: true },
+ id: { type: String, required: true },
action_type: { type: Number, required: true },
options: {
delete_member_days: String,
members_removed: String,
- channel_id: mongoose_1.Types.Long,
- messaged_id: mongoose_1.Types.Long,
+ channel_id: String,
+ messaged_id: String,
count: String,
- id: mongoose_1.Types.Long,
+ id: String,
type: String,
role_name: String,
},
diff --git a/dist/models/AuditLog.js.map b/dist/models/AuditLog.js.map
index b809fa3d..6529c239 100644
--- a/dist/models/AuditLog.js.map
+++ b/dist/models/AuditLog.js.map
@@ -1 +1 @@
-{"version":3,"file":"AuditLog.js","sourceRoot":"","sources":["../../src/models/AuditLog.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAmD;AACnD,gEAAkC;AAiGrB,QAAA,eAAe,GAAG;IAC9B,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,MAAM;IACnB,SAAS,EAAE,MAAM;IACjB,WAAW,EAAE,MAAM;IACnB,qBAAqB,EAAE,MAAM;IAC7B,WAAW,EAAE,MAAM;IACnB,QAAQ,EAAE,gBAAK,CAAC,IAAI;IACpB,MAAM,EAAE,MAAM;IACd,gBAAgB,EAAE,MAAM;IACxB,cAAc,EAAE,gBAAK,CAAC,IAAI;IAC1B,WAAW,EAAE,MAAM;IACnB,gBAAgB,EAAE,gBAAK,CAAC,IAAI;IAC5B,yBAAyB,EAAE,gBAAK,CAAC,IAAI;IACrC,SAAS,EAAE,MAAM;IACjB,kBAAkB,EAAE,MAAM;IAC1B,uBAAuB,EAAE,MAAM;IAC/B,6BAA6B,EAAE,MAAM;IACrC,eAAe,EAAE,MAAM;IACvB,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,OAAO,EAAE,CAAC,EAAE,CAAC;IACb,iBAAiB,EAAE,MAAM;IACzB,cAAc,EAAE,OAAO;IACvB,iBAAiB,EAAE,gBAAK,CAAC,IAAI;IAC7B,iBAAiB,EAAE,gBAAK,CAAC,IAAI;IAC7B,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,OAAO,EAAE,MAAM;IACf,qBAAqB,EAAE,CAAC,EAAE,CAAC;IAC3B,IAAI,EAAE,OAAO;IACb,cAAc,EAAE,gBAAK,CAAC,IAAI;IAC1B,mBAAmB,EAAE,MAAM;IAC3B,WAAW,EAAE,MA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E,uBAAe;YAC1B,GAAG,EAAE,MAAM;SACX;KACD;IACD,MAAM,EAAE,MAAM;CACd,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,aAAa,GAAG,kBAAE,CAAC,KAAK,CAAkB,UAAU,EAAE,sBAAc,EAAE,WAAW,CAAC,CAAC;AAEhG,IAAY,cAoCX;AApCD,WAAY,cAAc;IACzB,mEAAgB,CAAA;IAChB,wEAAmB,CAAA;IACnB,wEAAmB,CAAA;IACnB,wEAAmB,CAAA;IACnB,4FAA6B,CAAA;IAC7B,4FAA6B,CAAA;IAC7B,4FAA6B,CAAA;IAC7B,kEAAgB,CAAA;IAChB,oEAAiB,CAAA;IACjB,wEAAmB,CAAA;IACnB,8EAAsB,CAAA;IACtB,sEAAkB,CAAA;IAClB,gFAAuB,CAAA;IACvB,kEAAgB,CAAA;IAChB,8EAAsB,CAAA;IACtB,0DAAY,CAAA;IACZ,kEAAgB,CAAA;IAChB,kEAAgB,CAAA;IAChB,kEAAgB,CAAA;IAChB,sEAAkB,CAAA;IAClB,sEAAkB,CAAA;IAClB,sEAAkB,CAAA;IAClB,wEAAmB,CAAA;IACnB,wEAAmB,CAAA;IACnB,wEAAmB,CAAA;IACnB,oEAAiB,CAAA;IACjB,oEAAiB,CAAA;IACjB,oEAAiB,CAAA;IACjB,wEAAmB,CAAA;IACnB,kFAAwB,CAAA;IACxB,kEAAgB,CAAA;IAChB,sEAAkB,CAAA;IAClB,gFAAuB,CAAA;IACvB,gFAAuB,CAAA;IACvB,gFAAuB,CAAA;AACxB,CAAC,EApCW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAoCzB"}
\ No newline at end of file
+{"version":3,"file":"AuditLog.js","sourceRoot":"","sources":["../../src/models/AuditLog.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAmD;AACnD,gEAAkC;AAiGrB,QAAA,eAAe,GAAG;IAC9B,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,MAAM;IACnB,SAAS,EAAE,MAAM;IACjB,W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AChB,kEAAgB,CAAA;IAChB,sEAAkB,CAAA;IAClB,sEAAkB,CAAA;IAClB,sEAAkB,CAAA;IAClB,wEAAmB,CAAA;IACnB,wEAAmB,CAAA;IACnB,wEAAmB,CAAA;IACnB,oEAAiB,CAAA;IACjB,oEAAiB,CAAA;IACjB,oEAAiB,CAAA;IACjB,wEAAmB,CAAA;IACnB,kFAAwB,CAAA;IACxB,kEAAgB,CAAA;IAChB,sEAAkB,CAAA;IAClB,gFAAuB,CAAA;IACvB,gFAAuB,CAAA;IACvB,gFAAuB,CAAA;AACxB,CAAC,EApCW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAoCzB"}
\ No newline at end of file
diff --git a/dist/models/Ban.d.ts b/dist/models/Ban.d.ts
index a4357d5c..ad3a39b7 100644
--- a/dist/models/Ban.d.ts
+++ b/dist/models/Ban.d.ts
@@ -1,9 +1,9 @@
///
import { Schema, Document } from "mongoose";
export interface Ban extends Document {
- user_id: bigint;
- guild_id: bigint;
- executor_id: bigint;
+ user_id: string;
+ guild_id: string;
+ executor_id: string;
ip: string;
reason?: string;
}
diff --git a/dist/models/Ban.js b/dist/models/Ban.js
index abb0a4e2..0b7f30b5 100644
--- a/dist/models/Ban.js
+++ b/dist/models/Ban.js
@@ -7,9 +7,9 @@ exports.BanModel = exports.BanSchema = void 0;
const mongoose_1 = require("mongoose");
const Database_1 = __importDefault(require("../util/Database"));
exports.BanSchema = new mongoose_1.Schema({
- user_id: { type: mongoose_1.Types.Long, required: true },
- guild_id: { type: mongoose_1.Types.Long, required: true },
- executor_id: { type: mongoose_1.Types.Long, required: true },
+ user_id: { type: String, required: true },
+ guild_id: { type: String, required: true },
+ executor_id: { type: String, required: true },
reason: String,
ip: String,
});
diff --git a/dist/models/Ban.js.map b/dist/models/Ban.js.map
index 580002a0..6a10fccb 100644
--- a/dist/models/Ban.js.map
+++ b/dist/models/Ban.js.map
@@ -1 +1 @@
-{"version":3,"file":"Ban.js","sourceRoot":"","sources":["../../src/models/Ban.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA0D;AAC1D,gEAAkC;AAUrB,QAAA,SAAS,GAAG,IAAI,iBAAM,CAAC;IACnC,OAAO,EAAE,EAAE,IAAI,EAAE,gBAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC7C,QAAQ,EAAE,EAAE,IAAI,EAAE,gBAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC9C,WAAW,EAAE,EAAE,IAAI,EAAE,gBAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;IACjD,MAAM,EAAE,MAAM;IACd,EAAE,EAAE,MAAM;CACV,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,QAAQ,GAAG,kBAAE,CAAC,KAAK,CAAM,KAAK,EAAE,iBAAS,EAAE,MAAM,CAAC,CAAC"}
\ No newline at end of file
+{"version":3,"file":"Ban.js","sourceRoot":"","sources":["../../src/models/Ban.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA0D;AAC1D,gEAAkC;AAUrB,QAAA,SAAS,GAAG,IAAI,iBAAM,CAAC;IACnC,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACzC,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC1C,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC7C,MAAM,EAAE,MAAM;IACd,EAAE,EAAE,MAAM;CACV,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,QAAQ,GAAG,kBAAE,CAAC,KAAK,CAAM,KAAK,EAAE,iBAAS,EAAE,MAAM,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/models/Channel.d.ts b/dist/models/Channel.d.ts
index 5cd7b342..d3048622 100644
--- a/dist/models/Channel.d.ts
+++ b/dist/models/Channel.d.ts
@@ -3,30 +3,30 @@ import { Schema, Document } from "mongoose";
export interface AnyChannel extends Channel, DMChannel, TextChannel, VoiceChannel {
}
export interface ChannelDocument extends Document, AnyChannel {
- id: bigint;
+ id: string;
}
export declare const ChannelSchema: Schema, import("mongoose").Model>, undefined>;
export declare const ChannelModel: import("mongoose").Model;
export interface Channel {
- id: bigint;
+ id: string;
created_at: Date;
name: string;
type: number;
}
export interface TextBasedChannel {
- last_message_id?: bigint;
+ last_message_id?: string;
last_pin_timestamp?: number;
}
export interface GuildChannel extends Channel {
- guild_id: bigint;
+ guild_id: string;
position: number;
- parent_id?: bigint;
+ parent_id?: string;
permission_overwrites: ChannelPermissionOverwrite[];
}
export interface ChannelPermissionOverwrite {
allow: bigint;
deny: bigint;
- id: bigint;
+ id: string;
type: ChannelPermissionOverwriteType;
}
export declare enum ChannelPermissionOverwriteType {
@@ -41,8 +41,8 @@ export interface TextChannel extends GuildChannel, TextBasedChannel {
topic?: string;
}
export interface DMChannel extends Channel, TextBasedChannel {
- owner_id: bigint;
- recipients: bigint[];
+ owner_id: string;
+ recipients: string[];
}
export declare enum ChannelType {
GUILD_TEXT = 0,
diff --git a/dist/models/Channel.js b/dist/models/Channel.js
index 0c9a652a..956b1fc5 100644
--- a/dist/models/Channel.js
+++ b/dist/models/Channel.js
@@ -7,16 +7,16 @@ exports.ChannelType = exports.ChannelPermissionOverwriteType = exports.ChannelMo
const mongoose_1 = require("mongoose");
const Database_1 = __importDefault(require("../util/Database"));
exports.ChannelSchema = new mongoose_1.Schema({
- id: mongoose_1.Types.Long,
+ id: String,
created_at: { type: mongoose_1.Schema.Types.Date, required: true },
name: { type: String, required: true },
type: { type: Number, required: true },
- guild_id: mongoose_1.Types.Long,
- owner_id: mongoose_1.Types.Long,
- parent_id: mongoose_1.Types.Long,
- recipients: [mongoose_1.Types.Long],
+ guild_id: String,
+ owner_id: String,
+ parent_id: String,
+ recipients: [String],
position: Number,
- last_message_id: mongoose_1.Types.Long,
+ last_message_id: String,
last_pin_timestamp: Date,
nsfw: Boolean,
rate_limit_per_user: Number,
@@ -25,7 +25,7 @@ exports.ChannelSchema = new mongoose_1.Schema({
{
allow: mongoose_1.Types.Long,
deny: mongoose_1.Types.Long,
- id: mongoose_1.Types.Long,
+ id: String,
type: Number,
},
],
diff --git a/dist/models/Channel.js.map b/dist/models/Channel.js.map
index 845169ac..ff804845 100644
--- a/dist/models/Channel.js.map
+++ b/dist/models/Channel.js.map
@@ -1 +1 @@
-{"version":3,"file":"Channel.js","sourceRoot":"","sources":["../../src/models/Channel.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA0D;AAC1D,gEAAkC;AAQrB,QAAA,aAAa,GAAG,IAAI,iBAAM,CAAC;IACvC,EAAE,EAAE,gBAAK,CAAC,IAAI;IACd,UAAU,EAAE,EAAE,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;IACvD,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACtC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACtC,QAAQ,EAAE,gBAAK,CAAC,IAAI;IACpB,QAAQ,EAAE,gBAAK,CAAC,IAAI;IACpB,SAAS,EAAE,gBAAK,CAAC,IAAI;IACrB,UAAU,EAAE,CAAC,gBAAK,CAAC,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM;IAChB,eAAe,EAAE,gBAAK,CAAC,IAAI;IAC3B,kBAAkB,EAAE,IAAI;IACxB,IAAI,EAAE,OAAO;IACb,mBAAmB,EAAE,MAAM;IAC3B,KAAK,EAAE,MAAM;IACb,qBAAqB,EAAE;QACtB;YACC,KAAK,EAAE,gBAAK,CAAC,IAAI;YACjB,IAAI,EAAE,gBAAK,CAAC,IAAI;YAChB,EAAE,EAAE,gBAAK,CAAC,IAAI;YACd,IAAI,EAAE,MAAM;SACZ;KACD;CACD,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,Y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AAI;YAChB,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,MAAM;SACZ;KACD;CACD,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,YAAY,GAAG,kBAAE,CAAC,KAAK,CAAkB,SAAS,EAAE,qBAAa,EAAE,UAAU,CAAC,CAAC;AA4B5F,IAAY,8BAGX;AAHD,WAAY,8BAA8B;IACzC,mFAAQ,CAAA;IACR,uFAAU,CAAA;AACX,CAAC,EAHW,8BAA8B,GAA9B,sCAA8B,KAA9B,sCAA8B,QAGzC;AAeD,IAAY,WAQX;AARD,WAAY,WAAW;IACtB,yDAAc,CAAA;IACd,yCAAM,CAAA;IACN,2DAAe,CAAA;IACf,qDAAY,CAAA;IACZ,iEAAkB,CAAA;IAClB,yDAAc,CAAA;IACd,2DAAe,CAAA;AAChB,CAAC,EARW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAQtB"}
\ No newline at end of file
diff --git a/dist/models/Emoji.d.ts b/dist/models/Emoji.d.ts
index 91c1abfe..9e53cc72 100644
--- a/dist/models/Emoji.d.ts
+++ b/dist/models/Emoji.d.ts
@@ -1,15 +1,15 @@
///
import { Schema, Document } from "mongoose";
export interface Emoji extends Document {
- id: bigint;
+ id: string;
animated: boolean;
available: boolean;
- guild_id: bigint;
+ guild_id: string;
managed: boolean;
name: string;
require_colons: boolean;
url: string;
- roles: bigint[];
+ roles: string[];
}
export declare const EmojiSchema: Schema, import("mongoose").Model>, undefined>;
export declare const EmojiModel: import("mongoose").Model;
diff --git a/dist/models/Emoji.js b/dist/models/Emoji.js
index 79f2543f..5f9fc56f 100644
--- a/dist/models/Emoji.js
+++ b/dist/models/Emoji.js
@@ -7,15 +7,15 @@ exports.EmojiModel = exports.EmojiSchema = void 0;
const mongoose_1 = require("mongoose");
const Database_1 = __importDefault(require("../util/Database"));
exports.EmojiSchema = new mongoose_1.Schema({
- id: { type: mongoose_1.Types.Long, required: true },
+ id: { type: String, required: true },
animated: Boolean,
available: Boolean,
- guild_id: mongoose_1.Types.Long,
+ guild_id: String,
managed: Boolean,
name: String,
require_colons: Boolean,
url: String,
- roles: [mongoose_1.Types.Long],
+ roles: [String],
});
// @ts-ignore
exports.EmojiModel = Database_1.default.model("Emoji", exports.EmojiSchema, "emojis");
diff --git a/dist/models/Emoji.js.map b/dist/models/Emoji.js.map
index 76e2fd4d..f66fe302 100644
--- a/dist/models/Emoji.js.map
+++ b/dist/models/Emoji.js.map
@@ -1 +1 @@
-{"version":3,"file":"Emoji.js","sourceRoot":"","sources":["../../src/models/Emoji.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA0D;AAC1D,gEAAkC;AAcrB,QAAA,WAAW,GAAG,IAAI,iBAAM,CAAC;IACrC,EAAE,EAAE,EAAE,IAAI,EAAE,gBAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;IACxC,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,OAAO;IAClB,QAAQ,EAAE,gBAAK,CAAC,IAAI;IACpB,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,MAAM;IACZ,cAAc,EAAE,OAAO;IACvB,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,CAAC,gBAAK,CAAC,IAAI,CAAC;CACnB,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,UAAU,GAAG,kBAAE,CAAC,KAAK,CAAQ,OAAO,EAAE,mBAAW,EAAE,QAAQ,CAAC,CAAC"}
\ No newline at end of file
+{"version":3,"file":"Emoji.js","sourceRoot":"","sources":["../../src/models/Emoji.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA0D;AAC1D,gEAAkC;AAcrB,QAAA,WAAW,GAAG,IAAI,iBAAM,CAAC;IACrC,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACpC,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,OAAO;IAClB,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,MAAM;IACZ,cAAc,EAAE,OAAO;IACvB,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,CAAC,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,UAAU,GAAG,kBAAE,CAAC,KAAK,CAAQ,OAAO,EAAE,mBAAW,EAAE,QAAQ,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/models/Event.d.ts b/dist/models/Event.d.ts
index e00c2a97..00ca7cac 100644
--- a/dist/models/Event.d.ts
+++ b/dist/models/Event.d.ts
@@ -13,9 +13,9 @@ import { ApplicationCommand } from "./Application";
import { Interaction } from "./Interaction";
import { Schema, Document } from "mongoose";
export interface Event {
- guild_id?: bigint;
- user_id?: bigint;
- channel_id?: bigint;
+ guild_id?: string;
+ user_id?: string;
+ channel_id?: string;
created_at?: Date;
event: EVENT;
data?: any;
@@ -90,14 +90,14 @@ export interface ReadyEventData {
partial: boolean;
};
application?: {
- id: bigint;
+ id: string;
flags: bigint;
};
merged_members?: Omit[][];
users?: {
avatar?: string;
discriminator: string;
- id: bigint;
+ id: string;
username: string;
bot: boolean;
public_flags: bigint;
@@ -122,8 +122,8 @@ export interface ChannelDeleteEvent extends Event {
export interface ChannelPinsUpdateEvent extends Event {
event: "CHANNEL_PINS_UPDATE";
data: {
- guild_id?: bigint;
- channel_id: bigint;
+ guild_id?: string;
+ channel_id: string;
last_pin_timestamp: number;
};
}
@@ -138,55 +138,55 @@ export interface GuildUpdateEvent extends Event {
export interface GuildDeleteEvent extends Event {
event: "GUILD_DELETE";
data: {
- id: bigint;
+ id: string;
unavailable?: boolean;
};
}
export interface GuildBanAddEvent extends Event {
event: "GUILD_BAN_ADD";
data: {
- guild_id: bigint;
+ guild_id: string;
user: User;
};
}
export interface GuildBanRemoveEvent extends Event {
event: "GUILD_BAN_REMOVE";
data: {
- guild_id: bigint;
+ guild_id: string;
user: User;
};
}
export interface GuildEmojiUpdateEvent extends Event {
event: "GUILD_EMOJI_UPDATE";
data: {
- guild_id: bigint;
+ guild_id: string;
emojis: Emoji[];
};
}
export interface GuildIntegrationUpdateEvent extends Event {
event: "GUILD_INTEGRATIONS_UPDATE";
data: {
- guild_id: bigint;
+ guild_id: string;
};
}
export interface GuildMemberAddEvent extends Event {
event: "GUILD_MEMBER_ADD";
data: PublicMember & {
- guild_id: bigint;
+ guild_id: string;
};
}
export interface GuildMemberRemoveEvent extends Event {
event: "GUILD_MEMBER_REMOVE";
data: {
- guild_id: bigint;
+ guild_id: string;
user: User;
};
}
export interface GuildMemberUpdateEvent extends Event {
event: "GUILD_MEMBER_UPDATE";
data: {
- guild_id: bigint;
- roles: bigint[];
+ guild_id: string;
+ roles: string[];
user: User;
nick?: string;
joined_at: Date;
@@ -197,11 +197,11 @@ export interface GuildMemberUpdateEvent extends Event {
export interface GuildMembersChunkEvent extends Event {
event: "GUILD_MEMBERS_CHUNK";
data: {
- guild_id: bigint;
+ guild_id: string;
members: PublicMember[];
chunk_index: number;
chunk_count: number;
- not_found: bigint[];
+ not_found: string[];
presences: Presence[];
nonce?: string;
};
@@ -209,42 +209,42 @@ export interface GuildMembersChunkEvent extends Event {
export interface GuildRoleCreateEvent extends Event {
event: "GUILD_ROLE_CREATE";
data: {
- guild_id: bigint;
+ guild_id: string;
role: Role;
};
}
export interface GuildRoleUpdateEvent extends Event {
event: "GUILD_ROLE_UPDATE";
data: {
- guild_id: bigint;
+ guild_id: string;
role: Role;
};
}
export interface GuildRoleDeleteEvent extends Event {
event: "GUILD_ROLE_DELETE";
data: {
- guild_id: bigint;
- role_id: bigint;
+ guild_id: string;
+ role_id: string;
};
}
export interface InviteCreateEvent extends Event {
event: "INVITE_CREATE";
data: Omit & {
- channel_id: bigint;
- guild_id?: bigint;
+ channel_id: string;
+ guild_id?: string;
};
}
export interface InviteDeleteEvent extends Event {
event: "INVITE_DELETE";
data: {
- channel_id: bigint;
- guild_id?: bigint;
+ channel_id: string;
+ guild_id?: string;
code: string;
};
}
export declare type MessagePayload = Omit & {
- channel_id: bigint;
- guild_id?: bigint;
+ channel_id: string;
+ guild_id?: string;
author: User;
member: PublicMember;
mentions: (User & {
@@ -262,26 +262,26 @@ export interface MessageUpdateEvent extends Event {
export interface MessageDeleteEvent extends Event {
event: "MESSAGE_DELETE";
data: {
- id: bigint;
- channel_id: bigint;
- guild_id?: bigint;
+ id: string;
+ channel_id: string;
+ guild_id?: string;
};
}
export interface MessageDeleteBulkEvent extends Event {
event: "MESSAGE_DELETE_BULK";
data: {
- ids: bigint[];
- channel_id: bigint;
- guild_id?: bigint;
+ ids: string[];
+ channel_id: string;
+ guild_id?: string;
};
}
export interface MessageReactionAddEvent extends Event {
event: "MESSAGE_REACTION_ADD";
data: {
- user_id: bigint;
- channel_id: bigint;
- message_id: bigint;
- guild_id?: bigint;
+ user_id: string;
+ channel_id: string;
+ message_id: string;
+ guild_id?: string;
member?: PublicMember;
emoji: PartialEmoji;
};
@@ -289,27 +289,27 @@ export interface MessageReactionAddEvent extends Event {
export interface MessageReactionRemoveEvent extends Event {
event: "MESSAGE_REACTION_REMOVE";
data: {
- user_id: bigint;
- channel_id: bigint;
- message_id: bigint;
- guild_id?: bigint;
+ user_id: string;
+ channel_id: string;
+ message_id: string;
+ guild_id?: string;
emoji: PartialEmoji;
};
}
export interface MessageReactionRemoveAllEvent extends Event {
event: "MESSAGE_REACTION_REMOVE_ALL";
data: {
- channel_id: bigint;
- message_id: bigint;
- guild_id?: bigint;
+ channel_id: string;
+ message_id: string;
+ guild_id?: string;
};
}
export interface MessageReactionRemoveEmojiEvent extends Event {
event: "MESSAGE_REACTION_REMOVE_EMOJI";
data: {
- channel_id: bigint;
- message_id: bigint;
- guild_id?: bigint;
+ channel_id: string;
+ message_id: string;
+ guild_id?: string;
emoji: PartialEmoji;
};
}
@@ -320,10 +320,10 @@ export interface PresenceUpdateEvent extends Event {
export interface TypingStartEvent extends Event {
event: "TYPING_START";
data: {
- channel_id: bigint;
- user_id: bigint;
+ channel_id: string;
+ user_id: string;
timestamp: number;
- guild_id?: bigint;
+ guild_id?: string;
member?: PublicMember;
};
}
@@ -341,19 +341,19 @@ export interface VoiceServerUpdateEvent extends Event {
event: "VOICE_SERVER_UPDATE";
data: {
token: string;
- guild_id: bigint;
+ guild_id: string;
endpoint: string;
};
}
export interface WebhooksUpdateEvent extends Event {
event: "WEBHOOKS_UPDATE";
data: {
- guild_id: bigint;
- channel_id: bigint;
+ guild_id: string;
+ channel_id: string;
};
}
export declare type ApplicationCommandPayload = ApplicationCommand & {
- guild_id: bigint;
+ guild_id: string;
};
export interface ApplicationCommandCreateEvent extends Event {
event: "APPLICATION_COMMAND_CREATE";
diff --git a/dist/models/Event.js b/dist/models/Event.js
index d6eb6f6e..9d442aad 100644
--- a/dist/models/Event.js
+++ b/dist/models/Event.js
@@ -7,9 +7,9 @@ exports.EVENTEnum = exports.EventModel = exports.EventSchema = void 0;
const mongoose_1 = require("mongoose");
const Database_1 = __importDefault(require("../util/Database"));
exports.EventSchema = new mongoose_1.Schema({
- guild_id: mongoose_1.Types.Long,
- user_id: mongoose_1.Types.Long,
- channel_id: mongoose_1.Types.Long,
+ guild_id: String,
+ user_id: String,
+ channel_id: String,
created_at: { type: Date, required: true },
event: { type: String, required: true },
data: Object,
diff --git a/dist/models/Event.js.map b/dist/models/Event.js.map
index 268c8597..bd27fa9e 100644
--- a/dist/models/Event.js.map
+++ b/dist/models/Event.js.map
@@ -1 +1 @@
-{"version":3,"file":"Event.js","sourceRoot":"","sources":["../../src/models/Event.ts"],"names":[],"mappings":";;;;;;AAYA,uCAA0D;AAC1D,gEAAkC;AAarB,QAAA,WAAW,GAAG,IAAI,iBAAM,CAAC;IACrC,QAAQ,EAAE,gBAAK,CAAC,IAAI;IACpB,OAAO,EAAE,gBAAK,CAAC,IAAI;IACnB,UAAU,EAAE,gBAAK,CAAC,IAAI;IACtB,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC1C,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACvC,IAAI,EAAE,MAAM;CACZ,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,UAAU,GAAG,kBAAE,CAAC,KAAK,CAAgB,OAAO,EAAE,mBAAW,EAAE,QAAQ,CAAC,CAAC;AAkYlF,+BAA+B;AAE/B,IAAY,SAyCX;AAzCD,WAAY,SAAS;IACpB,4BAAe,CAAA;IACf,6CAAgC,CAAA;IAChC,6CAAgC,CAAA;IAChC,6CAAgC,CAAA;IAChC,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,yCAA4B,CAAA;IAC5B,yCAA4B,CAAA;IAC5B,0CAA6B,CAAA;IAC7B,gDAAmC,CAAA;IACnC,mDAAsC,CAAA;IACtC,kEAAqD,CAAA;IACrD,gDAAmC,CAAA;IACnC,sDAAyC,CAAA;IACzC,sDAAyC,CAAA;IACzC,0DAA6C,CAAA;IAC7C,sDAAyC,CAAA;IACzC,kDAAqC,CAAA;IACrC,kDAAqC,CAAA;IACrC,kDAAqC,CAAA;IACrC,2CAA8B,CAAA;IAC9B,2CAA8B,CAAA;IAC9B,6CAAgC,CAAA;IAChC,6CAAgC,CAAA;IAChC,6CAAgC,CAAA;IAChC,sDAAyC,CAAA;IACzC,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,qEAAwD,CAAA;IACxD,yEAA4D,CAAA;IAC5D,+CAAkC,CAAA;IAClC,yCAA4B,CAAA;IAC5B,uCAA0B,CAAA;IAC1B,+CAAkC,CAAA;IAClC,qDAAwC,CAAA;IACxC,oDAAuC,CAAA;IACvC,sDAAyC,CAAA;IACzC,oEAAuD,CAAA;IACvD,oEAAuD,CAAA;IACvD,oEAAuD,CAAA;AACxD,CAAC,EAzCW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAyCpB"}
\ No newline at end of file
+{"version":3,"file":"Event.js","sourceRoot":"","sources":["../../src/models/Event.ts"],"names":[],"mappings":";;;;;;AAYA,uCAA0D;AAC1D,gEAAkC;A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A;IACzC,oEAAuD,CAAA;IACvD,oEAAuD,CAAA;IACvD,oEAAuD,CAAA;AACxD,CAAC,EAzCW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAyCpB"}
\ No newline at end of file
diff --git a/dist/models/Guild.d.ts b/dist/models/Guild.d.ts
index 7ea96716..d7d94cb2 100644
--- a/dist/models/Guild.d.ts
+++ b/dist/models/Guild.d.ts
@@ -1,13 +1,13 @@
///
import { Schema, Document } from "mongoose";
export interface GuildDocument extends Document, Guild {
- id: bigint;
+ id: string;
}
export interface Guild {
- id: bigint;
- afk_channel_id?: bigint;
+ id: string;
+ afk_channel_id?: string;
afk_timeout?: number;
- application_id?: bigint;
+ application_id?: string;
banner?: string;
default_message_notifications?: number;
description?: string;
@@ -23,21 +23,21 @@ export interface Guild {
presence_count?: number;
mfa_level?: number;
name: string;
- owner_id: bigint;
+ owner_id: string;
preferred_locale?: string;
premium_subscription_count?: number;
premium_tier?: number;
- public_updates_channel_id?: bigint;
+ public_updates_channel_id?: string;
region?: string;
- rules_channel_id?: bigint;
+ rules_channel_id?: string;
splash?: string;
system_channel_flags?: number;
- system_channel_id?: bigint;
+ system_channel_id?: string;
unavailable?: boolean;
vanity_url_code?: string;
verification_level?: number;
welcome_screen: [];
- widget_channel_id?: bigint;
+ widget_channel_id?: string;
widget_enabled?: boolean;
}
export declare const GuildSchema: Schema, import("mongoose").Model>, undefined>;
diff --git a/dist/models/Guild.js b/dist/models/Guild.js
index 6a8adfc5..fa87d542 100644
--- a/dist/models/Guild.js
+++ b/dist/models/Guild.js
@@ -11,10 +11,10 @@ const Emoji_1 = require("./Emoji");
const Member_1 = require("./Member");
const Role_1 = require("./Role");
exports.GuildSchema = new mongoose_1.Schema({
- id: { type: mongoose_1.Types.Long, required: true },
- afk_channel_id: mongoose_1.Types.Long,
+ id: { type: String, required: true },
+ afk_channel_id: String,
afk_timeout: Number,
- application_id: mongoose_1.Types.Long,
+ application_id: String,
banner: String,
default_message_notifications: Number,
description: String,
@@ -30,22 +30,22 @@ exports.GuildSchema = new mongoose_1.Schema({
presence_count: Number,
mfa_level: Number,
name: { type: String, required: true },
- owner_id: { type: mongoose_1.Types.Long, required: true },
+ owner_id: { type: String, required: true },
preferred_locale: String,
premium_subscription_count: Number,
premium_tier: Number,
- public_updates_channel_id: mongoose_1.Types.Long,
+ public_updates_channel_id: String,
region: String,
- rules_channel_id: mongoose_1.Types.Long,
+ rules_channel_id: String,
splash: String,
system_channel_flags: Number,
- system_channel_id: mongoose_1.Types.Long,
+ system_channel_id: String,
unavailable: Boolean,
vanity_url_code: String,
verification_level: Number,
voice_states: { type: [Object], default: [] },
welcome_screen: { type: [Object], default: [] },
- widget_channel_id: mongoose_1.Types.Long,
+ widget_channel_id: String,
widget_enabled: Boolean,
});
exports.GuildSchema.virtual("channels", {
diff --git a/dist/models/Guild.js.map b/dist/models/Guild.js.map
index e64d6c61..aaa3951b 100644
--- a/dist/models/Guild.js.map
+++ b/dist/models/Guild.js.map
@@ -1 +1 @@
-{"version":3,"file":"Guild.js","sourceRoot":"","sources":["../../src/models/Guild.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA0D;AAC1D,gEAAkC;AAClC,uCAAyC;AACzC,mCAAqC;AACrC,qCAAuC;AACvC,iCAAmC;AAiDtB,QAAA,WAAW,GAAG,IAAI,iBAAM,CAAC;IACrC,EAAE,EAAE,EAAE,IAAI,EAAE,gBAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;IACxC,cAAc,EAAE,gBAAK,CAAC,IAAI;IAC1B,WAAW,EAAE,MAAM;IACnB,cAAc,EAAE,gBAAK,CAAC,IAAI;IAC1B,MAAM,EAAE,MAAM;IACd,6BAA6B,EAAE,MAAM;IACrC,WAAW,EAAE,MAAM;IACnB,gBAAgB,EAAE,MAAM;IACxB,uBAAuB,EAAE,MAAM;IAC/B,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;IACzC,I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AO;CACvB,CAAC,CAAC;AAEH,mBAAW,CAAC,OAAO,CAAC,UAAU,EAAE;IAC/B,GAAG,EAAE,sBAAY;IACjB,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,UAAU;IACxB,OAAO,EAAE,KAAK;CACd,CAAC,CAAC;AACH,mBAAW,CAAC,OAAO,CAAC,OAAO,EAAE;IAC5B,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,UAAU;IACxB,OAAO,EAAE,KAAK;CACd,CAAC,CAAC;AAEH,qFAAqF;AACrF,mBAAW,CAAC,OAAO,CAAC,SAAS,EAAE;IAC9B,GAAG,EAAE,oBAAW;IAChB,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,WAAW;IACzB,OAAO,EAAE,KAAK;CACd,CAAC,CAAC;AAEH,mBAAW,CAAC,OAAO,CAAC,QAAQ,EAAE;IAC7B,GAAG,EAAE,kBAAU;IACf,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,UAAU;IACxB,OAAO,EAAE,KAAK;CACd,CAAC,CAAC;AAEH,mBAAW,CAAC,OAAO,CAAC,WAAW,EAAE;IAChC,GAAG,EAAE,oBAAW;IAChB,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,UAAU;IACxB,OAAO,EAAE,IAAI;CACb,CAAC,CAAC,GAAG,CAAC,CAAC,MAAW,EAAE,OAAY,EAAE,GAAQ,EAAE,EAAE;IAC9C,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACjC,OAAO,MAAM,CAAC,SAAS,CAAC;AACzB,CAAC,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,UAAU,GAAG,kBAAE,CAAC,KAAK,CAAgB,OAAO,EAAE,mBAAW,EAAE,QAAQ,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/models/Interaction.d.ts b/dist/models/Interaction.d.ts
index df03b8a9..53836981 100644
--- a/dist/models/Interaction.d.ts
+++ b/dist/models/Interaction.d.ts
@@ -1,11 +1,11 @@
import { AllowedMentions, Embed } from "./Message";
export interface Interaction {
- id: bigint;
+ id: string;
type: InteractionType;
data?: {};
- guild_id: bigint;
- channel_id: bigint;
- member_id: bigint;
+ guild_id: string;
+ channel_id: string;
+ member_id: string;
token: string;
version: number;
}
diff --git a/dist/models/Invite.d.ts b/dist/models/Invite.d.ts
index a151322b..e6de64d3 100644
--- a/dist/models/Invite.d.ts
+++ b/dist/models/Invite.d.ts
@@ -7,10 +7,10 @@ export interface Invite extends Document {
max_uses: number;
max_age: number;
created_at: Date;
- guild_id: bigint;
- channel_id: bigint;
- inviter_id: bigint;
- target_user_id?: bigint;
+ guild_id: string;
+ channel_id: string;
+ inviter_id: string;
+ target_user_id?: string;
target_user_type?: number;
}
export declare const InviteSchema: Schema, import("mongoose").Model>, undefined>;
diff --git a/dist/models/Invite.js b/dist/models/Invite.js
index 31d21278..9113abcc 100644
--- a/dist/models/Invite.js
+++ b/dist/models/Invite.js
@@ -13,11 +13,11 @@ exports.InviteSchema = new mongoose_1.Schema({
max_uses: Number,
max_age: Number,
created_at: Date,
- guild_id: mongoose_1.Types.Long,
- channel_id: mongoose_1.Types.Long,
- inviter_id: mongoose_1.Types.Long,
- //! What the fucking shit is this
- target_user_id: mongoose_1.Types.Long,
+ guild_id: String,
+ channel_id: String,
+ inviter_id: String,
+ // ? What the fucking shit is this
+ target_user_id: String,
target_user_type: Number,
});
// @ts-ignore
diff --git a/dist/models/Invite.js.map b/dist/models/Invite.js.map
index 3b25219f..3e69e1d1 100644
--- a/dist/models/Invite.js.map
+++ b/dist/models/Invite.js.map
@@ -1 +1 @@
-{"version":3,"file":"Invite.js","sourceRoot":"","sources":["../../src/models/Invite.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAmD;AACnD,gEAAkC;AAmBrB,QAAA,YAAY,GAAG,IAAI,iBAAM,CAAC;IACtC,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,gBAAK,CAAC,IAAI;IACpB,UAAU,EAAE,gBAAK,CAAC,IAAI;IACtB,UAAU,EAAE,gBAAK,CAAC,IAAI;IAEtB,iCAAiC;IACjC,cAAc,EAAE,gBAAK,CAAC,IAAI;IAC1B,gBAAgB,EAAE,MAAM;CAExB,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,WAAW,GAAG,kBAAE,CAAC,KAAK,CAAS,QAAQ,EAAE,oBAAY,EAAE,SAAS,CAAC,CAAC"}
\ No newline at end of file
+{"version":3,"file":"Invite.js","sourceRoot":"","sources":["../../src/models/Invite.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAmD;AACnD,gEAAkC;AAkBrB,QAAA,YAAY,GAAG,IAAI,iBAAM,CAAC;IACtC,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,MAAM;IAClB,UAAU,EAAE,MAAM;IAElB,kCAAkC;IAClC,cAAc,EAAE,MAAM;IACtB,gBAAgB,EAAE,MAAM;CACxB,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,WAAW,GAAG,kBAAE,CAAC,KAAK,CAAS,QAAQ,EAAE,oBAAY,EAAE,SAAS,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/models/Member.d.ts b/dist/models/Member.d.ts
index bf930613..26079e7c 100644
--- a/dist/models/Member.d.ts
+++ b/dist/models/Member.d.ts
@@ -2,10 +2,10 @@
import { PublicUser, User } from "./User";
import { Schema, Document } from "mongoose";
export interface Member {
- id: bigint;
- guild_id: bigint;
+ id: string;
+ guild_id: string;
nick?: string;
- roles: bigint[];
+ roles: string[];
joined_at: Date;
premium_since?: number;
deaf: boolean;
@@ -15,11 +15,11 @@ export interface Member {
user?: User;
}
export interface MemberDocument extends Member, Document {
- id: bigint;
+ id: string;
}
export interface UserGuildSettings {
channel_overrides: {
- channel_id: bigint;
+ channel_id: string;
message_notifications: number;
mute_config: MuteConfig;
muted: boolean;
diff --git a/dist/models/Member.js b/dist/models/Member.js
index 26a728f0..c7717dd2 100644
--- a/dist/models/Member.js
+++ b/dist/models/Member.js
@@ -12,10 +12,10 @@ const MuteConfig = {
selected_time_window: Number,
};
exports.MemberSchema = new mongoose_1.Schema({
- id: { type: mongoose_1.Types.Long, required: true },
- guild_id: mongoose_1.Types.Long,
+ id: { type: String, required: true },
+ guild_id: String,
nick: String,
- roles: [mongoose_1.Types.Long],
+ roles: [String],
joined_at: Date,
premium_since: Number,
deaf: Boolean,
@@ -24,7 +24,7 @@ exports.MemberSchema = new mongoose_1.Schema({
settings: {
channel_overrides: [
{
- channel_id: mongoose_1.Types.Long,
+ channel_id: String,
message_notifications: Number,
mute_config: MuteConfig,
muted: Boolean,
diff --git a/dist/models/Member.js.map b/dist/models/Member.js.map
index aa0bae9b..c39e4bd1 100644
--- a/dist/models/Member.js.map
+++ b/dist/models/Member.js.map
@@ -1 +1 @@
-{"version":3,"file":"Member.js","sourceRoot":"","sources":["../../src/models/Member.ts"],"names":[],"mappings":";;;;;;AAAA,iCAAqD;AACrD,uCAAmD;AACnD,gEAAkC;AAyClC,MAAM,UAAU,GAAG;IAClB,QAAQ,EAAE,MAAM;IAChB,oBAAoB,EAAE,MAAM;CAC5B,CAAC;AAEW,QAAA,YAAY,GAAG,IAAI,iBAAM,CAAC;IACtC,EAAE,EAAE,EAAE,IAAI,EAAE,gBAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;IACxC,QAAQ,EAAE,gBAAK,CAAC,IAAI;IACpB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,CAAC,gBAAK,CAAC,IAAI,CAAC;IACnB,SAAS,EAAE,IAAI;IACf,aAAa,EAAE,MAAM;IACrB,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE;QACT,iBAAiB,EAAE;YAClB;gBACC,UAAU,EAAE,gBAAK,CAAC,IAAI;gBACtB,qBAAqB,EAAE,MAAM;gBAC7B,WAAW,EAAE,UAAU;gBACvB,KAAK,EAAE,OAAO;aACd;SACD;QACD,qBAAqB,EAAE,MAAM;QAC7B,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,UAAU;QACvB,KAAK,EAAE,OAAO;QACd,iBAAiB,EAAE,OAAO;QAC1B,cAAc,EAAE,OAAO;QACvB,OAAO,EAAE,MAAM;KACf;CACD,CAAC,CAAC;AAEH,oBAAY,CAAC,OAAO,CAAC,MAAM,EAAE;IAC5B,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,WAAW,GAAG,kBAAE,CAAC,KAAK,CAAiB,QAAQ,EAAE,oBAAY,EAAE,SAAS,CAAC,CAAC"}
\ No newline at end of file
+{"version":3,"file":"Member.js","sourceRoot":"","sources":["../../src/models/Member.ts"],"names":[],"mappings":";;;;;;AAAA,iCAAqD;AACrD,uCAAmD;AACnD,gEAAkC;AAyClC,MAAM,UAAU,GAAG;IAClB,QAAQ,EAAE,MAAM;IAChB,oBAAoB,EAAE,MAAM;CAC5B,CAAC;AAEW,QAAA,YAAY,GAAG,IAAI,iBAAM,CAAC;IACtC,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACpC,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,CAAC,MAAM,CAAC;IACf,SAAS,EAAE,IAAI;IACf,aAAa,EAAE,MAAM;IACrB,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE;QACT,iBAAiB,EAAE;YAClB;gBACC,UAAU,EAAE,MAAM;gBAClB,qBAAqB,EAAE,MAAM;gBAC7B,WAAW,EAAE,UAAU;gBACvB,KAAK,EAAE,OAAO;aACd;SACD;QACD,qBAAqB,EAAE,MAAM;QAC7B,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,UAAU;QACvB,KAAK,EAAE,OAAO;QACd,iBAAiB,EAAE,OAAO;QAC1B,cAAc,EAAE,OAAO;QACvB,OAAO,EAAE,MAAM;KACf;CACD,CAAC,CAAC;AAEH,oBAAY,CAAC,OAAO,CAAC,MAAM,EAAE;IAC5B,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,WAAW,GAAG,kBAAE,CAAC,KAAK,CAAiB,QAAQ,EAAE,oBAAY,EAAE,SAAS,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/models/Message.d.ts b/dist/models/Message.d.ts
index a823ce5e..a629f7ee 100644
--- a/dist/models/Message.d.ts
+++ b/dist/models/Message.d.ts
@@ -1,20 +1,20 @@
///
-import { Schema, Types, Document } from "mongoose";
+import { Schema, Document } from "mongoose";
export interface Message {
- id: bigint;
- channel_id: bigint;
- guild_id?: bigint;
- author_id?: bigint;
- webhook_id?: bigint;
- application_id?: bigint;
+ id: string;
+ channel_id: string;
+ guild_id?: string;
+ author_id?: string;
+ webhook_id?: string;
+ application_id?: string;
content?: string;
timestamp: Date;
edited_timestamp?: Date;
tts?: boolean;
mention_everyone?: boolean;
- mention_user_ids: bigint[];
- mention_role_ids: bigint[];
- mention_channels_ids: bigint[];
+ mention_user_ids: string[];
+ mention_role_ids: string[];
+ mention_channels_ids: string[];
attachments: Attachment[];
embeds: Embed[];
reactions: Reaction[];
@@ -28,13 +28,13 @@ export interface Message {
flags?: bigint;
stickers?: [];
message_reference?: {
- message_id: bigint;
- channel_id?: bigint;
- guild_id?: bigint;
+ message_id: string;
+ channel_id?: string;
+ guild_id?: string;
};
}
export interface MessageDocument extends Document, Message {
- id: bigint;
+ id: string;
}
export declare enum MessageType {
DEFAULT = 0,
@@ -56,7 +56,7 @@ export declare enum MessageType {
APPLICATION_COMMAND = 20
}
export interface Attachment {
- id: bigint;
+ id: string;
filename: string;
size: number;
url: string;
@@ -106,18 +106,18 @@ export interface Reaction {
emoji: PartialEmoji;
}
export interface PartialEmoji {
- id?: bigint;
+ id?: string;
name: string;
animated?: boolean;
}
export interface AllowedMentions {
parse?: ("users" | "roles" | "everyone")[];
- roles?: bigint[];
- users?: bigint[];
+ roles?: string[];
+ users?: string[];
replied_user?: boolean;
}
export declare const Attachment: {
- id: typeof Types.Long;
+ id: StringConstructor;
filename: StringConstructor;
size: NumberConstructor;
url: StringConstructor;
diff --git a/dist/models/Message.js b/dist/models/Message.js
index add929c6..1adca30c 100644
--- a/dist/models/Message.js
+++ b/dist/models/Message.js
@@ -30,7 +30,7 @@ var MessageType;
MessageType[MessageType["APPLICATION_COMMAND"] = 20] = "APPLICATION_COMMAND";
})(MessageType = exports.MessageType || (exports.MessageType = {}));
exports.Attachment = {
- id: mongoose_1.Types.Long,
+ id: String,
filename: String,
size: Number,
url: String,
@@ -47,7 +47,7 @@ exports.EmbedImage = {
const Reaction = {
count: Number,
emoji: {
- id: mongoose_1.Types.Long,
+ id: String,
name: String,
animated: Boolean,
},
@@ -86,20 +86,20 @@ exports.Embed = {
],
};
exports.MessageSchema = new mongoose_1.Schema({
- id: mongoose_1.Types.Long,
- channel_id: mongoose_1.Types.Long,
- author_id: mongoose_1.Types.Long,
- webhook_id: mongoose_1.Types.Long,
- guild_id: mongoose_1.Types.Long,
- application_id: mongoose_1.Types.Long,
+ id: String,
+ channel_id: String,
+ author_id: String,
+ webhook_id: String,
+ guild_id: String,
+ application_id: String,
content: String,
timestamp: Date,
edited_timestamp: Date,
tts: Boolean,
mention_everyone: Boolean,
- mention_user_ids: [mongoose_1.Types.Long],
- mention_role_ids: [mongoose_1.Types.Long],
- mention_channel_ids: [mongoose_1.Types.Long],
+ mention_user_ids: [String],
+ mention_role_ids: [String],
+ mention_channel_ids: [String],
attachments: [exports.Attachment],
embeds: [exports.Embed],
reactions: [Reaction],
@@ -113,9 +113,9 @@ exports.MessageSchema = new mongoose_1.Schema({
flags: mongoose_1.Types.Long,
stickers: [],
message_reference: {
- message_id: mongoose_1.Types.Long,
- channel_id: mongoose_1.Types.Long,
- guild_id: mongoose_1.Types.Long,
+ message_id: String,
+ channel_id: String,
+ guild_id: String,
},
});
exports.MessageSchema.virtual("author", {
diff --git a/dist/models/Message.js.map b/dist/models/Message.js.map
index 6e8bb229..e4387a0e 100644
--- a/dist/models/Message.js.map
+++ b/dist/models/Message.js.map
@@ -1 +1 @@
-{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../src/models/Message.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAmD;AACnD,gEAAkC;AAClC,iCAAmC;AACnC,qCAAuC;AACvC,iCAAmC;AAwCnC,IAAY,WAkBX;AAlBD,WAAY,WAAW;IACtB,mDAAW,CAAA;IACX,+DAAiB,CAAA;IACjB,qEAAoB,CAAA;IACpB,6CAAQ,CAAA;IACR,2EAAuB,CAAA;IACvB,2EAAuB,CAAA;IACvB,iFAA0B,CAAA;IAC1B,uEAAqB,CAAA;IACrB,mGAAmC,CAAA;IACnC,iHAA0C,CAAA;IAC1C,kHAA2C,CAAA;IAC3C,kHAA2C,CAAA;IAC3C,0EAAuB,CAAA;IACvB,8FAAiC,CAAA;IACjC,4FAAgC,CAAA;IAChC,gDAAU,CAAA;IACV,4EAAwB,CAAA;AACzB,CAAC,EAlBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAkBtB;AAsEY,QAAA,UAAU,GAAG;IACzB,EAAE,EAAE,gBAAK,CAAC,IAAI;IACd,QAAQ,EAAE,MAAM;IAChB,IAAI,E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C,UAAU,EAAE;IACjC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,qBAAa,CAAC,OAAO,CAAC,eAAe,EAAE;IACtC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,qBAAa,CAAC,OAAO,CAAC,kBAAkB,EAAE;IACzC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,kCAAkC;AAClC,yCAAyC;AACzC,qBAAqB;AACrB,mCAAmC;AACnC,uBAAuB;AACvB,kBAAkB;AAClB,MAAM;AAEN,aAAa;AACA,QAAA,YAAY,GAAG,kBAAE,CAAC,KAAK,CAAkB,SAAS,EAAE,qBAAa,EAAE,UAAU,CAAC,CAAC"}
\ No newline at end of file
+{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../src/models/Message.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAmD;AACnD,gEAAkC;AAClC,iCAAmC;AACnC,qCAAuC;AACvC,iCAAmC;AAwCnC,IAAY,WAkBX;AAlBD,WAAY,WAAW;IACtB,mDAAW,CAAA;IACX,+DAAiB,CAAA;IACjB,qEAAoB,CAAA;IACpB,6CAAQ,CAAA;IACR,2EAAuB,CAAA;IACvB,2EAAuB,CAAA;IACvB,iFAA0B,CAAA;IAC1B,uEAAqB,CAAA;IACrB,mGAAmC,CAAA;IACnC,iHAA0C,CAAA;IAC1C,kHAA2C,CAAA;IAC3C,kHAA2C,CAAA;IAC3C,0EAAuB,CAAA;IACvB,8FAAiC,CAAA;IACjC,4FAAgC,CAAA;IAChC,gDAAU,CAAA;IACV,4EAAwB,CAAA;AACzB,CAAC,EAlBW,WAAW,GAAX,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kBAAkB;IAC9B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,qBAAa,CAAC,OAAO,CAAC,eAAe,EAAE;IACtC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,qBAAa,CAAC,OAAO,CAAC,kBAAkB,EAAE;IACzC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,kCAAkC;AAClC,yCAAyC;AACzC,qBAAqB;AACrB,mCAAmC;AACnC,uBAAuB;AACvB,kBAAkB;AAClB,MAAM;AAEN,aAAa;AACA,QAAA,YAAY,GAAG,kBAAE,CAAC,KAAK,CAAkB,SAAS,EAAE,qBAAa,EAAE,UAAU,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/models/Role.d.ts b/dist/models/Role.d.ts
index 6a3f1669..d6765283 100644
--- a/dist/models/Role.d.ts
+++ b/dist/models/Role.d.ts
@@ -1,8 +1,8 @@
///
import { Schema, Document } from "mongoose";
export interface Role {
- id: bigint;
- guild_id: bigint;
+ id: string;
+ guild_id: string;
color: number;
hoist: boolean;
managed: boolean;
@@ -11,11 +11,11 @@ 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 declare const RoleSchema: Schema, import("mongoose").Model>, undefined>;
export declare const RoleModel: import("mongoose").Model;
diff --git a/dist/models/Role.js b/dist/models/Role.js
index ed681849..86c06db9 100644
--- a/dist/models/Role.js
+++ b/dist/models/Role.js
@@ -7,8 +7,8 @@ exports.RoleModel = exports.RoleSchema = void 0;
const mongoose_1 = require("mongoose");
const Database_1 = __importDefault(require("../util/Database"));
exports.RoleSchema = new mongoose_1.Schema({
- id: mongoose_1.Types.Long,
- guild_id: mongoose_1.Types.Long,
+ id: String,
+ guild_id: String,
color: Number,
hoist: Boolean,
managed: Boolean,
@@ -17,7 +17,7 @@ exports.RoleSchema = new mongoose_1.Schema({
permissions: mongoose_1.Types.Long,
position: Number,
tags: {
- bot_id: mongoose_1.Types.Long,
+ bot_id: String,
},
});
// @ts-ignore
diff --git a/dist/models/Role.js.map b/dist/models/Role.js.map
index b3ed1758..87872154 100644
--- a/dist/models/Role.js.map
+++ b/dist/models/Role.js.map
@@ -1 +1 @@
-{"version":3,"file":"Role.js","sourceRoot":"","sources":["../../src/models/Role.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA0D;AAC1D,gEAAkC;AAqBrB,QAAA,UAAU,GAAG,IAAI,iBAAM,CAAC;IACpC,EAAE,EAAE,gBAAK,CAAC,IAAI;IACd,QAAQ,EAAE,gBAAK,CAAC,IAAI;IACpB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,OAAO;IACpB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,gBAAK,CAAC,IAAI;IACvB,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE;QACL,MAAM,EAAE,gBAAK,CAAC,IAAI;KAClB;CACD,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,SAAS,GAAG,kBAAE,CAAC,KAAK,CAAe,MAAM,EAAE,kBAAU,EAAE,OAAO,CAAC,CAAC"}
\ No newline at end of file
+{"version":3,"file":"Role.js","sourceRoot":"","sources":["../../src/models/Role.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA0D;AAC1D,gEAAkC;AAqBrB,QAAA,UAAU,GAAG,IAAI,iBAAM,CAAC;IACpC,EAAE,EAAE,MAAM;IACV,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,OAAO;IACpB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,gBAAK,CAAC,IAAI;IACvB,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE;QACL,MAAM,EAAE,MAAM;KACd;CACD,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,SAAS,GAAG,kBAAE,CAAC,KAAK,CAAe,MAAM,EAAE,kBAAU,EAAE,OAAO,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/models/User.d.ts b/dist/models/User.d.ts
index 109dd177..ae101061 100644
--- a/dist/models/User.d.ts
+++ b/dist/models/User.d.ts
@@ -3,7 +3,7 @@ import { Activity } from "./Activity";
import { ClientStatus, Status } from "./Status";
import { Schema, Document } from "mongoose";
export interface User {
- id: bigint;
+ id: string;
username: string;
discriminator: string;
avatar: string | null;
@@ -23,7 +23,7 @@ export interface User {
flags: bigint;
public_flags: bigint;
user_settings: UserSettings;
- guilds: bigint[];
+ guilds: string[];
user_data: UserData;
presence: {
status: Status;
@@ -39,10 +39,10 @@ export interface UserData {
fingerprints: string[];
}
export interface UserDocument extends User, Document {
- id: bigint;
+ id: string;
}
export interface PublicUser {
- id: bigint;
+ id: string;
discriminator: string;
username: string;
avatar?: string;
@@ -60,10 +60,10 @@ export interface ConnectedAccount {
visibility: number;
}
export interface Relationship {
- id: bigint;
+ id: string;
nickname?: string;
type: number;
- user_id: bigint;
+ user_id: string;
}
export interface UserSettings {
afk_timeout: number;
@@ -73,7 +73,7 @@ export interface UserSettings {
contact_sync_enabled: boolean;
convert_emoticons: boolean;
custom_status: {
- emoji_id: bigint | null;
+ emoji_id: string | null;
emoji_name: string | null;
expires_at: number | null;
text: string | null;
@@ -91,11 +91,11 @@ export interface UserSettings {
gif_auto_play: boolean;
guild_folders: {
color: number;
- guild_ids: bigint[];
+ guild_ids: string[];
id: number;
name: string;
}[];
- guild_positions: bigint[];
+ guild_positions: string[];
inline_attachment_media: boolean;
inline_embed_media: boolean;
locale: string;
@@ -103,7 +103,7 @@ export interface UserSettings {
native_phone_integration_enabled: boolean;
render_embeds: boolean;
render_reactions: boolean;
- restricted_guilds: bigint[];
+ restricted_guilds: string[];
show_current_game: boolean;
status: "online" | "offline" | "dnd" | "idle";
stream_notifications_enabled: boolean;
diff --git a/dist/models/User.js b/dist/models/User.js
index 7c98f27e..3ba04503 100644
--- a/dist/models/User.js
+++ b/dist/models/User.js
@@ -9,7 +9,7 @@ const Status_1 = require("./Status");
const mongoose_1 = require("mongoose");
const Database_1 = __importDefault(require("../util/Database"));
exports.UserSchema = new mongoose_1.Schema({
- id: mongoose_1.Types.Long,
+ id: String,
username: String,
discriminator: String,
avatar: String,
@@ -28,17 +28,17 @@ exports.UserSchema = new mongoose_1.Schema({
email: String,
flags: mongoose_1.Types.Long,
public_flags: mongoose_1.Types.Long,
- guilds: [mongoose_1.Types.Long],
+ guilds: [String],
user_data: {
fingerprints: [String],
hash: String,
valid_tokens_since: Date,
relationships: [
{
- id: mongoose_1.Types.Long,
+ id: String,
nickname: String,
type: Number,
- user_id: mongoose_1.Types.Long,
+ user_id: String,
},
],
connected_accounts: [
@@ -63,7 +63,7 @@ exports.UserSchema = new mongoose_1.Schema({
contact_sync_enabled: Boolean,
convert_emoticons: Boolean,
custom_status: {
- emoji_id: mongoose_1.Types.Long,
+ emoji_id: String,
emoji_name: String,
expires_at: Number,
text: String,
@@ -81,12 +81,12 @@ exports.UserSchema = new mongoose_1.Schema({
guild_folders: [
{
color: Number,
- guild_ids: [mongoose_1.Types.Long],
+ guild_ids: [String],
id: Number,
name: String,
},
],
- guild_positions: [mongoose_1.Types.Long],
+ guild_positions: [String],
inline_attachment_media: Boolean,
inline_embed_media: Boolean,
locale: String,
@@ -94,7 +94,7 @@ exports.UserSchema = new mongoose_1.Schema({
native_phone_integration_enabled: Boolean,
render_embeds: Boolean,
render_reactions: Boolean,
- restricted_guilds: [mongoose_1.Types.Long],
+ restricted_guilds: [String],
show_current_game: Boolean,
status: String,
stream_notifications_enabled: Boolean,
diff --git a/dist/models/User.js.map b/dist/models/User.js.map
index 03a92cb6..d57da8db 100644
--- a/dist/models/User.js.map
+++ b/dist/models/User.js.map
@@ -1 +1 @@
-{"version":3,"file":"User.js","sourceRoot":"","sources":["../../src/models/User.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAsC;AACtC,qCAAgD;AAChD,uCAAmD;AACnD,gEAAkC;AAqHrB,QAAA,UAAU,GAAG,IAAI,iBAAM,CAAC;IACpC,EAAE,EAAE,gBAAK,CAAC,IAAI;IACd,QAAQ,EAAE,MAAM;IAChB,aAAa,EAAE,MAAM;IACrB,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;IACb,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,OAAO;IACf,OAAO,EAAE,OAAO;IAChB,aAAa,EAAE,IAAI;IACnB,YAAY,EAAE,MAAM;IACpB,GAAG,EAAE,OAAO;IACZ,MAAM,EAAE,OAAO;IACf,YAAY,EAAE,OAAO;IACrB,WAAW,EAAE,OAAO;IACpB,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,OAAO;IACjB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,gBAAK,CAAC,IAAI;IACjB,YAAY,EAAE,gBAAK,CAAC,IAAI;IACxB,MAAM,EAAE,CAAC,gBAAK,CAAC,IAAI,CAAC;IACpB,SAAS,EAAE;QACV,YAAY,EAAE,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,MAAM;QACZ,kBAAkB,EAAE,IAAI;QACxB,aAAa,EAAE;YACd;gBACC,EAAE,EAAE,gBAAK,CAAC,IAAI;gBACd,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,gBAAK,CAAC,IAAI;aACnB;SACD;QACD,kBAAkB,EAAE;YACnB;gBACC,YAAY,EAAE,MAAM;gBACpB,WAAW,EAAE,OAAO;gBACpB,EAAE,EAAE,MAAM;gBACV,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,OAAO;gBAChB,aAAa,EAAE,OAAO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MAAM;KACvB;IAED,QAAQ,EAAE;QACT,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,CAAC,mBAAQ,CAAC;QACtB,aAAa,EAAE,qBAAY;KAC3B;CACD,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,SAAS,GAAG,kBAAE,CAAC,KAAK,CAAe,MAAM,EAAE,kBAAU,EAAE,OAAO,CAAC,CAAC"}
\ No newline at end of file
+{"version":3,"file":"User.js","sourceRoot":"","sources":["../../src/models/User.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAsC;AACtC,qCAAgD;AAChD,uCAAmD;AACnD,gEAAkC;AAqHrB,QAAA,UAAU,GAAG,IAAI,iBAAM,CAAC;IACpC,EAAE,EAAE,MAAM;IACV,QAAQ,EAAE,MAAM;IAChB,aAAa,EAAE,MAAM;IACrB,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;IACb,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,OAAO;IACf,OAAO,EAAE,OAAO;IAChB,aAAa,EAAE,IAAI;IACnB,YAAY,EAAE,MAAM;IACpB,GAAG,EAAE,OAAO;IACZ,MAAM,EAAE,OAAO;IACf,YAAY,EAAE,OAAO;IACrB,WAAW,EAAE,OAAO;IACpB,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,OAAO;IACjB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,gBAAK,CAAC,IAAI;IACjB,YAAY,EAAE,gBAAK,CAAC,IAAI;IACxB,MAAM,EAAE,CAAC,MAAM,CAAC;IAChB,SAAS,EAAE;QACV,YAAY,EAAE,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,MAAM;QACZ,kBAAkB,EAAE,IAAI;QACxB,aAAa,EAAE;YACd;gBACC,EAAE,EAAE,MAAM;gBACV,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,MAAM;aACf;SACD;QACD,kBAAkB,EAAE;YACnB;gBACC,YAAY,EAAE,MAAM;gBAC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QACd,4BAA4B,EAAE,OAAO;QACrC,KAAK,EAAE,MAAM;QACb,eAAe,EAAE,MAAM;KACvB;IAED,QAAQ,EAAE;QACT,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,CAAC,mBAAQ,CAAC;QACtB,aAAa,EAAE,qBAAY;KAC3B;CACD,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,SAAS,GAAG,kBAAE,CAAC,KAAK,CAAe,MAAM,EAAE,kBAAU,EAAE,OAAO,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/models/VoiceState.d.ts b/dist/models/VoiceState.d.ts
index 50faa253..cf0fa523 100644
--- a/dist/models/VoiceState.d.ts
+++ b/dist/models/VoiceState.d.ts
@@ -1,9 +1,9 @@
///
import { Schema, Document } from "mongoose";
export interface VoiceState extends Document {
- guild_id?: bigint;
- channel_id: bigint;
- user_id: bigint;
+ guild_id?: string;
+ channel_id: string;
+ user_id: string;
session_id: string;
deaf: boolean;
mute: boolean;
diff --git a/dist/models/VoiceState.js b/dist/models/VoiceState.js
index c646879c..d96a5ad4 100644
--- a/dist/models/VoiceState.js
+++ b/dist/models/VoiceState.js
@@ -7,9 +7,9 @@ exports.VoiceStateModel = exports.VoiceSateSchema = void 0;
const mongoose_1 = require("mongoose");
const Database_1 = __importDefault(require("../util/Database"));
exports.VoiceSateSchema = new mongoose_1.Schema({
- guild_id: mongoose_1.Types.Long,
- channel_id: mongoose_1.Types.Long,
- user_id: mongoose_1.Types.Long,
+ guild_id: String,
+ channel_id: String,
+ user_id: String,
session_id: String,
deaf: Boolean,
mute: Boolean,
diff --git a/dist/models/VoiceState.js.map b/dist/models/VoiceState.js.map
index 1e21605d..1e7905d8 100644
--- a/dist/models/VoiceState.js.map
+++ b/dist/models/VoiceState.js.map
@@ -1 +1 @@
-{"version":3,"file":"VoiceState.js","sourceRoot":"","sources":["../../src/models/VoiceState.ts"],"names":[],"mappings":";;;;;;AACA,uCAA0D;AAC1D,gEAAkC;AAgBrB,QAAA,eAAe,GAAG,IAAI,iBAAM,CAAC;IACzC,QAAQ,EAAE,gBAAK,CAAC,IAAI;IACpB,UAAU,EAAE,gBAAK,CAAC,IAAI;IACtB,OAAO,EAAE,gBAAK,CAAC,IAAI;IACnB,UAAU,EAAE,MAAM;IAClB,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,OAAO;IAClB,WAAW,EAAE,OAAO;IACpB,UAAU,EAAE,OAAO;IACnB,QAAQ,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,eAAe,GAAG,kBAAE,CAAC,KAAK,CAAa,YAAY,EAAE,uBAAe,EAAE,aAAa,CAAC,CAAC"}
\ No newline at end of file
+{"version":3,"file":"VoiceState.js","sourceRoot":"","sources":["../../src/models/VoiceState.ts"],"names":[],"mappings":";;;;;;AACA,uCAA0D;AAC1D,gEAAkC;AAgBrB,QAAA,eAAe,GAAG,IAAI,iBAAM,CAAC;IACzC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,MAAM;IAClB,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,OAAO;IAClB,WAAW,EAAE,OAAO;IACpB,UAAU,EAAE,OAAO;IACnB,QAAQ,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,eAAe,GAAG,kBAAE,CAAC,KAAK,CAAa,YAAY,EAAE,uBAAe,EAAE,aAAa,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/util/Permissions.d.ts b/dist/util/Permissions.d.ts
index 1cedf036..19135666 100644
--- a/dist/util/Permissions.d.ts
+++ b/dist/util/Permissions.d.ts
@@ -48,8 +48,8 @@ export declare class Permissions extends BitField {
static rolePermission(roles: Role[]): bigint;
static finalPermission({ user, guild, channel, }: {
user: {
- id: bigint;
- roles: bigint[];
+ id: string;
+ roles: string[];
};
guild: {
roles: Role[];
@@ -59,7 +59,7 @@ export declare class Permissions extends BitField {
};
}): bigint;
}
-export declare function getPermission(user_id: bigint, guild_id: bigint, channel_id?: bigint, cache?: {
+export declare function getPermission(user_id: string, guild_id: string, channel_id?: string, cache?: {
channel?: ChannelDocument | null;
member?: MemberDocument | null;
}): Promise;
diff --git a/src/models/Activity.ts b/src/models/Activity.ts
index bf77856f..340590c4 100644
--- a/src/models/Activity.ts
+++ b/src/models/Activity.ts
@@ -4,7 +4,7 @@ import { Schema, model, Types, Document } from "mongoose";
export interface Presence {
user: User;
- guild_id?: bigint;
+ guild_id?: string;
status: Status;
activities: Activity[];
client_status: ClientStatus;
@@ -19,12 +19,12 @@ export interface Activity {
start?: number;
end?: number;
}[];
- application_id?: bigint;
+ application_id?: string;
details?: string;
state?: string;
emoji?: {
name: string;
- id?: bigint;
+ id?: string;
amimated?: boolean;
};
party?: {
@@ -57,12 +57,12 @@ export const Activity = {
$end: Number,
},
],
- $application_id: Types.Long,
+ $application_id: String,
$details: String,
$state: String,
$emoji: {
$name: String,
- $id: Types.Long,
+ $id: String,
$amimated: Boolean,
},
$party: {
diff --git a/src/models/Application.ts b/src/models/Application.ts
index ea443dc9..4c519ff2 100644
--- a/src/models/Application.ts
+++ b/src/models/Application.ts
@@ -1,6 +1,6 @@
export interface ApplicationCommand {
- id: bigint;
- application_id: bigint;
+ id: string;
+ application_id: string;
name: string;
description: string;
options?: ApplicationCommandOption[];
@@ -32,7 +32,7 @@ export enum ApplicationCommandOptionType {
}
export interface ApplicationCommandInteractionData {
- id: bigint;
+ id: string;
name: string;
options?: ApplicationCommandInteractionDataOption[];
}
diff --git a/src/models/AuditLog.ts b/src/models/AuditLog.ts
index a0f91a82..c1f83c13 100644
--- a/src/models/AuditLog.ts
+++ b/src/models/AuditLog.ts
@@ -11,17 +11,17 @@ export interface AuditLogResponse {
}
export interface AuditLogEntries {
- target_id?: bigint;
- user_id: bigint;
- id: bigint;
+ target_id?: string;
+ user_id: string;
+ id: string;
action_type: AuditLogEvents;
options?: {
delete_member_days?: string;
members_removed?: string;
- channel_id?: bigint;
- messaged_id?: bigint;
+ channel_id?: string;
+ messaged_id?: string;
count?: string;
- id?: bigint;
+ id?: string;
type?: string;
role_name?: string;
};
@@ -42,13 +42,13 @@ export interface AuditLogChangeValue {
splash_hash?: string;
discovery_splash_hash?: string;
banner_hash?: string;
- owner_id?: bigint;
+ owner_id?: string;
region?: string;
preferred_locale?: string;
- afk_channel_id?: bigint;
+ afk_channel_id?: string;
afk_timeout?: number;
- rules_channel_id?: bigint;
- public_updates_channel_id?: bigint;
+ rules_channel_id?: string;
+ public_updates_channel_id?: string;
mfa_level?: number;
verification_level?: number;
explicit_content_filter?: number;
@@ -58,14 +58,14 @@ export interface AuditLogChangeValue {
$remove?: {}[];
prune_delete_days?: number;
widget_enabled?: boolean;
- widget_channel_id?: bigint;
- system_channel_id?: bigint;
+ widget_channel_id?: string;
+ system_channel_id?: string;
position?: number;
topic?: string;
bitrate?: number;
permission_overwrites?: ChannelPermissionOverwrite[];
nsfw?: boolean;
- application_id?: bigint;
+ application_id?: string;
rate_limit_per_user?: number;
permissions?: string;
color?: number;
@@ -74,8 +74,8 @@ export interface AuditLogChangeValue {
allow?: string;
deny?: string;
code?: string;
- channel_id?: bigint;
- inviter_id?: bigint;
+ channel_id?: string;
+ inviter_id?: string;
max_uses?: number;
uses?: number;
max_age?: number;
@@ -84,7 +84,7 @@ export interface AuditLogChangeValue {
mute?: boolean;
nick?: string;
avatar_hash?: string;
- id?: bigint;
+ id?: string;
type?: number;
enable_emoticons?: boolean;
expire_behavior?: number;
@@ -93,7 +93,7 @@ export interface AuditLogChangeValue {
}
export interface AuditLogEntriesDocument extends Document, AuditLogEntries {
- id: bigint;
+ id: string;
}
export const AuditLogChanges = {
@@ -103,13 +103,13 @@ export const AuditLogChanges = {
splash_hash: String,
discovery_splash_hash: String,
banner_hash: String,
- owner_id: Types.Long,
+ owner_id: String,
region: String,
preferred_locale: String,
- afk_channel_id: Types.Long,
+ afk_channel_id: String,
afk_timeout: Number,
- rules_channel_id: Types.Long,
- public_updates_channel_id: Types.Long,
+ rules_channel_id: String,
+ public_updates_channel_id: String,
mfa_level: Number,
verification_level: Number,
explicit_content_filter: Number,
@@ -119,14 +119,14 @@ export const AuditLogChanges = {
$remove: [{}],
prune_delete_days: Number,
widget_enabled: Boolean,
- widget_channel_id: Types.Long,
- system_channel_id: Types.Long,
+ widget_channel_id: String,
+ system_channel_id: String,
position: Number,
topic: String,
bitrate: Number,
permission_overwrites: [{}],
nsfw: Boolean,
- application_id: Types.Long,
+ application_id: String,
rate_limit_per_user: Number,
permissions: String,
color: Number,
@@ -135,8 +135,8 @@ export const AuditLogChanges = {
allow: String,
deny: String,
code: String,
- channel_id: Types.Long,
- inviter_id: Types.Long,
+ channel_id: String,
+ inviter_id: String,
max_uses: Number,
uses: Number,
max_age: Number,
@@ -145,7 +145,7 @@ export const AuditLogChanges = {
mute: Boolean,
nick: String,
avatar_hash: String,
- id: Types.Long,
+ id: String,
type: Number,
enable_emoticons: Boolean,
expire_behavior: Number,
@@ -154,17 +154,17 @@ export const AuditLogChanges = {
};
export const AuditLogSchema = new Schema({
- target_id: Types.Long,
- user_id: { type: Types.Long, required: true },
- id: { type: Types.Long, required: true },
+ target_id: String,
+ user_id: { type: String, required: true },
+ id: { type: String, required: true },
action_type: { type: Number, required: true },
options: {
delete_member_days: String,
members_removed: String,
- channel_id: Types.Long,
- messaged_id: Types.Long,
+ channel_id: String,
+ messaged_id: String,
count: String,
- id: Types.Long,
+ id: String,
type: String,
role_name: String,
},
diff --git a/src/models/Ban.ts b/src/models/Ban.ts
index 8fc3b124..27893029 100644
--- a/src/models/Ban.ts
+++ b/src/models/Ban.ts
@@ -2,17 +2,17 @@ import { Schema, model, Types, Document } from "mongoose";
import db from "../util/Database";
export interface Ban extends Document {
- user_id: bigint;
- guild_id: bigint;
- executor_id: bigint;
+ user_id: string;
+ guild_id: string;
+ executor_id: string;
ip: string;
reason?: string;
}
export const BanSchema = new Schema({
- user_id: { type: Types.Long, required: true },
- guild_id: { type: Types.Long, required: true },
- executor_id: { type: Types.Long, required: true },
+ user_id: { type: String, required: true },
+ guild_id: { type: String, required: true },
+ executor_id: { type: String, required: true },
reason: String,
ip: String, // ? Should we store this in here, or in the UserModel?
});
diff --git a/src/models/Channel.ts b/src/models/Channel.ts
index bf03c939..82ad2999 100644
--- a/src/models/Channel.ts
+++ b/src/models/Channel.ts
@@ -4,20 +4,20 @@ import db from "../util/Database";
export interface AnyChannel extends Channel, DMChannel, TextChannel, VoiceChannel {}
export interface ChannelDocument extends Document, AnyChannel {
- id: bigint;
+ id: string;
}
export const ChannelSchema = new Schema({
- id: Types.Long,
+ id: String,
created_at: { type: Schema.Types.Date, required: true },
name: { type: String, required: true },
type: { type: Number, required: true },
- guild_id: Types.Long,
- owner_id: Types.Long,
- parent_id: Types.Long,
- recipients: [Types.Long],
+ guild_id: String,
+ owner_id: String,
+ parent_id: String,
+ recipients: [String],
position: Number,
- last_message_id: Types.Long,
+ last_message_id: String,
last_pin_timestamp: Date,
nsfw: Boolean,
rate_limit_per_user: Number,
@@ -26,7 +26,7 @@ export const ChannelSchema = new Schema({
{
allow: Types.Long,
deny: Types.Long,
- id: Types.Long,
+ id: String,
type: Number,
},
],
@@ -36,28 +36,28 @@ export const ChannelSchema = new Schema({
export const ChannelModel = db.model("Channel", ChannelSchema, "channels");
export interface Channel {
- id: bigint;
+ id: string;
created_at: Date;
name: string;
type: number;
}
export interface TextBasedChannel {
- last_message_id?: bigint;
+ last_message_id?: string;
last_pin_timestamp?: number;
}
export interface GuildChannel extends Channel {
- guild_id: bigint;
+ guild_id: string;
position: number;
- parent_id?: bigint;
+ parent_id?: string;
permission_overwrites: ChannelPermissionOverwrite[];
}
export interface ChannelPermissionOverwrite {
- allow: bigint;
- deny: bigint;
- id: bigint;
+ allow: bigint; // for bitfields we use bigints
+ deny: bigint; // for bitfields we use bigints
+ id: string;
type: ChannelPermissionOverwriteType;
}
@@ -75,8 +75,8 @@ export interface TextChannel extends GuildChannel, TextBasedChannel {
}
export interface DMChannel extends Channel, TextBasedChannel {
- owner_id: bigint;
- recipients: bigint[];
+ owner_id: string;
+ recipients: string[];
}
export enum ChannelType {
diff --git a/src/models/Emoji.ts b/src/models/Emoji.ts
index 530c2cc7..3e5cad53 100644
--- a/src/models/Emoji.ts
+++ b/src/models/Emoji.ts
@@ -2,27 +2,27 @@ import { Schema, model, Types, Document } from "mongoose";
import db from "../util/Database";
export interface Emoji extends Document {
- id: bigint;
+ id: string;
animated: boolean;
available: boolean;
- guild_id: bigint;
+ guild_id: string;
managed: boolean;
name: string;
require_colons: boolean;
url: string;
- roles: bigint[]; // roles this emoji is whitelisted to
+ roles: string[]; // roles this emoji is whitelisted to (new discord feature?)
}
export const EmojiSchema = new Schema({
- id: { type: Types.Long, required: true },
+ id: { type: String, required: true },
animated: Boolean,
available: Boolean,
- guild_id: Types.Long,
+ guild_id: String,
managed: Boolean,
name: String,
require_colons: Boolean,
url: String,
- roles: [Types.Long],
+ roles: [String],
});
// @ts-ignore
diff --git a/src/models/Event.ts b/src/models/Event.ts
index 97da98c0..9a5b5283 100644
--- a/src/models/Event.ts
+++ b/src/models/Event.ts
@@ -14,9 +14,9 @@ import { Schema, model, Types, Document } from "mongoose";
import db from "../util/Database";
export interface Event {
- guild_id?: bigint;
- user_id?: bigint;
- channel_id?: bigint;
+ guild_id?: string;
+ user_id?: string;
+ channel_id?: string;
created_at?: Date;
event: EVENT;
data?: any;
@@ -25,9 +25,9 @@ export interface Event {
export interface EventDocument extends Event, Document {}
export const EventSchema = new Schema({
- guild_id: Types.Long,
- user_id: Types.Long,
- channel_id: Types.Long,
+ guild_id: String,
+ user_id: String,
+ channel_id: String,
created_at: { type: Date, required: true },
event: { type: String, required: true },
data: Object,
@@ -98,7 +98,7 @@ export interface ReadyEventData {
partial: boolean;
};
application?: {
- id: bigint;
+ id: string;
flags: bigint;
};
merged_members?: Omit[][];
@@ -106,7 +106,7 @@ export interface ReadyEventData {
users?: {
avatar?: string;
discriminator: string;
- id: bigint;
+ id: string;
username: string;
bot: boolean;
public_flags: bigint;
@@ -136,8 +136,8 @@ export interface ChannelDeleteEvent extends Event {
export interface ChannelPinsUpdateEvent extends Event {
event: "CHANNEL_PINS_UPDATE";
data: {
- guild_id?: bigint;
- channel_id: bigint;
+ guild_id?: string;
+ channel_id: string;
last_pin_timestamp: number;
};
}
@@ -155,7 +155,7 @@ export interface GuildUpdateEvent extends Event {
export interface GuildDeleteEvent extends Event {
event: "GUILD_DELETE";
data: {
- id: bigint;
+ id: string;
unavailable?: boolean;
};
}
@@ -163,7 +163,7 @@ export interface GuildDeleteEvent extends Event {
export interface GuildBanAddEvent extends Event {
event: "GUILD_BAN_ADD";
data: {
- guild_id: bigint;
+ guild_id: string;
user: User;
};
}
@@ -171,7 +171,7 @@ export interface GuildBanAddEvent extends Event {
export interface GuildBanRemoveEvent extends Event {
event: "GUILD_BAN_REMOVE";
data: {
- guild_id: bigint;
+ guild_id: string;
user: User;
};
}
@@ -179,7 +179,7 @@ export interface GuildBanRemoveEvent extends Event {
export interface GuildEmojiUpdateEvent extends Event {
event: "GUILD_EMOJI_UPDATE";
data: {
- guild_id: bigint;
+ guild_id: string;
emojis: Emoji[];
};
}
@@ -187,21 +187,21 @@ export interface GuildEmojiUpdateEvent extends Event {
export interface GuildIntegrationUpdateEvent extends Event {
event: "GUILD_INTEGRATIONS_UPDATE";
data: {
- guild_id: bigint;
+ guild_id: string;
};
}
export interface GuildMemberAddEvent extends Event {
event: "GUILD_MEMBER_ADD";
data: PublicMember & {
- guild_id: bigint;
+ guild_id: string;
};
}
export interface GuildMemberRemoveEvent extends Event {
event: "GUILD_MEMBER_REMOVE";
data: {
- guild_id: bigint;
+ guild_id: string;
user: User;
};
}
@@ -209,8 +209,8 @@ export interface GuildMemberRemoveEvent extends Event {
export interface GuildMemberUpdateEvent extends Event {
event: "GUILD_MEMBER_UPDATE";
data: {
- guild_id: bigint;
- roles: bigint[];
+ guild_id: string;
+ roles: string[];
user: User;
nick?: string;
joined_at: Date;
@@ -222,11 +222,11 @@ export interface GuildMemberUpdateEvent extends Event {
export interface GuildMembersChunkEvent extends Event {
event: "GUILD_MEMBERS_CHUNK";
data: {
- guild_id: bigint;
+ guild_id: string;
members: PublicMember[];
chunk_index: number;
chunk_count: number;
- not_found: bigint[];
+ not_found: string[];
presences: Presence[];
nonce?: string;
};
@@ -235,7 +235,7 @@ export interface GuildMembersChunkEvent extends Event {
export interface GuildRoleCreateEvent extends Event {
event: "GUILD_ROLE_CREATE";
data: {
- guild_id: bigint;
+ guild_id: string;
role: Role;
};
}
@@ -243,7 +243,7 @@ export interface GuildRoleCreateEvent extends Event {
export interface GuildRoleUpdateEvent extends Event {
event: "GUILD_ROLE_UPDATE";
data: {
- guild_id: bigint;
+ guild_id: string;
role: Role;
};
}
@@ -251,31 +251,31 @@ export interface GuildRoleUpdateEvent extends Event {
export interface GuildRoleDeleteEvent extends Event {
event: "GUILD_ROLE_DELETE";
data: {
- guild_id: bigint;
- role_id: bigint;
+ guild_id: string;
+ role_id: string;
};
}
export interface InviteCreateEvent extends Event {
event: "INVITE_CREATE";
data: Omit & {
- channel_id: bigint;
- guild_id?: bigint;
+ channel_id: string;
+ guild_id?: string;
};
}
export interface InviteDeleteEvent extends Event {
event: "INVITE_DELETE";
data: {
- channel_id: bigint;
- guild_id?: bigint;
+ channel_id: string;
+ guild_id?: string;
code: string;
};
}
export type MessagePayload = Omit & {
- channel_id: bigint;
- guild_id?: bigint;
+ channel_id: string;
+ guild_id?: string;
author: User;
member: PublicMember;
mentions: (User & { member: PublicMember })[];
@@ -294,28 +294,28 @@ export interface MessageUpdateEvent extends Event {
export interface MessageDeleteEvent extends Event {
event: "MESSAGE_DELETE";
data: {
- id: bigint;
- channel_id: bigint;
- guild_id?: bigint;
+ id: string;
+ channel_id: string;
+ guild_id?: string;
};
}
export interface MessageDeleteBulkEvent extends Event {
event: "MESSAGE_DELETE_BULK";
data: {
- ids: bigint[];
- channel_id: bigint;
- guild_id?: bigint;
+ ids: string[];
+ channel_id: string;
+ guild_id?: string;
};
}
export interface MessageReactionAddEvent extends Event {
event: "MESSAGE_REACTION_ADD";
data: {
- user_id: bigint;
- channel_id: bigint;
- message_id: bigint;
- guild_id?: bigint;
+ user_id: string;
+ channel_id: string;
+ message_id: string;
+ guild_id?: string;
member?: PublicMember;
emoji: PartialEmoji;
};
@@ -324,10 +324,10 @@ export interface MessageReactionAddEvent extends Event {
export interface MessageReactionRemoveEvent extends Event {
event: "MESSAGE_REACTION_REMOVE";
data: {
- user_id: bigint;
- channel_id: bigint;
- message_id: bigint;
- guild_id?: bigint;
+ user_id: string;
+ channel_id: string;
+ message_id: string;
+ guild_id?: string;
emoji: PartialEmoji;
};
}
@@ -335,18 +335,18 @@ export interface MessageReactionRemoveEvent extends Event {
export interface MessageReactionRemoveAllEvent extends Event {
event: "MESSAGE_REACTION_REMOVE_ALL";
data: {
- channel_id: bigint;
- message_id: bigint;
- guild_id?: bigint;
+ channel_id: string;
+ message_id: string;
+ guild_id?: string;
};
}
export interface MessageReactionRemoveEmojiEvent extends Event {
event: "MESSAGE_REACTION_REMOVE_EMOJI";
data: {
- channel_id: bigint;
- message_id: bigint;
- guild_id?: bigint;
+ channel_id: string;
+ message_id: string;
+ guild_id?: string;
emoji: PartialEmoji;
};
}
@@ -359,10 +359,10 @@ export interface PresenceUpdateEvent extends Event {
export interface TypingStartEvent extends Event {
event: "TYPING_START";
data: {
- channel_id: bigint;
- user_id: bigint;
+ channel_id: string;
+ user_id: string;
timestamp: number;
- guild_id?: bigint;
+ guild_id?: string;
member?: PublicMember;
};
}
@@ -383,7 +383,7 @@ export interface VoiceServerUpdateEvent extends Event {
event: "VOICE_SERVER_UPDATE";
data: {
token: string;
- guild_id: bigint;
+ guild_id: string;
endpoint: string;
};
}
@@ -391,13 +391,13 @@ export interface VoiceServerUpdateEvent extends Event {
export interface WebhooksUpdateEvent extends Event {
event: "WEBHOOKS_UPDATE";
data: {
- guild_id: bigint;
- channel_id: bigint;
+ guild_id: string;
+ channel_id: string;
};
}
export type ApplicationCommandPayload = ApplicationCommand & {
- guild_id: bigint;
+ guild_id: string;
};
export interface ApplicationCommandCreateEvent extends Event {
diff --git a/src/models/Guild.ts b/src/models/Guild.ts
index a92a60cf..d3f098ea 100644
--- a/src/models/Guild.ts
+++ b/src/models/Guild.ts
@@ -6,14 +6,14 @@ import { MemberModel } from "./Member";
import { RoleModel } from "./Role";
export interface GuildDocument extends Document, Guild {
- id: bigint;
+ id: string;
}
export interface Guild {
- id: bigint;
- afk_channel_id?: bigint;
+ id: string;
+ afk_channel_id?: string;
afk_timeout?: number;
- application_id?: bigint;
+ application_id?: string;
banner?: string;
default_message_notifications?: number;
description?: string;
@@ -34,29 +34,29 @@ export interface Guild {
// voice_states: []; // * voice_states are stored in a seperate collection
mfa_level?: number;
name: string;
- owner_id: bigint;
+ owner_id: string;
preferred_locale?: string; // only community guilds can choose this
premium_subscription_count?: number;
premium_tier?: number; // nitro boost level
- public_updates_channel_id?: bigint;
+ public_updates_channel_id?: string;
region?: string;
- rules_channel_id?: bigint;
+ rules_channel_id?: string;
splash?: string;
system_channel_flags?: number;
- system_channel_id?: bigint;
+ system_channel_id?: string;
unavailable?: boolean;
vanity_url_code?: string;
verification_level?: number;
welcome_screen: []; // welcome splash screen if a user joins guild
- widget_channel_id?: bigint;
+ widget_channel_id?: string;
widget_enabled?: boolean;
}
export const GuildSchema = new Schema({
- id: { type: Types.Long, required: true },
- afk_channel_id: Types.Long,
+ id: { type: String, required: true },
+ afk_channel_id: String,
afk_timeout: Number,
- application_id: Types.Long,
+ application_id: String,
banner: String,
default_message_notifications: Number,
description: String,
@@ -72,22 +72,22 @@ export const GuildSchema = new Schema({
presence_count: Number,
mfa_level: Number,
name: { type: String, required: true },
- owner_id: { type: Types.Long, required: true },
+ owner_id: { type: String, required: true },
preferred_locale: String,
premium_subscription_count: Number,
premium_tier: Number,
- public_updates_channel_id: Types.Long,
+ public_updates_channel_id: String,
region: String,
- rules_channel_id: Types.Long,
+ rules_channel_id: String,
splash: String,
system_channel_flags: Number,
- system_channel_id: Types.Long,
+ system_channel_id: String,
unavailable: Boolean,
vanity_url_code: String,
verification_level: Number,
voice_states: { type: [Object], default: [] },
welcome_screen: { type: [Object], default: [] },
- widget_channel_id: Types.Long,
+ widget_channel_id: String,
widget_enabled: Boolean,
});
diff --git a/src/models/Interaction.ts b/src/models/Interaction.ts
index 6f36c14a..764247a5 100644
--- a/src/models/Interaction.ts
+++ b/src/models/Interaction.ts
@@ -1,12 +1,12 @@
import { AllowedMentions, Embed } from "./Message";
export interface Interaction {
- id: bigint;
+ id: string;
type: InteractionType;
data?: {};
- guild_id: bigint;
- channel_id: bigint;
- member_id: bigint;
+ guild_id: string;
+ channel_id: string;
+ member_id: string;
token: string;
version: number;
}
diff --git a/src/models/Invite.ts b/src/models/Invite.ts
index fc60b93c..590a4598 100644
--- a/src/models/Invite.ts
+++ b/src/models/Invite.ts
@@ -8,14 +8,13 @@ export interface Invite extends Document {
max_uses: number;
max_age: number;
created_at: Date;
- guild_id: bigint;
- channel_id: bigint;
- inviter_id: bigint;
+ guild_id: string;
+ channel_id: string;
+ inviter_id: string;
- //! What the fucking shit is this
- target_user_id?: bigint;
+ // ? What the fucking shit is this
+ target_user_id?: string;
target_user_type?: number;
- // !
}
export const InviteSchema = new Schema({
@@ -25,14 +24,13 @@ export const InviteSchema = new Schema({
max_uses: Number,
max_age: Number,
created_at: Date,
- guild_id: Types.Long,
- channel_id: Types.Long,
- inviter_id: Types.Long,
+ guild_id: String,
+ channel_id: String,
+ inviter_id: String,
- //! What the fucking shit is this
- target_user_id: Types.Long,
+ // ? What the fucking shit is this
+ target_user_id: String,
target_user_type: Number,
- // !
});
// @ts-ignore
diff --git a/src/models/Member.ts b/src/models/Member.ts
index 145b5df4..fc9d5b99 100644
--- a/src/models/Member.ts
+++ b/src/models/Member.ts
@@ -3,10 +3,10 @@ import { Schema, Types, Document } from "mongoose";
import db from "../util/Database";
export interface Member {
- id: bigint;
- guild_id: bigint;
+ id: string;
+ guild_id: string;
nick?: string;
- roles: bigint[];
+ roles: string[];
joined_at: Date;
premium_since?: number;
deaf: boolean;
@@ -17,12 +17,12 @@ export interface Member {
}
export interface MemberDocument extends Member, Document {
- id: bigint;
+ id: string;
}
export interface UserGuildSettings {
channel_overrides: {
- channel_id: bigint;
+ channel_id: string;
message_notifications: number;
mute_config: MuteConfig;
muted: boolean;
@@ -47,10 +47,10 @@ const MuteConfig = {
};
export const MemberSchema = new Schema({
- id: { type: Types.Long, required: true },
- guild_id: Types.Long,
+ id: { type: String, required: true },
+ guild_id: String,
nick: String,
- roles: [Types.Long],
+ roles: [String],
joined_at: Date,
premium_since: Number,
deaf: Boolean,
@@ -59,7 +59,7 @@ export const MemberSchema = new Schema({
settings: {
channel_overrides: [
{
- channel_id: Types.Long,
+ channel_id: String,
message_notifications: Number,
mute_config: MuteConfig,
muted: Boolean,
diff --git a/src/models/Message.ts b/src/models/Message.ts
index e80ec1f8..4adf8024 100644
--- a/src/models/Message.ts
+++ b/src/models/Message.ts
@@ -5,20 +5,20 @@ import { MemberModel } from "./Member";
import { RoleModel } from "./Role";
export interface Message {
- id: bigint;
- channel_id: bigint;
- guild_id?: bigint;
- author_id?: bigint;
- webhook_id?: bigint;
- application_id?: bigint;
+ id: string;
+ channel_id: string;
+ guild_id?: string;
+ author_id?: string;
+ webhook_id?: string;
+ application_id?: string;
content?: string;
timestamp: Date;
edited_timestamp?: Date;
tts?: boolean;
mention_everyone?: boolean;
- mention_user_ids: bigint[];
- mention_role_ids: bigint[];
- mention_channels_ids: bigint[];
+ mention_user_ids: string[];
+ mention_role_ids: string[];
+ mention_channels_ids: string[];
attachments: Attachment[];
embeds: Embed[];
reactions: Reaction[];
@@ -32,14 +32,14 @@ export interface Message {
flags?: bigint;
stickers?: [];
message_reference?: {
- message_id: bigint;
- channel_id?: bigint;
- guild_id?: bigint;
+ message_id: string;
+ channel_id?: string;
+ guild_id?: string;
};
}
export interface MessageDocument extends Document, Message {
- id: bigint;
+ id: string;
}
export enum MessageType {
@@ -63,7 +63,7 @@ export enum MessageType {
}
export interface Attachment {
- id: bigint; // attachment id
+ id: string; // attachment id
filename: string; // name of file attached
size: number; // size of file in bytes
url: string; // source url of file
@@ -118,20 +118,20 @@ export interface Reaction {
}
export interface PartialEmoji {
- id?: bigint;
+ id?: string;
name: string;
animated?: boolean;
}
export interface AllowedMentions {
parse?: ("users" | "roles" | "everyone")[];
- roles?: bigint[];
- users?: bigint[];
+ roles?: string[];
+ users?: string[];
replied_user?: boolean;
}
export const Attachment = {
- id: Types.Long, // attachment id
+ id: String, // attachment id
filename: String, // name of file attached
size: Number, // size of file in bytes
url: String, // source url of file
@@ -150,7 +150,7 @@ export const EmbedImage = {
const Reaction = {
count: Number,
emoji: {
- id: Types.Long,
+ id: String,
name: String,
animated: Boolean,
},
@@ -191,20 +191,20 @@ export const Embed = {
};
export const MessageSchema = new Schema({
- id: Types.Long,
- channel_id: Types.Long,
- author_id: Types.Long,
- webhook_id: Types.Long,
- guild_id: Types.Long,
- application_id: Types.Long,
+ id: String,
+ channel_id: String,
+ author_id: String,
+ webhook_id: String,
+ guild_id: String,
+ application_id: String,
content: String,
timestamp: Date,
edited_timestamp: Date,
tts: Boolean,
mention_everyone: Boolean,
- mention_user_ids: [Types.Long],
- mention_role_ids: [Types.Long],
- mention_channel_ids: [Types.Long],
+ mention_user_ids: [String],
+ mention_role_ids: [String],
+ mention_channel_ids: [String],
attachments: [Attachment],
embeds: [Embed],
reactions: [Reaction],
@@ -218,9 +218,9 @@ export const MessageSchema = new Schema({
flags: Types.Long,
stickers: [],
message_reference: {
- message_id: Types.Long,
- channel_id: Types.Long,
- guild_id: Types.Long,
+ message_id: String,
+ channel_id: String,
+ guild_id: String,
},
});
diff --git a/src/models/Role.ts b/src/models/Role.ts
index fe716593..adb75b0a 100644
--- a/src/models/Role.ts
+++ b/src/models/Role.ts
@@ -2,8 +2,8 @@ import { Schema, model, Types, Document } from "mongoose";
import db from "../util/Database";
export interface Role {
- id: bigint;
- guild_id: bigint;
+ id: string;
+ guild_id: string;
color: number;
hoist: boolean;
managed: boolean;
@@ -12,17 +12,17 @@ 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,
@@ -31,7 +31,7 @@ export const RoleSchema = new Schema({
permissions: Types.Long,
position: Number,
tags: {
- bot_id: Types.Long,
+ bot_id: String,
},
});
diff --git a/src/models/User.ts b/src/models/User.ts
index 9f447d91..7173e9a3 100644
--- a/src/models/User.ts
+++ b/src/models/User.ts
@@ -4,7 +4,7 @@ import { Schema, Types, Document } from "mongoose";
import db from "../util/Database";
export interface User {
- id: bigint;
+ id: string;
username: string; // username max length 32, min 2
discriminator: string; // #0001 4 digit long string from #0001 - #9999
avatar: string | null; // hash of the user avatar
@@ -24,7 +24,7 @@ export interface User {
flags: bigint; // UserFlags
public_flags: bigint;
user_settings: UserSettings;
- guilds: bigint[]; // array of guild ids the user is part of
+ guilds: string[]; // array of guild ids the user is part of
user_data: UserData;
presence: {
status: Status;
@@ -43,11 +43,11 @@ export interface UserData {
}
export interface UserDocument extends User, Document {
- id: bigint;
+ id: string;
}
export interface PublicUser {
- id: bigint;
+ id: string;
discriminator: string;
username: string;
avatar?: string;
@@ -67,10 +67,10 @@ export interface ConnectedAccount {
}
export interface Relationship {
- id: bigint;
+ id: string;
nickname?: string;
type: number;
- user_id: bigint;
+ user_id: string;
}
export interface UserSettings {
@@ -81,7 +81,7 @@ export interface UserSettings {
contact_sync_enabled: boolean;
convert_emoticons: boolean;
custom_status: {
- emoji_id: bigint | null;
+ emoji_id: string | null;
emoji_name: string | null;
expires_at: number | null;
text: string | null;
@@ -98,11 +98,11 @@ export interface UserSettings {
guild_folders: // every top guild is displayed as a "folder"
{
color: number;
- guild_ids: bigint[];
+ guild_ids: string[];
id: number;
name: string;
}[];
- guild_positions: bigint[]; // guild ids ordered by position
+ guild_positions: string[]; // guild ids ordered by position
inline_attachment_media: boolean;
inline_embed_media: boolean;
locale: string; // en_US
@@ -110,7 +110,7 @@ export interface UserSettings {
native_phone_integration_enabled: boolean;
render_embeds: boolean;
render_reactions: boolean;
- restricted_guilds: bigint[];
+ restricted_guilds: string[];
show_current_game: boolean;
status: "online" | "offline" | "dnd" | "idle";
stream_notifications_enabled: boolean;
@@ -119,7 +119,7 @@ export interface UserSettings {
}
export const UserSchema = new Schema({
- id: Types.Long,
+ id: String,
username: String,
discriminator: String,
avatar: String,
@@ -138,17 +138,17 @@ export const UserSchema = new Schema({
email: String,
flags: Types.Long, // TODO: automatically convert Types.Long to BitField of UserFlags
public_flags: Types.Long,
- guilds: [Types.Long], // array of guild ids the user is part of
+ guilds: [String], // array of guild ids the user is part of
user_data: {
fingerprints: [String],
hash: String, // hash of the password, salt is saved in password (bcrypt)
valid_tokens_since: Date, // all tokens with a previous issue date are invalid
relationships: [
{
- id: Types.Long,
+ id: String,
nickname: String,
type: Number,
- user_id: Types.Long,
+ user_id: String,
},
],
connected_accounts: [
@@ -173,7 +173,7 @@ export const UserSchema = new Schema({
contact_sync_enabled: Boolean,
convert_emoticons: Boolean,
custom_status: {
- emoji_id: Types.Long,
+ emoji_id: String,
emoji_name: String,
expires_at: Number,
text: String,
@@ -191,12 +191,12 @@ export const UserSchema = new Schema({
guild_folders: [
{
color: Number,
- guild_ids: [Types.Long],
+ guild_ids: [String],
id: Number,
name: String,
},
],
- guild_positions: [Types.Long], // guild ids ordered by position
+ guild_positions: [String], // guild ids ordered by position
inline_attachment_media: Boolean,
inline_embed_media: Boolean,
locale: String, // en_US
@@ -204,7 +204,7 @@ export const UserSchema = new Schema({
native_phone_integration_enabled: Boolean,
render_embeds: Boolean,
render_reactions: Boolean,
- restricted_guilds: [Types.Long],
+ restricted_guilds: [String],
show_current_game: Boolean,
status: String,
stream_notifications_enabled: Boolean,
diff --git a/src/models/VoiceState.ts b/src/models/VoiceState.ts
index 30439feb..c1f90edd 100644
--- a/src/models/VoiceState.ts
+++ b/src/models/VoiceState.ts
@@ -3,9 +3,9 @@ import { Schema, model, Types, Document } from "mongoose";
import db from "../util/Database";
export interface VoiceState extends Document {
- guild_id?: bigint;
- channel_id: bigint;
- user_id: bigint;
+ guild_id?: string;
+ channel_id: string;
+ user_id: string;
session_id: string;
deaf: boolean;
mute: boolean;
@@ -17,9 +17,9 @@ export interface VoiceState extends Document {
}
export const VoiceSateSchema = new Schema({
- guild_id: Types.Long,
- channel_id: Types.Long,
- user_id: Types.Long,
+ guild_id: String,
+ channel_id: String,
+ user_id: String,
session_id: String,
deaf: Boolean,
mute: Boolean,
diff --git a/src/util/Permissions.ts b/src/util/Permissions.ts
index 809111bf..4bad70d3 100644
--- a/src/util/Permissions.ts
+++ b/src/util/Permissions.ts
@@ -121,7 +121,7 @@ export class Permissions extends BitField {
guild,
channel,
}: {
- user: { id: bigint; roles: bigint[] };
+ user: { id: string; roles: string[] };
guild: { roles: Role[] };
channel?: {
overwrites?: ChannelPermissionOverwrite[];
@@ -144,9 +144,9 @@ export class Permissions extends BitField {
}
export async function getPermission(
- user_id: bigint,
- guild_id: bigint,
- channel_id?: bigint,
+ user_id: string,
+ guild_id: string,
+ channel_id?: string,
cache?: { channel?: ChannelDocument | null; member?: MemberDocument | null }
) {
var { channel, member } = cache || {};
diff --git a/src/util/Snowflake.ts b/src/util/Snowflake.ts
index 9e94bbd9..1ccae43c 100644
--- a/src/util/Snowflake.ts
+++ b/src/util/Snowflake.ts
@@ -87,7 +87,7 @@ export class Snowflake {
var worker = Snowflake.workerId << 17n;
var process = Snowflake.processId << 12n;
var increment = Snowflake.INCREMENT++;
- return time | worker | process | increment;
+ return (time | worker | process | increment).toString();
}
/**
--
cgit 1.5.1
From 41e72689476c639aa686074c9bb22d1cb04a6fc4 Mon Sep 17 00:00:00 2001
From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com>
Date: Tue, 6 Apr 2021 20:24:58 +0200
Subject: :bug: fix Message Model
---
dist/models/Message.js | 8 ++++----
dist/models/Message.js.map | 2 +-
dist/models/User.js | 1 -
dist/models/User.js.map | 2 +-
src/models/Message.ts | 8 ++++----
src/models/User.ts | 1 -
6 files changed, 10 insertions(+), 12 deletions(-)
(limited to 'src/models/Message.ts')
diff --git a/dist/models/Message.js b/dist/models/Message.js
index 1adca30c..18bb509d 100644
--- a/dist/models/Message.js
+++ b/dist/models/Message.js
@@ -134,19 +134,19 @@ exports.MessageSchema.virtual("mentions", {
ref: User_1.UserModel,
localField: "mention_user_ids",
foreignField: "id",
- justOne: true,
+ justOne: false,
});
exports.MessageSchema.virtual("mention_roles", {
ref: Role_1.RoleModel,
localField: "mention_role_ids",
foreignField: "id",
- justOne: true,
+ justOne: false,
});
exports.MessageSchema.virtual("mention_channels", {
ref: Role_1.RoleModel,
- localField: "mention_role_ids",
+ localField: "mention_channel_ids",
foreignField: "id",
- justOne: true,
+ justOne: false,
});
// TODO: missing Application Model
// MessageSchema.virtual("application", {
diff --git a/dist/models/Message.js.map b/dist/models/Message.js.map
index e4387a0e..2e617b31 100644
--- a/dist/models/Message.js.map
+++ b/dist/models/Message.js.map
@@ -1 +1 @@
-{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../src/models/Message.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAmD;AACnD,gEAAkC;AAClC,iCAAmC;AACnC,qCAAuC;AACvC,iCAAmC;AAwCnC,IAAY,WAkBX;AAlBD,WAAY,WAAW;IACtB,mDAAW,CAAA;IACX,+DAAiB,CAAA;IACjB,qEAAoB,CAAA;IACpB,6CAAQ,CAAA;IACR,2EAAuB,CAAA;IACvB,2EAAuB,CAAA;IACvB,iFAA0B,CAAA;IAC1B,uEAAqB,CAAA;I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,QAAQ,EAAE;IAC/B,GAAG,EAAE,oBAAW;IAChB,UAAU,EAAE,WAAW;IACvB,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,qBAAa,CAAC,OAAO,CAAC,UAAU,EAAE;IACjC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,qBAAa,CAAC,OAAO,CAAC,eAAe,EAAE;IACtC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,qBAAa,CAAC,OAAO,CAAC,kBAAkB,EAAE;IACzC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,kCAAkC;AAClC,yCAAyC;AACzC,qBAAqB;AACrB,mCAAmC;AACnC,uBAAuB;AACvB,kBAAkB;AAClB,MAAM;AAEN,aAAa;AACA,QAAA,YAAY,GAAG,kBAAE,CAAC,KAAK,CAAkB,SAAS,EAAE,qBAAa,EAAE,UAAU,CAAC,CAAC"}
\ No newline at end of file
+{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../src/models/Message.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAmD;AACnD,gEAAkC;AAClC,iCAAmC;AACnC,qCAAuC;AACvC,iCAAmC;AAwCnC,IAAY,WAkBX;AAlBD,WAAY,WAAW;IACtB,mDAAW,CAAA;IACX,+DAAiB,CAAA;IACjB,qEAAoB,CAAA;IACpB,6CAAQ,CAAA;IACR,2EAAuB,CAAA;IACvB,2EAAuB,CAAA;IACvB,iFAA0B,CAAA;IAC1B,uEAAqB,CAAA;IACrB,mGAAmC,CAAA;IACnC,iHAA0C,CAAA;IAC1C,kHAA2C,C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E,WAAW;IACvB,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,qBAAa,CAAC,OAAO,CAAC,UAAU,EAAE;IACjC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,KAAK;CACd,CAAC,CAAC;AAEH,qBAAa,CAAC,OAAO,CAAC,eAAe,EAAE;IACtC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,KAAK;CACd,CAAC,CAAC;AAEH,qBAAa,CAAC,OAAO,CAAC,kBAAkB,EAAE;IACzC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,qBAAqB;IACjC,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,KAAK;CACd,CAAC,CAAC;AAEH,kCAAkC;AAClC,yCAAyC;AACzC,qBAAqB;AACrB,mCAAmC;AACnC,uBAAuB;AACvB,kBAAkB;AAClB,MAAM;AAEN,aAAa;AACA,QAAA,YAAY,GAAG,kBAAE,CAAC,KAAK,CAAkB,SAAS,EAAE,qBAAa,EAAE,UAAU,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/models/User.js b/dist/models/User.js
index 3ba04503..e8caec6a 100644
--- a/dist/models/User.js
+++ b/dist/models/User.js
@@ -17,7 +17,6 @@ exports.UserSchema = new mongoose_1.Schema({
desktop: Boolean,
mobile: Boolean,
premium: Boolean,
- date_of_birth: Date,
premium_type: Number,
bot: Boolean,
system: Boolean,
diff --git a/dist/models/User.js.map b/dist/models/User.js.map
index a13c6c39..fa26f77a 100644
--- a/dist/models/User.js.map
+++ b/dist/models/User.js.map
@@ -1 +1 @@
-{"version":3,"file":"User.js","sourceRoot":"","sources":["../../src/models/User.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAsC;AACtC,qCAAgD;AAChD,uCAAmD;AACnD,gEAAkC;AAoHrB,QAAA,U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AAE;YACd,QAAQ,EAAE,MAAM;YAChB,UAAU,EAAE,MAAM;YAClB,UAAU,EAAE,MAAM;YAClB,IAAI,EAAE,MAAM;SACZ;QACD,yBAAyB,EAAE,OAAO;QAClC,wBAAwB,EAAE,OAAO;QACjC,cAAc,EAAE,OAAO;QACvB,iBAAiB,EAAE,OAAO;QAC1B,kBAAkB,EAAE,OAAO;QAC3B,uBAAuB,EAAE,MAAM;QAC/B,mBAAmB,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE;QACrC,iBAAiB,EAAE,OAAO;QAC1B,aAAa,EAAE,OAAO;QACtB,6CAA6C;QAC7C,aAAa,EAAE;YACd;gBACC,KAAK,EAAE,MAAM;gBACb,SAAS,EAAE,CAAC,MAAM,CAAC;gBACnB,EAAE,EAAE,MAAM;gBACV,IAAI,EAAE,MAAM;aACZ;SACD;QACD,eAAe,EAAE,CAAC,MAAM,CAAC;QACzB,uBAAuB,EAAE,OAAO;QAChC,kBAAkB,EAAE,OAAO;QAC3B,MAAM,EAAE,MAAM;QACd,uBAAuB,EAAE,OAAO;QAChC,gCAAgC,EAAE,OAAO;QACzC,aAAa,EAAE,OAAO;QACtB,gBAAgB,EAAE,OAAO;QACzB,iBAAiB,EAAE,CAAC,MAAM,CAAC;QAC3B,iBAAiB,EAAE,OAAO;QAC1B,MAAM,EAAE,MAAM;QACd,4BAA4B,EAAE,OAAO;QACrC,KAAK,EAAE,MAAM;QACb,eAAe,EAAE,MAAM;KACvB;IAED,QAAQ,EAAE;QACT,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,CAAC,mBAAQ,CAAC;QACtB,aAAa,EAAE,qBAAY;KAC3B;CACD,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,SAAS,GAAG,kBAAE,CAAC,KAAK,CAAe,MAAM,EAAE,kBAAU,EAAE,OAAO,CAAC,CAAC"}
\ No newline at end of file
+{"version":3,"file":"User.js","sourceRoot":"","sources":["../../src/models/User.ts"],"names":[],"mappings":";;;;;;AAAA,y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index 4adf8024..bb3c2d5b 100644
--- a/src/models/Message.ts
+++ b/src/models/Message.ts
@@ -242,21 +242,21 @@ MessageSchema.virtual("mentions", {
ref: UserModel,
localField: "mention_user_ids",
foreignField: "id",
- justOne: true,
+ justOne: false,
});
MessageSchema.virtual("mention_roles", {
ref: RoleModel,
localField: "mention_role_ids",
foreignField: "id",
- justOne: true,
+ justOne: false,
});
MessageSchema.virtual("mention_channels", {
ref: RoleModel,
- localField: "mention_role_ids",
+ localField: "mention_channel_ids",
foreignField: "id",
- justOne: true,
+ justOne: false,
});
// TODO: missing Application Model
diff --git a/src/models/User.ts b/src/models/User.ts
index 1ea55f6a..76251e09 100644
--- a/src/models/User.ts
+++ b/src/models/User.ts
@@ -126,7 +126,6 @@ export const UserSchema = new Schema({
desktop: Boolean,
mobile: Boolean,
premium: Boolean,
- date_of_birth: Date,
premium_type: Number,
bot: Boolean,
system: Boolean,
--
cgit 1.5.1
From 7d9cc0efbf536bcf9bf596360bd8a12652d85b95 Mon Sep 17 00:00:00 2001
From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com>
Date: Tue, 6 Apr 2021 22:06:53 +0200
Subject: :art: remove _id and __v from response
---
dist/index.d.ts | 24 ++--------------
dist/index.js | 24 ++--------------
dist/index.js.map | 2 +-
dist/models/Message.js | 8 ++++++
dist/models/Message.js.map | 2 +-
dist/models/index.d.ts | 15 ++++++++++
dist/models/index.js | 42 +++++++++++++++++++++++++++
dist/models/index.js.map | 1 +
dist/util/index.d.ts | 7 +++++
dist/util/index.js | 20 +++++++++++++
dist/util/index.js.map | 1 +
src/index.ts | 25 ++--------------
src/models/Message.ts | 71 ++++++++++++++++++++++++++--------------------
src/models/index.ts | 28 ++++++++++++++++++
src/util/index.ts | 7 +++++
15 files changed, 178 insertions(+), 99 deletions(-)
create mode 100644 dist/models/index.d.ts
create mode 100644 dist/models/index.js
create mode 100644 dist/models/index.js.map
create mode 100644 dist/util/index.d.ts
create mode 100644 dist/util/index.js
create mode 100644 dist/util/index.js.map
create mode 100644 src/models/index.ts
create mode 100644 src/util/index.ts
(limited to 'src/models/Message.ts')
diff --git a/dist/index.d.ts b/dist/index.d.ts
index df0761b1..4bf16a66 100644
--- a/dist/index.d.ts
+++ b/dist/index.d.ts
@@ -1,27 +1,7 @@
export * from "./util/checkToken";
export * as Constants from "./util/Constants";
-export * from "./models/Ban";
-export * from "./models/Channel";
-export * from "./models/Emoji";
-export * from "./models/Guild";
-export * from "./models/Invite";
-export * from "./models/Member";
-export * from "./models/Role";
-export * from "./models/User";
-export * from "./models/Activity";
-export * from "./models/Application";
-export * from "./models/Interaction";
-export * from "./models/Message";
-export * from "./models/Status";
-export * from "./models/VoiceState";
-export * from "./util/String";
-export * from "./util/BitField";
-export * from "./util/Intents";
-export * from "./util/MessageFlags";
-export * from "./util/Permissions";
-export * from "./util/Snowflake";
-export * from "./util/UserFlags";
-export * from "./models/Event";
+export * from "./models/index";
+export * from "./util/index";
import Config, { DefaultOptions } from "./util/Config";
import db, { MongooseCache } from "./util/Database";
export { Config, db, DefaultOptions, MongooseCache };
diff --git a/dist/index.js b/dist/index.js
index 99f66d3d..29b12d98 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -25,28 +25,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.MongooseCache = exports.DefaultOptions = exports.db = exports.Config = exports.Constants = void 0;
__exportStar(require("./util/checkToken"), exports);
exports.Constants = __importStar(require("./util/Constants"));
-__exportStar(require("./models/Ban"), exports);
-__exportStar(require("./models/Channel"), exports);
-__exportStar(require("./models/Emoji"), exports);
-__exportStar(require("./models/Guild"), exports);
-__exportStar(require("./models/Invite"), exports);
-__exportStar(require("./models/Member"), exports);
-__exportStar(require("./models/Role"), exports);
-__exportStar(require("./models/User"), exports);
-__exportStar(require("./models/Activity"), exports);
-__exportStar(require("./models/Application"), exports);
-__exportStar(require("./models/Interaction"), exports);
-__exportStar(require("./models/Message"), exports);
-__exportStar(require("./models/Status"), exports);
-__exportStar(require("./models/VoiceState"), exports);
-__exportStar(require("./util/String"), exports);
-__exportStar(require("./util/BitField"), exports);
-__exportStar(require("./util/Intents"), exports);
-__exportStar(require("./util/MessageFlags"), exports);
-__exportStar(require("./util/Permissions"), exports);
-__exportStar(require("./util/Snowflake"), exports);
-__exportStar(require("./util/UserFlags"), exports);
-__exportStar(require("./models/Event"), exports);
+__exportStar(require("./models/index"), exports);
+__exportStar(require("./util/index"), exports);
const Config_1 = __importStar(require("./util/Config"));
exports.Config = Config_1.default;
Object.defineProperty(exports, "DefaultOptions", { enumerable: true, get: function () { return Config_1.DefaultOptions; } });
diff --git a/dist/index.js.map b/dist/index.js.map
index 7db4514c..fe75c8ca 100644
--- a/dist/index.js.map
+++ b/dist/index.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAkC;AAElC,8DAA8C;AAC9C,+CAA6B;AAC7B,mDAAiC;AACjC,iDAA+B;AAC/B,iDAA+B;AAC/B,kDAAgC;AAChC,kDAAgC;AAChC,gDAA8B;AAC9B,gDAA8B;AAC9B,oDAAkC;AAClC,uDAAqC;AACrC,uDAAqC;AACrC,mDAAiC;AACjC,kDAAgC;AAChC,sDAAoC;AAEpC,gDAA8B;AAC9B,kDAAgC;AAChC,iDAA+B;AAC/B,sDAAoC;AACpC,qDAAmC;AACnC,mDAAiC;AACjC,mDAAiC;AACjC,iDAA+B;AAE/B,wDAAuD;AAG9C,iBAHF,gBAAM,CAGE;AAAM,+FAHJ,uBAAc,OAGI;AAFnC,4DAAoD;AAEnC,aAFV,kBAAE,CAEU;AAAkB,8FAFxB,wBAAa,OAEwB"}
\ No newline at end of file
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAkC;AAElC,8DAA8C;AAC9C,iDAA+B;AAC/B,+CAA6B;AAE7B,wDAAuD;AAG9C,iBAHF,gBAAM,CAGE;AAAM,+FAHJ,uBAAc,OAGI;AAFnC,4DAAoD;AAEnC,aAFV,kBAAE,CAEU;AAAkB,8FAFxB,wBAAa,OAEwB"}
\ No newline at end of file
diff --git a/dist/models/Message.js b/dist/models/Message.js
index 18bb509d..dfa22d42 100644
--- a/dist/models/Message.js
+++ b/dist/models/Message.js
@@ -117,6 +117,14 @@ exports.MessageSchema = new mongoose_1.Schema({
channel_id: String,
guild_id: String,
},
+}, {
+ toJSON: {
+ transform: function (doc, ret) {
+ delete ret.mention_channel_ids;
+ delete ret.mention_user_ids;
+ delete ret.mention_role_ids;
+ },
+ },
});
exports.MessageSchema.virtual("author", {
ref: User_1.UserModel,
diff --git a/dist/models/Message.js.map b/dist/models/Message.js.map
index 2e617b31..bb0f7b83 100644
--- a/dist/models/Message.js.map
+++ b/dist/models/Message.js.map
@@ -1 +1 @@
-{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../src/models/Message.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAmD;AACnD,gEAAkC;AAClC,iCAAmC;AACnC,qCAAuC;AACvC,iCAAmC;AAwCnC,IAAY,WAkBX;AAlBD,WAAY,WAAW;IACtB,mDAAW,CAAA;IACX,+DAAiB,CAAA;IACjB,qEAAoB,CAAA;IACpB,6CAAQ,CAAA;IACR,2EAAuB,CAAA;IACvB,2EAAuB,CAAA;IACvB,iFAA0B,CAAA;IAC1B,uEAAqB,CAAA;IACrB,mGAAmC,CAAA;IACnC,iHAA0C,CAAA;IAC1C,kHAA2C,CAAA;IAC3C,kHAA2C,CAAA;IAC3C,0EAAuB,CAAA;IACvB,8FAAiC,CAAA;IACjC,4FAAgC,CAAA;IAChC,gDAAU,CAAA;IACV,4EAAwB,CAAA;AACzB,CAAC,EAlBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAkBtB;AAsEY,QAAA,UAAU,GAAG;IACzB,EAAE,EAAE,MAAM;IACV,QAAQ,EAAE,MAAM;IAChB,IAAI,E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E;IACtC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,KAAK;CACd,CAAC,CAAC;AAEH,qBAAa,CAAC,OAAO,CAAC,kBAAkB,EAAE;IACzC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,qBAAqB;IACjC,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,KAAK;CACd,CAAC,CAAC;AAEH,kCAAkC;AAClC,yCAAyC;AACzC,qBAAqB;AACrB,mCAAmC;AACnC,uBAAuB;AACvB,kBAAkB;AAClB,MAAM;AAEN,aAAa;AACA,QAAA,YAAY,GAAG,kBAAE,CAAC,KAAK,CAAkB,SAAS,EAAE,qBAAa,EAAE,UAAU,CAAC,CAAC"}
\ No newline at end of file
+{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../src/models/Message.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAmD;AACnD,gEAAkC;AAClC,iCAAmC;AACnC,qCAAuC;AACvC,iCAAmC;AAwCnC,IAAY,WAkBX;AAlBD,WAAY,WAAW;IACtB,mDAAW,CAAA;IACX,+DAAiB,CAAA;IACjB,qEAAoB,CAAA;IACpB,6CAAQ,CAAA;IACR,2EAAuB,CAAA;IACvB,2EAAuB,CAAA;IACvB,iFAA0B,CAAA;IAC1B,uEAAqB,CAAA;IACrB,mGAAmC,CAAA;IACnC,iHAA0C,CAAA;IAC1C,kHAA2C,CAAA;IAC3C,kHAA2C,CAAA;IAC3C,0EAAuB,CAAA;IACvB,8FAAiC,CAAA;IACjC,4FAAgC,CAAA;IAChC,gDAAU,CAAA;IACV,4EAAwB,CAAA;AACzB,CAAC,EAlBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAkBtB;AAsEY,QAAA,UAAU,GAAG;IACzB,EAAE,EAAE,MAAM;IACV,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,MAAM;IACX,SAAS,EAAE,MAAM;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AAE,gBAAS;IACd,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,KAAK;CACd,CAAC,CAAC;AAEH,qBAAa,CAAC,OAAO,CAAC,eAAe,EAAE;IACtC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,KAAK;CACd,CAAC,CAAC;AAEH,qBAAa,CAAC,OAAO,CAAC,kBAAkB,EAAE;IACzC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,qBAAqB;IACjC,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,KAAK;CACd,CAAC,CAAC;AAEH,kCAAkC;AAClC,yCAAyC;AACzC,qBAAqB;AACrB,mCAAmC;AACnC,uBAAuB;AACvB,kBAAkB;AAClB,MAAM;AAEN,aAAa;AACA,QAAA,YAAY,GAAG,kBAAE,CAAC,KAAK,CAAkB,SAAS,EAAE,qBAAa,EAAE,UAAU,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/models/index.d.ts b/dist/models/index.d.ts
new file mode 100644
index 00000000..f82f24de
--- /dev/null
+++ b/dist/models/index.d.ts
@@ -0,0 +1,15 @@
+export * from "./Ban";
+export * from "./Channel";
+export * from "./Emoji";
+export * from "./Guild";
+export * from "./Invite";
+export * from "./Member";
+export * from "./Role";
+export * from "./User";
+export * from "./Activity";
+export * from "./Application";
+export * from "./Interaction";
+export * from "./Message";
+export * from "./Status";
+export * from "./VoiceState";
+export * from "./Event";
diff --git a/dist/models/index.js b/dist/models/index.js
new file mode 100644
index 00000000..3c81f38f
--- /dev/null
+++ b/dist/models/index.js
@@ -0,0 +1,42 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mongoose_1 = __importDefault(require("mongoose"));
+__exportStar(require("./Ban"), exports);
+__exportStar(require("./Channel"), exports);
+__exportStar(require("./Emoji"), exports);
+__exportStar(require("./Guild"), exports);
+__exportStar(require("./Invite"), exports);
+__exportStar(require("./Member"), exports);
+__exportStar(require("./Role"), exports);
+__exportStar(require("./User"), exports);
+__exportStar(require("./Activity"), exports);
+__exportStar(require("./Application"), exports);
+__exportStar(require("./Interaction"), exports);
+__exportStar(require("./Message"), exports);
+__exportStar(require("./Status"), exports);
+__exportStar(require("./VoiceState"), exports);
+__exportStar(require("./Event"), exports);
+mongoose_1.default.plugin((schema) => {
+ schema.options.toJSON = {
+ virtuals: true,
+ versionKey: false,
+ transform(doc, ret) {
+ delete ret._id;
+ delete ret.__v;
+ },
+ };
+});
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/models/index.js.map b/dist/models/index.js.map
new file mode 100644
index 00000000..db9b8835
--- /dev/null
+++ b/dist/models/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,wDAAgC;AAEhC,wCAAsB;AACtB,4CAA0B;AAC1B,0CAAwB;AACxB,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,6CAA2B;AAC3B,gDAA8B;AAC9B,gDAA8B;AAC9B,4CAA0B;AAC1B,2CAAyB;AACzB,+CAA6B;AAC7B,0CAAwB;AAExB,kBAAQ,CAAC,MAAM,CAAC,CAAC,MAAW,EAAE,EAAE;IAC/B,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG;QACvB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,KAAK;QACjB,SAAS,CAAC,GAAQ,EAAE,GAAQ;YAC3B,OAAO,GAAG,CAAC,GAAG,CAAC;YACf,OAAO,GAAG,CAAC,GAAG,CAAC;QAChB,CAAC;KACD,CAAC;AACH,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/util/index.d.ts b/dist/util/index.d.ts
new file mode 100644
index 00000000..b0c7fe62
--- /dev/null
+++ b/dist/util/index.d.ts
@@ -0,0 +1,7 @@
+export * from "./String";
+export * from "./BitField";
+export * from "./Intents";
+export * from "./MessageFlags";
+export * from "./Permissions";
+export * from "./Snowflake";
+export * from "./UserFlags";
diff --git a/dist/util/index.js b/dist/util/index.js
new file mode 100644
index 00000000..25791a96
--- /dev/null
+++ b/dist/util/index.js
@@ -0,0 +1,20 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+__exportStar(require("./String"), exports);
+__exportStar(require("./BitField"), exports);
+__exportStar(require("./Intents"), exports);
+__exportStar(require("./MessageFlags"), exports);
+__exportStar(require("./Permissions"), exports);
+__exportStar(require("./Snowflake"), exports);
+__exportStar(require("./UserFlags"), exports);
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/util/index.js.map b/dist/util/index.js.map
new file mode 100644
index 00000000..ce0269d5
--- /dev/null
+++ b/dist/util/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B;AAC3B,4CAA0B;AAC1B,iDAA+B;AAC/B,gDAA8B;AAC9B,8CAA4B;AAC5B,8CAA4B"}
\ No newline at end of file
diff --git a/src/index.ts b/src/index.ts
index 8484565a..914431d8 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,29 +1,8 @@
export * from "./util/checkToken";
export * as Constants from "./util/Constants";
-export * from "./models/Ban";
-export * from "./models/Channel";
-export * from "./models/Emoji";
-export * from "./models/Guild";
-export * from "./models/Invite";
-export * from "./models/Member";
-export * from "./models/Role";
-export * from "./models/User";
-export * from "./models/Activity";
-export * from "./models/Application";
-export * from "./models/Interaction";
-export * from "./models/Message";
-export * from "./models/Status";
-export * from "./models/VoiceState";
-
-export * from "./util/String";
-export * from "./util/BitField";
-export * from "./util/Intents";
-export * from "./util/MessageFlags";
-export * from "./util/Permissions";
-export * from "./util/Snowflake";
-export * from "./util/UserFlags";
-export * from "./models/Event";
+export * from "./models/index";
+export * from "./util/index";
import Config, { DefaultOptions } from "./util/Config";
import db, { MongooseCache } from "./util/Database";
diff --git a/src/models/Message.ts b/src/models/Message.ts
index bb3c2d5b..15f00cf4 100644
--- a/src/models/Message.ts
+++ b/src/models/Message.ts
@@ -190,39 +190,50 @@ export const Embed = {
],
};
-export const MessageSchema = new Schema({
- id: String,
- channel_id: String,
- author_id: String,
- webhook_id: String,
- guild_id: String,
- application_id: String,
- content: String,
- timestamp: Date,
- edited_timestamp: Date,
- tts: Boolean,
- mention_everyone: Boolean,
- mention_user_ids: [String],
- mention_role_ids: [String],
- mention_channel_ids: [String],
- attachments: [Attachment],
- embeds: [Embed],
- reactions: [Reaction],
- nonce: Schema.Types.Mixed, // can be a long or a string
- pinned: Boolean,
- type: { type: Number },
- activity: {
- type: Number,
- party_id: String,
- },
- flags: Types.Long,
- stickers: [],
- message_reference: {
- message_id: String,
+export const MessageSchema = new Schema(
+ {
+ id: String,
channel_id: String,
+ author_id: String,
+ webhook_id: String,
guild_id: String,
+ application_id: String,
+ content: String,
+ timestamp: Date,
+ edited_timestamp: Date,
+ tts: Boolean,
+ mention_everyone: Boolean,
+ mention_user_ids: [String],
+ mention_role_ids: [String],
+ mention_channel_ids: [String],
+ attachments: [Attachment],
+ embeds: [Embed],
+ reactions: [Reaction],
+ nonce: Schema.Types.Mixed, // can be a long or a string
+ pinned: Boolean,
+ type: { type: Number },
+ activity: {
+ type: Number,
+ party_id: String,
+ },
+ flags: Types.Long,
+ stickers: [],
+ message_reference: {
+ message_id: String,
+ channel_id: String,
+ guild_id: String,
+ },
},
-});
+ {
+ toJSON: {
+ transform: function (doc, ret) {
+ delete ret.mention_channel_ids;
+ delete ret.mention_user_ids;
+ delete ret.mention_role_ids;
+ },
+ },
+ }
+);
MessageSchema.virtual("author", {
ref: UserModel,
diff --git a/src/models/index.ts b/src/models/index.ts
new file mode 100644
index 00000000..bb6024fe
--- /dev/null
+++ b/src/models/index.ts
@@ -0,0 +1,28 @@
+import mongoose from "mongoose";
+
+export * from "./Ban";
+export * from "./Channel";
+export * from "./Emoji";
+export * from "./Guild";
+export * from "./Invite";
+export * from "./Member";
+export * from "./Role";
+export * from "./User";
+export * from "./Activity";
+export * from "./Application";
+export * from "./Interaction";
+export * from "./Message";
+export * from "./Status";
+export * from "./VoiceState";
+export * from "./Event";
+
+mongoose.plugin((schema: any) => {
+ schema.options.toJSON = {
+ virtuals: true,
+ versionKey: false,
+ transform(doc: any, ret: any) {
+ delete ret._id;
+ delete ret.__v;
+ },
+ };
+});
diff --git a/src/util/index.ts b/src/util/index.ts
new file mode 100644
index 00000000..b0c7fe62
--- /dev/null
+++ b/src/util/index.ts
@@ -0,0 +1,7 @@
+export * from "./String";
+export * from "./BitField";
+export * from "./Intents";
+export * from "./MessageFlags";
+export * from "./Permissions";
+export * from "./Snowflake";
+export * from "./UserFlags";
--
cgit 1.5.1
From f48127f8a4881afc6dfb9b066b4eb357f1ef6c63 Mon Sep 17 00:00:00 2001
From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com>
Date: Wed, 7 Apr 2021 03:02:13 +0200
Subject: :bug: fix lean not working with virtuals
---
package-lock.json | 39 +++++++++++++++++++++++
package.json | 1 +
src/index.ts | 4 +--
src/models/Message.ts | 86 +++++++++++++++++++++++++--------------------------
src/models/index.ts | 27 +++++++++-------
src/util/Database.ts | 9 ++++++
6 files changed, 109 insertions(+), 57 deletions(-)
(limited to 'src/models/Message.ts')
diff --git a/package-lock.json b/package-lock.json
index 0e721c0c..902566ed 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -17,6 +17,7 @@
},
"devDependencies": {
"@types/jsonwebtoken": "^8.5.0",
+ "@types/mongoose-lean-virtuals": "^0.5.1",
"@types/node": "^14.14.25",
"typescript": "^4.1.3"
}
@@ -47,6 +48,25 @@
"@types/node": "*"
}
},
+ "node_modules/@types/mongoose": {
+ "version": "5.10.4",
+ "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.10.4.tgz",
+ "integrity": "sha512-U7fNDcTcdaSGzQ3+mlSBeebiYr6eaacJi330LTLOEh8Sm6mXfuec70ag/UXkL+alFm7pfAjFqfc7jEaJEJvAHQ==",
+ "dev": true,
+ "dependencies": {
+ "@types/mongodb": "*",
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/mongoose-lean-virtuals": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/@types/mongoose-lean-virtuals/-/mongoose-lean-virtuals-0.5.1.tgz",
+ "integrity": "sha512-bNk+QLjP5VZU4EsJag4xQsjLAa8CEm/SKZDyiC2kM208wIrGum6daD7j45Oqs50bWNGfqZYRuEhh8xZ17D7aEw==",
+ "dev": true,
+ "dependencies": {
+ "@types/mongoose": "*"
+ }
+ },
"node_modules/@types/node": {
"version": "14.14.25",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.25.tgz",
@@ -1164,6 +1184,25 @@
"@types/node": "*"
}
},
+ "@types/mongoose": {
+ "version": "5.10.4",
+ "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.10.4.tgz",
+ "integrity": "sha512-U7fNDcTcdaSGzQ3+mlSBeebiYr6eaacJi330LTLOEh8Sm6mXfuec70ag/UXkL+alFm7pfAjFqfc7jEaJEJvAHQ==",
+ "dev": true,
+ "requires": {
+ "@types/mongodb": "*",
+ "@types/node": "*"
+ }
+ },
+ "@types/mongoose-lean-virtuals": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/@types/mongoose-lean-virtuals/-/mongoose-lean-virtuals-0.5.1.tgz",
+ "integrity": "sha512-bNk+QLjP5VZU4EsJag4xQsjLAa8CEm/SKZDyiC2kM208wIrGum6daD7j45Oqs50bWNGfqZYRuEhh8xZ17D7aEw==",
+ "dev": true,
+ "requires": {
+ "@types/mongoose": "*"
+ }
+ },
"@types/node": {
"version": "14.14.25",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.25.tgz",
diff --git a/package.json b/package.json
index 7900d301..b92228ff 100644
--- a/package.json
+++ b/package.json
@@ -28,6 +28,7 @@
},
"devDependencies": {
"@types/jsonwebtoken": "^8.5.0",
+ "@types/mongoose-lean-virtuals": "^0.5.1",
"@types/node": "^14.14.25",
"typescript": "^4.1.3"
}
diff --git a/src/index.ts b/src/index.ts
index 914431d8..343a7496 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -5,6 +5,6 @@ export * from "./models/index";
export * from "./util/index";
import Config, { DefaultOptions } from "./util/Config";
-import db, { MongooseCache } from "./util/Database";
+import db, { MongooseCache, toObject } from "./util/Database";
-export { Config, db, DefaultOptions, MongooseCache };
+export { Config, db, DefaultOptions, MongooseCache, toObject };
diff --git a/src/models/Message.ts b/src/models/Message.ts
index 15f00cf4..ee038f97 100644
--- a/src/models/Message.ts
+++ b/src/models/Message.ts
@@ -1,8 +1,9 @@
import { Schema, Types, Document } from "mongoose";
import db from "../util/Database";
-import { UserModel } from "./User";
-import { MemberModel } from "./Member";
-import { RoleModel } from "./Role";
+import { PublicUser, UserModel } from "./User";
+import { MemberModel, PublicMember } from "./Member";
+import { Role, RoleModel } from "./Role";
+import { Channel } from "./Channel";
export interface Message {
id: string;
@@ -36,6 +37,12 @@ export interface Message {
channel_id?: string;
guild_id?: string;
};
+ // mongoose virtuals:
+ author?: PublicUser;
+ member?: PublicMember;
+ mentions?: PublicUser[];
+ mention_roles?: Role[];
+ mention_channels?: Channel[];
}
export interface MessageDocument extends Document, Message {
@@ -190,50 +197,39 @@ export const Embed = {
],
};
-export const MessageSchema = new Schema(
- {
- id: String,
+export const MessageSchema = new Schema({
+ id: String,
+ channel_id: String,
+ author_id: String,
+ webhook_id: String,
+ guild_id: String,
+ application_id: String,
+ content: String,
+ timestamp: Date,
+ edited_timestamp: Date,
+ tts: Boolean,
+ mention_everyone: Boolean,
+ mention_user_ids: [String],
+ mention_role_ids: [String],
+ mention_channel_ids: [String],
+ attachments: [Attachment],
+ embeds: [Embed],
+ reactions: [Reaction],
+ nonce: Schema.Types.Mixed, // can be a long or a string
+ pinned: Boolean,
+ type: { type: Number },
+ activity: {
+ type: Number,
+ party_id: String,
+ },
+ flags: Types.Long,
+ stickers: [],
+ message_reference: {
+ message_id: String,
channel_id: String,
- author_id: String,
- webhook_id: String,
guild_id: String,
- application_id: String,
- content: String,
- timestamp: Date,
- edited_timestamp: Date,
- tts: Boolean,
- mention_everyone: Boolean,
- mention_user_ids: [String],
- mention_role_ids: [String],
- mention_channel_ids: [String],
- attachments: [Attachment],
- embeds: [Embed],
- reactions: [Reaction],
- nonce: Schema.Types.Mixed, // can be a long or a string
- pinned: Boolean,
- type: { type: Number },
- activity: {
- type: Number,
- party_id: String,
- },
- flags: Types.Long,
- stickers: [],
- message_reference: {
- message_id: String,
- channel_id: String,
- guild_id: String,
- },
},
- {
- toJSON: {
- transform: function (doc, ret) {
- delete ret.mention_channel_ids;
- delete ret.mention_user_ids;
- delete ret.mention_role_ids;
- },
- },
- }
-);
+});
MessageSchema.virtual("author", {
ref: UserModel,
@@ -270,6 +266,8 @@ MessageSchema.virtual("mention_channels", {
justOne: false,
});
+MessageSchema.set("removeResponse", ["mention_channel_ids", "mention_role_ids", "mention_user_ids", "author_id"]);
+
// TODO: missing Application Model
// MessageSchema.virtual("application", {
// ref: Application,
diff --git a/src/models/index.ts b/src/models/index.ts
index bb6024fe..03b9fe70 100644
--- a/src/models/index.ts
+++ b/src/models/index.ts
@@ -1,4 +1,20 @@
import mongoose from "mongoose";
+import { Schema } from "mongoose";
+
+mongoose.plugin((schema: Schema, opts: any) => {
+ schema.set("toObject", {
+ virtuals: true,
+ versionKey: false,
+ transform(doc: any, ret: any) {
+ delete ret._id;
+ delete ret.__v;
+ const props = schema.get("removeResponse") || [];
+ props.forEach((prop: string) => {
+ delete ret[prop];
+ });
+ },
+ });
+});
export * from "./Ban";
export * from "./Channel";
@@ -15,14 +31,3 @@ export * from "./Message";
export * from "./Status";
export * from "./VoiceState";
export * from "./Event";
-
-mongoose.plugin((schema: any) => {
- schema.options.toJSON = {
- virtuals: true,
- versionKey: false,
- transform(doc: any, ret: any) {
- delete ret._id;
- delete ret.__v;
- },
- };
-});
diff --git a/src/util/Database.ts b/src/util/Database.ts
index 883c8dcd..e17eeccb 100644
--- a/src/util/Database.ts
+++ b/src/util/Database.ts
@@ -2,6 +2,7 @@ import "./MongoBigInt";
import mongoose, { Collection, Connection } from "mongoose";
import { ChangeStream, ChangeEvent, Long } from "mongodb";
import EventEmitter from "events";
+import { Document } from "mongoose";
const uri = process.env.MONGO_URL || "mongodb://localhost:27017/fosscord?readPreference=secondaryPreferred";
console.log(`[DB] connect: ${uri}`);
@@ -10,6 +11,14 @@ const connection = mongoose.createConnection(uri, { autoIndex: true, useNewUrlPa
export default connection;
+function transform(document: T) {
+ return document.toObject({ virtuals: true });
+}
+
+export function toObject(document: T | T[]) {
+ return Array.isArray(document) ? document.map((x) => transform(x)) : transform(document);
+}
+
export interface MongooseCache {
on(event: "delete", listener: (id: string) => void): this;
on(event: "change", listener: (data: any) => void): this;
--
cgit 1.5.1
From a6d82b466f61c1b60b1058d75b0647f2c0ac91a0 Mon Sep 17 00:00:00 2001
From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com>
Date: Wed, 7 Apr 2021 20:26:19 +0200
Subject: :zap: use mongoose autopopulate
---
package-lock.json | 36 +++++++++++++++++++++++++++++++++++-
package.json | 4 +++-
src/models/Guild.ts | 4 +++-
src/models/Member.ts | 17 ++++++++++++++++-
src/models/Message.ts | 16 ++++++++++++++--
src/models/Role.ts | 1 +
src/models/User.ts | 7 +++++++
src/models/index.ts | 3 +++
8 files changed, 82 insertions(+), 6 deletions(-)
(limited to 'src/models/Message.ts')
diff --git a/package-lock.json b/package-lock.json
index 902566ed..17d70c4a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13,10 +13,12 @@
"lambert-db": "^1.1.7",
"missing-native-js-functions": "^1.2.2",
"mongodb": "^3.6.6",
- "mongoose": "^5.12.3"
+ "mongoose": "^5.12.3",
+ "mongoose-autopopulate": "^0.12.3"
},
"devDependencies": {
"@types/jsonwebtoken": "^8.5.0",
+ "@types/mongoose-autopopulate": "^0.10.1",
"@types/mongoose-lean-virtuals": "^0.5.1",
"@types/node": "^14.14.25",
"typescript": "^4.1.3"
@@ -58,6 +60,15 @@
"@types/node": "*"
}
},
+ "node_modules/@types/mongoose-autopopulate": {
+ "version": "0.10.1",
+ "resolved": "https://registry.npmjs.org/@types/mongoose-autopopulate/-/mongoose-autopopulate-0.10.1.tgz",
+ "integrity": "sha512-L67MAIE3WEoTtt7a7/spRYk+76lgp67FAP6I38Y9NcC1kQuzwqnukTaJzodfb8180wxHZM4qt68u6x6ptuDRaQ==",
+ "dev": true,
+ "dependencies": {
+ "@types/mongoose": "*"
+ }
+ },
"node_modules/@types/mongoose-lean-virtuals": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/@types/mongoose-lean-virtuals/-/mongoose-lean-virtuals-0.5.1.tgz",
@@ -720,6 +731,14 @@
"url": "https://opencollective.com/mongoose"
}
},
+ "node_modules/mongoose-autopopulate": {
+ "version": "0.12.3",
+ "resolved": "https://registry.npmjs.org/mongoose-autopopulate/-/mongoose-autopopulate-0.12.3.tgz",
+ "integrity": "sha512-yNmYsfi6OpS/GQ+48mkB0KQ199ExHmmPrt3wt3fyxPHPMtEBGts7yq3wBQR6VgKCPOQaKvCI1URbJCPOtrPeLw==",
+ "peerDependencies": {
+ "mongoose": "4.x || 5.x"
+ }
+ },
"node_modules/mongoose-legacy-pluralize": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz",
@@ -1194,6 +1213,15 @@
"@types/node": "*"
}
},
+ "@types/mongoose-autopopulate": {
+ "version": "0.10.1",
+ "resolved": "https://registry.npmjs.org/@types/mongoose-autopopulate/-/mongoose-autopopulate-0.10.1.tgz",
+ "integrity": "sha512-L67MAIE3WEoTtt7a7/spRYk+76lgp67FAP6I38Y9NcC1kQuzwqnukTaJzodfb8180wxHZM4qt68u6x6ptuDRaQ==",
+ "dev": true,
+ "requires": {
+ "@types/mongoose": "*"
+ }
+ },
"@types/mongoose-lean-virtuals": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/@types/mongoose-lean-virtuals/-/mongoose-lean-virtuals-0.5.1.tgz",
@@ -1694,6 +1722,12 @@
}
}
},
+ "mongoose-autopopulate": {
+ "version": "0.12.3",
+ "resolved": "https://registry.npmjs.org/mongoose-autopopulate/-/mongoose-autopopulate-0.12.3.tgz",
+ "integrity": "sha512-yNmYsfi6OpS/GQ+48mkB0KQ199ExHmmPrt3wt3fyxPHPMtEBGts7yq3wBQR6VgKCPOQaKvCI1URbJCPOtrPeLw==",
+ "requires": {}
+ },
"mongoose-legacy-pluralize": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz",
diff --git a/package.json b/package.json
index b92228ff..9bf8cd16 100644
--- a/package.json
+++ b/package.json
@@ -24,10 +24,12 @@
"lambert-db": "^1.1.7",
"missing-native-js-functions": "^1.2.2",
"mongodb": "^3.6.6",
- "mongoose": "^5.12.3"
+ "mongoose": "^5.12.3",
+ "mongoose-autopopulate": "^0.12.3"
},
"devDependencies": {
"@types/jsonwebtoken": "^8.5.0",
+ "@types/mongoose-autopopulate": "^0.10.1",
"@types/mongoose-lean-virtuals": "^0.5.1",
"@types/node": "^14.14.25",
"typescript": "^4.1.3"
diff --git a/src/models/Guild.ts b/src/models/Guild.ts
index d3f098ea..aa520329 100644
--- a/src/models/Guild.ts
+++ b/src/models/Guild.ts
@@ -96,12 +96,14 @@ GuildSchema.virtual("channels", {
localField: "id",
foreignField: "guild_id",
justOne: false,
+ autopopulate: true,
});
GuildSchema.virtual("roles", {
ref: RoleModel,
localField: "id",
foreignField: "guild_id",
justOne: false,
+ autopopulate: true,
});
// nested populate is needed for member users: https://gist.github.com/yangsu/5312204
@@ -117,6 +119,7 @@ GuildSchema.virtual("emojis", {
localField: "id",
foreignField: "guild_id",
justOne: false,
+ autopopulate: true,
});
GuildSchema.virtual("joined_at", {
@@ -125,7 +128,6 @@ GuildSchema.virtual("joined_at", {
foreignField: "guild_id",
justOne: true,
}).get((member: any, virtual: any, doc: any) => {
- console.log("get", member, this);
return member.joined_at;
});
diff --git a/src/models/Member.ts b/src/models/Member.ts
index fc9d5b99..52151235 100644
--- a/src/models/Member.ts
+++ b/src/models/Member.ts
@@ -1,7 +1,19 @@
-import { PublicUser, User, UserModel } from "./User";
+import { PublicUser, PublicUserProjection, User, UserModel } from "./User";
import { Schema, Types, Document } from "mongoose";
import db from "../util/Database";
+export const PublicMemberProjection = {
+ id: true,
+ guild_id: true,
+ nick: true,
+ roles: true,
+ joined_at: true,
+ pending: true,
+ deaf: true,
+ mute: true,
+ premium_since: true,
+};
+
export interface Member {
id: string;
guild_id: string;
@@ -80,6 +92,9 @@ MemberSchema.virtual("user", {
localField: "id",
foreignField: "id",
justOne: true,
+ autopopulate: {
+ select: PublicUserProjection,
+ },
});
// @ts-ignore
diff --git a/src/models/Message.ts b/src/models/Message.ts
index ee038f97..15ff57d3 100644
--- a/src/models/Message.ts
+++ b/src/models/Message.ts
@@ -1,7 +1,7 @@
import { Schema, Types, Document } from "mongoose";
import db from "../util/Database";
-import { PublicUser, UserModel } from "./User";
-import { MemberModel, PublicMember } from "./Member";
+import { PublicUser, PublicUserProjection, UserModel } from "./User";
+import { MemberModel, PublicMember, PublicMemberProjection } from "./Member";
import { Role, RoleModel } from "./Role";
import { Channel } from "./Channel";
@@ -229,6 +229,14 @@ export const MessageSchema = new Schema({
channel_id: String,
guild_id: String,
},
+ // virtual:
+ // author: {
+ // ref: UserModel,
+ // localField: "author_id",
+ // foreignField: "id",
+ // justOne: true,
+ // autopopulate: { select: { id: true, user_data: false } },
+ // },
});
MessageSchema.virtual("author", {
@@ -236,6 +244,7 @@ MessageSchema.virtual("author", {
localField: "author_id",
foreignField: "id",
justOne: true,
+ autopopulate: { select: PublicUserProjection },
});
MessageSchema.virtual("member", {
@@ -250,6 +259,7 @@ MessageSchema.virtual("mentions", {
localField: "mention_user_ids",
foreignField: "id",
justOne: false,
+ autopopulate: { select: PublicUserProjection },
});
MessageSchema.virtual("mention_roles", {
@@ -257,6 +267,7 @@ MessageSchema.virtual("mention_roles", {
localField: "mention_role_ids",
foreignField: "id",
justOne: false,
+ autopopulate: true,
});
MessageSchema.virtual("mention_channels", {
@@ -264,6 +275,7 @@ MessageSchema.virtual("mention_channels", {
localField: "mention_channel_ids",
foreignField: "id",
justOne: false,
+ autopopulate: { select: { id: true, guild_id: true, type: true, name: true } },
});
MessageSchema.set("removeResponse", ["mention_channel_ids", "mention_role_ids", "mention_user_ids", "author_id"]);
diff --git a/src/models/Role.ts b/src/models/Role.ts
index adb75b0a..84ad55d0 100644
--- a/src/models/Role.ts
+++ b/src/models/Role.ts
@@ -34,6 +34,7 @@ export const RoleSchema = new Schema({
bot_id: String,
},
});
+RoleSchema.set("removeResponse", ["guild_id"]);
// @ts-ignore
export const RoleModel = db.model("Role", RoleSchema, "roles");
diff --git a/src/models/User.ts b/src/models/User.ts
index 76251e09..1f01e837 100644
--- a/src/models/User.ts
+++ b/src/models/User.ts
@@ -3,6 +3,13 @@ import { ClientStatus, Status } from "./Status";
import { Schema, Types, Document } from "mongoose";
import db from "../util/Database";
+export const PublicUserProjection = {
+ username: true,
+ discriminator: true,
+ id: true,
+ public_flags: true,
+ avatar: true,
+};
export interface User {
id: string;
username: string; // username max length 32, min 2
diff --git a/src/models/index.ts b/src/models/index.ts
index 03b9fe70..876e5984 100644
--- a/src/models/index.ts
+++ b/src/models/index.ts
@@ -1,5 +1,8 @@
import mongoose from "mongoose";
import { Schema } from "mongoose";
+import mongooseAutoPopulate from "mongoose-autopopulate";
+
+mongoose.plugin(mongooseAutoPopulate);
mongoose.plugin((schema: Schema, opts: any) => {
schema.set("toObject", {
--
cgit 1.5.1