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 }];
|