summary refs log tree commit diff
path: root/api/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/util')
-rw-r--r--api/src/util/handlers/Message.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/api/src/util/handlers/Message.ts b/api/src/util/handlers/Message.ts

index 7035bc5c..34fb3d05 100644 --- a/api/src/util/handlers/Message.ts +++ b/api/src/util/handlers/Message.ts
@@ -47,7 +47,7 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> { const channel = await Channel.findOneOrFail({ where: { id: opts.channel_id }, relations: ["recipients"] }); if (!channel || !opts.channel_id) throw new HTTPError("Channel not found", 404); - const message = new Message({ + const message = Object.assign(new Message(), { ...opts, sticker_items: opts.sticker_ids?.map((x) => ({ id: x })), guild_id: channel.guild_id, @@ -132,9 +132,9 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> { } } - message.mention_channels = mention_channel_ids.map((x) => new Channel({ id: x })); - message.mention_roles = mention_role_ids.map((x) => new Role({ id: x })); - message.mentions = mention_user_ids.map((x) => new User({ id: x })); + message.mention_channels = mention_channel_ids.map((x) => Object.assign(new Channel(), { id: x })); + message.mention_roles = mention_role_ids.map((x) => Object.assign(new Role(), { id: x })); + message.mentions = mention_user_ids.map((x) => Object.assign(new User(), { id: x })); message.mention_everyone = mention_everyone; // TODO: check and put it all in the body