forked from Supositware/Haha-Yes
work too when message isint passed
This commit is contained in:
parent
126a5e3318
commit
e42edb1048
1 changed files with 5 additions and 3 deletions
8
rand.js
8
rand.js
|
@ -18,10 +18,12 @@ exports.random = function (text, message) {
|
|||
});
|
||||
|
||||
do {
|
||||
text = text.replace(/\[member\]/g, message.guild.members.random().user.username);
|
||||
text = text.replace(/\[memberRand\]/, message.guild.members.random().user.username);
|
||||
if (message) {
|
||||
text = text.replace(/\[author\]/, message.author.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\]/, ' ');
|
||||
text = text.replace(/\[delete\]/, ' ');
|
||||
|
|
Loading…
Reference in a new issue