From 88aa9473760e723209b6ff248f06ba683dad14b4 Mon Sep 17 00:00:00 2001 From: SpaceEEC Date: Sat, 29 Apr 2017 15:33:18 +0200 Subject: [PATCH] Make MessageMentions#channels return an empty collection in DMs (#1430) * Make MessageMentions#channels return an empty collection in DMs * reduce code duplication and corrected docstring --- 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 a2c979763..3206ce2a5 100644 --- a/src/structures/MessageMentions.js +++ b/src/structures/MessageMentions.js @@ -94,14 +94,14 @@ class MessageMentions { } /** - * Any channels that were mentioned (only in {@link TextChannel}s) - * @type {?Collection} + * Any channels that were mentioned (only populated 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]);