mirror of
https://github.com/danbulant/discord.js
synced 2026-06-19 14:41:36 +00:00
deprecate Guild#defaultChannel (#1752)
This commit is contained in:
parent
59122a6ba4
commit
407500bf52
2 changed files with 14 additions and 9 deletions
1
.npmrc
Normal file
1
.npmrc
Normal file
|
|
@ -0,0 +1 @@
|
|||
package-json=false
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
const util = require('util');
|
||||
const Long = require('long');
|
||||
const User = require('./User');
|
||||
const Role = require('./Role');
|
||||
|
|
@ -291,15 +292,6 @@ class Guild {
|
|||
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
|
||||
* <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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue