chore(release): v2.3.75
- fix: VoiceStateUpdate event not working (DM channels + Group DM channels) - docs: add sendSlash method - feat: Add new Event: callCreate, callUpdate, callDelete - fix(GroupDM): method require Class
This commit is contained in:
15
src/client/websocket/handlers/CALL_CREATE.js
Normal file
15
src/client/websocket/handlers/CALL_CREATE.js
Normal file
@@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
const { Events } = require('../../../util/Constants');
|
||||
module.exports = (client, packet) => {
|
||||
for (const voice of packet.d.voice_states) {
|
||||
client.actions.VoiceStateUpdate.handle(voice);
|
||||
}
|
||||
/**
|
||||
* Emitted whenever received a call
|
||||
* @event Client#callCreate
|
||||
* @param {Snowflake} channelId DM / Group DM channel ID
|
||||
* @param {string} region Voice server region
|
||||
* @param {?Snowflake[]} ringing List of user ID who is ringing
|
||||
*/
|
||||
client.emit(Events.CALL_CREATE, packet.d.channel_id, packet.d.region, packet.d.ringing);
|
||||
};
|
10
src/client/websocket/handlers/CALL_DELETE.js
Normal file
10
src/client/websocket/handlers/CALL_DELETE.js
Normal file
@@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
const { Events } = require('../../../util/Constants');
|
||||
module.exports = (client, packet) => {
|
||||
/**
|
||||
* Emitted whenever delete a call
|
||||
* @event Client#callDelete
|
||||
* @param {Snowflake} channelId DM / Group DM channel ID
|
||||
*/
|
||||
client.emit(Events.CALL_DELETE, packet.d.channel_id);
|
||||
};
|
12
src/client/websocket/handlers/CALL_UPDATE.js
Normal file
12
src/client/websocket/handlers/CALL_UPDATE.js
Normal file
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
const { Events } = require('../../../util/Constants');
|
||||
module.exports = (client, packet) => {
|
||||
/**
|
||||
* Emitted whenever update a call
|
||||
* @event Client#callUpdate
|
||||
* @param {Snowflake} channelId DM / Group DM channel ID
|
||||
* @param {string} region Voice server region
|
||||
* @param {?Snowflake[]} ringing List of user ID who is ringing
|
||||
*/
|
||||
client.emit(Events.CALL_UPDATE, packet.d.channel_id, packet.d.region, packet.d.ringing);
|
||||
};
|
@@ -115,7 +115,13 @@ module.exports = (client, { d: data }, shard) => {
|
||||
client.user._patchNote(data.notes);
|
||||
|
||||
for (const private_channel of data.private_channels) {
|
||||
client.channels._add(private_channel);
|
||||
const PrivateChannel = client.channels._add(private_channel);
|
||||
client.ws.broadcast({
|
||||
op: Opcodes.DM_UPDATE,
|
||||
d: {
|
||||
channel_id: PrivateChannel.id,
|
||||
},
|
||||
});
|
||||
}
|
||||
// Remove event because memory leak
|
||||
|
||||
|
@@ -9,6 +9,9 @@ const handlers = Object.fromEntries([
|
||||
['APPLICATION_COMMAND_CREATE', require('./APPLICATION_COMMAND_CREATE')],
|
||||
['APPLICATION_COMMAND_DELETE', require('./APPLICATION_COMMAND_DELETE')],
|
||||
['APPLICATION_COMMAND_UPDATE', require('./APPLICATION_COMMAND_UPDATE')],
|
||||
['CALL_CREATE', require('./CALL_CREATE')],
|
||||
['CALL_UPDATE', require('./CALL_UPDATE')],
|
||||
['CALL_DELETE', require('./CALL_DELETE')],
|
||||
['GUILD_CREATE', require('./GUILD_CREATE')],
|
||||
['GUILD_DELETE', require('./GUILD_DELETE')],
|
||||
['GUILD_UPDATE', require('./GUILD_UPDATE')],
|
||||
|
Reference in New Issue
Block a user