mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
deprecate Guild#defaultChannel (#1752)
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
const util = require('util');
|
||||||
const Long = require('long');
|
const Long = require('long');
|
||||||
const User = require('./User');
|
const User = require('./User');
|
||||||
const Role = require('./Role');
|
const Role = require('./Role');
|
||||||
@@ -291,15 +292,6 @@ class Guild {
|
|||||||
return this.client.voice.connections.get(this.id) || null;
|
return this.client.voice.connections.get(this.id) || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The `#general` TextChannel of the guild
|
|
||||||
* @type {TextChannel}
|
|
||||||
* @readonly
|
|
||||||
*/
|
|
||||||
get defaultChannel() {
|
|
||||||
return this.channels.get(this.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The position of this guild
|
* The position of this guild
|
||||||
* <warn>This is only available when using a user account.</warn>
|
* <warn>This is only available when using a user account.</warn>
|
||||||
@@ -1093,4 +1085,16 @@ class Guild {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The `#general` TextChannel of the guild
|
||||||
|
* @name Guild#defaultChannel
|
||||||
|
* @type {TextChannel}
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
|
Object.defineProperty(Guild.prototype, 'defaultChannel', {
|
||||||
|
get: util.deprecate(function defaultChannel() {
|
||||||
|
return this.channels.get(this.id);
|
||||||
|
}, 'Guild#defaultChannel: This property is obsolete, will be removed in v12.0.0, and may not function as expected.'),
|
||||||
|
});
|
||||||
|
|
||||||
module.exports = Guild;
|
module.exports = Guild;
|
||||||
|
|||||||
Reference in New Issue
Block a user