From f9147b78cae16c2228c6fef0ca3660b1784ddc7d Mon Sep 17 00:00:00 2001 From: whinis Date: Thu, 5 Mar 2026 19:53:20 -0500 Subject: [PATCH] Maybe fix an issue elisa had with discord.py --- src/util/entities/Channel.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/entities/Channel.ts b/src/util/entities/Channel.ts index 1fa552b24..611351aa4 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(),