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,10 +19,12 @@ exports.random = function (text, message) {
do { do {
if (message) { if (message) {
if (message.member) {
text = text.replace(/\[author\]/, message.author.username); text = text.replace(/\[author\]/, message.author.username);
text = text.replace(/\[member\]/g, 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(/\[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\]/, ' ');
text = text.replace(/\[ban\]/, ' '); text = text.replace(/\[ban\]/, ' ');