diff --git a/util/src/models/Application.ts b/util/oldModels/Application.ts
index fae6e8db..fae6e8db 100644
--- a/util/src/models/Application.ts
+++ b/util/oldModels/Application.ts
diff --git a/util/src/models/AuditLog.ts b/util/oldModels/AuditLog.ts
index 02b2c444..02b2c444 100644
--- a/util/src/models/AuditLog.ts
+++ b/util/oldModels/AuditLog.ts
diff --git a/util/src/models/Ban.ts b/util/oldModels/Ban.ts
index f09950ee..f09950ee 100644
--- a/util/src/models/Ban.ts
+++ b/util/oldModels/Ban.ts
diff --git a/util/src/models/Channel.ts b/util/oldModels/Channel.ts
index 2959decd..2959decd 100644
--- a/util/src/models/Channel.ts
+++ b/util/oldModels/Channel.ts
diff --git a/util/src/models/Emoji.ts b/util/oldModels/Emoji.ts
index 3e5cad53..3e5cad53 100644
--- a/util/src/models/Emoji.ts
+++ b/util/oldModels/Emoji.ts
diff --git a/util/src/models/Event.ts b/util/oldModels/Event.ts
index 86d0fd00..904522a8 100644
--- a/util/src/models/Event.ts
+++ b/util/oldModels/Event.ts
@@ -3,7 +3,7 @@ import { DMChannel, Channel } from "./Channel";
import { Guild } from "./Guild";
import { Member, PublicMember, UserGuildSettings } from "./Member";
import { Emoji } from "./Emoji";
-import { Presence } from "./Activity";
+import { Presence } from "../models/Activity";
import { Role } from "./Role";
import { Invite } from "./Invite";
import { Message, PartialEmoji } from "./Message";
diff --git a/util/src/models/Guild.ts b/util/oldModels/Guild.ts
index a5dcd8e3..a5dcd8e3 100644
--- a/util/src/models/Guild.ts
+++ b/util/oldModels/Guild.ts
diff --git a/util/src/models/Interaction.ts b/util/oldModels/Interaction.ts
index 764247a5..764247a5 100644
--- a/util/src/models/Interaction.ts
+++ b/util/oldModels/Interaction.ts
diff --git a/util/src/models/Invite.ts b/util/oldModels/Invite.ts
index 01f12003..01f12003 100644
--- a/util/src/models/Invite.ts
+++ b/util/oldModels/Invite.ts
diff --git a/util/src/models/Member.ts b/util/oldModels/Member.ts
index d1c9ad9b..d1c9ad9b 100644
--- a/util/src/models/Member.ts
+++ b/util/oldModels/Member.ts
diff --git a/util/src/models/Message.ts b/util/oldModels/Message.ts
index 15a6f40d..15a6f40d 100644
--- a/util/src/models/Message.ts
+++ b/util/oldModels/Message.ts
diff --git a/util/src/models/RateLimit.ts b/util/oldModels/RateLimit.ts
index 6a0e1ffd..6a0e1ffd 100644
--- a/util/src/models/RateLimit.ts
+++ b/util/oldModels/RateLimit.ts
diff --git a/util/src/models/ReadState.ts b/util/oldModels/ReadState.ts
index 9c4fb323..9c4fb323 100644
--- a/util/src/models/ReadState.ts
+++ b/util/oldModels/ReadState.ts
diff --git a/util/src/models/Role.ts b/util/oldModels/Role.ts
index c1111c84..c1111c84 100644
--- a/util/src/models/Role.ts
+++ b/util/oldModels/Role.ts
diff --git a/util/src/models/Team.ts b/util/oldModels/Team.ts
index 795c82d2..795c82d2 100644
--- a/util/src/models/Team.ts
+++ b/util/oldModels/Team.ts
diff --git a/util/src/models/Template.ts b/util/oldModels/Template.ts
index ad0f9104..ad0f9104 100644
--- a/util/src/models/Template.ts
+++ b/util/oldModels/Template.ts
diff --git a/util/src/models/VoiceState.ts b/util/oldModels/VoiceState.ts
index c1f90edd..c1f90edd 100644
--- a/util/src/models/VoiceState.ts
+++ b/util/oldModels/VoiceState.ts
diff --git a/util/src/models/Webhook.ts b/util/oldModels/Webhook.ts
index 7379e98f..7379e98f 100644
--- a/util/src/models/Webhook.ts
+++ b/util/oldModels/Webhook.ts
diff --git a/util/src/index.ts b/util/src/index.ts
index 3565fb6b..c6bbfd57 100644
--- a/util/src/index.ts
+++ b/util/src/index.ts
@@ -1,10 +1,10 @@
-export * from "./util/checkToken";
+import "reflect-metadata";
-export * as Constants from "./util/Constants";
+// export * as Constants from "../util/Constants";
export * from "./models/index";
-export * from "./util/index";
+// export * from "../util/index";
-import Config from "./util/Config";
-import db, { MongooseCache, toObject } from "./util/Database";
+// import Config from "../util/Config";
+// import db, { MongooseCache, toObject } from "./util/Database";
-export { Config, db, MongooseCache, toObject };
+// export { Config };
diff --git a/util/src/models/Activity.ts b/util/src/models/Activity.ts
index 17abd1ca..6b13477f 100644
--- a/util/src/models/Activity.ts
+++ b/util/src/models/Activity.ts
@@ -1,7 +1,5 @@
-import { User } from "..";
+import { User } from "./User";
import { ClientStatus, Status } from "./Status";
-import { Schema, model, Types, Document } from "mongoose";
-import toBigInt from "../util/toBigInt";
export interface Presence {
user: User;
@@ -47,82 +45,6 @@ export interface Activity {
flags?: bigint;
}
-export const ActivitySchema = {
- name: { type: String, required: true },
- type: { type: Number, required: true },
- url: String,
- created_at: Date,
- timestamps: [
- {
- start: Number,
- end: Number,
- },
- ],
- application_id: String,
- details: String,
- state: String,
- emoji: {
- name: String,
- id: String,
- amimated: Boolean,
- },
- party: {
- id: String,
- size: [Number, Number],
- },
- assets: {
- large_image: String,
- large_text: String,
- small_image: String,
- small_text: String,
- },
- secrets: {
- join: String,
- spectate: String,
- match: String,
- },
- instance: Boolean,
- flags: { type: String, get: toBigInt },
-};
-
-export const ActivityBodySchema = {
- name: String,
- type: Number,
- $url: String,
- $created_at: Date,
- $timestamps: [
- {
- $start: Number,
- $end: Number,
- },
- ],
- $application_id: String,
- $details: String,
- $state: String,
- $emoji: {
- $name: String,
- $id: String,
- $amimated: Boolean,
- },
- $party: {
- $id: String,
- $size: [Number, Number],
- },
- $assets: {
- $large_image: String,
- $large_text: String,
- $small_image: String,
- $small_text: String,
- },
- $secrets: {
- $join: String,
- $spectate: String,
- $match: String,
- },
- $instance: Boolean,
- $flags: BigInt,
-};
-
export enum ActivityType {
GAME = 0,
STREAMING = 1,
diff --git a/util/src/models/BaseClass.ts b/util/src/models/BaseClass.ts
new file mode 100644
index 00000000..78cd329c
--- /dev/null
+++ b/util/src/models/BaseClass.ts
@@ -0,0 +1,28 @@
+import "reflect-metadata";
+import { BaseEntity, Column } from "typeorm";
+
+export class BaseClass extends BaseEntity {
+ @Column()
+ id?: string;
+
+ constructor(props?: any) {
+ super();
+ BaseClass.assign(props, this, "body.");
+ }
+
+ private static assign(props: any, object: any, path?: string): any {
+ const expectedType = Reflect.getMetadata("design:type", object, props);
+ console.log(expectedType, object, props, path, typeof object);
+
+ if (typeof object !== typeof props) throw new Error(`Property at ${path} must be`);
+ if (typeof object === "object")
+ return Object.keys(object).map((key) => BaseClass.assign(props[key], object[key], `${path}.${key}`));
+ }
+}
+
+// @ts-ignore
+global.BaseClass = BaseClass;
+
+var test = new BaseClass({});
+
+setTimeout(() => {}, 10000 * 1000);
diff --git a/util/src/models/Status.ts b/util/src/models/Status.ts
index 5a9bf2ca..c4dab586 100644
--- a/util/src/models/Status.ts
+++ b/util/src/models/Status.ts
@@ -5,9 +5,3 @@ export interface ClientStatus {
mobile?: string; // e.g. iOS/Android
web?: string; // e.g. browser, bot account
}
-
-export const ClientStatus = {
- desktop: String,
- mobile: String,
- web: String,
-};
diff --git a/util/src/models/User.ts b/util/src/models/User.ts
index c667e954..38045738 100644
--- a/util/src/models/User.ts
+++ b/util/src/models/User.ts
@@ -1,8 +1,7 @@
-import { Activity, ActivitySchema } from "./Activity";
+import { Column, PrimaryColumn, PrimaryGeneratedColumn } from "typeorm";
+import { Activity } from "./Activity";
+import { BaseClass } from "./BaseClass";
import { ClientStatus, Status } from "./Status";
-import { Schema, Types, Document } from "mongoose";
-import db from "../util/Database";
-import toBigInt from "../util/toBigInt";
export const PublicUserProjection = {
username: true,
@@ -16,53 +15,109 @@ export const PublicUserProjection = {
bot: true,
};
-export interface User {
+export class User extends BaseClass {
+ @PrimaryGeneratedColumn()
id: string;
- username: string; // username max length 32, min 2
+
+ @Column()
+ username: string; // username max length 32, min 2 (should be configurable)
+
+ @Column()
discriminator: string; // #0001 4 digit long string from #0001 - #9999
+
+ @Column()
avatar: string | null; // hash of the user avatar
+
+ @Column()
accent_color: number | null; // banner color of user
- banner: string | null;
+
+ @Column()
+ banner: string | null; // hash of the user banner
+
+ @Column()
phone: string | null; // phone number of the user
+
+ @Column()
desktop: boolean; // if the user has desktop app installed
+
+ @Column()
mobile: boolean; // if the user has mobile app installed
+
+ @Column()
premium: boolean; // if user bought nitro
+
+ @Column()
premium_type: number; // nitro level
+
+ @Column()
bot: boolean; // if user is bot
- bio: string; // short description of the user (max 190 chars)
- system: boolean; // shouldn't be used, the api sents this field type true, if the genetaed message comes from a system generated author
+
+ @Column()
+ bio: string; // short description of the user (max 190 chars -> should be configurable)
+
+ @Column()
+ system: boolean; // shouldn't be used, the api sents this field type true, if the generated message comes from a system generated author
+
+ @Column()
nsfw_allowed: boolean; // if the user is older than 18 (resp. Config)
+
+ @Column()
mfa_enabled: boolean; // if multi factor authentication is enabled
+
+ @Column()
created_at: Date; // registration date
+
+ @Column()
verified: boolean; // if the user is offically verified
+
+ @Column()
disabled: boolean; // if the account is disabled
+
+ @Column()
deleted: boolean; // if the user was deleted
+
+ @Column()
email: string | null; // email of the user
+
+ @Column()
flags: bigint; // UserFlags
+
+ @Column()
public_flags: bigint;
- user_settings: UserSettings;
+
+ @Column("simple-array") // string in simple-array must not contain commas
guilds: string[]; // array of guild ids the user is part of
+
+ @Column("simple-json")
+ user_settings: UserSettings;
+
+ @Column("simple-json")
user_data: UserData;
+
+ @Column("simple-json")
presence: {
status: Status;
activities: Activity[];
client_status: ClientStatus;
};
+
+ @Column("simple-json")
+ relationships: Relationship[];
+
+ @Column("simple-json")
+ connected_accounts: ConnectedAccount[];
}
-// Private user data:
+// @ts-ignore
+global.User = User;
+
+// Private user data that should never get sent to the client
export interface UserData {
valid_tokens_since: Date; // all tokens with a previous issue date are invalid
- relationships: Relationship[];
- connected_accounts: ConnectedAccount[];
hash: string; // hash of the password, salt is saved in password (bcrypt)
fingerprints: string[]; // array of fingerprints -> used to prevent multiple accounts
}
-export interface UserDocument extends User, Document {
- id: string;
-}
-
export interface PublicUser {
id: string;
discriminator: string;
@@ -143,110 +198,3 @@ export interface UserSettings {
theme: "dark" | "white"; // dark
timezone_offset: number; // e.g -60
}
-
-export const UserSchema = new Schema({
- id: String,
- username: String,
- discriminator: String,
- avatar: String,
- accent_color: Number,
- banner: String,
- phone: String,
- desktop: Boolean,
- mobile: Boolean,
- premium: Boolean,
- premium_type: Number,
- bot: Boolean,
- bio: String,
- system: Boolean,
- nsfw_allowed: Boolean,
- mfa_enabled: Boolean,
- created_at: Date,
- verified: Boolean,
- disabled: Boolean,
- deleted: Boolean,
- email: String,
- flags: { type: String, get: toBigInt }, // TODO: automatically convert Types.Long to BitField of UserFlags
- public_flags: { type: String, get: toBigInt },
- 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: { type: String, required: true },
- nickname: String,
- type: { type: Number },
- },
- ],
- connected_accounts: [
- {
- access_token: String,
- friend_sync: Boolean,
- id: String,
- name: String,
- revoked: Boolean,
- show_activity: Boolean,
- type: { type: String },
- verifie: Boolean,
- visibility: Number,
- },
- ],
- },
- user_settings: {
- afk_timeout: Number,
- allow_accessibility_detection: Boolean,
- animate_emoji: Boolean,
- animate_stickers: Number,
- contact_sync_enabled: Boolean,
- convert_emoticons: Boolean,
- custom_status: {
- emoji_id: String,
- emoji_name: String,
- expires_at: Number,
- text: String,
- },
- default_guilds_restricted: Boolean,
- detect_platform_accounts: Boolean,
- developer_mode: Boolean,
- disable_games_tab: Boolean,
- enable_tts_command: Boolean,
- explicit_content_filter: Number,
- friend_source_flags: { all: Boolean },
- gateway_connected: Boolean,
- gif_auto_play: Boolean,
- // every top guild is displayed as a "folder"
- guild_folders: [
- {
- color: Number,
- guild_ids: [String],
- id: Number,
- name: String,
- },
- ],
- guild_positions: [String], // guild ids ordered by position
- inline_attachment_media: Boolean,
- inline_embed_media: Boolean,
- locale: String, // en_US
- message_display_compact: Boolean,
- native_phone_integration_enabled: Boolean,
- render_embeds: Boolean,
- render_reactions: Boolean,
- restricted_guilds: [String],
- show_current_game: Boolean,
- status: String,
- stream_notifications_enabled: Boolean,
- theme: String, // dark
- timezone_offset: Number, // e.g -60,
- },
-
- presence: {
- status: String,
- activities: [ActivitySchema],
- client_status: ClientStatus,
- },
-});
-
-// @ts-ignore
-export const UserModel = db.model<UserDocument>("User", UserSchema, "users");
diff --git a/util/src/models/index.ts b/util/src/models/index.ts
index b6100f86..94882a0a 100644
--- a/util/src/models/index.ts
+++ b/util/src/models/index.ts
@@ -1,93 +1,4 @@
-// @ts-nocheck
-import mongoose, { Schema, Document } from "mongoose";
-import mongooseAutoPopulate from "mongoose-autopopulate";
-
-type UpdateWithAggregationPipeline = UpdateAggregationStage[];
-type UpdateAggregationStage =
- | { $addFields: any }
- | { $set: any }
- | { $project: any }
- | { $unset: any }
- | { $replaceRoot: any }
- | { $replaceWith: any };
-type EnforceDocument<T, TMethods> = T extends Document ? T : T & Document & TMethods;
-
-declare module "mongoose" {
- interface SchemaOptions {
- removeResponse?: string[];
- }
- interface Model<T, TQueryHelpers = {}, TMethods = {}> {
- // removed null -> always return document -> throw error if it doesn't exist
- findOne(
- filter?: FilterQuery<T>,
- projection?: any | null,
- options?: QueryOptions | null,
- callback?: (err: CallbackError, doc: EnforceDocument<T, TMethods>) => void
- ): QueryWithHelpers<EnforceDocument<T, TMethods>, EnforceDocument<T, TMethods>, TQueryHelpers>;
- findOneAndUpdate(
- filter?: FilterQuery<T>,
- update?: UpdateQuery<T> | UpdateWithAggregationPipeline,
- options?: QueryOptions | null,
- callback?: (err: any, doc: EnforceDocument<T, TMethods> | null, res: any) => void
- ): QueryWithHelpers<EnforceDocument<T, TMethods>, EnforceDocument<T, TMethods>, TQueryHelpers>;
- }
-}
-
-var HTTPError: any;
-
-try {
- HTTPError = require("lambert-server").HTTPError;
-} catch (e) {
- HTTPError = Error;
-}
-
-mongoose.plugin(mongooseAutoPopulate);
-
-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];
- });
- },
- });
- schema.post("findOne", function (doc, next) {
- try {
- // @ts-ignore
- const isExistsQuery = JSON.stringify(this._userProvidedFields) === JSON.stringify({ _id: 1 });
- if (!doc && !isExistsQuery) {
- // @ts-ignore
- return next(new HTTPError(`${this?.mongooseCollection?.name}.${this?._conditions?.id} not found`, 400));
- }
- // @ts-ignore
- return next();
- } catch (error) {
- // @ts-ignore
- next();
- }
- });
-});
-
export * from "./Activity";
-export * from "./Application";
-export * from "./Ban";
-export * from "./Channel";
-export * from "./Emoji";
-export * from "./Event";
-export * from "./Template";
-export * from "./Guild";
-export * from "./Invite";
-export * from "./Interaction";
-export * from "./Member";
-export * from "./Message";
+export * from "./BaseClass";
export * from "./Status";
-export * from "./Role";
export * from "./User";
-export * from "./VoiceState";
-export * from "./ReadState";
-export * from "./RateLimit";
diff --git a/util/src/util/Database.ts b/util/src/util/Database.ts
deleted file mode 100644
index ea517234..00000000
--- a/util/src/util/Database.ts
+++ /dev/null
@@ -1,159 +0,0 @@
-// @ts-nocheck
-import "./MongoBigInt";
-import mongoose, { Collection, Connection, LeanDocument } from "mongoose";
-import { ChangeStream, ChangeEvent, Long } from "mongodb";
-import EventEmitter from "events";
-const uri = process.env.MONGO_URL || "mongodb://localhost:27017/fosscord?readPreference=secondaryPreferred";
-import { URL } from "url";
-
-const url = new URL(uri.replace("mongodb://", "http://"));
-
-const connection = mongoose.createConnection(uri, {
- autoIndex: true,
- useNewUrlParser: true,
- useUnifiedTopology: true,
- useFindAndModify: true,
-});
-
-// this will return the new updated document for findOneAndUpdate
-mongoose.set("returnOriginal", false); // https://mongoosejs.com/docs/api/model.html#model_Model.findOneAndUpdate
-
-console.log(`[Database] connect: mongodb://${url.username}@${url.host}${url.pathname}${url.search}`);
-connection.once("open", () => {
- console.log("[Database] connected");
-});
-
-export default <Connection>connection;
-
-function transform<T>(document: T) {
- // @ts-ignore
- if (!document || !document.toObject) {
- try {
- // @ts-ignore
- delete document._id;
- // @ts-ignore
- delete document.__v;
- } catch (error) {}
- return document;
- }
- // @ts-ignore
- return document.toObject({ virtuals: true });
-}
-
-export function toObject<T>(document: T): LeanDocument<T> {
- // @ts-ignore
- return Array.isArray(document) ? document.map((x) => transform<T>(x)) : transform(document);
-}
-
-export interface MongooseCache {
- on(event: "delete", listener: (id: string) => void): this;
- on(event: "change", listener: (data: any) => void): this;
- on(event: "insert", listener: (data: any) => void): this;
- on(event: "close", listener: () => void): this;
-}
-
-export class MongooseCache extends EventEmitter {
- public stream: ChangeStream;
- public data: any;
- public initalizing?: Promise<void>;
-
- constructor(
- public collection: Collection,
- public pipeline: Array<Record<string, unknown>>,
- public opts: {
- onlyEvents: boolean;
- array?: boolean;
- }
- ) {
- super();
- if (this.opts.array == null) this.opts.array = true;
- }
-
- init = () => {
- if (this.initalizing) return this.initalizing;
- this.initalizing = new Promise(async (resolve, reject) => {
- // @ts-ignore
- this.stream = this.collection.watch(this.pipeline, { fullDocument: "updateLookup" });
-
- this.stream.on("change", this.change);
- this.stream.on("close", this.destroy);
- this.stream.on("error", console.error);
-
- if (!this.opts.onlyEvents) {
- const arr = await this.collection.aggregate(this.pipeline).toArray();
- if (this.opts.array) this.data = arr || [];
- else this.data = arr?.[0];
- }
- resolve();
- });
- return this.initalizing;
- };
-
- changeStream = (pipeline: any) => {
- this.pipeline = pipeline;
- this.destroy();
- this.init();
- };
-
- convertResult = (obj: any) => {
- if (obj instanceof Long) return BigInt(obj.toString());
- if (typeof obj === "object") {
- Object.keys(obj).forEach((key) => {
- obj[key] = this.convertResult(obj[key]);
- });
- }
-
- return obj;
- };
-
- change = (doc: ChangeEvent) => {
- try {
- switch (doc.operationType) {
- case "dropDatabase":
- return this.destroy();
- case "drop":
- return this.destroy();
- case "delete":
- if (!this.opts.onlyEvents) {
- if (this.opts.array) {
- this.data = this.data.filter((x: any) => doc.documentKey?._id?.equals(x._id));
- } else this.data = null;
- }
- return this.emit("delete", doc.documentKey._id.toHexString());
- case "insert":
- if (!this.opts.onlyEvents) {
- if (this.opts.array) this.data.push(doc.fullDocument);
- else this.data = doc.fullDocument;
- }
- return this.emit("insert", doc.fullDocument);
- case "update":
- case "replace":
- if (!this.opts.onlyEvents) {
- if (this.opts.array) {
- const i = this.data.findIndex((x: any) => doc.fullDocument?._id?.equals(x._id));
- if (i == -1) this.data.push(doc.fullDocument);
- else this.data[i] = doc.fullDocument;
- } else this.data = doc.fullDocument;
- }
-
- return this.emit("change", doc.fullDocument);
- case "invalidate":
- return this.destroy();
- default:
- return;
- }
- } catch (error) {
- this.emit("error", error);
- }
- };
-
- destroy = () => {
- this.data = null;
- this.stream?.off("change", this.change);
- this.emit("close");
-
- if (this.stream.isClosed()) return;
-
- return this.stream.close();
- };
-}
diff --git a/util/src/util/AutoUpdate.ts b/util/util/AutoUpdate.ts
index a2ce73c2..a2ce73c2 100644
--- a/util/src/util/AutoUpdate.ts
+++ b/util/util/AutoUpdate.ts
diff --git a/util/src/util/BitField.ts b/util/util/BitField.ts
index 728dc632..728dc632 100644
--- a/util/src/util/BitField.ts
+++ b/util/util/BitField.ts
diff --git a/util/src/util/Config.ts b/util/util/Config.ts
index a93e1846..a93e1846 100644
--- a/util/src/util/Config.ts
+++ b/util/util/Config.ts
diff --git a/util/src/util/Constants.ts b/util/util/Constants.ts
index a9978c51..a9978c51 100644
--- a/util/src/util/Constants.ts
+++ b/util/util/Constants.ts
diff --git a/util/src/util/Event.ts b/util/util/Event.ts
index 0dbddc76..0dbddc76 100644
--- a/util/src/util/Event.ts
+++ b/util/util/Event.ts
diff --git a/util/src/util/Intents.ts b/util/util/Intents.ts
index 943b29cf..943b29cf 100644
--- a/util/src/util/Intents.ts
+++ b/util/util/Intents.ts
diff --git a/util/src/util/MessageFlags.ts b/util/util/MessageFlags.ts
index c76be4c8..c76be4c8 100644
--- a/util/src/util/MessageFlags.ts
+++ b/util/util/MessageFlags.ts
diff --git a/util/src/util/MongoBigInt.ts b/util/util/MongoBigInt.ts
index 2ae8b91c..2ae8b91c 100644
--- a/util/src/util/MongoBigInt.ts
+++ b/util/util/MongoBigInt.ts
diff --git a/util/src/util/Permissions.ts b/util/util/Permissions.ts
index 63d87e48..63d87e48 100644
--- a/util/src/util/Permissions.ts
+++ b/util/util/Permissions.ts
diff --git a/util/src/util/RabbitMQ.ts b/util/util/RabbitMQ.ts
index 9da41990..9da41990 100644
--- a/util/src/util/RabbitMQ.ts
+++ b/util/util/RabbitMQ.ts
diff --git a/util/src/util/Regex.ts b/util/util/Regex.ts
index 83fc9fe8..83fc9fe8 100644
--- a/util/src/util/Regex.ts
+++ b/util/util/Regex.ts
diff --git a/util/src/util/Snowflake.ts b/util/util/Snowflake.ts
index 1d725710..1d725710 100644
--- a/util/src/util/Snowflake.ts
+++ b/util/util/Snowflake.ts
diff --git a/util/src/util/String.ts b/util/util/String.ts
index 55f11e8d..55f11e8d 100644
--- a/util/src/util/String.ts
+++ b/util/util/String.ts
diff --git a/util/src/util/UserFlags.ts b/util/util/UserFlags.ts
index 72394eff..72394eff 100644
--- a/util/src/util/UserFlags.ts
+++ b/util/util/UserFlags.ts
diff --git a/util/src/util/checkToken.ts b/util/util/checkToken.ts
index 91bf08d5..91bf08d5 100644
--- a/util/src/util/checkToken.ts
+++ b/util/util/checkToken.ts
diff --git a/util/src/util/index.ts b/util/util/index.ts
index e52a23b7..67c45b59 100644
--- a/util/src/util/index.ts
+++ b/util/util/index.ts
@@ -9,3 +9,4 @@ export * from "./UserFlags";
export * from "./toBigInt";
export * from "./RabbitMQ";
export * from "./Event";
+export * from "./checkToken";
diff --git a/util/src/util/toBigInt.ts b/util/util/toBigInt.ts
index b7985928..b7985928 100644
--- a/util/src/util/toBigInt.ts
+++ b/util/util/toBigInt.ts
|