diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-07-31 21:00:03 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-07-31 21:00:03 +1000 |
commit | 496cfc8ea19ac430cfeaf9d7b8d3b3bc6843b852 (patch) | |
tree | 4aac0dbaba5dabcd8e714d66b69b2d15bb8b36ac /src/util/entities | |
parent | lazyrequest dont crash when no members can be found in lazyrequest (diff) | |
download | server-496cfc8ea19ac430cfeaf9d7b8d3b3bc6843b852.tar.xz |
some abaddon compat
Diffstat (limited to 'src/util/entities')
-rw-r--r-- | src/util/entities/Message.ts | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/util/entities/Message.ts b/src/util/entities/Message.ts index 519c431e..e5390300 100644 --- a/src/util/entities/Message.ts +++ b/src/util/entities/Message.ts @@ -193,7 +193,7 @@ export class Message extends BaseClass { }; @Column({ nullable: true }) - flags?: string; + flags?: number; @Column({ type: "simple-json", nullable: true }) message_reference?: { @@ -217,6 +217,30 @@ export class Message extends BaseClass { @Column({ type: "simple-json", nullable: true }) components?: MessageComponent[]; + + toJSON(): Message { + return { + ...this, + author_id: undefined, + member_id: undefined, + guild_id: undefined, + webhook_id: undefined, + application_id: undefined, + nonce: undefined, + + tts: this.tts ?? false, + guild: this.guild ?? undefined, + webhook: this.webhook ?? undefined, + interaction: this.interaction ?? undefined, + reactions: this.reactions ?? undefined, + sticker_items: this.sticker_items ?? undefined, + message_reference: this.message_reference ?? undefined, + author: this.author?.toPublicUser() ?? undefined, + activity: this.activity ?? undefined, + application: this.application ?? undefined, + components: this.components ?? undefined, + }; + } } export interface MessageComponent { |