From 30a7b3729aa2618b073e245417f25f8cd8a4adb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Sat, 9 Feb 2019 00:25:33 +0000 Subject: [PATCH] =?UTF-8?q?Mettre=20=C3=A0=20jour=20rand.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rand.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rand.js b/rand.js index 1607aca..9492540 100644 --- a/rand.js +++ b/rand.js @@ -42,13 +42,14 @@ exports.random = function (text, message) { text = text.replace(/\[state\]/, states[randNumber(states)]); text = text.replace(/\[title\]/, titles[randNumber(titles)]); text = text.replace(/\[unit\]/, units[randNumber(units)]); - text = text.replace(/\[member\]/, message.guild.members.random().user.username); + text = text.replace(/\[member\]/g, message.guild.members.random().user.username); + text = text.replace(/\[memberRand\]/, message.guild.members.random().user.username); text = text.replace(/\[number\]/, Math.floor((Math.random() * 9) + 1)); text = text.replace(/\[author\]/, message.author.username); text = text.replace(/\[kick\]/, ' '); text = text.replace(/\[ban\]/, ' '); // Verify if it replaced everything - } while( text.includes('[verb]') || text.includes('[adverbs]') || text.includes('[noun]') || text.includes('[adjective]') || text.includes('[member]') || text.includes('[number]') || text.includes('[activities]') || text.includes('[celebrities]') || text.includes('[countries]') || text.includes('[diseases]') || text.includes('[elements]') || text.includes('[hobbies]') || text.includes('[music]') || text.includes('[prefixes]') || text.includes('[pronoun]') || text.includes('[state]') || text.includes('[title]') || text.includes('[unit]') || text.includes('[author]') || text.includes('[kick]') || text.includes('[ban]')); + } while( text.includes('[verb]') || text.includes('[adverbs]') || text.includes('[noun]') || text.includes('[adjective]') || text.includes('[member]') || text.includes('[memberRand]') || text.includes('[number]') || text.includes('[activities]') || text.includes('[celebrities]') || text.includes('[countries]') || text.includes('[diseases]') || text.includes('[elements]') || text.includes('[hobbies]') || text.includes('[music]') || text.includes('[prefixes]') || text.includes('[pronoun]') || text.includes('[state]') || text.includes('[title]') || text.includes('[unit]') || text.includes('[author]') || text.includes('[kick]') || text.includes('[ban]')); return text; }; \ No newline at end of file