"clean" substring, removes prefix and callers

This commit is contained in:
Erik 2020-09-17 20:41:44 +03:00
parent 70e69e5882
commit 08c652eb8e

View File

@ -198,6 +198,13 @@ const Message = Structures.extend('Message', (Message) => {
: this.author.prefix;
}
get _clean() {
if (!this.command) return this.cleanContent;
let str = this.content.replace(new RegExp(`^(${this.prefix}|<@!?${this.client.id}>)`, 'iu'), '').replace(this._caller, '');
if (this._settingCaller) str = str.replace(this._settingCaller, '');
return str.trim();
}
}
return ExtendedMessage;