From 1240618d554bed196f89c7591ea67a077717bb0c Mon Sep 17 00:00:00 2001 From: Lamp Date: Sun, 8 Mar 2020 22:49:31 -0700 Subject: [PATCH] fix clyde in webhook url --- src/misc.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/misc.js b/src/misc.js index e843935..4bda596 100755 --- a/src/misc.js +++ b/src/misc.js @@ -2,10 +2,12 @@ (async function(){ var webhook = new Discord.WebhookClient(config.webhooks.welcome[0], config.webhooks.welcome[1]); dClient.on('local_guildMemberAdd', async member => { - webhook.send(`${member} joined.`, {username: member.user.username, avatarURL: member.user.displayAvatarURL({format:'png',size:2048}), disableEveryone:true}); + let username = member.user.username.toLowerCase().includes('clyde') ? member.user.username.replace(/C/g,'Q').replace(/c/g,'q') : member.user.username; + webhook.send(`${member} joined.`, {username, avatarURL: member.user.displayAvatarURL({format:'png',size:2048}), disableEveryone:true}); }); dClient.on('local_guildMemberRemove', async member => { - webhook.send(`${member.user.tag} left.`, {username: member.user.username, avatarURL: member.user.displayAvatarURL({format:'png',size:2048}), disableEveryone:true}); + let username = member.user.username.toLowerCase().includes('clyde') ? member.user.username.replace(/C/g,'Q').replace(/c/g,'q') : member.user.username; + webhook.send(`${member.user.tag} left.`, {username, avatarURL: member.user.displayAvatarURL({format:'png',size:2048}), disableEveryone:true}); }); })();