diff --git a/src/client/actions/ThreadCreate.js b/src/client/actions/ThreadCreate.js index f7c36e678720..d2d58599fb43 100644 --- a/src/client/actions/ThreadCreate.js +++ b/src/client/actions/ThreadCreate.js @@ -13,8 +13,9 @@ class ThreadCreateAction extends Action { * Emitted whenever a thread is created or when the client user is added to a thread. * @event Client#threadCreate * @param {ThreadChannel} thread The thread that was created + * @param {boolean} newlyCreated Whether the thread was newly created */ - client.emit(Events.THREAD_CREATE, thread); + client.emit(Events.THREAD_CREATE, thread, data.newly_created ?? false); } return { thread }; } diff --git a/typings/index.d.ts b/typings/index.d.ts index d634484aa9f0..59cc3166128c 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -3969,7 +3969,7 @@ export interface ClientEvents extends BaseClientEvents { roleCreate: [role: Role]; roleDelete: [role: Role]; roleUpdate: [oldRole: Role, newRole: Role]; - threadCreate: [thread: ThreadChannel]; + threadCreate: [thread: ThreadChannel, newlyCreated: boolean]; threadDelete: [thread: ThreadChannel]; threadListSync: [threads: Collection]; threadMemberUpdate: [oldMember: ThreadMember, newMember: ThreadMember];