mirror of
https://github.com/danbulant/discord.js
synced 2026-06-06 16:22:08 +00:00
Optimise everyone/here replacing
This commit is contained in:
parent
526430b51a
commit
c96d5ad30e
2 changed files with 2 additions and 3 deletions
|
|
@ -59,7 +59,7 @@ class RESTMethods {
|
||||||
|
|
||||||
if (content) {
|
if (content) {
|
||||||
if (disableEveryone || (typeof disableEveryone === 'undefined' && this.rest.client.options.disableEveryone)) {
|
if (disableEveryone || (typeof disableEveryone === 'undefined' && this.rest.client.options.disableEveryone)) {
|
||||||
content = content.replace('@everyone', '@\u200beveryone').replace('@here', '@\u200bhere');
|
content = content.replace(/@(everyone|here)/g, '@\u200b$1');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (split) content = splitMessage(content, typeof split === 'object' ? split : {});
|
if (split) content = splitMessage(content, typeof split === 'object' ? split : {});
|
||||||
|
|
|
||||||
|
|
@ -236,8 +236,7 @@ class Message {
|
||||||
*/
|
*/
|
||||||
get cleanContent() {
|
get cleanContent() {
|
||||||
return this.content
|
return this.content
|
||||||
.replace(/@everyone/g, '@\u200Beveryone')
|
.replace(/@(everyone|here)/g, '@\u200b$1')
|
||||||
.replace(/@here/g, '@\u200Bhere')
|
|
||||||
.replace(/<@!?[0-9]+>/g, (input) => {
|
.replace(/<@!?[0-9]+>/g, (input) => {
|
||||||
const id = input.replace(/<|!|>|@/g, '');
|
const id = input.replace(/<|!|>|@/g, '');
|
||||||
if (this.channel.type === 'dm' || this.channel.type === 'group') {
|
if (this.channel.type === 'dm' || this.channel.type === 'group') {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue