feat(thread): v13 add newlyCreated to threadCreate event (#7481)

This commit is contained in:
Jiralite
2022-02-20 12:42:23 +00:00
committed by GitHub
parent 0b54089c43
commit 2b3db734df
2 changed files with 3 additions and 2 deletions

View File

@@ -13,8 +13,9 @@ class ThreadCreateAction extends Action {
* Emitted whenever a thread is created or when the client user is added to a thread. * Emitted whenever a thread is created or when the client user is added to a thread.
* @event Client#threadCreate * @event Client#threadCreate
* @param {ThreadChannel} thread The thread that was created * @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 }; return { thread };
} }

2
typings/index.d.ts vendored
View File

@@ -3969,7 +3969,7 @@ export interface ClientEvents extends BaseClientEvents {
roleCreate: [role: Role]; roleCreate: [role: Role];
roleDelete: [role: Role]; roleDelete: [role: Role];
roleUpdate: [oldRole: Role, newRole: Role]; roleUpdate: [oldRole: Role, newRole: Role];
threadCreate: [thread: ThreadChannel]; threadCreate: [thread: ThreadChannel, newlyCreated: boolean];
threadDelete: [thread: ThreadChannel]; threadDelete: [thread: ThreadChannel];
threadListSync: [threads: Collection<Snowflake, ThreadChannel>]; threadListSync: [threads: Collection<Snowflake, ThreadChannel>];
threadMemberUpdate: [oldMember: ThreadMember, newMember: ThreadMember]; threadMemberUpdate: [oldMember: ThreadMember, newMember: ThreadMember];