feat: new class Call
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
const Call = require('../../../structures/Call');
|
||||
const { Events } = require('../../../util/Constants');
|
||||
module.exports = (client, packet) => {
|
||||
for (const voice of packet.d.voice_states) {
|
||||
@@ -7,9 +8,7 @@ module.exports = (client, packet) => {
|
||||
/**
|
||||
* 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
|
||||
* @param {Call} call Call
|
||||
*/
|
||||
client.emit(Events.CALL_CREATE, packet.d.channel_id, packet.d.region, packet.d.ringing);
|
||||
client.emit(Events.CALL_CREATE, new Call(client, packet.d));
|
||||
};
|
||||
|
@@ -1,10 +1,11 @@
|
||||
'use strict';
|
||||
const Call = require('../../../structures/Call');
|
||||
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
|
||||
* @param {Call} call Call
|
||||
*/
|
||||
client.emit(Events.CALL_DELETE, packet.d.channel_id);
|
||||
client.emit(Events.CALL_DELETE, new Call(client, packet.d));
|
||||
};
|
||||
|
@@ -1,12 +1,11 @@
|
||||
'use strict';
|
||||
const Call = require('../../../structures/Call');
|
||||
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
|
||||
* @param {Call} call Call
|
||||
*/
|
||||
client.emit(Events.CALL_UPDATE, packet.d.channel_id, packet.d.region, packet.d.ringing);
|
||||
client.emit(Events.CALL_UPDATE, new Call(client, packet.d));
|
||||
};
|
||||
|
Reference in New Issue
Block a user