mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
refactor: Remove VoiceChannel#editable (#7291)
This commit is contained in:
@@ -1,35 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
const process = require('node:process');
|
||||
const BaseGuildVoiceChannel = require('./BaseGuildVoiceChannel');
|
||||
const Permissions = require('../util/Permissions');
|
||||
|
||||
let deprecationEmittedForEditable = false;
|
||||
|
||||
/**
|
||||
* Represents a guild voice channel on Discord.
|
||||
* @extends {BaseGuildVoiceChannel}
|
||||
*/
|
||||
class VoiceChannel extends BaseGuildVoiceChannel {
|
||||
/**
|
||||
* Whether the channel is editable by the client user
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
* @deprecated Use {@link VoiceChannel#manageable} instead
|
||||
*/
|
||||
get editable() {
|
||||
if (!deprecationEmittedForEditable) {
|
||||
process.emitWarning(
|
||||
'The VoiceChannel#editable getter is deprecated. Use VoiceChannel#manageable instead.',
|
||||
'DeprecationWarning',
|
||||
);
|
||||
|
||||
deprecationEmittedForEditable = true;
|
||||
}
|
||||
|
||||
return this.manageable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the channel is joinable by the client user
|
||||
* @type {boolean}
|
||||
|
||||
2
packages/discord.js/typings/index.d.ts
vendored
2
packages/discord.js/typings/index.d.ts
vendored
@@ -2398,8 +2398,6 @@ export class Formatters extends null {
|
||||
}
|
||||
|
||||
export class VoiceChannel extends BaseGuildVoiceChannel {
|
||||
/** @deprecated Use manageable instead */
|
||||
public readonly editable: boolean;
|
||||
public readonly speakable: boolean;
|
||||
public type: 'GuildVoice';
|
||||
public setBitrate(bitrate: number, reason?: string): Promise<VoiceChannel>;
|
||||
|
||||
Reference in New Issue
Block a user