Skip to content

Commit

Permalink
Check for content in Message#channelMentions (abalabahaha#1159)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsian03 authored Apr 2, 2021
1 parent 7b08976 commit 9ec347a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/structures/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,11 @@ class Message extends Base {
return this._channelMentions;
}

return (this._channelMentions = (this.content.match(/<#[0-9]+>/g) || []).map((mention) => mention.substring(2, mention.length - 1)));
return (this._channelMentions = (this.content && this.content.match(/<#[0-9]+>/g) || []).map((mention) => mention.substring(2, mention.length - 1)));
}

get cleanContent() {
let cleanContent = this.content.replace(/<a?(:\w+:)[0-9]+>/g, "$1");
let cleanContent = this.content && this.content.replace(/<a?(:\w+:)[0-9]+>/g, "$1") || "";

let authorName = this.author.username;
if(this.channel.guild) {
Expand Down

0 comments on commit 9ec347a

Please sign in to comment.