message member on if

This commit is contained in:
loicbersier 2020-03-29 15:38:23 +02:00
parent 1aa341e0f1
commit fe75450309

View file

@ -19,9 +19,11 @@ exports.random = function (text, message) {
do { do {
if (message) { if (message) {
text = text.replace(/\[author\]/, message.author.username); if (message.member) {
text = text.replace(/\[member\]/g, message.guild.members.cache.random().user.username); text = text.replace(/\[author\]/, message.author.username);
text = text.replace(/\[memberRand\]/, message.guild.members.cache.random().user.username); text = text.replace(/\[member\]/g, message.guild.members.cache.random().user.username);
text = text.replace(/\[memberRand\]/, message.guild.members.cache.random().user.username);
}
} }
text = text.replace(/\[number\]/, Math.floor((Math.random() * 9) + 1)); text = text.replace(/\[number\]/, Math.floor((Math.random() * 9) + 1));
text = text.replace(/\[kick\]/, ' '); text = text.replace(/\[kick\]/, ' ');