deprecate Guild#defaultChannel (#1752)

This commit is contained in:
Gus Caplan
2017-08-04 03:44:35 -05:00
committed by Crawl
parent 59122a6ba4
commit 407500bf52
2 changed files with 14 additions and 9 deletions

1
.npmrc Normal file
View File

@@ -0,0 +1 @@
package-json=false

View File

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