Optimise everyone/here replacing

This commit is contained in:
Schuyler Cebulskie
2016-10-25 19:01:56 -04:00
parent 526430b51a
commit c96d5ad30e
2 changed files with 2 additions and 3 deletions

View File

@@ -236,8 +236,7 @@ class Message {
*/
get cleanContent() {
return this.content
.replace(/@everyone/g, '@\u200Beveryone')
.replace(/@here/g, '@\u200Bhere')
.replace(/@(everyone|here)/g, '@\u200b$1')
.replace(/<@!?[0-9]+>/g, (input) => {
const id = input.replace(/<|!|>|@/g, '');
if (this.channel.type === 'dm' || this.channel.type === 'group') {