diff --git a/src/client/websocket/handlers/VOICE_CHANNEL_STATUS_UPDATE.js b/src/client/websocket/handlers/VOICE_CHANNEL_STATUS_UPDATE.js new file mode 100644 index 00000000..266af47 --- /dev/null +++ b/src/client/websocket/handlers/VOICE_CHANNEL_STATUS_UPDATE.js @@ -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); + } +}; diff --git a/src/client/websocket/handlers/index.js b/src/client/websocket/handlers/index.js index 45423cd..f01d263 100644 --- a/src/client/websocket/handlers/index.js +++ b/src/client/websocket/handlers/index.js @@ -75,6 +75,7 @@ const handlers = Object.fromEntries([ ['CALL_DELETE', require('./CALL_DELETE')], ['USER_SETTINGS_UPDATE', require('./USER_SETTINGS_UPDATE')], ['USER_GUILD_SETTINGS_UPDATE', require('./USER_GUILD_SETTINGS_UPDATE')], + ['VOICE_CHANNEL_STATUS_UPDATE', require('./VOICE_CHANNEL_STATUS_UPDATE')], ]); module.exports = handlers; diff --git a/src/structures/BaseGuildVoiceChannel.js b/src/structures/BaseGuildVoiceChannel.js index d653e7a..f48f0de 100644 --- a/src/structures/BaseGuildVoiceChannel.js +++ b/src/structures/BaseGuildVoiceChannel.js @@ -90,6 +90,14 @@ class BaseGuildVoiceChannel extends GuildChannel { if ('nsfw' in data) { this.nsfw = data.nsfw; } + + if ('status' in data) { + /** + * The status of the voice channel (max 500 characters) + * @type {?string} + */ + this.status = data.status; + } } /**