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:
March 7th
2022-07-15 17:26:25 +07:00
parent fb6ab3f8e8
commit fad6d708b4
17 changed files with 826 additions and 780 deletions

View 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);
};

View 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);
};

View 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);
};

View File

@@ -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

View File

@@ -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')],