feat: VoiceChannel Status
This commit is contained in:
parent
c257659c99
commit
5962c59684
12
src/client/websocket/handlers/VOICE_CHANNEL_STATUS_UPDATE.js
Normal file
12
src/client/websocket/handlers/VOICE_CHANNEL_STATUS_UPDATE.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const { Events } = require('../../../util/Constants');
|
||||||
|
|
||||||
|
module.exports = (client, { d: data }) => {
|
||||||
|
const channel = client.channels.cache.get(data.id);
|
||||||
|
if (channel) {
|
||||||
|
const old = channel._clone();
|
||||||
|
channel.status = data.status;
|
||||||
|
client.emit(Events.CHANNEL_UPDATE, old, channel);
|
||||||
|
}
|
||||||
|
};
|
@ -75,6 +75,7 @@ const handlers = Object.fromEntries([
|
|||||||
['CALL_DELETE', require('./CALL_DELETE')],
|
['CALL_DELETE', require('./CALL_DELETE')],
|
||||||
['USER_SETTINGS_UPDATE', require('./USER_SETTINGS_UPDATE')],
|
['USER_SETTINGS_UPDATE', require('./USER_SETTINGS_UPDATE')],
|
||||||
['USER_GUILD_SETTINGS_UPDATE', require('./USER_GUILD_SETTINGS_UPDATE')],
|
['USER_GUILD_SETTINGS_UPDATE', require('./USER_GUILD_SETTINGS_UPDATE')],
|
||||||
|
['VOICE_CHANNEL_STATUS_UPDATE', require('./VOICE_CHANNEL_STATUS_UPDATE')],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
module.exports = handlers;
|
module.exports = handlers;
|
||||||
|
@ -90,6 +90,14 @@ class BaseGuildVoiceChannel extends GuildChannel {
|
|||||||
if ('nsfw' in data) {
|
if ('nsfw' in data) {
|
||||||
this.nsfw = data.nsfw;
|
this.nsfw = data.nsfw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('status' in data) {
|
||||||
|
/**
|
||||||
|
* The status of the voice channel (max 500 characters)
|
||||||
|
* @type {?string}
|
||||||
|
*/
|
||||||
|
this.status = data.status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user