summary refs log tree commit diff
path: root/util/src/entities
diff options
context:
space:
mode:
Diffstat (limited to 'util/src/entities')
-rw-r--r--util/src/entities/Categories.ts32
-rw-r--r--util/src/entities/Config.ts14
-rw-r--r--util/src/entities/Guild.ts26
-rw-r--r--util/src/entities/User.ts9
-rw-r--r--util/src/entities/index.ts1
5 files changed, 51 insertions, 31 deletions
diff --git a/util/src/entities/Categories.ts b/util/src/entities/Categories.ts
new file mode 100644
index 00000000..1d272118
--- /dev/null
+++ b/util/src/entities/Categories.ts
@@ -0,0 +1,32 @@
+import { PrimaryColumn, Column, Entity} from "typeorm";
+import { BaseClassWithoutId } from "./BaseClass";
+
+// TODO: categories:
+// [{
+// 	"id": 16,
+// 	"default": "Anime & Manga",
+// 	"localizations": {
+// 			"de": "Anime & Manga",
+// 			"fr": "Anim\u00e9s et mangas",
+// 			"ru": "\u0410\u043d\u0438\u043c\u0435 \u0438 \u043c\u0430\u043d\u0433\u0430"
+// 		}
+// 	},
+// 	"is_primary": false/true
+// }]
+
+@Entity("categories")
+export class CategoryEntity extends BaseClassWithoutId { // Not using snowflake
+    
+    @PrimaryColumn()
+	id: number;
+
+    @Column()
+    default: string;
+
+    @Column({ type: "simple-json", nullable: false })
+    localizations: string;
+
+    @Column()
+    is_primary: boolean;
+
+}
\ No newline at end of file
diff --git a/util/src/entities/Config.ts b/util/src/entities/Config.ts
index 6993cc09..f4a266dc 100644
--- a/util/src/entities/Config.ts
+++ b/util/src/entities/Config.ts
@@ -157,7 +157,12 @@ export interface ConfigValue {
 		available: Region[];
 	};
 	guild: {
-		showAllGuildsInDiscovery: boolean;
+		discovery: {
+			showAllGuilds: boolean;
+			useRecommendation: boolean; // TODO: Recommendation, privacy concern?
+			offset: number;
+			limit: number;
+		};
 		autoJoin: {
 			enabled: boolean;
 			guilds: string[];
@@ -353,7 +358,12 @@ export const DefaultConfigOptions: ConfigValue = {
 		],
 	},
 	guild: {
-		showAllGuildsInDiscovery: false,
+		discovery: {
+			showAllGuilds: false,
+			useRecommendation: false,
+			offset: 0,
+			limit: 24,
+		},
 		autoJoin: {
 			enabled: true,
 			canLeave: true,
diff --git a/util/src/entities/Guild.ts b/util/src/entities/Guild.ts
index 6a1df4d6..18fa7a0a 100644
--- a/util/src/entities/Guild.ts
+++ b/util/src/entities/Guild.ts
@@ -17,28 +17,6 @@ import { Webhook } from "./Webhook";
 // TODO: guild_scheduled_events
 // TODO: stage_instances
 // TODO: threads
-// TODO: categories:
-// [{
-// 	"id": 16,
-// 	"name": {
-// 		"default": "Anime & Manga",
-// 		"localizations": {
-// 			"de": "Anime & Manga",
-// 			"fr": "Anim\u00e9s et mangas",
-// 			"ru": "\u0410\u043d\u0438\u043c\u0435 \u0438 \u043c\u0430\u043d\u0433\u0430"
-// 		}
-// 	},
-// 	"is_primary": false
-// }]
-// TODO:
-//  primary_category :{
-// 	id: 1,
-// 	name: {
-// 		default: "Gaming",
-// 		localizations: { de: "Gaming", fr: "Gaming", ru: "\u0418\u0433\u0440\u044b" },
-// 		is_primary: true,
-// 	},
-// };
 // TODO:
 // "keywords": [
 // 		"Genshin Impact",
@@ -108,6 +86,9 @@ export class Guild extends BaseClass {
 	//TODO: https://discord.com/developers/docs/resources/guild#guild-object-guild-features
 
 	@Column({ nullable: true })
+	primary_category_id: number;
+
+	@Column({ nullable: true })
 	icon?: string;
 
 	@Column({ nullable: true })
@@ -306,6 +287,7 @@ export class Guild extends BaseClass {
 			default_message_notifications: 1, // defaults effect: setting the push default at mentions-only will save a lot
 			explicit_content_filter: 0,
 			features: [],
+			primary_category_id: null,
 			id: guild_id,
 			max_members: 250000,
 			max_presences: 250000,
diff --git a/util/src/entities/User.ts b/util/src/entities/User.ts
index 5f2618e0..1027331a 100644
--- a/util/src/entities/User.ts
+++ b/util/src/entities/User.ts
@@ -289,12 +289,7 @@ export const defaultSettings: UserSettings = {
 	animate_stickers: 0,
 	contact_sync_enabled: false,
 	convert_emoticons: false,
-	custom_status: {
-		emoji_id: undefined,
-		emoji_name: undefined,
-		expires_at: undefined,
-		text: undefined,
-	},
+	custom_status: null,
 	default_guilds_restricted: false,
 	detect_platform_accounts: true,
 	developer_mode: false,
@@ -334,7 +329,7 @@ export interface UserSettings {
 		emoji_name?: string;
 		expires_at?: number;
 		text?: string;
-	};
+	} | null;
 	default_guilds_restricted: boolean;
 	detect_platform_accounts: boolean;
 	developer_mode: boolean;
diff --git a/util/src/entities/index.ts b/util/src/entities/index.ts
index c1f979d4..fc18d422 100644
--- a/util/src/entities/index.ts
+++ b/util/src/entities/index.ts
@@ -3,6 +3,7 @@ export * from "./Attachment";
 export * from "./AuditLog";
 export * from "./Ban";
 export * from "./BaseClass";
+export * from "./Categories";
 export * from "./Channel";
 export * from "./Config";
 export * from "./ConnectedAccount";