feat: VoiceChannel Status

This commit is contained in:
Elysia 2024-01-26 20:26:39 +07:00
parent c257659c99
commit 5962c59684
3 changed files with 21 additions and 0 deletions

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

View File

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

View File

@ -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;
}
}
/**