5 files changed, 129 insertions, 4 deletions
diff --git a/src/models/Channel.ts b/src/models/Channel.ts
new file mode 100644
index 00000000..81fec185
--- /dev/null
+++ b/src/models/Channel.ts
@@ -0,0 +1,19 @@
+export interface Channel {
+ id: bigint;
+ guild_id: bigint;
+ last_message_id: string;
+ last_pin_timestamp: string;
+ name: string;
+ nsfw: boolean;
+ parent_id: bigint;
+ position: number;
+ rate_limit_per_user: number;
+ topic: string | null;
+ type: number;
+ permission_overwrites: {
+ allow: bigint;
+ deny: bigint;
+ id: bigint;
+ type: number;
+ }[];
+}
diff --git a/src/models/Emoji.ts b/src/models/Emoji.ts
new file mode 100644
index 00000000..1facc252
--- /dev/null
+++ b/src/models/Emoji.ts
@@ -0,0 +1,12 @@
+export interface Emoji {
+ allNamesString: string; // e.g. :thonk:
+ animated: boolean;
+ available: boolean;
+ guildId: bigint;
+ id: bigint;
+ managed: boolean;
+ name: string;
+ require_colons: boolean;
+ url: string;
+ roles: [];
+}
diff --git a/src/models/Guild.ts b/src/models/Guild.ts
new file mode 100644
index 00000000..a4e7460f
--- /dev/null
+++ b/src/models/Guild.ts
@@ -0,0 +1,38 @@
+export interface Guild {
+ id: bigint;
+ name: string;
+ icon: string; // e.g. "28776e7ad42922582be25bb06cdc5b53"
+ icon_hash: string;
+ afk_channel_id: bigint;
+ afk_timeout: number;
+ application_id: bigint;
+ banner: string; // id
+ description: string;
+ explicit_content_filter: number;
+ features: string[];
+ /* guild_hashes: // ? what is this
+ channels: {hash: "uZsNP+TWAFY", omitted: false}
+ metadata: {hash: "JCboqYj68bQ", omitted: false}
+ roles: {hash: "1d7EJBRgVqg", omitted: false}
+ version: 1
+ */
+ joined_at: string; // user specific, Date Iso: "2021-01-23T19:01:23.126002+00:00"
+ large: boolean;
+ lazy: boolean; // ? what is this
+ max_members: number; // e.g. default 100.000
+ max_video_channel_users: number; // ? default: 25, is this max 25 streaming or watching
+ member_count: number; // current member count
+ mfa_level: number;
+ owner_id: bigint;
+ preferred_locale: string; // only partnered/verified guilds can choose this
+ premium_subscription_count: number; // number of boosts
+ premium_tier: number; // ? what is this
+ public_updates_channel_id: bigint; //
+ rules_channel_id: bigint;
+ splash: string; // e.g. "32bec3d01f1dc90933cbb0bd75d333b0"
+ system_channel_flags: number;
+ system_channel_id: bigint;
+ vanity_url_code: string;
+ verification_level: number;
+ threads: []; // ? not yet finished
+}
diff --git a/src/models/Role.ts b/src/models/Role.ts
new file mode 100644
index 00000000..44ddfea1
--- /dev/null
+++ b/src/models/Role.ts
@@ -0,0 +1,9 @@
+export interface Role {
+ color: number;
+ hoist: boolean;
+ managed: boolean;
+ mentionable: boolean;
+ name: string;
+ permissions: bigint;
+ position: number;
+}
diff --git a/src/models/User.ts b/src/models/User.ts
index 24184c57..4cef39c6 100644
--- a/src/models/User.ts
+++ b/src/models/User.ts
@@ -1,15 +1,62 @@
import { UserFlags } from "../util/UserFlags";
export interface User {
- id: BigInt;
+ id: bigint;
username: string;
discriminator: string;
- avatar: string;
+ avatar: string | null;
bot: boolean;
system: boolean;
mfa_enabled: boolean;
- locale: string;
+ created_at: number;
verified: boolean;
email: string;
- flags: UserFlags;
+ flags: bigint; // TODO: automatically convert BigInt to BitField of UserFlags
+ hash: string; // hash of the password, salt is saved in password (bcrypt)
+ valid_tokens_since: number; // all tokens with a previous issue date are invalid
+ user_settings: UserSettings;
+}
+
+export interface UserSettings {
+ afk_timeout: number;
+ allow_accessibility_detection: boolean;
+ animate_emoji: boolean;
+ animate_stickers: number;
+ contact_sync_enabled: boolean;
+ convert_emoticons: boolean;
+ custom_status: {
+ emoji_id: bigint | null;
+ emoji_name: string | null;
+ expires_at: number | null;
+ text: string | null;
+ };
+ 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 };
+ gif_auto_play: boolean;
+ guild_folders: // every top guild is displayed as a "folder"
+ {
+ color: number;
+ guild_ids: bigint[];
+ id: number;
+ name: string;
+ }[];
+ guild_positions: bigint[]; // 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: bigint[];
+ show_current_game: boolean;
+ status: "online" | "offline" | "dnd" | "idle";
+ stream_notifications_enabled: boolean;
+ theme: "dark" | "white"; // dark
+ timezone_offset: number; // e.g -60
}
|