forked from Galactic/galactic-bot
"clean" substring, removes prefix and callers
This commit is contained in:
parent
70e69e5882
commit
08c652eb8e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user