mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 11:03:30 +01:00
feat: api v9 and threads (#5570)
Co-authored-by: Noel <icrawltogo@gmail.com> Co-authored-by: Amish Shah <dev@shah.gg> Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> Co-authored-by: SynthGhost <60333233+synthghost@users.noreply.github.com> Co-authored-by: SpaceEEC <24881032+SpaceEEC@users.noreply.github.com> Co-authored-by: Elliot <elliot@maisl.fr> Co-authored-by: Antonio Román <kyradiscord@gmail.com> Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
This commit is contained in:
5
src/client/websocket/handlers/THREAD_CREATE.js
Normal file
5
src/client/websocket/handlers/THREAD_CREATE.js
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (client, packet) => {
|
||||
client.actions.ThreadCreate.handle(packet.d);
|
||||
};
|
||||
5
src/client/websocket/handlers/THREAD_DELETE.js
Normal file
5
src/client/websocket/handlers/THREAD_DELETE.js
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (client, packet) => {
|
||||
client.actions.ThreadDelete.handle(packet.d);
|
||||
};
|
||||
5
src/client/websocket/handlers/THREAD_LIST_SYNC.js
Normal file
5
src/client/websocket/handlers/THREAD_LIST_SYNC.js
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (client, packet) => {
|
||||
client.actions.ThreadListSync.handle(packet.d);
|
||||
};
|
||||
5
src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js
Normal file
5
src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (client, packet) => {
|
||||
client.actions.ThreadMembersUpdate.handle(packet.d);
|
||||
};
|
||||
5
src/client/websocket/handlers/THREAD_MEMBER_UPDATE.js
Normal file
5
src/client/websocket/handlers/THREAD_MEMBER_UPDATE.js
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (client, packet) => {
|
||||
client.actions.ThreadMemberUpdate.handle(packet.d);
|
||||
};
|
||||
16
src/client/websocket/handlers/THREAD_UPDATE.js
Normal file
16
src/client/websocket/handlers/THREAD_UPDATE.js
Normal file
@@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
const { Events } = require('../../../util/Constants');
|
||||
|
||||
module.exports = (client, packet) => {
|
||||
const { old, updated } = client.actions.ChannelUpdate.handle(packet.d);
|
||||
if (old && updated) {
|
||||
/**
|
||||
* Emitted whenever a thread is updated - e.g. name change, archive state change, locked state change.
|
||||
* @event Client#threadUpdate
|
||||
* @param {ThreadChannel} oldThread The thread before the update
|
||||
* @param {ThreadChannel} newThread The thread after the update
|
||||
*/
|
||||
client.emit(Events.THREAD_UPDATE, old, updated);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user