From aa35e21b8433213d7fadb9752eaa1dc4117ea38d Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Sat, 29 Apr 2017 20:00:36 -0400 Subject: [PATCH] Revert "Make MessageMentions#channels return an empty collection in DMs (#1430)" This reverts commit 88aa9473760e723209b6ff248f06ba683dad14b4. --- src/structures/MessageMentions.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/structures/MessageMentions.js b/src/structures/MessageMentions.js index 3206ce2a5..a2c979763 100644 --- a/src/structures/MessageMentions.js +++ b/src/structures/MessageMentions.js @@ -94,14 +94,14 @@ class MessageMentions { } /** - * Any channels that were mentioned (only populated in {@link TextChannel}s) - * @type {Collection} + * Any channels that were mentioned (only in {@link TextChannel}s) + * @type {?Collection} * @readonly */ get channels() { if (this._channels) return this._channels; + if (!this._guild) return null; this._channels = new Collection(); - if (!this._guild) return this._channels; let matches; while ((matches = this.constructor.CHANNELS_PATTERN.exec(this._content)) !== null) { const chan = this._guild.channels.get(matches[1]);