Skip to content

Commit

Permalink
feat(thread): v13 add newlyCreated to threadCreate event (#7481)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed Feb 20, 2022
1 parent 0b54089 commit 2b3db73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/client/actions/ThreadCreate.js
Expand Up @@ -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 };
}
Expand Down
2 changes: 1 addition & 1 deletion typings/index.d.ts
Expand Up @@ -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<Snowflake, ThreadChannel>];
threadMemberUpdate: [oldMember: ThreadMember, newMember: ThreadMember];
Expand Down

0 comments on commit 2b3db73

Please sign in to comment.