summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-06-11 00:09:44 +0200
committerRory& <root@rory.gay>2026-06-11 00:09:44 +0200
commit2270afa41fc09cfba57fe046ff6aa80535a5c417 (patch)
tree87319f3ae929c710f64b274c371527648dc69b80
parentBcrypt worker threads (diff)
downloadserver-ts-2270afa41fc09cfba57fe046ff6aa80535a5c417.tar.xz
Handle welcome message as insert + update
-rw-r--r--src/util/entities/Member.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/util/entities/Member.ts b/src/util/entities/Member.ts

index fba7c400..474e3e83 100644 --- a/src/util/entities/Member.ts +++ b/src/util/entities/Member.ts
@@ -438,6 +438,7 @@ export class Member extends BaseClassWithoutId { const channel = await Channel.findOneOrFail({ where: { id: guild.system_channel_id }, }); + // Send a welcome message const message = Message.create({ type: 7, @@ -456,9 +457,7 @@ export class Member extends BaseClassWithoutId { mention_everyone: false, }); - channel.last_message_id = message.id; - - await message.save(); + await message.insert(); const publicMsg = message.toJSON(); await Promise.all([ emitEvent({ @@ -466,7 +465,7 @@ export class Member extends BaseClassWithoutId { channel_id: message.channel_id, data: publicMsg, } satisfies MessageCreateEvent), - channel.save(), + Channel.update({ id: channel.id }, { last_message_id: message.id }), ]); logTrace("Send welcome message"); }