From 93e1b493a31ac9a27e66a6f7603d8832eeca8e48 Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Thu, 12 Jan 2023 23:51:46 -0500 Subject: [PATCH] Adding DiscordID lookup --- bot.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bot.js b/bot.js index 7668be8..ab65965 100644 --- a/bot.js +++ b/bot.js @@ -149,7 +149,21 @@ client.on('messageCreate', msg => { } else { - client.channels.fetch(channel_id).then(channel => channel.send(data.toString())) + if (data.toString().includes(">")) return + if (!data.toString().startsWith("annon")){ + let split = data.toString().split(":") + console.log(split[0]) + let dUser = client.users.fetch(split[0]); + dUser.then(function (result) { + console.log(split) + client.channels.fetch(channel_id).then(channel => channel.send(`${result.username}: ${split[1]}`)) + + }); + } else { + client.channels.fetch(channel_id).then(channel => channel.send(data.toString())) + + } + } }); });