Skip to content

Commit

Permalink
deprecate Guild#defaultChannel (#1752)
Browse files Browse the repository at this point in the history
  • Loading branch information
devsnek authored and iCrawl committed Aug 4, 2017
1 parent 59122a6 commit 407500b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions .npmrc
@@ -0,0 +1 @@
package-json=false
22 changes: 13 additions & 9 deletions src/structures/Guild.js
@@ -1,3 +1,4 @@
const util = require('util');
const Long = require('long');
const User = require('./User');
const Role = require('./Role');
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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;

0 comments on commit 407500b

Please sign in to comment.