Skip to content

Commit d452006

Browse files
committed
Maybe fix an issue elisa had with discord.py
1 parent ea79151 commit d452006

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/util/entities/Channel.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,12 @@ export class Channel extends BaseClass {
700700
}
701701

702702
toJSON() {
703+
// needed as some CHANNEL_UPDATE event doesn't call the calculatePosition function and doesn't populate
704+
// the position field. Needs to be looked into more
705+
// TODO: Look into when this can be undefined during CHANNEL_UPDATE
706+
if (this.position === undefined) {
707+
this.position = 0;
708+
}
703709
return {
704710
...this,
705711

0 commit comments

Comments
 (0)