From 5a6119bc42ff67b7ec09aee5c5b65d39c6348286 Mon Sep 17 00:00:00 2001
From: Supositware <sup@libtar.de>
Date: Thu, 24 Nov 2022 21:11:24 +0100
Subject: [PATCH] use the nickname of the member and don't send the status
 reply on messages

---
 commands/fun/fakeuser.js | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/commands/fun/fakeuser.js b/commands/fun/fakeuser.js
index 160a467c..0f68da5f 100644
--- a/commands/fun/fakeuser.js
+++ b/commands/fun/fakeuser.js
@@ -24,9 +24,10 @@ export default {
 		const member = args.user;
 		const message = args.message;
 		const attachment = args.image;
+		const username = member.nickname ? member.nickname : member.user.username;
 
 		const webhook = await interaction.channel.createWebhook({
-			name: member.user.username,
+			name: username,
 			avatar: member.user.displayAvatarURL(),
 			reason: `Fakebot/user command triggered by: ${interaction.user.username}`,
 		});
@@ -37,6 +38,12 @@ export default {
 			await webhook.send({ content: message });
 		}
 		await webhook.delete(`Fakebot/user command triggered by: ${interaction.user.username}`);
-		await interaction.editReply({ content: `Faked the user ${member}` });
+		if (interaction.isMessage) {
+			await interaction.delete();
+			await interaction.deleteReply();
+		}
+		else {
+			await interaction.editReply({ content: `Faked the user ${member}` });
+		}
 	},
 };