summary refs log tree commit diff
path: root/src/database
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-08-16 14:53:25 +0200
committerRory& <root@rory.gay>2026-08-16 14:53:25 +0200
commitfcd9e9e0c983238608f50f58825ca4d5fe098bf6 (patch)
tree3061bbb482c0caaf89715cc0c499677f767cdb59 /src/database
parentUpdate webstorm run configurations (diff)
downloadserver-ts-master.tar.xz
Fix discovery HEAD github/master master
Diffstat (limited to '')
-rw-r--r--src/database/entities/Guild.ts20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/database/entities/Guild.ts b/src/database/entities/Guild.ts

index 0b3bd27e..f7de1032 100644 --- a/src/database/entities/Guild.ts +++ b/src/database/entities/Guild.ts
@@ -336,9 +336,9 @@ export class Guild extends BaseClass { }, }, }),*/ - emojis: this.emojis.map((e) => e.toJSON()) ?? undefined, + emojis: this.emojis?.map((e) => e.toJSON()) ?? undefined, emoji_count: this.emojis ? this.emojis.length : undefined, - stickers: this.stickers.map((s) => s.toJSON()) ?? undefined, + stickers: this.stickers?.map((s) => s.toJSON()) ?? undefined, sticker_count: this.stickers ? this.stickers.length : undefined, auto_removed: false, primary_category_id: this.primary_category_id!, @@ -346,13 +346,15 @@ export class Guild extends BaseClass { is_published: false, reasons_to_join: [], created_at: new Date(Snowflake.deconstruct(this.id).timestamp).toISOString(), // TODO: make column - primary_category: ( - await Categories.findOneOrFail({ - where: { - id: this.primary_category_id!, - }, - }) - ).toJSON(), + primary_category: this.primary_category_id + ? ( + await Categories.findOneOrFail({ + where: { + id: this.primary_category_id!, + }, + }) + ).toJSON() + : undefined, }; }