summary refs log tree commit diff
path: root/src/util/entities/Channel.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-09-22 15:39:15 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-09-22 15:46:35 +1000
commit3c4691499249e184f4e418ae798379f98d5f4cff (patch)
tree952a1f634bd860aec68064151580aed0cbbfb78f /src/util/entities/Channel.ts
parenta ton of broken shit and approx 1 nice function (diff)
parentMerge branch 'master' of github.com:spacebarchat/server (diff)
downloadserver-feat/federation.tar.xz
Merge branch 'master' into feat/federation feat/federation
Diffstat (limited to 'src/util/entities/Channel.ts')
-rw-r--r--src/util/entities/Channel.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/util/entities/Channel.ts b/src/util/entities/Channel.ts

index 8b692ac7..0ccabd62 100644 --- a/src/util/entities/Channel.ts +++ b/src/util/entities/Channel.ts
@@ -102,10 +102,11 @@ export class Channel extends BaseClass { guild_id?: string; @JoinColumn({ name: "guild_id" }) - @ManyToOne(() => Guild, { + @ManyToOne(() => Guild, (guild) => guild.channels, { onDelete: "CASCADE", + nullable: true, }) - guild: Guild; + guild?: Guild; @Column({ nullable: true }) @RelationId((channel: Channel) => channel.parent) @@ -571,7 +572,6 @@ export interface DMChannel extends Omit<Channel, "type" | "recipients"> { export function isTextChannel(type: ChannelType): boolean { switch (type) { case ChannelType.GUILD_STORE: - case ChannelType.GUILD_VOICE: case ChannelType.GUILD_STAGE_VOICE: case ChannelType.GUILD_CATEGORY: case ChannelType.GUILD_FORUM: @@ -580,6 +580,7 @@ export function isTextChannel(type: ChannelType): boolean { case ChannelType.DM: case ChannelType.GROUP_DM: case ChannelType.GUILD_NEWS: + case ChannelType.GUILD_VOICE: case ChannelType.GUILD_NEWS_THREAD: case ChannelType.GUILD_PUBLIC_THREAD: case ChannelType.GUILD_PRIVATE_THREAD: