const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if (msg.author.bot) return;
resend(msg);
function resend(msg){
let words = ['#qwerty', 'asdf'];
let author = msg.author.id;
let content = msg.content;
let chan = msg.channel;
let wordsStr = words.join('|');
let regex = new RegExp('('+wordsStr+')', 'g');
if(msg.content.match(regex)){
content = content.replace(regex, '' );
msg.delete().then(() => {
chan.send( new Discord.RichEmbed()
.setDescription(content)
.setColor(0x4cff00)
);
}).catch((e) => {console.error(e);});
}
}
});
//client.login('token');
client.login('NDQ0MjY5OTgklVz107oc7oEEcgM');
Quiero añadirle que si en el mensaje principal aparezca esta url https://t.co/4234jhg2 la cambie por esta https://hola.es/