summary refs log tree commit diff
diff options
context:
space:
mode:
authorwhinis <whinis@whinis.com>2026-03-05 19:53:20 -0500
committerRory& <root@rory.gay>2026-04-13 12:11:07 +0200
commitf9147b78cae16c2228c6fef0ca3660b1784ddc7d (patch)
tree058fd157f83a435cb7422273b0ffb67cf6c1b9a3
parentAdded the @JsonRemoveEmpty decrorator to most of the fields in the message cl... (diff)
downloadserver-ts-f9147b78cae16c2228c6fef0ca3660b1784ddc7d.tar.xz
Maybe fix an issue elisa had with discord.py
-rw-r--r--src/util/entities/Channel.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util/entities/Channel.ts b/src/util/entities/Channel.ts

index 1fa552b2..611351aa 100644 --- a/src/util/entities/Channel.ts +++ b/src/util/entities/Channel.ts
@@ -704,6 +704,12 @@ export class Channel extends BaseClass { } toJSON(): PublicChannel { + // needed as some CHANNEL_UPDATE event doesn't call the calculatePosition function and doesn't populate + // the position field. Needs to be looked into more + // TODO: Look into when this can be undefined during CHANNEL_UPDATE + if (this.position === undefined) { + this.position = 0; + } return { ...this, last_pin_timestamp: this.last_pin_timestamp?.toISOString(),