From c940aa8d3e71aa2ec955725d7402ebdbbd2412e7 Mon Sep 17 00:00:00 2001
From: loicbersier <loic.bersier1@gmail.com>
Date: Mon, 12 Aug 2019 14:08:06 +0200
Subject: [PATCH] reload the json

---
 commands/fun/fakebot.js | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/commands/fun/fakebot.js b/commands/fun/fakebot.js
index 932bc52..9fd3208 100644
--- a/commands/fun/fakebot.js
+++ b/commands/fun/fakebot.js
@@ -1,5 +1,6 @@
 const { Command } = require('discord-akairo');
 const fs = require('fs');
+const reload = require('auto-reload');
 
 class fakebotCommand extends Command {
 	constructor() {
@@ -44,7 +45,7 @@ class fakebotCommand extends Command {
 					});
 				});
 		} else {
-			let webhook = require(`../../webhook/${message.guild.id}.json`);
+			let webhook = reload(`../../webhook/${message.guild.id}.json`);
 			this.client.fetchWebhook(webhook.id, webhook.token)
 				.then(webhook => {
 					webhook.edit({
@@ -52,11 +53,6 @@ class fakebotCommand extends Command {
 						avatar: args.member.displayAvatarURL()
 					});
 
-					webhook.edit({
-						name: args.member.username,
-						avatar: args.member.displayAvatarURL()
-					});
-					
 					message.delete();
 					return webhook.send(args.message);
 				});