Maybe fix an issue elisa had with discord.py

This commit is contained in:
whinis
2026-03-05 19:53:20 -05:00
committed by Rory&
parent 195d379e33
commit f9147b78ca
+6
View File
@@ -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(),