summary refs log tree commit diff
path: root/util
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-13 01:11:03 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-13 01:11:03 +0200
commit4f1b926d097c68b6c73677b710c9731ddc307336 (patch)
treee341e4c8c560a5e9d32aed583ac4c859e6ef5dc8 /util
parent:bug: fix channel events + message send (diff)
downloadserver-4f1b926d097c68b6c73677b710c9731ddc307336.tar.xz
:bug: fix dm #321
Diffstat (limited to 'util')
-rw-r--r--util/src/entities/Channel.ts12
-rw-r--r--util/src/util/Permissions.ts2
2 files changed, 7 insertions, 7 deletions
diff --git a/util/src/entities/Channel.ts b/util/src/entities/Channel.ts
index 592b0b83..fc954f63 100644
--- a/util/src/entities/Channel.ts
+++ b/util/src/entities/Channel.ts
@@ -28,8 +28,8 @@ export class Channel extends BaseClass {
 	@Column()
 	created_at: Date;
 
-	@Column()
-	name: string;
+	@Column({ nullable: true })
+	name?: string;
 
 	@Column({ type: "simple-enum", enum: ChannelType })
 	type: ChannelType;
@@ -76,11 +76,11 @@ export class Channel extends BaseClass {
 	@Column({ nullable: true })
 	default_auto_archive_duration?: number;
 
-	@Column()
-	position: number;
+	@Column({ nullable: true })
+	position?: number;
 
-	@Column({ type: "simple-json" })
-	permission_overwrites: ChannelPermissionOverwrite[];
+	@Column({ type: "simple-json", nullable: true })
+	permission_overwrites?: ChannelPermissionOverwrite[];
 
 	@Column({ nullable: true })
 	video_quality_mode?: number;
diff --git a/util/src/util/Permissions.ts b/util/src/util/Permissions.ts
index 628a495d..9d87253a 100644
--- a/util/src/util/Permissions.ts
+++ b/util/src/util/Permissions.ts
@@ -242,7 +242,7 @@ export async function getPermission(
 		});
 	}
 
-	let recipient_ids: any = channel?.recipients?.map((x) => x.id);
+	let recipient_ids: any = channel?.recipients?.map((x) => x.user_id);
 	if (!recipient_ids?.length) recipient_ids = null;
 
 	// TODO: remove guild.roles and convert recipient_ids to recipients