summary refs log tree commit diff
path: root/src/util/entities/Guild.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-25 18:24:21 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-25 23:35:18 +1000
commitf44f5d7ac2d24ff836c2e1d4b2fa58da04b13052 (patch)
treea6655c41bb3db79c30fd876b06ee60fe9cf70c9b /src/util/entities/Guild.ts
parentAllow edited_timestamp to passthrough in handleMessage (diff)
downloadserver-f44f5d7ac2d24ff836c2e1d4b2fa58da04b13052.tar.xz
Refactor to mono-repo + upgrade packages
Diffstat (limited to '')
-rw-r--r--src/util/entities/Guild.ts (renamed from util/src/entities/Guild.ts)12
1 files changed, 6 insertions, 6 deletions
diff --git a/util/src/entities/Guild.ts b/src/util/entities/Guild.ts

index 143cb542..2ce7c213 100644 --- a/util/src/entities/Guild.ts +++ b/src/util/entities/Guild.ts
@@ -86,7 +86,7 @@ export class Guild extends BaseClass { //TODO: https://discord.com/developers/docs/resources/guild#guild-object-guild-features @Column({ nullable: true }) - primary_category_id: number; + primary_category_id?: string; // TODO: this was number? @Column({ nullable: true }) icon?: string; @@ -285,7 +285,7 @@ export class Guild extends BaseClass { }) { const guild_id = Snowflake.generate(); - const guild = await new Guild({ + const guild = await Guild.create({ name: body.name || "Fosscord", icon: await handleFile(`/icons/${guild_id}`, body.icon as string), region: Config.get().regions.default, @@ -294,7 +294,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: Config.get().guild.defaultFeatures, - primary_category_id: null, + primary_category_id: undefined, id: guild_id, max_members: 250000, max_presences: 250000, @@ -320,7 +320,7 @@ export class Guild extends BaseClass { // we have to create the role _after_ the guild because else we would get a "SQLITE_CONSTRAINT: FOREIGN KEY constraint failed" error // TODO: make the @everyone a pseudorole that is dynamically generated at runtime so we can save storage - await new Role({ + await Role.create({ id: guild_id, guild_id: guild_id, color: 0, @@ -331,8 +331,8 @@ export class Guild extends BaseClass { name: "@everyone", permissions: String("2251804225"), position: 0, - icon: null, - unicode_emoji: null + icon: undefined, + unicode_emoji: undefined }).save(); if (!body.channels || !body.channels.length) body.channels = [{ id: "01", type: 0, name: "general", nsfw: false }];